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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3811f7072e0d416a04c342ff6cfaec05deda3619 | setup.py | setup.py | from setuptools import setup
setup(
name="livejson",
version="0.1",
description="Bind Python objects to JSON files",
long_description=("An interface to transparantly bind Python objects to"
"JSON files so that all changes made to the object are"
"reflected in... | from setuptools import setup
setup(
name="livejson",
version="0.1",
description="Bind Python objects to JSON files",
long_description=("An interface to transparantly bind Python objects to"
"JSON files so that all changes made to the object are"
"reflected in... | Change URL to point to GitHub | Change URL to point to GitHub
| Python | mit | controversial/livejson | from setuptools import setup
setup(
name="livejson",
version="0.1",
description="Bind Python objects to JSON files",
long_description=("An interface to transparantly bind Python objects to"
"JSON files so that all changes made to the object are"
"reflected in... | from setuptools import setup
setup(
name="livejson",
version="0.1",
description="Bind Python objects to JSON files",
long_description=("An interface to transparantly bind Python objects to"
"JSON files so that all changes made to the object are"
"reflected in... | <commit_before>from setuptools import setup
setup(
name="livejson",
version="0.1",
description="Bind Python objects to JSON files",
long_description=("An interface to transparantly bind Python objects to"
"JSON files so that all changes made to the object are"
... | from setuptools import setup
setup(
name="livejson",
version="0.1",
description="Bind Python objects to JSON files",
long_description=("An interface to transparantly bind Python objects to"
"JSON files so that all changes made to the object are"
"reflected in... | from setuptools import setup
setup(
name="livejson",
version="0.1",
description="Bind Python objects to JSON files",
long_description=("An interface to transparantly bind Python objects to"
"JSON files so that all changes made to the object are"
"reflected in... | <commit_before>from setuptools import setup
setup(
name="livejson",
version="0.1",
description="Bind Python objects to JSON files",
long_description=("An interface to transparantly bind Python objects to"
"JSON files so that all changes made to the object are"
... |
673dea4b1415b32adb4eb9cc38c6cfa0f5076f93 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from setuptools import setup
from setuptools.command.test import test as TestCommand
import io
import os
import sys
import pambox
here = os.path.abspath(os.path.dirname(__file__))
def read(*filenames, **kwargs):
encoding = kwar... | Add basic, and probably incomplete setyp.py. | Add basic, and probably incomplete setyp.py.
| Python | bsd-3-clause | achabotl/pambox | Add basic, and probably incomplete setyp.py. | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from setuptools import setup
from setuptools.command.test import test as TestCommand
import io
import os
import sys
import pambox
here = os.path.abspath(os.path.dirname(__file__))
def read(*filenames, **kwargs):
encoding = kwar... | <commit_before><commit_msg>Add basic, and probably incomplete setyp.py.<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from setuptools import setup
from setuptools.command.test import test as TestCommand
import io
import os
import sys
import pambox
here = os.path.abspath(os.path.dirname(__file__))
def read(*filenames, **kwargs):
encoding = kwar... | Add basic, and probably incomplete setyp.py.#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from setuptools import setup
from setuptools.command.test import test as TestCommand
import io
import os
import sys
import pambox
here = os.path.abspath(os.path.dirname(__file__))
def rea... | <commit_before><commit_msg>Add basic, and probably incomplete setyp.py.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from setuptools import setup
from setuptools.command.test import test as TestCommand
import io
import os
import sys
import pambox
here = os.path.abs... | |
4a43bc36f0f3a413b222f2cb1fac316240168aa2 | LPC.py | LPC.py | # -*- coding: utf-8 -*-
"""
Created on Sat Feb 27 22:01:37 2016
@author: ORCHISAMA
"""
#calculate LPC coefficients from sound file
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
def autocorr(x):
n = len(x)
variance = np.var(x)
x = x - np.mean(x)
r = np.correlate(x... | Add program to calculate Linear Prediction Coefficients | Add program to calculate Linear Prediction Coefficients
| Python | mit | orchidas/Speaker-Recognition | Add program to calculate Linear Prediction Coefficients | # -*- coding: utf-8 -*-
"""
Created on Sat Feb 27 22:01:37 2016
@author: ORCHISAMA
"""
#calculate LPC coefficients from sound file
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
def autocorr(x):
n = len(x)
variance = np.var(x)
x = x - np.mean(x)
r = np.correlate(x... | <commit_before><commit_msg>Add program to calculate Linear Prediction Coefficients<commit_after> | # -*- coding: utf-8 -*-
"""
Created on Sat Feb 27 22:01:37 2016
@author: ORCHISAMA
"""
#calculate LPC coefficients from sound file
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
def autocorr(x):
n = len(x)
variance = np.var(x)
x = x - np.mean(x)
r = np.correlate(x... | Add program to calculate Linear Prediction Coefficients# -*- coding: utf-8 -*-
"""
Created on Sat Feb 27 22:01:37 2016
@author: ORCHISAMA
"""
#calculate LPC coefficients from sound file
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
def autocorr(x):
n = len(x)
variance = ... | <commit_before><commit_msg>Add program to calculate Linear Prediction Coefficients<commit_after># -*- coding: utf-8 -*-
"""
Created on Sat Feb 27 22:01:37 2016
@author: ORCHISAMA
"""
#calculate LPC coefficients from sound file
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
def au... | |
512abbbda1fe249ef59b8a416c7c92b195940f27 | analysis/__init__.py | analysis/__init__.py | import os
import retrying
import sys
from .. import BaseAction
from .. import experiments
from ..helpers import get_first_existing_path, get_multiprint, save_pickle_gz
class Analysis(BaseAction):
DEFAULT_RESULTS_ROOT = os.path.join('output', 'analysis')
def _setup(self, config, status):
conf... | Add Analysis and InPlaceAnalysis base classes for analyzing experiment results. | Add Analysis and InPlaceAnalysis base classes for analyzing experiment results.
| Python | mit | tsoontornwutikul/mlxm | Add Analysis and InPlaceAnalysis base classes for analyzing experiment results. | import os
import retrying
import sys
from .. import BaseAction
from .. import experiments
from ..helpers import get_first_existing_path, get_multiprint, save_pickle_gz
class Analysis(BaseAction):
DEFAULT_RESULTS_ROOT = os.path.join('output', 'analysis')
def _setup(self, config, status):
conf... | <commit_before><commit_msg>Add Analysis and InPlaceAnalysis base classes for analyzing experiment results.<commit_after> | import os
import retrying
import sys
from .. import BaseAction
from .. import experiments
from ..helpers import get_first_existing_path, get_multiprint, save_pickle_gz
class Analysis(BaseAction):
DEFAULT_RESULTS_ROOT = os.path.join('output', 'analysis')
def _setup(self, config, status):
conf... | Add Analysis and InPlaceAnalysis base classes for analyzing experiment results.import os
import retrying
import sys
from .. import BaseAction
from .. import experiments
from ..helpers import get_first_existing_path, get_multiprint, save_pickle_gz
class Analysis(BaseAction):
DEFAULT_RESULTS_ROOT = os.path.join('ou... | <commit_before><commit_msg>Add Analysis and InPlaceAnalysis base classes for analyzing experiment results.<commit_after>import os
import retrying
import sys
from .. import BaseAction
from .. import experiments
from ..helpers import get_first_existing_path, get_multiprint, save_pickle_gz
class Analysis(BaseAction):
... | |
53be0ba69200c907c8172e255aab84beb19506fb | pitchfork/template_filters.py | pitchfork/template_filters.py |
import re
import json
def nl2br(value):
if value:
_newline_re = re.compile(r'(?:\r\n|\r|\n)')
return _newline_re.sub('<br>', value)
def tab2spaces(value):
if value:
text = re.sub('\t', ' ' * 4, value)
return text
def unslug(value):
text = re.sub('_', ' ', value)
... | Move template filters out of init file | Move template filters out of init file
| Python | apache-2.0 | oldarmyc/pitchfork,rackerlabs/pitchfork,oldarmyc/pitchfork,oldarmyc/pitchfork,rackerlabs/pitchfork,rackerlabs/pitchfork | Move template filters out of init file |
import re
import json
def nl2br(value):
if value:
_newline_re = re.compile(r'(?:\r\n|\r|\n)')
return _newline_re.sub('<br>', value)
def tab2spaces(value):
if value:
text = re.sub('\t', ' ' * 4, value)
return text
def unslug(value):
text = re.sub('_', ' ', value)
... | <commit_before><commit_msg>Move template filters out of init file<commit_after> |
import re
import json
def nl2br(value):
if value:
_newline_re = re.compile(r'(?:\r\n|\r|\n)')
return _newline_re.sub('<br>', value)
def tab2spaces(value):
if value:
text = re.sub('\t', ' ' * 4, value)
return text
def unslug(value):
text = re.sub('_', ' ', value)
... | Move template filters out of init file
import re
import json
def nl2br(value):
if value:
_newline_re = re.compile(r'(?:\r\n|\r|\n)')
return _newline_re.sub('<br>', value)
def tab2spaces(value):
if value:
text = re.sub('\t', ' ' * 4, value)
return text
def unslug(value)... | <commit_before><commit_msg>Move template filters out of init file<commit_after>
import re
import json
def nl2br(value):
if value:
_newline_re = re.compile(r'(?:\r\n|\r|\n)')
return _newline_re.sub('<br>', value)
def tab2spaces(value):
if value:
text = re.sub('\t', ' ' * 4, value... | |
2e97821b1d1a7f30a73010843e19ad66780a0522 | sword/submitOnZenodo.py | sword/submitOnZenodo.py | import json
import requests
from os.path import basename
from dissemin.settings import ZENODO_KEY
#THIS IS PRIVATE
#url = "https://zenodo.org/api/deposit/depositions/1234/files?access_token=2SsQE9VkkgDQG1WDjrvrZqTJtkmsGHICEaccBY6iAEuBlSTdMC6QvcTR2HRv"
#TODO error handling
def submitPubli(paper,filePdf):
r = req... | Add tracking of zenodo file, put the secret key in the secret place. | Add tracking of zenodo file, put the secret key in the secret place.
| Python | agpl-3.0 | dissemin/dissemin,Lysxia/dissemin,Lysxia/dissemin,dissemin/dissemin,Lysxia/dissemin,wetneb/dissemin,dissemin/dissemin,Lysxia/dissemin,wetneb/dissemin,dissemin/dissemin,wetneb/dissemin,wetneb/dissemin,dissemin/dissemin | Add tracking of zenodo file, put the secret key in the secret place. | import json
import requests
from os.path import basename
from dissemin.settings import ZENODO_KEY
#THIS IS PRIVATE
#url = "https://zenodo.org/api/deposit/depositions/1234/files?access_token=2SsQE9VkkgDQG1WDjrvrZqTJtkmsGHICEaccBY6iAEuBlSTdMC6QvcTR2HRv"
#TODO error handling
def submitPubli(paper,filePdf):
r = req... | <commit_before><commit_msg>Add tracking of zenodo file, put the secret key in the secret place.<commit_after> | import json
import requests
from os.path import basename
from dissemin.settings import ZENODO_KEY
#THIS IS PRIVATE
#url = "https://zenodo.org/api/deposit/depositions/1234/files?access_token=2SsQE9VkkgDQG1WDjrvrZqTJtkmsGHICEaccBY6iAEuBlSTdMC6QvcTR2HRv"
#TODO error handling
def submitPubli(paper,filePdf):
r = req... | Add tracking of zenodo file, put the secret key in the secret place.import json
import requests
from os.path import basename
from dissemin.settings import ZENODO_KEY
#THIS IS PRIVATE
#url = "https://zenodo.org/api/deposit/depositions/1234/files?access_token=2SsQE9VkkgDQG1WDjrvrZqTJtkmsGHICEaccBY6iAEuBlSTdMC6QvcTR2HR... | <commit_before><commit_msg>Add tracking of zenodo file, put the secret key in the secret place.<commit_after>import json
import requests
from os.path import basename
from dissemin.settings import ZENODO_KEY
#THIS IS PRIVATE
#url = "https://zenodo.org/api/deposit/depositions/1234/files?access_token=2SsQE9VkkgDQG1WDjr... | |
dd129aa3bb7d2115294a091a347648c423480b6e | Python/check_n_double_n.py | Python/check_n_double_n.py | # https://leetcode.com/problems/check-if-n-and-its-double-exist/
# Given an array arr of integers, check if there exists two integers N and M such that
# N is the double of M ( i.e. N = 2 * M).
# More formally check if there exists two indices i and j such that :
# i != j
# 0 <= i, j < arr.length
# arr[i] == 2 * arr[j... | Check if n and double of n exists | Check if n and double of n exists
| Python | mit | anu-ka/coding-problems,anu-ka/coding-problems,anu-ka/coding-problems | Check if n and double of n exists | # https://leetcode.com/problems/check-if-n-and-its-double-exist/
# Given an array arr of integers, check if there exists two integers N and M such that
# N is the double of M ( i.e. N = 2 * M).
# More formally check if there exists two indices i and j such that :
# i != j
# 0 <= i, j < arr.length
# arr[i] == 2 * arr[j... | <commit_before><commit_msg>Check if n and double of n exists<commit_after> | # https://leetcode.com/problems/check-if-n-and-its-double-exist/
# Given an array arr of integers, check if there exists two integers N and M such that
# N is the double of M ( i.e. N = 2 * M).
# More formally check if there exists two indices i and j such that :
# i != j
# 0 <= i, j < arr.length
# arr[i] == 2 * arr[j... | Check if n and double of n exists# https://leetcode.com/problems/check-if-n-and-its-double-exist/
# Given an array arr of integers, check if there exists two integers N and M such that
# N is the double of M ( i.e. N = 2 * M).
# More formally check if there exists two indices i and j such that :
# i != j
# 0 <= i, j <... | <commit_before><commit_msg>Check if n and double of n exists<commit_after># https://leetcode.com/problems/check-if-n-and-its-double-exist/
# Given an array arr of integers, check if there exists two integers N and M such that
# N is the double of M ( i.e. N = 2 * M).
# More formally check if there exists two indices i ... | |
3b2b72436459dcf58ab07466d5a2ed0425b17962 | algorithms/diagonal_difference/kevin.py | algorithms/diagonal_difference/kevin.py | #!/usr/bin/env python
from typing import List
def get_matrix_row_from_input() -> List[int]:
return [int(index) for index in input().strip().split(' ')]
n = int(input().strip())
primary_diag_sum = 0
secondary_diag_sum = 0
for row_count in range(n):
row = get_matrix_row_from_input()
primary_diag_sum += row... | Add Diagonal Difference HackerRank Problem | Add Diagonal Difference HackerRank Problem
* https://www.hackerrank.com/challenges/diagonal-difference
| Python | mit | PlattsSEC/HackerRank,PlattsSEC/HackerRank,PlattsSEC/HackerRank,PlattsSEC/HackerRank,PlattsSEC/HackerRank,PlattsSEC/HackerRank | Add Diagonal Difference HackerRank Problem
* https://www.hackerrank.com/challenges/diagonal-difference | #!/usr/bin/env python
from typing import List
def get_matrix_row_from_input() -> List[int]:
return [int(index) for index in input().strip().split(' ')]
n = int(input().strip())
primary_diag_sum = 0
secondary_diag_sum = 0
for row_count in range(n):
row = get_matrix_row_from_input()
primary_diag_sum += row... | <commit_before><commit_msg>Add Diagonal Difference HackerRank Problem
* https://www.hackerrank.com/challenges/diagonal-difference<commit_after> | #!/usr/bin/env python
from typing import List
def get_matrix_row_from_input() -> List[int]:
return [int(index) for index in input().strip().split(' ')]
n = int(input().strip())
primary_diag_sum = 0
secondary_diag_sum = 0
for row_count in range(n):
row = get_matrix_row_from_input()
primary_diag_sum += row... | Add Diagonal Difference HackerRank Problem
* https://www.hackerrank.com/challenges/diagonal-difference#!/usr/bin/env python
from typing import List
def get_matrix_row_from_input() -> List[int]:
return [int(index) for index in input().strip().split(' ')]
n = int(input().strip())
primary_diag_sum = 0
secondary_di... | <commit_before><commit_msg>Add Diagonal Difference HackerRank Problem
* https://www.hackerrank.com/challenges/diagonal-difference<commit_after>#!/usr/bin/env python
from typing import List
def get_matrix_row_from_input() -> List[int]:
return [int(index) for index in input().strip().split(' ')]
n = int(input().s... | |
19c652d9b5740e08219d1bc5688f663c7c7ab848 | test/test_emo_cls.py | test/test_emo_cls.py | #!/usr/bin/env python
# -*- encoding: utf-8
import unittest
from src.emo_cls import EmoClassifier
from src.ec_settings import POS, NEG, NO_CLASS
ec = EmoClassifier(terms_fn=None,
bigrams_fn=None,
trigrams_fn=None,
terms_by_root_form_fn=None,
... | Add tests for classify() method | Add tests for classify() method
| Python | mit | wojtekwalczak/EmoClassifier | Add tests for classify() method | #!/usr/bin/env python
# -*- encoding: utf-8
import unittest
from src.emo_cls import EmoClassifier
from src.ec_settings import POS, NEG, NO_CLASS
ec = EmoClassifier(terms_fn=None,
bigrams_fn=None,
trigrams_fn=None,
terms_by_root_form_fn=None,
... | <commit_before><commit_msg>Add tests for classify() method<commit_after> | #!/usr/bin/env python
# -*- encoding: utf-8
import unittest
from src.emo_cls import EmoClassifier
from src.ec_settings import POS, NEG, NO_CLASS
ec = EmoClassifier(terms_fn=None,
bigrams_fn=None,
trigrams_fn=None,
terms_by_root_form_fn=None,
... | Add tests for classify() method#!/usr/bin/env python
# -*- encoding: utf-8
import unittest
from src.emo_cls import EmoClassifier
from src.ec_settings import POS, NEG, NO_CLASS
ec = EmoClassifier(terms_fn=None,
bigrams_fn=None,
trigrams_fn=None,
terms_by_root_fo... | <commit_before><commit_msg>Add tests for classify() method<commit_after>#!/usr/bin/env python
# -*- encoding: utf-8
import unittest
from src.emo_cls import EmoClassifier
from src.ec_settings import POS, NEG, NO_CLASS
ec = EmoClassifier(terms_fn=None,
bigrams_fn=None,
trigrams_fn=... | |
f4fcb99cc9dec1cf68697520b959569e937dcd33 | tests/test_region.py | tests/test_region.py | from bioframe.region import parse_region
import pytest
def test_parse_region():
# UCSC-style names
assert parse_region("chr21") == ("chr21", 0, None)
assert parse_region("chr21:1000-2000") == ("chr21", 1000, 2000)
assert parse_region("chr21:1,000-2,000") == ("chr21", 1000, 2000)
# Ensembl style n... | Add tests to make CI happy | Add tests to make CI happy
| Python | mit | open2c/bioframe | Add tests to make CI happy | from bioframe.region import parse_region
import pytest
def test_parse_region():
# UCSC-style names
assert parse_region("chr21") == ("chr21", 0, None)
assert parse_region("chr21:1000-2000") == ("chr21", 1000, 2000)
assert parse_region("chr21:1,000-2,000") == ("chr21", 1000, 2000)
# Ensembl style n... | <commit_before><commit_msg>Add tests to make CI happy<commit_after> | from bioframe.region import parse_region
import pytest
def test_parse_region():
# UCSC-style names
assert parse_region("chr21") == ("chr21", 0, None)
assert parse_region("chr21:1000-2000") == ("chr21", 1000, 2000)
assert parse_region("chr21:1,000-2,000") == ("chr21", 1000, 2000)
# Ensembl style n... | Add tests to make CI happyfrom bioframe.region import parse_region
import pytest
def test_parse_region():
# UCSC-style names
assert parse_region("chr21") == ("chr21", 0, None)
assert parse_region("chr21:1000-2000") == ("chr21", 1000, 2000)
assert parse_region("chr21:1,000-2,000") == ("chr21", 1000, 20... | <commit_before><commit_msg>Add tests to make CI happy<commit_after>from bioframe.region import parse_region
import pytest
def test_parse_region():
# UCSC-style names
assert parse_region("chr21") == ("chr21", 0, None)
assert parse_region("chr21:1000-2000") == ("chr21", 1000, 2000)
assert parse_region("... | |
7c7d0701dddf54006ba87e3e785caab6e53bd68a | config.py | config.py | import os
class Config(object):
DEBUG = False
ASSETS_DEBUG = False
cache = False
manifest = True
SQLALCHEMY_COMMIT_ON_TEARDOWN = False
SQLALCHEMY_RECORD_QUERIES = True
SQLALCHEMY_DATABASE_URI = 'postgresql://localhost/notifications_admin'
MAX_FAILED_LOGIN_COUNT = 10
PASS_SECRET_KE... | import os
class Config(object):
DEBUG = False
ASSETS_DEBUG = False
cache = False
manifest = True
SQLALCHEMY_COMMIT_ON_TEARDOWN = False
SQLALCHEMY_RECORD_QUERIES = True
SQLALCHEMY_DATABASE_URI = 'postgresql://localhost/notifications_admin'
MAX_FAILED_LOGIN_COUNT = 10
PASS_SECRET_KE... | Use a dev api token | Use a dev api token
| Python | mit | alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin,gov-cjwaszczuk/notifications-admin,gov-cjwaszczuk/notifications-admin,gov-cjwaszczuk/notifications-admin,alphagov/notifications-admin,gov-cjwaszczuk/notifications-admin | import os
class Config(object):
DEBUG = False
ASSETS_DEBUG = False
cache = False
manifest = True
SQLALCHEMY_COMMIT_ON_TEARDOWN = False
SQLALCHEMY_RECORD_QUERIES = True
SQLALCHEMY_DATABASE_URI = 'postgresql://localhost/notifications_admin'
MAX_FAILED_LOGIN_COUNT = 10
PASS_SECRET_KE... | import os
class Config(object):
DEBUG = False
ASSETS_DEBUG = False
cache = False
manifest = True
SQLALCHEMY_COMMIT_ON_TEARDOWN = False
SQLALCHEMY_RECORD_QUERIES = True
SQLALCHEMY_DATABASE_URI = 'postgresql://localhost/notifications_admin'
MAX_FAILED_LOGIN_COUNT = 10
PASS_SECRET_KE... | <commit_before>import os
class Config(object):
DEBUG = False
ASSETS_DEBUG = False
cache = False
manifest = True
SQLALCHEMY_COMMIT_ON_TEARDOWN = False
SQLALCHEMY_RECORD_QUERIES = True
SQLALCHEMY_DATABASE_URI = 'postgresql://localhost/notifications_admin'
MAX_FAILED_LOGIN_COUNT = 10
... | import os
class Config(object):
DEBUG = False
ASSETS_DEBUG = False
cache = False
manifest = True
SQLALCHEMY_COMMIT_ON_TEARDOWN = False
SQLALCHEMY_RECORD_QUERIES = True
SQLALCHEMY_DATABASE_URI = 'postgresql://localhost/notifications_admin'
MAX_FAILED_LOGIN_COUNT = 10
PASS_SECRET_KE... | import os
class Config(object):
DEBUG = False
ASSETS_DEBUG = False
cache = False
manifest = True
SQLALCHEMY_COMMIT_ON_TEARDOWN = False
SQLALCHEMY_RECORD_QUERIES = True
SQLALCHEMY_DATABASE_URI = 'postgresql://localhost/notifications_admin'
MAX_FAILED_LOGIN_COUNT = 10
PASS_SECRET_KE... | <commit_before>import os
class Config(object):
DEBUG = False
ASSETS_DEBUG = False
cache = False
manifest = True
SQLALCHEMY_COMMIT_ON_TEARDOWN = False
SQLALCHEMY_RECORD_QUERIES = True
SQLALCHEMY_DATABASE_URI = 'postgresql://localhost/notifications_admin'
MAX_FAILED_LOGIN_COUNT = 10
... |
ed05b50ca560db868e760629de883695a787c0cd | tests/test_read_parsers.py | tests/test_read_parsers.py | # Tests for the ReadParser and Read classes.
import khmer
from khmer import ReadParser
import khmer_tst_utils as utils
def test_DEFAULT_ARGUMENTS( ):
read_names = [ ]
# Note: Using a data file where read names are just integers on [0,99).
rparser = ReadParser( utils.get_test_data( "random-20-a.fa" ... | Create test harness for 'Read' and 'ReadParser' classes. (Note: Need to finish writing tests.) | Create test harness for 'Read' and 'ReadParser' classes. (Note: Need to finish writing tests.)
| Python | bsd-3-clause | kdmurray91/khmer,ged-lab/khmer,jas14/khmer,Winterflower/khmer,Winterflower/khmer,F1000Research/khmer,kdmurray91/khmer,F1000Research/khmer,souravsingh/khmer,souravsingh/khmer,ged-lab/khmer,souravsingh/khmer,ged-lab/khmer,Winterflower/khmer,F1000Research/khmer,kdmurray91/khmer,jas14/khmer,jas14/khmer | Create test harness for 'Read' and 'ReadParser' classes. (Note: Need to finish writing tests.) | # Tests for the ReadParser and Read classes.
import khmer
from khmer import ReadParser
import khmer_tst_utils as utils
def test_DEFAULT_ARGUMENTS( ):
read_names = [ ]
# Note: Using a data file where read names are just integers on [0,99).
rparser = ReadParser( utils.get_test_data( "random-20-a.fa" ... | <commit_before><commit_msg>Create test harness for 'Read' and 'ReadParser' classes. (Note: Need to finish writing tests.)<commit_after> | # Tests for the ReadParser and Read classes.
import khmer
from khmer import ReadParser
import khmer_tst_utils as utils
def test_DEFAULT_ARGUMENTS( ):
read_names = [ ]
# Note: Using a data file where read names are just integers on [0,99).
rparser = ReadParser( utils.get_test_data( "random-20-a.fa" ... | Create test harness for 'Read' and 'ReadParser' classes. (Note: Need to finish writing tests.)# Tests for the ReadParser and Read classes.
import khmer
from khmer import ReadParser
import khmer_tst_utils as utils
def test_DEFAULT_ARGUMENTS( ):
read_names = [ ]
# Note: Using a data file where read names... | <commit_before><commit_msg>Create test harness for 'Read' and 'ReadParser' classes. (Note: Need to finish writing tests.)<commit_after># Tests for the ReadParser and Read classes.
import khmer
from khmer import ReadParser
import khmer_tst_utils as utils
def test_DEFAULT_ARGUMENTS( ):
read_names = [ ]
#... | |
511522f2e0d6399191d79e393ed6f14d3a843550 | range_ghost_test.py | range_ghost_test.py | from dtest import Tester
from tools import *
from assertions import *
import os, sys, time
from ccmlib.cluster import Cluster
class TestRangeGhosts(Tester):
def ghosts_test(self):
""" Check range ghost are correctly removed by the system """
cluster = self.cluster
cluster.populate(1).star... | Add test to check range ghost are removed | Add test to check range ghost are removed
| Python | apache-2.0 | thobbs/cassandra-dtest,snazy/cassandra-dtest,carlyeks/cassandra-dtest,krummas/cassandra-dtest,beobal/cassandra-dtest,thobbs/cassandra-dtest,tjake/cassandra-dtest,pcmanus/cassandra-dtest,spodkowinski/cassandra-dtest,aweisberg/cassandra-dtest,stef1927/cassandra-dtest,pauloricardomg/cassandra-dtest,snazy/cassandra-dtest,m... | Add test to check range ghost are removed | from dtest import Tester
from tools import *
from assertions import *
import os, sys, time
from ccmlib.cluster import Cluster
class TestRangeGhosts(Tester):
def ghosts_test(self):
""" Check range ghost are correctly removed by the system """
cluster = self.cluster
cluster.populate(1).star... | <commit_before><commit_msg>Add test to check range ghost are removed<commit_after> | from dtest import Tester
from tools import *
from assertions import *
import os, sys, time
from ccmlib.cluster import Cluster
class TestRangeGhosts(Tester):
def ghosts_test(self):
""" Check range ghost are correctly removed by the system """
cluster = self.cluster
cluster.populate(1).star... | Add test to check range ghost are removedfrom dtest import Tester
from tools import *
from assertions import *
import os, sys, time
from ccmlib.cluster import Cluster
class TestRangeGhosts(Tester):
def ghosts_test(self):
""" Check range ghost are correctly removed by the system """
cluster = self... | <commit_before><commit_msg>Add test to check range ghost are removed<commit_after>from dtest import Tester
from tools import *
from assertions import *
import os, sys, time
from ccmlib.cluster import Cluster
class TestRangeGhosts(Tester):
def ghosts_test(self):
""" Check range ghost are correctly removed... | |
2ea737e3ef9d15e61504c8e35314a21b159fe830 | pombola/hansard/management/commands/hansard_email_unmatched_speakers.py | pombola/hansard/management/commands/hansard_email_unmatched_speakers.py | from django.core.management.base import NoArgsCommand
from django.core.mail import send_mail
from pombola.hansard.models import Alias
class Command(NoArgsCommand):
help = 'Email a list of all the speaker names that have not been matched up to a real person'
def handle_noargs(self, **options):
unassi... | Add command to email unassigned aliases | [KE] Add command to email unassigned aliases
This is currently done as part of the `bin/update_hansard.bash` script,
which runs the `hansard_list_unmatched_speakers` command. We want it to
be separate so that errors from running the Hansard update script go to
developers, and the unmatched aliases go to the Mzalendo m... | Python | agpl-3.0 | mysociety/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola | [KE] Add command to email unassigned aliases
This is currently done as part of the `bin/update_hansard.bash` script,
which runs the `hansard_list_unmatched_speakers` command. We want it to
be separate so that errors from running the Hansard update script go to
developers, and the unmatched aliases go to the Mzalendo m... | from django.core.management.base import NoArgsCommand
from django.core.mail import send_mail
from pombola.hansard.models import Alias
class Command(NoArgsCommand):
help = 'Email a list of all the speaker names that have not been matched up to a real person'
def handle_noargs(self, **options):
unassi... | <commit_before><commit_msg>[KE] Add command to email unassigned aliases
This is currently done as part of the `bin/update_hansard.bash` script,
which runs the `hansard_list_unmatched_speakers` command. We want it to
be separate so that errors from running the Hansard update script go to
developers, and the unmatched a... | from django.core.management.base import NoArgsCommand
from django.core.mail import send_mail
from pombola.hansard.models import Alias
class Command(NoArgsCommand):
help = 'Email a list of all the speaker names that have not been matched up to a real person'
def handle_noargs(self, **options):
unassi... | [KE] Add command to email unassigned aliases
This is currently done as part of the `bin/update_hansard.bash` script,
which runs the `hansard_list_unmatched_speakers` command. We want it to
be separate so that errors from running the Hansard update script go to
developers, and the unmatched aliases go to the Mzalendo m... | <commit_before><commit_msg>[KE] Add command to email unassigned aliases
This is currently done as part of the `bin/update_hansard.bash` script,
which runs the `hansard_list_unmatched_speakers` command. We want it to
be separate so that errors from running the Hansard update script go to
developers, and the unmatched a... | |
72c6c2a4ea2e3ddaacad4fb5376b6a48a12db200 | logistic_regression.py | logistic_regression.py | import os
import numpy as np
import matplotlib.pyplot as plt
from keras.models import Sequential
from keras.layers.core import Dense, Activation
"""2-class logistic regression by keras"""
def plot_data(X, y):
positive = [i for i in range(len(y)) if y[i] == 1]
negative = [i for i in range(len(y)) if y[i] == 0... | Add a logistic regression example | Add a logistic regression example
| Python | mit | aidiary/keras_examples,aidiary/keras_examples | Add a logistic regression example | import os
import numpy as np
import matplotlib.pyplot as plt
from keras.models import Sequential
from keras.layers.core import Dense, Activation
"""2-class logistic regression by keras"""
def plot_data(X, y):
positive = [i for i in range(len(y)) if y[i] == 1]
negative = [i for i in range(len(y)) if y[i] == 0... | <commit_before><commit_msg>Add a logistic regression example<commit_after> | import os
import numpy as np
import matplotlib.pyplot as plt
from keras.models import Sequential
from keras.layers.core import Dense, Activation
"""2-class logistic regression by keras"""
def plot_data(X, y):
positive = [i for i in range(len(y)) if y[i] == 1]
negative = [i for i in range(len(y)) if y[i] == 0... | Add a logistic regression exampleimport os
import numpy as np
import matplotlib.pyplot as plt
from keras.models import Sequential
from keras.layers.core import Dense, Activation
"""2-class logistic regression by keras"""
def plot_data(X, y):
positive = [i for i in range(len(y)) if y[i] == 1]
negative = [i fo... | <commit_before><commit_msg>Add a logistic regression example<commit_after>import os
import numpy as np
import matplotlib.pyplot as plt
from keras.models import Sequential
from keras.layers.core import Dense, Activation
"""2-class logistic regression by keras"""
def plot_data(X, y):
positive = [i for i in range(l... | |
3c94874e1ad30325cb0464eec956d55c97130233 | clean_table.py | clean_table.py | from lxml import etree
from urllib.request import urlopen
import pandas as pd
DATA_URL = "https://en.wikipedia.org/w/index.php?title=Spacecraft_propulsion&oldid=760799107"
parser = etree.HTMLParser()
with urlopen(DATA_URL) as fp:
all_html = etree.parse(fp, parser)
tables = [t for t in all_html.xpath(r"//table[... | Add script to extract table of propulsion methods | Add script to extract table of propulsion methods
TODO: Organize code
| Python | mit | Juanlu001/pfc-uc3m | Add script to extract table of propulsion methods
TODO: Organize code | from lxml import etree
from urllib.request import urlopen
import pandas as pd
DATA_URL = "https://en.wikipedia.org/w/index.php?title=Spacecraft_propulsion&oldid=760799107"
parser = etree.HTMLParser()
with urlopen(DATA_URL) as fp:
all_html = etree.parse(fp, parser)
tables = [t for t in all_html.xpath(r"//table[... | <commit_before><commit_msg>Add script to extract table of propulsion methods
TODO: Organize code<commit_after> | from lxml import etree
from urllib.request import urlopen
import pandas as pd
DATA_URL = "https://en.wikipedia.org/w/index.php?title=Spacecraft_propulsion&oldid=760799107"
parser = etree.HTMLParser()
with urlopen(DATA_URL) as fp:
all_html = etree.parse(fp, parser)
tables = [t for t in all_html.xpath(r"//table[... | Add script to extract table of propulsion methods
TODO: Organize codefrom lxml import etree
from urllib.request import urlopen
import pandas as pd
DATA_URL = "https://en.wikipedia.org/w/index.php?title=Spacecraft_propulsion&oldid=760799107"
parser = etree.HTMLParser()
with urlopen(DATA_URL) as fp:
all_html = e... | <commit_before><commit_msg>Add script to extract table of propulsion methods
TODO: Organize code<commit_after>from lxml import etree
from urllib.request import urlopen
import pandas as pd
DATA_URL = "https://en.wikipedia.org/w/index.php?title=Spacecraft_propulsion&oldid=760799107"
parser = etree.HTMLParser()
with ... | |
901c484590367e5e6c98d6f30d355fd6b9707861 | get_jamdb_users.py | get_jamdb_users.py | import requests
import json
JAMDB_AUTHORIZATION_TOKEN = 'JWT_SECRET_TOKEN'
# To set this make this request
# POST https://metadata.osf.io/v1/auth
#
# {
# "data": {
# "type": "users",
# "attributes": {
# "provider": "osf",
# "access_token": "PERSONAL_ACCESS_TOKEN"
# }
# }
# }
# Fill this in ... | Include script to get users from jamdb lookit | Include script to get users from jamdb lookit
| Python | apache-2.0 | CenterForOpenScience/lookit-api,CenterForOpenScience/lookit-api,CenterForOpenScience/lookit-api | Include script to get users from jamdb lookit | import requests
import json
JAMDB_AUTHORIZATION_TOKEN = 'JWT_SECRET_TOKEN'
# To set this make this request
# POST https://metadata.osf.io/v1/auth
#
# {
# "data": {
# "type": "users",
# "attributes": {
# "provider": "osf",
# "access_token": "PERSONAL_ACCESS_TOKEN"
# }
# }
# }
# Fill this in ... | <commit_before><commit_msg>Include script to get users from jamdb lookit<commit_after> | import requests
import json
JAMDB_AUTHORIZATION_TOKEN = 'JWT_SECRET_TOKEN'
# To set this make this request
# POST https://metadata.osf.io/v1/auth
#
# {
# "data": {
# "type": "users",
# "attributes": {
# "provider": "osf",
# "access_token": "PERSONAL_ACCESS_TOKEN"
# }
# }
# }
# Fill this in ... | Include script to get users from jamdb lookitimport requests
import json
JAMDB_AUTHORIZATION_TOKEN = 'JWT_SECRET_TOKEN'
# To set this make this request
# POST https://metadata.osf.io/v1/auth
#
# {
# "data": {
# "type": "users",
# "attributes": {
# "provider": "osf",
# "access_token": "PERSONAL_AC... | <commit_before><commit_msg>Include script to get users from jamdb lookit<commit_after>import requests
import json
JAMDB_AUTHORIZATION_TOKEN = 'JWT_SECRET_TOKEN'
# To set this make this request
# POST https://metadata.osf.io/v1/auth
#
# {
# "data": {
# "type": "users",
# "attributes": {
# "provider": "o... | |
d5ac116901d554b055386c71aa4a9c70b2291a33 | myAssert.py | myAssert.py | from __future__ import print_function
def areEqual(expect, val, eps = 0.01):
print("Expected: ", expect, " actual: ", val)
try:
diff = abs(float(val) / float(expect) - 1.0)
assert diff < eps, "***** Values don't match, expected= {:.12f}, found= {:.12f}, diff= {:.12f}. *****".format(expect, val,... | Put my custom assert function into its own module. | Put my custom assert function into its own module.
| Python | agpl-3.0 | cielling/jupyternbs | Put my custom assert function into its own module. | from __future__ import print_function
def areEqual(expect, val, eps = 0.01):
print("Expected: ", expect, " actual: ", val)
try:
diff = abs(float(val) / float(expect) - 1.0)
assert diff < eps, "***** Values don't match, expected= {:.12f}, found= {:.12f}, diff= {:.12f}. *****".format(expect, val,... | <commit_before><commit_msg>Put my custom assert function into its own module.<commit_after> | from __future__ import print_function
def areEqual(expect, val, eps = 0.01):
print("Expected: ", expect, " actual: ", val)
try:
diff = abs(float(val) / float(expect) - 1.0)
assert diff < eps, "***** Values don't match, expected= {:.12f}, found= {:.12f}, diff= {:.12f}. *****".format(expect, val,... | Put my custom assert function into its own module.from __future__ import print_function
def areEqual(expect, val, eps = 0.01):
print("Expected: ", expect, " actual: ", val)
try:
diff = abs(float(val) / float(expect) - 1.0)
assert diff < eps, "***** Values don't match, expected= {:.12f}, found= ... | <commit_before><commit_msg>Put my custom assert function into its own module.<commit_after>from __future__ import print_function
def areEqual(expect, val, eps = 0.01):
print("Expected: ", expect, " actual: ", val)
try:
diff = abs(float(val) / float(expect) - 1.0)
assert diff < eps, "***** Value... | |
4a8a2aa12134dab63632e594c900dbfd93129f97 | openomni/nonce_test.py | openomni/nonce_test.py | import unittest
from nonce import *
class NonceTestCase(unittest.TestCase):
def test_nonces(self):
nonces = generate_nonces(42560, 661771, 4)
self.assertEqual(nonces[0], 0x8c61ee59)
self.assertEqual(nonces[1], 0xc0256620)
self.assertEqual(nonces[2], 0x15022c8a)
self.assertE... | Add test for nonce generation | Add test for nonce generation
| Python | mit | openaps/openomni,openaps/openomni,openaps/openomni | Add test for nonce generation | import unittest
from nonce import *
class NonceTestCase(unittest.TestCase):
def test_nonces(self):
nonces = generate_nonces(42560, 661771, 4)
self.assertEqual(nonces[0], 0x8c61ee59)
self.assertEqual(nonces[1], 0xc0256620)
self.assertEqual(nonces[2], 0x15022c8a)
self.assertE... | <commit_before><commit_msg>Add test for nonce generation<commit_after> | import unittest
from nonce import *
class NonceTestCase(unittest.TestCase):
def test_nonces(self):
nonces = generate_nonces(42560, 661771, 4)
self.assertEqual(nonces[0], 0x8c61ee59)
self.assertEqual(nonces[1], 0xc0256620)
self.assertEqual(nonces[2], 0x15022c8a)
self.assertE... | Add test for nonce generationimport unittest
from nonce import *
class NonceTestCase(unittest.TestCase):
def test_nonces(self):
nonces = generate_nonces(42560, 661771, 4)
self.assertEqual(nonces[0], 0x8c61ee59)
self.assertEqual(nonces[1], 0xc0256620)
self.assertEqual(nonces[2], 0x1... | <commit_before><commit_msg>Add test for nonce generation<commit_after>import unittest
from nonce import *
class NonceTestCase(unittest.TestCase):
def test_nonces(self):
nonces = generate_nonces(42560, 661771, 4)
self.assertEqual(nonces[0], 0x8c61ee59)
self.assertEqual(nonces[1], 0xc0256620... | |
4725a80e6a02a08ef6081eac9261cb420bdc1fee | django_countries/templatetags/countries.py | django_countries/templatetags/countries.py | import django
from django import template
from django_countries.fields import Country, countries
register = template.Library()
if django.VERSION < (1, 9):
# Support older versions without implicit assignment support in simple_tag.
simple_tag = register.assignment_tag
else:
simple_tag = register.simple_ta... | import django
from django import template
from django_countries.fields import Country, countries
register = template.Library()
@register.simple_tag
def get_country(code):
return Country(code=code)
@register.simple_tag
def get_countries():
return list(countries)
| Remove Django 1.9 simple_tag reference | Remove Django 1.9 simple_tag reference
| Python | mit | SmileyChris/django-countries | import django
from django import template
from django_countries.fields import Country, countries
register = template.Library()
if django.VERSION < (1, 9):
# Support older versions without implicit assignment support in simple_tag.
simple_tag = register.assignment_tag
else:
simple_tag = register.simple_ta... | import django
from django import template
from django_countries.fields import Country, countries
register = template.Library()
@register.simple_tag
def get_country(code):
return Country(code=code)
@register.simple_tag
def get_countries():
return list(countries)
| <commit_before>import django
from django import template
from django_countries.fields import Country, countries
register = template.Library()
if django.VERSION < (1, 9):
# Support older versions without implicit assignment support in simple_tag.
simple_tag = register.assignment_tag
else:
simple_tag = reg... | import django
from django import template
from django_countries.fields import Country, countries
register = template.Library()
@register.simple_tag
def get_country(code):
return Country(code=code)
@register.simple_tag
def get_countries():
return list(countries)
| import django
from django import template
from django_countries.fields import Country, countries
register = template.Library()
if django.VERSION < (1, 9):
# Support older versions without implicit assignment support in simple_tag.
simple_tag = register.assignment_tag
else:
simple_tag = register.simple_ta... | <commit_before>import django
from django import template
from django_countries.fields import Country, countries
register = template.Library()
if django.VERSION < (1, 9):
# Support older versions without implicit assignment support in simple_tag.
simple_tag = register.assignment_tag
else:
simple_tag = reg... |
02b57a47f3ee117b6b32e248c698366469be1a5b | runtests.py | runtests.py | #!/usr/bin/env python
import sys
from os.path import dirname, abspath
from django.conf import settings
if not settings.configured:
settings.configure(
DATABASE_ENGINE = 'sqlite3',
INSTALLED_APPS = [
'django.contrib.contenttypes',
'genericm2m',
'genericm2m.generi... | #!/usr/bin/env python
import sys
from os.path import dirname, abspath
from django.conf import settings
if len(sys.argv) > 1 and 'postgres' in sys.argv:
sys.argv.remove('postgres')
db_engine = 'postgresql_psycopg2'
db_name = 'test_main'
else:
db_engine = 'sqlite3'
db_name = ''
if not settings.con... | Allow running tests with postgres | Allow running tests with postgres
| Python | mit | jayfk/django-generic-m2m,coleifer/django-generic-m2m,coleifer/django-generic-m2m,coleifer/django-generic-m2m,jayfk/django-generic-m2m | #!/usr/bin/env python
import sys
from os.path import dirname, abspath
from django.conf import settings
if not settings.configured:
settings.configure(
DATABASE_ENGINE = 'sqlite3',
INSTALLED_APPS = [
'django.contrib.contenttypes',
'genericm2m',
'genericm2m.generi... | #!/usr/bin/env python
import sys
from os.path import dirname, abspath
from django.conf import settings
if len(sys.argv) > 1 and 'postgres' in sys.argv:
sys.argv.remove('postgres')
db_engine = 'postgresql_psycopg2'
db_name = 'test_main'
else:
db_engine = 'sqlite3'
db_name = ''
if not settings.con... | <commit_before>#!/usr/bin/env python
import sys
from os.path import dirname, abspath
from django.conf import settings
if not settings.configured:
settings.configure(
DATABASE_ENGINE = 'sqlite3',
INSTALLED_APPS = [
'django.contrib.contenttypes',
'genericm2m',
'ge... | #!/usr/bin/env python
import sys
from os.path import dirname, abspath
from django.conf import settings
if len(sys.argv) > 1 and 'postgres' in sys.argv:
sys.argv.remove('postgres')
db_engine = 'postgresql_psycopg2'
db_name = 'test_main'
else:
db_engine = 'sqlite3'
db_name = ''
if not settings.con... | #!/usr/bin/env python
import sys
from os.path import dirname, abspath
from django.conf import settings
if not settings.configured:
settings.configure(
DATABASE_ENGINE = 'sqlite3',
INSTALLED_APPS = [
'django.contrib.contenttypes',
'genericm2m',
'genericm2m.generi... | <commit_before>#!/usr/bin/env python
import sys
from os.path import dirname, abspath
from django.conf import settings
if not settings.configured:
settings.configure(
DATABASE_ENGINE = 'sqlite3',
INSTALLED_APPS = [
'django.contrib.contenttypes',
'genericm2m',
'ge... |
0afda70c3fa96bba8908c7b1c8d310389a74b694 | zerver/migrations/0397_remove_custom_field_values_for_deleted_options.py | zerver/migrations/0397_remove_custom_field_values_for_deleted_options.py | # Generated by Django 3.2.13 on 2022-06-17 17:39
import orjson
from django.db import migrations
from django.db.backends.postgresql.schema import BaseDatabaseSchemaEditor
from django.db.migrations.state import StateApps
def remove_custom_field_values_for_deleted_options(
apps: StateApps, schema_editor: BaseDatabas... | Add migration to remove user values for deleted options. | migration: Add migration to remove user values for deleted options.
This commit adds migration to delete CustomProfileFieldValue
objects for deleted options of SELECT type custom profile
fields.
| Python | apache-2.0 | andersk/zulip,rht/zulip,andersk/zulip,zulip/zulip,andersk/zulip,zulip/zulip,rht/zulip,rht/zulip,zulip/zulip,andersk/zulip,zulip/zulip,rht/zulip,rht/zulip,rht/zulip,zulip/zulip,andersk/zulip,zulip/zulip,rht/zulip,zulip/zulip,andersk/zulip,andersk/zulip | migration: Add migration to remove user values for deleted options.
This commit adds migration to delete CustomProfileFieldValue
objects for deleted options of SELECT type custom profile
fields. | # Generated by Django 3.2.13 on 2022-06-17 17:39
import orjson
from django.db import migrations
from django.db.backends.postgresql.schema import BaseDatabaseSchemaEditor
from django.db.migrations.state import StateApps
def remove_custom_field_values_for_deleted_options(
apps: StateApps, schema_editor: BaseDatabas... | <commit_before><commit_msg>migration: Add migration to remove user values for deleted options.
This commit adds migration to delete CustomProfileFieldValue
objects for deleted options of SELECT type custom profile
fields.<commit_after> | # Generated by Django 3.2.13 on 2022-06-17 17:39
import orjson
from django.db import migrations
from django.db.backends.postgresql.schema import BaseDatabaseSchemaEditor
from django.db.migrations.state import StateApps
def remove_custom_field_values_for_deleted_options(
apps: StateApps, schema_editor: BaseDatabas... | migration: Add migration to remove user values for deleted options.
This commit adds migration to delete CustomProfileFieldValue
objects for deleted options of SELECT type custom profile
fields.# Generated by Django 3.2.13 on 2022-06-17 17:39
import orjson
from django.db import migrations
from django.db.backends.postg... | <commit_before><commit_msg>migration: Add migration to remove user values for deleted options.
This commit adds migration to delete CustomProfileFieldValue
objects for deleted options of SELECT type custom profile
fields.<commit_after># Generated by Django 3.2.13 on 2022-06-17 17:39
import orjson
from django.db import... | |
56d444a1233b027718e0f7bfdf2c7d27b4de45d4 | into/backends/spark.py | into/backends/spark.py | class Dummy(object):
sum = max = min = count = distinct = mean = variance = stdev = None
try:
from pyspark import SparkContext
import pyspark
from pyspark.rdd import RDD
RDD.min
except (AttributeError, ImportError):
SparkContext = Dummy
pyspark = Dummy()
pyspark.rdd = Dummy()
RDD = ... | class Dummy(object):
pass
try:
from pyspark import SparkContext
import pyspark
from pyspark import RDD
from pyspark.rdd import PipelinedRDD
from pyspark.sql import SchemaRDD
RDD.min
except (AttributeError, ImportError):
SparkContext = Dummy
pyspark = Dummy()
RDD = Dummy
from c... | Add convert for the various RDDs | Add convert for the various RDDs
| Python | bsd-3-clause | cpcloud/odo,blaze/odo,ContinuumIO/odo,ContinuumIO/odo,blaze/odo,quantopian/odo,alexmojaki/odo,ywang007/odo,cpcloud/odo,ywang007/odo,cowlicks/odo,Dannnno/odo,alexmojaki/odo,Dannnno/odo,quantopian/odo,cowlicks/odo | class Dummy(object):
sum = max = min = count = distinct = mean = variance = stdev = None
try:
from pyspark import SparkContext
import pyspark
from pyspark.rdd import RDD
RDD.min
except (AttributeError, ImportError):
SparkContext = Dummy
pyspark = Dummy()
pyspark.rdd = Dummy()
RDD = ... | class Dummy(object):
pass
try:
from pyspark import SparkContext
import pyspark
from pyspark import RDD
from pyspark.rdd import PipelinedRDD
from pyspark.sql import SchemaRDD
RDD.min
except (AttributeError, ImportError):
SparkContext = Dummy
pyspark = Dummy()
RDD = Dummy
from c... | <commit_before>class Dummy(object):
sum = max = min = count = distinct = mean = variance = stdev = None
try:
from pyspark import SparkContext
import pyspark
from pyspark.rdd import RDD
RDD.min
except (AttributeError, ImportError):
SparkContext = Dummy
pyspark = Dummy()
pyspark.rdd = Dum... | class Dummy(object):
pass
try:
from pyspark import SparkContext
import pyspark
from pyspark import RDD
from pyspark.rdd import PipelinedRDD
from pyspark.sql import SchemaRDD
RDD.min
except (AttributeError, ImportError):
SparkContext = Dummy
pyspark = Dummy()
RDD = Dummy
from c... | class Dummy(object):
sum = max = min = count = distinct = mean = variance = stdev = None
try:
from pyspark import SparkContext
import pyspark
from pyspark.rdd import RDD
RDD.min
except (AttributeError, ImportError):
SparkContext = Dummy
pyspark = Dummy()
pyspark.rdd = Dummy()
RDD = ... | <commit_before>class Dummy(object):
sum = max = min = count = distinct = mean = variance = stdev = None
try:
from pyspark import SparkContext
import pyspark
from pyspark.rdd import RDD
RDD.min
except (AttributeError, ImportError):
SparkContext = Dummy
pyspark = Dummy()
pyspark.rdd = Dum... |
3620bafe1ce573d08fca7db357f4df40d6949cfb | flowz/channels/__init__.py | flowz/channels/__init__.py | from __future__ import absolute_import
from .core import (ChannelDone, Channel, ReadChannel, MapChannel, FlatMapChannel,
FilterChannel, FutureChannel, ReadyFutureChannel, TeeChannel,
ProducerChannel, IterChannel, ZipChannel, CoGroupChannel,
WindowChannel, GroupC... | from __future__ import absolute_import
from .core import (
Channel,
ChannelDone,
CoGroupChannel,
FilterChannel,
FlatMapChannel,
FutureChannel,
GroupChannel,
IterChannel,
MapChannel,
ProducerChannel,
ReadChannel,
ReadyFuture... | Change to one package per line for channel import | Change to one package per line for channel import
Resolves #19.
While this doesn't switch to the ideal standard of one import, one
line, it makes the import from `flowz.channels.core` into
`flowz.channels` easier to read and less likely to invite conflicts.
Didn't go to "from .core import" per line primarily due to ... | Python | mit | ethanrowe/flowz,PatrickDRusk/flowz | from __future__ import absolute_import
from .core import (ChannelDone, Channel, ReadChannel, MapChannel, FlatMapChannel,
FilterChannel, FutureChannel, ReadyFutureChannel, TeeChannel,
ProducerChannel, IterChannel, ZipChannel, CoGroupChannel,
WindowChannel, GroupC... | from __future__ import absolute_import
from .core import (
Channel,
ChannelDone,
CoGroupChannel,
FilterChannel,
FlatMapChannel,
FutureChannel,
GroupChannel,
IterChannel,
MapChannel,
ProducerChannel,
ReadChannel,
ReadyFuture... | <commit_before>from __future__ import absolute_import
from .core import (ChannelDone, Channel, ReadChannel, MapChannel, FlatMapChannel,
FilterChannel, FutureChannel, ReadyFutureChannel, TeeChannel,
ProducerChannel, IterChannel, ZipChannel, CoGroupChannel,
Window... | from __future__ import absolute_import
from .core import (
Channel,
ChannelDone,
CoGroupChannel,
FilterChannel,
FlatMapChannel,
FutureChannel,
GroupChannel,
IterChannel,
MapChannel,
ProducerChannel,
ReadChannel,
ReadyFuture... | from __future__ import absolute_import
from .core import (ChannelDone, Channel, ReadChannel, MapChannel, FlatMapChannel,
FilterChannel, FutureChannel, ReadyFutureChannel, TeeChannel,
ProducerChannel, IterChannel, ZipChannel, CoGroupChannel,
WindowChannel, GroupC... | <commit_before>from __future__ import absolute_import
from .core import (ChannelDone, Channel, ReadChannel, MapChannel, FlatMapChannel,
FilterChannel, FutureChannel, ReadyFutureChannel, TeeChannel,
ProducerChannel, IterChannel, ZipChannel, CoGroupChannel,
Window... |
357a37d607b4b85d46e26fa4d2409f23d923d176 | src/client/keyboard/win.py | src/client/keyboard/win.py | #!/usr/bin/env python
import re, sys, os
if len(sys.argv) != 2:
print >>sys.stderr, "Usage: win.py path/to/WinUser.h"
sys.exit(1)
OUT = 'win2.txt'
TMP = OUT + '.tmp'
f = open(TMP, 'w')
try:
print >>f, '; Automatically generated by "win.py"'
VK = re.compile('#define\s*VK_(\w+)\s+(\w+)')
for line in o... | Add keycode table generator for Windows | Add keycode table generator for Windows
| Python | bsd-2-clause | depp/sglib,depp/sglib | Add keycode table generator for Windows | #!/usr/bin/env python
import re, sys, os
if len(sys.argv) != 2:
print >>sys.stderr, "Usage: win.py path/to/WinUser.h"
sys.exit(1)
OUT = 'win2.txt'
TMP = OUT + '.tmp'
f = open(TMP, 'w')
try:
print >>f, '; Automatically generated by "win.py"'
VK = re.compile('#define\s*VK_(\w+)\s+(\w+)')
for line in o... | <commit_before><commit_msg>Add keycode table generator for Windows<commit_after> | #!/usr/bin/env python
import re, sys, os
if len(sys.argv) != 2:
print >>sys.stderr, "Usage: win.py path/to/WinUser.h"
sys.exit(1)
OUT = 'win2.txt'
TMP = OUT + '.tmp'
f = open(TMP, 'w')
try:
print >>f, '; Automatically generated by "win.py"'
VK = re.compile('#define\s*VK_(\w+)\s+(\w+)')
for line in o... | Add keycode table generator for Windows#!/usr/bin/env python
import re, sys, os
if len(sys.argv) != 2:
print >>sys.stderr, "Usage: win.py path/to/WinUser.h"
sys.exit(1)
OUT = 'win2.txt'
TMP = OUT + '.tmp'
f = open(TMP, 'w')
try:
print >>f, '; Automatically generated by "win.py"'
VK = re.compile('#define... | <commit_before><commit_msg>Add keycode table generator for Windows<commit_after>#!/usr/bin/env python
import re, sys, os
if len(sys.argv) != 2:
print >>sys.stderr, "Usage: win.py path/to/WinUser.h"
sys.exit(1)
OUT = 'win2.txt'
TMP = OUT + '.tmp'
f = open(TMP, 'w')
try:
print >>f, '; Automatically generated ... | |
950cef23b570dc744357ab7a1dd7e8ad3d7c71d7 | cdent/emitter/python3.py | cdent/emitter/python3.py | """\
Python code emitter for C'Dent
"""
from cdent.emitter import Emitter as Base
class Emitter(Base):
LANGUAGE_ID = 'py3'
BLOCK_COMMENT_BEGIN = '"""\\\n'
BLOCK_COMMENT_PREFIX = ''
BLOCK_COMMENT_END = '"""\n'
def emit_includecdent(self, includecdent):
self.writeln('from cdent.run import *... | Add a Python 3000 emitter. | Add a Python 3000 emitter.
| Python | bsd-2-clause | ingydotnet/cdent-py,ingydotnet/cdent-py,ingydotnet/cdent-py,ingydotnet/cdent-py,ingydotnet/cdent-py,ingydotnet/cdent-py,ingydotnet/cdent-py,ingydotnet/cdent-py | Add a Python 3000 emitter. | """\
Python code emitter for C'Dent
"""
from cdent.emitter import Emitter as Base
class Emitter(Base):
LANGUAGE_ID = 'py3'
BLOCK_COMMENT_BEGIN = '"""\\\n'
BLOCK_COMMENT_PREFIX = ''
BLOCK_COMMENT_END = '"""\n'
def emit_includecdent(self, includecdent):
self.writeln('from cdent.run import *... | <commit_before><commit_msg>Add a Python 3000 emitter.<commit_after> | """\
Python code emitter for C'Dent
"""
from cdent.emitter import Emitter as Base
class Emitter(Base):
LANGUAGE_ID = 'py3'
BLOCK_COMMENT_BEGIN = '"""\\\n'
BLOCK_COMMENT_PREFIX = ''
BLOCK_COMMENT_END = '"""\n'
def emit_includecdent(self, includecdent):
self.writeln('from cdent.run import *... | Add a Python 3000 emitter."""\
Python code emitter for C'Dent
"""
from cdent.emitter import Emitter as Base
class Emitter(Base):
LANGUAGE_ID = 'py3'
BLOCK_COMMENT_BEGIN = '"""\\\n'
BLOCK_COMMENT_PREFIX = ''
BLOCK_COMMENT_END = '"""\n'
def emit_includecdent(self, includecdent):
self.writel... | <commit_before><commit_msg>Add a Python 3000 emitter.<commit_after>"""\
Python code emitter for C'Dent
"""
from cdent.emitter import Emitter as Base
class Emitter(Base):
LANGUAGE_ID = 'py3'
BLOCK_COMMENT_BEGIN = '"""\\\n'
BLOCK_COMMENT_PREFIX = ''
BLOCK_COMMENT_END = '"""\n'
def emit_includecdent... | |
54beba6ca344e6b0269e9500b3ec9f103348f217 | scripts/line.rw.py | scripts/line.rw.py | from nxt import locator
from nxt.sensor.common import PORT_1, PORT_2, PORT_3, PORT_4
from nxt.motor import PORT_A, PORT_B, PORT_C
from scripts.robot import Robot, SERVO_NICE, ON, OFF
from scripts.utils import normalize
def main():
brick = locator.find_one_brick() # USB connection
robot = Robot(brick)
# Sensors
l... | Add experimental version of line.py (fancier :fire:) | Add experimental version of line.py (fancier :fire:)
| Python | mit | richin13/nxt-scripts | Add experimental version of line.py (fancier :fire:) | from nxt import locator
from nxt.sensor.common import PORT_1, PORT_2, PORT_3, PORT_4
from nxt.motor import PORT_A, PORT_B, PORT_C
from scripts.robot import Robot, SERVO_NICE, ON, OFF
from scripts.utils import normalize
def main():
brick = locator.find_one_brick() # USB connection
robot = Robot(brick)
# Sensors
l... | <commit_before><commit_msg>Add experimental version of line.py (fancier :fire:)<commit_after> | from nxt import locator
from nxt.sensor.common import PORT_1, PORT_2, PORT_3, PORT_4
from nxt.motor import PORT_A, PORT_B, PORT_C
from scripts.robot import Robot, SERVO_NICE, ON, OFF
from scripts.utils import normalize
def main():
brick = locator.find_one_brick() # USB connection
robot = Robot(brick)
# Sensors
l... | Add experimental version of line.py (fancier :fire:)from nxt import locator
from nxt.sensor.common import PORT_1, PORT_2, PORT_3, PORT_4
from nxt.motor import PORT_A, PORT_B, PORT_C
from scripts.robot import Robot, SERVO_NICE, ON, OFF
from scripts.utils import normalize
def main():
brick = locator.find_one_brick() #... | <commit_before><commit_msg>Add experimental version of line.py (fancier :fire:)<commit_after>from nxt import locator
from nxt.sensor.common import PORT_1, PORT_2, PORT_3, PORT_4
from nxt.motor import PORT_A, PORT_B, PORT_C
from scripts.robot import Robot, SERVO_NICE, ON, OFF
from scripts.utils import normalize
def ma... | |
92726afbbf7e51ff21aba9e08ea0aad6c5c49dfc | tank_structure_test.py | tank_structure_test.py | import unittest
import tank_structure as ts
from units import inch2meter, psi2pascal
class TestStringMethods(unittest.TestCase):
def test_sample_8_3(self):
# Do sample problem 8-3 from Huzel and Huang.
stress = psi2pascal(38e3)
a = inch2meter(41.0)
l_c = inch2meter(46.9)
E... | Add limited unit test for tank structure. | Add limited unit test for tank structure.
| Python | mit | mvernacc/proptools | Add limited unit test for tank structure. | import unittest
import tank_structure as ts
from units import inch2meter, psi2pascal
class TestStringMethods(unittest.TestCase):
def test_sample_8_3(self):
# Do sample problem 8-3 from Huzel and Huang.
stress = psi2pascal(38e3)
a = inch2meter(41.0)
l_c = inch2meter(46.9)
E... | <commit_before><commit_msg>Add limited unit test for tank structure.<commit_after> | import unittest
import tank_structure as ts
from units import inch2meter, psi2pascal
class TestStringMethods(unittest.TestCase):
def test_sample_8_3(self):
# Do sample problem 8-3 from Huzel and Huang.
stress = psi2pascal(38e3)
a = inch2meter(41.0)
l_c = inch2meter(46.9)
E... | Add limited unit test for tank structure.import unittest
import tank_structure as ts
from units import inch2meter, psi2pascal
class TestStringMethods(unittest.TestCase):
def test_sample_8_3(self):
# Do sample problem 8-3 from Huzel and Huang.
stress = psi2pascal(38e3)
a = inch2meter(41.0)... | <commit_before><commit_msg>Add limited unit test for tank structure.<commit_after>import unittest
import tank_structure as ts
from units import inch2meter, psi2pascal
class TestStringMethods(unittest.TestCase):
def test_sample_8_3(self):
# Do sample problem 8-3 from Huzel and Huang.
stress = psi2... | |
538a41b25a4aae3f98e32602880f2464723a0f9d | docs/source/conf.py | docs/source/conf.py | # vim:fileencoding=utf-8:noet
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))
sys.path.insert(0, os.path.abspath(os.getcwd()))
extensions = ['powerline_autodoc', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode']
source_suffix = '.rst'
master_doc ... | # vim:fileencoding=utf-8:noet
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))
sys.path.insert(0, os.path.abspath(os.getcwd()))
extensions = ['powerline_autodoc', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode']
source_suffix = '.rst'
master_doc ... | Fix building the docs without RTD theme. | docs: Fix building the docs without RTD theme.
Signed-off-by: Andreas Schneider <5be00ddc76278cf6077f5047ca3384a88460c671@cryptomilk.org>
| Python | mit | magus424/powerline,seanfisk/powerline,cyrixhero/powerline,bezhermoso/powerline,QuLogic/powerline,firebitsbr/powerline,junix/powerline,lukw00/powerline,EricSB/powerline,darac/powerline,xxxhycl2010/powerline,xxxhycl2010/powerline,IvanAli/powerline,seanfisk/powerline,dragon788/powerline,QuLogic/powerline,russellb/powerlin... | # vim:fileencoding=utf-8:noet
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))
sys.path.insert(0, os.path.abspath(os.getcwd()))
extensions = ['powerline_autodoc', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode']
source_suffix = '.rst'
master_doc ... | # vim:fileencoding=utf-8:noet
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))
sys.path.insert(0, os.path.abspath(os.getcwd()))
extensions = ['powerline_autodoc', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode']
source_suffix = '.rst'
master_doc ... | <commit_before># vim:fileencoding=utf-8:noet
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))
sys.path.insert(0, os.path.abspath(os.getcwd()))
extensions = ['powerline_autodoc', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode']
source_suffix = '.r... | # vim:fileencoding=utf-8:noet
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))
sys.path.insert(0, os.path.abspath(os.getcwd()))
extensions = ['powerline_autodoc', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode']
source_suffix = '.rst'
master_doc ... | # vim:fileencoding=utf-8:noet
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))
sys.path.insert(0, os.path.abspath(os.getcwd()))
extensions = ['powerline_autodoc', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode']
source_suffix = '.rst'
master_doc ... | <commit_before># vim:fileencoding=utf-8:noet
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))
sys.path.insert(0, os.path.abspath(os.getcwd()))
extensions = ['powerline_autodoc', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode']
source_suffix = '.r... |
d3903dcb846fec36e176a45118414c925f23aa8a | test/test_inelastic.py | test/test_inelastic.py | from cstool.parse_input import (parse_to_model, check_settings, cstool_model)
from cstool.inelastic import (inelastic_cs_fn)
from cslib import (units)
import numpy as np
pmma = {
"name": "pmma",
"rho_m": "1.192 g/cm³",
"fermi": "0 eV",
"work_func": "2.5 eV",
"phonon": {
"model": "dual",
... | Add basic test for inelastic_cs_fn, similar to phonon | Add basic test for inelastic_cs_fn, similar to phonon
| Python | apache-2.0 | eScatter/cstool | Add basic test for inelastic_cs_fn, similar to phonon | from cstool.parse_input import (parse_to_model, check_settings, cstool_model)
from cstool.inelastic import (inelastic_cs_fn)
from cslib import (units)
import numpy as np
pmma = {
"name": "pmma",
"rho_m": "1.192 g/cm³",
"fermi": "0 eV",
"work_func": "2.5 eV",
"phonon": {
"model": "dual",
... | <commit_before><commit_msg>Add basic test for inelastic_cs_fn, similar to phonon<commit_after> | from cstool.parse_input import (parse_to_model, check_settings, cstool_model)
from cstool.inelastic import (inelastic_cs_fn)
from cslib import (units)
import numpy as np
pmma = {
"name": "pmma",
"rho_m": "1.192 g/cm³",
"fermi": "0 eV",
"work_func": "2.5 eV",
"phonon": {
"model": "dual",
... | Add basic test for inelastic_cs_fn, similar to phononfrom cstool.parse_input import (parse_to_model, check_settings, cstool_model)
from cstool.inelastic import (inelastic_cs_fn)
from cslib import (units)
import numpy as np
pmma = {
"name": "pmma",
"rho_m": "1.192 g/cm³",
"fermi": "0 eV",
"work_func": ... | <commit_before><commit_msg>Add basic test for inelastic_cs_fn, similar to phonon<commit_after>from cstool.parse_input import (parse_to_model, check_settings, cstool_model)
from cstool.inelastic import (inelastic_cs_fn)
from cslib import (units)
import numpy as np
pmma = {
"name": "pmma",
"rho_m": "1.192 g/cm³... | |
191363e349735d6b51d3dbbfe471f1b51f59bffc | python/walk_directories.py | python/walk_directories.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import os
# GET THE ROOT DIRECTORY ######################################################
parser = argparse.ArgumentParser(description='An os.walk() snippet.')
parser.add_argument("root_dir_args", nargs=1, metavar="DIRECTORY", help="The directory to exp... | Add a snippet (walk directory). | Add a snippet (walk directory).
| Python | mit | jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets | Add a snippet (walk directory). | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import os
# GET THE ROOT DIRECTORY ######################################################
parser = argparse.ArgumentParser(description='An os.walk() snippet.')
parser.add_argument("root_dir_args", nargs=1, metavar="DIRECTORY", help="The directory to exp... | <commit_before><commit_msg>Add a snippet (walk directory).<commit_after> | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import os
# GET THE ROOT DIRECTORY ######################################################
parser = argparse.ArgumentParser(description='An os.walk() snippet.')
parser.add_argument("root_dir_args", nargs=1, metavar="DIRECTORY", help="The directory to exp... | Add a snippet (walk directory).#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import os
# GET THE ROOT DIRECTORY ######################################################
parser = argparse.ArgumentParser(description='An os.walk() snippet.')
parser.add_argument("root_dir_args", nargs=1, metavar="DIRECTO... | <commit_before><commit_msg>Add a snippet (walk directory).<commit_after>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import os
# GET THE ROOT DIRECTORY ######################################################
parser = argparse.ArgumentParser(description='An os.walk() snippet.')
parser.add_argument("... | |
b24997980f57b4ebfdb88f688b936ba345422acf | tests/test___init__.py | tests/test___init__.py | import pytest
def _call_extend(crc, chunk):
import crc32c
return crc32c.extend(crc, chunk, len(chunk))
def test_extend_w_empty_chunk():
assert _call_extend(123, b'') == 123
# From: https://tools.ietf.org/html/rfc3720#appendix-B.4
iscsi_scsi_read_10_command_pdu = [
0x01, 0xc0, 0x00, 0x00, 0x00, 0x0... | Add tests derived from RFC 3720, section B.4. | Add tests derived from RFC 3720, section B.4.
| Python | apache-2.0 | googleapis/python-crc32c,googleapis/python-crc32c,googleapis/python-crc32c | Add tests derived from RFC 3720, section B.4. | import pytest
def _call_extend(crc, chunk):
import crc32c
return crc32c.extend(crc, chunk, len(chunk))
def test_extend_w_empty_chunk():
assert _call_extend(123, b'') == 123
# From: https://tools.ietf.org/html/rfc3720#appendix-B.4
iscsi_scsi_read_10_command_pdu = [
0x01, 0xc0, 0x00, 0x00, 0x00, 0x0... | <commit_before><commit_msg>Add tests derived from RFC 3720, section B.4.<commit_after> | import pytest
def _call_extend(crc, chunk):
import crc32c
return crc32c.extend(crc, chunk, len(chunk))
def test_extend_w_empty_chunk():
assert _call_extend(123, b'') == 123
# From: https://tools.ietf.org/html/rfc3720#appendix-B.4
iscsi_scsi_read_10_command_pdu = [
0x01, 0xc0, 0x00, 0x00, 0x00, 0x0... | Add tests derived from RFC 3720, section B.4.import pytest
def _call_extend(crc, chunk):
import crc32c
return crc32c.extend(crc, chunk, len(chunk))
def test_extend_w_empty_chunk():
assert _call_extend(123, b'') == 123
# From: https://tools.ietf.org/html/rfc3720#appendix-B.4
iscsi_scsi_read_10_command_... | <commit_before><commit_msg>Add tests derived from RFC 3720, section B.4.<commit_after>import pytest
def _call_extend(crc, chunk):
import crc32c
return crc32c.extend(crc, chunk, len(chunk))
def test_extend_w_empty_chunk():
assert _call_extend(123, b'') == 123
# From: https://tools.ietf.org/html/rfc3720... | |
5b3069d96d03c3f3dc15370d48c47b8cec21ed86 | bluebottle/members/migrations/0068_auto_20220923_1420.py | bluebottle/members/migrations/0068_auto_20220923_1420.py | # Generated by Django 2.2.24 on 2022-09-23 12:20
import bluebottle.bb_accounts.models
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('members', '0067_auto_20220923_1212'),
]
operations = [
migrations.Alt... | FIx fiscal offset. Could be negative too | FIx fiscal offset. Could be negative too
| Python | bsd-3-clause | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | FIx fiscal offset. Could be negative too | # Generated by Django 2.2.24 on 2022-09-23 12:20
import bluebottle.bb_accounts.models
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('members', '0067_auto_20220923_1212'),
]
operations = [
migrations.Alt... | <commit_before><commit_msg>FIx fiscal offset. Could be negative too<commit_after> | # Generated by Django 2.2.24 on 2022-09-23 12:20
import bluebottle.bb_accounts.models
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('members', '0067_auto_20220923_1212'),
]
operations = [
migrations.Alt... | FIx fiscal offset. Could be negative too# Generated by Django 2.2.24 on 2022-09-23 12:20
import bluebottle.bb_accounts.models
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('members', '0067_auto_20220923_1212'),
]
... | <commit_before><commit_msg>FIx fiscal offset. Could be negative too<commit_after># Generated by Django 2.2.24 on 2022-09-23 12:20
import bluebottle.bb_accounts.models
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('membe... | |
9f09494c538ab6dc99ffdd46f91850691c748428 | src/p1.py | src/p1.py | def calc():
return sum(x for x in range(1000) if (x % 3) == 0 or (x % 5) == 0)
if __name__ == "__main__":
print(calc())
| Add solution to first problem | Add solution to first problem
| Python | mit | gsnedders/projecteuler | Add solution to first problem | def calc():
return sum(x for x in range(1000) if (x % 3) == 0 or (x % 5) == 0)
if __name__ == "__main__":
print(calc())
| <commit_before><commit_msg>Add solution to first problem<commit_after> | def calc():
return sum(x for x in range(1000) if (x % 3) == 0 or (x % 5) == 0)
if __name__ == "__main__":
print(calc())
| Add solution to first problemdef calc():
return sum(x for x in range(1000) if (x % 3) == 0 or (x % 5) == 0)
if __name__ == "__main__":
print(calc())
| <commit_before><commit_msg>Add solution to first problem<commit_after>def calc():
return sum(x for x in range(1000) if (x % 3) == 0 or (x % 5) == 0)
if __name__ == "__main__":
print(calc())
| |
3363e01f99cd60d23029d25c7102abdafa5aeacc | test/test_spam_check.py | test/test_spam_check.py | from sendgrid.helpers.mail.spam_check import SpamCheck
try:
import unittest2 as unittest
except ImportError:
import unittest
class UnitTests(unittest.TestCase):
def test_spam_all_values(self):
expected = {'enable': True, 'threshold': 5, 'post_to_url': 'https://www.test.com'}
spam_check =... | Add unit tests for spam check | Add unit tests for spam check
| Python | mit | sendgrid/sendgrid-python,sendgrid/sendgrid-python,sendgrid/sendgrid-python | Add unit tests for spam check | from sendgrid.helpers.mail.spam_check import SpamCheck
try:
import unittest2 as unittest
except ImportError:
import unittest
class UnitTests(unittest.TestCase):
def test_spam_all_values(self):
expected = {'enable': True, 'threshold': 5, 'post_to_url': 'https://www.test.com'}
spam_check =... | <commit_before><commit_msg>Add unit tests for spam check<commit_after> | from sendgrid.helpers.mail.spam_check import SpamCheck
try:
import unittest2 as unittest
except ImportError:
import unittest
class UnitTests(unittest.TestCase):
def test_spam_all_values(self):
expected = {'enable': True, 'threshold': 5, 'post_to_url': 'https://www.test.com'}
spam_check =... | Add unit tests for spam checkfrom sendgrid.helpers.mail.spam_check import SpamCheck
try:
import unittest2 as unittest
except ImportError:
import unittest
class UnitTests(unittest.TestCase):
def test_spam_all_values(self):
expected = {'enable': True, 'threshold': 5, 'post_to_url': 'https://www.te... | <commit_before><commit_msg>Add unit tests for spam check<commit_after>from sendgrid.helpers.mail.spam_check import SpamCheck
try:
import unittest2 as unittest
except ImportError:
import unittest
class UnitTests(unittest.TestCase):
def test_spam_all_values(self):
expected = {'enable': True, 'thre... | |
84251f94bf82bf521533f707fc0c93d13ec39efc | newton.py | newton.py | import timeit
import numpy as np
from scipy.linalg import lu_factor, lu_solve
def newton(x0, func, jacobian, tol=1e-2, verbose=False):
dx = None
x = np.copy(x0)
step = 0
while dx is None or np.linalg.norm(dx) > tol:
step += 1
dx = np.linalg.solve(jacobian(x), -func(x))
x += dx
if verbose:
print('step ... | Add Newton solver for non-linear equations | Add Newton solver for non-linear equations
| Python | mit | matthiasplappert/math-algorithms | Add Newton solver for non-linear equations | import timeit
import numpy as np
from scipy.linalg import lu_factor, lu_solve
def newton(x0, func, jacobian, tol=1e-2, verbose=False):
dx = None
x = np.copy(x0)
step = 0
while dx is None or np.linalg.norm(dx) > tol:
step += 1
dx = np.linalg.solve(jacobian(x), -func(x))
x += dx
if verbose:
print('step ... | <commit_before><commit_msg>Add Newton solver for non-linear equations<commit_after> | import timeit
import numpy as np
from scipy.linalg import lu_factor, lu_solve
def newton(x0, func, jacobian, tol=1e-2, verbose=False):
dx = None
x = np.copy(x0)
step = 0
while dx is None or np.linalg.norm(dx) > tol:
step += 1
dx = np.linalg.solve(jacobian(x), -func(x))
x += dx
if verbose:
print('step ... | Add Newton solver for non-linear equationsimport timeit
import numpy as np
from scipy.linalg import lu_factor, lu_solve
def newton(x0, func, jacobian, tol=1e-2, verbose=False):
dx = None
x = np.copy(x0)
step = 0
while dx is None or np.linalg.norm(dx) > tol:
step += 1
dx = np.linalg.solve(jacobian(x), -func(x... | <commit_before><commit_msg>Add Newton solver for non-linear equations<commit_after>import timeit
import numpy as np
from scipy.linalg import lu_factor, lu_solve
def newton(x0, func, jacobian, tol=1e-2, verbose=False):
dx = None
x = np.copy(x0)
step = 0
while dx is None or np.linalg.norm(dx) > tol:
step += 1
... | |
754437642a69338deca196d7758ee37c7d3baffe | tools/make_test_data.py | tools/make_test_data.py | #!/usr/bin/env python
"""Use real bigquery data to create a tinyquery table.
This makes it easier to generate tests for existing queries, since we don't
have to construct the data by hand. Yay!
We assume that you've created application default gcloud credentials, and that
you have the project set to the one you want... | Add a script to generate a tinyquery table literal from data in bigquery | Add a script to generate a tinyquery table literal from data in bigquery
Summary:
Creating tinyquery tables by hand is kind of a pain for tables of any
complexity. This revision adds a script that takes a dataset and table on the
command line and generates a tinyquery table literal (i.e. the python code that
creates ... | Python | mit | Khan/tinyquery | Add a script to generate a tinyquery table literal from data in bigquery
Summary:
Creating tinyquery tables by hand is kind of a pain for tables of any
complexity. This revision adds a script that takes a dataset and table on the
command line and generates a tinyquery table literal (i.e. the python code that
creates ... | #!/usr/bin/env python
"""Use real bigquery data to create a tinyquery table.
This makes it easier to generate tests for existing queries, since we don't
have to construct the data by hand. Yay!
We assume that you've created application default gcloud credentials, and that
you have the project set to the one you want... | <commit_before><commit_msg>Add a script to generate a tinyquery table literal from data in bigquery
Summary:
Creating tinyquery tables by hand is kind of a pain for tables of any
complexity. This revision adds a script that takes a dataset and table on the
command line and generates a tinyquery table literal (i.e. th... | #!/usr/bin/env python
"""Use real bigquery data to create a tinyquery table.
This makes it easier to generate tests for existing queries, since we don't
have to construct the data by hand. Yay!
We assume that you've created application default gcloud credentials, and that
you have the project set to the one you want... | Add a script to generate a tinyquery table literal from data in bigquery
Summary:
Creating tinyquery tables by hand is kind of a pain for tables of any
complexity. This revision adds a script that takes a dataset and table on the
command line and generates a tinyquery table literal (i.e. the python code that
creates ... | <commit_before><commit_msg>Add a script to generate a tinyquery table literal from data in bigquery
Summary:
Creating tinyquery tables by hand is kind of a pain for tables of any
complexity. This revision adds a script that takes a dataset and table on the
command line and generates a tinyquery table literal (i.e. th... | |
fe13379bd4b1cd323c433bfaa8ab75368df3d8c5 | midterm/problem5.py | midterm/problem5.py | # Problem 5
# 10.0 points possible (graded)
# Write a Python function that returns the sum of the pairwise products of listA and listB. You should assume that listA and listB have the same length and are two lists of integer numbers. For example, if listA = [1, 2, 3] and listB = [4, 5, 6], the dot product is 1*4 + 2*5 ... | Write a Python function that returns the sum of the pairwise products of two lists | Write a Python function that returns the sum of the pairwise products of two lists
| Python | mit | Kunal57/MIT_6.00.1x | Write a Python function that returns the sum of the pairwise products of two lists | # Problem 5
# 10.0 points possible (graded)
# Write a Python function that returns the sum of the pairwise products of listA and listB. You should assume that listA and listB have the same length and are two lists of integer numbers. For example, if listA = [1, 2, 3] and listB = [4, 5, 6], the dot product is 1*4 + 2*5 ... | <commit_before><commit_msg>Write a Python function that returns the sum of the pairwise products of two lists<commit_after> | # Problem 5
# 10.0 points possible (graded)
# Write a Python function that returns the sum of the pairwise products of listA and listB. You should assume that listA and listB have the same length and are two lists of integer numbers. For example, if listA = [1, 2, 3] and listB = [4, 5, 6], the dot product is 1*4 + 2*5 ... | Write a Python function that returns the sum of the pairwise products of two lists# Problem 5
# 10.0 points possible (graded)
# Write a Python function that returns the sum of the pairwise products of listA and listB. You should assume that listA and listB have the same length and are two lists of integer numbers. For ... | <commit_before><commit_msg>Write a Python function that returns the sum of the pairwise products of two lists<commit_after># Problem 5
# 10.0 points possible (graded)
# Write a Python function that returns the sum of the pairwise products of listA and listB. You should assume that listA and listB have the same length a... | |
cbcc97af0bc0710358dc04ba927ccde2ef70be8f | cerbero/commands/add_recipe.py | cerbero/commands/add_recipe.py | # cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | Add command to add new recipes | Add command to add new recipes
| Python | lgpl-2.1 | centricular/cerbero,fluendo/cerbero,nirbheek/cerbero,shoreflyer/cerbero,ramaxlo/cerbero,nicolewu/cerbero,freedesktop-unofficial-mirror/gstreamer__cerbero,atsushieno/cerbero,nirbheek/cerbero-old,freedesktop-unofficial-mirror/gstreamer__sdk__cerbero,justinjoy/cerbero,lubosz/cerbero,nzjrs/cerbero,davibe/cerbero,freedeskto... | Add command to add new recipes | # cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | <commit_before><commit_msg>Add command to add new recipes<commit_after> | # cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | Add command to add new recipes# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the... | <commit_before><commit_msg>Add command to add new recipes<commit_after># cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library Gen... | |
0235330fa2b58e166a25a90714436e9503c6c5a9 | examples/plot-results.py | examples/plot-results.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import pickle
from matplotlib import pyplot as plt
if len(sys.argv) < 2:
sys.exit("Usage: plot-results.py <pickle file>")
with open(sys.argv[1], 'rb') as pf:
results = pickle.load(pf)
lines = []
for num, result in results.items():
x, y = zip(*sort... | Add script to plot benchmark results with matplotlib | Add script to plot benchmark results with matplotlib
| Python | mit | benmoran56/esper | Add script to plot benchmark results with matplotlib | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import pickle
from matplotlib import pyplot as plt
if len(sys.argv) < 2:
sys.exit("Usage: plot-results.py <pickle file>")
with open(sys.argv[1], 'rb') as pf:
results = pickle.load(pf)
lines = []
for num, result in results.items():
x, y = zip(*sort... | <commit_before><commit_msg>Add script to plot benchmark results with matplotlib<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import pickle
from matplotlib import pyplot as plt
if len(sys.argv) < 2:
sys.exit("Usage: plot-results.py <pickle file>")
with open(sys.argv[1], 'rb') as pf:
results = pickle.load(pf)
lines = []
for num, result in results.items():
x, y = zip(*sort... | Add script to plot benchmark results with matplotlib#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import pickle
from matplotlib import pyplot as plt
if len(sys.argv) < 2:
sys.exit("Usage: plot-results.py <pickle file>")
with open(sys.argv[1], 'rb') as pf:
results = pickle.load(pf)
lines = []
for ... | <commit_before><commit_msg>Add script to plot benchmark results with matplotlib<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import pickle
from matplotlib import pyplot as plt
if len(sys.argv) < 2:
sys.exit("Usage: plot-results.py <pickle file>")
with open(sys.argv[1], 'rb') as pf:
r... | |
becbda54738ab976342420faf684e9be417132e0 | scripts/transtate.py | scripts/transtate.py | #!/usr/bin/env python
# Extracts the progress of translations from the compilation
# log in easily readable form. Make sure to delete all .qm
# files beforehand.
#
# Usage: cat log | .\transtate.py
#
import sys
import re
def n(val):
return (int(val) if val else 0)
if __name__ == "__main__":
#--Regex mat... | Add a small script to pull translation state from compile logs. | Add a small script to pull translation state from compile logs.
| Python | bsd-3-clause | niko20010/mumble,feld/mumble,mbax/mumble,richard227/mumble,bheart/mumble,feld/mumble,Githlar/mumble,LuAPi/mumble,richard227/mumble,feld/mumble,richard227/mumble,unascribed/mumble,Keridos/mumble,LuAPi/mumble,Lartza/mumble,unascribed/mumble,SuperNascher/mumble,Lartza/mumble,ccpgames/mumble,SuperNascher/mumble,Lartza/mumb... | Add a small script to pull translation state from compile logs. | #!/usr/bin/env python
# Extracts the progress of translations from the compilation
# log in easily readable form. Make sure to delete all .qm
# files beforehand.
#
# Usage: cat log | .\transtate.py
#
import sys
import re
def n(val):
return (int(val) if val else 0)
if __name__ == "__main__":
#--Regex mat... | <commit_before><commit_msg>Add a small script to pull translation state from compile logs.<commit_after> | #!/usr/bin/env python
# Extracts the progress of translations from the compilation
# log in easily readable form. Make sure to delete all .qm
# files beforehand.
#
# Usage: cat log | .\transtate.py
#
import sys
import re
def n(val):
return (int(val) if val else 0)
if __name__ == "__main__":
#--Regex mat... | Add a small script to pull translation state from compile logs.#!/usr/bin/env python
# Extracts the progress of translations from the compilation
# log in easily readable form. Make sure to delete all .qm
# files beforehand.
#
# Usage: cat log | .\transtate.py
#
import sys
import re
def n(val):
return (int(val) i... | <commit_before><commit_msg>Add a small script to pull translation state from compile logs.<commit_after>#!/usr/bin/env python
# Extracts the progress of translations from the compilation
# log in easily readable form. Make sure to delete all .qm
# files beforehand.
#
# Usage: cat log | .\transtate.py
#
import sys
impo... | |
1254177287c7c40bd5658035cedc1fc26598b81e | py/garage/garage/codecs.py | py/garage/garage/codecs.py | """Character encoding error handlers."""
__all__ = [
'make_error_logger',
]
def make_error_logger(logger):
"""Make handlers that logs and ignores encoding errors."""
def log_errors(exc):
logger.error('incorrect character encoding', exc_info=exc)
return ('', exc.end)
return log_errors
| Add character encoding error handler | Add character encoding error handler
| Python | mit | clchiou/garage,clchiou/garage,clchiou/garage,clchiou/garage | Add character encoding error handler | """Character encoding error handlers."""
__all__ = [
'make_error_logger',
]
def make_error_logger(logger):
"""Make handlers that logs and ignores encoding errors."""
def log_errors(exc):
logger.error('incorrect character encoding', exc_info=exc)
return ('', exc.end)
return log_errors
| <commit_before><commit_msg>Add character encoding error handler<commit_after> | """Character encoding error handlers."""
__all__ = [
'make_error_logger',
]
def make_error_logger(logger):
"""Make handlers that logs and ignores encoding errors."""
def log_errors(exc):
logger.error('incorrect character encoding', exc_info=exc)
return ('', exc.end)
return log_errors
| Add character encoding error handler"""Character encoding error handlers."""
__all__ = [
'make_error_logger',
]
def make_error_logger(logger):
"""Make handlers that logs and ignores encoding errors."""
def log_errors(exc):
logger.error('incorrect character encoding', exc_info=exc)
return ... | <commit_before><commit_msg>Add character encoding error handler<commit_after>"""Character encoding error handlers."""
__all__ = [
'make_error_logger',
]
def make_error_logger(logger):
"""Make handlers that logs and ignores encoding errors."""
def log_errors(exc):
logger.error('incorrect character... | |
c1e1d4d40b8344437f8f2fb3fa44f60a42d5112d | config_diag/tests/test_util.py | config_diag/tests/test_util.py |
from .examples import load_email_client
from ..policy import MDPDialogBuilder
from ..util import simulate_dialog, cross_validation
EMAIL_CLIENT = load_email_client()
def test_simulate_dialog():
builder = MDPDialogBuilder(
config_sample=EMAIL_CLIENT.config_sample,
assoc_rule_min_support=EMAIL_CL... | Add a test for simulate_dialog | Add a test for simulate_dialog
| Python | apache-2.0 | yasserglez/configurator,yasserglez/configurator | Add a test for simulate_dialog |
from .examples import load_email_client
from ..policy import MDPDialogBuilder
from ..util import simulate_dialog, cross_validation
EMAIL_CLIENT = load_email_client()
def test_simulate_dialog():
builder = MDPDialogBuilder(
config_sample=EMAIL_CLIENT.config_sample,
assoc_rule_min_support=EMAIL_CL... | <commit_before><commit_msg>Add a test for simulate_dialog<commit_after> |
from .examples import load_email_client
from ..policy import MDPDialogBuilder
from ..util import simulate_dialog, cross_validation
EMAIL_CLIENT = load_email_client()
def test_simulate_dialog():
builder = MDPDialogBuilder(
config_sample=EMAIL_CLIENT.config_sample,
assoc_rule_min_support=EMAIL_CL... | Add a test for simulate_dialog
from .examples import load_email_client
from ..policy import MDPDialogBuilder
from ..util import simulate_dialog, cross_validation
EMAIL_CLIENT = load_email_client()
def test_simulate_dialog():
builder = MDPDialogBuilder(
config_sample=EMAIL_CLIENT.config_sample,
a... | <commit_before><commit_msg>Add a test for simulate_dialog<commit_after>
from .examples import load_email_client
from ..policy import MDPDialogBuilder
from ..util import simulate_dialog, cross_validation
EMAIL_CLIENT = load_email_client()
def test_simulate_dialog():
builder = MDPDialogBuilder(
config_sam... | |
f5382cf42ffb7bb96b4c6616ef59c569194096cf | tests/test_vector2_cross.py | tests/test_vector2_cross.py | from ppb_vector import Vector2
import pytest
@pytest.mark.parametrize("left, right, expected", [
(Vector2(1, 1), Vector2(0, -1), -1),
(Vector2(1, 1), Vector2(-1, 0), 1),
(Vector2(0, 1), Vector2(0, -1), 0),
(Vector2(-1, -1), Vector2(1, 0), 1),
(Vector2(-1, -1), Vector2(-1, 0), -1)
])
def test_cross(... | Add tests for cross product | Add tests for cross product
| Python | artistic-2.0 | ppb/ppb-vector,ppb/ppb-vector | Add tests for cross product | from ppb_vector import Vector2
import pytest
@pytest.mark.parametrize("left, right, expected", [
(Vector2(1, 1), Vector2(0, -1), -1),
(Vector2(1, 1), Vector2(-1, 0), 1),
(Vector2(0, 1), Vector2(0, -1), 0),
(Vector2(-1, -1), Vector2(1, 0), 1),
(Vector2(-1, -1), Vector2(-1, 0), -1)
])
def test_cross(... | <commit_before><commit_msg>Add tests for cross product<commit_after> | from ppb_vector import Vector2
import pytest
@pytest.mark.parametrize("left, right, expected", [
(Vector2(1, 1), Vector2(0, -1), -1),
(Vector2(1, 1), Vector2(-1, 0), 1),
(Vector2(0, 1), Vector2(0, -1), 0),
(Vector2(-1, -1), Vector2(1, 0), 1),
(Vector2(-1, -1), Vector2(-1, 0), -1)
])
def test_cross(... | Add tests for cross productfrom ppb_vector import Vector2
import pytest
@pytest.mark.parametrize("left, right, expected", [
(Vector2(1, 1), Vector2(0, -1), -1),
(Vector2(1, 1), Vector2(-1, 0), 1),
(Vector2(0, 1), Vector2(0, -1), 0),
(Vector2(-1, -1), Vector2(1, 0), 1),
(Vector2(-1, -1), Vector2(-1,... | <commit_before><commit_msg>Add tests for cross product<commit_after>from ppb_vector import Vector2
import pytest
@pytest.mark.parametrize("left, right, expected", [
(Vector2(1, 1), Vector2(0, -1), -1),
(Vector2(1, 1), Vector2(-1, 0), 1),
(Vector2(0, 1), Vector2(0, -1), 0),
(Vector2(-1, -1), Vector2(1, ... | |
532649313b4660f0f2aa360940c8d90d2091dda9 | utils/carouselify_images.py | utils/carouselify_images.py | """ XXX: Helper script ... """
from os.path import basename
from PIL import Image
ASPECT_RATIOS = (1.5, 2, 2.5)
PREFIX = '/assets/img/'
STYLE_MAPPING = {
'1.5': 'visible-sm',
'2': 'visible-md',
'2.5': 'visible-lg',
}
def distance(a, b):
return (a-b) * (a-b)
def save_image(image, aspect_ratio, file... | Add script to generate images suitable for carousel. | Add script to generate images suitable for carousel.
| Python | bsd-3-clause | punchagan/mumbaiultimate.in,punchagan/mumbaiultimate.in | Add script to generate images suitable for carousel. | """ XXX: Helper script ... """
from os.path import basename
from PIL import Image
ASPECT_RATIOS = (1.5, 2, 2.5)
PREFIX = '/assets/img/'
STYLE_MAPPING = {
'1.5': 'visible-sm',
'2': 'visible-md',
'2.5': 'visible-lg',
}
def distance(a, b):
return (a-b) * (a-b)
def save_image(image, aspect_ratio, file... | <commit_before><commit_msg>Add script to generate images suitable for carousel.<commit_after> | """ XXX: Helper script ... """
from os.path import basename
from PIL import Image
ASPECT_RATIOS = (1.5, 2, 2.5)
PREFIX = '/assets/img/'
STYLE_MAPPING = {
'1.5': 'visible-sm',
'2': 'visible-md',
'2.5': 'visible-lg',
}
def distance(a, b):
return (a-b) * (a-b)
def save_image(image, aspect_ratio, file... | Add script to generate images suitable for carousel.""" XXX: Helper script ... """
from os.path import basename
from PIL import Image
ASPECT_RATIOS = (1.5, 2, 2.5)
PREFIX = '/assets/img/'
STYLE_MAPPING = {
'1.5': 'visible-sm',
'2': 'visible-md',
'2.5': 'visible-lg',
}
def distance(a, b):
return (a-b... | <commit_before><commit_msg>Add script to generate images suitable for carousel.<commit_after>""" XXX: Helper script ... """
from os.path import basename
from PIL import Image
ASPECT_RATIOS = (1.5, 2, 2.5)
PREFIX = '/assets/img/'
STYLE_MAPPING = {
'1.5': 'visible-sm',
'2': 'visible-md',
'2.5': 'visible-lg'... | |
fc7904ed8753edba2e3a2ed7f6ca702c2f942903 | test/test_outputs.py | test/test_outputs.py | """Test the output module."""
frc_out = outputs.frc_eia923_df(pudl_engine)
gens_out = outputs.gens_eia860_df(pudl_engine)
gf_out = outputs.gf_eia923_df(pudl_engine)
pu_eia = outputs.plants_utils_eia_df(pudl_engine)
pu_ferc = outputs.plants_utils_ferc_df(pudl_engine)
steam_out = outputs.plants_steam_ferc1_df(pudl_engin... | Add skeletal output test cases. | Add skeletal output test cases.
| Python | mit | catalyst-cooperative/pudl,catalyst-cooperative/pudl | Add skeletal output test cases. | """Test the output module."""
frc_out = outputs.frc_eia923_df(pudl_engine)
gens_out = outputs.gens_eia860_df(pudl_engine)
gf_out = outputs.gf_eia923_df(pudl_engine)
pu_eia = outputs.plants_utils_eia_df(pudl_engine)
pu_ferc = outputs.plants_utils_ferc_df(pudl_engine)
steam_out = outputs.plants_steam_ferc1_df(pudl_engin... | <commit_before><commit_msg>Add skeletal output test cases.<commit_after> | """Test the output module."""
frc_out = outputs.frc_eia923_df(pudl_engine)
gens_out = outputs.gens_eia860_df(pudl_engine)
gf_out = outputs.gf_eia923_df(pudl_engine)
pu_eia = outputs.plants_utils_eia_df(pudl_engine)
pu_ferc = outputs.plants_utils_ferc_df(pudl_engine)
steam_out = outputs.plants_steam_ferc1_df(pudl_engin... | Add skeletal output test cases."""Test the output module."""
frc_out = outputs.frc_eia923_df(pudl_engine)
gens_out = outputs.gens_eia860_df(pudl_engine)
gf_out = outputs.gf_eia923_df(pudl_engine)
pu_eia = outputs.plants_utils_eia_df(pudl_engine)
pu_ferc = outputs.plants_utils_ferc_df(pudl_engine)
steam_out = outputs.p... | <commit_before><commit_msg>Add skeletal output test cases.<commit_after>"""Test the output module."""
frc_out = outputs.frc_eia923_df(pudl_engine)
gens_out = outputs.gens_eia860_df(pudl_engine)
gf_out = outputs.gf_eia923_df(pudl_engine)
pu_eia = outputs.plants_utils_eia_df(pudl_engine)
pu_ferc = outputs.plants_utils_f... | |
0db8f4b170793e1e31cb86479d931239f69efa77 | annealing_lr.py | annealing_lr.py | import abc
from math import exp
"""Classes for annealing learning rate schedules."""
class AnnealingSchedule(object):
def __init__(self, initial_lr, decay_rate, decay_step):
self.initial_lr = initial_lr
self.lr = initial_lr
self.k = k
self.decay_step = decay_step
self.global_step = 0
def __mul__(self, z)... | Implement annealing learning rate schedules. | Implement annealing learning rate schedules.
| Python | mit | prasanna08/MachineLearning | Implement annealing learning rate schedules. | import abc
from math import exp
"""Classes for annealing learning rate schedules."""
class AnnealingSchedule(object):
def __init__(self, initial_lr, decay_rate, decay_step):
self.initial_lr = initial_lr
self.lr = initial_lr
self.k = k
self.decay_step = decay_step
self.global_step = 0
def __mul__(self, z)... | <commit_before><commit_msg>Implement annealing learning rate schedules.<commit_after> | import abc
from math import exp
"""Classes for annealing learning rate schedules."""
class AnnealingSchedule(object):
def __init__(self, initial_lr, decay_rate, decay_step):
self.initial_lr = initial_lr
self.lr = initial_lr
self.k = k
self.decay_step = decay_step
self.global_step = 0
def __mul__(self, z)... | Implement annealing learning rate schedules.import abc
from math import exp
"""Classes for annealing learning rate schedules."""
class AnnealingSchedule(object):
def __init__(self, initial_lr, decay_rate, decay_step):
self.initial_lr = initial_lr
self.lr = initial_lr
self.k = k
self.decay_step = decay_step
... | <commit_before><commit_msg>Implement annealing learning rate schedules.<commit_after>import abc
from math import exp
"""Classes for annealing learning rate schedules."""
class AnnealingSchedule(object):
def __init__(self, initial_lr, decay_rate, decay_step):
self.initial_lr = initial_lr
self.lr = initial_lr
se... | |
39df35c45ffa672b6ad9af962e53a9dc2c45be85 | netprofile_core/netprofile_core/tasks.py | netprofile_core/netprofile_core/tasks.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# NetProfile: Core module - Tasks
# Copyright © 2017 Alex Unigovsky
#
# This file is part of NetProfile.
# NetProfile is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public
# License as published by the Free Software ... | Add internal task to flush mail queue | Add internal task to flush mail queue
| Python | agpl-3.0 | unikmhz/npui,unikmhz/npui,unikmhz/npui,unikmhz/npui | Add internal task to flush mail queue | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# NetProfile: Core module - Tasks
# Copyright © 2017 Alex Unigovsky
#
# This file is part of NetProfile.
# NetProfile is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public
# License as published by the Free Software ... | <commit_before><commit_msg>Add internal task to flush mail queue<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# NetProfile: Core module - Tasks
# Copyright © 2017 Alex Unigovsky
#
# This file is part of NetProfile.
# NetProfile is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public
# License as published by the Free Software ... | Add internal task to flush mail queue#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# NetProfile: Core module - Tasks
# Copyright © 2017 Alex Unigovsky
#
# This file is part of NetProfile.
# NetProfile is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public
# Licen... | <commit_before><commit_msg>Add internal task to flush mail queue<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# NetProfile: Core module - Tasks
# Copyright © 2017 Alex Unigovsky
#
# This file is part of NetProfile.
# NetProfile is free software: you can redistribute it and/or
# modify it under the terms... | |
05624ed9e24886dc8ac0f89b097b8f165aa719fe | tests/test_models.py | tests/test_models.py | #! /usr/bin/env python
import os
import pytest
from pymt import models
@pytest.mark.parametrize("cls", models.__all__)
def test_model_setup(cls):
model = models.__dict__[cls]()
args = model.setup()
assert os.path.isfile(os.path.join(args[1], args[0]))
@pytest.mark.parametrize("cls", models.__all__)
de... | Add simple test for included model IRF methods. | Add simple test for included model IRF methods.
| Python | mit | csdms/pymt,csdms/coupling,csdms/coupling | Add simple test for included model IRF methods. | #! /usr/bin/env python
import os
import pytest
from pymt import models
@pytest.mark.parametrize("cls", models.__all__)
def test_model_setup(cls):
model = models.__dict__[cls]()
args = model.setup()
assert os.path.isfile(os.path.join(args[1], args[0]))
@pytest.mark.parametrize("cls", models.__all__)
de... | <commit_before><commit_msg>Add simple test for included model IRF methods.<commit_after> | #! /usr/bin/env python
import os
import pytest
from pymt import models
@pytest.mark.parametrize("cls", models.__all__)
def test_model_setup(cls):
model = models.__dict__[cls]()
args = model.setup()
assert os.path.isfile(os.path.join(args[1], args[0]))
@pytest.mark.parametrize("cls", models.__all__)
de... | Add simple test for included model IRF methods.#! /usr/bin/env python
import os
import pytest
from pymt import models
@pytest.mark.parametrize("cls", models.__all__)
def test_model_setup(cls):
model = models.__dict__[cls]()
args = model.setup()
assert os.path.isfile(os.path.join(args[1], args[0]))
@py... | <commit_before><commit_msg>Add simple test for included model IRF methods.<commit_after>#! /usr/bin/env python
import os
import pytest
from pymt import models
@pytest.mark.parametrize("cls", models.__all__)
def test_model_setup(cls):
model = models.__dict__[cls]()
args = model.setup()
assert os.path.isf... | |
5f8dd68c094c5da5dd21970eb8038b226521de8b | hydrotrend-2/run_hydrotrend.py | hydrotrend-2/run_hydrotrend.py | #! /usr/bin/env python
# Brokers communication between HydroTrend and Dakota through files.
# Mark Piper (mark.piper@colorado.edu)
import sys
import os
import shutil
from subprocess import call
import numpy as np
def read(file):
'''
Reads a column of text containing HydroTrend output. Returns a numpy array.
... | Add the analysis driver script | Add the analysis driver script
| Python | mit | mdpiper/dakota-experiments,mdpiper/dakota-experiments,mdpiper/dakota-experiments,mcflugen/dakota-experiments,mcflugen/dakota-experiments | Add the analysis driver script | #! /usr/bin/env python
# Brokers communication between HydroTrend and Dakota through files.
# Mark Piper (mark.piper@colorado.edu)
import sys
import os
import shutil
from subprocess import call
import numpy as np
def read(file):
'''
Reads a column of text containing HydroTrend output. Returns a numpy array.
... | <commit_before><commit_msg>Add the analysis driver script<commit_after> | #! /usr/bin/env python
# Brokers communication between HydroTrend and Dakota through files.
# Mark Piper (mark.piper@colorado.edu)
import sys
import os
import shutil
from subprocess import call
import numpy as np
def read(file):
'''
Reads a column of text containing HydroTrend output. Returns a numpy array.
... | Add the analysis driver script#! /usr/bin/env python
# Brokers communication between HydroTrend and Dakota through files.
# Mark Piper (mark.piper@colorado.edu)
import sys
import os
import shutil
from subprocess import call
import numpy as np
def read(file):
'''
Reads a column of text containing HydroTrend o... | <commit_before><commit_msg>Add the analysis driver script<commit_after>#! /usr/bin/env python
# Brokers communication between HydroTrend and Dakota through files.
# Mark Piper (mark.piper@colorado.edu)
import sys
import os
import shutil
from subprocess import call
import numpy as np
def read(file):
'''
Reads... | |
13467a7989c0412a6d5e8815c3441acecd7f5d58 | pymatgen/symmetry/tests/test_spacegroup.py | pymatgen/symmetry/tests/test_spacegroup.py | #!/usr/bin/env python
'''
Created on Mar 12, 2012
'''
from __future__ import division
__author__="Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyue@mit.edu"
__date__ = "Mar 12, 2012"
import unittest
import os
from pymatg... | Add a unittest for spacegroup. Still very basic. | Add a unittest for spacegroup. Still very basic.
Former-commit-id: f539c5f894a6ebd867dfee0eeb5dc1248de11c97 [formerly 2a214050a30048eab177f696d891a33c2860bb55]
Former-commit-id: 26ca50b3c5eceb253d7371b8c0f2a4d08e7f48d7 | Python | mit | johnson1228/pymatgen,mbkumar/pymatgen,matk86/pymatgen,gmatteo/pymatgen,montoyjh/pymatgen,richardtran415/pymatgen,johnson1228/pymatgen,ndardenne/pymatgen,czhengsci/pymatgen,tallakahath/pymatgen,Bismarrck/pymatgen,czhengsci/pymatgen,setten/pymatgen,aykol/pymatgen,mbkumar/pymatgen,dongsenfo/pymatgen,johnson1228/pymatgen,x... | Add a unittest for spacegroup. Still very basic.
Former-commit-id: f539c5f894a6ebd867dfee0eeb5dc1248de11c97 [formerly 2a214050a30048eab177f696d891a33c2860bb55]
Former-commit-id: 26ca50b3c5eceb253d7371b8c0f2a4d08e7f48d7 | #!/usr/bin/env python
'''
Created on Mar 12, 2012
'''
from __future__ import division
__author__="Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyue@mit.edu"
__date__ = "Mar 12, 2012"
import unittest
import os
from pymatg... | <commit_before><commit_msg>Add a unittest for spacegroup. Still very basic.
Former-commit-id: f539c5f894a6ebd867dfee0eeb5dc1248de11c97 [formerly 2a214050a30048eab177f696d891a33c2860bb55]
Former-commit-id: 26ca50b3c5eceb253d7371b8c0f2a4d08e7f48d7<commit_after> | #!/usr/bin/env python
'''
Created on Mar 12, 2012
'''
from __future__ import division
__author__="Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyue@mit.edu"
__date__ = "Mar 12, 2012"
import unittest
import os
from pymatg... | Add a unittest for spacegroup. Still very basic.
Former-commit-id: f539c5f894a6ebd867dfee0eeb5dc1248de11c97 [formerly 2a214050a30048eab177f696d891a33c2860bb55]
Former-commit-id: 26ca50b3c5eceb253d7371b8c0f2a4d08e7f48d7#!/usr/bin/env python
'''
Created on Mar 12, 2012
'''
from __future__ import division
__author__=... | <commit_before><commit_msg>Add a unittest for spacegroup. Still very basic.
Former-commit-id: f539c5f894a6ebd867dfee0eeb5dc1248de11c97 [formerly 2a214050a30048eab177f696d891a33c2860bb55]
Former-commit-id: 26ca50b3c5eceb253d7371b8c0f2a4d08e7f48d7<commit_after>#!/usr/bin/env python
'''
Created on Mar 12, 2012
'''
fro... | |
d576b654c9ae9b53630dd9133d50c7ddc34e1d3a | scripts/addUserCounts.py | scripts/addUserCounts.py | """
To each region, let's add the number of users that tweeted in the region.
"""
import json
import pymongo
import twitterproj
def via_json():
json_files = [
'json/grids.states.bot_filtered.users.json',
'json/grids.counties.bot_filtered.users.json',
'json/grids.squares.bot_filtered.users.... | Add script used to add user counts stored in json file. Still need to modify this so that it is built directly. | Add script used to add user counts stored in json file.
Still need to modify this so that it is built directly.
| Python | unlicense | chebee7i/twitter,chebee7i/twitter,chebee7i/twitter | Add script used to add user counts stored in json file.
Still need to modify this so that it is built directly. | """
To each region, let's add the number of users that tweeted in the region.
"""
import json
import pymongo
import twitterproj
def via_json():
json_files = [
'json/grids.states.bot_filtered.users.json',
'json/grids.counties.bot_filtered.users.json',
'json/grids.squares.bot_filtered.users.... | <commit_before><commit_msg>Add script used to add user counts stored in json file.
Still need to modify this so that it is built directly.<commit_after> | """
To each region, let's add the number of users that tweeted in the region.
"""
import json
import pymongo
import twitterproj
def via_json():
json_files = [
'json/grids.states.bot_filtered.users.json',
'json/grids.counties.bot_filtered.users.json',
'json/grids.squares.bot_filtered.users.... | Add script used to add user counts stored in json file.
Still need to modify this so that it is built directly."""
To each region, let's add the number of users that tweeted in the region.
"""
import json
import pymongo
import twitterproj
def via_json():
json_files = [
'json/grids.states.bot_filtered.user... | <commit_before><commit_msg>Add script used to add user counts stored in json file.
Still need to modify this so that it is built directly.<commit_after>"""
To each region, let's add the number of users that tweeted in the region.
"""
import json
import pymongo
import twitterproj
def via_json():
json_files = [
... | |
5894f4148f6b6311b2985f3b23d9c3545ce55fb1 | bigml/multiple_models.py | bigml/multiple_models.py | # -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2012 BigML
#
# 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 b... | Add simple predict method to multi models | Add simple predict method to multi models
| Python | apache-2.0 | xaowoodenfish/python-1,ShaguptaS/python,mmerce/python,jaor/python,bigmlcom/python | Add simple predict method to multi models | # -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2012 BigML
#
# 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 b... | <commit_before><commit_msg>Add simple predict method to multi models<commit_after> | # -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2012 BigML
#
# 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 b... | Add simple predict method to multi models# -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2012 BigML
#
# 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/l... | <commit_before><commit_msg>Add simple predict method to multi models<commit_after># -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2012 BigML
#
# 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 L... | |
b6353857dc124c8a9295cab865418ee888adf1e9 | examples/plot_mne_example.py | examples/plot_mne_example.py | """
Using NeuroDSP with MNE
=======================
This example explores some example analyses using NeuroDSP, integrated with MNE.
"""
###################################################################################################
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne import i... | Add draft of MNE example | Add draft of MNE example
| Python | apache-2.0 | srcole/neurodsp,srcole/neurodsp,voytekresearch/neurodsp | Add draft of MNE example | """
Using NeuroDSP with MNE
=======================
This example explores some example analyses using NeuroDSP, integrated with MNE.
"""
###################################################################################################
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne import i... | <commit_before><commit_msg>Add draft of MNE example<commit_after> | """
Using NeuroDSP with MNE
=======================
This example explores some example analyses using NeuroDSP, integrated with MNE.
"""
###################################################################################################
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne import i... | Add draft of MNE example"""
Using NeuroDSP with MNE
=======================
This example explores some example analyses using NeuroDSP, integrated with MNE.
"""
###################################################################################################
import numpy as np
import matplotlib.pyplot as plt
impo... | <commit_before><commit_msg>Add draft of MNE example<commit_after>"""
Using NeuroDSP with MNE
=======================
This example explores some example analyses using NeuroDSP, integrated with MNE.
"""
###################################################################################################
import numpy as... | |
44bbd4fd96791d14a4cb4165d049badf750397dc | bidb/keys/tasks.py | bidb/keys/tasks.py | import celery
import subprocess
from bidb.utils.tempfile import TemporaryDirectory
from .models import Key
@celery.task(soft_time_limit=60)
def update_or_create_key(uid):
with TemporaryDirectory() as homedir:
subprocess.check_call((
'gpg',
'--homedir', homedir,
'--key... | Add async task to update/create key ids. | Add async task to update/create key ids.
This might need to be reworked so that Key instances always exist but then
we fill in 'name' etc. later/asynchronously.
Signed-off-by: Chris Lamb <29e6d179a8d73471df7861382db6dd7e64138033@debian.org>
| Python | agpl-3.0 | lamby/buildinfo.debian.net,lamby/buildinfo.debian.net | Add async task to update/create key ids.
This might need to be reworked so that Key instances always exist but then
we fill in 'name' etc. later/asynchronously.
Signed-off-by: Chris Lamb <29e6d179a8d73471df7861382db6dd7e64138033@debian.org> | import celery
import subprocess
from bidb.utils.tempfile import TemporaryDirectory
from .models import Key
@celery.task(soft_time_limit=60)
def update_or_create_key(uid):
with TemporaryDirectory() as homedir:
subprocess.check_call((
'gpg',
'--homedir', homedir,
'--key... | <commit_before><commit_msg>Add async task to update/create key ids.
This might need to be reworked so that Key instances always exist but then
we fill in 'name' etc. later/asynchronously.
Signed-off-by: Chris Lamb <29e6d179a8d73471df7861382db6dd7e64138033@debian.org><commit_after> | import celery
import subprocess
from bidb.utils.tempfile import TemporaryDirectory
from .models import Key
@celery.task(soft_time_limit=60)
def update_or_create_key(uid):
with TemporaryDirectory() as homedir:
subprocess.check_call((
'gpg',
'--homedir', homedir,
'--key... | Add async task to update/create key ids.
This might need to be reworked so that Key instances always exist but then
we fill in 'name' etc. later/asynchronously.
Signed-off-by: Chris Lamb <29e6d179a8d73471df7861382db6dd7e64138033@debian.org>import celery
import subprocess
from bidb.utils.tempfile import TemporaryDire... | <commit_before><commit_msg>Add async task to update/create key ids.
This might need to be reworked so that Key instances always exist but then
we fill in 'name' etc. later/asynchronously.
Signed-off-by: Chris Lamb <29e6d179a8d73471df7861382db6dd7e64138033@debian.org><commit_after>import celery
import subprocess
from... | |
bcda46423bd28b60aac8a9befd3e06670a9675c8 | sync_scheduler.py | sync_scheduler.py | from tapiriik.database import db
from tapiriik.messagequeue import mq
from tapiriik.sync import Sync
from datetime import datetime
from pymongo.read_preferences import ReadPreference
import kombu
import time
Sync.InitializeWorkerBindings()
producer = kombu.Producer(Sync._channel, Sync._exchange)
while True:
queuein... | from tapiriik.database import db
from tapiriik.messagequeue import mq
from tapiriik.sync import Sync
from datetime import datetime
from pymongo.read_preferences import ReadPreference
import kombu
import time
Sync.InitializeWorkerBindings()
producer = kombu.Producer(Sync._channel, Sync._exchange)
while True:
queuein... | Include queued date in MQ messages | Include queued date in MQ messages | Python | apache-2.0 | abs0/tapiriik,mduggan/tapiriik,marxin/tapiriik,niosus/tapiriik,marxin/tapiriik,gavioto/tapiriik,dmschreiber/tapiriik,dlenski/tapiriik,campbellr/tapiriik,abhijit86k/tapiriik,gavioto/tapiriik,dlenski/tapiriik,abhijit86k/tapiriik,marxin/tapiriik,dmschreiber/tapiriik,dmschreiber/tapiriik,olamy/tapiriik,campbellr/tapiriik,c... | from tapiriik.database import db
from tapiriik.messagequeue import mq
from tapiriik.sync import Sync
from datetime import datetime
from pymongo.read_preferences import ReadPreference
import kombu
import time
Sync.InitializeWorkerBindings()
producer = kombu.Producer(Sync._channel, Sync._exchange)
while True:
queuein... | from tapiriik.database import db
from tapiriik.messagequeue import mq
from tapiriik.sync import Sync
from datetime import datetime
from pymongo.read_preferences import ReadPreference
import kombu
import time
Sync.InitializeWorkerBindings()
producer = kombu.Producer(Sync._channel, Sync._exchange)
while True:
queuein... | <commit_before>from tapiriik.database import db
from tapiriik.messagequeue import mq
from tapiriik.sync import Sync
from datetime import datetime
from pymongo.read_preferences import ReadPreference
import kombu
import time
Sync.InitializeWorkerBindings()
producer = kombu.Producer(Sync._channel, Sync._exchange)
while... | from tapiriik.database import db
from tapiriik.messagequeue import mq
from tapiriik.sync import Sync
from datetime import datetime
from pymongo.read_preferences import ReadPreference
import kombu
import time
Sync.InitializeWorkerBindings()
producer = kombu.Producer(Sync._channel, Sync._exchange)
while True:
queuein... | from tapiriik.database import db
from tapiriik.messagequeue import mq
from tapiriik.sync import Sync
from datetime import datetime
from pymongo.read_preferences import ReadPreference
import kombu
import time
Sync.InitializeWorkerBindings()
producer = kombu.Producer(Sync._channel, Sync._exchange)
while True:
queuein... | <commit_before>from tapiriik.database import db
from tapiriik.messagequeue import mq
from tapiriik.sync import Sync
from datetime import datetime
from pymongo.read_preferences import ReadPreference
import kombu
import time
Sync.InitializeWorkerBindings()
producer = kombu.Producer(Sync._channel, Sync._exchange)
while... |
5368a3728560f0da460a19b67af4c607dc01a0c7 | teemof/analyze.py | teemof/analyze.py | # Analyze thermal conductivity results
# Date: June 2017
# Author: Kutay B. Sezginel
import os
import numpy as np
from teemof.read import avg_kt, get_kt, read_runs, read_legend
def analyze_trial_set(trial_set_dir, xkey='mass2', sort=True, t0=10, t1=20):
""" Read thermal conductivity for a set of trials, get appro... | Add thermal conductivity trend analysis library. | Add thermal conductivity trend analysis library.
| Python | mit | kbsezginel/tee_mof,kbsezginel/tee_mof | Add thermal conductivity trend analysis library. | # Analyze thermal conductivity results
# Date: June 2017
# Author: Kutay B. Sezginel
import os
import numpy as np
from teemof.read import avg_kt, get_kt, read_runs, read_legend
def analyze_trial_set(trial_set_dir, xkey='mass2', sort=True, t0=10, t1=20):
""" Read thermal conductivity for a set of trials, get appro... | <commit_before><commit_msg>Add thermal conductivity trend analysis library.<commit_after> | # Analyze thermal conductivity results
# Date: June 2017
# Author: Kutay B. Sezginel
import os
import numpy as np
from teemof.read import avg_kt, get_kt, read_runs, read_legend
def analyze_trial_set(trial_set_dir, xkey='mass2', sort=True, t0=10, t1=20):
""" Read thermal conductivity for a set of trials, get appro... | Add thermal conductivity trend analysis library.# Analyze thermal conductivity results
# Date: June 2017
# Author: Kutay B. Sezginel
import os
import numpy as np
from teemof.read import avg_kt, get_kt, read_runs, read_legend
def analyze_trial_set(trial_set_dir, xkey='mass2', sort=True, t0=10, t1=20):
""" Read the... | <commit_before><commit_msg>Add thermal conductivity trend analysis library.<commit_after># Analyze thermal conductivity results
# Date: June 2017
# Author: Kutay B. Sezginel
import os
import numpy as np
from teemof.read import avg_kt, get_kt, read_runs, read_legend
def analyze_trial_set(trial_set_dir, xkey='mass2', s... | |
e01798c18faa59b2bedd8bd5e592a967512d94ef | 16B/spw_setup.py | 16B/spw_setup.py |
# Line SPW setup for 16B projects
linespw_dict = {0: ["HI", "1.420405752GHz"],
3: ["OH1612", "1.612231GHz"],
5: ["OH1665", "1.6654018GHz"],
6: ["OH1667", "1.667359GHz"],
7: ["OH1720", "1.72053GHz"],
9: ["H152alp", "1.85425GHz"],
... | Add line SPW setup info for 16B | Add line SPW setup info for 16B
| Python | mit | e-koch/VLA_Lband,e-koch/VLA_Lband | Add line SPW setup info for 16B |
# Line SPW setup for 16B projects
linespw_dict = {0: ["HI", "1.420405752GHz"],
3: ["OH1612", "1.612231GHz"],
5: ["OH1665", "1.6654018GHz"],
6: ["OH1667", "1.667359GHz"],
7: ["OH1720", "1.72053GHz"],
9: ["H152alp", "1.85425GHz"],
... | <commit_before><commit_msg>Add line SPW setup info for 16B<commit_after> |
# Line SPW setup for 16B projects
linespw_dict = {0: ["HI", "1.420405752GHz"],
3: ["OH1612", "1.612231GHz"],
5: ["OH1665", "1.6654018GHz"],
6: ["OH1667", "1.667359GHz"],
7: ["OH1720", "1.72053GHz"],
9: ["H152alp", "1.85425GHz"],
... | Add line SPW setup info for 16B
# Line SPW setup for 16B projects
linespw_dict = {0: ["HI", "1.420405752GHz"],
3: ["OH1612", "1.612231GHz"],
5: ["OH1665", "1.6654018GHz"],
6: ["OH1667", "1.667359GHz"],
7: ["OH1720", "1.72053GHz"],
9: ["H15... | <commit_before><commit_msg>Add line SPW setup info for 16B<commit_after>
# Line SPW setup for 16B projects
linespw_dict = {0: ["HI", "1.420405752GHz"],
3: ["OH1612", "1.612231GHz"],
5: ["OH1665", "1.6654018GHz"],
6: ["OH1667", "1.667359GHz"],
7: ["OH1720"... | |
ed9375ef9ed0c7d6b98c827db2db0f59369eedb6 | make-cbr.py | make-cbr.py | #!/usr/bin/env python
from __future__ import print_function
from path import Path
import sys
import subprocess
import re
for d in sys.argv[1:]:
filename = re.sub('\.?(/Check me|pdf|rar)$', '', d) + ".cbr"
dir = Path(d)
jpgs = dir.files('*.jpg') + dir.files('*.jpeg')
if len(jpgs) < 10:
print('n... | Add script to make cbr archive out of jpegs | Add script to make cbr archive out of jpegs
The cbr commic archive format is just jpegs compressed with rar.
This script will automate the process of creating one from a folder of
jpegs.
| Python | bsd-3-clause | FreekKalter/linux-scripts,FreekKalter/linux-scripts,FreekKalter/linux-scripts,FreekKalter/linux-scripts | Add script to make cbr archive out of jpegs
The cbr commic archive format is just jpegs compressed with rar.
This script will automate the process of creating one from a folder of
jpegs. | #!/usr/bin/env python
from __future__ import print_function
from path import Path
import sys
import subprocess
import re
for d in sys.argv[1:]:
filename = re.sub('\.?(/Check me|pdf|rar)$', '', d) + ".cbr"
dir = Path(d)
jpgs = dir.files('*.jpg') + dir.files('*.jpeg')
if len(jpgs) < 10:
print('n... | <commit_before><commit_msg>Add script to make cbr archive out of jpegs
The cbr commic archive format is just jpegs compressed with rar.
This script will automate the process of creating one from a folder of
jpegs.<commit_after> | #!/usr/bin/env python
from __future__ import print_function
from path import Path
import sys
import subprocess
import re
for d in sys.argv[1:]:
filename = re.sub('\.?(/Check me|pdf|rar)$', '', d) + ".cbr"
dir = Path(d)
jpgs = dir.files('*.jpg') + dir.files('*.jpeg')
if len(jpgs) < 10:
print('n... | Add script to make cbr archive out of jpegs
The cbr commic archive format is just jpegs compressed with rar.
This script will automate the process of creating one from a folder of
jpegs.#!/usr/bin/env python
from __future__ import print_function
from path import Path
import sys
import subprocess
import re
for d in s... | <commit_before><commit_msg>Add script to make cbr archive out of jpegs
The cbr commic archive format is just jpegs compressed with rar.
This script will automate the process of creating one from a folder of
jpegs.<commit_after>#!/usr/bin/env python
from __future__ import print_function
from path import Path
import sys... | |
5be4fde44d7ce7cb7937f2dccdd097aa47faf0d7 | DataWrangling/process_csv.py | DataWrangling/process_csv.py | # -*- coding: utf-8 -*-
'''
Transform csv files in dict structures and print in a pretty form
'''
import os
import pprint
import csv
# Set the directory for the data and the name of the file
DATADIR = '../Data/'
DATAFILE = 'beatles-diskography.csv'
def parse_csv(datafile):
data = []
# Open the file
wit... | Add script to transform csv files in dict structure | feat: Add script to transform csv files in dict structure
Reads a csv file to transform in dict structure and then print it
in a frienly format
| Python | mit | aguijarro/DataSciencePython | feat: Add script to transform csv files in dict structure
Reads a csv file to transform in dict structure and then print it
in a frienly format | # -*- coding: utf-8 -*-
'''
Transform csv files in dict structures and print in a pretty form
'''
import os
import pprint
import csv
# Set the directory for the data and the name of the file
DATADIR = '../Data/'
DATAFILE = 'beatles-diskography.csv'
def parse_csv(datafile):
data = []
# Open the file
wit... | <commit_before><commit_msg>feat: Add script to transform csv files in dict structure
Reads a csv file to transform in dict structure and then print it
in a frienly format<commit_after> | # -*- coding: utf-8 -*-
'''
Transform csv files in dict structures and print in a pretty form
'''
import os
import pprint
import csv
# Set the directory for the data and the name of the file
DATADIR = '../Data/'
DATAFILE = 'beatles-diskography.csv'
def parse_csv(datafile):
data = []
# Open the file
wit... | feat: Add script to transform csv files in dict structure
Reads a csv file to transform in dict structure and then print it
in a frienly format# -*- coding: utf-8 -*-
'''
Transform csv files in dict structures and print in a pretty form
'''
import os
import pprint
import csv
# Set the directory for the data and the ... | <commit_before><commit_msg>feat: Add script to transform csv files in dict structure
Reads a csv file to transform in dict structure and then print it
in a frienly format<commit_after># -*- coding: utf-8 -*-
'''
Transform csv files in dict structures and print in a pretty form
'''
import os
import pprint
import csv
... | |
e14ee15116ee2137d528d298ca38e26e4f02f09f | htpcfrontend.py | htpcfrontend.py | from flask import Flask, render_template
from settings import *
import jsonrpclib
app = Flask(__name__)
@app.route('/')
def index():
xbmc = jsonrpclib.Server(SERVER_ADDRESS)
episodes = xbmc.VideoLibrary.GetRecentlyAddedEpisodes()
recently_added_episodes = []
# tidy up filenames of recently added epi... | from flask import Flask, render_template
from settings import *
import jsonrpclib
app = Flask(__name__)
@app.route('/')
def index():
xbmc = jsonrpclib.Server(SERVER_ADDRESS)
episodes = xbmc.VideoLibrary.GetRecentlyAddedEpisodes()
recently_added_episodes = []
# tidy up filenames of recently added epi... | Revert "retrieve currently playing info (commented out)" | Revert "retrieve currently playing info (commented out)"
This reverts commit 2c07f2110c844ce86af2fc0b818db196379d9310.
| Python | mit | robweber/maraschino,insertnamehere1/maraschino,mrkipling/maraschino,gugahoi/maraschino,runjmc/maraschino,runjmc/maraschino,insertnamehere1/maraschino,gugahoi/maraschino,mboeru/maraschino,awagnon/maraschino,mrkipling/maraschino,insertnamehere1/maraschino,mboeru/maraschino,awagnon/maraschino,robweber/maraschino,awagnon/m... | from flask import Flask, render_template
from settings import *
import jsonrpclib
app = Flask(__name__)
@app.route('/')
def index():
xbmc = jsonrpclib.Server(SERVER_ADDRESS)
episodes = xbmc.VideoLibrary.GetRecentlyAddedEpisodes()
recently_added_episodes = []
# tidy up filenames of recently added epi... | from flask import Flask, render_template
from settings import *
import jsonrpclib
app = Flask(__name__)
@app.route('/')
def index():
xbmc = jsonrpclib.Server(SERVER_ADDRESS)
episodes = xbmc.VideoLibrary.GetRecentlyAddedEpisodes()
recently_added_episodes = []
# tidy up filenames of recently added epi... | <commit_before>from flask import Flask, render_template
from settings import *
import jsonrpclib
app = Flask(__name__)
@app.route('/')
def index():
xbmc = jsonrpclib.Server(SERVER_ADDRESS)
episodes = xbmc.VideoLibrary.GetRecentlyAddedEpisodes()
recently_added_episodes = []
# tidy up filenames of rec... | from flask import Flask, render_template
from settings import *
import jsonrpclib
app = Flask(__name__)
@app.route('/')
def index():
xbmc = jsonrpclib.Server(SERVER_ADDRESS)
episodes = xbmc.VideoLibrary.GetRecentlyAddedEpisodes()
recently_added_episodes = []
# tidy up filenames of recently added epi... | from flask import Flask, render_template
from settings import *
import jsonrpclib
app = Flask(__name__)
@app.route('/')
def index():
xbmc = jsonrpclib.Server(SERVER_ADDRESS)
episodes = xbmc.VideoLibrary.GetRecentlyAddedEpisodes()
recently_added_episodes = []
# tidy up filenames of recently added epi... | <commit_before>from flask import Flask, render_template
from settings import *
import jsonrpclib
app = Flask(__name__)
@app.route('/')
def index():
xbmc = jsonrpclib.Server(SERVER_ADDRESS)
episodes = xbmc.VideoLibrary.GetRecentlyAddedEpisodes()
recently_added_episodes = []
# tidy up filenames of rec... |
066c248ca31b13bcde7ace756c27cf4d8b46ef9d | tests/test_authors.py | tests/test_authors.py | from os.path import dirname, join
import subprocess
import unittest
from cvsgit.command.clone import Clone
from cvsgit.git import Git
from cvsgit.utils import Tempdir
from cvsgit.main import UnknownAuthorFullnames
class Test(unittest.TestCase):
def setUp(self):
self.tempdir = Tempdir(cwd=True)
se... | Add test case for authors mapping | Add test case for authors mapping
| Python | isc | ustuehler/git-cvs,ustuehler/git-cvs | Add test case for authors mapping | from os.path import dirname, join
import subprocess
import unittest
from cvsgit.command.clone import Clone
from cvsgit.git import Git
from cvsgit.utils import Tempdir
from cvsgit.main import UnknownAuthorFullnames
class Test(unittest.TestCase):
def setUp(self):
self.tempdir = Tempdir(cwd=True)
se... | <commit_before><commit_msg>Add test case for authors mapping<commit_after> | from os.path import dirname, join
import subprocess
import unittest
from cvsgit.command.clone import Clone
from cvsgit.git import Git
from cvsgit.utils import Tempdir
from cvsgit.main import UnknownAuthorFullnames
class Test(unittest.TestCase):
def setUp(self):
self.tempdir = Tempdir(cwd=True)
se... | Add test case for authors mappingfrom os.path import dirname, join
import subprocess
import unittest
from cvsgit.command.clone import Clone
from cvsgit.git import Git
from cvsgit.utils import Tempdir
from cvsgit.main import UnknownAuthorFullnames
class Test(unittest.TestCase):
def setUp(self):
self.tempd... | <commit_before><commit_msg>Add test case for authors mapping<commit_after>from os.path import dirname, join
import subprocess
import unittest
from cvsgit.command.clone import Clone
from cvsgit.git import Git
from cvsgit.utils import Tempdir
from cvsgit.main import UnknownAuthorFullnames
class Test(unittest.TestCase):... | |
982d57604c95ce7f3dd4a422cee82f5bec2b6553 | tests/test_plotting.py | tests/test_plotting.py | """Integration tests for plotting tools."""
from emdp import examples
from emdp.gridworld import GridWorldPlotter
from emdp import actions
import random
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
def test_plotting_integration():
mdp = examples.build_SB_example35()
trajectories = ... | Add integration test for plotting utilities | Add integration test for plotting utilities
| Python | mit | zafarali/emdp | Add integration test for plotting utilities | """Integration tests for plotting tools."""
from emdp import examples
from emdp.gridworld import GridWorldPlotter
from emdp import actions
import random
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
def test_plotting_integration():
mdp = examples.build_SB_example35()
trajectories = ... | <commit_before><commit_msg>Add integration test for plotting utilities<commit_after> | """Integration tests for plotting tools."""
from emdp import examples
from emdp.gridworld import GridWorldPlotter
from emdp import actions
import random
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
def test_plotting_integration():
mdp = examples.build_SB_example35()
trajectories = ... | Add integration test for plotting utilities"""Integration tests for plotting tools."""
from emdp import examples
from emdp.gridworld import GridWorldPlotter
from emdp import actions
import random
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
def test_plotting_integration():
mdp = example... | <commit_before><commit_msg>Add integration test for plotting utilities<commit_after>"""Integration tests for plotting tools."""
from emdp import examples
from emdp.gridworld import GridWorldPlotter
from emdp import actions
import random
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
def test_... | |
74c67a6dc619d5da6dbff67c1679859c3ac26281 | tests/test_tabulate.py | tests/test_tabulate.py | from pgcli.packages.tabulate import tabulate
from textwrap import dedent
def test_dont_strip_leading_whitespace():
data = [[' abc']]
headers = ['xyz']
tbl, _ = tabulate(data, headers, tablefmt='psql')
assert tbl == dedent('''
+---------+
| xyz |
|---------|
| ... | Add a test written by darikg. Not actually executed, please confirm it. | Add a test written by darikg. Not actually executed, please confirm it.
| Python | bsd-3-clause | dbcli/pgcli,koljonen/pgcli,dbcli/pgcli,darikg/pgcli,koljonen/pgcli,d33tah/pgcli,d33tah/pgcli,darikg/pgcli | Add a test written by darikg. Not actually executed, please confirm it. | from pgcli.packages.tabulate import tabulate
from textwrap import dedent
def test_dont_strip_leading_whitespace():
data = [[' abc']]
headers = ['xyz']
tbl, _ = tabulate(data, headers, tablefmt='psql')
assert tbl == dedent('''
+---------+
| xyz |
|---------|
| ... | <commit_before><commit_msg>Add a test written by darikg. Not actually executed, please confirm it.<commit_after> | from pgcli.packages.tabulate import tabulate
from textwrap import dedent
def test_dont_strip_leading_whitespace():
data = [[' abc']]
headers = ['xyz']
tbl, _ = tabulate(data, headers, tablefmt='psql')
assert tbl == dedent('''
+---------+
| xyz |
|---------|
| ... | Add a test written by darikg. Not actually executed, please confirm it.from pgcli.packages.tabulate import tabulate
from textwrap import dedent
def test_dont_strip_leading_whitespace():
data = [[' abc']]
headers = ['xyz']
tbl, _ = tabulate(data, headers, tablefmt='psql')
assert tbl == dedent('''
... | <commit_before><commit_msg>Add a test written by darikg. Not actually executed, please confirm it.<commit_after>from pgcli.packages.tabulate import tabulate
from textwrap import dedent
def test_dont_strip_leading_whitespace():
data = [[' abc']]
headers = ['xyz']
tbl, _ = tabulate(data, headers, tablefm... | |
23003c2ad9c69a198e2b84a3a1c59ab13b165eb0 | send_sms.py | send_sms.py | from twilio.rest import TwilioRestClient
# Find these values at https://twilio.com/user/account
account_sid = "AC00b0db4128bdf9e869bed9ec08e8xxxx" //check your account
auth_token = "9887b585dd9f708da2a154f33cd4xxxx" //check your account
client = TwilioRestClient(account_sid, auth_token)
message = client.messages... | Send sms to phones via twilio api | Send sms to phones via twilio api
first install twilio using cmd pip install twilio after this step run the above script to send sms , update sid and token wrt your accounts | Python | mit | Naveenkhasyap/python_scripts,Naveenkhasyap/python_scripts | Send sms to phones via twilio api
first install twilio using cmd pip install twilio after this step run the above script to send sms , update sid and token wrt your accounts | from twilio.rest import TwilioRestClient
# Find these values at https://twilio.com/user/account
account_sid = "AC00b0db4128bdf9e869bed9ec08e8xxxx" //check your account
auth_token = "9887b585dd9f708da2a154f33cd4xxxx" //check your account
client = TwilioRestClient(account_sid, auth_token)
message = client.messages... | <commit_before><commit_msg>Send sms to phones via twilio api
first install twilio using cmd pip install twilio after this step run the above script to send sms , update sid and token wrt your accounts<commit_after> | from twilio.rest import TwilioRestClient
# Find these values at https://twilio.com/user/account
account_sid = "AC00b0db4128bdf9e869bed9ec08e8xxxx" //check your account
auth_token = "9887b585dd9f708da2a154f33cd4xxxx" //check your account
client = TwilioRestClient(account_sid, auth_token)
message = client.messages... | Send sms to phones via twilio api
first install twilio using cmd pip install twilio after this step run the above script to send sms , update sid and token wrt your accountsfrom twilio.rest import TwilioRestClient
# Find these values at https://twilio.com/user/account
account_sid = "AC00b0db4128bdf9e869bed9ec08e8xxxx... | <commit_before><commit_msg>Send sms to phones via twilio api
first install twilio using cmd pip install twilio after this step run the above script to send sms , update sid and token wrt your accounts<commit_after>from twilio.rest import TwilioRestClient
# Find these values at https://twilio.com/user/account
account_... | |
f75d8e315a290bb1b5b78cacfbd52191abef0fdf | javelin/structure.py | javelin/structure.py | import numpy as np
from pandas import DataFrame
from javelin.unitcell import UnitCell
class Structure(object):
def __init__(self):
self.unitcell = UnitCell()
self.atoms = DataFrame(columns=['i', 'j', 'k', 'site',
'Z', 'symbol',
... | Add Structure class using pandas DataFrame | Add Structure class using pandas DataFrame
| Python | mit | rosswhitfield/javelin | Add Structure class using pandas DataFrame | import numpy as np
from pandas import DataFrame
from javelin.unitcell import UnitCell
class Structure(object):
def __init__(self):
self.unitcell = UnitCell()
self.atoms = DataFrame(columns=['i', 'j', 'k', 'site',
'Z', 'symbol',
... | <commit_before><commit_msg>Add Structure class using pandas DataFrame<commit_after> | import numpy as np
from pandas import DataFrame
from javelin.unitcell import UnitCell
class Structure(object):
def __init__(self):
self.unitcell = UnitCell()
self.atoms = DataFrame(columns=['i', 'j', 'k', 'site',
'Z', 'symbol',
... | Add Structure class using pandas DataFrameimport numpy as np
from pandas import DataFrame
from javelin.unitcell import UnitCell
class Structure(object):
def __init__(self):
self.unitcell = UnitCell()
self.atoms = DataFrame(columns=['i', 'j', 'k', 'site',
'Z'... | <commit_before><commit_msg>Add Structure class using pandas DataFrame<commit_after>import numpy as np
from pandas import DataFrame
from javelin.unitcell import UnitCell
class Structure(object):
def __init__(self):
self.unitcell = UnitCell()
self.atoms = DataFrame(columns=['i', 'j', 'k', 'site',
... | |
dec17e4d8eb88610fbe81aeef84ea41b76b0e398 | ListItems.py | ListItems.py | import os
import json
import re
###############################################
# Run this from the root of the assets folder #
###############################################
# Some code from http://www.lifl.fr/~riquetd/parse-a-json-file-with-comments.html
# "Parse a JSON file with comments"
comment_re = re.compile... | Add a python script to list all items | Add a python script to list all items
Saves the item name, item path, and image path into "items.json"
| Python | mit | McSimp/starbound-research | Add a python script to list all items
Saves the item name, item path, and image path into "items.json" | import os
import json
import re
###############################################
# Run this from the root of the assets folder #
###############################################
# Some code from http://www.lifl.fr/~riquetd/parse-a-json-file-with-comments.html
# "Parse a JSON file with comments"
comment_re = re.compile... | <commit_before><commit_msg>Add a python script to list all items
Saves the item name, item path, and image path into "items.json"<commit_after> | import os
import json
import re
###############################################
# Run this from the root of the assets folder #
###############################################
# Some code from http://www.lifl.fr/~riquetd/parse-a-json-file-with-comments.html
# "Parse a JSON file with comments"
comment_re = re.compile... | Add a python script to list all items
Saves the item name, item path, and image path into "items.json"import os
import json
import re
###############################################
# Run this from the root of the assets folder #
###############################################
# Some code from http://www.lifl.fr/~ri... | <commit_before><commit_msg>Add a python script to list all items
Saves the item name, item path, and image path into "items.json"<commit_after>import os
import json
import re
###############################################
# Run this from the root of the assets folder #
###############################################... | |
83a2a04ec5b416e68588142ececb055d646a5449 | nose2/tests/functional/__init__.py | nose2/tests/functional/__init__.py | import os
SUPPORT = os.path.abspath(os.path.join(os.path.dirname(__file__), 'support'))
def support_file(*path_parts):
return os.path.join(SUPPORT, *path_parts)
| import os
import subprocess
SUPPORT = os.path.abspath(os.path.join(os.path.dirname(__file__), 'support'))
def support_file(*path_parts):
return os.path.join(SUPPORT, *path_parts)
def run_nose2(*nose2_args, **popen_args):
if 'cwd' in popen_args:
cwd = popen_args.pop('cwd')
if not os.path.isa... | Add utility function for executing test runs | Add utility function for executing test runs
| Python | bsd-2-clause | ezigman/nose2,ojengwa/nose2,leth/nose2,leth/nose2,little-dude/nose2,little-dude/nose2,ptthiem/nose2,ojengwa/nose2,ptthiem/nose2,ezigman/nose2 | import os
SUPPORT = os.path.abspath(os.path.join(os.path.dirname(__file__), 'support'))
def support_file(*path_parts):
return os.path.join(SUPPORT, *path_parts)
Add utility function for executing test runs | import os
import subprocess
SUPPORT = os.path.abspath(os.path.join(os.path.dirname(__file__), 'support'))
def support_file(*path_parts):
return os.path.join(SUPPORT, *path_parts)
def run_nose2(*nose2_args, **popen_args):
if 'cwd' in popen_args:
cwd = popen_args.pop('cwd')
if not os.path.isa... | <commit_before>import os
SUPPORT = os.path.abspath(os.path.join(os.path.dirname(__file__), 'support'))
def support_file(*path_parts):
return os.path.join(SUPPORT, *path_parts)
<commit_msg>Add utility function for executing test runs<commit_after> | import os
import subprocess
SUPPORT = os.path.abspath(os.path.join(os.path.dirname(__file__), 'support'))
def support_file(*path_parts):
return os.path.join(SUPPORT, *path_parts)
def run_nose2(*nose2_args, **popen_args):
if 'cwd' in popen_args:
cwd = popen_args.pop('cwd')
if not os.path.isa... | import os
SUPPORT = os.path.abspath(os.path.join(os.path.dirname(__file__), 'support'))
def support_file(*path_parts):
return os.path.join(SUPPORT, *path_parts)
Add utility function for executing test runsimport os
import subprocess
SUPPORT = os.path.abspath(os.path.join(os.path.dirname(__file__), 'support'))
d... | <commit_before>import os
SUPPORT = os.path.abspath(os.path.join(os.path.dirname(__file__), 'support'))
def support_file(*path_parts):
return os.path.join(SUPPORT, *path_parts)
<commit_msg>Add utility function for executing test runs<commit_after>import os
import subprocess
SUPPORT = os.path.abspath(os.path.join(... |
21bdda2f1a001dde6ed2aea34d3dccd7e63a5a37 | src_py/writeGPIO.py | src_py/writeGPIO.py | import RPi.GPIO as GPIO
from time import sleep
GPIO.setmode(GPIO.BCM)
GPIO.setup(9, GPIO.OUT)
GPIO.setup(11, GPIO.OUT)
while 1:
GPIO.output(9, True)
sleep(0.25)
GPIO.output(9, False)
sleep(0.25)
GPIO.output(11, True)
sleep(0.25)
GPIO.output(11, False)
sleep(0.25)
#GPIO.output(11, True)
#sleep(0... | Write in gpio on raspberry | Write in gpio on raspberry
| Python | mit | nich2000/ncs,nich2000/ncs,nich2000/ncs,nich2000/ncs,nich2000/ncs,nich2000/ncs,nich2000/ncs | Write in gpio on raspberry | import RPi.GPIO as GPIO
from time import sleep
GPIO.setmode(GPIO.BCM)
GPIO.setup(9, GPIO.OUT)
GPIO.setup(11, GPIO.OUT)
while 1:
GPIO.output(9, True)
sleep(0.25)
GPIO.output(9, False)
sleep(0.25)
GPIO.output(11, True)
sleep(0.25)
GPIO.output(11, False)
sleep(0.25)
#GPIO.output(11, True)
#sleep(0... | <commit_before><commit_msg>Write in gpio on raspberry<commit_after> | import RPi.GPIO as GPIO
from time import sleep
GPIO.setmode(GPIO.BCM)
GPIO.setup(9, GPIO.OUT)
GPIO.setup(11, GPIO.OUT)
while 1:
GPIO.output(9, True)
sleep(0.25)
GPIO.output(9, False)
sleep(0.25)
GPIO.output(11, True)
sleep(0.25)
GPIO.output(11, False)
sleep(0.25)
#GPIO.output(11, True)
#sleep(0... | Write in gpio on raspberryimport RPi.GPIO as GPIO
from time import sleep
GPIO.setmode(GPIO.BCM)
GPIO.setup(9, GPIO.OUT)
GPIO.setup(11, GPIO.OUT)
while 1:
GPIO.output(9, True)
sleep(0.25)
GPIO.output(9, False)
sleep(0.25)
GPIO.output(11, True)
sleep(0.25)
GPIO.output(11, False)
sleep(0.25)
#GPIO.o... | <commit_before><commit_msg>Write in gpio on raspberry<commit_after>import RPi.GPIO as GPIO
from time import sleep
GPIO.setmode(GPIO.BCM)
GPIO.setup(9, GPIO.OUT)
GPIO.setup(11, GPIO.OUT)
while 1:
GPIO.output(9, True)
sleep(0.25)
GPIO.output(9, False)
sleep(0.25)
GPIO.output(11, True)
sleep(0.25)
GPIO.o... | |
89e8b3ef400c6025161c3af819c15ad8c7b74425 | pyramid_authsanity/sources.py | pyramid_authsanity/sources.py | from zope.interface import implementer
from .interfaces (
IAuthSourceService,
)
@implementer(IAuthSourceService)
class SessionAuthSource(object):
""" An authentication source that uses the current session """
vary = ()
value_key = 'sanity.value'
def __init__(self, context, request):
... | Add a session based source | Add a session based source
This will pull the auth information from the current session.
| Python | isc | usingnamespace/pyramid_authsanity | Add a session based source
This will pull the auth information from the current session. | from zope.interface import implementer
from .interfaces (
IAuthSourceService,
)
@implementer(IAuthSourceService)
class SessionAuthSource(object):
""" An authentication source that uses the current session """
vary = ()
value_key = 'sanity.value'
def __init__(self, context, request):
... | <commit_before><commit_msg>Add a session based source
This will pull the auth information from the current session.<commit_after> | from zope.interface import implementer
from .interfaces (
IAuthSourceService,
)
@implementer(IAuthSourceService)
class SessionAuthSource(object):
""" An authentication source that uses the current session """
vary = ()
value_key = 'sanity.value'
def __init__(self, context, request):
... | Add a session based source
This will pull the auth information from the current session.from zope.interface import implementer
from .interfaces (
IAuthSourceService,
)
@implementer(IAuthSourceService)
class SessionAuthSource(object):
""" An authentication source that uses the current session """
... | <commit_before><commit_msg>Add a session based source
This will pull the auth information from the current session.<commit_after>from zope.interface import implementer
from .interfaces (
IAuthSourceService,
)
@implementer(IAuthSourceService)
class SessionAuthSource(object):
""" An authentication ... | |
1adbe7b5974403ac58963679d2b945cf94c36826 | test/tests_and_pull.py | test/tests_and_pull.py | #!/usr/bin/env python
import json, argparse
import httplib, subprocess, os
def execute(args):
IP = args.agent.split(':')[0]
if len(args.agent.split(':')) == 2:
port = args.agent.split(':')[1]
else:
port = 80
agent = 'http://' + args.agent
with open(args.config, 'r') as f:
c... | Add a handy CLI test client | Add a handy CLI test client
| Python | apache-2.0 | eaufavor/chrome-webpage-profiler-webui,eaufavor/chrome-webpage-profiler-webui,eaufavor/chrome-webpage-profiler-webui,eaufavor/chrome-webpage-profiler-webui | Add a handy CLI test client | #!/usr/bin/env python
import json, argparse
import httplib, subprocess, os
def execute(args):
IP = args.agent.split(':')[0]
if len(args.agent.split(':')) == 2:
port = args.agent.split(':')[1]
else:
port = 80
agent = 'http://' + args.agent
with open(args.config, 'r') as f:
c... | <commit_before><commit_msg>Add a handy CLI test client<commit_after> | #!/usr/bin/env python
import json, argparse
import httplib, subprocess, os
def execute(args):
IP = args.agent.split(':')[0]
if len(args.agent.split(':')) == 2:
port = args.agent.split(':')[1]
else:
port = 80
agent = 'http://' + args.agent
with open(args.config, 'r') as f:
c... | Add a handy CLI test client#!/usr/bin/env python
import json, argparse
import httplib, subprocess, os
def execute(args):
IP = args.agent.split(':')[0]
if len(args.agent.split(':')) == 2:
port = args.agent.split(':')[1]
else:
port = 80
agent = 'http://' + args.agent
with open(args.c... | <commit_before><commit_msg>Add a handy CLI test client<commit_after>#!/usr/bin/env python
import json, argparse
import httplib, subprocess, os
def execute(args):
IP = args.agent.split(':')[0]
if len(args.agent.split(':')) == 2:
port = args.agent.split(':')[1]
else:
port = 80
agent = 'h... | |
0774f8d159e9f749b89416bbdf0fe394e8083f6a | tools/usbd_vcp_test.py | tools/usbd_vcp_test.py | #!/usr/bin/env python2.7
import sys, serial, struct
port = '/dev/ttyACM0'
sp = serial.Serial(port, baudrate=115200, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE,
xonxoff=False, rtscts=False, stopbits=serial.STOPBITS_ONE, timeout=None, dsrdtr=True)
sp.setDTR(True) # dsrdtr is ignored on Windows.
sp.w... | Add USB VCP test script. | Add USB VCP test script.
| Python | mit | kwagyeman/openmv,kwagyeman/openmv,iabdalkader/openmv,iabdalkader/openmv,kwagyeman/openmv,openmv/openmv,iabdalkader/openmv,openmv/openmv,openmv/openmv,kwagyeman/openmv,openmv/openmv,iabdalkader/openmv | Add USB VCP test script. | #!/usr/bin/env python2.7
import sys, serial, struct
port = '/dev/ttyACM0'
sp = serial.Serial(port, baudrate=115200, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE,
xonxoff=False, rtscts=False, stopbits=serial.STOPBITS_ONE, timeout=None, dsrdtr=True)
sp.setDTR(True) # dsrdtr is ignored on Windows.
sp.w... | <commit_before><commit_msg>Add USB VCP test script.<commit_after> | #!/usr/bin/env python2.7
import sys, serial, struct
port = '/dev/ttyACM0'
sp = serial.Serial(port, baudrate=115200, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE,
xonxoff=False, rtscts=False, stopbits=serial.STOPBITS_ONE, timeout=None, dsrdtr=True)
sp.setDTR(True) # dsrdtr is ignored on Windows.
sp.w... | Add USB VCP test script.#!/usr/bin/env python2.7
import sys, serial, struct
port = '/dev/ttyACM0'
sp = serial.Serial(port, baudrate=115200, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE,
xonxoff=False, rtscts=False, stopbits=serial.STOPBITS_ONE, timeout=None, dsrdtr=True)
sp.setDTR(True) # dsrdtr is ... | <commit_before><commit_msg>Add USB VCP test script.<commit_after>#!/usr/bin/env python2.7
import sys, serial, struct
port = '/dev/ttyACM0'
sp = serial.Serial(port, baudrate=115200, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE,
xonxoff=False, rtscts=False, stopbits=serial.STOPBITS_ONE, timeout=None, ... | |
fcbb6f845cce5c5a4bb996cf394ecbe2d33fdbfa | tests/ep_canvas_test.py | tests/ep_canvas_test.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Test case for Energy Profle Canvas.
"""
import unittest
from catplot.ep_components.ep_canvas import EPCanvas
class EPCanvasTest(unittest.TestCase):
def setUp(self):
self.maxDiff = True
def test_construction_and_query(self):
""" Test we can... | Add test case for EPCanvas. | Add test case for EPCanvas.
| Python | mit | PytLab/catplot | Add test case for EPCanvas. | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Test case for Energy Profle Canvas.
"""
import unittest
from catplot.ep_components.ep_canvas import EPCanvas
class EPCanvasTest(unittest.TestCase):
def setUp(self):
self.maxDiff = True
def test_construction_and_query(self):
""" Test we can... | <commit_before><commit_msg>Add test case for EPCanvas.<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Test case for Energy Profle Canvas.
"""
import unittest
from catplot.ep_components.ep_canvas import EPCanvas
class EPCanvasTest(unittest.TestCase):
def setUp(self):
self.maxDiff = True
def test_construction_and_query(self):
""" Test we can... | Add test case for EPCanvas.#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Test case for Energy Profle Canvas.
"""
import unittest
from catplot.ep_components.ep_canvas import EPCanvas
class EPCanvasTest(unittest.TestCase):
def setUp(self):
self.maxDiff = True
def test_construction_and_query(sel... | <commit_before><commit_msg>Add test case for EPCanvas.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Test case for Energy Profle Canvas.
"""
import unittest
from catplot.ep_components.ep_canvas import EPCanvas
class EPCanvasTest(unittest.TestCase):
def setUp(self):
self.maxDiff = True... | |
437b9c92e59215b41464f54a4040bf1be9d41d2d | create_window.py | create_window.py | import pygame
pygame.init()
#-- SCREEN CHARACTERISTICS ------------------------->>>
background_color = (255,255,255)
(width, height) = (300, 200)
#-- RENDER SCREEN ---------------------------------->>>
screen = pygame.display.set_mode((width, height))
screen.fill(background_color)
pygame.display.flip()
#-- RUN LOO... | Add module capable of creating a window when ran | Add module capable of creating a window when ran
| Python | mit | withtwoemms/pygame-explorations | Add module capable of creating a window when ran | import pygame
pygame.init()
#-- SCREEN CHARACTERISTICS ------------------------->>>
background_color = (255,255,255)
(width, height) = (300, 200)
#-- RENDER SCREEN ---------------------------------->>>
screen = pygame.display.set_mode((width, height))
screen.fill(background_color)
pygame.display.flip()
#-- RUN LOO... | <commit_before><commit_msg>Add module capable of creating a window when ran<commit_after> | import pygame
pygame.init()
#-- SCREEN CHARACTERISTICS ------------------------->>>
background_color = (255,255,255)
(width, height) = (300, 200)
#-- RENDER SCREEN ---------------------------------->>>
screen = pygame.display.set_mode((width, height))
screen.fill(background_color)
pygame.display.flip()
#-- RUN LOO... | Add module capable of creating a window when ranimport pygame
pygame.init()
#-- SCREEN CHARACTERISTICS ------------------------->>>
background_color = (255,255,255)
(width, height) = (300, 200)
#-- RENDER SCREEN ---------------------------------->>>
screen = pygame.display.set_mode((width, height))
screen.fill(back... | <commit_before><commit_msg>Add module capable of creating a window when ran<commit_after>import pygame
pygame.init()
#-- SCREEN CHARACTERISTICS ------------------------->>>
background_color = (255,255,255)
(width, height) = (300, 200)
#-- RENDER SCREEN ---------------------------------->>>
screen = pygame.display.s... | |
fdd8aecba5aea0faae5c17062af33d61f70f0e70 | test/benchmark/decorate.py | test/benchmark/decorate.py | from __future__ import absolute_import
import functools
import black_magic.decorator
from test.benchmark import _common
class Functools(_common.Base):
def __init__(self):
self._decorator = functools.wraps(_common.wrap)
def __call__(self):
self._decorator(_common.func)
class BlackMagicDeco... | Add some random benchmark module | Add some random benchmark module
This module existed for some time in my local working dir. TBH, I forgot
about its precise purpose, but it doesn't really hurt to add it right
now, so whatever…
| Python | unlicense | coldfix/black-magic | Add some random benchmark module
This module existed for some time in my local working dir. TBH, I forgot
about its precise purpose, but it doesn't really hurt to add it right
now, so whatever… | from __future__ import absolute_import
import functools
import black_magic.decorator
from test.benchmark import _common
class Functools(_common.Base):
def __init__(self):
self._decorator = functools.wraps(_common.wrap)
def __call__(self):
self._decorator(_common.func)
class BlackMagicDeco... | <commit_before><commit_msg>Add some random benchmark module
This module existed for some time in my local working dir. TBH, I forgot
about its precise purpose, but it doesn't really hurt to add it right
now, so whatever…<commit_after> | from __future__ import absolute_import
import functools
import black_magic.decorator
from test.benchmark import _common
class Functools(_common.Base):
def __init__(self):
self._decorator = functools.wraps(_common.wrap)
def __call__(self):
self._decorator(_common.func)
class BlackMagicDeco... | Add some random benchmark module
This module existed for some time in my local working dir. TBH, I forgot
about its precise purpose, but it doesn't really hurt to add it right
now, so whatever…from __future__ import absolute_import
import functools
import black_magic.decorator
from test.benchmark import _common
cla... | <commit_before><commit_msg>Add some random benchmark module
This module existed for some time in my local working dir. TBH, I forgot
about its precise purpose, but it doesn't really hurt to add it right
now, so whatever…<commit_after>from __future__ import absolute_import
import functools
import black_magic.decorator... | |
49ae354a13c33cceffe616b0906819257432318c | RpiAir/client_sds011.py | RpiAir/client_sds011.py | import sys
from sds011 import Sds011Reader
from mqttsender import client
if len(sys.argv) > 1:
port = sys.argv[1]
else:
port = '/dev/ttyUSB0'
sds011 = Sds011Reader(port)
for pm25, pm10, ok in sds011.read_forever3():
print("PM 2.5: {} μg/m^3 PM 10: {} μg/m^3 CRC={}".format(pm25, pm10, "OK" if ok else "NO... | Add first sensor reader (SDS011) client script | Add first sensor reader (SDS011) client script
| Python | mit | aapris/VekotinVerstas,aapris/VekotinVerstas | Add first sensor reader (SDS011) client script | import sys
from sds011 import Sds011Reader
from mqttsender import client
if len(sys.argv) > 1:
port = sys.argv[1]
else:
port = '/dev/ttyUSB0'
sds011 = Sds011Reader(port)
for pm25, pm10, ok in sds011.read_forever3():
print("PM 2.5: {} μg/m^3 PM 10: {} μg/m^3 CRC={}".format(pm25, pm10, "OK" if ok else "NO... | <commit_before><commit_msg>Add first sensor reader (SDS011) client script<commit_after> | import sys
from sds011 import Sds011Reader
from mqttsender import client
if len(sys.argv) > 1:
port = sys.argv[1]
else:
port = '/dev/ttyUSB0'
sds011 = Sds011Reader(port)
for pm25, pm10, ok in sds011.read_forever3():
print("PM 2.5: {} μg/m^3 PM 10: {} μg/m^3 CRC={}".format(pm25, pm10, "OK" if ok else "NO... | Add first sensor reader (SDS011) client scriptimport sys
from sds011 import Sds011Reader
from mqttsender import client
if len(sys.argv) > 1:
port = sys.argv[1]
else:
port = '/dev/ttyUSB0'
sds011 = Sds011Reader(port)
for pm25, pm10, ok in sds011.read_forever3():
print("PM 2.5: {} μg/m^3 PM 10: {} μg/m^3 ... | <commit_before><commit_msg>Add first sensor reader (SDS011) client script<commit_after>import sys
from sds011 import Sds011Reader
from mqttsender import client
if len(sys.argv) > 1:
port = sys.argv[1]
else:
port = '/dev/ttyUSB0'
sds011 = Sds011Reader(port)
for pm25, pm10, ok in sds011.read_forever3():
pr... | |
5063bed38d64843387a681f72734b3cc1e9d6394 | tools/create_images_xml.py | tools/create_images_xml.py | #! /usr/bin/python3
import sys
import argparse
import xml_utils as u
import datetime
import pdb
import os
from argparse import RawTextHelpFormatter
from collections import defaultdict
##------------------------------------------------------------
## can be called with:
## find_bears *.xml dirs
##-----------------... | Create xml of all jpg/png from list of files & directories. | Create xml of all jpg/png from list of files & directories.
| Python | mit | hypraptive/bearid,hypraptive/bearid,hypraptive/bearid | Create xml of all jpg/png from list of files & directories. | #! /usr/bin/python3
import sys
import argparse
import xml_utils as u
import datetime
import pdb
import os
from argparse import RawTextHelpFormatter
from collections import defaultdict
##------------------------------------------------------------
## can be called with:
## find_bears *.xml dirs
##-----------------... | <commit_before><commit_msg>Create xml of all jpg/png from list of files & directories.<commit_after> | #! /usr/bin/python3
import sys
import argparse
import xml_utils as u
import datetime
import pdb
import os
from argparse import RawTextHelpFormatter
from collections import defaultdict
##------------------------------------------------------------
## can be called with:
## find_bears *.xml dirs
##-----------------... | Create xml of all jpg/png from list of files & directories.#! /usr/bin/python3
import sys
import argparse
import xml_utils as u
import datetime
import pdb
import os
from argparse import RawTextHelpFormatter
from collections import defaultdict
##------------------------------------------------------------
## can be c... | <commit_before><commit_msg>Create xml of all jpg/png from list of files & directories.<commit_after>#! /usr/bin/python3
import sys
import argparse
import xml_utils as u
import datetime
import pdb
import os
from argparse import RawTextHelpFormatter
from collections import defaultdict
##--------------------------------... | |
b07d9e5218ba1075ec5a2c8cf0d62c9c5ee0dd35 | tests/debug_test.py | tests/debug_test.py | #! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# vi:ts=4:et
import pycurl
import unittest
from . import app
from . import runwsgi
setup_module, teardown_module = runwsgi.app_runner_setup((app.app, 8380))
class DebugTest(unittest.TestCase):
def setUp(self):
self.curl = pycurl.Curl()
self.deb... | Debug test, ported from the old debug test | Debug test, ported from the old debug test
| Python | lgpl-2.1 | pycurl/pycurl,p/pycurl-archived,pycurl/pycurl,p/pycurl-archived,pycurl/pycurl,p/pycurl-archived | Debug test, ported from the old debug test | #! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# vi:ts=4:et
import pycurl
import unittest
from . import app
from . import runwsgi
setup_module, teardown_module = runwsgi.app_runner_setup((app.app, 8380))
class DebugTest(unittest.TestCase):
def setUp(self):
self.curl = pycurl.Curl()
self.deb... | <commit_before><commit_msg>Debug test, ported from the old debug test<commit_after> | #! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# vi:ts=4:et
import pycurl
import unittest
from . import app
from . import runwsgi
setup_module, teardown_module = runwsgi.app_runner_setup((app.app, 8380))
class DebugTest(unittest.TestCase):
def setUp(self):
self.curl = pycurl.Curl()
self.deb... | Debug test, ported from the old debug test#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# vi:ts=4:et
import pycurl
import unittest
from . import app
from . import runwsgi
setup_module, teardown_module = runwsgi.app_runner_setup((app.app, 8380))
class DebugTest(unittest.TestCase):
def setUp(self):
... | <commit_before><commit_msg>Debug test, ported from the old debug test<commit_after>#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# vi:ts=4:et
import pycurl
import unittest
from . import app
from . import runwsgi
setup_module, teardown_module = runwsgi.app_runner_setup((app.app, 8380))
class DebugTest(unittest... | |
946b693e52fca4e55f0d4dd9c07edd609f26297f | tests/test_score.py | tests/test_score.py | from toolshed.importer import create_project
from toolshed.updater import update_projects_score
def test_oauth_rankings():
flask_dance = create_project(pypi_url="https://pypi.python.org/pypi/Flask-Dance", github_url="https://github.com/singingwolfboy/flask-dance")
flask_oauth = create_project(pypi_url="https:... | Put in sanity-check for project scores. | Put in sanity-check for project scores.
| Python | mit | PythonClutch/python-clutch,PythonClutch/python-clutch,PythonClutch/python-clutch | Put in sanity-check for project scores. | from toolshed.importer import create_project
from toolshed.updater import update_projects_score
def test_oauth_rankings():
flask_dance = create_project(pypi_url="https://pypi.python.org/pypi/Flask-Dance", github_url="https://github.com/singingwolfboy/flask-dance")
flask_oauth = create_project(pypi_url="https:... | <commit_before><commit_msg>Put in sanity-check for project scores.<commit_after> | from toolshed.importer import create_project
from toolshed.updater import update_projects_score
def test_oauth_rankings():
flask_dance = create_project(pypi_url="https://pypi.python.org/pypi/Flask-Dance", github_url="https://github.com/singingwolfboy/flask-dance")
flask_oauth = create_project(pypi_url="https:... | Put in sanity-check for project scores.from toolshed.importer import create_project
from toolshed.updater import update_projects_score
def test_oauth_rankings():
flask_dance = create_project(pypi_url="https://pypi.python.org/pypi/Flask-Dance", github_url="https://github.com/singingwolfboy/flask-dance")
flask_... | <commit_before><commit_msg>Put in sanity-check for project scores.<commit_after>from toolshed.importer import create_project
from toolshed.updater import update_projects_score
def test_oauth_rankings():
flask_dance = create_project(pypi_url="https://pypi.python.org/pypi/Flask-Dance", github_url="https://github.co... | |
f670fabfecb6dbcf2ce5bcc3e312d61064463820 | tests/test_utils.py | tests/test_utils.py | # -*- coding: utf-8 -*-
"""
colorful
~~~~~~~~
Terminal string styling done right, in Python.
:copyright: (c) 2017 by Timo Furrer <tuxtimo@gmail.com>
:license: MIT, see LICENSE for more details.
"""
import os
import pytest
# do not overwrite module
os.environ['COLORFUL_NO_MODULE_OVERWRITE'] = '... | Add tests for utils module | Add tests for utils module
| Python | mit | timofurrer/colorful | Add tests for utils module | # -*- coding: utf-8 -*-
"""
colorful
~~~~~~~~
Terminal string styling done right, in Python.
:copyright: (c) 2017 by Timo Furrer <tuxtimo@gmail.com>
:license: MIT, see LICENSE for more details.
"""
import os
import pytest
# do not overwrite module
os.environ['COLORFUL_NO_MODULE_OVERWRITE'] = '... | <commit_before><commit_msg>Add tests for utils module<commit_after> | # -*- coding: utf-8 -*-
"""
colorful
~~~~~~~~
Terminal string styling done right, in Python.
:copyright: (c) 2017 by Timo Furrer <tuxtimo@gmail.com>
:license: MIT, see LICENSE for more details.
"""
import os
import pytest
# do not overwrite module
os.environ['COLORFUL_NO_MODULE_OVERWRITE'] = '... | Add tests for utils module# -*- coding: utf-8 -*-
"""
colorful
~~~~~~~~
Terminal string styling done right, in Python.
:copyright: (c) 2017 by Timo Furrer <tuxtimo@gmail.com>
:license: MIT, see LICENSE for more details.
"""
import os
import pytest
# do not overwrite module
os.environ['COLORFUL... | <commit_before><commit_msg>Add tests for utils module<commit_after># -*- coding: utf-8 -*-
"""
colorful
~~~~~~~~
Terminal string styling done right, in Python.
:copyright: (c) 2017 by Timo Furrer <tuxtimo@gmail.com>
:license: MIT, see LICENSE for more details.
"""
import os
import pytest
# do ... | |
95652f83865913dd6989374faa3ac2be8d50d981 | buildlapse/gui.py | buildlapse/gui.py | # gui.py
# Generic GUI crap
from gi.repository import Gtk
class CheckEntry(Gtk.Box):
def __init__(self, labeltxt, togglef = None):
Gtk.Box.__init__(self, spacing=2)
self.label = Gtk.Label(labeltxt, valign=0)
self.check = Gtk.CheckButton()
self.pack_start(self.check, True, T... | Add generic settings-related GUI util module | Add generic settings-related GUI util module
| Python | apache-2.0 | twoodford/nxt-timelapse,twoodford/nxt-timelapse,twoodford/nxt-timelapse | Add generic settings-related GUI util module | # gui.py
# Generic GUI crap
from gi.repository import Gtk
class CheckEntry(Gtk.Box):
def __init__(self, labeltxt, togglef = None):
Gtk.Box.__init__(self, spacing=2)
self.label = Gtk.Label(labeltxt, valign=0)
self.check = Gtk.CheckButton()
self.pack_start(self.check, True, T... | <commit_before><commit_msg>Add generic settings-related GUI util module<commit_after> | # gui.py
# Generic GUI crap
from gi.repository import Gtk
class CheckEntry(Gtk.Box):
def __init__(self, labeltxt, togglef = None):
Gtk.Box.__init__(self, spacing=2)
self.label = Gtk.Label(labeltxt, valign=0)
self.check = Gtk.CheckButton()
self.pack_start(self.check, True, T... | Add generic settings-related GUI util module# gui.py
# Generic GUI crap
from gi.repository import Gtk
class CheckEntry(Gtk.Box):
def __init__(self, labeltxt, togglef = None):
Gtk.Box.__init__(self, spacing=2)
self.label = Gtk.Label(labeltxt, valign=0)
self.check = Gtk.CheckButton()
... | <commit_before><commit_msg>Add generic settings-related GUI util module<commit_after># gui.py
# Generic GUI crap
from gi.repository import Gtk
class CheckEntry(Gtk.Box):
def __init__(self, labeltxt, togglef = None):
Gtk.Box.__init__(self, spacing=2)
self.label = Gtk.Label(labeltxt, valign=0)... | |
fe1b6725855a64898d385efe4e616dc04513b61d | tests/test_03_runtime.py | tests/test_03_runtime.py | """Using depends() to mark dependencies at runtime.
"""
import pytest
def test_skip_depend_runtime(ctestdir):
"""One test is skipped, other dependent tests are skipped as well.
This also includes indirect dependencies.
"""
ctestdir.makepyfile("""
import pytest
from pytest_dependency i... | Add test for the depends() function. | Add test for the depends() function.
| Python | apache-2.0 | RKrahl/pytest-dependency | Add test for the depends() function. | """Using depends() to mark dependencies at runtime.
"""
import pytest
def test_skip_depend_runtime(ctestdir):
"""One test is skipped, other dependent tests are skipped as well.
This also includes indirect dependencies.
"""
ctestdir.makepyfile("""
import pytest
from pytest_dependency i... | <commit_before><commit_msg>Add test for the depends() function.<commit_after> | """Using depends() to mark dependencies at runtime.
"""
import pytest
def test_skip_depend_runtime(ctestdir):
"""One test is skipped, other dependent tests are skipped as well.
This also includes indirect dependencies.
"""
ctestdir.makepyfile("""
import pytest
from pytest_dependency i... | Add test for the depends() function."""Using depends() to mark dependencies at runtime.
"""
import pytest
def test_skip_depend_runtime(ctestdir):
"""One test is skipped, other dependent tests are skipped as well.
This also includes indirect dependencies.
"""
ctestdir.makepyfile("""
import pyt... | <commit_before><commit_msg>Add test for the depends() function.<commit_after>"""Using depends() to mark dependencies at runtime.
"""
import pytest
def test_skip_depend_runtime(ctestdir):
"""One test is skipped, other dependent tests are skipped as well.
This also includes indirect dependencies.
"""
c... | |
2b29bd4c1a15136a066a61e02920721ef8117d23 | tests/test_converters.py | tests/test_converters.py | import unittest
from beaker.converters import asbool, aslist
class AsBool(unittest.TestCase):
def test_truth_str(self):
for v in ('true', 'yes', 'on', 'y', 't', '1'):
self.assertTrue(asbool(v), "%s should be considered True" % (v,))
v = v.upper()
self.assertTrue(asbool... | Bring coverage for the converters module up to 100%. | Bring coverage for the converters module up to 100%.
| Python | bsd-3-clause | lann/python-beaker | Bring coverage for the converters module up to 100%. | import unittest
from beaker.converters import asbool, aslist
class AsBool(unittest.TestCase):
def test_truth_str(self):
for v in ('true', 'yes', 'on', 'y', 't', '1'):
self.assertTrue(asbool(v), "%s should be considered True" % (v,))
v = v.upper()
self.assertTrue(asbool... | <commit_before><commit_msg>Bring coverage for the converters module up to 100%.<commit_after> | import unittest
from beaker.converters import asbool, aslist
class AsBool(unittest.TestCase):
def test_truth_str(self):
for v in ('true', 'yes', 'on', 'y', 't', '1'):
self.assertTrue(asbool(v), "%s should be considered True" % (v,))
v = v.upper()
self.assertTrue(asbool... | Bring coverage for the converters module up to 100%.import unittest
from beaker.converters import asbool, aslist
class AsBool(unittest.TestCase):
def test_truth_str(self):
for v in ('true', 'yes', 'on', 'y', 't', '1'):
self.assertTrue(asbool(v), "%s should be considered True" % (v,))
... | <commit_before><commit_msg>Bring coverage for the converters module up to 100%.<commit_after>import unittest
from beaker.converters import asbool, aslist
class AsBool(unittest.TestCase):
def test_truth_str(self):
for v in ('true', 'yes', 'on', 'y', 't', '1'):
self.assertTrue(asbool(v), "%s sh... | |
1a41aa1088965e0b30bd3b53ac400cd6a0f8ce69 | tests/test_parser_api.py | tests/test_parser_api.py | from xml.etree import ElementTree
from junit2htmlreport import parser as j2h
def test_public_api():
container = j2h.Junit(xmlstring="""<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="suite"></testsuite>
""")
container.filename = "test_results.xml"
document = j2h.Suite()
container.suit... | Add unit tests for our main public API so we can start to re-impliment the parser | Add unit tests for our main public API so we can start to re-impliment the parser
| Python | mit | inorton/junit2html | Add unit tests for our main public API so we can start to re-impliment the parser | from xml.etree import ElementTree
from junit2htmlreport import parser as j2h
def test_public_api():
container = j2h.Junit(xmlstring="""<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="suite"></testsuite>
""")
container.filename = "test_results.xml"
document = j2h.Suite()
container.suit... | <commit_before><commit_msg>Add unit tests for our main public API so we can start to re-impliment the parser<commit_after> | from xml.etree import ElementTree
from junit2htmlreport import parser as j2h
def test_public_api():
container = j2h.Junit(xmlstring="""<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="suite"></testsuite>
""")
container.filename = "test_results.xml"
document = j2h.Suite()
container.suit... | Add unit tests for our main public API so we can start to re-impliment the parserfrom xml.etree import ElementTree
from junit2htmlreport import parser as j2h
def test_public_api():
container = j2h.Junit(xmlstring="""<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="suite"></testsuite>
""")
cont... | <commit_before><commit_msg>Add unit tests for our main public API so we can start to re-impliment the parser<commit_after>from xml.etree import ElementTree
from junit2htmlreport import parser as j2h
def test_public_api():
container = j2h.Junit(xmlstring="""<?xml version="1.0" encoding="UTF-8"?>
<testsuite na... | |
9862a89b6eab4b8c1b87f338ee71e683ca387765 | simulator-perfect.py | simulator-perfect.py | #!/usr/bin/env python3
import gzip
import itertools
import timer
import sys
import utils
# A set of files already in the storage
seen = set()
# The total number of uploads
total_uploads = 0
# The number of files in the storage
files_in = 0
tmr = timer.Timer()
for (hsh, _) in utils.read_upload_stream():
if hsh ... | Add a simulator for measuring perfect deduplication | Add a simulator for measuring perfect deduplication
| Python | apache-2.0 | sjakthol/dedup-simulator,sjakthol/dedup-simulator | Add a simulator for measuring perfect deduplication | #!/usr/bin/env python3
import gzip
import itertools
import timer
import sys
import utils
# A set of files already in the storage
seen = set()
# The total number of uploads
total_uploads = 0
# The number of files in the storage
files_in = 0
tmr = timer.Timer()
for (hsh, _) in utils.read_upload_stream():
if hsh ... | <commit_before><commit_msg>Add a simulator for measuring perfect deduplication<commit_after> | #!/usr/bin/env python3
import gzip
import itertools
import timer
import sys
import utils
# A set of files already in the storage
seen = set()
# The total number of uploads
total_uploads = 0
# The number of files in the storage
files_in = 0
tmr = timer.Timer()
for (hsh, _) in utils.read_upload_stream():
if hsh ... | Add a simulator for measuring perfect deduplication#!/usr/bin/env python3
import gzip
import itertools
import timer
import sys
import utils
# A set of files already in the storage
seen = set()
# The total number of uploads
total_uploads = 0
# The number of files in the storage
files_in = 0
tmr = timer.Timer()
for ... | <commit_before><commit_msg>Add a simulator for measuring perfect deduplication<commit_after>#!/usr/bin/env python3
import gzip
import itertools
import timer
import sys
import utils
# A set of files already in the storage
seen = set()
# The total number of uploads
total_uploads = 0
# The number of files in the stora... | |
fc34c641688d0f87987297f8e47c5fdf9e26334c | pombola/core/management/commands/core_list_person_primary_images.py | pombola/core/management/commands/core_list_person_primary_images.py | from django.core.management.base import BaseCommand
from pombola.core.models import Person
class Command(BaseCommand):
def handle(self, **options):
help = 'List the paths of primary person images relative to media root'
for p in Person.objects.filter(hidden=False):
image_file_field =... | Add a command to list all primary image filenames for people | Add a command to list all primary image filenames for people
This is useful to make a list of files to copy to your development copy
to make sure you don't have broken images on people pages, or pages that
list people.
| Python | agpl-3.0 | geoffkilpin/pombola,mysociety/pombola,geoffkilpin/pombola,geoffkilpin/pombola,mysociety/pombola,geoffkilpin/pombola,geoffkilpin/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola,geoffkilpin/pombola | Add a command to list all primary image filenames for people
This is useful to make a list of files to copy to your development copy
to make sure you don't have broken images on people pages, or pages that
list people. | from django.core.management.base import BaseCommand
from pombola.core.models import Person
class Command(BaseCommand):
def handle(self, **options):
help = 'List the paths of primary person images relative to media root'
for p in Person.objects.filter(hidden=False):
image_file_field =... | <commit_before><commit_msg>Add a command to list all primary image filenames for people
This is useful to make a list of files to copy to your development copy
to make sure you don't have broken images on people pages, or pages that
list people.<commit_after> | from django.core.management.base import BaseCommand
from pombola.core.models import Person
class Command(BaseCommand):
def handle(self, **options):
help = 'List the paths of primary person images relative to media root'
for p in Person.objects.filter(hidden=False):
image_file_field =... | Add a command to list all primary image filenames for people
This is useful to make a list of files to copy to your development copy
to make sure you don't have broken images on people pages, or pages that
list people.from django.core.management.base import BaseCommand
from pombola.core.models import Person
class Co... | <commit_before><commit_msg>Add a command to list all primary image filenames for people
This is useful to make a list of files to copy to your development copy
to make sure you don't have broken images on people pages, or pages that
list people.<commit_after>from django.core.management.base import BaseCommand
from po... | |
f88b7f0b70205e9ac6f41f8acffdf96e8b263e9e | CRS_Tests_Journal.py | CRS_Tests_Journal.py | from ftw import ruleset, logchecker, testrunner
import pytest
import sys
import re
import os
import ConfigParser
def test_crs(ruleset, test, logchecker_obj, with_journal, tablename):
runner = testrunner.TestRunner()
for stage in test.stages:
runner.run_stage_with_journal(test.ruleset_meta['name'], test... | Add journal script (needs next version of ftw pinned), remove conftest.py | Add journal script (needs next version of ftw pinned), remove conftest.py
| Python | apache-2.0 | csjperon/OWASP-CRS-regressions,SpiderLabs/OWASP-CRS-regressions | Add journal script (needs next version of ftw pinned), remove conftest.py | from ftw import ruleset, logchecker, testrunner
import pytest
import sys
import re
import os
import ConfigParser
def test_crs(ruleset, test, logchecker_obj, with_journal, tablename):
runner = testrunner.TestRunner()
for stage in test.stages:
runner.run_stage_with_journal(test.ruleset_meta['name'], test... | <commit_before><commit_msg>Add journal script (needs next version of ftw pinned), remove conftest.py<commit_after> | from ftw import ruleset, logchecker, testrunner
import pytest
import sys
import re
import os
import ConfigParser
def test_crs(ruleset, test, logchecker_obj, with_journal, tablename):
runner = testrunner.TestRunner()
for stage in test.stages:
runner.run_stage_with_journal(test.ruleset_meta['name'], test... | Add journal script (needs next version of ftw pinned), remove conftest.pyfrom ftw import ruleset, logchecker, testrunner
import pytest
import sys
import re
import os
import ConfigParser
def test_crs(ruleset, test, logchecker_obj, with_journal, tablename):
runner = testrunner.TestRunner()
for stage in test.stag... | <commit_before><commit_msg>Add journal script (needs next version of ftw pinned), remove conftest.py<commit_after>from ftw import ruleset, logchecker, testrunner
import pytest
import sys
import re
import os
import ConfigParser
def test_crs(ruleset, test, logchecker_obj, with_journal, tablename):
runner = testrunne... | |
cc543e52b82761473b0a6dfd47f7451b2a5411f8 | app/tests/cases_tests/test_forms.py | app/tests/cases_tests/test_forms.py | import pytest
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser
from django.http import HttpResponse
from django.test import Client, RequestFactory
from django.views import View
from grandchallenge.cases.views import UploadRawFiles
from tests.factories import UserFacto... | Add tests for user frontend forms | Add tests for user frontend forms
Issue #479
| Python | apache-2.0 | comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django | Add tests for user frontend forms
Issue #479 | import pytest
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser
from django.http import HttpResponse
from django.test import Client, RequestFactory
from django.views import View
from grandchallenge.cases.views import UploadRawFiles
from tests.factories import UserFacto... | <commit_before><commit_msg>Add tests for user frontend forms
Issue #479<commit_after> | import pytest
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser
from django.http import HttpResponse
from django.test import Client, RequestFactory
from django.views import View
from grandchallenge.cases.views import UploadRawFiles
from tests.factories import UserFacto... | Add tests for user frontend forms
Issue #479import pytest
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser
from django.http import HttpResponse
from django.test import Client, RequestFactory
from django.views import View
from grandchallenge.cases.views import UploadR... | <commit_before><commit_msg>Add tests for user frontend forms
Issue #479<commit_after>import pytest
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser
from django.http import HttpResponse
from django.test import Client, RequestFactory
from django.views import View
from ... | |
629f4b2361d9fc7a021b8fb5c302f00a6240e96c | tests/test_filemap_read_alt_file_map.py | tests/test_filemap_read_alt_file_map.py | import os
import re
import sys
import pytest
from mock import Mock, mock_open, patch
app_path = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, app_path + '/../')
from photo_rename import *
from stubs import *
@pytest.fixture
def alt_file_map_tab():
"""
Sample alternate file map.
"""
ret... | Add new unit tests for reading alternate file map. | Add new unit tests for reading alternate file map.
| Python | mit | eigenholser/jpeg_rename,eigenholser/jpeg_rename,eigenholser/jpeg_rename,eigenholser/jpeg_rename | Add new unit tests for reading alternate file map. | import os
import re
import sys
import pytest
from mock import Mock, mock_open, patch
app_path = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, app_path + '/../')
from photo_rename import *
from stubs import *
@pytest.fixture
def alt_file_map_tab():
"""
Sample alternate file map.
"""
ret... | <commit_before><commit_msg>Add new unit tests for reading alternate file map.<commit_after> | import os
import re
import sys
import pytest
from mock import Mock, mock_open, patch
app_path = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, app_path + '/../')
from photo_rename import *
from stubs import *
@pytest.fixture
def alt_file_map_tab():
"""
Sample alternate file map.
"""
ret... | Add new unit tests for reading alternate file map.import os
import re
import sys
import pytest
from mock import Mock, mock_open, patch
app_path = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, app_path + '/../')
from photo_rename import *
from stubs import *
@pytest.fixture
def alt_file_map_tab():
... | <commit_before><commit_msg>Add new unit tests for reading alternate file map.<commit_after>import os
import re
import sys
import pytest
from mock import Mock, mock_open, patch
app_path = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, app_path + '/../')
from photo_rename import *
from stubs import *
@py... | |
62009e7ea13360a71a5294d73411f4b802610aae | grizli/pipeline/run_MPI.py | grizli/pipeline/run_MPI.py | """
Script to run all redshift fits in parallel with OpenMPI
Usage:
mpiexec -n 10 python -m mpi4py.futures $GRIZLICODE/grizli/pipeline/run_MPI.py
where "-n 8" indicates running 8 parallel threads.
Needs 'fit_args.py' created by `auto_script.generate_fit_params`.
"""
import os
import glob
import numpy as n... | Add file for running fits with OpenMPI | Add file for running fits with OpenMPI
| Python | mit | albertfxwang/grizli | Add file for running fits with OpenMPI | """
Script to run all redshift fits in parallel with OpenMPI
Usage:
mpiexec -n 10 python -m mpi4py.futures $GRIZLICODE/grizli/pipeline/run_MPI.py
where "-n 8" indicates running 8 parallel threads.
Needs 'fit_args.py' created by `auto_script.generate_fit_params`.
"""
import os
import glob
import numpy as n... | <commit_before><commit_msg>Add file for running fits with OpenMPI<commit_after> | """
Script to run all redshift fits in parallel with OpenMPI
Usage:
mpiexec -n 10 python -m mpi4py.futures $GRIZLICODE/grizli/pipeline/run_MPI.py
where "-n 8" indicates running 8 parallel threads.
Needs 'fit_args.py' created by `auto_script.generate_fit_params`.
"""
import os
import glob
import numpy as n... | Add file for running fits with OpenMPI"""
Script to run all redshift fits in parallel with OpenMPI
Usage:
mpiexec -n 10 python -m mpi4py.futures $GRIZLICODE/grizli/pipeline/run_MPI.py
where "-n 8" indicates running 8 parallel threads.
Needs 'fit_args.py' created by `auto_script.generate_fit_params`.
"""
i... | <commit_before><commit_msg>Add file for running fits with OpenMPI<commit_after>"""
Script to run all redshift fits in parallel with OpenMPI
Usage:
mpiexec -n 10 python -m mpi4py.futures $GRIZLICODE/grizli/pipeline/run_MPI.py
where "-n 8" indicates running 8 parallel threads.
Needs 'fit_args.py' created by ... | |
76a4b872101a41eddf583866d675aebeeb815f59 | dojo/tools/h1/parser.py | dojo/tools/h1/parser.py | import json
import hashlib
from urllib.parse import urlparse
from dojo.models import Endpoint, Finding
__author__ = 'Kirill Gotsman'
class HackerOneJSONParser(object):
"""
A class that can be used to parse the Get All Reports JSON export from HackerOne API.
"""
def __init__(self, file, test):
... | Add functionality of importing hackerone reports add-hackeroneparcer-359 | Add functionality of importing hackerone reports add-hackeroneparcer-359
| Python | bsd-3-clause | rackerlabs/django-DefectDojo,rackerlabs/django-DefectDojo,rackerlabs/django-DefectDojo,rackerlabs/django-DefectDojo | Add functionality of importing hackerone reports add-hackeroneparcer-359 | import json
import hashlib
from urllib.parse import urlparse
from dojo.models import Endpoint, Finding
__author__ = 'Kirill Gotsman'
class HackerOneJSONParser(object):
"""
A class that can be used to parse the Get All Reports JSON export from HackerOne API.
"""
def __init__(self, file, test):
... | <commit_before><commit_msg>Add functionality of importing hackerone reports add-hackeroneparcer-359<commit_after> | import json
import hashlib
from urllib.parse import urlparse
from dojo.models import Endpoint, Finding
__author__ = 'Kirill Gotsman'
class HackerOneJSONParser(object):
"""
A class that can be used to parse the Get All Reports JSON export from HackerOne API.
"""
def __init__(self, file, test):
... | Add functionality of importing hackerone reports add-hackeroneparcer-359import json
import hashlib
from urllib.parse import urlparse
from dojo.models import Endpoint, Finding
__author__ = 'Kirill Gotsman'
class HackerOneJSONParser(object):
"""
A class that can be used to parse the Get All Reports JSON export... | <commit_before><commit_msg>Add functionality of importing hackerone reports add-hackeroneparcer-359<commit_after>import json
import hashlib
from urllib.parse import urlparse
from dojo.models import Endpoint, Finding
__author__ = 'Kirill Gotsman'
class HackerOneJSONParser(object):
"""
A class that can be used... | |
c77c4e0bf8d9fe12b7f11ee1fb0827e259c6727c | resnet_sound.py | resnet_sound.py |
'''Trains a simple convnet on the MNIST dataset.
Gets to 99.25% test accuracy after 12 epochs
(there is still a lot of margin for parameter tuning).
16 seconds per epoch on a GRID K520 GPU.
'''
from __future__ import print_function
import numpy as np
np.random.seed(1337) # for reproducibility
SEED = 1337
from kera... | Add resnet training scheme (draft) | Add resnet training scheme (draft)
| Python | mit | johnmartinsson/bird-species-classification,johnmartinsson/bird-species-classification | Add resnet training scheme (draft) |
'''Trains a simple convnet on the MNIST dataset.
Gets to 99.25% test accuracy after 12 epochs
(there is still a lot of margin for parameter tuning).
16 seconds per epoch on a GRID K520 GPU.
'''
from __future__ import print_function
import numpy as np
np.random.seed(1337) # for reproducibility
SEED = 1337
from kera... | <commit_before><commit_msg>Add resnet training scheme (draft)<commit_after> |
'''Trains a simple convnet on the MNIST dataset.
Gets to 99.25% test accuracy after 12 epochs
(there is still a lot of margin for parameter tuning).
16 seconds per epoch on a GRID K520 GPU.
'''
from __future__ import print_function
import numpy as np
np.random.seed(1337) # for reproducibility
SEED = 1337
from kera... | Add resnet training scheme (draft)
'''Trains a simple convnet on the MNIST dataset.
Gets to 99.25% test accuracy after 12 epochs
(there is still a lot of margin for parameter tuning).
16 seconds per epoch on a GRID K520 GPU.
'''
from __future__ import print_function
import numpy as np
np.random.seed(1337) # for repr... | <commit_before><commit_msg>Add resnet training scheme (draft)<commit_after>
'''Trains a simple convnet on the MNIST dataset.
Gets to 99.25% test accuracy after 12 epochs
(there is still a lot of margin for parameter tuning).
16 seconds per epoch on a GRID K520 GPU.
'''
from __future__ import print_function
import num... | |
3e06c319b08bbb3e1cb2691a7db8c5cd1675c241 | tests/test_generate_copy_without_render.py | tests/test_generate_copy_without_render.py | def test_generate_copy_without_render_extensions(self):
generate.generate_files(
context={
'cookiecutter': {
"repo_name": "test_copy_without_render",
"render_test": "I have been rendered!",
"_copy_without_render": [
"*not-render... | Copy over test from the PR into its own module | Copy over test from the PR into its own module
| Python | bsd-3-clause | cguardia/cookiecutter,christabor/cookiecutter,michaeljoseph/cookiecutter,dajose/cookiecutter,ramiroluz/cookiecutter,vintasoftware/cookiecutter,luzfcb/cookiecutter,Vauxoo/cookiecutter,0k/cookiecutter,venumech/cookiecutter,vintasoftware/cookiecutter,agconti/cookiecutter,tylerdave/cookiecutter,cguardia/cookiecutter,cichm/... | Copy over test from the PR into its own module | def test_generate_copy_without_render_extensions(self):
generate.generate_files(
context={
'cookiecutter': {
"repo_name": "test_copy_without_render",
"render_test": "I have been rendered!",
"_copy_without_render": [
"*not-render... | <commit_before><commit_msg>Copy over test from the PR into its own module<commit_after> | def test_generate_copy_without_render_extensions(self):
generate.generate_files(
context={
'cookiecutter': {
"repo_name": "test_copy_without_render",
"render_test": "I have been rendered!",
"_copy_without_render": [
"*not-render... | Copy over test from the PR into its own moduledef test_generate_copy_without_render_extensions(self):
generate.generate_files(
context={
'cookiecutter': {
"repo_name": "test_copy_without_render",
"render_test": "I have been rendered!",
"_copy_witho... | <commit_before><commit_msg>Copy over test from the PR into its own module<commit_after>def test_generate_copy_without_render_extensions(self):
generate.generate_files(
context={
'cookiecutter': {
"repo_name": "test_copy_without_render",
"render_test": "I have been... | |
3bf0c34c256e0c94475283bbeffdbc8fb384aa25 | tests/test_tool_placement.py | tests/test_tool_placement.py | import pytest
from gi.repository import Gtk
from gaphas.item import Element
from gaphas.tool.placement import PlacementState, on_drag_begin, placement_tool
@pytest.fixture
def tool_factory(connections):
def tool_factory():
return Element(connections)
return tool_factory
def test_can_create_placeme... | Add some extra tests for placement | Add some extra tests for placement
| Python | lgpl-2.1 | amolenaar/gaphas | Add some extra tests for placement | import pytest
from gi.repository import Gtk
from gaphas.item import Element
from gaphas.tool.placement import PlacementState, on_drag_begin, placement_tool
@pytest.fixture
def tool_factory(connections):
def tool_factory():
return Element(connections)
return tool_factory
def test_can_create_placeme... | <commit_before><commit_msg>Add some extra tests for placement<commit_after> | import pytest
from gi.repository import Gtk
from gaphas.item import Element
from gaphas.tool.placement import PlacementState, on_drag_begin, placement_tool
@pytest.fixture
def tool_factory(connections):
def tool_factory():
return Element(connections)
return tool_factory
def test_can_create_placeme... | Add some extra tests for placementimport pytest
from gi.repository import Gtk
from gaphas.item import Element
from gaphas.tool.placement import PlacementState, on_drag_begin, placement_tool
@pytest.fixture
def tool_factory(connections):
def tool_factory():
return Element(connections)
return tool_fac... | <commit_before><commit_msg>Add some extra tests for placement<commit_after>import pytest
from gi.repository import Gtk
from gaphas.item import Element
from gaphas.tool.placement import PlacementState, on_drag_begin, placement_tool
@pytest.fixture
def tool_factory(connections):
def tool_factory():
return ... | |
8baf19e38ea7c51679d2e5ed32e8519a3290f20c | code/print_analysis_files.py | code/print_analysis_files.py | import synthetic_data_experiments as sde
import logging
if __name__ == "__main__":
args = sde.get_integrous_arguments_values()
for repeat_idx in xrange(args.num_repeats) :
resu_dir = "%s/repeat_%d" % (args.resu_dir, repeat_idx)
data_dir = '%s/repeat_%d' % (args.data_di... | Create script that print analysis_files (rep per rep) | Create script that print analysis_files (rep per rep)
| Python | mit | chagaz/sfan,chagaz/sfan,chagaz/sfan,chagaz/sfan,chagaz/sfan | Create script that print analysis_files (rep per rep) | import synthetic_data_experiments as sde
import logging
if __name__ == "__main__":
args = sde.get_integrous_arguments_values()
for repeat_idx in xrange(args.num_repeats) :
resu_dir = "%s/repeat_%d" % (args.resu_dir, repeat_idx)
data_dir = '%s/repeat_%d' % (args.data_di... | <commit_before><commit_msg>Create script that print analysis_files (rep per rep)<commit_after> | import synthetic_data_experiments as sde
import logging
if __name__ == "__main__":
args = sde.get_integrous_arguments_values()
for repeat_idx in xrange(args.num_repeats) :
resu_dir = "%s/repeat_%d" % (args.resu_dir, repeat_idx)
data_dir = '%s/repeat_%d' % (args.data_di... | Create script that print analysis_files (rep per rep)import synthetic_data_experiments as sde
import logging
if __name__ == "__main__":
args = sde.get_integrous_arguments_values()
for repeat_idx in xrange(args.num_repeats) :
resu_dir = "%s/repeat_%d" % (args.resu_dir, repeat_id... | <commit_before><commit_msg>Create script that print analysis_files (rep per rep)<commit_after>import synthetic_data_experiments as sde
import logging
if __name__ == "__main__":
args = sde.get_integrous_arguments_values()
for repeat_idx in xrange(args.num_repeats) :
resu_dir = "... | |
e425efee30dacb16b5e3f677ffea8ab39c66c6ac | dump_db.py | dump_db.py | # !/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Dump SQL database into bibtex file."""
import sys
import bibtexparser
from bibtexparser.bparser import BibTexParser
from bibtexparser.bwriter import BibTexWriter
from bibtexparser.bibdatabase import BibDatabase
from bibtexparser.customization import convert_to_unicod... | Add a script to dump DB in bib file | [DEV] Add a script to dump DB in bib file
| Python | mit | frapac/bibtex-browser,frapac/bibtex-browser,frapac/bibtex-browser | [DEV] Add a script to dump DB in bib file | # !/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Dump SQL database into bibtex file."""
import sys
import bibtexparser
from bibtexparser.bparser import BibTexParser
from bibtexparser.bwriter import BibTexWriter
from bibtexparser.bibdatabase import BibDatabase
from bibtexparser.customization import convert_to_unicod... | <commit_before><commit_msg>[DEV] Add a script to dump DB in bib file<commit_after> | # !/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Dump SQL database into bibtex file."""
import sys
import bibtexparser
from bibtexparser.bparser import BibTexParser
from bibtexparser.bwriter import BibTexWriter
from bibtexparser.bibdatabase import BibDatabase
from bibtexparser.customization import convert_to_unicod... | [DEV] Add a script to dump DB in bib file# !/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Dump SQL database into bibtex file."""
import sys
import bibtexparser
from bibtexparser.bparser import BibTexParser
from bibtexparser.bwriter import BibTexWriter
from bibtexparser.bibdatabase import BibDatabase
from bibtexpars... | <commit_before><commit_msg>[DEV] Add a script to dump DB in bib file<commit_after># !/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Dump SQL database into bibtex file."""
import sys
import bibtexparser
from bibtexparser.bparser import BibTexParser
from bibtexparser.bwriter import BibTexWriter
from bibtexparser.bibda... | |
f5172547163660cacee8c6e8dda157322ac7e0a1 | fib/fib.py | fib/fib.py | phi = (1 + 5**0.5) / 2
def F(n):
return int(round((phi**n - (1-phi)**n) / 5**0.5))
def fib(n):
a = 0
fibs = []
if n > 0:
while a < n:
a = a + 1
fibs.append(F(a))
elif n < 0:
while a > n:
a = a - 1
fibs.append(F(a))
return fibs
def ... | Add Fibonacci script to Python | Add Fibonacci script to Python
| Python | mit | Strikingwolf/Messing-With-Python | Add Fibonacci script to Python | phi = (1 + 5**0.5) / 2
def F(n):
return int(round((phi**n - (1-phi)**n) / 5**0.5))
def fib(n):
a = 0
fibs = []
if n > 0:
while a < n:
a = a + 1
fibs.append(F(a))
elif n < 0:
while a > n:
a = a - 1
fibs.append(F(a))
return fibs
def ... | <commit_before><commit_msg>Add Fibonacci script to Python<commit_after> | phi = (1 + 5**0.5) / 2
def F(n):
return int(round((phi**n - (1-phi)**n) / 5**0.5))
def fib(n):
a = 0
fibs = []
if n > 0:
while a < n:
a = a + 1
fibs.append(F(a))
elif n < 0:
while a > n:
a = a - 1
fibs.append(F(a))
return fibs
def ... | Add Fibonacci script to Pythonphi = (1 + 5**0.5) / 2
def F(n):
return int(round((phi**n - (1-phi)**n) / 5**0.5))
def fib(n):
a = 0
fibs = []
if n > 0:
while a < n:
a = a + 1
fibs.append(F(a))
elif n < 0:
while a > n:
a = a - 1
fibs.app... | <commit_before><commit_msg>Add Fibonacci script to Python<commit_after>phi = (1 + 5**0.5) / 2
def F(n):
return int(round((phi**n - (1-phi)**n) / 5**0.5))
def fib(n):
a = 0
fibs = []
if n > 0:
while a < n:
a = a + 1
fibs.append(F(a))
elif n < 0:
while a > n:
... | |
862611ce97a45f5cbc78cae298a7f4936454ad19 | examples/crackme_xor_obfu.py | examples/crackme_xor_obfu.py |
import smt2lib
from triton import *
# PoC. Doesn't work yet
# $ triton ./examples/crackme_xor_obfu.py ./samples/crackmes/crackme_xor_obfu a
_GREEN = "\033[92m"
_ENDC = "\033[0m"
def cbeforeSymProc(instruction):
# 400544 mov [rbp+user_password], rdi
# RDI points on the user password
if instruction... | Test to crack the xor obfuscation crackme | Test to crack the xor obfuscation crackme
| Python | apache-2.0 | JonathanSalwan/Triton,JonathanSalwan/Triton,JonathanSalwan/Triton,JonathanSalwan/Triton,JonathanSalwan/Triton | Test to crack the xor obfuscation crackme |
import smt2lib
from triton import *
# PoC. Doesn't work yet
# $ triton ./examples/crackme_xor_obfu.py ./samples/crackmes/crackme_xor_obfu a
_GREEN = "\033[92m"
_ENDC = "\033[0m"
def cbeforeSymProc(instruction):
# 400544 mov [rbp+user_password], rdi
# RDI points on the user password
if instruction... | <commit_before><commit_msg>Test to crack the xor obfuscation crackme<commit_after> |
import smt2lib
from triton import *
# PoC. Doesn't work yet
# $ triton ./examples/crackme_xor_obfu.py ./samples/crackmes/crackme_xor_obfu a
_GREEN = "\033[92m"
_ENDC = "\033[0m"
def cbeforeSymProc(instruction):
# 400544 mov [rbp+user_password], rdi
# RDI points on the user password
if instruction... | Test to crack the xor obfuscation crackme
import smt2lib
from triton import *
# PoC. Doesn't work yet
# $ triton ./examples/crackme_xor_obfu.py ./samples/crackmes/crackme_xor_obfu a
_GREEN = "\033[92m"
_ENDC = "\033[0m"
def cbeforeSymProc(instruction):
# 400544 mov [rbp+user_password], rdi
# RDI point... | <commit_before><commit_msg>Test to crack the xor obfuscation crackme<commit_after>
import smt2lib
from triton import *
# PoC. Doesn't work yet
# $ triton ./examples/crackme_xor_obfu.py ./samples/crackmes/crackme_xor_obfu a
_GREEN = "\033[92m"
_ENDC = "\033[0m"
def cbeforeSymProc(instruction):
# 400544 mov... | |
6fc0c3884c38448956273d99a57e0c758ecbc658 | crmapp/marketing/views.py | crmapp/marketing/views.py | from django.shortcuts import render
# Create your views here.
| from django.views.generic.base import TemplateView
class HomePage(TemplateView):
"""
Because our needs are so simple, all we have to do is
assign one value; template_name. The home.html file will be created
in the next lesson.
"""
template_name = 'marketing/home.html'
| Create the Home Page > Create the Home Page View | Create the Home Page > Create the Home Page View
| Python | mit | tabdon/crmeasyapp,tabdon/crmeasyapp,deenaariff/Django | from django.shortcuts import render
# Create your views here.
Create the Home Page > Create the Home Page View | from django.views.generic.base import TemplateView
class HomePage(TemplateView):
"""
Because our needs are so simple, all we have to do is
assign one value; template_name. The home.html file will be created
in the next lesson.
"""
template_name = 'marketing/home.html'
| <commit_before>from django.shortcuts import render
# Create your views here.
<commit_msg>Create the Home Page > Create the Home Page View<commit_after> | from django.views.generic.base import TemplateView
class HomePage(TemplateView):
"""
Because our needs are so simple, all we have to do is
assign one value; template_name. The home.html file will be created
in the next lesson.
"""
template_name = 'marketing/home.html'
| from django.shortcuts import render
# Create your views here.
Create the Home Page > Create the Home Page Viewfrom django.views.generic.base import TemplateView
class HomePage(TemplateView):
"""
Because our needs are so simple, all we have to do is
assign one value; template_name. The home.html file will ... | <commit_before>from django.shortcuts import render
# Create your views here.
<commit_msg>Create the Home Page > Create the Home Page View<commit_after>from django.views.generic.base import TemplateView
class HomePage(TemplateView):
"""
Because our needs are so simple, all we have to do is
assign one value... |
3e147eba049c51c3b1c7c7278f48e40ef5b1263f | paperpass.py | paperpass.py | import json
class PaperPass:
# class var
outline = {}
def __init__(self, outline):
self.outline = outline
def outputjson(self, filename):
fp = open(filename, 'w')
json.dump(self.outline, fp)
if __name__ == "__main__":
import sys
a = PaperPass({3:2,2:1})
a.outpu... | Create PaperPass class. It contains outputjson method. | Create PaperPass class. It contains outputjson method.
| Python | mit | lucaskotw/paperpass | Create PaperPass class. It contains outputjson method. | import json
class PaperPass:
# class var
outline = {}
def __init__(self, outline):
self.outline = outline
def outputjson(self, filename):
fp = open(filename, 'w')
json.dump(self.outline, fp)
if __name__ == "__main__":
import sys
a = PaperPass({3:2,2:1})
a.outpu... | <commit_before><commit_msg>Create PaperPass class. It contains outputjson method.<commit_after> | import json
class PaperPass:
# class var
outline = {}
def __init__(self, outline):
self.outline = outline
def outputjson(self, filename):
fp = open(filename, 'w')
json.dump(self.outline, fp)
if __name__ == "__main__":
import sys
a = PaperPass({3:2,2:1})
a.outpu... | Create PaperPass class. It contains outputjson method.import json
class PaperPass:
# class var
outline = {}
def __init__(self, outline):
self.outline = outline
def outputjson(self, filename):
fp = open(filename, 'w')
json.dump(self.outline, fp)
if __name__ == "__main__":
... | <commit_before><commit_msg>Create PaperPass class. It contains outputjson method.<commit_after>import json
class PaperPass:
# class var
outline = {}
def __init__(self, outline):
self.outline = outline
def outputjson(self, filename):
fp = open(filename, 'w')
json.dump(self.out... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.