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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dcac78f31a2c46038d547821d8b56d721a095093 | app/tools/application.py | app/tools/application.py | # -*- coding:utf-8 -*-
import os,time,asyncio,json
import logging
logging.basicConfig(level=logging.ERROR)
try:
from aiohttp import web
except ImportError:
logging.error("Can't import module aiohttp")
from tools.log import Log
from tools.httptools import Middleware,Route,Template
from tools.config import Config
clas... | Add Application class,for init all self write module | Add Application class,for init all self write module
| Python | mit | free-free/pyblog,free-free/pyblog,free-free/pyblog,free-free/pyblog | Add Application class,for init all self write module | # -*- coding:utf-8 -*-
import os,time,asyncio,json
import logging
logging.basicConfig(level=logging.ERROR)
try:
from aiohttp import web
except ImportError:
logging.error("Can't import module aiohttp")
from tools.log import Log
from tools.httptools import Middleware,Route,Template
from tools.config import Config
clas... | <commit_before><commit_msg>Add Application class,for init all self write module<commit_after> | # -*- coding:utf-8 -*-
import os,time,asyncio,json
import logging
logging.basicConfig(level=logging.ERROR)
try:
from aiohttp import web
except ImportError:
logging.error("Can't import module aiohttp")
from tools.log import Log
from tools.httptools import Middleware,Route,Template
from tools.config import Config
clas... | Add Application class,for init all self write module# -*- coding:utf-8 -*-
import os,time,asyncio,json
import logging
logging.basicConfig(level=logging.ERROR)
try:
from aiohttp import web
except ImportError:
logging.error("Can't import module aiohttp")
from tools.log import Log
from tools.httptools import Middleware,... | <commit_before><commit_msg>Add Application class,for init all self write module<commit_after># -*- coding:utf-8 -*-
import os,time,asyncio,json
import logging
logging.basicConfig(level=logging.ERROR)
try:
from aiohttp import web
except ImportError:
logging.error("Can't import module aiohttp")
from tools.log import Lo... | |
cbb6bee9622f5a899892a3fdf05368ac3665ff06 | zues/migrations/0002_change_managers.py | zues/migrations/0002_change_managers.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import zues.utils
class Migration(migrations.Migration):
dependencies = [
('zues', '0001_initial'),
]
operations = [
migrations.AlterModelManagers(
name='actuelepolitieke... | Add migration to change managers | Add migration to change managers
| Python | mit | jonge-democraten/zues,jonge-democraten/zues,jonge-democraten/zues | Add migration to change managers | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import zues.utils
class Migration(migrations.Migration):
dependencies = [
('zues', '0001_initial'),
]
operations = [
migrations.AlterModelManagers(
name='actuelepolitieke... | <commit_before><commit_msg>Add migration to change managers<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import zues.utils
class Migration(migrations.Migration):
dependencies = [
('zues', '0001_initial'),
]
operations = [
migrations.AlterModelManagers(
name='actuelepolitieke... | Add migration to change managers# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import zues.utils
class Migration(migrations.Migration):
dependencies = [
('zues', '0001_initial'),
]
operations = [
migrations.AlterModelManagers(
... | <commit_before><commit_msg>Add migration to change managers<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import zues.utils
class Migration(migrations.Migration):
dependencies = [
('zues', '0001_initial'),
]
operations = [
... | |
d1009f5de4a8e9a97686d36f26d60255ffffea42 | anytownlib/kavrayskiy.py | anytownlib/kavrayskiy.py | """Functions that produce a Kavrayskiy VII projection map."""
import math
def coords_to_kavrayskiy(coords):
"""Convert geographical coordinates to Kavrayskiy VII coordinates.
A Kavrayskiy VII map is defined with the following dimensions:
- Height: pi units
- Width: sqrt(3) * pi units
"""
# c... | Add Kavrayskiy VII utils lib | Add Kavrayskiy VII utils lib
| Python | mit | andrewyang96/AnytownMapper,andrewyang96/AnytownMapper,andrewyang96/AnytownMapper | Add Kavrayskiy VII utils lib | """Functions that produce a Kavrayskiy VII projection map."""
import math
def coords_to_kavrayskiy(coords):
"""Convert geographical coordinates to Kavrayskiy VII coordinates.
A Kavrayskiy VII map is defined with the following dimensions:
- Height: pi units
- Width: sqrt(3) * pi units
"""
# c... | <commit_before><commit_msg>Add Kavrayskiy VII utils lib<commit_after> | """Functions that produce a Kavrayskiy VII projection map."""
import math
def coords_to_kavrayskiy(coords):
"""Convert geographical coordinates to Kavrayskiy VII coordinates.
A Kavrayskiy VII map is defined with the following dimensions:
- Height: pi units
- Width: sqrt(3) * pi units
"""
# c... | Add Kavrayskiy VII utils lib"""Functions that produce a Kavrayskiy VII projection map."""
import math
def coords_to_kavrayskiy(coords):
"""Convert geographical coordinates to Kavrayskiy VII coordinates.
A Kavrayskiy VII map is defined with the following dimensions:
- Height: pi units
- Width: sqrt(3... | <commit_before><commit_msg>Add Kavrayskiy VII utils lib<commit_after>"""Functions that produce a Kavrayskiy VII projection map."""
import math
def coords_to_kavrayskiy(coords):
"""Convert geographical coordinates to Kavrayskiy VII coordinates.
A Kavrayskiy VII map is defined with the following dimensions:
... | |
fc253535f2ef3cc256b8dd6912b65ac136eafb9c | heat/tests/functional/test_WordPress_Single_Instance_With_HA.py | heat/tests/functional/test_WordPress_Single_Instance_With_HA.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | Add functional test for HA template | Add functional test for HA template
Change-Id: I6d3304b807492e7041264402d161365447fa6ce1
Signed-off-by: Angus Salkeld <[email protected]>
| Python | apache-2.0 | takeshineshiro/heat,cryptickp/heat,dims/heat,pratikmallya/heat,varunarya10/heat,jasondunsmore/heat,steveb/heat,rickerc/heat_audit,dims/heat,varunarya10/heat,citrix-openstack-build/heat,jasondunsmore/heat,maestro-hybrid-cloud/heat,miguelgrinberg/heat,pratikmallya/heat,cwolferh/heat-scratch,gonzolino/heat,dragorosson/hea... | Add functional test for HA template
Change-Id: I6d3304b807492e7041264402d161365447fa6ce1
Signed-off-by: Angus Salkeld <[email protected]> | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | <commit_before><commit_msg>Add functional test for HA template
Change-Id: I6d3304b807492e7041264402d161365447fa6ce1
Signed-off-by: Angus Salkeld <[email protected]><commit_after> | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | Add functional test for HA template
Change-Id: I6d3304b807492e7041264402d161365447fa6ce1
Signed-off-by: Angus Salkeld <[email protected]># vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file ex... | <commit_before><commit_msg>Add functional test for HA template
Change-Id: I6d3304b807492e7041264402d161365447fa6ce1
Signed-off-by: Angus Salkeld <[email protected]><commit_after># vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Licensed under the Apache License, Version 2.0 (the "Lic... | |
55fe2230ad3d4f9c4957600b0ff49ce23575017a | senato/spiders/zan_spider.py | senato/spiders/zan_spider.py | # -*- coding: utf-8 -*-
import os
import re
import scrapy
AMENDMENT_XPATH = '//dl[@class="emendamenti"]/dt/a/@href'
AMENDMENT_URL = '/leg/18/BGT/Testi/Emend/0{parent}/0{_id}.akn'
HREF_REGEX = r'id=(?P<_id>\d+)&idoggetto=(?P<parent>\d+)'
class ZanSpider(scrapy.Spider):
name = 'zan'
allowed_domains = ['senat... | Add spider for the amendments to the Zan DDL | Add spider for the amendments to the Zan DDL
| Python | mit | jacquerie/senato.py | Add spider for the amendments to the Zan DDL | # -*- coding: utf-8 -*-
import os
import re
import scrapy
AMENDMENT_XPATH = '//dl[@class="emendamenti"]/dt/a/@href'
AMENDMENT_URL = '/leg/18/BGT/Testi/Emend/0{parent}/0{_id}.akn'
HREF_REGEX = r'id=(?P<_id>\d+)&idoggetto=(?P<parent>\d+)'
class ZanSpider(scrapy.Spider):
name = 'zan'
allowed_domains = ['senat... | <commit_before><commit_msg>Add spider for the amendments to the Zan DDL<commit_after> | # -*- coding: utf-8 -*-
import os
import re
import scrapy
AMENDMENT_XPATH = '//dl[@class="emendamenti"]/dt/a/@href'
AMENDMENT_URL = '/leg/18/BGT/Testi/Emend/0{parent}/0{_id}.akn'
HREF_REGEX = r'id=(?P<_id>\d+)&idoggetto=(?P<parent>\d+)'
class ZanSpider(scrapy.Spider):
name = 'zan'
allowed_domains = ['senat... | Add spider for the amendments to the Zan DDL# -*- coding: utf-8 -*-
import os
import re
import scrapy
AMENDMENT_XPATH = '//dl[@class="emendamenti"]/dt/a/@href'
AMENDMENT_URL = '/leg/18/BGT/Testi/Emend/0{parent}/0{_id}.akn'
HREF_REGEX = r'id=(?P<_id>\d+)&idoggetto=(?P<parent>\d+)'
class ZanSpider(scrapy.Spider):
... | <commit_before><commit_msg>Add spider for the amendments to the Zan DDL<commit_after># -*- coding: utf-8 -*-
import os
import re
import scrapy
AMENDMENT_XPATH = '//dl[@class="emendamenti"]/dt/a/@href'
AMENDMENT_URL = '/leg/18/BGT/Testi/Emend/0{parent}/0{_id}.akn'
HREF_REGEX = r'id=(?P<_id>\d+)&idoggetto=(?P<parent>\... | |
4e3b01b3f702c60083dd94136263cea9e11fb725 | server/daily_backup.py | server/daily_backup.py | #!/usr/bin/env python2
# coding: utf-8
'''
A daily backup script
How to use:
0. Init a borg repository using `borg init ...`
1. Fill information in this script
2. Set a daily cron job for this script
3. Sleep. :) You'll be notified once the backup finished or failed.
'''
import os
from requests import post as http_pos... | Add server daily backup script | Add server daily backup script
| Python | bsd-2-clause | JokerQyou/toolset,JokerQyou/toolset | Add server daily backup script | #!/usr/bin/env python2
# coding: utf-8
'''
A daily backup script
How to use:
0. Init a borg repository using `borg init ...`
1. Fill information in this script
2. Set a daily cron job for this script
3. Sleep. :) You'll be notified once the backup finished or failed.
'''
import os
from requests import post as http_pos... | <commit_before><commit_msg>Add server daily backup script<commit_after> | #!/usr/bin/env python2
# coding: utf-8
'''
A daily backup script
How to use:
0. Init a borg repository using `borg init ...`
1. Fill information in this script
2. Set a daily cron job for this script
3. Sleep. :) You'll be notified once the backup finished or failed.
'''
import os
from requests import post as http_pos... | Add server daily backup script#!/usr/bin/env python2
# coding: utf-8
'''
A daily backup script
How to use:
0. Init a borg repository using `borg init ...`
1. Fill information in this script
2. Set a daily cron job for this script
3. Sleep. :) You'll be notified once the backup finished or failed.
'''
import os
from re... | <commit_before><commit_msg>Add server daily backup script<commit_after>#!/usr/bin/env python2
# coding: utf-8
'''
A daily backup script
How to use:
0. Init a borg repository using `borg init ...`
1. Fill information in this script
2. Set a daily cron job for this script
3. Sleep. :) You'll be notified once the backup f... | |
299bfcd6cff71f847023eeb3bcd4a8296457f2d9 | scripts/merge_abr_files.py | scripts/merge_abr_files.py | import os.path
from cochlear.util import merge_abr_files
if __name__ == '__main__':
import argparse
description = 'Merge ABR files'
parser = argparse.ArgumentParser(description=description)
parser.add_argument('files', nargs='+', help='ABR files to merge')
parser.add_argument('-o', '--out', nargs... | Add script to merge ABR files | Add script to merge ABR files
| Python | bsd-3-clause | bburan/cochlear | Add script to merge ABR files | import os.path
from cochlear.util import merge_abr_files
if __name__ == '__main__':
import argparse
description = 'Merge ABR files'
parser = argparse.ArgumentParser(description=description)
parser.add_argument('files', nargs='+', help='ABR files to merge')
parser.add_argument('-o', '--out', nargs... | <commit_before><commit_msg>Add script to merge ABR files<commit_after> | import os.path
from cochlear.util import merge_abr_files
if __name__ == '__main__':
import argparse
description = 'Merge ABR files'
parser = argparse.ArgumentParser(description=description)
parser.add_argument('files', nargs='+', help='ABR files to merge')
parser.add_argument('-o', '--out', nargs... | Add script to merge ABR filesimport os.path
from cochlear.util import merge_abr_files
if __name__ == '__main__':
import argparse
description = 'Merge ABR files'
parser = argparse.ArgumentParser(description=description)
parser.add_argument('files', nargs='+', help='ABR files to merge')
parser.add_... | <commit_before><commit_msg>Add script to merge ABR files<commit_after>import os.path
from cochlear.util import merge_abr_files
if __name__ == '__main__':
import argparse
description = 'Merge ABR files'
parser = argparse.ArgumentParser(description=description)
parser.add_argument('files', nargs='+', h... | |
4631a2192b24675f61f4eec5ab68e273ea47cca8 | sklearn/svm/sparse/base.py | sklearn/svm/sparse/base.py | import numpy as np
import scipy.sparse
from abc import ABCMeta, abstractmethod
from ..base import BaseLibSVM
class SparseBaseLibSVM(BaseLibSVM):
__metaclass__ = ABCMeta
@abstractmethod
def __init__(self, impl, kernel, degree, gamma, coef0,
tol, C, nu, epsilon, shrinking, probability, ca... | import numpy as np
import scipy.sparse
from abc import ABCMeta, abstractmethod
from ..base import BaseLibSVM
class SparseBaseLibSVM(BaseLibSVM):
__metaclass__ = ABCMeta
@abstractmethod
def __init__(self, impl, kernel, degree, gamma, coef0,
tol, C, nu, epsilon, shrinking, probability, ca... | FIX sparse OneClassSVM was using the wrong parameter | FIX sparse OneClassSVM was using the wrong parameter
| Python | bsd-3-clause | rishikksh20/scikit-learn,kmike/scikit-learn,JPFrancoia/scikit-learn,B3AU/waveTree,themrmax/scikit-learn,vybstat/scikit-learn,kaichogami/scikit-learn,IndraVikas/scikit-learn,walterreade/scikit-learn,tosolveit/scikit-learn,macks22/scikit-learn,AlexRobson/scikit-learn,heli522/scikit-learn,robbymeals/scikit-learn,xuewei4d/... | import numpy as np
import scipy.sparse
from abc import ABCMeta, abstractmethod
from ..base import BaseLibSVM
class SparseBaseLibSVM(BaseLibSVM):
__metaclass__ = ABCMeta
@abstractmethod
def __init__(self, impl, kernel, degree, gamma, coef0,
tol, C, nu, epsilon, shrinking, probability, ca... | import numpy as np
import scipy.sparse
from abc import ABCMeta, abstractmethod
from ..base import BaseLibSVM
class SparseBaseLibSVM(BaseLibSVM):
__metaclass__ = ABCMeta
@abstractmethod
def __init__(self, impl, kernel, degree, gamma, coef0,
tol, C, nu, epsilon, shrinking, probability, ca... | <commit_before>import numpy as np
import scipy.sparse
from abc import ABCMeta, abstractmethod
from ..base import BaseLibSVM
class SparseBaseLibSVM(BaseLibSVM):
__metaclass__ = ABCMeta
@abstractmethod
def __init__(self, impl, kernel, degree, gamma, coef0,
tol, C, nu, epsilon, shrinking, ... | import numpy as np
import scipy.sparse
from abc import ABCMeta, abstractmethod
from ..base import BaseLibSVM
class SparseBaseLibSVM(BaseLibSVM):
__metaclass__ = ABCMeta
@abstractmethod
def __init__(self, impl, kernel, degree, gamma, coef0,
tol, C, nu, epsilon, shrinking, probability, ca... | import numpy as np
import scipy.sparse
from abc import ABCMeta, abstractmethod
from ..base import BaseLibSVM
class SparseBaseLibSVM(BaseLibSVM):
__metaclass__ = ABCMeta
@abstractmethod
def __init__(self, impl, kernel, degree, gamma, coef0,
tol, C, nu, epsilon, shrinking, probability, ca... | <commit_before>import numpy as np
import scipy.sparse
from abc import ABCMeta, abstractmethod
from ..base import BaseLibSVM
class SparseBaseLibSVM(BaseLibSVM):
__metaclass__ = ABCMeta
@abstractmethod
def __init__(self, impl, kernel, degree, gamma, coef0,
tol, C, nu, epsilon, shrinking, ... |
37a8da7f759e2218c63b9c56e69cca0987855cc9 | comics/crawler/crawlers/johnnywander.py | comics/crawler/crawlers/johnnywander.py | from comics.crawler.base import BaseComicCrawler
from comics.crawler.meta import BaseComicMeta
class ComicMeta(BaseComicMeta):
name = 'Johnny Wander'
language = 'en'
url = 'http://www.johnnywander.com/'
start_date = '2008-09-30'
history_capable_days = 40
schedule = 'Tu,Th'
time_zone = -8
... | Add crawler for Johnny Wander | Add crawler for Johnny Wander
| Python | agpl-3.0 | jodal/comics,jodal/comics,klette/comics,jodal/comics,jodal/comics,klette/comics,datagutten/comics,klette/comics,datagutten/comics,datagutten/comics,datagutten/comics | Add crawler for Johnny Wander | from comics.crawler.base import BaseComicCrawler
from comics.crawler.meta import BaseComicMeta
class ComicMeta(BaseComicMeta):
name = 'Johnny Wander'
language = 'en'
url = 'http://www.johnnywander.com/'
start_date = '2008-09-30'
history_capable_days = 40
schedule = 'Tu,Th'
time_zone = -8
... | <commit_before><commit_msg>Add crawler for Johnny Wander<commit_after> | from comics.crawler.base import BaseComicCrawler
from comics.crawler.meta import BaseComicMeta
class ComicMeta(BaseComicMeta):
name = 'Johnny Wander'
language = 'en'
url = 'http://www.johnnywander.com/'
start_date = '2008-09-30'
history_capable_days = 40
schedule = 'Tu,Th'
time_zone = -8
... | Add crawler for Johnny Wanderfrom comics.crawler.base import BaseComicCrawler
from comics.crawler.meta import BaseComicMeta
class ComicMeta(BaseComicMeta):
name = 'Johnny Wander'
language = 'en'
url = 'http://www.johnnywander.com/'
start_date = '2008-09-30'
history_capable_days = 40
schedule = ... | <commit_before><commit_msg>Add crawler for Johnny Wander<commit_after>from comics.crawler.base import BaseComicCrawler
from comics.crawler.meta import BaseComicMeta
class ComicMeta(BaseComicMeta):
name = 'Johnny Wander'
language = 'en'
url = 'http://www.johnnywander.com/'
start_date = '2008-09-30'
... | |
cd97d293343f59b28c59ec88c1f80ebb4697a3f2 | protein_preview_generation/protein_preview_generation.py | protein_preview_generation/protein_preview_generation.py | ##This script takes a path with PDB files, an output path and a csv file as inputs, and creates a high quality static image
#of each uniprot in the csv file in the right orientation, coloured by secondary structure
#The CSV file contains a column with uniprot ids, a column with the pdb file that contains the best chain... | Add protein preview generation script | Add protein preview generation script
| Python | mit | jtapial/snvdb,jtapial/snvdb | Add protein preview generation script | ##This script takes a path with PDB files, an output path and a csv file as inputs, and creates a high quality static image
#of each uniprot in the csv file in the right orientation, coloured by secondary structure
#The CSV file contains a column with uniprot ids, a column with the pdb file that contains the best chain... | <commit_before><commit_msg>Add protein preview generation script<commit_after> | ##This script takes a path with PDB files, an output path and a csv file as inputs, and creates a high quality static image
#of each uniprot in the csv file in the right orientation, coloured by secondary structure
#The CSV file contains a column with uniprot ids, a column with the pdb file that contains the best chain... | Add protein preview generation script##This script takes a path with PDB files, an output path and a csv file as inputs, and creates a high quality static image
#of each uniprot in the csv file in the right orientation, coloured by secondary structure
#The CSV file contains a column with uniprot ids, a column with the ... | <commit_before><commit_msg>Add protein preview generation script<commit_after>##This script takes a path with PDB files, an output path and a csv file as inputs, and creates a high quality static image
#of each uniprot in the csv file in the right orientation, coloured by secondary structure
#The CSV file contains a co... | |
213708504447c8858ed3ba86324acaff98dbefdf | seahub/profile/models.py | seahub/profile/models.py | from django.db import models
class Profile(models.Model):
user = models.EmailField(unique=True)
nickname = models.CharField(max_length=64, blank=True)
intro = models.TextField(max_length=256, blank=True)
| from django.db import models
from django.core.cache import cache
from django.dispatch import receiver
from settings import EMAIL_ID_CACHE_PREFIX, EMAIL_ID_CACHE_TIMEOUT
from registration.signals import user_registered
class Profile(models.Model):
user = models.EmailField(unique=True)
nickname = models.CharFie... | Update email_id cache when user has registered | Update email_id cache when user has registered
| Python | apache-2.0 | madflow/seahub,cloudcopy/seahub,Chilledheart/seahub,cloudcopy/seahub,miurahr/seahub,Chilledheart/seahub,cloudcopy/seahub,miurahr/seahub,madflow/seahub,madflow/seahub,cloudcopy/seahub,miurahr/seahub,Chilledheart/seahub,madflow/seahub,madflow/seahub,Chilledheart/seahub,Chilledheart/seahub,miurahr/seahub | from django.db import models
class Profile(models.Model):
user = models.EmailField(unique=True)
nickname = models.CharField(max_length=64, blank=True)
intro = models.TextField(max_length=256, blank=True)
Update email_id cache when user has registered | from django.db import models
from django.core.cache import cache
from django.dispatch import receiver
from settings import EMAIL_ID_CACHE_PREFIX, EMAIL_ID_CACHE_TIMEOUT
from registration.signals import user_registered
class Profile(models.Model):
user = models.EmailField(unique=True)
nickname = models.CharFie... | <commit_before>from django.db import models
class Profile(models.Model):
user = models.EmailField(unique=True)
nickname = models.CharField(max_length=64, blank=True)
intro = models.TextField(max_length=256, blank=True)
<commit_msg>Update email_id cache when user has registered<commit_after> | from django.db import models
from django.core.cache import cache
from django.dispatch import receiver
from settings import EMAIL_ID_CACHE_PREFIX, EMAIL_ID_CACHE_TIMEOUT
from registration.signals import user_registered
class Profile(models.Model):
user = models.EmailField(unique=True)
nickname = models.CharFie... | from django.db import models
class Profile(models.Model):
user = models.EmailField(unique=True)
nickname = models.CharField(max_length=64, blank=True)
intro = models.TextField(max_length=256, blank=True)
Update email_id cache when user has registeredfrom django.db import models
from django.core.cache impo... | <commit_before>from django.db import models
class Profile(models.Model):
user = models.EmailField(unique=True)
nickname = models.CharField(max_length=64, blank=True)
intro = models.TextField(max_length=256, blank=True)
<commit_msg>Update email_id cache when user has registered<commit_after>from django.db ... |
25215f3b353122ccb4a20b00a9fdcdaca81f3ef8 | other/vlen_leak.py | other/vlen_leak.py |
"""
Demonstrates memory leak involving variable-length strings.
"""
import sys
import resource
import numpy as np
import h5py
FNAME = 'test.hdf5'
if 'linux' in sys.platform:
MAXRSS_BYTES = 1024. # in KiB on linux
else:
MAXRSS_BYTES = 1.
if sys.version_info[0] == 3:
xrange = range
memory = 0
def p... | Add script demonstrating vlen memory leak | Add script demonstrating vlen memory leak
| Python | bsd-3-clause | h5py/h5py,h5py/h5py,h5py/h5py | Add script demonstrating vlen memory leak |
"""
Demonstrates memory leak involving variable-length strings.
"""
import sys
import resource
import numpy as np
import h5py
FNAME = 'test.hdf5'
if 'linux' in sys.platform:
MAXRSS_BYTES = 1024. # in KiB on linux
else:
MAXRSS_BYTES = 1.
if sys.version_info[0] == 3:
xrange = range
memory = 0
def p... | <commit_before><commit_msg>Add script demonstrating vlen memory leak<commit_after> |
"""
Demonstrates memory leak involving variable-length strings.
"""
import sys
import resource
import numpy as np
import h5py
FNAME = 'test.hdf5'
if 'linux' in sys.platform:
MAXRSS_BYTES = 1024. # in KiB on linux
else:
MAXRSS_BYTES = 1.
if sys.version_info[0] == 3:
xrange = range
memory = 0
def p... | Add script demonstrating vlen memory leak
"""
Demonstrates memory leak involving variable-length strings.
"""
import sys
import resource
import numpy as np
import h5py
FNAME = 'test.hdf5'
if 'linux' in sys.platform:
MAXRSS_BYTES = 1024. # in KiB on linux
else:
MAXRSS_BYTES = 1.
if sys.version_info[0] =... | <commit_before><commit_msg>Add script demonstrating vlen memory leak<commit_after>
"""
Demonstrates memory leak involving variable-length strings.
"""
import sys
import resource
import numpy as np
import h5py
FNAME = 'test.hdf5'
if 'linux' in sys.platform:
MAXRSS_BYTES = 1024. # in KiB on linux
else:
MA... | |
76d5056c24daf3a61201f6b171a21fc879c0e602 | tests/test_migrations.py | tests/test_migrations.py | import copy
import pytest
import mock
import scrapi
from scrapi.linter.document import NormalizedDocument, RawDocument
from scrapi import tasks
from scrapi.migrations import rename
from scrapi import registry
# Need to force cassandra to ignore set keyspace
from scrapi.processing.cassandra import CassandraProcessor... | Add migration test for rename | Add migration test for rename
| Python | apache-2.0 | fabianvf/scrapi,fabianvf/scrapi,icereval/scrapi,mehanig/scrapi,erinspace/scrapi,felliott/scrapi,alexgarciac/scrapi,erinspace/scrapi,felliott/scrapi,jeffreyliu3230/scrapi,CenterForOpenScience/scrapi,ostwald/scrapi,mehanig/scrapi,CenterForOpenScience/scrapi | Add migration test for rename | import copy
import pytest
import mock
import scrapi
from scrapi.linter.document import NormalizedDocument, RawDocument
from scrapi import tasks
from scrapi.migrations import rename
from scrapi import registry
# Need to force cassandra to ignore set keyspace
from scrapi.processing.cassandra import CassandraProcessor... | <commit_before><commit_msg>Add migration test for rename<commit_after> | import copy
import pytest
import mock
import scrapi
from scrapi.linter.document import NormalizedDocument, RawDocument
from scrapi import tasks
from scrapi.migrations import rename
from scrapi import registry
# Need to force cassandra to ignore set keyspace
from scrapi.processing.cassandra import CassandraProcessor... | Add migration test for renameimport copy
import pytest
import mock
import scrapi
from scrapi.linter.document import NormalizedDocument, RawDocument
from scrapi import tasks
from scrapi.migrations import rename
from scrapi import registry
# Need to force cassandra to ignore set keyspace
from scrapi.processing.cassan... | <commit_before><commit_msg>Add migration test for rename<commit_after>import copy
import pytest
import mock
import scrapi
from scrapi.linter.document import NormalizedDocument, RawDocument
from scrapi import tasks
from scrapi.migrations import rename
from scrapi import registry
# Need to force cassandra to ignore s... | |
1397791e663f57927524ccf7a25915e8059d7376 | tests/provider/test_article_structure.py | tests/provider/test_article_structure.py | import unittest
from ddt import ddt, data, unpack
from provider.article_structure import ArticleInfo
@ddt
class TestArticleStructure(unittest.TestCase):
@unpack
@data({'input': 'elife-07702-vor-r4.zip', 'expected': None},
{'input': 'elife-00013-vor-v1-20121015000000.zip', 'expected':'2012-10-15T00:... | Test article structure replacing lettuce tests | Test article structure replacing lettuce tests
| Python | mit | gnott/elife-bot,jhroot/elife-bot,jhroot/elife-bot,gnott/elife-bot,gnott/elife-bot,jhroot/elife-bot | Test article structure replacing lettuce tests | import unittest
from ddt import ddt, data, unpack
from provider.article_structure import ArticleInfo
@ddt
class TestArticleStructure(unittest.TestCase):
@unpack
@data({'input': 'elife-07702-vor-r4.zip', 'expected': None},
{'input': 'elife-00013-vor-v1-20121015000000.zip', 'expected':'2012-10-15T00:... | <commit_before><commit_msg>Test article structure replacing lettuce tests<commit_after> | import unittest
from ddt import ddt, data, unpack
from provider.article_structure import ArticleInfo
@ddt
class TestArticleStructure(unittest.TestCase):
@unpack
@data({'input': 'elife-07702-vor-r4.zip', 'expected': None},
{'input': 'elife-00013-vor-v1-20121015000000.zip', 'expected':'2012-10-15T00:... | Test article structure replacing lettuce testsimport unittest
from ddt import ddt, data, unpack
from provider.article_structure import ArticleInfo
@ddt
class TestArticleStructure(unittest.TestCase):
@unpack
@data({'input': 'elife-07702-vor-r4.zip', 'expected': None},
{'input': 'elife-00013-vor-v1-2... | <commit_before><commit_msg>Test article structure replacing lettuce tests<commit_after>import unittest
from ddt import ddt, data, unpack
from provider.article_structure import ArticleInfo
@ddt
class TestArticleStructure(unittest.TestCase):
@unpack
@data({'input': 'elife-07702-vor-r4.zip', 'expected': None},
... | |
9388754e53c0d2898a6b1bfbc64f3d5c68c1f8d1 | scripts/box/connect_external_accounts.py | scripts/box/connect_external_accounts.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
First run
rm -rf website/addons/box/views/
Then change the user_settings field of BoxNodeSettings to foreign_user_settings
"""
import sys
import logging
from modularodm import Q
from website.app import init_app
from scripts import utils as script_utils
from frame... | Add script to connect ExternalAccounts and folders -after the pre-merge migrations have been done | Add script to connect ExternalAccounts and folders
-after the pre-merge migrations have been done
| Python | apache-2.0 | RomanZWang/osf.io,RomanZWang/osf.io,amyshi188/osf.io,GageGaskins/osf.io,baylee-d/osf.io,cwisecarver/osf.io,adlius/osf.io,leb2dg/osf.io,jnayak1/osf.io,erinspace/osf.io,acshi/osf.io,billyhunt/osf.io,brianjgeiger/osf.io,wearpants/osf.io,zamattiac/osf.io,mluke93/osf.io,KAsante95/osf.io,leb2dg/osf.io,samchrisinger/osf.io,To... | Add script to connect ExternalAccounts and folders
-after the pre-merge migrations have been done | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
First run
rm -rf website/addons/box/views/
Then change the user_settings field of BoxNodeSettings to foreign_user_settings
"""
import sys
import logging
from modularodm import Q
from website.app import init_app
from scripts import utils as script_utils
from frame... | <commit_before><commit_msg>Add script to connect ExternalAccounts and folders
-after the pre-merge migrations have been done<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
First run
rm -rf website/addons/box/views/
Then change the user_settings field of BoxNodeSettings to foreign_user_settings
"""
import sys
import logging
from modularodm import Q
from website.app import init_app
from scripts import utils as script_utils
from frame... | Add script to connect ExternalAccounts and folders
-after the pre-merge migrations have been done#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
First run
rm -rf website/addons/box/views/
Then change the user_settings field of BoxNodeSettings to foreign_user_settings
"""
import sys
import logging
from modul... | <commit_before><commit_msg>Add script to connect ExternalAccounts and folders
-after the pre-merge migrations have been done<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
First run
rm -rf website/addons/box/views/
Then change the user_settings field of BoxNodeSettings to foreign_user_settings... | |
9e89e35d1071a2123c9fa8a28bf538f2e34daeeb | bumblebee/modules/cpu.py | bumblebee/modules/cpu.py | import bumblebee.module
import psutil
class Module(bumblebee.module.Module):
def __init__(self, args):
super(Module, self).__init__(args)
self._perc = psutil.cpu_percent(percpu=False)
def data(self):
self._perc = psutil.cpu_percent(percpu=False)
return "{:05.02f}%".format(self... | Add module for measuring CPU utilization | [modules] Add module for measuring CPU utilization
Add module "cpu", which uses psutil to measure CPU utilization between
two consecutive calls.
| Python | mit | tobi-wan-kenobi/bumblebee-status,tobi-wan-kenobi/bumblebee-status | [modules] Add module for measuring CPU utilization
Add module "cpu", which uses psutil to measure CPU utilization between
two consecutive calls. | import bumblebee.module
import psutil
class Module(bumblebee.module.Module):
def __init__(self, args):
super(Module, self).__init__(args)
self._perc = psutil.cpu_percent(percpu=False)
def data(self):
self._perc = psutil.cpu_percent(percpu=False)
return "{:05.02f}%".format(self... | <commit_before><commit_msg>[modules] Add module for measuring CPU utilization
Add module "cpu", which uses psutil to measure CPU utilization between
two consecutive calls.<commit_after> | import bumblebee.module
import psutil
class Module(bumblebee.module.Module):
def __init__(self, args):
super(Module, self).__init__(args)
self._perc = psutil.cpu_percent(percpu=False)
def data(self):
self._perc = psutil.cpu_percent(percpu=False)
return "{:05.02f}%".format(self... | [modules] Add module for measuring CPU utilization
Add module "cpu", which uses psutil to measure CPU utilization between
two consecutive calls.import bumblebee.module
import psutil
class Module(bumblebee.module.Module):
def __init__(self, args):
super(Module, self).__init__(args)
self._perc = psu... | <commit_before><commit_msg>[modules] Add module for measuring CPU utilization
Add module "cpu", which uses psutil to measure CPU utilization between
two consecutive calls.<commit_after>import bumblebee.module
import psutil
class Module(bumblebee.module.Module):
def __init__(self, args):
super(Module, self... | |
6e723142d28aafb0bb925cb3456fd962b679349b | app/applier.py | app/applier.py | import random
from collections import namedtuple
Rule = namedtuple('Rule', ['changes', 'environments'])
sonorization = Rule({'p': 'b', 't': 'd', 'ʈ': 'ɖ', 'c':'ɟ', 'k': 'g', 'q': 'ɢ'},
['^.', 'V.V'])
rules = [sonorization]
words = ['potato', 'tobado', 'tabasco']
def choose_rule(words, rules):
... | Create skeleton for new rule chooser | Create skeleton for new rule chooser
| Python | mit | kdelwat/LangEvolve,kdelwat/LangEvolve,kdelwat/LangEvolve | Create skeleton for new rule chooser | import random
from collections import namedtuple
Rule = namedtuple('Rule', ['changes', 'environments'])
sonorization = Rule({'p': 'b', 't': 'd', 'ʈ': 'ɖ', 'c':'ɟ', 'k': 'g', 'q': 'ɢ'},
['^.', 'V.V'])
rules = [sonorization]
words = ['potato', 'tobado', 'tabasco']
def choose_rule(words, rules):
... | <commit_before><commit_msg>Create skeleton for new rule chooser<commit_after> | import random
from collections import namedtuple
Rule = namedtuple('Rule', ['changes', 'environments'])
sonorization = Rule({'p': 'b', 't': 'd', 'ʈ': 'ɖ', 'c':'ɟ', 'k': 'g', 'q': 'ɢ'},
['^.', 'V.V'])
rules = [sonorization]
words = ['potato', 'tobado', 'tabasco']
def choose_rule(words, rules):
... | Create skeleton for new rule chooserimport random
from collections import namedtuple
Rule = namedtuple('Rule', ['changes', 'environments'])
sonorization = Rule({'p': 'b', 't': 'd', 'ʈ': 'ɖ', 'c':'ɟ', 'k': 'g', 'q': 'ɢ'},
['^.', 'V.V'])
rules = [sonorization]
words = ['potato', 'tobado', 'tabasc... | <commit_before><commit_msg>Create skeleton for new rule chooser<commit_after>import random
from collections import namedtuple
Rule = namedtuple('Rule', ['changes', 'environments'])
sonorization = Rule({'p': 'b', 't': 'd', 'ʈ': 'ɖ', 'c':'ɟ', 'k': 'g', 'q': 'ɢ'},
['^.', 'V.V'])
rules = [sonorizati... | |
e1c5891650eaf3934a082e52934a1c4dd113fee7 | doc/quickstart/testlibs/LoginLibrary.py | doc/quickstart/testlibs/LoginLibrary.py | import os
import sys
class LoginLibrary:
def __init__(self):
self._sut_path = os.path.join(os.path.dirname(__file__),
'..', 'sut', 'login.py')
self._status = ''
def create_user(self, username, password):
self._run_command('create', username, pass... | import os
import sys
import subprocess
class LoginLibrary:
def __init__(self):
self._sut_path = os.path.join(os.path.dirname(__file__),
'..', 'sut', 'login.py')
self._status = ''
def create_user(self, username, password):
self._run_command('creat... | Use subprocess isntead of popen to get Jython working too | Use subprocess isntead of popen to get Jython working too
| Python | apache-2.0 | ChrisHirsch/robotframework,alexandrul-ci/robotframework,yonglehou/robotframework,JackNokia/robotframework,edbrannin/robotframework,jaloren/robotframework,un33k/robotframework,Colorfulstan/robotframework,kyle1986/robortframe,synsun/robotframework,userzimmermann/robotframework,userzimmermann/robotframework,un33k/robotfra... | import os
import sys
class LoginLibrary:
def __init__(self):
self._sut_path = os.path.join(os.path.dirname(__file__),
'..', 'sut', 'login.py')
self._status = ''
def create_user(self, username, password):
self._run_command('create', username, pass... | import os
import sys
import subprocess
class LoginLibrary:
def __init__(self):
self._sut_path = os.path.join(os.path.dirname(__file__),
'..', 'sut', 'login.py')
self._status = ''
def create_user(self, username, password):
self._run_command('creat... | <commit_before>import os
import sys
class LoginLibrary:
def __init__(self):
self._sut_path = os.path.join(os.path.dirname(__file__),
'..', 'sut', 'login.py')
self._status = ''
def create_user(self, username, password):
self._run_command('create',... | import os
import sys
import subprocess
class LoginLibrary:
def __init__(self):
self._sut_path = os.path.join(os.path.dirname(__file__),
'..', 'sut', 'login.py')
self._status = ''
def create_user(self, username, password):
self._run_command('creat... | import os
import sys
class LoginLibrary:
def __init__(self):
self._sut_path = os.path.join(os.path.dirname(__file__),
'..', 'sut', 'login.py')
self._status = ''
def create_user(self, username, password):
self._run_command('create', username, pass... | <commit_before>import os
import sys
class LoginLibrary:
def __init__(self):
self._sut_path = os.path.join(os.path.dirname(__file__),
'..', 'sut', 'login.py')
self._status = ''
def create_user(self, username, password):
self._run_command('create',... |
72e743b0ee40609ce2f469b44afe82d1574c498a | bin/explore.py | bin/explore.py | #!/usr/bin/env python3
import os, sys
sys.path.append(os.path.dirname(__file__))
import random, support
import matplotlib.pyplot as pp
support.figure()
app_count = support.count_apps()
user_count = support.count_users()
while True:
while True:
app = None
user = random.randrange(user_count)
... | Add a script for the exploration of app-user pairs | Add a script for the exploration of app-user pairs
| Python | mit | learning-on-chip/google-cluster-prediction | Add a script for the exploration of app-user pairs | #!/usr/bin/env python3
import os, sys
sys.path.append(os.path.dirname(__file__))
import random, support
import matplotlib.pyplot as pp
support.figure()
app_count = support.count_apps()
user_count = support.count_users()
while True:
while True:
app = None
user = random.randrange(user_count)
... | <commit_before><commit_msg>Add a script for the exploration of app-user pairs<commit_after> | #!/usr/bin/env python3
import os, sys
sys.path.append(os.path.dirname(__file__))
import random, support
import matplotlib.pyplot as pp
support.figure()
app_count = support.count_apps()
user_count = support.count_users()
while True:
while True:
app = None
user = random.randrange(user_count)
... | Add a script for the exploration of app-user pairs#!/usr/bin/env python3
import os, sys
sys.path.append(os.path.dirname(__file__))
import random, support
import matplotlib.pyplot as pp
support.figure()
app_count = support.count_apps()
user_count = support.count_users()
while True:
while True:
app = None
... | <commit_before><commit_msg>Add a script for the exploration of app-user pairs<commit_after>#!/usr/bin/env python3
import os, sys
sys.path.append(os.path.dirname(__file__))
import random, support
import matplotlib.pyplot as pp
support.figure()
app_count = support.count_apps()
user_count = support.count_users()
while ... | |
fb9a381f7a45e79b8c67f516c2e4d76c9a1d9553 | sts/util/rpc_forker.py | sts/util/rpc_forker.py |
from abc import *
import os
from SimpleXMLRPCServer import SimpleXMLRPCServer
import xmlrpclib
import sys
class Forker(object):
''' Easily fork a job and retrieve the results '''
__metaclass__ = ABCMeta
def __init__(self, ip='localhost', port=3370):
self.ip = ip
self.port = port
self.server = Simpl... | Add a forker class: spawn children and return results via XML-RPC | Add a forker class: spawn children and return results via XML-RPC
| Python | apache-2.0 | jmiserez/sts,ucb-sts/sts,ucb-sts/sts,jmiserez/sts | Add a forker class: spawn children and return results via XML-RPC |
from abc import *
import os
from SimpleXMLRPCServer import SimpleXMLRPCServer
import xmlrpclib
import sys
class Forker(object):
''' Easily fork a job and retrieve the results '''
__metaclass__ = ABCMeta
def __init__(self, ip='localhost', port=3370):
self.ip = ip
self.port = port
self.server = Simpl... | <commit_before><commit_msg>Add a forker class: spawn children and return results via XML-RPC<commit_after> |
from abc import *
import os
from SimpleXMLRPCServer import SimpleXMLRPCServer
import xmlrpclib
import sys
class Forker(object):
''' Easily fork a job and retrieve the results '''
__metaclass__ = ABCMeta
def __init__(self, ip='localhost', port=3370):
self.ip = ip
self.port = port
self.server = Simpl... | Add a forker class: spawn children and return results via XML-RPC
from abc import *
import os
from SimpleXMLRPCServer import SimpleXMLRPCServer
import xmlrpclib
import sys
class Forker(object):
''' Easily fork a job and retrieve the results '''
__metaclass__ = ABCMeta
def __init__(self, ip='localhost', port=337... | <commit_before><commit_msg>Add a forker class: spawn children and return results via XML-RPC<commit_after>
from abc import *
import os
from SimpleXMLRPCServer import SimpleXMLRPCServer
import xmlrpclib
import sys
class Forker(object):
''' Easily fork a job and retrieve the results '''
__metaclass__ = ABCMeta
de... | |
48acf7dd057d17611dcafa279721a99434e99885 | ou_noise.py | ou_noise.py | # --------------------------------------
# Reference: https://github.com/rllab/rllab/blob/master/rllab/exploration_strategies/ou_strategy.py
# --------------------------------------
import numpy as np
import numpy.random as nr
class OUNoise:
""" docstring for OUNoise """
def __init__(self,action_dimension,mu=... | Add OU Noise as given in ddpg paper | Add OU Noise as given in ddpg paper
| Python | mit | stevenpjg/ddpg-aigym | Add OU Noise as given in ddpg paper | # --------------------------------------
# Reference: https://github.com/rllab/rllab/blob/master/rllab/exploration_strategies/ou_strategy.py
# --------------------------------------
import numpy as np
import numpy.random as nr
class OUNoise:
""" docstring for OUNoise """
def __init__(self,action_dimension,mu=... | <commit_before><commit_msg>Add OU Noise as given in ddpg paper<commit_after> | # --------------------------------------
# Reference: https://github.com/rllab/rllab/blob/master/rllab/exploration_strategies/ou_strategy.py
# --------------------------------------
import numpy as np
import numpy.random as nr
class OUNoise:
""" docstring for OUNoise """
def __init__(self,action_dimension,mu=... | Add OU Noise as given in ddpg paper# --------------------------------------
# Reference: https://github.com/rllab/rllab/blob/master/rllab/exploration_strategies/ou_strategy.py
# --------------------------------------
import numpy as np
import numpy.random as nr
class OUNoise:
""" docstring for OUNoise """
def... | <commit_before><commit_msg>Add OU Noise as given in ddpg paper<commit_after># --------------------------------------
# Reference: https://github.com/rllab/rllab/blob/master/rllab/exploration_strategies/ou_strategy.py
# --------------------------------------
import numpy as np
import numpy.random as nr
class OUNoise:
... | |
3c5c28f598738be2457948aa8872196604496c73 | custom-scripts/long-term-formula.py | custom-scripts/long-term-formula.py | #! /usr/bin/python3
import argparse
def generate_rows(lower, upper):
assert (lower <= upper), "Lower limit can not be larger than upper"
for i in range(lower, upper):
print("=VLOOKUP(C{0},MFPortfolio!G52:MFPortfolio!H72,2,FALSE)".format(i))
def main():
parser = argparse.ArgumentParser(description='Process ... | Add script to generate sheets formula for personal usage | Add script to generate sheets formula for personal usage
| Python | mit | ayushgoel/dotfiles,ayushgoel/dotfiles,ayushgoel/dotfiles | Add script to generate sheets formula for personal usage | #! /usr/bin/python3
import argparse
def generate_rows(lower, upper):
assert (lower <= upper), "Lower limit can not be larger than upper"
for i in range(lower, upper):
print("=VLOOKUP(C{0},MFPortfolio!G52:MFPortfolio!H72,2,FALSE)".format(i))
def main():
parser = argparse.ArgumentParser(description='Process ... | <commit_before><commit_msg>Add script to generate sheets formula for personal usage<commit_after> | #! /usr/bin/python3
import argparse
def generate_rows(lower, upper):
assert (lower <= upper), "Lower limit can not be larger than upper"
for i in range(lower, upper):
print("=VLOOKUP(C{0},MFPortfolio!G52:MFPortfolio!H72,2,FALSE)".format(i))
def main():
parser = argparse.ArgumentParser(description='Process ... | Add script to generate sheets formula for personal usage#! /usr/bin/python3
import argparse
def generate_rows(lower, upper):
assert (lower <= upper), "Lower limit can not be larger than upper"
for i in range(lower, upper):
print("=VLOOKUP(C{0},MFPortfolio!G52:MFPortfolio!H72,2,FALSE)".format(i))
def main():
... | <commit_before><commit_msg>Add script to generate sheets formula for personal usage<commit_after>#! /usr/bin/python3
import argparse
def generate_rows(lower, upper):
assert (lower <= upper), "Lower limit can not be larger than upper"
for i in range(lower, upper):
print("=VLOOKUP(C{0},MFPortfolio!G52:MFPortfol... | |
7b2c418cbe6291afa4d339278d549dda162b382e | tests/test_version_parser.py | tests/test_version_parser.py | import pytest
from leak.version_parser import versions_split
def test_versions_split():
pass
def test_wrong_versions_split():
# too many dots
assert versions_split('1.2.3.4') == [0, 0, 0]
# test missing numeric version
with pytest.raises(ValueError):
versions_split('not.numeric')
... | Add some dummy test for negative cases when version splitting | Add some dummy test for negative cases when version splitting
| Python | mit | bmwant21/leak | Add some dummy test for negative cases when version splitting | import pytest
from leak.version_parser import versions_split
def test_versions_split():
pass
def test_wrong_versions_split():
# too many dots
assert versions_split('1.2.3.4') == [0, 0, 0]
# test missing numeric version
with pytest.raises(ValueError):
versions_split('not.numeric')
... | <commit_before><commit_msg>Add some dummy test for negative cases when version splitting<commit_after> | import pytest
from leak.version_parser import versions_split
def test_versions_split():
pass
def test_wrong_versions_split():
# too many dots
assert versions_split('1.2.3.4') == [0, 0, 0]
# test missing numeric version
with pytest.raises(ValueError):
versions_split('not.numeric')
... | Add some dummy test for negative cases when version splittingimport pytest
from leak.version_parser import versions_split
def test_versions_split():
pass
def test_wrong_versions_split():
# too many dots
assert versions_split('1.2.3.4') == [0, 0, 0]
# test missing numeric version
with pytest.ra... | <commit_before><commit_msg>Add some dummy test for negative cases when version splitting<commit_after>import pytest
from leak.version_parser import versions_split
def test_versions_split():
pass
def test_wrong_versions_split():
# too many dots
assert versions_split('1.2.3.4') == [0, 0, 0]
# test m... | |
48944ae9625cf36457b053508eff1e189c64f2c4 | libraries/verification.py | libraries/verification.py | from django.contrib.sites.models import Site
from django.core.mail import send_mail
from okupy.libraries.encryption import random_string
from okupy.libraries.exception import OkupyException, log_extra_data
import logging
logger = logging.getLogger('okupy')
def sendConfirmationEmail(request, form, model):
'''
... | from django.contrib.sites.models import Site
from django.core.mail import send_mail
from okupy.libraries.encryption import random_string
from okupy.libraries.exception import OkupyException, log_extra_data
import logging
logger = logging.getLogger('okupy')
def sendConfirmationEmail(request, form, model):
'''
... | Fix bug in checkConfirmationKey, call the model directly instead of eval(arg) | Fix bug in checkConfirmationKey, call the model directly instead of
eval(arg)
| Python | agpl-3.0 | gentoo/identity.gentoo.org,dastergon/identity.gentoo.org,dastergon/identity.gentoo.org,gentoo/identity.gentoo.org | from django.contrib.sites.models import Site
from django.core.mail import send_mail
from okupy.libraries.encryption import random_string
from okupy.libraries.exception import OkupyException, log_extra_data
import logging
logger = logging.getLogger('okupy')
def sendConfirmationEmail(request, form, model):
'''
... | from django.contrib.sites.models import Site
from django.core.mail import send_mail
from okupy.libraries.encryption import random_string
from okupy.libraries.exception import OkupyException, log_extra_data
import logging
logger = logging.getLogger('okupy')
def sendConfirmationEmail(request, form, model):
'''
... | <commit_before>from django.contrib.sites.models import Site
from django.core.mail import send_mail
from okupy.libraries.encryption import random_string
from okupy.libraries.exception import OkupyException, log_extra_data
import logging
logger = logging.getLogger('okupy')
def sendConfirmationEmail(request, form, model... | from django.contrib.sites.models import Site
from django.core.mail import send_mail
from okupy.libraries.encryption import random_string
from okupy.libraries.exception import OkupyException, log_extra_data
import logging
logger = logging.getLogger('okupy')
def sendConfirmationEmail(request, form, model):
'''
... | from django.contrib.sites.models import Site
from django.core.mail import send_mail
from okupy.libraries.encryption import random_string
from okupy.libraries.exception import OkupyException, log_extra_data
import logging
logger = logging.getLogger('okupy')
def sendConfirmationEmail(request, form, model):
'''
... | <commit_before>from django.contrib.sites.models import Site
from django.core.mail import send_mail
from okupy.libraries.encryption import random_string
from okupy.libraries.exception import OkupyException, log_extra_data
import logging
logger = logging.getLogger('okupy')
def sendConfirmationEmail(request, form, model... |
6a91b842626d531f7242994c91bb496f5b90d6c7 | web/ctf_gameserver/web/scoring/forms.py | web/ctf_gameserver/web/scoring/forms.py | from django import forms
from django.utils.translation import ugettext_lazy as _
from . import models
class GameControlAdminForm(forms.ModelForm):
"""
Form for the GameControl object, designed to be used in GameControlAdmin.
"""
class Meta:
model = models.GameControl
fields = '__all_... | Add missing file, which actually belongs to last commit | Add missing file, which actually belongs to last commit
| Python | isc | fausecteam/ctf-gameserver,fausecteam/ctf-gameserver,fausecteam/ctf-gameserver,fausecteam/ctf-gameserver,fausecteam/ctf-gameserver | Add missing file, which actually belongs to last commit | from django import forms
from django.utils.translation import ugettext_lazy as _
from . import models
class GameControlAdminForm(forms.ModelForm):
"""
Form for the GameControl object, designed to be used in GameControlAdmin.
"""
class Meta:
model = models.GameControl
fields = '__all_... | <commit_before><commit_msg>Add missing file, which actually belongs to last commit<commit_after> | from django import forms
from django.utils.translation import ugettext_lazy as _
from . import models
class GameControlAdminForm(forms.ModelForm):
"""
Form for the GameControl object, designed to be used in GameControlAdmin.
"""
class Meta:
model = models.GameControl
fields = '__all_... | Add missing file, which actually belongs to last commitfrom django import forms
from django.utils.translation import ugettext_lazy as _
from . import models
class GameControlAdminForm(forms.ModelForm):
"""
Form for the GameControl object, designed to be used in GameControlAdmin.
"""
class Meta:
... | <commit_before><commit_msg>Add missing file, which actually belongs to last commit<commit_after>from django import forms
from django.utils.translation import ugettext_lazy as _
from . import models
class GameControlAdminForm(forms.ModelForm):
"""
Form for the GameControl object, designed to be used in GameCo... | |
e2e609aec055a6e81a0ca7cb747809081ade81b1 | designate/backend/impl_powerdns/migrate_repo/versions/010_records_add_disabled_column.py | designate/backend/impl_powerdns/migrate_repo/versions/010_records_add_disabled_column.py | # Copyright 2015 NetEase, Inc.
#
# Author: Zhang Gengyuan <[email protected]>
#
# 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 re... | Fix powerdns db table records missing column disabled | Fix powerdns db table records missing column disabled
Fix powerdns db table 'records' missing column 'disabled', which makes powerdns
service unable to start.
Change-Id: I3b4c056ca68c44b7e42d20faba555471171b661f
Closes-Bug: 1409629
| Python | apache-2.0 | cneill/designate,ionrock/designate,kiall/designate-py3,ionrock/designate,muraliselva10/designate,openstack/designate,kiall/designate-py3,ramsateesh/designate,muraliselva10/designate,cneill/designate-testing,grahamhayes/designate,kiall/designate-py3,muraliselva10/designate,openstack/designate,cneill/designate-testing,cn... | Fix powerdns db table records missing column disabled
Fix powerdns db table 'records' missing column 'disabled', which makes powerdns
service unable to start.
Change-Id: I3b4c056ca68c44b7e42d20faba555471171b661f
Closes-Bug: 1409629 | # Copyright 2015 NetEase, Inc.
#
# Author: Zhang Gengyuan <[email protected]>
#
# 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 re... | <commit_before><commit_msg>Fix powerdns db table records missing column disabled
Fix powerdns db table 'records' missing column 'disabled', which makes powerdns
service unable to start.
Change-Id: I3b4c056ca68c44b7e42d20faba555471171b661f
Closes-Bug: 1409629<commit_after> | # Copyright 2015 NetEase, Inc.
#
# Author: Zhang Gengyuan <[email protected]>
#
# 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 re... | Fix powerdns db table records missing column disabled
Fix powerdns db table 'records' missing column 'disabled', which makes powerdns
service unable to start.
Change-Id: I3b4c056ca68c44b7e42d20faba555471171b661f
Closes-Bug: 1409629# Copyright 2015 NetEase, Inc.
#
# Author: Zhang Gengyuan <[email protected]>
#
# Licen... | <commit_before><commit_msg>Fix powerdns db table records missing column disabled
Fix powerdns db table 'records' missing column 'disabled', which makes powerdns
service unable to start.
Change-Id: I3b4c056ca68c44b7e42d20faba555471171b661f
Closes-Bug: 1409629<commit_after># Copyright 2015 NetEase, Inc.
#
# Author: Zha... | |
89597c9a277cb092e2a61450efad3d95574ec3b1 | scripts/password_confirmation_reminders.py | scripts/password_confirmation_reminders.py | '''
Send an email to users who haven't confirmed their passwords asking them to confirm.
'''
import logging
from community_share.models.user import User
from community_share.models.share import Event
from community_share.models.conversation import Conversation
from community_share import mail_actions, config, store
... | '''
Send an email to users who haven't confirmed their passwords asking them to confirm.
'''
import logging
from community_share.models.user import User
from community_share.models.share import Event
from community_share.models.conversation import Conversation
from community_share import mail_actions, config, store
... | Fix bug in email confirmation scripts. | Fix bug in email confirmation scripts.
| Python | mpl-2.0 | seanastephens/communityshare,seanastephens/communityshare,seanastephens/communityshare,communityshare/communityshare,communityshare/communityshare,seanastephens/communityshare,communityshare/communityshare,communityshare/communityshare | '''
Send an email to users who haven't confirmed their passwords asking them to confirm.
'''
import logging
from community_share.models.user import User
from community_share.models.share import Event
from community_share.models.conversation import Conversation
from community_share import mail_actions, config, store
... | '''
Send an email to users who haven't confirmed their passwords asking them to confirm.
'''
import logging
from community_share.models.user import User
from community_share.models.share import Event
from community_share.models.conversation import Conversation
from community_share import mail_actions, config, store
... | <commit_before>'''
Send an email to users who haven't confirmed their passwords asking them to confirm.
'''
import logging
from community_share.models.user import User
from community_share.models.share import Event
from community_share.models.conversation import Conversation
from community_share import mail_actions, ... | '''
Send an email to users who haven't confirmed their passwords asking them to confirm.
'''
import logging
from community_share.models.user import User
from community_share.models.share import Event
from community_share.models.conversation import Conversation
from community_share import mail_actions, config, store
... | '''
Send an email to users who haven't confirmed their passwords asking them to confirm.
'''
import logging
from community_share.models.user import User
from community_share.models.share import Event
from community_share.models.conversation import Conversation
from community_share import mail_actions, config, store
... | <commit_before>'''
Send an email to users who haven't confirmed their passwords asking them to confirm.
'''
import logging
from community_share.models.user import User
from community_share.models.share import Event
from community_share.models.conversation import Conversation
from community_share import mail_actions, ... |
32ceedf7be64bde3dfd5804e87d7337c566a28e5 | OIPA/api/activity/tests/test_filters.py | OIPA/api/activity/tests/test_filters.py | from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from iati.factory.iati_factory import ActivityFactory, OtherIdentifierFactory
class ActivityFiltersTestCase(APITestCase):
def setUp(self):
self.first_activity = ActivityFactory(
iati... | Add tests for new 'other_identifier' filter | Add tests for new 'other_identifier' filter
| Python | agpl-3.0 | openaid-IATI/OIPA,zimmerman-zimmerman/OIPA,openaid-IATI/OIPA,openaid-IATI/OIPA,zimmerman-zimmerman/OIPA,zimmerman-zimmerman/OIPA,openaid-IATI/OIPA,zimmerman-zimmerman/OIPA,zimmerman-zimmerman/OIPA,openaid-IATI/OIPA | Add tests for new 'other_identifier' filter | from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from iati.factory.iati_factory import ActivityFactory, OtherIdentifierFactory
class ActivityFiltersTestCase(APITestCase):
def setUp(self):
self.first_activity = ActivityFactory(
iati... | <commit_before><commit_msg>Add tests for new 'other_identifier' filter<commit_after> | from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from iati.factory.iati_factory import ActivityFactory, OtherIdentifierFactory
class ActivityFiltersTestCase(APITestCase):
def setUp(self):
self.first_activity = ActivityFactory(
iati... | Add tests for new 'other_identifier' filterfrom django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from iati.factory.iati_factory import ActivityFactory, OtherIdentifierFactory
class ActivityFiltersTestCase(APITestCase):
def setUp(self):
self.first_a... | <commit_before><commit_msg>Add tests for new 'other_identifier' filter<commit_after>from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from iati.factory.iati_factory import ActivityFactory, OtherIdentifierFactory
class ActivityFiltersTestCase(APITestCase):
... | |
e238b3b7ffea183f22d8171c8640e8a888fda791 | zinnia/tests/test_context.py | zinnia/tests/test_context.py | """Test cases for Zinnia Context"""
from django.test import TestCase
from django.template import Context
from django.core.paginator import Paginator
from zinnia.context import get_context_first_object
from zinnia.context import get_context_loop_position
class ContextTestCase(TestCase):
"""Tests cases for context... | Add unit tests for zinnia.context | Add unit tests for zinnia.context
| Python | bsd-3-clause | Fantomas42/django-blog-zinnia,ghachey/django-blog-zinnia,Fantomas42/django-blog-zinnia,Zopieux/django-blog-zinnia,ghachey/django-blog-zinnia,Fantomas42/django-blog-zinnia,ghachey/django-blog-zinnia,Zopieux/django-blog-zinnia,Zopieux/django-blog-zinnia | Add unit tests for zinnia.context | """Test cases for Zinnia Context"""
from django.test import TestCase
from django.template import Context
from django.core.paginator import Paginator
from zinnia.context import get_context_first_object
from zinnia.context import get_context_loop_position
class ContextTestCase(TestCase):
"""Tests cases for context... | <commit_before><commit_msg>Add unit tests for zinnia.context<commit_after> | """Test cases for Zinnia Context"""
from django.test import TestCase
from django.template import Context
from django.core.paginator import Paginator
from zinnia.context import get_context_first_object
from zinnia.context import get_context_loop_position
class ContextTestCase(TestCase):
"""Tests cases for context... | Add unit tests for zinnia.context"""Test cases for Zinnia Context"""
from django.test import TestCase
from django.template import Context
from django.core.paginator import Paginator
from zinnia.context import get_context_first_object
from zinnia.context import get_context_loop_position
class ContextTestCase(TestCase... | <commit_before><commit_msg>Add unit tests for zinnia.context<commit_after>"""Test cases for Zinnia Context"""
from django.test import TestCase
from django.template import Context
from django.core.paginator import Paginator
from zinnia.context import get_context_first_object
from zinnia.context import get_context_loop_... | |
fb4fc80c5e95308f363d96d02193300abbeb22c9 | hotline/db/db_mongo.py | hotline/db/db_mongo.py | import os
from pymongo import MongoClient
from urllib.parse import urlparse
mongo_url = os.environ.get('MONGODB_URL', 'mongodb://localhost:27017/')
# mongo_url_parse = urlparse(mongo_url)
mongo_client = MongoClient(mongo_url)
mongo_db = mongo_client['hotline']
| Define layer for Mongo client | Define layer for Mongo client
| Python | mit | wearhacks/hackathon_hotline | Define layer for Mongo client | import os
from pymongo import MongoClient
from urllib.parse import urlparse
mongo_url = os.environ.get('MONGODB_URL', 'mongodb://localhost:27017/')
# mongo_url_parse = urlparse(mongo_url)
mongo_client = MongoClient(mongo_url)
mongo_db = mongo_client['hotline']
| <commit_before><commit_msg>Define layer for Mongo client<commit_after> | import os
from pymongo import MongoClient
from urllib.parse import urlparse
mongo_url = os.environ.get('MONGODB_URL', 'mongodb://localhost:27017/')
# mongo_url_parse = urlparse(mongo_url)
mongo_client = MongoClient(mongo_url)
mongo_db = mongo_client['hotline']
| Define layer for Mongo clientimport os
from pymongo import MongoClient
from urllib.parse import urlparse
mongo_url = os.environ.get('MONGODB_URL', 'mongodb://localhost:27017/')
# mongo_url_parse = urlparse(mongo_url)
mongo_client = MongoClient(mongo_url)
mongo_db = mongo_client['hotline']
| <commit_before><commit_msg>Define layer for Mongo client<commit_after>import os
from pymongo import MongoClient
from urllib.parse import urlparse
mongo_url = os.environ.get('MONGODB_URL', 'mongodb://localhost:27017/')
# mongo_url_parse = urlparse(mongo_url)
mongo_client = MongoClient(mongo_url)
mongo_db = mongo_clie... | |
1c18e61ece7f05ac5b1afd276c72a6a242e9fb66 | braid/info.py | braid/info.py | from fabric.api import run, quiet
from braid import succeeds, cacheInEnvironment
@cacheInEnvironment
def distroName():
"""
Get the name of the distro.
"""
with quiet():
lsb = run('lsb_release --id --short', warn_only=True)
if lsb.succeeded:
return lsb.lower()
distro... | Add some tools for detecting the remote distribution. | Add some tools for detecting the remote distribution.
| Python | mit | alex/braid,alex/braid | Add some tools for detecting the remote distribution. | from fabric.api import run, quiet
from braid import succeeds, cacheInEnvironment
@cacheInEnvironment
def distroName():
"""
Get the name of the distro.
"""
with quiet():
lsb = run('lsb_release --id --short', warn_only=True)
if lsb.succeeded:
return lsb.lower()
distro... | <commit_before><commit_msg>Add some tools for detecting the remote distribution.<commit_after> | from fabric.api import run, quiet
from braid import succeeds, cacheInEnvironment
@cacheInEnvironment
def distroName():
"""
Get the name of the distro.
"""
with quiet():
lsb = run('lsb_release --id --short', warn_only=True)
if lsb.succeeded:
return lsb.lower()
distro... | Add some tools for detecting the remote distribution.from fabric.api import run, quiet
from braid import succeeds, cacheInEnvironment
@cacheInEnvironment
def distroName():
"""
Get the name of the distro.
"""
with quiet():
lsb = run('lsb_release --id --short', warn_only=True)
if lsb.succ... | <commit_before><commit_msg>Add some tools for detecting the remote distribution.<commit_after>from fabric.api import run, quiet
from braid import succeeds, cacheInEnvironment
@cacheInEnvironment
def distroName():
"""
Get the name of the distro.
"""
with quiet():
lsb = run('lsb_release --id --sh... | |
16ab1054d77d0f50762122cb747ba0d819f3ec2c | numba/cuda/tests/cudapy/test_lineinfo.py | numba/cuda/tests/cudapy/test_lineinfo.py | from numba.cuda.testing import skip_on_cudasim
from numba import cuda
from numba.core import types
from numba.cuda.testing import CUDATestCase
import re
import unittest
@skip_on_cudasim('Simulator does not produce lineinfo')
class TestCudaLineInfo(CUDATestCase):
"""
These tests only check the compiled PTX for... | Add tests for lineinfo in cuda.jit | Add tests for lineinfo in cuda.jit
| Python | bsd-2-clause | stonebig/numba,cpcloud/numba,stuartarchibald/numba,stuartarchibald/numba,numba/numba,cpcloud/numba,stonebig/numba,IntelLabs/numba,stonebig/numba,numba/numba,IntelLabs/numba,stonebig/numba,seibert/numba,IntelLabs/numba,numba/numba,stuartarchibald/numba,seibert/numba,cpcloud/numba,seibert/numba,cpcloud/numba,seibert/numb... | Add tests for lineinfo in cuda.jit | from numba.cuda.testing import skip_on_cudasim
from numba import cuda
from numba.core import types
from numba.cuda.testing import CUDATestCase
import re
import unittest
@skip_on_cudasim('Simulator does not produce lineinfo')
class TestCudaLineInfo(CUDATestCase):
"""
These tests only check the compiled PTX for... | <commit_before><commit_msg>Add tests for lineinfo in cuda.jit<commit_after> | from numba.cuda.testing import skip_on_cudasim
from numba import cuda
from numba.core import types
from numba.cuda.testing import CUDATestCase
import re
import unittest
@skip_on_cudasim('Simulator does not produce lineinfo')
class TestCudaLineInfo(CUDATestCase):
"""
These tests only check the compiled PTX for... | Add tests for lineinfo in cuda.jitfrom numba.cuda.testing import skip_on_cudasim
from numba import cuda
from numba.core import types
from numba.cuda.testing import CUDATestCase
import re
import unittest
@skip_on_cudasim('Simulator does not produce lineinfo')
class TestCudaLineInfo(CUDATestCase):
"""
These tes... | <commit_before><commit_msg>Add tests for lineinfo in cuda.jit<commit_after>from numba.cuda.testing import skip_on_cudasim
from numba import cuda
from numba.core import types
from numba.cuda.testing import CUDATestCase
import re
import unittest
@skip_on_cudasim('Simulator does not produce lineinfo')
class TestCudaLine... | |
acebd3a5e91788c95cbd22745620d6e05e8bf3a3 | zerver/migrations/0126_disallow_chars_in_stream_and_user_name.py | zerver/migrations/0126_disallow_chars_in_stream_and_user_name.py | # -*- coding: utf-8 -*-
from django.db import models, migrations
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
from typing import Text
def remove_special_chars_from_streamname(apps, schema_editor):
# type: (StateApps, DatabaseSchemaE... | Replace special chars in stream & user names with space. | migrations: Replace special chars in stream & user names with space.
Also handle potential duplicate stream names created.
Fixes #6534
| Python | apache-2.0 | punchagan/zulip,showell/zulip,shubhamdhama/zulip,jackrzhang/zulip,jackrzhang/zulip,rishig/zulip,brainwane/zulip,rishig/zulip,hackerkid/zulip,rht/zulip,zulip/zulip,tommyip/zulip,rishig/zulip,timabbott/zulip,showell/zulip,kou/zulip,rishig/zulip,brainwane/zulip,hackerkid/zulip,kou/zulip,jackrzhang/zulip,rishig/zulip,kou/z... | migrations: Replace special chars in stream & user names with space.
Also handle potential duplicate stream names created.
Fixes #6534 | # -*- coding: utf-8 -*-
from django.db import models, migrations
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
from typing import Text
def remove_special_chars_from_streamname(apps, schema_editor):
# type: (StateApps, DatabaseSchemaE... | <commit_before><commit_msg>migrations: Replace special chars in stream & user names with space.
Also handle potential duplicate stream names created.
Fixes #6534<commit_after> | # -*- coding: utf-8 -*-
from django.db import models, migrations
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
from typing import Text
def remove_special_chars_from_streamname(apps, schema_editor):
# type: (StateApps, DatabaseSchemaE... | migrations: Replace special chars in stream & user names with space.
Also handle potential duplicate stream names created.
Fixes #6534# -*- coding: utf-8 -*-
from django.db import models, migrations
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import St... | <commit_before><commit_msg>migrations: Replace special chars in stream & user names with space.
Also handle potential duplicate stream names created.
Fixes #6534<commit_after># -*- coding: utf-8 -*-
from django.db import models, migrations
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
... | |
abc46027b8af2d21debe8a23968b964ab6cb5c6b | CSP-Browser/CSPBrowser.py | CSP-Browser/CSPBrowser.py | #!/usr/bin/python
from pyvirtualdisplay import Display
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
import selenium.webdriver.support.ui as ui
import re
import atexit
disp = Display(visible=0, size=(800,600))
atexit.regist... | #!/usr/bin/python
from pyvirtualdisplay import Display
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
import selenium.webdriver.support.ui as ui
import re
import atexit
disp = Display(visible=0, size=(800,600))
atexit.regist... | Make Selenium shut down after it's done | Make Selenium shut down after it's done
| Python | mit | reedox/CSPTools,Kennysan/CSPTools | #!/usr/bin/python
from pyvirtualdisplay import Display
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
import selenium.webdriver.support.ui as ui
import re
import atexit
disp = Display(visible=0, size=(800,600))
atexit.regist... | #!/usr/bin/python
from pyvirtualdisplay import Display
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
import selenium.webdriver.support.ui as ui
import re
import atexit
disp = Display(visible=0, size=(800,600))
atexit.regist... | <commit_before>#!/usr/bin/python
from pyvirtualdisplay import Display
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
import selenium.webdriver.support.ui as ui
import re
import atexit
disp = Display(visible=0, size=(800,600)... | #!/usr/bin/python
from pyvirtualdisplay import Display
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
import selenium.webdriver.support.ui as ui
import re
import atexit
disp = Display(visible=0, size=(800,600))
atexit.regist... | #!/usr/bin/python
from pyvirtualdisplay import Display
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
import selenium.webdriver.support.ui as ui
import re
import atexit
disp = Display(visible=0, size=(800,600))
atexit.regist... | <commit_before>#!/usr/bin/python
from pyvirtualdisplay import Display
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
import selenium.webdriver.support.ui as ui
import re
import atexit
disp = Display(visible=0, size=(800,600)... |
e963ba18ec0b2d403a8a99d6374f42245a30e20d | spicedham/basewrapper.py | spicedham/basewrapper.py |
class BaseWrapper(object):
def set_up():
pass
def get_key(key, default=None):
raise NotImplementedError()
def get_key_list(keys, default=None):
return [ get_key(key, default) for key in keys ]
def set_key_list(key_value_tuples):
return [ set_key(key, value) for key, ... | Add a base class for the backends | Add a base class for the backends
| Python | mpl-2.0 | mozilla/spicedham,mozilla/spicedham | Add a base class for the backends |
class BaseWrapper(object):
def set_up():
pass
def get_key(key, default=None):
raise NotImplementedError()
def get_key_list(keys, default=None):
return [ get_key(key, default) for key in keys ]
def set_key_list(key_value_tuples):
return [ set_key(key, value) for key, ... | <commit_before><commit_msg>Add a base class for the backends<commit_after> |
class BaseWrapper(object):
def set_up():
pass
def get_key(key, default=None):
raise NotImplementedError()
def get_key_list(keys, default=None):
return [ get_key(key, default) for key in keys ]
def set_key_list(key_value_tuples):
return [ set_key(key, value) for key, ... | Add a base class for the backends
class BaseWrapper(object):
def set_up():
pass
def get_key(key, default=None):
raise NotImplementedError()
def get_key_list(keys, default=None):
return [ get_key(key, default) for key in keys ]
def set_key_list(key_value_tuples):
retur... | <commit_before><commit_msg>Add a base class for the backends<commit_after>
class BaseWrapper(object):
def set_up():
pass
def get_key(key, default=None):
raise NotImplementedError()
def get_key_list(keys, default=None):
return [ get_key(key, default) for key in keys ]
def set_... | |
13c490a10c8eb7b84583c2713843969bcdc035e1 | bluebottle/members/migrations/0029_merge_20190222_0930.py | bluebottle/members/migrations/0029_merge_20190222_0930.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-02-22 08:30
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('members', '0028_auto_20190219_1024'),
('members', '0028_merge_20190215_1441'),
]
o... | Make migrate file database members | Make migrate file database members
- Migrate field last_logout to member & field scim_external_id to member
| Python | bsd-3-clause | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | Make migrate file database members
- Migrate field last_logout to member & field scim_external_id to member | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-02-22 08:30
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('members', '0028_auto_20190219_1024'),
('members', '0028_merge_20190215_1441'),
]
o... | <commit_before><commit_msg>Make migrate file database members
- Migrate field last_logout to member & field scim_external_id to member<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-02-22 08:30
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('members', '0028_auto_20190219_1024'),
('members', '0028_merge_20190215_1441'),
]
o... | Make migrate file database members
- Migrate field last_logout to member & field scim_external_id to member# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-02-22 08:30
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
... | <commit_before><commit_msg>Make migrate file database members
- Migrate field last_logout to member & field scim_external_id to member<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-02-22 08:30
from __future__ import unicode_literals
from django.db import migrations
class Migration(migra... | |
f2c79668789dd2c9f7dcfe2bf12bb34d30516962 | bluebottle/projects/migrations/0084_auto_20181207_1435.py | bluebottle/projects/migrations/0084_auto_20181207_1435.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-12-07 13:35
from __future__ import unicode_literals
import bluebottle.utils.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0083_auto_20181129_1506'),
]
operations = [
... | Add migration that removes bank_account_reviewed flag on project | Add migration that removes bank_account_reviewed flag on project
| Python | bsd-3-clause | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | Add migration that removes bank_account_reviewed flag on project | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-12-07 13:35
from __future__ import unicode_literals
import bluebottle.utils.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0083_auto_20181129_1506'),
]
operations = [
... | <commit_before><commit_msg>Add migration that removes bank_account_reviewed flag on project<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-12-07 13:35
from __future__ import unicode_literals
import bluebottle.utils.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0083_auto_20181129_1506'),
]
operations = [
... | Add migration that removes bank_account_reviewed flag on project# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-12-07 13:35
from __future__ import unicode_literals
import bluebottle.utils.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('proje... | <commit_before><commit_msg>Add migration that removes bank_account_reviewed flag on project<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-12-07 13:35
from __future__ import unicode_literals
import bluebottle.utils.fields
from django.db import migrations
class Migration(migrations.Migratio... | |
8ebba2af62f7b917427fa1233ad81314f4e47102 | shade/tests/unit/test_operator_noauth.py | shade/tests/unit/test_operator_noauth.py | # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Add test of OperatorCloud auth_type=None | Add test of OperatorCloud auth_type=None
Ironic features a noauth mode which is intended for use in isolated
trusted environments. As this is not a normal use case for shade,
it is an increadibly important item to have a test for.
Change-Id: If86b9df238982d912105fb08dcd59c9c85b7de4a
| Python | apache-2.0 | stackforge/python-openstacksdk,dtroyer/python-openstacksdk,stackforge/python-openstacksdk,openstack-infra/shade,dtroyer/python-openstacksdk,openstack-infra/shade,openstack/python-openstacksdk,jsmartin/shade,jsmartin/shade,openstack/python-openstacksdk | Add test of OperatorCloud auth_type=None
Ironic features a noauth mode which is intended for use in isolated
trusted environments. As this is not a normal use case for shade,
it is an increadibly important item to have a test for.
Change-Id: If86b9df238982d912105fb08dcd59c9c85b7de4a | # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | <commit_before><commit_msg>Add test of OperatorCloud auth_type=None
Ironic features a noauth mode which is intended for use in isolated
trusted environments. As this is not a normal use case for shade,
it is an increadibly important item to have a test for.
Change-Id: If86b9df238982d912105fb08dcd59c9c85b7de4a<commit... | # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Add test of OperatorCloud auth_type=None
Ironic features a noauth mode which is intended for use in isolated
trusted environments. As this is not a normal use case for shade,
it is an increadibly important item to have a test for.
Change-Id: If86b9df238982d912105fb08dcd59c9c85b7de4a# Copyright (c) 2015 Hewlett-Packa... | <commit_before><commit_msg>Add test of OperatorCloud auth_type=None
Ironic features a noauth mode which is intended for use in isolated
trusted environments. As this is not a normal use case for shade,
it is an increadibly important item to have a test for.
Change-Id: If86b9df238982d912105fb08dcd59c9c85b7de4a<commit... | |
f7287bdf569374757880a70e4c2e3a69ed31295e | tests/test_cpan.py | tests/test_cpan.py | from tests.helper import ExternalVersionTestCase
class CPANTest(ExternalVersionTestCase):
def test_cpan(self):
self.assertEqual(self.sync_get_version("POE-Component-Server-HTTPServer", {"cpan": None}), "0.9.2")
| Add a testcase for CPAN | Add a testcase for CPAN
| Python | mit | lilydjwg/nvchecker | Add a testcase for CPAN | from tests.helper import ExternalVersionTestCase
class CPANTest(ExternalVersionTestCase):
def test_cpan(self):
self.assertEqual(self.sync_get_version("POE-Component-Server-HTTPServer", {"cpan": None}), "0.9.2")
| <commit_before><commit_msg>Add a testcase for CPAN<commit_after> | from tests.helper import ExternalVersionTestCase
class CPANTest(ExternalVersionTestCase):
def test_cpan(self):
self.assertEqual(self.sync_get_version("POE-Component-Server-HTTPServer", {"cpan": None}), "0.9.2")
| Add a testcase for CPANfrom tests.helper import ExternalVersionTestCase
class CPANTest(ExternalVersionTestCase):
def test_cpan(self):
self.assertEqual(self.sync_get_version("POE-Component-Server-HTTPServer", {"cpan": None}), "0.9.2")
| <commit_before><commit_msg>Add a testcase for CPAN<commit_after>from tests.helper import ExternalVersionTestCase
class CPANTest(ExternalVersionTestCase):
def test_cpan(self):
self.assertEqual(self.sync_get_version("POE-Component-Server-HTTPServer", {"cpan": None}), "0.9.2")
| |
a01d667946b65ca3ede55fa44a2c409cc129b737 | misc/show-cairo-subpixel-behavior.py | misc/show-cairo-subpixel-behavior.py | import cairo
# this shows that even though we are using integer values
# for set_source_surface, the subpixel translation is
# capturing pixel values from adjacent pixels of the source
src = cairo.ImageSurface(cairo.FORMAT_RGB24, 60, 40)
cr = cairo.Context(src)
#cr.set_source_rgb(1, 0, 0)
#cr.rectangle(0, 0, 20, 40)... | Add script to show what cairo is doing that is strange | Add script to show what cairo is doing that is strange
| Python | lgpl-2.1 | openslide/openslide,openslide/openslide,openslide/openslide,openslide/openslide | Add script to show what cairo is doing that is strange | import cairo
# this shows that even though we are using integer values
# for set_source_surface, the subpixel translation is
# capturing pixel values from adjacent pixels of the source
src = cairo.ImageSurface(cairo.FORMAT_RGB24, 60, 40)
cr = cairo.Context(src)
#cr.set_source_rgb(1, 0, 0)
#cr.rectangle(0, 0, 20, 40)... | <commit_before><commit_msg>Add script to show what cairo is doing that is strange<commit_after> | import cairo
# this shows that even though we are using integer values
# for set_source_surface, the subpixel translation is
# capturing pixel values from adjacent pixels of the source
src = cairo.ImageSurface(cairo.FORMAT_RGB24, 60, 40)
cr = cairo.Context(src)
#cr.set_source_rgb(1, 0, 0)
#cr.rectangle(0, 0, 20, 40)... | Add script to show what cairo is doing that is strangeimport cairo
# this shows that even though we are using integer values
# for set_source_surface, the subpixel translation is
# capturing pixel values from adjacent pixels of the source
src = cairo.ImageSurface(cairo.FORMAT_RGB24, 60, 40)
cr = cairo.Context(src)
#... | <commit_before><commit_msg>Add script to show what cairo is doing that is strange<commit_after>import cairo
# this shows that even though we are using integer values
# for set_source_surface, the subpixel translation is
# capturing pixel values from adjacent pixels of the source
src = cairo.ImageSurface(cairo.FORMAT_... | |
2e8728a0bfa6cac8f4a17c53ce762f82c4f60583 | cherrypy/test/test_package.py | cherrypy/test/test_package.py | from jaraco.packaging import depends
def test_dependencies_no_namespaces():
"""
Until #1673 lands, ensure dependencies do not employ
namespace packages.
"""
deps = depends.load_dependencies('cherrypy')
names = map(package_name, traverse(deps))
assert not any(name.startswith('jaraco.') for... | Add test module, omitted from prior commit. | Add test module, omitted from prior commit.
| Python | bsd-3-clause | cherrypy/cherrypy,Safihre/cherrypy,cherrypy/cherrypy,Safihre/cherrypy | Add test module, omitted from prior commit. | from jaraco.packaging import depends
def test_dependencies_no_namespaces():
"""
Until #1673 lands, ensure dependencies do not employ
namespace packages.
"""
deps = depends.load_dependencies('cherrypy')
names = map(package_name, traverse(deps))
assert not any(name.startswith('jaraco.') for... | <commit_before><commit_msg>Add test module, omitted from prior commit.<commit_after> | from jaraco.packaging import depends
def test_dependencies_no_namespaces():
"""
Until #1673 lands, ensure dependencies do not employ
namespace packages.
"""
deps = depends.load_dependencies('cherrypy')
names = map(package_name, traverse(deps))
assert not any(name.startswith('jaraco.') for... | Add test module, omitted from prior commit.from jaraco.packaging import depends
def test_dependencies_no_namespaces():
"""
Until #1673 lands, ensure dependencies do not employ
namespace packages.
"""
deps = depends.load_dependencies('cherrypy')
names = map(package_name, traverse(deps))
as... | <commit_before><commit_msg>Add test module, omitted from prior commit.<commit_after>from jaraco.packaging import depends
def test_dependencies_no_namespaces():
"""
Until #1673 lands, ensure dependencies do not employ
namespace packages.
"""
deps = depends.load_dependencies('cherrypy')
names =... | |
b282434e61cd1a185806b985953d1543a57bca8f | skan/_testdata.py | skan/_testdata.py | import numpy as np
tinycycle = np.array([[0, 1, 0],
[1, 0, 1],
[0, 1, 0]], dtype=bool)
skeleton1 = np.array([[0, 1, 1, 1, 1, 1, 0],
[1, 0, 0, 0, 0, 0, 1],
[0, 1, 1, 0, 1, 1, 0],
[1, 0, 0, 1, 0, 0, 0],
... | Add some tiny synthetic data for testing | Add some tiny synthetic data for testing
| Python | bsd-3-clause | jni/skan | Add some tiny synthetic data for testing | import numpy as np
tinycycle = np.array([[0, 1, 0],
[1, 0, 1],
[0, 1, 0]], dtype=bool)
skeleton1 = np.array([[0, 1, 1, 1, 1, 1, 0],
[1, 0, 0, 0, 0, 0, 1],
[0, 1, 1, 0, 1, 1, 0],
[1, 0, 0, 1, 0, 0, 0],
... | <commit_before><commit_msg>Add some tiny synthetic data for testing<commit_after> | import numpy as np
tinycycle = np.array([[0, 1, 0],
[1, 0, 1],
[0, 1, 0]], dtype=bool)
skeleton1 = np.array([[0, 1, 1, 1, 1, 1, 0],
[1, 0, 0, 0, 0, 0, 1],
[0, 1, 1, 0, 1, 1, 0],
[1, 0, 0, 1, 0, 0, 0],
... | Add some tiny synthetic data for testingimport numpy as np
tinycycle = np.array([[0, 1, 0],
[1, 0, 1],
[0, 1, 0]], dtype=bool)
skeleton1 = np.array([[0, 1, 1, 1, 1, 1, 0],
[1, 0, 0, 0, 0, 0, 1],
[0, 1, 1, 0, 1, 1, 0],
... | <commit_before><commit_msg>Add some tiny synthetic data for testing<commit_after>import numpy as np
tinycycle = np.array([[0, 1, 0],
[1, 0, 1],
[0, 1, 0]], dtype=bool)
skeleton1 = np.array([[0, 1, 1, 1, 1, 1, 0],
[1, 0, 0, 0, 0, 0, 1],
... | |
ef294ced9a9500344e02b046a2d4dd3b9621229d | tests/t_utils/test_filters.py | tests/t_utils/test_filters.py | # -*- coding: utf-8 -*-
"""
tests.t_utils.test_filters
~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2017 by The Stormrose Project team, see AUTHORS.
:license: MIT License, see LICENSE for details.
"""
import os
from unittest import TestCase
from xobox.utils import filters
class TestXoboxUtilsFi... | Add unit test for xobox.utils.filters.file | Add unit test for xobox.utils.filters.file
| Python | mit | stormrose-va/xobox | Add unit test for xobox.utils.filters.file | # -*- coding: utf-8 -*-
"""
tests.t_utils.test_filters
~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2017 by The Stormrose Project team, see AUTHORS.
:license: MIT License, see LICENSE for details.
"""
import os
from unittest import TestCase
from xobox.utils import filters
class TestXoboxUtilsFi... | <commit_before><commit_msg>Add unit test for xobox.utils.filters.file<commit_after> | # -*- coding: utf-8 -*-
"""
tests.t_utils.test_filters
~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2017 by The Stormrose Project team, see AUTHORS.
:license: MIT License, see LICENSE for details.
"""
import os
from unittest import TestCase
from xobox.utils import filters
class TestXoboxUtilsFi... | Add unit test for xobox.utils.filters.file# -*- coding: utf-8 -*-
"""
tests.t_utils.test_filters
~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2017 by The Stormrose Project team, see AUTHORS.
:license: MIT License, see LICENSE for details.
"""
import os
from unittest import TestCase
from xobox.uti... | <commit_before><commit_msg>Add unit test for xobox.utils.filters.file<commit_after># -*- coding: utf-8 -*-
"""
tests.t_utils.test_filters
~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2017 by The Stormrose Project team, see AUTHORS.
:license: MIT License, see LICENSE for details.
"""
import os
fro... | |
b2158dcd6aaae9c44503b509ddcb5187ea37bdba | api/production_pending.py | api/production_pending.py | from constants import *
import sys, time, datetime
from scraper import Scraper
from dateutil import tz
from execute_query import execute_query
try:
guild_ids = str(sys.argv[1]).split(',')
print '[INFO] [{0}] - Not using all guild IDs, but only the following: {1}'.format(datetime.datetime.utcnow().replace(tzin... | Add script to process pending changes separately from the regular refresh cycle | Add script to process pending changes separately from the regular refresh cycle
| Python | mit | Sheday/GuildAudit,Sheday/GuildAudit | Add script to process pending changes separately from the regular refresh cycle | from constants import *
import sys, time, datetime
from scraper import Scraper
from dateutil import tz
from execute_query import execute_query
try:
guild_ids = str(sys.argv[1]).split(',')
print '[INFO] [{0}] - Not using all guild IDs, but only the following: {1}'.format(datetime.datetime.utcnow().replace(tzin... | <commit_before><commit_msg>Add script to process pending changes separately from the regular refresh cycle<commit_after> | from constants import *
import sys, time, datetime
from scraper import Scraper
from dateutil import tz
from execute_query import execute_query
try:
guild_ids = str(sys.argv[1]).split(',')
print '[INFO] [{0}] - Not using all guild IDs, but only the following: {1}'.format(datetime.datetime.utcnow().replace(tzin... | Add script to process pending changes separately from the regular refresh cyclefrom constants import *
import sys, time, datetime
from scraper import Scraper
from dateutil import tz
from execute_query import execute_query
try:
guild_ids = str(sys.argv[1]).split(',')
print '[INFO] [{0}] - Not using all guild I... | <commit_before><commit_msg>Add script to process pending changes separately from the regular refresh cycle<commit_after>from constants import *
import sys, time, datetime
from scraper import Scraper
from dateutil import tz
from execute_query import execute_query
try:
guild_ids = str(sys.argv[1]).split(',')
pr... | |
173423ee7f43fb7a33db847e2ef3abb34317944e | tests/test_decorators.py | tests/test_decorators.py | from dtest import *
from dtest.util import *
@skip
def test_skip():
pass
@failing
def test_failing():
pass
@attr(attr1=1, attr2=2)
def test_attr():
pass
@depends(test_skip, test_failing, test_attr)
def test_depends():
pass
class DecoratorTestException(Exception):
pass
@raises(DecoratorTe... | Add tests to verify the proper functioning of decorators | Add tests to verify the proper functioning of decorators
| Python | apache-2.0 | klmitch/dtest,klmitch/dtest | Add tests to verify the proper functioning of decorators | from dtest import *
from dtest.util import *
@skip
def test_skip():
pass
@failing
def test_failing():
pass
@attr(attr1=1, attr2=2)
def test_attr():
pass
@depends(test_skip, test_failing, test_attr)
def test_depends():
pass
class DecoratorTestException(Exception):
pass
@raises(DecoratorTe... | <commit_before><commit_msg>Add tests to verify the proper functioning of decorators<commit_after> | from dtest import *
from dtest.util import *
@skip
def test_skip():
pass
@failing
def test_failing():
pass
@attr(attr1=1, attr2=2)
def test_attr():
pass
@depends(test_skip, test_failing, test_attr)
def test_depends():
pass
class DecoratorTestException(Exception):
pass
@raises(DecoratorTe... | Add tests to verify the proper functioning of decoratorsfrom dtest import *
from dtest.util import *
@skip
def test_skip():
pass
@failing
def test_failing():
pass
@attr(attr1=1, attr2=2)
def test_attr():
pass
@depends(test_skip, test_failing, test_attr)
def test_depends():
pass
class Decorator... | <commit_before><commit_msg>Add tests to verify the proper functioning of decorators<commit_after>from dtest import *
from dtest.util import *
@skip
def test_skip():
pass
@failing
def test_failing():
pass
@attr(attr1=1, attr2=2)
def test_attr():
pass
@depends(test_skip, test_failing, test_attr)
def t... | |
1cbd6aedeb3b7c3b867f0927450154f386de5664 | tests/test_playsongin.py | tests/test_playsongin.py | #!/usr/bin/env python
# coding=utf-8
from __future__ import print_function, unicode_literals
import os
import os.path
import nose.tools as nose
from tests.utils import run_filter
def test_query_ignore_case():
"""should ignore case when querying songs in an album"""
results = run_filter('playsongin', 'beat... | Add tests for playsongin filter | Add tests for playsongin filter
| Python | mit | caleb531/play-song,caleb531/play-song | Add tests for playsongin filter | #!/usr/bin/env python
# coding=utf-8
from __future__ import print_function, unicode_literals
import os
import os.path
import nose.tools as nose
from tests.utils import run_filter
def test_query_ignore_case():
"""should ignore case when querying songs in an album"""
results = run_filter('playsongin', 'beat... | <commit_before><commit_msg>Add tests for playsongin filter<commit_after> | #!/usr/bin/env python
# coding=utf-8
from __future__ import print_function, unicode_literals
import os
import os.path
import nose.tools as nose
from tests.utils import run_filter
def test_query_ignore_case():
"""should ignore case when querying songs in an album"""
results = run_filter('playsongin', 'beat... | Add tests for playsongin filter#!/usr/bin/env python
# coding=utf-8
from __future__ import print_function, unicode_literals
import os
import os.path
import nose.tools as nose
from tests.utils import run_filter
def test_query_ignore_case():
"""should ignore case when querying songs in an album"""
results =... | <commit_before><commit_msg>Add tests for playsongin filter<commit_after>#!/usr/bin/env python
# coding=utf-8
from __future__ import print_function, unicode_literals
import os
import os.path
import nose.tools as nose
from tests.utils import run_filter
def test_query_ignore_case():
"""should ignore case when qu... | |
af94b633f11cc7ea550dd52a165989370137a27d | paretoer.py | paretoer.py | #!/usr/bin/env python
import sys
import csv
import string
class CSVParetoer():
"""
This class represents an instance of paretoization. In short,
it operates on a CSV file and produces another file with a list
of tags to be applied to that file.
"""
def __init__(self, input_path, output_pat... | Add main file. Initial functionality, no error checking. | Add main file. Initial functionality, no error checking.
| Python | mit | sposterkil/pareto-project | Add main file. Initial functionality, no error checking. | #!/usr/bin/env python
import sys
import csv
import string
class CSVParetoer():
"""
This class represents an instance of paretoization. In short,
it operates on a CSV file and produces another file with a list
of tags to be applied to that file.
"""
def __init__(self, input_path, output_pat... | <commit_before><commit_msg>Add main file. Initial functionality, no error checking.<commit_after> | #!/usr/bin/env python
import sys
import csv
import string
class CSVParetoer():
"""
This class represents an instance of paretoization. In short,
it operates on a CSV file and produces another file with a list
of tags to be applied to that file.
"""
def __init__(self, input_path, output_pat... | Add main file. Initial functionality, no error checking.#!/usr/bin/env python
import sys
import csv
import string
class CSVParetoer():
"""
This class represents an instance of paretoization. In short,
it operates on a CSV file and produces another file with a list
of tags to be applied to that fil... | <commit_before><commit_msg>Add main file. Initial functionality, no error checking.<commit_after>#!/usr/bin/env python
import sys
import csv
import string
class CSVParetoer():
"""
This class represents an instance of paretoization. In short,
it operates on a CSV file and produces another file with a l... | |
bb467be1398e43becde8a3cb2494ba0c81ec40e1 | kpi/ona_db_routers.py | kpi/ona_db_routers.py | from __future__ import unicode_literals, absolute_import
from .constants import SHADOW_MODEL_APP_LABEL
class DefaultDatabaseRouter(object):
def db_for_read(self, model, **hints):
"""
Reads go to a randomly-chosen replica.
"""
return "default"
def db_for_write(self, mode... | Include ona database router file | Include ona database router file
| Python | agpl-3.0 | onaio/kpi,onaio/kpi,onaio/kpi,onaio/kpi | Include ona database router file | from __future__ import unicode_literals, absolute_import
from .constants import SHADOW_MODEL_APP_LABEL
class DefaultDatabaseRouter(object):
def db_for_read(self, model, **hints):
"""
Reads go to a randomly-chosen replica.
"""
return "default"
def db_for_write(self, mode... | <commit_before><commit_msg>Include ona database router file<commit_after> | from __future__ import unicode_literals, absolute_import
from .constants import SHADOW_MODEL_APP_LABEL
class DefaultDatabaseRouter(object):
def db_for_read(self, model, **hints):
"""
Reads go to a randomly-chosen replica.
"""
return "default"
def db_for_write(self, mode... | Include ona database router filefrom __future__ import unicode_literals, absolute_import
from .constants import SHADOW_MODEL_APP_LABEL
class DefaultDatabaseRouter(object):
def db_for_read(self, model, **hints):
"""
Reads go to a randomly-chosen replica.
"""
return "default"
... | <commit_before><commit_msg>Include ona database router file<commit_after>from __future__ import unicode_literals, absolute_import
from .constants import SHADOW_MODEL_APP_LABEL
class DefaultDatabaseRouter(object):
def db_for_read(self, model, **hints):
"""
Reads go to a randomly-chosen replic... | |
29e8cf3a1ecd3ce24a1d4473f7817da6df815c77 | salad/terrains/browser.py | salad/terrains/browser.py | from lettuce import before, world, after
from splinter.browser import Browser
from salad.logger import logger
@before.all
def setup_master_browser():
world.master_browser = setup_browser(world.drivers[0], world.remote_url)
world.browser = world.master_browser
def setup_browser(browser, url=None):
logger... | from lettuce import before, world, after
from splinter.browser import Browser
from salad.logger import logger
@before.all
def setup_master_browser():
try:
browser = world.drivers[0]
remote_url = world.remote_url
except AttributeError, IndexError:
browser = 'firefox'
remote_url ... | Make sure executing lettuce still results in something sane | Make sure executing lettuce still results in something sane
| Python | bsd-3-clause | salad/salad,adw0rd/salad-py3,beanqueen/salad,adw0rd/salad-py3,beanqueen/salad,salad/salad | from lettuce import before, world, after
from splinter.browser import Browser
from salad.logger import logger
@before.all
def setup_master_browser():
world.master_browser = setup_browser(world.drivers[0], world.remote_url)
world.browser = world.master_browser
def setup_browser(browser, url=None):
logger... | from lettuce import before, world, after
from splinter.browser import Browser
from salad.logger import logger
@before.all
def setup_master_browser():
try:
browser = world.drivers[0]
remote_url = world.remote_url
except AttributeError, IndexError:
browser = 'firefox'
remote_url ... | <commit_before>from lettuce import before, world, after
from splinter.browser import Browser
from salad.logger import logger
@before.all
def setup_master_browser():
world.master_browser = setup_browser(world.drivers[0], world.remote_url)
world.browser = world.master_browser
def setup_browser(browser, url=No... | from lettuce import before, world, after
from splinter.browser import Browser
from salad.logger import logger
@before.all
def setup_master_browser():
try:
browser = world.drivers[0]
remote_url = world.remote_url
except AttributeError, IndexError:
browser = 'firefox'
remote_url ... | from lettuce import before, world, after
from splinter.browser import Browser
from salad.logger import logger
@before.all
def setup_master_browser():
world.master_browser = setup_browser(world.drivers[0], world.remote_url)
world.browser = world.master_browser
def setup_browser(browser, url=None):
logger... | <commit_before>from lettuce import before, world, after
from splinter.browser import Browser
from salad.logger import logger
@before.all
def setup_master_browser():
world.master_browser = setup_browser(world.drivers[0], world.remote_url)
world.browser = world.master_browser
def setup_browser(browser, url=No... |
d8cd90bfea137f27c356bb34687e4b847d2019f4 | pylab/website/tests/test_comments.py | pylab/website/tests/test_comments.py | import datetime
from django.test import TestCase
from django.contrib.auth.models import User
from django_comments.models import Comment
from pylab.core.models import Project
class CommentsTests(TestCase):
def test_add_comment(self):
user = User.objects.create_user('user1')
project = Project.o... | Add test for project comments | Add test for project comments
| Python | agpl-3.0 | python-dirbtuves/website,python-dirbtuves/website,python-dirbtuves/website | Add test for project comments | import datetime
from django.test import TestCase
from django.contrib.auth.models import User
from django_comments.models import Comment
from pylab.core.models import Project
class CommentsTests(TestCase):
def test_add_comment(self):
user = User.objects.create_user('user1')
project = Project.o... | <commit_before><commit_msg>Add test for project comments<commit_after> | import datetime
from django.test import TestCase
from django.contrib.auth.models import User
from django_comments.models import Comment
from pylab.core.models import Project
class CommentsTests(TestCase):
def test_add_comment(self):
user = User.objects.create_user('user1')
project = Project.o... | Add test for project commentsimport datetime
from django.test import TestCase
from django.contrib.auth.models import User
from django_comments.models import Comment
from pylab.core.models import Project
class CommentsTests(TestCase):
def test_add_comment(self):
user = User.objects.create_user('user1'... | <commit_before><commit_msg>Add test for project comments<commit_after>import datetime
from django.test import TestCase
from django.contrib.auth.models import User
from django_comments.models import Comment
from pylab.core.models import Project
class CommentsTests(TestCase):
def test_add_comment(self):
... | |
e3838a3281184b4fe3428b55cb893ecfd213e845 | zmq_io/out_pifacedigitalio.py | zmq_io/out_pifacedigitalio.py | import argparse
import json
import pifacedigitalio as pfdio
import zmq
PINS = (
0b00000001,
0b00000010,
0b00000100,
0b00001000,
0b00010000,
0b00100000,
0b01000000,
0b10000000
)
def parse_args():
"""
Specify and parse command line arguments.
"""
p = argparse.ArgumentP... | Add outbound pifacedigitalio module which uses interrupt events instead of polling. | Add outbound pifacedigitalio module which uses interrupt events instead of polling.
| Python | unlicense | flyte/zmq-io-modules,flyte/zmq-io-modules | Add outbound pifacedigitalio module which uses interrupt events instead of polling. | import argparse
import json
import pifacedigitalio as pfdio
import zmq
PINS = (
0b00000001,
0b00000010,
0b00000100,
0b00001000,
0b00010000,
0b00100000,
0b01000000,
0b10000000
)
def parse_args():
"""
Specify and parse command line arguments.
"""
p = argparse.ArgumentP... | <commit_before><commit_msg>Add outbound pifacedigitalio module which uses interrupt events instead of polling.<commit_after> | import argparse
import json
import pifacedigitalio as pfdio
import zmq
PINS = (
0b00000001,
0b00000010,
0b00000100,
0b00001000,
0b00010000,
0b00100000,
0b01000000,
0b10000000
)
def parse_args():
"""
Specify and parse command line arguments.
"""
p = argparse.ArgumentP... | Add outbound pifacedigitalio module which uses interrupt events instead of polling.import argparse
import json
import pifacedigitalio as pfdio
import zmq
PINS = (
0b00000001,
0b00000010,
0b00000100,
0b00001000,
0b00010000,
0b00100000,
0b01000000,
0b10000000
)
def parse_args():
"... | <commit_before><commit_msg>Add outbound pifacedigitalio module which uses interrupt events instead of polling.<commit_after>import argparse
import json
import pifacedigitalio as pfdio
import zmq
PINS = (
0b00000001,
0b00000010,
0b00000100,
0b00001000,
0b00010000,
0b00100000,
0b01000000,
... | |
d2883e9c38d0b093c78b2145343b922fd2406cbb | samples/debugger_membp_singlestep.py | samples/debugger_membp_singlestep.py | import sys
import os.path
import pprint
sys.path.append(os.path.abspath(__file__ + "\..\.."))
import windows
import windows.test
import windows.debug
import windows.native_exec.simple_x86 as x86
from windows.generated_def.winstructs import *
class MyDebugger(windows.debug.Debugger):
def __init__(self, *args, *... | Add a sample on memoryBP + singlestep (cc Heurs :D) | Add a sample on memoryBP + singlestep (cc Heurs :D)
| Python | bsd-3-clause | hakril/PythonForWindows | Add a sample on memoryBP + singlestep (cc Heurs :D) | import sys
import os.path
import pprint
sys.path.append(os.path.abspath(__file__ + "\..\.."))
import windows
import windows.test
import windows.debug
import windows.native_exec.simple_x86 as x86
from windows.generated_def.winstructs import *
class MyDebugger(windows.debug.Debugger):
def __init__(self, *args, *... | <commit_before><commit_msg>Add a sample on memoryBP + singlestep (cc Heurs :D)<commit_after> | import sys
import os.path
import pprint
sys.path.append(os.path.abspath(__file__ + "\..\.."))
import windows
import windows.test
import windows.debug
import windows.native_exec.simple_x86 as x86
from windows.generated_def.winstructs import *
class MyDebugger(windows.debug.Debugger):
def __init__(self, *args, *... | Add a sample on memoryBP + singlestep (cc Heurs :D)import sys
import os.path
import pprint
sys.path.append(os.path.abspath(__file__ + "\..\.."))
import windows
import windows.test
import windows.debug
import windows.native_exec.simple_x86 as x86
from windows.generated_def.winstructs import *
class MyDebugger(windo... | <commit_before><commit_msg>Add a sample on memoryBP + singlestep (cc Heurs :D)<commit_after>import sys
import os.path
import pprint
sys.path.append(os.path.abspath(__file__ + "\..\.."))
import windows
import windows.test
import windows.debug
import windows.native_exec.simple_x86 as x86
from windows.generated_def.wins... | |
f08aa45603056c4fa8fca398a65d7bd751a7e4ed | src/Scripts/cachelines.py | src/Scripts/cachelines.py | # Takes a Document Frequency Table and caclulates the expected number of cache
# misses for each term.
#
# TODO: allow use of different TermTreatments.
# TODO: this assumes we subtract 1 from 'rows' because the DocumentActive row is counted as a row. Check that assumption!
from collections import defaultdict
import c... | Add script for cache miss estimation. | Add script for cache miss estimation.
| Python | mit | danluu/BitFunnel,BitFunnel/BitFunnel,BitFunnel/BitFunnel,danluu/BitFunnel,danluu/BitFunnel,BitFunnel/BitFunnel,BitFunnel/BitFunnel,danluu/BitFunnel,danluu/BitFunnel,danluu/BitFunnel,BitFunnel/BitFunnel,BitFunnel/BitFunnel | Add script for cache miss estimation. | # Takes a Document Frequency Table and caclulates the expected number of cache
# misses for each term.
#
# TODO: allow use of different TermTreatments.
# TODO: this assumes we subtract 1 from 'rows' because the DocumentActive row is counted as a row. Check that assumption!
from collections import defaultdict
import c... | <commit_before><commit_msg>Add script for cache miss estimation.<commit_after> | # Takes a Document Frequency Table and caclulates the expected number of cache
# misses for each term.
#
# TODO: allow use of different TermTreatments.
# TODO: this assumes we subtract 1 from 'rows' because the DocumentActive row is counted as a row. Check that assumption!
from collections import defaultdict
import c... | Add script for cache miss estimation.# Takes a Document Frequency Table and caclulates the expected number of cache
# misses for each term.
#
# TODO: allow use of different TermTreatments.
# TODO: this assumes we subtract 1 from 'rows' because the DocumentActive row is counted as a row. Check that assumption!
from co... | <commit_before><commit_msg>Add script for cache miss estimation.<commit_after># Takes a Document Frequency Table and caclulates the expected number of cache
# misses for each term.
#
# TODO: allow use of different TermTreatments.
# TODO: this assumes we subtract 1 from 'rows' because the DocumentActive row is counted ... | |
b20be113b5aa491025dd6f2b4ea0a6d0cd1c7343 | ynr/apps/parties/migrations/0011_add_initial_candidates_counts.py | ynr/apps/parties/migrations/0011_add_initial_candidates_counts.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-03-22 11:39
from __future__ import unicode_literals
from django.db import migrations
def populate_initial_candidate_counts(apps, schema_editor):
Party = apps.get_model("parties", "Party")
parties_qs = Party.objects.all()
for party in parties_q... | Add initial candidates counts in migration | Add initial candidates counts in migration
| Python | agpl-3.0 | DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative | Add initial candidates counts in migration | # -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-03-22 11:39
from __future__ import unicode_literals
from django.db import migrations
def populate_initial_candidate_counts(apps, schema_editor):
Party = apps.get_model("parties", "Party")
parties_qs = Party.objects.all()
for party in parties_q... | <commit_before><commit_msg>Add initial candidates counts in migration<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-03-22 11:39
from __future__ import unicode_literals
from django.db import migrations
def populate_initial_candidate_counts(apps, schema_editor):
Party = apps.get_model("parties", "Party")
parties_qs = Party.objects.all()
for party in parties_q... | Add initial candidates counts in migration# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-03-22 11:39
from __future__ import unicode_literals
from django.db import migrations
def populate_initial_candidate_counts(apps, schema_editor):
Party = apps.get_model("parties", "Party")
parties_qs = Part... | <commit_before><commit_msg>Add initial candidates counts in migration<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-03-22 11:39
from __future__ import unicode_literals
from django.db import migrations
def populate_initial_candidate_counts(apps, schema_editor):
Party = apps.get_model(... | |
277fd92e8f3a695af1af9ec795a3dd63e21566d9 | test/unittests/audio/test_vlc_backend.py | test/unittests/audio/test_vlc_backend.py | import unittest
import unittest.mock as mock
import mycroft.audio.services.vlc as vlc
config = {
'backends': {
'test_simple': {
'type': 'vlc',
'active': True
}
}
}
@mock.patch('mycroft.audio.services.vlc.vlc')
class TestVlcBackend(unittest.TestCase):
def test_loa... | Add tests for vlc audio backend | Add tests for vlc audio backend
| Python | apache-2.0 | forslund/mycroft-core,MycroftAI/mycroft-core,forslund/mycroft-core,MycroftAI/mycroft-core | Add tests for vlc audio backend | import unittest
import unittest.mock as mock
import mycroft.audio.services.vlc as vlc
config = {
'backends': {
'test_simple': {
'type': 'vlc',
'active': True
}
}
}
@mock.patch('mycroft.audio.services.vlc.vlc')
class TestVlcBackend(unittest.TestCase):
def test_loa... | <commit_before><commit_msg>Add tests for vlc audio backend<commit_after> | import unittest
import unittest.mock as mock
import mycroft.audio.services.vlc as vlc
config = {
'backends': {
'test_simple': {
'type': 'vlc',
'active': True
}
}
}
@mock.patch('mycroft.audio.services.vlc.vlc')
class TestVlcBackend(unittest.TestCase):
def test_loa... | Add tests for vlc audio backendimport unittest
import unittest.mock as mock
import mycroft.audio.services.vlc as vlc
config = {
'backends': {
'test_simple': {
'type': 'vlc',
'active': True
}
}
}
@mock.patch('mycroft.audio.services.vlc.vlc')
class TestVlcBackend(unitt... | <commit_before><commit_msg>Add tests for vlc audio backend<commit_after>import unittest
import unittest.mock as mock
import mycroft.audio.services.vlc as vlc
config = {
'backends': {
'test_simple': {
'type': 'vlc',
'active': True
}
}
}
@mock.patch('mycroft.audio.serv... | |
6a67e280fd690dccf4ff5c22460dd0d52b9ec88d | napper_kittydar.py | napper_kittydar.py | import sys, socket, time, logging
import shlex, subprocess
from hdfs import *
logging.basicConfig()
if len(sys.argv) < 4:
print "usage: napper_kittydar <job name> <worker ID> <executable>"
sys.exit(1)
job_name = sys.argv[1]
worker_id = int(sys.argv[2])
kittydar_path = " ".join(sys.argv[3:])
# fetch inputs from ... | Add simplified napper instance for kittydar. | Add simplified napper instance for kittydar.
| Python | mit | ms705/napper | Add simplified napper instance for kittydar. | import sys, socket, time, logging
import shlex, subprocess
from hdfs import *
logging.basicConfig()
if len(sys.argv) < 4:
print "usage: napper_kittydar <job name> <worker ID> <executable>"
sys.exit(1)
job_name = sys.argv[1]
worker_id = int(sys.argv[2])
kittydar_path = " ".join(sys.argv[3:])
# fetch inputs from ... | <commit_before><commit_msg>Add simplified napper instance for kittydar.<commit_after> | import sys, socket, time, logging
import shlex, subprocess
from hdfs import *
logging.basicConfig()
if len(sys.argv) < 4:
print "usage: napper_kittydar <job name> <worker ID> <executable>"
sys.exit(1)
job_name = sys.argv[1]
worker_id = int(sys.argv[2])
kittydar_path = " ".join(sys.argv[3:])
# fetch inputs from ... | Add simplified napper instance for kittydar.import sys, socket, time, logging
import shlex, subprocess
from hdfs import *
logging.basicConfig()
if len(sys.argv) < 4:
print "usage: napper_kittydar <job name> <worker ID> <executable>"
sys.exit(1)
job_name = sys.argv[1]
worker_id = int(sys.argv[2])
kittydar_path = ... | <commit_before><commit_msg>Add simplified napper instance for kittydar.<commit_after>import sys, socket, time, logging
import shlex, subprocess
from hdfs import *
logging.basicConfig()
if len(sys.argv) < 4:
print "usage: napper_kittydar <job name> <worker ID> <executable>"
sys.exit(1)
job_name = sys.argv[1]
work... | |
d78d944038dfa768a6aac5dc531d5220e6883a11 | tests/unit/models/reddit/test_modmail.py | tests/unit/models/reddit/test_modmail.py | from praw.models import ModmailConversation
from ... import UnitTest
class TestModmailConversation(UnitTest):
def test_parse(self):
conversation = ModmailConversation(self.reddit,
_data={'id': 'ik72'})
assert str(conversation) == 'ik72'
| Test that ModmailConversation.id is preserved after fetch | Test that ModmailConversation.id is preserved after fetch
| Python | bsd-2-clause | gschizas/praw,13steinj/praw,13steinj/praw,praw-dev/praw,gschizas/praw,darthkedrik/praw,praw-dev/praw,leviroth/praw,leviroth/praw,darthkedrik/praw | Test that ModmailConversation.id is preserved after fetch | from praw.models import ModmailConversation
from ... import UnitTest
class TestModmailConversation(UnitTest):
def test_parse(self):
conversation = ModmailConversation(self.reddit,
_data={'id': 'ik72'})
assert str(conversation) == 'ik72'
| <commit_before><commit_msg>Test that ModmailConversation.id is preserved after fetch<commit_after> | from praw.models import ModmailConversation
from ... import UnitTest
class TestModmailConversation(UnitTest):
def test_parse(self):
conversation = ModmailConversation(self.reddit,
_data={'id': 'ik72'})
assert str(conversation) == 'ik72'
| Test that ModmailConversation.id is preserved after fetchfrom praw.models import ModmailConversation
from ... import UnitTest
class TestModmailConversation(UnitTest):
def test_parse(self):
conversation = ModmailConversation(self.reddit,
_data={'id': 'ik72'})
... | <commit_before><commit_msg>Test that ModmailConversation.id is preserved after fetch<commit_after>from praw.models import ModmailConversation
from ... import UnitTest
class TestModmailConversation(UnitTest):
def test_parse(self):
conversation = ModmailConversation(self.reddit,
... | |
c15293b0b68ebee62b148ac8c8e1930d17cd27c7 | py/heaters.py | py/heaters.py | class Solution(object):
def findRadius(self, houses, heaters):
"""
:type houses: List[int]
:type heaters: List[int]
:rtype: int
"""
heaters.sort()
lh = len(heaters)
ans = 0
for h in houses:
L, U = -1, lh
while L + 1 < U:... | Add py solution for 475. Heaters | Add py solution for 475. Heaters
475. Heaters: https://leetcode.com/problems/heaters/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 475. Heaters
475. Heaters: https://leetcode.com/problems/heaters/ | class Solution(object):
def findRadius(self, houses, heaters):
"""
:type houses: List[int]
:type heaters: List[int]
:rtype: int
"""
heaters.sort()
lh = len(heaters)
ans = 0
for h in houses:
L, U = -1, lh
while L + 1 < U:... | <commit_before><commit_msg>Add py solution for 475. Heaters
475. Heaters: https://leetcode.com/problems/heaters/<commit_after> | class Solution(object):
def findRadius(self, houses, heaters):
"""
:type houses: List[int]
:type heaters: List[int]
:rtype: int
"""
heaters.sort()
lh = len(heaters)
ans = 0
for h in houses:
L, U = -1, lh
while L + 1 < U:... | Add py solution for 475. Heaters
475. Heaters: https://leetcode.com/problems/heaters/class Solution(object):
def findRadius(self, houses, heaters):
"""
:type houses: List[int]
:type heaters: List[int]
:rtype: int
"""
heaters.sort()
lh = len(heaters)
a... | <commit_before><commit_msg>Add py solution for 475. Heaters
475. Heaters: https://leetcode.com/problems/heaters/<commit_after>class Solution(object):
def findRadius(self, houses, heaters):
"""
:type houses: List[int]
:type heaters: List[int]
:rtype: int
"""
heaters.s... | |
38d17a3d7cf98d69b2366b50bc3994de2f505cca | core/migrations/0029_machinerequest_new_version_scripts.py | core/migrations/0029_machinerequest_new_version_scripts.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0028_add_version_license_and_scripts'),
]
operations = [
migrations.AddField(
model_name='machinerequest... | Add boot script and licensing support to API v1 | Add boot script and licensing support to API v1
| Python | apache-2.0 | CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend | Add boot script and licensing support to API v1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0028_add_version_license_and_scripts'),
]
operations = [
migrations.AddField(
model_name='machinerequest... | <commit_before><commit_msg>Add boot script and licensing support to API v1<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0028_add_version_license_and_scripts'),
]
operations = [
migrations.AddField(
model_name='machinerequest... | Add boot script and licensing support to API v1# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0028_add_version_license_and_scripts'),
]
operations = [
migrations.A... | <commit_before><commit_msg>Add boot script and licensing support to API v1<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0028_add_version_license_and_scripts'),
]... | |
34c179a2db3fa1b2419869b2f77f37de272d21d5 | voteswap/tests/test_sendgrid_backend.py | voteswap/tests/test_sendgrid_backend.py | from django.core.mail import EmailMultiAlternatives
from django.test import override_settings
from django.test import TestCase
from mock import patch
from mock import MagicMock
@override_settings(
EMAIL_BACKEND='voteswap.mail.backends.sendgrid.SendGridBackend')
class TestEmailBase(TestCase):
def setUp(self):
... | Test the sendgrid email backend | Test the sendgrid email backend
| Python | mit | sbuss/voteswap,sbuss/voteswap,sbuss/voteswap,sbuss/voteswap | Test the sendgrid email backend | from django.core.mail import EmailMultiAlternatives
from django.test import override_settings
from django.test import TestCase
from mock import patch
from mock import MagicMock
@override_settings(
EMAIL_BACKEND='voteswap.mail.backends.sendgrid.SendGridBackend')
class TestEmailBase(TestCase):
def setUp(self):
... | <commit_before><commit_msg>Test the sendgrid email backend<commit_after> | from django.core.mail import EmailMultiAlternatives
from django.test import override_settings
from django.test import TestCase
from mock import patch
from mock import MagicMock
@override_settings(
EMAIL_BACKEND='voteswap.mail.backends.sendgrid.SendGridBackend')
class TestEmailBase(TestCase):
def setUp(self):
... | Test the sendgrid email backendfrom django.core.mail import EmailMultiAlternatives
from django.test import override_settings
from django.test import TestCase
from mock import patch
from mock import MagicMock
@override_settings(
EMAIL_BACKEND='voteswap.mail.backends.sendgrid.SendGridBackend')
class TestEmailBase(T... | <commit_before><commit_msg>Test the sendgrid email backend<commit_after>from django.core.mail import EmailMultiAlternatives
from django.test import override_settings
from django.test import TestCase
from mock import patch
from mock import MagicMock
@override_settings(
EMAIL_BACKEND='voteswap.mail.backends.sendgri... | |
8803f6058255237dff39549426ca6a513a25193c | website_product_supplier/__openerp__.py | website_product_supplier/__openerp__.py | # -*- coding: utf-8 -*-
# (c) 2015 Antiun Ingeniería S.L. - Sergio Teruel
# (c) 2015 Antiun Ingeniería S.L. - Carlos Dauden
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': "Website Product Supplier",
'category': 'Website',
'version': '8.0.1.0.0',
'depends': [
'website... | # -*- coding: utf-8 -*-
# (c) 2015 Antiun Ingeniería S.L. - Sergio Teruel
# (c) 2015 Antiun Ingeniería S.L. - Carlos Dauden
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': "Website Product Supplier",
'category': 'Website',
'version': '8.0.1.0.0',
'depends': [
'website... | Add images key in manifest file | [FIX] website_product_supplier: Add images key in manifest file
| Python | agpl-3.0 | nuobit/website,open-synergy/website,gfcapalbo/website,LasLabs/website,acsone/website,nuobit/website,LasLabs/website,Yajo/website,LasLabs/website,gfcapalbo/website,kaerdsar/website,Yajo/website,nuobit/website,nuobit/website,Yajo/website,gfcapalbo/website,acsone/website,kaerdsar/website,LasLabs/website,open-synergy/websi... | # -*- coding: utf-8 -*-
# (c) 2015 Antiun Ingeniería S.L. - Sergio Teruel
# (c) 2015 Antiun Ingeniería S.L. - Carlos Dauden
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': "Website Product Supplier",
'category': 'Website',
'version': '8.0.1.0.0',
'depends': [
'website... | # -*- coding: utf-8 -*-
# (c) 2015 Antiun Ingeniería S.L. - Sergio Teruel
# (c) 2015 Antiun Ingeniería S.L. - Carlos Dauden
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': "Website Product Supplier",
'category': 'Website',
'version': '8.0.1.0.0',
'depends': [
'website... | <commit_before># -*- coding: utf-8 -*-
# (c) 2015 Antiun Ingeniería S.L. - Sergio Teruel
# (c) 2015 Antiun Ingeniería S.L. - Carlos Dauden
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': "Website Product Supplier",
'category': 'Website',
'version': '8.0.1.0.0',
'depends': [
... | # -*- coding: utf-8 -*-
# (c) 2015 Antiun Ingeniería S.L. - Sergio Teruel
# (c) 2015 Antiun Ingeniería S.L. - Carlos Dauden
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': "Website Product Supplier",
'category': 'Website',
'version': '8.0.1.0.0',
'depends': [
'website... | # -*- coding: utf-8 -*-
# (c) 2015 Antiun Ingeniería S.L. - Sergio Teruel
# (c) 2015 Antiun Ingeniería S.L. - Carlos Dauden
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': "Website Product Supplier",
'category': 'Website',
'version': '8.0.1.0.0',
'depends': [
'website... | <commit_before># -*- coding: utf-8 -*-
# (c) 2015 Antiun Ingeniería S.L. - Sergio Teruel
# (c) 2015 Antiun Ingeniería S.L. - Carlos Dauden
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': "Website Product Supplier",
'category': 'Website',
'version': '8.0.1.0.0',
'depends': [
... |
d758cab051d9f6b36daa39bb061cc17bbb3e53b9 | locations/spiders/jefferson_univ_hosp.py | locations/spiders/jefferson_univ_hosp.py | # -*- coding: utf-8 -*-
import json
import re
import scrapy
from locations.items import GeojsonPointItem
class jefferson_univ_hosp(scrapy.Spider):
name = "jefferson_univ_hosp"
allowed_domains = ['https://hospitals.jefferson.edu']
start_urls = [
'https://hospitals.jefferson.edu/find-a-location.ht... | Add spider for Thomas Jefferson University and Hospitals | Add spider for Thomas Jefferson University and Hospitals
| Python | mit | iandees/all-the-places,iandees/all-the-places,iandees/all-the-places | Add spider for Thomas Jefferson University and Hospitals | # -*- coding: utf-8 -*-
import json
import re
import scrapy
from locations.items import GeojsonPointItem
class jefferson_univ_hosp(scrapy.Spider):
name = "jefferson_univ_hosp"
allowed_domains = ['https://hospitals.jefferson.edu']
start_urls = [
'https://hospitals.jefferson.edu/find-a-location.ht... | <commit_before><commit_msg>Add spider for Thomas Jefferson University and Hospitals<commit_after> | # -*- coding: utf-8 -*-
import json
import re
import scrapy
from locations.items import GeojsonPointItem
class jefferson_univ_hosp(scrapy.Spider):
name = "jefferson_univ_hosp"
allowed_domains = ['https://hospitals.jefferson.edu']
start_urls = [
'https://hospitals.jefferson.edu/find-a-location.ht... | Add spider for Thomas Jefferson University and Hospitals# -*- coding: utf-8 -*-
import json
import re
import scrapy
from locations.items import GeojsonPointItem
class jefferson_univ_hosp(scrapy.Spider):
name = "jefferson_univ_hosp"
allowed_domains = ['https://hospitals.jefferson.edu']
start_urls = [
... | <commit_before><commit_msg>Add spider for Thomas Jefferson University and Hospitals<commit_after># -*- coding: utf-8 -*-
import json
import re
import scrapy
from locations.items import GeojsonPointItem
class jefferson_univ_hosp(scrapy.Spider):
name = "jefferson_univ_hosp"
allowed_domains = ['https://hospita... | |
d98f57c7be175df8103c7f29fac4e39057ff4891 | website/upload_local_replays.py | website/upload_local_replays.py | """ Pull replay from rocketleaguereplays and post turbo-carnival """
import StringIO
import os
import sys
import traceback
import requests
import boto3
# To setup your keys
# aws configure
DYNAMO = boto3.resource("dynamodb")
TABLE = DYNAMO.Table('turbo-carnival')
REPLAY_DIR = "C:\Users\Carlos\Documents\My Games\Rocke... | Add script to upload local replays | Add script to upload local replays
| Python | mit | mrcarlosrendon/turbo-carnival,mrcarlosrendon/turbo-carnival,mrcarlosrendon/turbo-carnival | Add script to upload local replays | """ Pull replay from rocketleaguereplays and post turbo-carnival """
import StringIO
import os
import sys
import traceback
import requests
import boto3
# To setup your keys
# aws configure
DYNAMO = boto3.resource("dynamodb")
TABLE = DYNAMO.Table('turbo-carnival')
REPLAY_DIR = "C:\Users\Carlos\Documents\My Games\Rocke... | <commit_before><commit_msg>Add script to upload local replays<commit_after> | """ Pull replay from rocketleaguereplays and post turbo-carnival """
import StringIO
import os
import sys
import traceback
import requests
import boto3
# To setup your keys
# aws configure
DYNAMO = boto3.resource("dynamodb")
TABLE = DYNAMO.Table('turbo-carnival')
REPLAY_DIR = "C:\Users\Carlos\Documents\My Games\Rocke... | Add script to upload local replays""" Pull replay from rocketleaguereplays and post turbo-carnival """
import StringIO
import os
import sys
import traceback
import requests
import boto3
# To setup your keys
# aws configure
DYNAMO = boto3.resource("dynamodb")
TABLE = DYNAMO.Table('turbo-carnival')
REPLAY_DIR = "C:\Use... | <commit_before><commit_msg>Add script to upload local replays<commit_after>""" Pull replay from rocketleaguereplays and post turbo-carnival """
import StringIO
import os
import sys
import traceback
import requests
import boto3
# To setup your keys
# aws configure
DYNAMO = boto3.resource("dynamodb")
TABLE = DYNAMO.Tabl... | |
bf0a8d5a13ecf7acbb646696a602a24898793294 | newsroom/management/commands/setsite.py | newsroom/management/commands/setsite.py | from django.core.management.base import BaseCommand, CommandError
from newsroom.models import Article
from django.contrib.sites.models import Site
def process(site_name, site_domain):
site = Site.objects.get_current()
site.name = site_name
site.domain = site_domain
site.save()
class Command(BaseComma... | Change site name and domain from command line. | Change site name and domain from command line.
| Python | bsd-3-clause | groundupnews/gu,groundupnews/gu,groundupnews/gu,groundupnews/gu,groundupnews/gu | Change site name and domain from command line. | from django.core.management.base import BaseCommand, CommandError
from newsroom.models import Article
from django.contrib.sites.models import Site
def process(site_name, site_domain):
site = Site.objects.get_current()
site.name = site_name
site.domain = site_domain
site.save()
class Command(BaseComma... | <commit_before><commit_msg>Change site name and domain from command line.<commit_after> | from django.core.management.base import BaseCommand, CommandError
from newsroom.models import Article
from django.contrib.sites.models import Site
def process(site_name, site_domain):
site = Site.objects.get_current()
site.name = site_name
site.domain = site_domain
site.save()
class Command(BaseComma... | Change site name and domain from command line.from django.core.management.base import BaseCommand, CommandError
from newsroom.models import Article
from django.contrib.sites.models import Site
def process(site_name, site_domain):
site = Site.objects.get_current()
site.name = site_name
site.domain = site_d... | <commit_before><commit_msg>Change site name and domain from command line.<commit_after>from django.core.management.base import BaseCommand, CommandError
from newsroom.models import Article
from django.contrib.sites.models import Site
def process(site_name, site_domain):
site = Site.objects.get_current()
site.... | |
b98f0570842a5c51a286b09df7e7d49ae708765e | tests/reader-revA-test.py | tests/reader-revA-test.py | """Tests for the revA circuit board of the 'reader'.
These tests will test the expected functionality of 'reader-revA'
(https://github.com/fmfi-svt-deadlock/reader-hw/releases/tag/revA).
They are intended to be run once on new boards before the FW is loaded
and the device is deployed
"""
import mempoke
from test_sequ... | Add tests for LED1 and LED2 | [reader-revA] Add tests for LED1 and LED2
| Python | mit | fmfi-svt-deadlock/hw-testing,fmfi-svt-deadlock/hw-testing | [reader-revA] Add tests for LED1 and LED2 | """Tests for the revA circuit board of the 'reader'.
These tests will test the expected functionality of 'reader-revA'
(https://github.com/fmfi-svt-deadlock/reader-hw/releases/tag/revA).
They are intended to be run once on new boards before the FW is loaded
and the device is deployed
"""
import mempoke
from test_sequ... | <commit_before><commit_msg>[reader-revA] Add tests for LED1 and LED2<commit_after> | """Tests for the revA circuit board of the 'reader'.
These tests will test the expected functionality of 'reader-revA'
(https://github.com/fmfi-svt-deadlock/reader-hw/releases/tag/revA).
They are intended to be run once on new boards before the FW is loaded
and the device is deployed
"""
import mempoke
from test_sequ... | [reader-revA] Add tests for LED1 and LED2"""Tests for the revA circuit board of the 'reader'.
These tests will test the expected functionality of 'reader-revA'
(https://github.com/fmfi-svt-deadlock/reader-hw/releases/tag/revA).
They are intended to be run once on new boards before the FW is loaded
and the device is de... | <commit_before><commit_msg>[reader-revA] Add tests for LED1 and LED2<commit_after>"""Tests for the revA circuit board of the 'reader'.
These tests will test the expected functionality of 'reader-revA'
(https://github.com/fmfi-svt-deadlock/reader-hw/releases/tag/revA).
They are intended to be run once on new boards bef... | |
c3efc9ba15fd1833474e2a59e4e266cfc6a4b9dc | awacs/kms.py | awacs/kms.py | from aws import Action, BaseARN
service_name = 'Amazon Key Management Service'
prefix = 'kms'
class ARN(BaseARN):
def __init__(self, resource, region='', account=''):
sup = super(ARN, self)
sup.__init__(service=prefix, resource=resource, region=region,
account=account)
Cance... | Add support for key management service | Add support for key management service
| Python | bsd-2-clause | cloudtools/awacs,craigbruce/awacs | Add support for key management service | from aws import Action, BaseARN
service_name = 'Amazon Key Management Service'
prefix = 'kms'
class ARN(BaseARN):
def __init__(self, resource, region='', account=''):
sup = super(ARN, self)
sup.__init__(service=prefix, resource=resource, region=region,
account=account)
Cance... | <commit_before><commit_msg>Add support for key management service<commit_after> | from aws import Action, BaseARN
service_name = 'Amazon Key Management Service'
prefix = 'kms'
class ARN(BaseARN):
def __init__(self, resource, region='', account=''):
sup = super(ARN, self)
sup.__init__(service=prefix, resource=resource, region=region,
account=account)
Cance... | Add support for key management servicefrom aws import Action, BaseARN
service_name = 'Amazon Key Management Service'
prefix = 'kms'
class ARN(BaseARN):
def __init__(self, resource, region='', account=''):
sup = super(ARN, self)
sup.__init__(service=prefix, resource=resource, region=region,
... | <commit_before><commit_msg>Add support for key management service<commit_after>from aws import Action, BaseARN
service_name = 'Amazon Key Management Service'
prefix = 'kms'
class ARN(BaseARN):
def __init__(self, resource, region='', account=''):
sup = super(ARN, self)
sup.__init__(service=prefix,... | |
356bba4061a6dbc70f086c59f1870e729733b062 | build/unix/pandoc-jira.py | build/unix/pandoc-jira.py | #!/usr/bin/env python
import json
from sys import stdin
from StringIO import StringIO
def gotObj(obj):
# Replace {"t":"Str","c":"[ROOT-7392]"}
if 't' in obj and obj['t'] == 'Str' \
and obj['c'][0:6] == '[ROOT-':
# with {"t":"Link","c":[[{"t":"Str","c":"ROOT-7290"}],["https://sft.its.cern.ch/jir... | Add pandoc filter to convert [ROOT-nnnn] into proper links. | Add pandoc filter to convert [ROOT-nnnn] into proper links.
(cherry picked from commit 5d48c8e572ee0bf6e9db759eb9089f0a921562b4)
| Python | lgpl-2.1 | simonpf/root,krafczyk/root,root-mirror/root,gganis/root,lgiommi/root,abhinavmoudgil95/root,root-mirror/root,jrtomps/root,lgiommi/root,thomaskeck/root,sawenzel/root,gbitzes/root,mhuwiler/rootauto,lgiommi/root,mkret2/root,lgiommi/root,georgtroska/root,georgtroska/root,mhuwiler/rootauto,BerserkerTroll/root,satyarth934/roo... | Add pandoc filter to convert [ROOT-nnnn] into proper links.
(cherry picked from commit 5d48c8e572ee0bf6e9db759eb9089f0a921562b4) | #!/usr/bin/env python
import json
from sys import stdin
from StringIO import StringIO
def gotObj(obj):
# Replace {"t":"Str","c":"[ROOT-7392]"}
if 't' in obj and obj['t'] == 'Str' \
and obj['c'][0:6] == '[ROOT-':
# with {"t":"Link","c":[[{"t":"Str","c":"ROOT-7290"}],["https://sft.its.cern.ch/jir... | <commit_before><commit_msg>Add pandoc filter to convert [ROOT-nnnn] into proper links.
(cherry picked from commit 5d48c8e572ee0bf6e9db759eb9089f0a921562b4)<commit_after> | #!/usr/bin/env python
import json
from sys import stdin
from StringIO import StringIO
def gotObj(obj):
# Replace {"t":"Str","c":"[ROOT-7392]"}
if 't' in obj and obj['t'] == 'Str' \
and obj['c'][0:6] == '[ROOT-':
# with {"t":"Link","c":[[{"t":"Str","c":"ROOT-7290"}],["https://sft.its.cern.ch/jir... | Add pandoc filter to convert [ROOT-nnnn] into proper links.
(cherry picked from commit 5d48c8e572ee0bf6e9db759eb9089f0a921562b4)#!/usr/bin/env python
import json
from sys import stdin
from StringIO import StringIO
def gotObj(obj):
# Replace {"t":"Str","c":"[ROOT-7392]"}
if 't' in obj and obj['t'] == 'Str' \
... | <commit_before><commit_msg>Add pandoc filter to convert [ROOT-nnnn] into proper links.
(cherry picked from commit 5d48c8e572ee0bf6e9db759eb9089f0a921562b4)<commit_after>#!/usr/bin/env python
import json
from sys import stdin
from StringIO import StringIO
def gotObj(obj):
# Replace {"t":"Str","c":"[ROOT-7392]"}
... | |
cf0174b72f6a7e4318b8e97f7a11fc93502c4a0f | command/sub8_alarm/nodes/alarm_handler.py | command/sub8_alarm/nodes/alarm_handler.py | #!/usr/bin/env python
import rospy
import json
from sub8_msgs.msg import Alarm
from std_msgs.msg import Header
from sub8_alarm import alarms
import string
class AlarmHandler(object):
def __init__(self):
'''Alarm Handler
Listen for alarms, call scenarios
TODO:
- Add alarm qu... | Add core alarm handling node | ALARMS: Add core alarm handling node
| Python | mit | pemami4911/Sub8,pemami4911/Sub8,pemami4911/Sub8 | ALARMS: Add core alarm handling node | #!/usr/bin/env python
import rospy
import json
from sub8_msgs.msg import Alarm
from std_msgs.msg import Header
from sub8_alarm import alarms
import string
class AlarmHandler(object):
def __init__(self):
'''Alarm Handler
Listen for alarms, call scenarios
TODO:
- Add alarm qu... | <commit_before><commit_msg>ALARMS: Add core alarm handling node<commit_after> | #!/usr/bin/env python
import rospy
import json
from sub8_msgs.msg import Alarm
from std_msgs.msg import Header
from sub8_alarm import alarms
import string
class AlarmHandler(object):
def __init__(self):
'''Alarm Handler
Listen for alarms, call scenarios
TODO:
- Add alarm qu... | ALARMS: Add core alarm handling node#!/usr/bin/env python
import rospy
import json
from sub8_msgs.msg import Alarm
from std_msgs.msg import Header
from sub8_alarm import alarms
import string
class AlarmHandler(object):
def __init__(self):
'''Alarm Handler
Listen for alarms, call scenarios
... | <commit_before><commit_msg>ALARMS: Add core alarm handling node<commit_after>#!/usr/bin/env python
import rospy
import json
from sub8_msgs.msg import Alarm
from std_msgs.msg import Header
from sub8_alarm import alarms
import string
class AlarmHandler(object):
def __init__(self):
'''Alarm Handler
... | |
a1e332d8deef67d0a854471cfbb5fd3a57658e49 | py/judge-route-circle.py | py/judge-route-circle.py | from collections import Counter
class Solution(object):
def judgeCircle(self, moves):
"""
:type moves: str
:rtype: bool
"""
c = Counter(moves)
return c['L'] == c['R'] and c['U'] == c['D']
| Add sql solution for 657. Judge Route Circle | Add sql solution for 657. Judge Route Circle
657. Judge Route Circle: https://leetcode.com/problems/judge-route-circle/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add sql solution for 657. Judge Route Circle
657. Judge Route Circle: https://leetcode.com/problems/judge-route-circle/ | from collections import Counter
class Solution(object):
def judgeCircle(self, moves):
"""
:type moves: str
:rtype: bool
"""
c = Counter(moves)
return c['L'] == c['R'] and c['U'] == c['D']
| <commit_before><commit_msg>Add sql solution for 657. Judge Route Circle
657. Judge Route Circle: https://leetcode.com/problems/judge-route-circle/<commit_after> | from collections import Counter
class Solution(object):
def judgeCircle(self, moves):
"""
:type moves: str
:rtype: bool
"""
c = Counter(moves)
return c['L'] == c['R'] and c['U'] == c['D']
| Add sql solution for 657. Judge Route Circle
657. Judge Route Circle: https://leetcode.com/problems/judge-route-circle/from collections import Counter
class Solution(object):
def judgeCircle(self, moves):
"""
:type moves: str
:rtype: bool
"""
c = Counter(moves)
retur... | <commit_before><commit_msg>Add sql solution for 657. Judge Route Circle
657. Judge Route Circle: https://leetcode.com/problems/judge-route-circle/<commit_after>from collections import Counter
class Solution(object):
def judgeCircle(self, moves):
"""
:type moves: str
:rtype: bool
"""... | |
8c087accfcc1e5692a608162a2f8e867e8a9b7df | tools/update-seahub-db_0.9.4_to_0.9.5.py | tools/update-seahub-db_0.9.4_to_0.9.5.py | #!/usr/bin/env python
# encoding: utf-8
import sqlite3
conn = sqlite3.connect('/home/xiez/seahub/seahub.db')
c = conn.cursor()
# Create index
c.execute('''CREATE INDEX IF NOT EXISTS "group_groupmessage_425ae3c4" ON "group_groupmessage" ("group_id")''')
c.execute('''CREATE UNIQUE INDEX IF NOT EXISTS "contacts_conta... | Add update script to tools | Add update script to tools
| Python | apache-2.0 | madflow/seahub,madflow/seahub,Chilledheart/seahub,madflow/seahub,Chilledheart/seahub,madflow/seahub,cloudcopy/seahub,cloudcopy/seahub,miurahr/seahub,Chilledheart/seahub,miurahr/seahub,miurahr/seahub,madflow/seahub,cloudcopy/seahub,Chilledheart/seahub,Chilledheart/seahub,miurahr/seahub,cloudcopy/seahub | Add update script to tools | #!/usr/bin/env python
# encoding: utf-8
import sqlite3
conn = sqlite3.connect('/home/xiez/seahub/seahub.db')
c = conn.cursor()
# Create index
c.execute('''CREATE INDEX IF NOT EXISTS "group_groupmessage_425ae3c4" ON "group_groupmessage" ("group_id")''')
c.execute('''CREATE UNIQUE INDEX IF NOT EXISTS "contacts_conta... | <commit_before><commit_msg>Add update script to tools<commit_after> | #!/usr/bin/env python
# encoding: utf-8
import sqlite3
conn = sqlite3.connect('/home/xiez/seahub/seahub.db')
c = conn.cursor()
# Create index
c.execute('''CREATE INDEX IF NOT EXISTS "group_groupmessage_425ae3c4" ON "group_groupmessage" ("group_id")''')
c.execute('''CREATE UNIQUE INDEX IF NOT EXISTS "contacts_conta... | Add update script to tools#!/usr/bin/env python
# encoding: utf-8
import sqlite3
conn = sqlite3.connect('/home/xiez/seahub/seahub.db')
c = conn.cursor()
# Create index
c.execute('''CREATE INDEX IF NOT EXISTS "group_groupmessage_425ae3c4" ON "group_groupmessage" ("group_id")''')
c.execute('''CREATE UNIQUE INDEX IF ... | <commit_before><commit_msg>Add update script to tools<commit_after>#!/usr/bin/env python
# encoding: utf-8
import sqlite3
conn = sqlite3.connect('/home/xiez/seahub/seahub.db')
c = conn.cursor()
# Create index
c.execute('''CREATE INDEX IF NOT EXISTS "group_groupmessage_425ae3c4" ON "group_groupmessage" ("group_id")'... | |
dcffaaf4bccee5930d7ec0cef6e81543bb4d851e | examples/chord_catalog.py | examples/chord_catalog.py | """
Play all the 3-note chords on one octave, after Tom Johnson's "Chord Catalog".
Example originally by Douglas Repetto
"""
import pretty_midi
import itertools
# Our starting note/octave is middle C
base_note = 60
# Time between each chord
chord_duration = .1
# Length of each note
note_duration = chord_duration*.9
... | Add MIDI file generation example | Add MIDI file generation example
| Python | mit | douglaseck/pretty-midi,craffel/pretty-midi,rafaelvalle/pretty-midi,tygeng/pretty-midi | Add MIDI file generation example | """
Play all the 3-note chords on one octave, after Tom Johnson's "Chord Catalog".
Example originally by Douglas Repetto
"""
import pretty_midi
import itertools
# Our starting note/octave is middle C
base_note = 60
# Time between each chord
chord_duration = .1
# Length of each note
note_duration = chord_duration*.9
... | <commit_before><commit_msg>Add MIDI file generation example<commit_after> | """
Play all the 3-note chords on one octave, after Tom Johnson's "Chord Catalog".
Example originally by Douglas Repetto
"""
import pretty_midi
import itertools
# Our starting note/octave is middle C
base_note = 60
# Time between each chord
chord_duration = .1
# Length of each note
note_duration = chord_duration*.9
... | Add MIDI file generation example"""
Play all the 3-note chords on one octave, after Tom Johnson's "Chord Catalog".
Example originally by Douglas Repetto
"""
import pretty_midi
import itertools
# Our starting note/octave is middle C
base_note = 60
# Time between each chord
chord_duration = .1
# Length of each note
no... | <commit_before><commit_msg>Add MIDI file generation example<commit_after>"""
Play all the 3-note chords on one octave, after Tom Johnson's "Chord Catalog".
Example originally by Douglas Repetto
"""
import pretty_midi
import itertools
# Our starting note/octave is middle C
base_note = 60
# Time between each chord
cho... | |
1e4a2b9c9898de4f8e98ac09179afdd7a47f8508 | demo_data.py | demo_data.py | from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from database_setup import Base, User, Business, Category, Account, Transaction, AccountUser
engine = create_engine('sqlite:///bam.db')
Base.metadata.bind = engine
Base.metadata.drop_all(engine) # Drop all existing tables
Base.metadata.crea... | Add file that was omitted from previous commit | Add file that was omitted from previous commit
| Python | unknown | gregcowell/BAM,gregcowell/PFT,gregcowell/PFT,gregcowell/BAM | Add file that was omitted from previous commit | from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from database_setup import Base, User, Business, Category, Account, Transaction, AccountUser
engine = create_engine('sqlite:///bam.db')
Base.metadata.bind = engine
Base.metadata.drop_all(engine) # Drop all existing tables
Base.metadata.crea... | <commit_before><commit_msg>Add file that was omitted from previous commit<commit_after> | from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from database_setup import Base, User, Business, Category, Account, Transaction, AccountUser
engine = create_engine('sqlite:///bam.db')
Base.metadata.bind = engine
Base.metadata.drop_all(engine) # Drop all existing tables
Base.metadata.crea... | Add file that was omitted from previous commitfrom sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from database_setup import Base, User, Business, Category, Account, Transaction, AccountUser
engine = create_engine('sqlite:///bam.db')
Base.metadata.bind = engine
Base.metadata.drop_all(engine)... | <commit_before><commit_msg>Add file that was omitted from previous commit<commit_after>from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from database_setup import Base, User, Business, Category, Account, Transaction, AccountUser
engine = create_engine('sqlite:///bam.db')
Base.metadata.bin... | |
e411edf21bc13518fb1dba8f394fb4d0ed7ed60d | scripts/monitor_yatsm.py | scripts/monitor_yatsm.py | #!/usr/bin/env python
""" Near real-time monitoring
Usage:
monitor_yatsm.py [options] <config_file> <job_number> <total_jobs>
Options:
--resume Do not overwrite pre-existing results
-v --verbose Show verbose debugging messages
--version Print program... | Add prototype CLI to monitoring script | Add prototype CLI to monitoring script
| Python | mit | valpasq/yatsm,valpasq/yatsm,c11/yatsm,jmorton/yatsm,c11/yatsm,jmorton/yatsm,ceholden/yatsm,jmorton/yatsm,ceholden/yatsm | Add prototype CLI to monitoring script | #!/usr/bin/env python
""" Near real-time monitoring
Usage:
monitor_yatsm.py [options] <config_file> <job_number> <total_jobs>
Options:
--resume Do not overwrite pre-existing results
-v --verbose Show verbose debugging messages
--version Print program... | <commit_before><commit_msg>Add prototype CLI to monitoring script<commit_after> | #!/usr/bin/env python
""" Near real-time monitoring
Usage:
monitor_yatsm.py [options] <config_file> <job_number> <total_jobs>
Options:
--resume Do not overwrite pre-existing results
-v --verbose Show verbose debugging messages
--version Print program... | Add prototype CLI to monitoring script#!/usr/bin/env python
""" Near real-time monitoring
Usage:
monitor_yatsm.py [options] <config_file> <job_number> <total_jobs>
Options:
--resume Do not overwrite pre-existing results
-v --verbose Show verbose debugging messages
--v... | <commit_before><commit_msg>Add prototype CLI to monitoring script<commit_after>#!/usr/bin/env python
""" Near real-time monitoring
Usage:
monitor_yatsm.py [options] <config_file> <job_number> <total_jobs>
Options:
--resume Do not overwrite pre-existing results
-v --verbose ... | |
6fcc2bff61aad25d9f2f1da93c1e1cc6390c19b7 | scripts/motion_sensor.py | scripts/motion_sensor.py | import time
import RPi.GPIO as GPIO
from blink2 import Blink
GPIO.setmode(GPIO.BCM)
pir_pin = 23
GPIO.setup(pir_pin, GPIO.IN) # activate input
i = 0
while True:
if GPIO.input(pir_pin):
i += 1
print("%i PIR ALARM!" % i)
Blink(27, 3, 0.3)
GPIO.setmode(GPIO.BCM)
GPI... | Add motion sensor python script. | Add motion sensor python script.
| Python | bsd-3-clause | kbsezginel/raspberry-pi,kbsezginel/raspberry-pi,kbsezginel/raspberry-pi,kbsezginel/raspberry-pi | Add motion sensor python script. | import time
import RPi.GPIO as GPIO
from blink2 import Blink
GPIO.setmode(GPIO.BCM)
pir_pin = 23
GPIO.setup(pir_pin, GPIO.IN) # activate input
i = 0
while True:
if GPIO.input(pir_pin):
i += 1
print("%i PIR ALARM!" % i)
Blink(27, 3, 0.3)
GPIO.setmode(GPIO.BCM)
GPI... | <commit_before><commit_msg>Add motion sensor python script.<commit_after> | import time
import RPi.GPIO as GPIO
from blink2 import Blink
GPIO.setmode(GPIO.BCM)
pir_pin = 23
GPIO.setup(pir_pin, GPIO.IN) # activate input
i = 0
while True:
if GPIO.input(pir_pin):
i += 1
print("%i PIR ALARM!" % i)
Blink(27, 3, 0.3)
GPIO.setmode(GPIO.BCM)
GPI... | Add motion sensor python script.import time
import RPi.GPIO as GPIO
from blink2 import Blink
GPIO.setmode(GPIO.BCM)
pir_pin = 23
GPIO.setup(pir_pin, GPIO.IN) # activate input
i = 0
while True:
if GPIO.input(pir_pin):
i += 1
print("%i PIR ALARM!" % i)
Blink(27, 3, 0.3)
GP... | <commit_before><commit_msg>Add motion sensor python script.<commit_after>import time
import RPi.GPIO as GPIO
from blink2 import Blink
GPIO.setmode(GPIO.BCM)
pir_pin = 23
GPIO.setup(pir_pin, GPIO.IN) # activate input
i = 0
while True:
if GPIO.input(pir_pin):
i += 1
print("%i PIR ALARM!" ... | |
9a27a0699127be1a6b2770e6ffcbfa22a2f72e32 | _tests/test_item.py | _tests/test_item.py | from unittest import TestCase
from classes.item import Item
class TestShoppingList(TestCase):
def setUp(self):
self.item = Item("name")
def tearDown(self):
self.item = None
def test_item_id_is_int(self):
self.assertIsInstance(self.item.id, int)
def test_item_name_is_str(self... | Create test-cases for class item | [TESTS] Create test-cases for class item
| Python | mit | EinsteinCarrey/Shoppinglist,EinsteinCarrey/Shoppinglist,EinsteinCarrey/Shoppinglist | [TESTS] Create test-cases for class item | from unittest import TestCase
from classes.item import Item
class TestShoppingList(TestCase):
def setUp(self):
self.item = Item("name")
def tearDown(self):
self.item = None
def test_item_id_is_int(self):
self.assertIsInstance(self.item.id, int)
def test_item_name_is_str(self... | <commit_before><commit_msg>[TESTS] Create test-cases for class item<commit_after> | from unittest import TestCase
from classes.item import Item
class TestShoppingList(TestCase):
def setUp(self):
self.item = Item("name")
def tearDown(self):
self.item = None
def test_item_id_is_int(self):
self.assertIsInstance(self.item.id, int)
def test_item_name_is_str(self... | [TESTS] Create test-cases for class itemfrom unittest import TestCase
from classes.item import Item
class TestShoppingList(TestCase):
def setUp(self):
self.item = Item("name")
def tearDown(self):
self.item = None
def test_item_id_is_int(self):
self.assertIsInstance(self.item.id, ... | <commit_before><commit_msg>[TESTS] Create test-cases for class item<commit_after>from unittest import TestCase
from classes.item import Item
class TestShoppingList(TestCase):
def setUp(self):
self.item = Item("name")
def tearDown(self):
self.item = None
def test_item_id_is_int(self):
... | |
92de07a7f959df2a4ad7d3dfcb1e9fb8af890fc9 | openedx/core/djangoapps/content/block_structure/migrations/0005_trim_leading_slashes_in_data_path.py | openedx/core/djangoapps/content/block_structure/migrations/0005_trim_leading_slashes_in_data_path.py | """
Data migration to convert absolute paths in block_structure.data to be relative.
This has only been tested with MySQL, though it should also work for Postgres as
well. This is necessary to manually correct absolute paths in the "data" field
of the block_structure table. For S3 storage, having a path that starts wi... | Convert block_structure.data to relative paths (TNL-8335) | fix: Convert block_structure.data to relative paths (TNL-8335)
In order to upgrade to Django > 2.2.20, we can't continue to use
absolute paths in the block_structure's data FileField. This used to
work for S3, but it will not work going forward due to a security fix
in Django 2.2.21.
This data migration will remove t... | Python | agpl-3.0 | edx/edx-platform,arbrandes/edx-platform,eduNEXT/edx-platform,eduNEXT/edx-platform,edx/edx-platform,angelapper/edx-platform,edx/edx-platform,eduNEXT/edx-platform,arbrandes/edx-platform,angelapper/edx-platform,angelapper/edx-platform,eduNEXT/edx-platform,arbrandes/edx-platform,edx/edx-platform,arbrandes/edx-platform,ange... | fix: Convert block_structure.data to relative paths (TNL-8335)
In order to upgrade to Django > 2.2.20, we can't continue to use
absolute paths in the block_structure's data FileField. This used to
work for S3, but it will not work going forward due to a security fix
in Django 2.2.21.
This data migration will remove t... | """
Data migration to convert absolute paths in block_structure.data to be relative.
This has only been tested with MySQL, though it should also work for Postgres as
well. This is necessary to manually correct absolute paths in the "data" field
of the block_structure table. For S3 storage, having a path that starts wi... | <commit_before><commit_msg>fix: Convert block_structure.data to relative paths (TNL-8335)
In order to upgrade to Django > 2.2.20, we can't continue to use
absolute paths in the block_structure's data FileField. This used to
work for S3, but it will not work going forward due to a security fix
in Django 2.2.21.
This d... | """
Data migration to convert absolute paths in block_structure.data to be relative.
This has only been tested with MySQL, though it should also work for Postgres as
well. This is necessary to manually correct absolute paths in the "data" field
of the block_structure table. For S3 storage, having a path that starts wi... | fix: Convert block_structure.data to relative paths (TNL-8335)
In order to upgrade to Django > 2.2.20, we can't continue to use
absolute paths in the block_structure's data FileField. This used to
work for S3, but it will not work going forward due to a security fix
in Django 2.2.21.
This data migration will remove t... | <commit_before><commit_msg>fix: Convert block_structure.data to relative paths (TNL-8335)
In order to upgrade to Django > 2.2.20, we can't continue to use
absolute paths in the block_structure's data FileField. This used to
work for S3, but it will not work going forward due to a security fix
in Django 2.2.21.
This d... | |
ed729218148a2700093bc17ffd7e0b10400b9443 | alembic/versions/f96f78987d58_added_self_referential_image_parent.py | alembic/versions/f96f78987d58_added_self_referential_image_parent.py | """Added self-referential image parent
Revision ID: f96f78987d58
Revises: 698cc06661d6
Create Date: 2016-03-20 19:21:05.651929
"""
# revision identifiers, used by Alembic.
revision = 'f96f78987d58'
down_revision = '698cc06661d6'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
... | Add DB migration for self referential images | Add DB migration for self referential images
| Python | mit | matslindh/kimochi,matslindh/kimochi | Add DB migration for self referential images | """Added self-referential image parent
Revision ID: f96f78987d58
Revises: 698cc06661d6
Create Date: 2016-03-20 19:21:05.651929
"""
# revision identifiers, used by Alembic.
revision = 'f96f78987d58'
down_revision = '698cc06661d6'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
... | <commit_before><commit_msg>Add DB migration for self referential images<commit_after> | """Added self-referential image parent
Revision ID: f96f78987d58
Revises: 698cc06661d6
Create Date: 2016-03-20 19:21:05.651929
"""
# revision identifiers, used by Alembic.
revision = 'f96f78987d58'
down_revision = '698cc06661d6'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
... | Add DB migration for self referential images"""Added self-referential image parent
Revision ID: f96f78987d58
Revises: 698cc06661d6
Create Date: 2016-03-20 19:21:05.651929
"""
# revision identifiers, used by Alembic.
revision = 'f96f78987d58'
down_revision = '698cc06661d6'
branch_labels = None
depends_on = None
from... | <commit_before><commit_msg>Add DB migration for self referential images<commit_after>"""Added self-referential image parent
Revision ID: f96f78987d58
Revises: 698cc06661d6
Create Date: 2016-03-20 19:21:05.651929
"""
# revision identifiers, used by Alembic.
revision = 'f96f78987d58'
down_revision = '698cc06661d6'
bra... | |
b0ad67e88481b7656e56f6d1af9449eb43e43337 | lowfat/management/commands/fixstatus.py | lowfat/management/commands/fixstatus.py | import datetime
from django.core.management.base import BaseCommand
from lowfat.models import Fund, Expense
class Command(BaseCommand):
help = "Fix the status on the database."
def handle(self, *args, **options):
# Blog posts
# Nothing to change
# Expense status
# Nothing to... | Add script to archive some funding requests | Add script to archive some funding requests
| Python | bsd-3-clause | softwaresaved/fat,softwaresaved/fat,softwaresaved/fat,softwaresaved/fat | Add script to archive some funding requests | import datetime
from django.core.management.base import BaseCommand
from lowfat.models import Fund, Expense
class Command(BaseCommand):
help = "Fix the status on the database."
def handle(self, *args, **options):
# Blog posts
# Nothing to change
# Expense status
# Nothing to... | <commit_before><commit_msg>Add script to archive some funding requests<commit_after> | import datetime
from django.core.management.base import BaseCommand
from lowfat.models import Fund, Expense
class Command(BaseCommand):
help = "Fix the status on the database."
def handle(self, *args, **options):
# Blog posts
# Nothing to change
# Expense status
# Nothing to... | Add script to archive some funding requestsimport datetime
from django.core.management.base import BaseCommand
from lowfat.models import Fund, Expense
class Command(BaseCommand):
help = "Fix the status on the database."
def handle(self, *args, **options):
# Blog posts
# Nothing to change
... | <commit_before><commit_msg>Add script to archive some funding requests<commit_after>import datetime
from django.core.management.base import BaseCommand
from lowfat.models import Fund, Expense
class Command(BaseCommand):
help = "Fix the status on the database."
def handle(self, *args, **options):
# B... | |
7d31792ad48cccf1e893cc2f5a1552d562030771 | symposion/schedule/migrations/0004_remove_session_and_sessionrole.py | symposion/schedule/migrations/0004_remove_session_and_sessionrole.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-10-05 17:38
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('symposion_schedule', '0003_make_sessionrole_submitted_timezone_aware'),
]
operations = [
... | Add migrations to remove Session and SessionRole. | Add migrations to remove Session and SessionRole.
See 7873a7959f27bbd39fde74f7912d24390d1f58a0.
| Python | mit | pydata/conf_site,pydata/conf_site,pydata/conf_site | Add migrations to remove Session and SessionRole.
See 7873a7959f27bbd39fde74f7912d24390d1f58a0. | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-10-05 17:38
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('symposion_schedule', '0003_make_sessionrole_submitted_timezone_aware'),
]
operations = [
... | <commit_before><commit_msg>Add migrations to remove Session and SessionRole.
See 7873a7959f27bbd39fde74f7912d24390d1f58a0.<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-10-05 17:38
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('symposion_schedule', '0003_make_sessionrole_submitted_timezone_aware'),
]
operations = [
... | Add migrations to remove Session and SessionRole.
See 7873a7959f27bbd39fde74f7912d24390d1f58a0.# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-10-05 17:38
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('sym... | <commit_before><commit_msg>Add migrations to remove Session and SessionRole.
See 7873a7959f27bbd39fde74f7912d24390d1f58a0.<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-10-05 17:38
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migrat... | |
5ba528773ca7b7bce61e983cfa2d9f028367805c | fat/migrations/0081_auto_20161010_1616.py | fat/migrations/0081_auto_20161010_1616.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-10-10 16:16
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fat', '0080_auto_20160831_0732'),
]
operations = [
migrations.AddField(
... | Add migration for Software Carpentry and Data Carpentry | Add migration for Software Carpentry and Data Carpentry
| Python | bsd-3-clause | softwaresaved/fat,softwaresaved/fat,softwaresaved/fat,softwaresaved/fat | Add migration for Software Carpentry and Data Carpentry | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-10-10 16:16
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fat', '0080_auto_20160831_0732'),
]
operations = [
migrations.AddField(
... | <commit_before><commit_msg>Add migration for Software Carpentry and Data Carpentry<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-10-10 16:16
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fat', '0080_auto_20160831_0732'),
]
operations = [
migrations.AddField(
... | Add migration for Software Carpentry and Data Carpentry# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-10-10 16:16
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fat', '0080_auto_20160831_0732'),
]... | <commit_before><commit_msg>Add migration for Software Carpentry and Data Carpentry<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-10-10 16:16
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
... | |
36aa92b1c4a6c00cd50ed303565107b0213f09c2 | enthought/chaco/tests/border_test_case.py | enthought/chaco/tests/border_test_case.py | """ Needed Tests
Component.draw_border() tests
--------------------
DONE *. draw_border output should match a similar draw_rect output
"""
import nose
import unittest
from numpy import array, alltrue, ravel
# Chaco imports
from enthought.chaco.api import Plot, PlotGraphicsCon... | Add a test case for component borders | Add a test case for component borders
| Python | bsd-3-clause | tommy-u/chaco,ContinuumIO/chaco,tommy-u/chaco,burnpanck/chaco,ContinuumIO/chaco,ContinuumIO/chaco,tommy-u/chaco,burnpanck/chaco,ContinuumIO/chaco,burnpanck/chaco | Add a test case for component borders | """ Needed Tests
Component.draw_border() tests
--------------------
DONE *. draw_border output should match a similar draw_rect output
"""
import nose
import unittest
from numpy import array, alltrue, ravel
# Chaco imports
from enthought.chaco.api import Plot, PlotGraphicsCon... | <commit_before><commit_msg>Add a test case for component borders<commit_after> | """ Needed Tests
Component.draw_border() tests
--------------------
DONE *. draw_border output should match a similar draw_rect output
"""
import nose
import unittest
from numpy import array, alltrue, ravel
# Chaco imports
from enthought.chaco.api import Plot, PlotGraphicsCon... | Add a test case for component borders""" Needed Tests
Component.draw_border() tests
--------------------
DONE *. draw_border output should match a similar draw_rect output
"""
import nose
import unittest
from numpy import array, alltrue, ravel
# Chaco imports
from enthought.c... | <commit_before><commit_msg>Add a test case for component borders<commit_after>""" Needed Tests
Component.draw_border() tests
--------------------
DONE *. draw_border output should match a similar draw_rect output
"""
import nose
import unittest
from numpy import array, alltrue... | |
edb2aaa60d56526a8f48ed40b04a8c903203bc64 | web/utils/views.py | web/utils/views.py | import StringIO
import zipfile
from django.http import HttpResponse
def plain_text(name, contents, content_type='text/plain'):
"""
Downloads a plain text file with the given name and contents.
"""
response = HttpResponse(content_type='{0}; charset=utf-8'.format(content_type))
response['Content-Dis... | Add helper functions for downloading files | Add helper functions for downloading files | Python | agpl-3.0 | matijapretnar/projekt-tomo,matijapretnar/projekt-tomo,matijapretnar/projekt-tomo,matijapretnar/projekt-tomo,ul-fmf/projekt-tomo,ul-fmf/projekt-tomo,ul-fmf/projekt-tomo,ul-fmf/projekt-tomo,ul-fmf/projekt-tomo,matijapretnar/projekt-tomo,ul-fmf/projekt-tomo | Add helper functions for downloading files | import StringIO
import zipfile
from django.http import HttpResponse
def plain_text(name, contents, content_type='text/plain'):
"""
Downloads a plain text file with the given name and contents.
"""
response = HttpResponse(content_type='{0}; charset=utf-8'.format(content_type))
response['Content-Dis... | <commit_before><commit_msg>Add helper functions for downloading files<commit_after> | import StringIO
import zipfile
from django.http import HttpResponse
def plain_text(name, contents, content_type='text/plain'):
"""
Downloads a plain text file with the given name and contents.
"""
response = HttpResponse(content_type='{0}; charset=utf-8'.format(content_type))
response['Content-Dis... | Add helper functions for downloading filesimport StringIO
import zipfile
from django.http import HttpResponse
def plain_text(name, contents, content_type='text/plain'):
"""
Downloads a plain text file with the given name and contents.
"""
response = HttpResponse(content_type='{0}; charset=utf-8'.forma... | <commit_before><commit_msg>Add helper functions for downloading files<commit_after>import StringIO
import zipfile
from django.http import HttpResponse
def plain_text(name, contents, content_type='text/plain'):
"""
Downloads a plain text file with the given name and contents.
"""
response = HttpRespons... | |
7726ac8471730cdcb426ef002c7b2046cdffd602 | sippy/IVoiSysAuthorisation.py | sippy/IVoiSysAuthorisation.py | # Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved.
# Copyright (c) 2006-2007 Sippy Software, Inc. All rights reserved.
#
# This file is part of SIPPY, a free RFC3261 SIP stack and B2BUA.
#
# SIPPY is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | Add class specific for IVoiSys to do DB auth. | Add class specific for IVoiSys to do DB auth.
| Python | bsd-2-clause | AVOXI/b2bua,sippy/b2bua,sippy/b2bua,AVOXI/b2bua | Add class specific for IVoiSys to do DB auth. | # Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved.
# Copyright (c) 2006-2007 Sippy Software, Inc. All rights reserved.
#
# This file is part of SIPPY, a free RFC3261 SIP stack and B2BUA.
#
# SIPPY is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | <commit_before><commit_msg>Add class specific for IVoiSys to do DB auth.<commit_after> | # Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved.
# Copyright (c) 2006-2007 Sippy Software, Inc. All rights reserved.
#
# This file is part of SIPPY, a free RFC3261 SIP stack and B2BUA.
#
# SIPPY is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | Add class specific for IVoiSys to do DB auth.# Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved.
# Copyright (c) 2006-2007 Sippy Software, Inc. All rights reserved.
#
# This file is part of SIPPY, a free RFC3261 SIP stack and B2BUA.
#
# SIPPY is free software; you can redistribute it and/or modify
# it under ... | <commit_before><commit_msg>Add class specific for IVoiSys to do DB auth.<commit_after># Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved.
# Copyright (c) 2006-2007 Sippy Software, Inc. All rights reserved.
#
# This file is part of SIPPY, a free RFC3261 SIP stack and B2BUA.
#
# SIPPY is free software; you can ... | |
d77a01a76bfe4789cf76f656b7136069ddac33a3 | scipy/constants/tests/test_constants.py | scipy/constants/tests/test_constants.py | from numpy.testing import run_module_suite, assert_equal
import scipy.constants as sc
def test_fahrenheit_to_celcius():
assert_equal(sc.F2C(32), 0)
assert_equal(sc.F2C([32, 32]), [0, 0])
def test_celcius_to_kelvin():
assert_equal(sc.C2K([0, 0]), [273.15, 273.15])
def test_kelvin_to_celcius():
assert_... | Add basic tests for constants. | ENH: Add basic tests for constants.
| Python | bsd-3-clause | arokem/scipy,zxsted/scipy,cpaulik/scipy,mingwpy/scipy,Gillu13/scipy,njwilson23/scipy,matthew-brett/scipy,mikebenfield/scipy,pnedunuri/scipy,larsmans/scipy,ilayn/scipy,jonycgn/scipy,dch312/scipy,anntzer/scipy,maniteja123/scipy,futurulus/scipy,Dapid/scipy,hainm/scipy,WarrenWeckesser/scipy,e-q/scipy,person142/scipy,lhilt/... | ENH: Add basic tests for constants. | from numpy.testing import run_module_suite, assert_equal
import scipy.constants as sc
def test_fahrenheit_to_celcius():
assert_equal(sc.F2C(32), 0)
assert_equal(sc.F2C([32, 32]), [0, 0])
def test_celcius_to_kelvin():
assert_equal(sc.C2K([0, 0]), [273.15, 273.15])
def test_kelvin_to_celcius():
assert_... | <commit_before><commit_msg>ENH: Add basic tests for constants.<commit_after> | from numpy.testing import run_module_suite, assert_equal
import scipy.constants as sc
def test_fahrenheit_to_celcius():
assert_equal(sc.F2C(32), 0)
assert_equal(sc.F2C([32, 32]), [0, 0])
def test_celcius_to_kelvin():
assert_equal(sc.C2K([0, 0]), [273.15, 273.15])
def test_kelvin_to_celcius():
assert_... | ENH: Add basic tests for constants.from numpy.testing import run_module_suite, assert_equal
import scipy.constants as sc
def test_fahrenheit_to_celcius():
assert_equal(sc.F2C(32), 0)
assert_equal(sc.F2C([32, 32]), [0, 0])
def test_celcius_to_kelvin():
assert_equal(sc.C2K([0, 0]), [273.15, 273.15])
def te... | <commit_before><commit_msg>ENH: Add basic tests for constants.<commit_after>from numpy.testing import run_module_suite, assert_equal
import scipy.constants as sc
def test_fahrenheit_to_celcius():
assert_equal(sc.F2C(32), 0)
assert_equal(sc.F2C([32, 32]), [0, 0])
def test_celcius_to_kelvin():
assert_equal(... | |
d6b11eec630d3709d69e3b3878a7859b67cb0fd4 | src/compare_meta_data.py | src/compare_meta_data.py | import argparse
import json
import re
from os.path import join
file_regex = re.compile("(^[a-z\-]*)")
results_log = "query_results.json"
def extract_arXiv_topic(filename):
return_topic = ""
matches = file_regex.match(filename).groups()
if len(matches) > 0:
return_topic = matches[0]
return r... | Add script to compare similarites with meta data | Add script to compare similarites with meta data
| Python | mit | PinPinIre/Final-Year-Project,PinPinIre/Final-Year-Project,PinPinIre/Final-Year-Project | Add script to compare similarites with meta data | import argparse
import json
import re
from os.path import join
file_regex = re.compile("(^[a-z\-]*)")
results_log = "query_results.json"
def extract_arXiv_topic(filename):
return_topic = ""
matches = file_regex.match(filename).groups()
if len(matches) > 0:
return_topic = matches[0]
return r... | <commit_before><commit_msg>Add script to compare similarites with meta data<commit_after> | import argparse
import json
import re
from os.path import join
file_regex = re.compile("(^[a-z\-]*)")
results_log = "query_results.json"
def extract_arXiv_topic(filename):
return_topic = ""
matches = file_regex.match(filename).groups()
if len(matches) > 0:
return_topic = matches[0]
return r... | Add script to compare similarites with meta dataimport argparse
import json
import re
from os.path import join
file_regex = re.compile("(^[a-z\-]*)")
results_log = "query_results.json"
def extract_arXiv_topic(filename):
return_topic = ""
matches = file_regex.match(filename).groups()
if len(matches) > 0... | <commit_before><commit_msg>Add script to compare similarites with meta data<commit_after>import argparse
import json
import re
from os.path import join
file_regex = re.compile("(^[a-z\-]*)")
results_log = "query_results.json"
def extract_arXiv_topic(filename):
return_topic = ""
matches = file_regex.match(f... | |
8df57b5241ba04ec8444546ed2356ae421796d23 | django_vend/core/forms.py | django_vend/core/forms.py | import re
from django import forms
from django.utils.dateparse import parse_datetime
from django.core.exceptions import ValidationError
def valid_date(date):
regex = ("^(?:[1-9]\d{3}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1\d|2[0-8])|(?:0[13"
"-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[1-9]\d(?:0[48]|[... | Create form field that can accept dates in the format used by the Vend API | Create form field that can accept dates in the format used by the Vend API
| Python | bsd-3-clause | remarkablerocket/django-vend,remarkablerocket/django-vend | Create form field that can accept dates in the format used by the Vend API | import re
from django import forms
from django.utils.dateparse import parse_datetime
from django.core.exceptions import ValidationError
def valid_date(date):
regex = ("^(?:[1-9]\d{3}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1\d|2[0-8])|(?:0[13"
"-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[1-9]\d(?:0[48]|[... | <commit_before><commit_msg>Create form field that can accept dates in the format used by the Vend API<commit_after> | import re
from django import forms
from django.utils.dateparse import parse_datetime
from django.core.exceptions import ValidationError
def valid_date(date):
regex = ("^(?:[1-9]\d{3}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1\d|2[0-8])|(?:0[13"
"-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[1-9]\d(?:0[48]|[... | Create form field that can accept dates in the format used by the Vend APIimport re
from django import forms
from django.utils.dateparse import parse_datetime
from django.core.exceptions import ValidationError
def valid_date(date):
regex = ("^(?:[1-9]\d{3}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1\d|2[0-8])|(?:0[13"
... | <commit_before><commit_msg>Create form field that can accept dates in the format used by the Vend API<commit_after>import re
from django import forms
from django.utils.dateparse import parse_datetime
from django.core.exceptions import ValidationError
def valid_date(date):
regex = ("^(?:[1-9]\d{3}-(?:(?:0[1-9]|1[0... | |
cb88cdb82eb8032b2a83f006aa7c5e153cbbe8e2 | python/smqtk/data_rep/data_set_impl/test_plugins.py | python/smqtk/data_rep/data_set_impl/test_plugins.py |
from smqtk.data_rep.data_set_impl import get_data_set_impls
__author__ = 'purg'
def test_plugin_getter():
c = get_data_set_impls()
assert 'DataFileSet' in c
| Add missing DataSet plugin test | Add missing DataSet plugin test
| Python | bsd-3-clause | kfieldho/SMQTK,Purg/SMQTK,kfieldho/SMQTK,kfieldho/SMQTK,Purg/SMQTK,kfieldho/SMQTK,kfieldho/SMQTK,Purg/SMQTK,Purg/SMQTK,Purg/SMQTK,kfieldho/SMQTK,kfieldho/SMQTK,kfieldho/SMQTK,Purg/SMQTK,Purg/SMQTK,kfieldho/SMQTK,Purg/SMQTK,Purg/SMQTK | Add missing DataSet plugin test |
from smqtk.data_rep.data_set_impl import get_data_set_impls
__author__ = 'purg'
def test_plugin_getter():
c = get_data_set_impls()
assert 'DataFileSet' in c
| <commit_before><commit_msg>Add missing DataSet plugin test<commit_after> |
from smqtk.data_rep.data_set_impl import get_data_set_impls
__author__ = 'purg'
def test_plugin_getter():
c = get_data_set_impls()
assert 'DataFileSet' in c
| Add missing DataSet plugin test
from smqtk.data_rep.data_set_impl import get_data_set_impls
__author__ = 'purg'
def test_plugin_getter():
c = get_data_set_impls()
assert 'DataFileSet' in c
| <commit_before><commit_msg>Add missing DataSet plugin test<commit_after>
from smqtk.data_rep.data_set_impl import get_data_set_impls
__author__ = 'purg'
def test_plugin_getter():
c = get_data_set_impls()
assert 'DataFileSet' in c
| |
fa4f6bc0eae79aec45ee3da5bc70515bb363110c | misc/bonus_feat_dumper.py | misc/bonus_feat_dumper.py | #!/usr/bin/env python
import argparse
from pynwn.resource import ResourceManager
from pynwn.file.twoda import TwoDA
from pynwn.item import Item
parser = argparse.ArgumentParser()
parser.add_argument('-v', '--version', action='version', version='0.1')
parser.add_argument('--nwn', help='NWN Path.',
... | Add little class bonus feat dumper. | Add little class bonus feat dumper.
| Python | mit | jd28/pynwn-tools,jd28/pynwn-tools | Add little class bonus feat dumper. | #!/usr/bin/env python
import argparse
from pynwn.resource import ResourceManager
from pynwn.file.twoda import TwoDA
from pynwn.item import Item
parser = argparse.ArgumentParser()
parser.add_argument('-v', '--version', action='version', version='0.1')
parser.add_argument('--nwn', help='NWN Path.',
... | <commit_before><commit_msg>Add little class bonus feat dumper.<commit_after> | #!/usr/bin/env python
import argparse
from pynwn.resource import ResourceManager
from pynwn.file.twoda import TwoDA
from pynwn.item import Item
parser = argparse.ArgumentParser()
parser.add_argument('-v', '--version', action='version', version='0.1')
parser.add_argument('--nwn', help='NWN Path.',
... | Add little class bonus feat dumper.#!/usr/bin/env python
import argparse
from pynwn.resource import ResourceManager
from pynwn.file.twoda import TwoDA
from pynwn.item import Item
parser = argparse.ArgumentParser()
parser.add_argument('-v', '--version', action='version', version='0.1')
parser.add_argument('--nwn', he... | <commit_before><commit_msg>Add little class bonus feat dumper.<commit_after>#!/usr/bin/env python
import argparse
from pynwn.resource import ResourceManager
from pynwn.file.twoda import TwoDA
from pynwn.item import Item
parser = argparse.ArgumentParser()
parser.add_argument('-v', '--version', action='version', versi... | |
e98452df23fd680be0b4b9729d1c7f80d0686a0e | examples/open-existing.py | examples/open-existing.py | #!/usr/bin/python
# This is a simple example program to show how to use PyIso to open up an
# existing ISO passed on the command-line, and print out all of the file names
# at the root of the ISO.
# Import standard python modules.
import sys
# Import pyiso itself.
import pyiso
# Check that there are enough command-... | Add a well-documented example for opening an existing ISO. | Add a well-documented example for opening an existing ISO.
Signed-off-by: Chris Lalancette <[email protected]>
| Python | lgpl-2.1 | clalancette/pycdlib,clalancette/pyiso | Add a well-documented example for opening an existing ISO.
Signed-off-by: Chris Lalancette <[email protected]> | #!/usr/bin/python
# This is a simple example program to show how to use PyIso to open up an
# existing ISO passed on the command-line, and print out all of the file names
# at the root of the ISO.
# Import standard python modules.
import sys
# Import pyiso itself.
import pyiso
# Check that there are enough command-... | <commit_before><commit_msg>Add a well-documented example for opening an existing ISO.
Signed-off-by: Chris Lalancette <[email protected]><commit_after> | #!/usr/bin/python
# This is a simple example program to show how to use PyIso to open up an
# existing ISO passed on the command-line, and print out all of the file names
# at the root of the ISO.
# Import standard python modules.
import sys
# Import pyiso itself.
import pyiso
# Check that there are enough command-... | Add a well-documented example for opening an existing ISO.
Signed-off-by: Chris Lalancette <[email protected]>#!/usr/bin/python
# This is a simple example program to show how to use PyIso to open up an
# existing ISO passed on the command-line, and print out all of the file names
# at... | <commit_before><commit_msg>Add a well-documented example for opening an existing ISO.
Signed-off-by: Chris Lalancette <[email protected]><commit_after>#!/usr/bin/python
# This is a simple example program to show how to use PyIso to open up an
# existing ISO passed on the command-line,... | |
6ba590092846ca240629091df2f064b389d15eca | babybuddy/migrations/0002_add_settings.py | babybuddy/migrations/0002_add_settings.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def add_settings(apps, schema_editor):
Settings = apps.get_model('babybuddy', 'Settings')
User = apps.get_model('auth', 'User')
for user in User.objects.all():
if Settings.objects.filter(user=user).co... | Add migration to handle existing users when adding the Settings model. | Add migration to handle existing users when adding the Settings model.
| Python | bsd-2-clause | cdubz/babybuddy,cdubz/babybuddy,cdubz/babybuddy | Add migration to handle existing users when adding the Settings model. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def add_settings(apps, schema_editor):
Settings = apps.get_model('babybuddy', 'Settings')
User = apps.get_model('auth', 'User')
for user in User.objects.all():
if Settings.objects.filter(user=user).co... | <commit_before><commit_msg>Add migration to handle existing users when adding the Settings model.<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def add_settings(apps, schema_editor):
Settings = apps.get_model('babybuddy', 'Settings')
User = apps.get_model('auth', 'User')
for user in User.objects.all():
if Settings.objects.filter(user=user).co... | Add migration to handle existing users when adding the Settings model.# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def add_settings(apps, schema_editor):
Settings = apps.get_model('babybuddy', 'Settings')
User = apps.get_model('auth', 'User')
for user i... | <commit_before><commit_msg>Add migration to handle existing users when adding the Settings model.<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def add_settings(apps, schema_editor):
Settings = apps.get_model('babybuddy', 'Settings')
User = apps... | |
9fb8b2bc70a34c9f91c652eb5582b3d894a069d6 | util/fetch_archive.py | util/fetch_archive.py | #!/usr/bin/python3
import argparse
import os
import requests
import shutil
import subprocess
parser = argparse.ArgumentParser(description='iconograph fetch_archive')
parser.add_argument(
'--dest-dir',
dest='dest_dir',
action='store',
default='.')
parser.add_argument(
'--https-ca-cert',
dest='... | Add utility to fetch and unpack tarballs securely from a server. | Add utility to fetch and unpack tarballs securely from a server.
| Python | apache-2.0 | robot-tools/iconograph,robot-tools/iconograph,robot-tools/iconograph,robot-tools/iconograph | Add utility to fetch and unpack tarballs securely from a server. | #!/usr/bin/python3
import argparse
import os
import requests
import shutil
import subprocess
parser = argparse.ArgumentParser(description='iconograph fetch_archive')
parser.add_argument(
'--dest-dir',
dest='dest_dir',
action='store',
default='.')
parser.add_argument(
'--https-ca-cert',
dest='... | <commit_before><commit_msg>Add utility to fetch and unpack tarballs securely from a server.<commit_after> | #!/usr/bin/python3
import argparse
import os
import requests
import shutil
import subprocess
parser = argparse.ArgumentParser(description='iconograph fetch_archive')
parser.add_argument(
'--dest-dir',
dest='dest_dir',
action='store',
default='.')
parser.add_argument(
'--https-ca-cert',
dest='... | Add utility to fetch and unpack tarballs securely from a server.#!/usr/bin/python3
import argparse
import os
import requests
import shutil
import subprocess
parser = argparse.ArgumentParser(description='iconograph fetch_archive')
parser.add_argument(
'--dest-dir',
dest='dest_dir',
action='store',
def... | <commit_before><commit_msg>Add utility to fetch and unpack tarballs securely from a server.<commit_after>#!/usr/bin/python3
import argparse
import os
import requests
import shutil
import subprocess
parser = argparse.ArgumentParser(description='iconograph fetch_archive')
parser.add_argument(
'--dest-dir',
des... | |
6db79795e3839003965686f8ef73d1937aba1fba | scripts/consistency/fix_duplicate_addons.py | scripts/consistency/fix_duplicate_addons.py | """Fixes nodes with two copies of the files and wiki addons attached.
This script must be run from the OSF root directory for the imports to work.
"""
from pymongo import MongoClient
from website.app import init_app
from website.project.model import Node
from website.addons.wiki.model import AddonWikiNodeSettings
... | Add script to fix file and wiki migration bug | Add script to fix file and wiki migration bug
| Python | apache-2.0 | sloria/osf.io,felliott/osf.io,chrisseto/osf.io,mattclark/osf.io,icereval/osf.io,samanehsan/osf.io,cwisecarver/osf.io,laurenrevere/osf.io,reinaH/osf.io,erinspace/osf.io,abought/osf.io,baylee-d/osf.io,dplorimer/osf,danielneis/osf.io,jinluyuan/osf.io,rdhyee/osf.io,chrisseto/osf.io,jolene-esposito/osf.io,CenterForOpenScien... | Add script to fix file and wiki migration bug | """Fixes nodes with two copies of the files and wiki addons attached.
This script must be run from the OSF root directory for the imports to work.
"""
from pymongo import MongoClient
from website.app import init_app
from website.project.model import Node
from website.addons.wiki.model import AddonWikiNodeSettings
... | <commit_before><commit_msg>Add script to fix file and wiki migration bug<commit_after> | """Fixes nodes with two copies of the files and wiki addons attached.
This script must be run from the OSF root directory for the imports to work.
"""
from pymongo import MongoClient
from website.app import init_app
from website.project.model import Node
from website.addons.wiki.model import AddonWikiNodeSettings
... | Add script to fix file and wiki migration bug"""Fixes nodes with two copies of the files and wiki addons attached.
This script must be run from the OSF root directory for the imports to work.
"""
from pymongo import MongoClient
from website.app import init_app
from website.project.model import Node
from website.ad... | <commit_before><commit_msg>Add script to fix file and wiki migration bug<commit_after>"""Fixes nodes with two copies of the files and wiki addons attached.
This script must be run from the OSF root directory for the imports to work.
"""
from pymongo import MongoClient
from website.app import init_app
from website.p... | |
2c6cb6b869726fbac859b5e3e1ab3d3a76d4908b | tools/telemetry/telemetry/page/page_test_results.py | tools/telemetry/telemetry/page/page_test_results.py | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import traceback
import unittest
class PageTestResults(unittest.TestResult):
def __init__(self):
super(PageTestResults, self).__init__()
self.... | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import traceback
import unittest
class PageTestResults(unittest.TestResult):
def __init__(self):
super(PageTestResults, self).__init__()
self.... | Add skipped and addSkip() to PageTestResults, for Python < 2.7. | [telemetry] Add skipped and addSkip() to PageTestResults, for Python < 2.7.
Fixing bots after https://chromiumcodereview.appspot.com/15153003/
Also fix typo in addSuccess(). successes is only used by record_wpr, so that mistake had no effect on the bots.
[email protected]
BUG=None.
TEST=None.
Review URL: https:... | Python | bsd-3-clause | ondra-novak/chromium.src,dushu1203/chromium.src,hgl888/chromium-crosswalk,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk-efl,jaruba/chromium.src,Just-D/chromium-1,ondra-novak/chromium.src,hgl888/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,Chilledheart/chromium,patrickm/chromium.sr... | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import traceback
import unittest
class PageTestResults(unittest.TestResult):
def __init__(self):
super(PageTestResults, self).__init__()
self.... | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import traceback
import unittest
class PageTestResults(unittest.TestResult):
def __init__(self):
super(PageTestResults, self).__init__()
self.... | <commit_before># Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import traceback
import unittest
class PageTestResults(unittest.TestResult):
def __init__(self):
super(PageTestResults, self).__ini... | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import traceback
import unittest
class PageTestResults(unittest.TestResult):
def __init__(self):
super(PageTestResults, self).__init__()
self.... | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import traceback
import unittest
class PageTestResults(unittest.TestResult):
def __init__(self):
super(PageTestResults, self).__init__()
self.... | <commit_before># Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import traceback
import unittest
class PageTestResults(unittest.TestResult):
def __init__(self):
super(PageTestResults, self).__ini... |
dd617bf4ef79d61caa3080331733d05c46b6aa04 | python/aspk/super_test.py | python/aspk/super_test.py | # this file demostrate the diamond problem. The constructore method can't be called correctly in this case.
# When instance a D object, super(D, self) will be a B object, so B.__init__ will be called.
# But in B.__init__, super(B, self) will be a C object, instead of a A object, so C.__init__ will be called, this will ... | Test the diamond inheritance problem. | Test the diamond inheritance problem.
| Python | mit | astropeak/aspk-code-base,astropeak/aspk-code-base,astropeak/aspk-code-base,astropeak/aspk-code-base,astropeak/aspk-code-base,astropeak/aspk-code-base,astropeak/aspk-code-base,astropeak/aspk-code-base,astropeak/aspk-code-base | Test the diamond inheritance problem. | # this file demostrate the diamond problem. The constructore method can't be called correctly in this case.
# When instance a D object, super(D, self) will be a B object, so B.__init__ will be called.
# But in B.__init__, super(B, self) will be a C object, instead of a A object, so C.__init__ will be called, this will ... | <commit_before><commit_msg>Test the diamond inheritance problem.<commit_after> | # this file demostrate the diamond problem. The constructore method can't be called correctly in this case.
# When instance a D object, super(D, self) will be a B object, so B.__init__ will be called.
# But in B.__init__, super(B, self) will be a C object, instead of a A object, so C.__init__ will be called, this will ... | Test the diamond inheritance problem.# this file demostrate the diamond problem. The constructore method can't be called correctly in this case.
# When instance a D object, super(D, self) will be a B object, so B.__init__ will be called.
# But in B.__init__, super(B, self) will be a C object, instead of a A object, so ... | <commit_before><commit_msg>Test the diamond inheritance problem.<commit_after># this file demostrate the diamond problem. The constructore method can't be called correctly in this case.
# When instance a D object, super(D, self) will be a B object, so B.__init__ will be called.
# But in B.__init__, super(B, self) will ... | |
0ff96767ea737a1771bec6ac912c2e5dec6c3328 | modules/tools/extractor/extractor.py | modules/tools/extractor/extractor.py | #!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy ... | Add tool to extract routing from planning debug | Add tool to extract routing from planning debug
| Python | apache-2.0 | msbeta/apollo,msbeta/apollo,msbeta/apollo,msbeta/apollo,msbeta/apollo,msbeta/apollo | Add tool to extract routing from planning debug | #!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy ... | <commit_before><commit_msg>Add tool to extract routing from planning debug<commit_after> | #!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy ... | Add tool to extract routing from planning debug#!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compli... | <commit_before><commit_msg>Add tool to extract routing from planning debug<commit_after>#!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# y... | |
4c359a1bab5782614d95c7165c6af8805fe85d99 | plot.py | plot.py | #!/usr/bin/env python
"""
This script generates the relevant figures and/or tables from the experiment. To
reprocess the data, run `process.py`.
"""
import os
from Modules.plotting import *
from pxl.styleplot import set_sns
save = True
savetype = ".pdf"
show = True
if __name__ == "__main__":
# Set plot style us... | Add top-level script for generating figures | Add top-level script for generating figures
| Python | mit | iangagnon/2015-09-24-turbine-test-bed-demo,UNH-CORE/2015-09-24-turbine-test-bed-demo,petebachant/TurbineDAQ-project-template | Add top-level script for generating figures | #!/usr/bin/env python
"""
This script generates the relevant figures and/or tables from the experiment. To
reprocess the data, run `process.py`.
"""
import os
from Modules.plotting import *
from pxl.styleplot import set_sns
save = True
savetype = ".pdf"
show = True
if __name__ == "__main__":
# Set plot style us... | <commit_before><commit_msg>Add top-level script for generating figures<commit_after> | #!/usr/bin/env python
"""
This script generates the relevant figures and/or tables from the experiment. To
reprocess the data, run `process.py`.
"""
import os
from Modules.plotting import *
from pxl.styleplot import set_sns
save = True
savetype = ".pdf"
show = True
if __name__ == "__main__":
# Set plot style us... | Add top-level script for generating figures#!/usr/bin/env python
"""
This script generates the relevant figures and/or tables from the experiment. To
reprocess the data, run `process.py`.
"""
import os
from Modules.plotting import *
from pxl.styleplot import set_sns
save = True
savetype = ".pdf"
show = True
if __na... | <commit_before><commit_msg>Add top-level script for generating figures<commit_after>#!/usr/bin/env python
"""
This script generates the relevant figures and/or tables from the experiment. To
reprocess the data, run `process.py`.
"""
import os
from Modules.plotting import *
from pxl.styleplot import set_sns
save = Tru... | |
23255192812a687e9fa56828908828d5c4caddc6 | DBConnect.py | DBConnect.py | import psycopg2 as pg_driver
class DBService:
def __init__(self, user, password, host, dbname):
self.db = pg_driver.connect(user=user, password=password, host=host, dbname=dbname)
self.cur = self.db.cursor()
def __del__(self):
self.db.close()
def get_url(self):
self.cur.e... | Implement class for connect to DB | Implement class for connect to DB
| Python | mit | YorovSobir/informational_retrieval | Implement class for connect to DB | import psycopg2 as pg_driver
class DBService:
def __init__(self, user, password, host, dbname):
self.db = pg_driver.connect(user=user, password=password, host=host, dbname=dbname)
self.cur = self.db.cursor()
def __del__(self):
self.db.close()
def get_url(self):
self.cur.e... | <commit_before><commit_msg>Implement class for connect to DB<commit_after> | import psycopg2 as pg_driver
class DBService:
def __init__(self, user, password, host, dbname):
self.db = pg_driver.connect(user=user, password=password, host=host, dbname=dbname)
self.cur = self.db.cursor()
def __del__(self):
self.db.close()
def get_url(self):
self.cur.e... | Implement class for connect to DBimport psycopg2 as pg_driver
class DBService:
def __init__(self, user, password, host, dbname):
self.db = pg_driver.connect(user=user, password=password, host=host, dbname=dbname)
self.cur = self.db.cursor()
def __del__(self):
self.db.close()
def ... | <commit_before><commit_msg>Implement class for connect to DB<commit_after>import psycopg2 as pg_driver
class DBService:
def __init__(self, user, password, host, dbname):
self.db = pg_driver.connect(user=user, password=password, host=host, dbname=dbname)
self.cur = self.db.cursor()
def __del__... | |
9cb3ab8ff55cfdf1413f1290bdc40d2e90fe1e02 | tests/test_response.py | tests/test_response.py | """Unit test some basic response rendering functionality.
These tests use the unittest.mock mechanism to provide a simple Assistant
instance for the _Response initialization.
"""
from unittest.mock import patch
from flask import Flask
from flask_assistant import Assistant
from flask_assistant.response import _Respons... | Add basic unittests for _Response initialization | Add basic unittests for _Response initialization
| Python | apache-2.0 | treethought/flask-assistant | Add basic unittests for _Response initialization | """Unit test some basic response rendering functionality.
These tests use the unittest.mock mechanism to provide a simple Assistant
instance for the _Response initialization.
"""
from unittest.mock import patch
from flask import Flask
from flask_assistant import Assistant
from flask_assistant.response import _Respons... | <commit_before><commit_msg>Add basic unittests for _Response initialization<commit_after> | """Unit test some basic response rendering functionality.
These tests use the unittest.mock mechanism to provide a simple Assistant
instance for the _Response initialization.
"""
from unittest.mock import patch
from flask import Flask
from flask_assistant import Assistant
from flask_assistant.response import _Respons... | Add basic unittests for _Response initialization"""Unit test some basic response rendering functionality.
These tests use the unittest.mock mechanism to provide a simple Assistant
instance for the _Response initialization.
"""
from unittest.mock import patch
from flask import Flask
from flask_assistant import Assista... | <commit_before><commit_msg>Add basic unittests for _Response initialization<commit_after>"""Unit test some basic response rendering functionality.
These tests use the unittest.mock mechanism to provide a simple Assistant
instance for the _Response initialization.
"""
from unittest.mock import patch
from flask import ... | |
6ae99e2d05ba43e09f500ddad9d8cc491c7263f7 | static_rnn.py | static_rnn.py | # Static unrolling through time
import tensorflow as tf
import numpy as np
tf.set_random_seed(765)
np.random.seed(765)
n_inputs = 3
n_neurons = 5
X0 = tf.placeholder(tf.float32, [None, n_inputs])
X1 = tf.placeholder(tf.float32, [None, n_inputs])
basic_cell = tf.contrib.rnn.BasicRNNCell(num_units=n_neurons)
output_s... | Add code for simple static RNN | Add code for simple static RNN
Hard to scale up this example.
| Python | mit | KT12/hands_on_machine_learning | Add code for simple static RNN
Hard to scale up this example. | # Static unrolling through time
import tensorflow as tf
import numpy as np
tf.set_random_seed(765)
np.random.seed(765)
n_inputs = 3
n_neurons = 5
X0 = tf.placeholder(tf.float32, [None, n_inputs])
X1 = tf.placeholder(tf.float32, [None, n_inputs])
basic_cell = tf.contrib.rnn.BasicRNNCell(num_units=n_neurons)
output_s... | <commit_before><commit_msg>Add code for simple static RNN
Hard to scale up this example.<commit_after> | # Static unrolling through time
import tensorflow as tf
import numpy as np
tf.set_random_seed(765)
np.random.seed(765)
n_inputs = 3
n_neurons = 5
X0 = tf.placeholder(tf.float32, [None, n_inputs])
X1 = tf.placeholder(tf.float32, [None, n_inputs])
basic_cell = tf.contrib.rnn.BasicRNNCell(num_units=n_neurons)
output_s... | Add code for simple static RNN
Hard to scale up this example.# Static unrolling through time
import tensorflow as tf
import numpy as np
tf.set_random_seed(765)
np.random.seed(765)
n_inputs = 3
n_neurons = 5
X0 = tf.placeholder(tf.float32, [None, n_inputs])
X1 = tf.placeholder(tf.float32, [None, n_inputs])
basic_ce... | <commit_before><commit_msg>Add code for simple static RNN
Hard to scale up this example.<commit_after># Static unrolling through time
import tensorflow as tf
import numpy as np
tf.set_random_seed(765)
np.random.seed(765)
n_inputs = 3
n_neurons = 5
X0 = tf.placeholder(tf.float32, [None, n_inputs])
X1 = tf.placeholde... | |
d6aeb1b4e4a9df6ae1f8b8316a90b1d9e3e7b7f2 | test.py | test.py | #!/usr/bin/env python
# built-in
import os
from pprint import pprint
import sys
# 3rd party by pip
# local
from bibpy import bib
def main(argv=sys.argv[:]):
# example = 'bibtex/robust_inside-outside_segmentation_using_generalized_winding_numbers.bib'
example = argv[1]
data = bib.clear_comments(open(exa... | Test bibpy. It works really well. | Test bibpy. It works really well.
| Python | unlicense | drakeguan/siggraphwall,drakeguan/siggraphwall,drakeguan/siggraphwall | Test bibpy. It works really well. | #!/usr/bin/env python
# built-in
import os
from pprint import pprint
import sys
# 3rd party by pip
# local
from bibpy import bib
def main(argv=sys.argv[:]):
# example = 'bibtex/robust_inside-outside_segmentation_using_generalized_winding_numbers.bib'
example = argv[1]
data = bib.clear_comments(open(exa... | <commit_before><commit_msg>Test bibpy. It works really well.<commit_after> | #!/usr/bin/env python
# built-in
import os
from pprint import pprint
import sys
# 3rd party by pip
# local
from bibpy import bib
def main(argv=sys.argv[:]):
# example = 'bibtex/robust_inside-outside_segmentation_using_generalized_winding_numbers.bib'
example = argv[1]
data = bib.clear_comments(open(exa... | Test bibpy. It works really well.#!/usr/bin/env python
# built-in
import os
from pprint import pprint
import sys
# 3rd party by pip
# local
from bibpy import bib
def main(argv=sys.argv[:]):
# example = 'bibtex/robust_inside-outside_segmentation_using_generalized_winding_numbers.bib'
example = argv[1]
d... | <commit_before><commit_msg>Test bibpy. It works really well.<commit_after>#!/usr/bin/env python
# built-in
import os
from pprint import pprint
import sys
# 3rd party by pip
# local
from bibpy import bib
def main(argv=sys.argv[:]):
# example = 'bibtex/robust_inside-outside_segmentation_using_generalized_winding... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.