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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
51b90afe8388b0425810bc1560cffe2e5a02fca8 | code/generate_boolean_matrix.py | code/generate_boolean_matrix.py | import itertools
letters = ['A','R','N','D','C','E','Q','G','H','I','L','K','M','F','P','S','T','W','Y','V']
# generates a matrix from all peptides and saves to CSV
def generateBooleanMatrix(peptides):
# generate header ------
peptide_length = 9
aa_list = ['A','R','N','D','C','E','Q','G','H','I','L','K','M','F','... | Add boolean matrix generator - from mocogenomics | Add boolean matrix generator - from mocogenomics
| Python | mit | andretadeu/jhu-immuno,andretadeu/jhu-immuno | Add boolean matrix generator - from mocogenomics | import itertools
letters = ['A','R','N','D','C','E','Q','G','H','I','L','K','M','F','P','S','T','W','Y','V']
# generates a matrix from all peptides and saves to CSV
def generateBooleanMatrix(peptides):
# generate header ------
peptide_length = 9
aa_list = ['A','R','N','D','C','E','Q','G','H','I','L','K','M','F','... | <commit_before><commit_msg>Add boolean matrix generator - from mocogenomics<commit_after> | import itertools
letters = ['A','R','N','D','C','E','Q','G','H','I','L','K','M','F','P','S','T','W','Y','V']
# generates a matrix from all peptides and saves to CSV
def generateBooleanMatrix(peptides):
# generate header ------
peptide_length = 9
aa_list = ['A','R','N','D','C','E','Q','G','H','I','L','K','M','F','... | Add boolean matrix generator - from mocogenomicsimport itertools
letters = ['A','R','N','D','C','E','Q','G','H','I','L','K','M','F','P','S','T','W','Y','V']
# generates a matrix from all peptides and saves to CSV
def generateBooleanMatrix(peptides):
# generate header ------
peptide_length = 9
aa_list = ['A','R','... | <commit_before><commit_msg>Add boolean matrix generator - from mocogenomics<commit_after>import itertools
letters = ['A','R','N','D','C','E','Q','G','H','I','L','K','M','F','P','S','T','W','Y','V']
# generates a matrix from all peptides and saves to CSV
def generateBooleanMatrix(peptides):
# generate header ------
... | |
bffa61da4576c088c081daea3833142af58fef1d | tests/test_cities.py | tests/test_cities.py | import testtools
import cities
class TestCities(testtools.TestCase):
def test_largest(self):
largest = 'Sydney'
self.assertEqual(largest, cities.largest(cities.get_cities()).name)
| Add in some tests for cities | Add in some tests for cities
| Python | apache-2.0 | jhesketh/pyconau-gating-demo | Add in some tests for cities | import testtools
import cities
class TestCities(testtools.TestCase):
def test_largest(self):
largest = 'Sydney'
self.assertEqual(largest, cities.largest(cities.get_cities()).name)
| <commit_before><commit_msg>Add in some tests for cities<commit_after> | import testtools
import cities
class TestCities(testtools.TestCase):
def test_largest(self):
largest = 'Sydney'
self.assertEqual(largest, cities.largest(cities.get_cities()).name)
| Add in some tests for citiesimport testtools
import cities
class TestCities(testtools.TestCase):
def test_largest(self):
largest = 'Sydney'
self.assertEqual(largest, cities.largest(cities.get_cities()).name)
| <commit_before><commit_msg>Add in some tests for cities<commit_after>import testtools
import cities
class TestCities(testtools.TestCase):
def test_largest(self):
largest = 'Sydney'
self.assertEqual(largest, cities.largest(cities.get_cities()).name)
| |
71fda989816e1848c99b801c133171216abe0df5 | tests/test_domain.py | tests/test_domain.py |
import unittest
import libvirt
class TestLibvirtDomain(unittest.TestCase):
def setUp(self):
self.conn = libvirt.open("test:///default")
self.dom = self.conn.lookupByName("test")
def tearDown(self):
self.dom = None
self.conn = None
def testDomainSchedParams(self):
... | Add test for setting scheduler parameters | Add test for setting scheduler parameters
Add a test setting scheduler parameters to validate the
previous bugfix to strncpy of field names.
Signed-off-by: Daniel P. Berrange <bb938cf255e055ff3507f2627d214e8e62118fcf@redhat.com>
| Python | lgpl-2.1 | libvirt/libvirt-python,libvirt/libvirt-python,libvirt/libvirt-python | Add test for setting scheduler parameters
Add a test setting scheduler parameters to validate the
previous bugfix to strncpy of field names.
Signed-off-by: Daniel P. Berrange <bb938cf255e055ff3507f2627d214e8e62118fcf@redhat.com> |
import unittest
import libvirt
class TestLibvirtDomain(unittest.TestCase):
def setUp(self):
self.conn = libvirt.open("test:///default")
self.dom = self.conn.lookupByName("test")
def tearDown(self):
self.dom = None
self.conn = None
def testDomainSchedParams(self):
... | <commit_before><commit_msg>Add test for setting scheduler parameters
Add a test setting scheduler parameters to validate the
previous bugfix to strncpy of field names.
Signed-off-by: Daniel P. Berrange <bb938cf255e055ff3507f2627d214e8e62118fcf@redhat.com><commit_after> |
import unittest
import libvirt
class TestLibvirtDomain(unittest.TestCase):
def setUp(self):
self.conn = libvirt.open("test:///default")
self.dom = self.conn.lookupByName("test")
def tearDown(self):
self.dom = None
self.conn = None
def testDomainSchedParams(self):
... | Add test for setting scheduler parameters
Add a test setting scheduler parameters to validate the
previous bugfix to strncpy of field names.
Signed-off-by: Daniel P. Berrange <bb938cf255e055ff3507f2627d214e8e62118fcf@redhat.com>
import unittest
import libvirt
class TestLibvirtDomain(unittest.TestCase):
def setUp... | <commit_before><commit_msg>Add test for setting scheduler parameters
Add a test setting scheduler parameters to validate the
previous bugfix to strncpy of field names.
Signed-off-by: Daniel P. Berrange <bb938cf255e055ff3507f2627d214e8e62118fcf@redhat.com><commit_after>
import unittest
import libvirt
class TestLibvir... | |
ba09b09e7315cafa96e162a8186abe14c51c8128 | python/download_file_from_url.py | python/download_file_from_url.py | import urllib2
'''
Script to download pdf from a url, you need specify the website URL, and change the
filename in the loop, it mostly useful to download a sequence of files with the
filename only differ by a sequence number, e.g. CH1.PDF, CH2.PDF, CH3.PDF ...
'''
def download_file(download_url, output_name):
''... | Add a script to download files from url | Add a script to download files from url
| Python | bsd-3-clause | qingkaikong/useful_script,qingkaikong/useful_script,qingkaikong/useful_script,qingkaikong/useful_script,qingkaikong/useful_script | Add a script to download files from url | import urllib2
'''
Script to download pdf from a url, you need specify the website URL, and change the
filename in the loop, it mostly useful to download a sequence of files with the
filename only differ by a sequence number, e.g. CH1.PDF, CH2.PDF, CH3.PDF ...
'''
def download_file(download_url, output_name):
''... | <commit_before><commit_msg>Add a script to download files from url<commit_after> | import urllib2
'''
Script to download pdf from a url, you need specify the website URL, and change the
filename in the loop, it mostly useful to download a sequence of files with the
filename only differ by a sequence number, e.g. CH1.PDF, CH2.PDF, CH3.PDF ...
'''
def download_file(download_url, output_name):
''... | Add a script to download files from urlimport urllib2
'''
Script to download pdf from a url, you need specify the website URL, and change the
filename in the loop, it mostly useful to download a sequence of files with the
filename only differ by a sequence number, e.g. CH1.PDF, CH2.PDF, CH3.PDF ...
'''
def download_... | <commit_before><commit_msg>Add a script to download files from url<commit_after>import urllib2
'''
Script to download pdf from a url, you need specify the website URL, and change the
filename in the loop, it mostly useful to download a sequence of files with the
filename only differ by a sequence number, e.g. CH1.PDF... | |
4646873ec80076759c02deac7ff3c50665e31415 | setup.py | setup.py | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.11',
packages=['todoist', 'todoist.managers'],
author='Doist Team... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.12',
packages=['todoist', 'todoist.managers'],
author='Doist Team... | Update the PyPI version to 0.2.12 | Update the PyPI version to 0.2.12
| Python | mit | Doist/todoist-python,electronick1/todoist-python | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.11',
packages=['todoist', 'todoist.managers'],
author='Doist Team... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.12',
packages=['todoist', 'todoist.managers'],
author='Doist Team... | <commit_before># -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.11',
packages=['todoist', 'todoist.managers'],
aut... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.12',
packages=['todoist', 'todoist.managers'],
author='Doist Team... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.11',
packages=['todoist', 'todoist.managers'],
author='Doist Team... | <commit_before># -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.11',
packages=['todoist', 'todoist.managers'],
aut... |
23df7b77cde8b5351cf2902b8b11ee07e4b478f4 | tests/smoke_test.py | tests/smoke_test.py | # -*- coding: utf-8 -*-
import unittest
import sys
sys.path.insert(0, '../mafia')
from game import Game
from game import Player
class TestMessenger:
def message_all_players(self, message: str):
print ('public: {message}'.format(message=message))
def message_player(self, player, message: str):
... | Add a basic smoke test to check for exceptions and programming errors. | Add a basic smoke test to check for exceptions and programming errors.
| Python | mit | BitokuOokami/PloungeMafiaToolkit | Add a basic smoke test to check for exceptions and programming errors. | # -*- coding: utf-8 -*-
import unittest
import sys
sys.path.insert(0, '../mafia')
from game import Game
from game import Player
class TestMessenger:
def message_all_players(self, message: str):
print ('public: {message}'.format(message=message))
def message_player(self, player, message: str):
... | <commit_before><commit_msg>Add a basic smoke test to check for exceptions and programming errors.<commit_after> | # -*- coding: utf-8 -*-
import unittest
import sys
sys.path.insert(0, '../mafia')
from game import Game
from game import Player
class TestMessenger:
def message_all_players(self, message: str):
print ('public: {message}'.format(message=message))
def message_player(self, player, message: str):
... | Add a basic smoke test to check for exceptions and programming errors.# -*- coding: utf-8 -*-
import unittest
import sys
sys.path.insert(0, '../mafia')
from game import Game
from game import Player
class TestMessenger:
def message_all_players(self, message: str):
print ('public: {message}'.format(message... | <commit_before><commit_msg>Add a basic smoke test to check for exceptions and programming errors.<commit_after># -*- coding: utf-8 -*-
import unittest
import sys
sys.path.insert(0, '../mafia')
from game import Game
from game import Player
class TestMessenger:
def message_all_players(self, message: str):
... | |
36756dbd6b287f8dc6d5629027a8fe75d0f4bb09 | NorrisIsSoFunny_bot.py | NorrisIsSoFunny_bot.py | import telegram
LAST_UPDATE_ID = None
def main():
''' This is the main function that has to be called '''
global LAST_UPDATE_ID
# Telegram Bot Authorization Token
bot = telegram.Bot('put your token here')
# This will be our global variable to keep the latest update_id when requesting
# f... | Add Chuck Norris bot to the team | Add Chuck Norris bot to the team
| Python | mit | farhaanbukhsh/Telegram-Bots | Add Chuck Norris bot to the team | import telegram
LAST_UPDATE_ID = None
def main():
''' This is the main function that has to be called '''
global LAST_UPDATE_ID
# Telegram Bot Authorization Token
bot = telegram.Bot('put your token here')
# This will be our global variable to keep the latest update_id when requesting
# f... | <commit_before><commit_msg>Add Chuck Norris bot to the team<commit_after> | import telegram
LAST_UPDATE_ID = None
def main():
''' This is the main function that has to be called '''
global LAST_UPDATE_ID
# Telegram Bot Authorization Token
bot = telegram.Bot('put your token here')
# This will be our global variable to keep the latest update_id when requesting
# f... | Add Chuck Norris bot to the teamimport telegram
LAST_UPDATE_ID = None
def main():
''' This is the main function that has to be called '''
global LAST_UPDATE_ID
# Telegram Bot Authorization Token
bot = telegram.Bot('put your token here')
# This will be our global variable to keep the latest u... | <commit_before><commit_msg>Add Chuck Norris bot to the team<commit_after>import telegram
LAST_UPDATE_ID = None
def main():
''' This is the main function that has to be called '''
global LAST_UPDATE_ID
# Telegram Bot Authorization Token
bot = telegram.Bot('put your token here')
# This will be... | |
924ef1395214c2f71b96c21f41e240c88f0570a1 | addons/project/__terp__.py | addons/project/__terp__.py | {
"name" : "Project Management",
"version": "1.0",
"author" : "Tiny",
"website" : "http://tinyerp.com/module_project.html",
"category" : "Generic Modules/Projects & Services",
"depends" : ["product", "account", 'mrp', 'sale', 'base'],
"description": "Project management module that track multi-level projects, tas... | {
"name" : "Project Management",
"version": "1.0",
"author" : "Tiny",
"website" : "http://tinyerp.com/module_project.html",
"category" : "Generic Modules/Projects & Services",
"depends" : ["product", "account", 'mrp', 'sale', 'base'],
"description": "Project management module that track multi-level projects, tas... | Add project_security.xml file entry in update_xml section | Add project_security.xml file entry in update_xml section
bzr revid: mga@tinyerp.com-1950891d2c32d7af7c7ba38518a3abdba822b091 | Python | agpl-3.0 | gavin-feng/odoo,hip-odoo/odoo,SerpentCS/odoo,OpusVL/odoo,ecosoft-odoo/odoo,abstract-open-solutions/OCB,ojengwa/odoo,cloud9UG/odoo,spadae22/odoo,chiragjogi/odoo,rdeheele/odoo,fevxie/odoo,gavin-feng/odoo,jolevq/odoopub,alhashash/odoo,ramitalat/odoo,numerigraphe/odoo,apanju/GMIO_Odoo,blaggacao/OpenUpgrade,shivam1111/odoo,... | {
"name" : "Project Management",
"version": "1.0",
"author" : "Tiny",
"website" : "http://tinyerp.com/module_project.html",
"category" : "Generic Modules/Projects & Services",
"depends" : ["product", "account", 'mrp', 'sale', 'base'],
"description": "Project management module that track multi-level projects, tas... | {
"name" : "Project Management",
"version": "1.0",
"author" : "Tiny",
"website" : "http://tinyerp.com/module_project.html",
"category" : "Generic Modules/Projects & Services",
"depends" : ["product", "account", 'mrp', 'sale', 'base'],
"description": "Project management module that track multi-level projects, tas... | <commit_before>{
"name" : "Project Management",
"version": "1.0",
"author" : "Tiny",
"website" : "http://tinyerp.com/module_project.html",
"category" : "Generic Modules/Projects & Services",
"depends" : ["product", "account", 'mrp', 'sale', 'base'],
"description": "Project management module that track multi-leve... | {
"name" : "Project Management",
"version": "1.0",
"author" : "Tiny",
"website" : "http://tinyerp.com/module_project.html",
"category" : "Generic Modules/Projects & Services",
"depends" : ["product", "account", 'mrp', 'sale', 'base'],
"description": "Project management module that track multi-level projects, tas... | {
"name" : "Project Management",
"version": "1.0",
"author" : "Tiny",
"website" : "http://tinyerp.com/module_project.html",
"category" : "Generic Modules/Projects & Services",
"depends" : ["product", "account", 'mrp', 'sale', 'base'],
"description": "Project management module that track multi-level projects, tas... | <commit_before>{
"name" : "Project Management",
"version": "1.0",
"author" : "Tiny",
"website" : "http://tinyerp.com/module_project.html",
"category" : "Generic Modules/Projects & Services",
"depends" : ["product", "account", 'mrp', 'sale', 'base'],
"description": "Project management module that track multi-leve... |
b01b2757e5bfd9835ce28e6d5e27137c7aa5075b | tools/testdriver.py | tools/testdriver.py | # -*- Mode: Python; coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2007 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Sof... | Add a small test script to call individual methods of a driver | Add a small test script to call individual methods of a driver | Python | lgpl-2.1 | Vauxoo/stoqdrivers,stoq/stoqdrivers,vauxoo-dev/stoqdrivers,stoq/stoqdrivers | Add a small test script to call individual methods of a driver | # -*- Mode: Python; coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2007 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Sof... | <commit_before><commit_msg>Add a small test script to call individual methods of a driver<commit_after> | # -*- Mode: Python; coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2007 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Sof... | Add a small test script to call individual methods of a driver# -*- Mode: Python; coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2007 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of ... | <commit_before><commit_msg>Add a small test script to call individual methods of a driver<commit_after># -*- Mode: Python; coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2007 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## This program is free software; you can redistribute i... | |
fb08ad77a821d86a3049628d907577949d525dac | toolium/test/behave/test_environment.py | toolium/test/behave/test_environment.py | # -*- coding: utf-8 -*-
u"""
Copyright 2016 Telefónica Investigación y Desarrollo, S.A.U.
This file is part of Toolium.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/lic... | Add unittests to test environment.py methods | Add unittests to test environment.py methods
| Python | apache-2.0 | Telefonica/toolium,Telefonica/toolium,Telefonica/toolium | Add unittests to test environment.py methods | # -*- coding: utf-8 -*-
u"""
Copyright 2016 Telefónica Investigación y Desarrollo, S.A.U.
This file is part of Toolium.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/lic... | <commit_before><commit_msg>Add unittests to test environment.py methods<commit_after> | # -*- coding: utf-8 -*-
u"""
Copyright 2016 Telefónica Investigación y Desarrollo, S.A.U.
This file is part of Toolium.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/lic... | Add unittests to test environment.py methods# -*- coding: utf-8 -*-
u"""
Copyright 2016 Telefónica Investigación y Desarrollo, S.A.U.
This file is part of Toolium.
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 t... | <commit_before><commit_msg>Add unittests to test environment.py methods<commit_after># -*- coding: utf-8 -*-
u"""
Copyright 2016 Telefónica Investigación y Desarrollo, S.A.U.
This file is part of Toolium.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance wit... | |
c43000d2f9ec20a1c0cdbbec86270d88acb36104 | bench_examples/sparqlstore.py | bench_examples/sparqlstore.py | from ktbs_bench.graph_store import GraphStore
import rdflib
rdflib.plugin.register('BN', rdflib.store.Store, 'ktbs_bench.bnsparqlstore', 'SPARQLUpdateStore')
def get_sparqlstore(query_endpoint, update_endpoint, identifier="http://localhost/generic_sparqlstore/"):
triple_store = GraphStore(store='BN', identifier=... | Add implementation of more generic store calls | Add implementation of more generic store calls
| Python | mit | ktbs/ktbs-bench,ktbs/ktbs-bench | Add implementation of more generic store calls | from ktbs_bench.graph_store import GraphStore
import rdflib
rdflib.plugin.register('BN', rdflib.store.Store, 'ktbs_bench.bnsparqlstore', 'SPARQLUpdateStore')
def get_sparqlstore(query_endpoint, update_endpoint, identifier="http://localhost/generic_sparqlstore/"):
triple_store = GraphStore(store='BN', identifier=... | <commit_before><commit_msg>Add implementation of more generic store calls<commit_after> | from ktbs_bench.graph_store import GraphStore
import rdflib
rdflib.plugin.register('BN', rdflib.store.Store, 'ktbs_bench.bnsparqlstore', 'SPARQLUpdateStore')
def get_sparqlstore(query_endpoint, update_endpoint, identifier="http://localhost/generic_sparqlstore/"):
triple_store = GraphStore(store='BN', identifier=... | Add implementation of more generic store callsfrom ktbs_bench.graph_store import GraphStore
import rdflib
rdflib.plugin.register('BN', rdflib.store.Store, 'ktbs_bench.bnsparqlstore', 'SPARQLUpdateStore')
def get_sparqlstore(query_endpoint, update_endpoint, identifier="http://localhost/generic_sparqlstore/"):
tri... | <commit_before><commit_msg>Add implementation of more generic store calls<commit_after>from ktbs_bench.graph_store import GraphStore
import rdflib
rdflib.plugin.register('BN', rdflib.store.Store, 'ktbs_bench.bnsparqlstore', 'SPARQLUpdateStore')
def get_sparqlstore(query_endpoint, update_endpoint, identifier="http://... | |
a6c96caa1392868402be9f89db034ef664a12bda | utils.py | utils.py | import datetime
import flask
import functools
from app import app
# Use dateutil if available
try:
from dateutil import parser as dateutil
except ImportError:
dateutil = None
class GameTime(object):
@classmethod
def setup(cls):
"""Get start and end time."""
cls.start, cls.end = app.config.get('GAME_T... | Add open time range support. | Add open time range support.
| Python | apache-2.0 | google/ctfscoreboard,google/ctfscoreboard,google/ctfscoreboard,google/ctfscoreboard | Add open time range support. | import datetime
import flask
import functools
from app import app
# Use dateutil if available
try:
from dateutil import parser as dateutil
except ImportError:
dateutil = None
class GameTime(object):
@classmethod
def setup(cls):
"""Get start and end time."""
cls.start, cls.end = app.config.get('GAME_T... | <commit_before><commit_msg>Add open time range support.<commit_after> | import datetime
import flask
import functools
from app import app
# Use dateutil if available
try:
from dateutil import parser as dateutil
except ImportError:
dateutil = None
class GameTime(object):
@classmethod
def setup(cls):
"""Get start and end time."""
cls.start, cls.end = app.config.get('GAME_T... | Add open time range support.import datetime
import flask
import functools
from app import app
# Use dateutil if available
try:
from dateutil import parser as dateutil
except ImportError:
dateutil = None
class GameTime(object):
@classmethod
def setup(cls):
"""Get start and end time."""
cls.start, cls.... | <commit_before><commit_msg>Add open time range support.<commit_after>import datetime
import flask
import functools
from app import app
# Use dateutil if available
try:
from dateutil import parser as dateutil
except ImportError:
dateutil = None
class GameTime(object):
@classmethod
def setup(cls):
"""Get s... | |
68babe2de9a8204c46ad23e1c82dd0ff8fe44c94 | pyarm/tests/test_plot_figs.py | pyarm/tests/test_plot_figs.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010 Jérémie DECOCK (http://www.jdhp.org)
import unittest
import os
import sys
dirname = os.path.dirname(__file__)
if dirname == '':
dirname = '.'
dirname = os.path.realpath(dirname)
updir = os.path.split(dirname)[0]
if updir not in sys.path:
sys... | Add a unittest on plot_figs module. | Add a unittest on plot_figs module. | Python | mit | jeremiedecock/pyarm,jeremiedecock/pyarm | Add a unittest on plot_figs module. | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010 Jérémie DECOCK (http://www.jdhp.org)
import unittest
import os
import sys
dirname = os.path.dirname(__file__)
if dirname == '':
dirname = '.'
dirname = os.path.realpath(dirname)
updir = os.path.split(dirname)[0]
if updir not in sys.path:
sys... | <commit_before><commit_msg>Add a unittest on plot_figs module.<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010 Jérémie DECOCK (http://www.jdhp.org)
import unittest
import os
import sys
dirname = os.path.dirname(__file__)
if dirname == '':
dirname = '.'
dirname = os.path.realpath(dirname)
updir = os.path.split(dirname)[0]
if updir not in sys.path:
sys... | Add a unittest on plot_figs module.#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010 Jérémie DECOCK (http://www.jdhp.org)
import unittest
import os
import sys
dirname = os.path.dirname(__file__)
if dirname == '':
dirname = '.'
dirname = os.path.realpath(dirname)
updir = os.path.split(dirname)[0... | <commit_before><commit_msg>Add a unittest on plot_figs module.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010 Jérémie DECOCK (http://www.jdhp.org)
import unittest
import os
import sys
dirname = os.path.dirname(__file__)
if dirname == '':
dirname = '.'
dirname = os.path.realpath(... | |
a383d1220c31f153a5519e4aab4703db2b71ef53 | analysis/_goal_leaders.py | analysis/_goal_leaders.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
from lxml import html
SEASON_URL_TEMPLATE = "http://www.hockey-reference.com/leagues/NHL_%d.html"
CAREER_GOAL_LEADERS_URL = "http://www.hockey-reference.com/leaders/goals_career.html"
season_goal_leaders = set()
for year in range(1918, 2017)[:0]:
... | Add initial version of season goal leader retrieval | Add initial version of season goal leader retrieval
| Python | mit | leaffan/pynhldb | Add initial version of season goal leader retrieval | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
from lxml import html
SEASON_URL_TEMPLATE = "http://www.hockey-reference.com/leagues/NHL_%d.html"
CAREER_GOAL_LEADERS_URL = "http://www.hockey-reference.com/leaders/goals_career.html"
season_goal_leaders = set()
for year in range(1918, 2017)[:0]:
... | <commit_before><commit_msg>Add initial version of season goal leader retrieval<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
from lxml import html
SEASON_URL_TEMPLATE = "http://www.hockey-reference.com/leagues/NHL_%d.html"
CAREER_GOAL_LEADERS_URL = "http://www.hockey-reference.com/leaders/goals_career.html"
season_goal_leaders = set()
for year in range(1918, 2017)[:0]:
... | Add initial version of season goal leader retrieval#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
from lxml import html
SEASON_URL_TEMPLATE = "http://www.hockey-reference.com/leagues/NHL_%d.html"
CAREER_GOAL_LEADERS_URL = "http://www.hockey-reference.com/leaders/goals_career.html"
season_goal_leader... | <commit_before><commit_msg>Add initial version of season goal leader retrieval<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
from lxml import html
SEASON_URL_TEMPLATE = "http://www.hockey-reference.com/leagues/NHL_%d.html"
CAREER_GOAL_LEADERS_URL = "http://www.hockey-reference.com/leader... | |
37b175b6a6ac3f0fd7fdaa5c2ed6435c159a29c2 | py/optimal-division.py | py/optimal-division.py | from fractions import Fraction
class Solution(object):
def optimalDivision(self, nums):
"""
:type nums: List[int]
:rtype: str
"""
min_result, max_result = dict(), dict()
min_offset, max_offset = dict(), dict()
lnums = len(nums)
def print_ans(start, end... | Add py solution for 553. Optimal Division | Add py solution for 553. Optimal Division
553. Optimal Division: https://leetcode.com/problems/optimal-division/
Approach1
Bottom-up DP
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 553. Optimal Division
553. Optimal Division: https://leetcode.com/problems/optimal-division/
Approach1
Bottom-up DP | from fractions import Fraction
class Solution(object):
def optimalDivision(self, nums):
"""
:type nums: List[int]
:rtype: str
"""
min_result, max_result = dict(), dict()
min_offset, max_offset = dict(), dict()
lnums = len(nums)
def print_ans(start, end... | <commit_before><commit_msg>Add py solution for 553. Optimal Division
553. Optimal Division: https://leetcode.com/problems/optimal-division/
Approach1
Bottom-up DP<commit_after> | from fractions import Fraction
class Solution(object):
def optimalDivision(self, nums):
"""
:type nums: List[int]
:rtype: str
"""
min_result, max_result = dict(), dict()
min_offset, max_offset = dict(), dict()
lnums = len(nums)
def print_ans(start, end... | Add py solution for 553. Optimal Division
553. Optimal Division: https://leetcode.com/problems/optimal-division/
Approach1
Bottom-up DPfrom fractions import Fraction
class Solution(object):
def optimalDivision(self, nums):
"""
:type nums: List[int]
:rtype: str
"""
min_r... | <commit_before><commit_msg>Add py solution for 553. Optimal Division
553. Optimal Division: https://leetcode.com/problems/optimal-division/
Approach1
Bottom-up DP<commit_after>from fractions import Fraction
class Solution(object):
def optimalDivision(self, nums):
"""
:type nums: List[int]
... | |
54afce985f7f24e74cd5796e12e3c5f2c4616590 | etc/gen-test-dump.py | etc/gen-test-dump.py | #!/usr/bin/env python
import random
WORLDS = [None] * 8 + ['world', 'world_nether', 'creative', 'hardcore']
REGIONS = [None] * 20 + ['Region%d' % i for i in range(10)]
NUM_PLAYERS = 100
NUM_PERMISSIONS_PER_PLAYER = 50
NUM_GROUPS = (3, 13, 23, 31, 41)
NUM_PERMISSIONS_PER_GROUP = 50
NUM_PLAYERS_PER_GROUP = 50
P... | Add Python script to generate (huge) test dumps. | Add Python script to generate (huge) test dumps.
| Python | apache-2.0 | CoolV1994/zPermissions,TWSSYesterday/zPermissions,TWSSYesterday/zPermissions,CoolV1994/zPermissions,ZerothAngel/zPermissions,ZerothAngel/zPermissions | Add Python script to generate (huge) test dumps. | #!/usr/bin/env python
import random
WORLDS = [None] * 8 + ['world', 'world_nether', 'creative', 'hardcore']
REGIONS = [None] * 20 + ['Region%d' % i for i in range(10)]
NUM_PLAYERS = 100
NUM_PERMISSIONS_PER_PLAYER = 50
NUM_GROUPS = (3, 13, 23, 31, 41)
NUM_PERMISSIONS_PER_GROUP = 50
NUM_PLAYERS_PER_GROUP = 50
P... | <commit_before><commit_msg>Add Python script to generate (huge) test dumps.<commit_after> | #!/usr/bin/env python
import random
WORLDS = [None] * 8 + ['world', 'world_nether', 'creative', 'hardcore']
REGIONS = [None] * 20 + ['Region%d' % i for i in range(10)]
NUM_PLAYERS = 100
NUM_PERMISSIONS_PER_PLAYER = 50
NUM_GROUPS = (3, 13, 23, 31, 41)
NUM_PERMISSIONS_PER_GROUP = 50
NUM_PLAYERS_PER_GROUP = 50
P... | Add Python script to generate (huge) test dumps.#!/usr/bin/env python
import random
WORLDS = [None] * 8 + ['world', 'world_nether', 'creative', 'hardcore']
REGIONS = [None] * 20 + ['Region%d' % i for i in range(10)]
NUM_PLAYERS = 100
NUM_PERMISSIONS_PER_PLAYER = 50
NUM_GROUPS = (3, 13, 23, 31, 41)
NUM_PERMISSIO... | <commit_before><commit_msg>Add Python script to generate (huge) test dumps.<commit_after>#!/usr/bin/env python
import random
WORLDS = [None] * 8 + ['world', 'world_nether', 'creative', 'hardcore']
REGIONS = [None] * 20 + ['Region%d' % i for i in range(10)]
NUM_PLAYERS = 100
NUM_PERMISSIONS_PER_PLAYER = 50
NUM_GR... | |
f264a4a15682467549326cc530c152f647bf7832 | replace_imports.py | replace_imports.py | from __future__ import with_statement
import os
file_contents = {}
file_imports = {}
def get_file(file_name):
if file_name[-2:] != '.v': file_name += '.v'
if file_name not in file_contents.keys():
print(file_name)
try:
with open(file_name, 'r', encoding='UTF-8') as f:
... | Add a convenience python script to inline the imports of a file. | Add a convenience python script to inline the imports of a file.
Useful for making files to trim down into minimal test cases.
| Python | mit | JasonGross/catdb,CategoricalData/catdb,CategoricalData/catdb,JasonGross/catdb | Add a convenience python script to inline the imports of a file.
Useful for making files to trim down into minimal test cases. | from __future__ import with_statement
import os
file_contents = {}
file_imports = {}
def get_file(file_name):
if file_name[-2:] != '.v': file_name += '.v'
if file_name not in file_contents.keys():
print(file_name)
try:
with open(file_name, 'r', encoding='UTF-8') as f:
... | <commit_before><commit_msg>Add a convenience python script to inline the imports of a file.
Useful for making files to trim down into minimal test cases.<commit_after> | from __future__ import with_statement
import os
file_contents = {}
file_imports = {}
def get_file(file_name):
if file_name[-2:] != '.v': file_name += '.v'
if file_name not in file_contents.keys():
print(file_name)
try:
with open(file_name, 'r', encoding='UTF-8') as f:
... | Add a convenience python script to inline the imports of a file.
Useful for making files to trim down into minimal test cases.from __future__ import with_statement
import os
file_contents = {}
file_imports = {}
def get_file(file_name):
if file_name[-2:] != '.v': file_name += '.v'
if file_name not in ... | <commit_before><commit_msg>Add a convenience python script to inline the imports of a file.
Useful for making files to trim down into minimal test cases.<commit_after>from __future__ import with_statement
import os
file_contents = {}
file_imports = {}
def get_file(file_name):
if file_name[-2:] != '.v': fi... | |
cdefa248cb481f8b8a676fd674a4290f95d15145 | fix_mp4_timestamp.py | fix_mp4_timestamp.py | #!/usr/bin/env python3
import datetime
import shutil
import gpmf.extract
import gpmf.parse
import hachoir.editor
import hachoir.parser
import hachoir.stream
from hachoir.field import MissingField
def locate_fields_by_subpath(parser, subpath):
"""Locate mp4 fields by their subpath element name"""
def recursiv... | Add tool to fix MP4 file timestamp from GPMF GPS clock | Add tool to fix MP4 file timestamp from GPMF GPS clock
| Python | mit | rambo/python-gpmf,rambo/python-gpmf | Add tool to fix MP4 file timestamp from GPMF GPS clock | #!/usr/bin/env python3
import datetime
import shutil
import gpmf.extract
import gpmf.parse
import hachoir.editor
import hachoir.parser
import hachoir.stream
from hachoir.field import MissingField
def locate_fields_by_subpath(parser, subpath):
"""Locate mp4 fields by their subpath element name"""
def recursiv... | <commit_before><commit_msg>Add tool to fix MP4 file timestamp from GPMF GPS clock<commit_after> | #!/usr/bin/env python3
import datetime
import shutil
import gpmf.extract
import gpmf.parse
import hachoir.editor
import hachoir.parser
import hachoir.stream
from hachoir.field import MissingField
def locate_fields_by_subpath(parser, subpath):
"""Locate mp4 fields by their subpath element name"""
def recursiv... | Add tool to fix MP4 file timestamp from GPMF GPS clock#!/usr/bin/env python3
import datetime
import shutil
import gpmf.extract
import gpmf.parse
import hachoir.editor
import hachoir.parser
import hachoir.stream
from hachoir.field import MissingField
def locate_fields_by_subpath(parser, subpath):
"""Locate mp4 fi... | <commit_before><commit_msg>Add tool to fix MP4 file timestamp from GPMF GPS clock<commit_after>#!/usr/bin/env python3
import datetime
import shutil
import gpmf.extract
import gpmf.parse
import hachoir.editor
import hachoir.parser
import hachoir.stream
from hachoir.field import MissingField
def locate_fields_by_subpa... | |
08e52c671ef405c34e532f1ca29e7fc2ee6892d9 | viewcwl-json.py | viewcwl-json.py | #!/usr/bin/env python
import fnmatch
import requests
import time
import os
import glob
# You can alternatively define these in travis.yml as env vars or arguments
BASE_URL = 'https://view.commonwl.org'
WORKFLOW_PATH = '/workflows/workflow.cwl'
#get the cwl in l7g/cwl-version
matches = []
for root, dirnames, filename... | Add python script that should submit to view.cwl API | Add python script that should submit to view.cwl API
Arvados-DCO-1.1-Signed-off-by: Benjamin Carr <ben@curii.com>
| Python | agpl-3.0 | curoverse/l7g,curoverse/l7g,curoverse/l7g,curoverse/l7g,curoverse/l7g,curoverse/l7g,curoverse/l7g | Add python script that should submit to view.cwl API
Arvados-DCO-1.1-Signed-off-by: Benjamin Carr <ben@curii.com> | #!/usr/bin/env python
import fnmatch
import requests
import time
import os
import glob
# You can alternatively define these in travis.yml as env vars or arguments
BASE_URL = 'https://view.commonwl.org'
WORKFLOW_PATH = '/workflows/workflow.cwl'
#get the cwl in l7g/cwl-version
matches = []
for root, dirnames, filename... | <commit_before><commit_msg>Add python script that should submit to view.cwl API
Arvados-DCO-1.1-Signed-off-by: Benjamin Carr <ben@curii.com><commit_after> | #!/usr/bin/env python
import fnmatch
import requests
import time
import os
import glob
# You can alternatively define these in travis.yml as env vars or arguments
BASE_URL = 'https://view.commonwl.org'
WORKFLOW_PATH = '/workflows/workflow.cwl'
#get the cwl in l7g/cwl-version
matches = []
for root, dirnames, filename... | Add python script that should submit to view.cwl API
Arvados-DCO-1.1-Signed-off-by: Benjamin Carr <ben@curii.com>#!/usr/bin/env python
import fnmatch
import requests
import time
import os
import glob
# You can alternatively define these in travis.yml as env vars or arguments
BASE_URL = 'https://view.commonwl.org'
WO... | <commit_before><commit_msg>Add python script that should submit to view.cwl API
Arvados-DCO-1.1-Signed-off-by: Benjamin Carr <ben@curii.com><commit_after>#!/usr/bin/env python
import fnmatch
import requests
import time
import os
import glob
# You can alternatively define these in travis.yml as env vars or arguments
... | |
48bfe2d20cca35885ad0a460679d0a951d0c584e | locations/spiders/gianteagle.py | locations/spiders/gianteagle.py | # -*- coding: utf-8 -*-
import json
import re
import scrapy
from locations.items import GeojsonPointItem
from locations.hours import OpeningHours
DAY_MAPPING = {
1: "Su",
2: "Mo",
3: "Tu",
4: "We",
5: "Th",
6: "Fr",
7: "Sa"
}
class GiantEagleSpider(scrapy.Spider):
name = "gianteagle... | Add spider for Giant Eagle | Add spider for Giant Eagle
| Python | mit | iandees/all-the-places,iandees/all-the-places,iandees/all-the-places | Add spider for Giant Eagle | # -*- coding: utf-8 -*-
import json
import re
import scrapy
from locations.items import GeojsonPointItem
from locations.hours import OpeningHours
DAY_MAPPING = {
1: "Su",
2: "Mo",
3: "Tu",
4: "We",
5: "Th",
6: "Fr",
7: "Sa"
}
class GiantEagleSpider(scrapy.Spider):
name = "gianteagle... | <commit_before><commit_msg>Add spider for Giant Eagle<commit_after> | # -*- coding: utf-8 -*-
import json
import re
import scrapy
from locations.items import GeojsonPointItem
from locations.hours import OpeningHours
DAY_MAPPING = {
1: "Su",
2: "Mo",
3: "Tu",
4: "We",
5: "Th",
6: "Fr",
7: "Sa"
}
class GiantEagleSpider(scrapy.Spider):
name = "gianteagle... | Add spider for Giant Eagle# -*- coding: utf-8 -*-
import json
import re
import scrapy
from locations.items import GeojsonPointItem
from locations.hours import OpeningHours
DAY_MAPPING = {
1: "Su",
2: "Mo",
3: "Tu",
4: "We",
5: "Th",
6: "Fr",
7: "Sa"
}
class GiantEagleSpider(scrapy.Spide... | <commit_before><commit_msg>Add spider for Giant Eagle<commit_after># -*- coding: utf-8 -*-
import json
import re
import scrapy
from locations.items import GeojsonPointItem
from locations.hours import OpeningHours
DAY_MAPPING = {
1: "Su",
2: "Mo",
3: "Tu",
4: "We",
5: "Th",
6: "Fr",
7: "Sa... | |
2ab796aeb53e650b8a1dd828b5daaca16850d9c3 | zerver/tests/test_push_notifications.py | zerver/tests/test_push_notifications.py | import mock
from django.test import TestCase
from django.conf import settings
from zerver.models import PushDeviceToken, UserProfile
from zerver.models import get_user_profile_by_email
from zerver.lib import push_notifications as apn
from zerver.lib.redis_utils import get_redis_client
class PushNotificationTest(Tes... | Add tests for APNS message. | Add tests for APNS message.
| Python | apache-2.0 | hackerkid/zulip,ahmadassaf/zulip,vaidap/zulip,peguin40/zulip,AZtheAsian/zulip,dhcrzf/zulip,brainwane/zulip,ahmadassaf/zulip,rishig/zulip,sharmaeklavya2/zulip,dattatreya303/zulip,calvinleenyc/zulip,jphilipsen05/zulip,j831/zulip,sonali0901/zulip,eeshangarg/zulip,synicalsyntax/zulip,jrowan/zulip,punchagan/zulip,verma-vars... | Add tests for APNS message. | import mock
from django.test import TestCase
from django.conf import settings
from zerver.models import PushDeviceToken, UserProfile
from zerver.models import get_user_profile_by_email
from zerver.lib import push_notifications as apn
from zerver.lib.redis_utils import get_redis_client
class PushNotificationTest(Tes... | <commit_before><commit_msg>Add tests for APNS message.<commit_after> | import mock
from django.test import TestCase
from django.conf import settings
from zerver.models import PushDeviceToken, UserProfile
from zerver.models import get_user_profile_by_email
from zerver.lib import push_notifications as apn
from zerver.lib.redis_utils import get_redis_client
class PushNotificationTest(Tes... | Add tests for APNS message.import mock
from django.test import TestCase
from django.conf import settings
from zerver.models import PushDeviceToken, UserProfile
from zerver.models import get_user_profile_by_email
from zerver.lib import push_notifications as apn
from zerver.lib.redis_utils import get_redis_client
cla... | <commit_before><commit_msg>Add tests for APNS message.<commit_after>import mock
from django.test import TestCase
from django.conf import settings
from zerver.models import PushDeviceToken, UserProfile
from zerver.models import get_user_profile_by_email
from zerver.lib import push_notifications as apn
from zerver.lib.... | |
846ce88f199381387f612463da51c6b17281dd21 | scripts/check_python3_compatibility.py | scripts/check_python3_compatibility.py | #!/usr/bin/env python
#
# Copyright 2021 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Check for Python scripts which are incompatible with Python 3."""
import ast
import os
import subprocess
import sys
def check_file(fp):
content = open(f... | Add script for checking Python3 compatibility | Add script for checking Python3 compatibility
Note that it only actually works as intended if it's run using Python3.
Change-Id: Ic41ea54e2d1eceabacfcfbb935ac1d029e563645
Reviewed-on: https://skia-review.googlesource.com/c/buildbot/+/387136
Reviewed-by: Joe Gregorio <b9cf2471ff6d33504cafe8e6f356b732b2cadced@google.co... | Python | bsd-3-clause | google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot | Add script for checking Python3 compatibility
Note that it only actually works as intended if it's run using Python3.
Change-Id: Ic41ea54e2d1eceabacfcfbb935ac1d029e563645
Reviewed-on: https://skia-review.googlesource.com/c/buildbot/+/387136
Reviewed-by: Joe Gregorio <b9cf2471ff6d33504cafe8e6f356b732b2cadced@google.co... | #!/usr/bin/env python
#
# Copyright 2021 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Check for Python scripts which are incompatible with Python 3."""
import ast
import os
import subprocess
import sys
def check_file(fp):
content = open(f... | <commit_before><commit_msg>Add script for checking Python3 compatibility
Note that it only actually works as intended if it's run using Python3.
Change-Id: Ic41ea54e2d1eceabacfcfbb935ac1d029e563645
Reviewed-on: https://skia-review.googlesource.com/c/buildbot/+/387136
Reviewed-by: Joe Gregorio <b9cf2471ff6d33504cafe8e... | #!/usr/bin/env python
#
# Copyright 2021 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Check for Python scripts which are incompatible with Python 3."""
import ast
import os
import subprocess
import sys
def check_file(fp):
content = open(f... | Add script for checking Python3 compatibility
Note that it only actually works as intended if it's run using Python3.
Change-Id: Ic41ea54e2d1eceabacfcfbb935ac1d029e563645
Reviewed-on: https://skia-review.googlesource.com/c/buildbot/+/387136
Reviewed-by: Joe Gregorio <b9cf2471ff6d33504cafe8e6f356b732b2cadced@google.co... | <commit_before><commit_msg>Add script for checking Python3 compatibility
Note that it only actually works as intended if it's run using Python3.
Change-Id: Ic41ea54e2d1eceabacfcfbb935ac1d029e563645
Reviewed-on: https://skia-review.googlesource.com/c/buildbot/+/387136
Reviewed-by: Joe Gregorio <b9cf2471ff6d33504cafe8e... | |
e3665928c80da9df192f8edb5dc28e3200e34fdc | toolbot/scripts/google_images.py | toolbot/scripts/google_images.py | import re
import json
import asyncio
import random
import aiohttp
GOOGLE_IMAGE_API = 'http://ajax.googleapis.com/ajax/services/search/images'
def plugin(bot):
@bot.respond(re.compile(r'(image|img)( me)? (.*)', re.I))
def image_me(msg):
asyncio.Task(imageMe(msg, msg.match.group(3), cb=msg.reply))
@... | Add a "image me [thing]" handler | Add a "image me [thing]" handler
| Python | mit | tgerdes/toolbot,tgerdes/toolbot | Add a "image me [thing]" handler | import re
import json
import asyncio
import random
import aiohttp
GOOGLE_IMAGE_API = 'http://ajax.googleapis.com/ajax/services/search/images'
def plugin(bot):
@bot.respond(re.compile(r'(image|img)( me)? (.*)', re.I))
def image_me(msg):
asyncio.Task(imageMe(msg, msg.match.group(3), cb=msg.reply))
@... | <commit_before><commit_msg>Add a "image me [thing]" handler<commit_after> | import re
import json
import asyncio
import random
import aiohttp
GOOGLE_IMAGE_API = 'http://ajax.googleapis.com/ajax/services/search/images'
def plugin(bot):
@bot.respond(re.compile(r'(image|img)( me)? (.*)', re.I))
def image_me(msg):
asyncio.Task(imageMe(msg, msg.match.group(3), cb=msg.reply))
@... | Add a "image me [thing]" handlerimport re
import json
import asyncio
import random
import aiohttp
GOOGLE_IMAGE_API = 'http://ajax.googleapis.com/ajax/services/search/images'
def plugin(bot):
@bot.respond(re.compile(r'(image|img)( me)? (.*)', re.I))
def image_me(msg):
asyncio.Task(imageMe(msg, msg.ma... | <commit_before><commit_msg>Add a "image me [thing]" handler<commit_after>import re
import json
import asyncio
import random
import aiohttp
GOOGLE_IMAGE_API = 'http://ajax.googleapis.com/ajax/services/search/images'
def plugin(bot):
@bot.respond(re.compile(r'(image|img)( me)? (.*)', re.I))
def image_me(msg):... | |
ef8d86704c0930091b8b8f07842e46ffff5bfc34 | correct_empty_lines.py | correct_empty_lines.py | print('\n\n\n\n')
print('Now:\n')
for p in c.all_positions():
try:
# Corrects empty lines around @language python\n@tabwidth -4
if p.h.startswith('@clean') and p.h.endswith('py'):
# Corrects empty lines after @first
if p.h == '@clean manage.py':
splited = p.... | Correct empty lines in imported files | Correct empty lines in imported files
| Python | mit | benzolius/leo-scripts | Correct empty lines in imported files | print('\n\n\n\n')
print('Now:\n')
for p in c.all_positions():
try:
# Corrects empty lines around @language python\n@tabwidth -4
if p.h.startswith('@clean') and p.h.endswith('py'):
# Corrects empty lines after @first
if p.h == '@clean manage.py':
splited = p.... | <commit_before><commit_msg>Correct empty lines in imported files<commit_after> | print('\n\n\n\n')
print('Now:\n')
for p in c.all_positions():
try:
# Corrects empty lines around @language python\n@tabwidth -4
if p.h.startswith('@clean') and p.h.endswith('py'):
# Corrects empty lines after @first
if p.h == '@clean manage.py':
splited = p.... | Correct empty lines in imported filesprint('\n\n\n\n')
print('Now:\n')
for p in c.all_positions():
try:
# Corrects empty lines around @language python\n@tabwidth -4
if p.h.startswith('@clean') and p.h.endswith('py'):
# Corrects empty lines after @first
if p.h == '@clean man... | <commit_before><commit_msg>Correct empty lines in imported files<commit_after>print('\n\n\n\n')
print('Now:\n')
for p in c.all_positions():
try:
# Corrects empty lines around @language python\n@tabwidth -4
if p.h.startswith('@clean') and p.h.endswith('py'):
# Corrects empty lines after... | |
43fbaa6c109c51a77832d6f09e0543794882b518 | scripts/contrib/model_info.py | scripts/contrib/model_info.py | #!/usr/bin/env python3
import sys
import argparse
import numpy as np
import yaml
DESC = "Prints version and model type from model.npz file."
S2S_SPECIAL_NODE = "special:model.yml"
def main():
args = parse_args()
model = np.load(args.model)
if S2S_SPECIAL_NODE not in model:
print("No special Ma... | Add scripts printing special:mode.yml from model.npz | Add scripts printing special:mode.yml from model.npz
| Python | mit | marian-nmt/marian-train,marian-nmt/marian-train,emjotde/Marian,marian-nmt/marian-train,emjotde/amunn,emjotde/amunmt,emjotde/Marian,marian-nmt/marian-train,emjotde/amunmt,amunmt/marian,emjotde/amunn,emjotde/amunmt,emjotde/amunn,amunmt/marian,emjotde/amunn,emjotde/amunmt,amunmt/marian,marian-nmt/marian-train | Add scripts printing special:mode.yml from model.npz | #!/usr/bin/env python3
import sys
import argparse
import numpy as np
import yaml
DESC = "Prints version and model type from model.npz file."
S2S_SPECIAL_NODE = "special:model.yml"
def main():
args = parse_args()
model = np.load(args.model)
if S2S_SPECIAL_NODE not in model:
print("No special Ma... | <commit_before><commit_msg>Add scripts printing special:mode.yml from model.npz<commit_after> | #!/usr/bin/env python3
import sys
import argparse
import numpy as np
import yaml
DESC = "Prints version and model type from model.npz file."
S2S_SPECIAL_NODE = "special:model.yml"
def main():
args = parse_args()
model = np.load(args.model)
if S2S_SPECIAL_NODE not in model:
print("No special Ma... | Add scripts printing special:mode.yml from model.npz#!/usr/bin/env python3
import sys
import argparse
import numpy as np
import yaml
DESC = "Prints version and model type from model.npz file."
S2S_SPECIAL_NODE = "special:model.yml"
def main():
args = parse_args()
model = np.load(args.model)
if S2S_SPE... | <commit_before><commit_msg>Add scripts printing special:mode.yml from model.npz<commit_after>#!/usr/bin/env python3
import sys
import argparse
import numpy as np
import yaml
DESC = "Prints version and model type from model.npz file."
S2S_SPECIAL_NODE = "special:model.yml"
def main():
args = parse_args()
m... | |
af5e58c2fefdffa8046ecace238a3fd1a2a43387 | ML/naivebayes.py | ML/naivebayes.py | """
Naive Bayes Classifier
Includes gaussian, bernoulli and multinomial models
"""
import abc
import numpy as np
class NaiveBayes:
"""
Naive Bayes Classifier
Given class label, assumes features are independent
"""
__metaclass__ = abc.ABCMeta
def __init__(self):
"""
Attributes... | Add Naive Bayes base class: | Add Naive Bayes base class:
| Python | mit | christopherjenness/ML-lib | Add Naive Bayes base class: | """
Naive Bayes Classifier
Includes gaussian, bernoulli and multinomial models
"""
import abc
import numpy as np
class NaiveBayes:
"""
Naive Bayes Classifier
Given class label, assumes features are independent
"""
__metaclass__ = abc.ABCMeta
def __init__(self):
"""
Attributes... | <commit_before><commit_msg>Add Naive Bayes base class:<commit_after> | """
Naive Bayes Classifier
Includes gaussian, bernoulli and multinomial models
"""
import abc
import numpy as np
class NaiveBayes:
"""
Naive Bayes Classifier
Given class label, assumes features are independent
"""
__metaclass__ = abc.ABCMeta
def __init__(self):
"""
Attributes... | Add Naive Bayes base class:"""
Naive Bayes Classifier
Includes gaussian, bernoulli and multinomial models
"""
import abc
import numpy as np
class NaiveBayes:
"""
Naive Bayes Classifier
Given class label, assumes features are independent
"""
__metaclass__ = abc.ABCMeta
def __init__(self):
... | <commit_before><commit_msg>Add Naive Bayes base class:<commit_after>"""
Naive Bayes Classifier
Includes gaussian, bernoulli and multinomial models
"""
import abc
import numpy as np
class NaiveBayes:
"""
Naive Bayes Classifier
Given class label, assumes features are independent
"""
__metaclass__ =... | |
ded9c39402ca9cf7adfaaebbf06c196048d48db9 | Source/bindings/PRESUBMIT.py | Source/bindings/PRESUBMIT.py | # Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | Add presubmit check for run-bindings-tests | Add presubmit check for run-bindings-tests
run-bindings-tests should be run (and succeed) for any changes to
Source/bindings. This is particularly important to make sure tests are
rebaselined when changes are made to the code generator.
This adds a PRESUBMIT.py script to do just that!
Checked that this worked by chan... | Python | bsd-3-clause | XiaosongWei/blink-crosswalk,PeterWangIntel/blink-crosswalk,crosswalk-project/blink-crosswalk-efl,XiaosongWei/blink-crosswalk,Pluto-tv/blink-crosswalk,Bysmyyr/blink-crosswalk,modulexcite/blink,ondra-novak/blink,nwjs/blink,kurli/blink-crosswalk,PeterWangIntel/blink-crosswalk,Pluto-tv/blink-crosswalk,crosswalk-project/bli... | Add presubmit check for run-bindings-tests
run-bindings-tests should be run (and succeed) for any changes to
Source/bindings. This is particularly important to make sure tests are
rebaselined when changes are made to the code generator.
This adds a PRESUBMIT.py script to do just that!
Checked that this worked by chan... | # Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | <commit_before><commit_msg>Add presubmit check for run-bindings-tests
run-bindings-tests should be run (and succeed) for any changes to
Source/bindings. This is particularly important to make sure tests are
rebaselined when changes are made to the code generator.
This adds a PRESUBMIT.py script to do just that!
Check... | # Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | Add presubmit check for run-bindings-tests
run-bindings-tests should be run (and succeed) for any changes to
Source/bindings. This is particularly important to make sure tests are
rebaselined when changes are made to the code generator.
This adds a PRESUBMIT.py script to do just that!
Checked that this worked by chan... | <commit_before><commit_msg>Add presubmit check for run-bindings-tests
run-bindings-tests should be run (and succeed) for any changes to
Source/bindings. This is particularly important to make sure tests are
rebaselined when changes are made to the code generator.
This adds a PRESUBMIT.py script to do just that!
Check... | |
fbd179d9d22a2eef6c2fb24152a441b85133e556 | lowfat/utils.py | lowfat/utils.py | """
This module contains small utility classes and functions which do not clearly belong to one part of the project.
"""
import enum
class ChoicesEnum(enum.Enum):
"""
Abstract Enum class to represent values in a Django CharField choices.
"""
@classmethod
def choices(cls):
"""
Get ... | Add missing component of previous commit | Add missing component of previous commit
| Python | bsd-3-clause | softwaresaved/fat,softwaresaved/fat,softwaresaved/fat,softwaresaved/fat | Add missing component of previous commit | """
This module contains small utility classes and functions which do not clearly belong to one part of the project.
"""
import enum
class ChoicesEnum(enum.Enum):
"""
Abstract Enum class to represent values in a Django CharField choices.
"""
@classmethod
def choices(cls):
"""
Get ... | <commit_before><commit_msg>Add missing component of previous commit<commit_after> | """
This module contains small utility classes and functions which do not clearly belong to one part of the project.
"""
import enum
class ChoicesEnum(enum.Enum):
"""
Abstract Enum class to represent values in a Django CharField choices.
"""
@classmethod
def choices(cls):
"""
Get ... | Add missing component of previous commit"""
This module contains small utility classes and functions which do not clearly belong to one part of the project.
"""
import enum
class ChoicesEnum(enum.Enum):
"""
Abstract Enum class to represent values in a Django CharField choices.
"""
@classmethod
de... | <commit_before><commit_msg>Add missing component of previous commit<commit_after>"""
This module contains small utility classes and functions which do not clearly belong to one part of the project.
"""
import enum
class ChoicesEnum(enum.Enum):
"""
Abstract Enum class to represent values in a Django CharField... | |
9140b3249820d0dd86f7f85270327d9264841b50 | tests/search_backend_mysql.py | tests/search_backend_mysql.py | from wolis.test_case import WolisTestCase
from wolis import utils
class SearchBackendMysqlTest(WolisTestCase):
@utils.restrict_database('mysql*')
@utils.restrict_phpbb_version('>=3.1.0')
def test_set_search_backend(self):
self.login('morpheus', 'morpheus')
self.acp_login('morpheus', 'morphe... | Test for selecting mysql search backend | Test for selecting mysql search backend
| Python | bsd-2-clause | p/wolis-phpbb,p/wolis-phpbb | Test for selecting mysql search backend | from wolis.test_case import WolisTestCase
from wolis import utils
class SearchBackendMysqlTest(WolisTestCase):
@utils.restrict_database('mysql*')
@utils.restrict_phpbb_version('>=3.1.0')
def test_set_search_backend(self):
self.login('morpheus', 'morpheus')
self.acp_login('morpheus', 'morphe... | <commit_before><commit_msg>Test for selecting mysql search backend<commit_after> | from wolis.test_case import WolisTestCase
from wolis import utils
class SearchBackendMysqlTest(WolisTestCase):
@utils.restrict_database('mysql*')
@utils.restrict_phpbb_version('>=3.1.0')
def test_set_search_backend(self):
self.login('morpheus', 'morpheus')
self.acp_login('morpheus', 'morphe... | Test for selecting mysql search backendfrom wolis.test_case import WolisTestCase
from wolis import utils
class SearchBackendMysqlTest(WolisTestCase):
@utils.restrict_database('mysql*')
@utils.restrict_phpbb_version('>=3.1.0')
def test_set_search_backend(self):
self.login('morpheus', 'morpheus')
... | <commit_before><commit_msg>Test for selecting mysql search backend<commit_after>from wolis.test_case import WolisTestCase
from wolis import utils
class SearchBackendMysqlTest(WolisTestCase):
@utils.restrict_database('mysql*')
@utils.restrict_phpbb_version('>=3.1.0')
def test_set_search_backend(self):
... | |
ff82f56b8ea901a30478b11a61f8ca52b23346bd | test/BuildDir/guess-subdir.py | test/BuildDir/guess-subdir.py | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... | Add a test case for guessing the BuildDir associated with a subdirectory argument. | Add a test case for guessing the BuildDir associated with a subdirectory argument.
git-svn-id: 7892167f69f80ee5d3024affce49f20c74bcb41d@1394 fdb21ef1-2011-0410-befe-b5e4ea1792b1
| Python | mit | azverkan/scons,datalogics-robb/scons,datalogics/scons,datalogics/scons,datalogics-robb/scons,azverkan/scons,azverkan/scons,azverkan/scons,datalogics-robb/scons,azverkan/scons,datalogics/scons,datalogics/scons,datalogics-robb/scons | Add a test case for guessing the BuildDir associated with a subdirectory argument.
git-svn-id: 7892167f69f80ee5d3024affce49f20c74bcb41d@1394 fdb21ef1-2011-0410-befe-b5e4ea1792b1 | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... | <commit_before><commit_msg>Add a test case for guessing the BuildDir associated with a subdirectory argument.
git-svn-id: 7892167f69f80ee5d3024affce49f20c74bcb41d@1394 fdb21ef1-2011-0410-befe-b5e4ea1792b1<commit_after> | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... | Add a test case for guessing the BuildDir associated with a subdirectory argument.
git-svn-id: 7892167f69f80ee5d3024affce49f20c74bcb41d@1394 fdb21ef1-2011-0410-befe-b5e4ea1792b1#!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software a... | <commit_before><commit_msg>Add a test case for guessing the BuildDir associated with a subdirectory argument.
git-svn-id: 7892167f69f80ee5d3024affce49f20c74bcb41d@1394 fdb21ef1-2011-0410-befe-b5e4ea1792b1<commit_after>#!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any per... | |
ff187730fa1ebd64984dbb6e91a8f04edae84548 | ngx_task/cli.py | ngx_task/cli.py | import os
from concurrent.futures import ThreadPoolExecutor, as_completed
from ngx_task import settings, utils
def generate_data():
if not os.path.exists(settings.DATA_DIR):
os.mkdir(settings.DATA_DIR, 0o755)
files_to_submit = ['arc-{}.zip'.format(arc_num) for arc_num in range(1, 51)]
with Thre... | Introduce module for CLI commands; implement data generating command | Introduce module for CLI commands; implement data generating command
| Python | apache-2.0 | shudmi/ngx-task | Introduce module for CLI commands; implement data generating command | import os
from concurrent.futures import ThreadPoolExecutor, as_completed
from ngx_task import settings, utils
def generate_data():
if not os.path.exists(settings.DATA_DIR):
os.mkdir(settings.DATA_DIR, 0o755)
files_to_submit = ['arc-{}.zip'.format(arc_num) for arc_num in range(1, 51)]
with Thre... | <commit_before><commit_msg>Introduce module for CLI commands; implement data generating command<commit_after> | import os
from concurrent.futures import ThreadPoolExecutor, as_completed
from ngx_task import settings, utils
def generate_data():
if not os.path.exists(settings.DATA_DIR):
os.mkdir(settings.DATA_DIR, 0o755)
files_to_submit = ['arc-{}.zip'.format(arc_num) for arc_num in range(1, 51)]
with Thre... | Introduce module for CLI commands; implement data generating commandimport os
from concurrent.futures import ThreadPoolExecutor, as_completed
from ngx_task import settings, utils
def generate_data():
if not os.path.exists(settings.DATA_DIR):
os.mkdir(settings.DATA_DIR, 0o755)
files_to_submit = ['arc... | <commit_before><commit_msg>Introduce module for CLI commands; implement data generating command<commit_after>import os
from concurrent.futures import ThreadPoolExecutor, as_completed
from ngx_task import settings, utils
def generate_data():
if not os.path.exists(settings.DATA_DIR):
os.mkdir(settings.DATA... | |
2cc6edec8295a216261fff09388a35e0805f474c | tests/functional/test_service_names.py | tests/functional/test_service_names.py | # Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | Add test to validate service names | Add test to validate service names
| Python | apache-2.0 | pplu/botocore,boto/botocore | Add test to validate service names | # Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | <commit_before><commit_msg>Add test to validate service names<commit_after> | # Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | Add test to validate service names# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
... | <commit_before><commit_msg>Add test to validate service names<commit_after># Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located a... | |
6ad9b8e65562c00607fe0fe9f92cdba3c022ef2b | lms/djangoapps/student_account/teachfirst.py | lms/djangoapps/student_account/teachfirst.py | from django.conf import settings
from social_core.backends.oauth import BaseOAuth2
import logging
log = logging.getLogger(__name__)
class TeachFirstOAuth2(BaseOAuth2):
"""TeachFirst OAuth2 authentication backend."""
settings_dict = settings.CUSTOM_BACKENDS.get('teachfirst')
name = 'teachfirst-oauth2'
... | Add initial version Teach First Oauth2 backend. | Add initial version Teach First Oauth2 backend.
| Python | agpl-3.0 | proversity-org/edx-platform,proversity-org/edx-platform,proversity-org/edx-platform,proversity-org/edx-platform | Add initial version Teach First Oauth2 backend. | from django.conf import settings
from social_core.backends.oauth import BaseOAuth2
import logging
log = logging.getLogger(__name__)
class TeachFirstOAuth2(BaseOAuth2):
"""TeachFirst OAuth2 authentication backend."""
settings_dict = settings.CUSTOM_BACKENDS.get('teachfirst')
name = 'teachfirst-oauth2'
... | <commit_before><commit_msg>Add initial version Teach First Oauth2 backend.<commit_after> | from django.conf import settings
from social_core.backends.oauth import BaseOAuth2
import logging
log = logging.getLogger(__name__)
class TeachFirstOAuth2(BaseOAuth2):
"""TeachFirst OAuth2 authentication backend."""
settings_dict = settings.CUSTOM_BACKENDS.get('teachfirst')
name = 'teachfirst-oauth2'
... | Add initial version Teach First Oauth2 backend.from django.conf import settings
from social_core.backends.oauth import BaseOAuth2
import logging
log = logging.getLogger(__name__)
class TeachFirstOAuth2(BaseOAuth2):
"""TeachFirst OAuth2 authentication backend."""
settings_dict = settings.CUSTOM_BACKENDS.get('... | <commit_before><commit_msg>Add initial version Teach First Oauth2 backend.<commit_after>from django.conf import settings
from social_core.backends.oauth import BaseOAuth2
import logging
log = logging.getLogger(__name__)
class TeachFirstOAuth2(BaseOAuth2):
"""TeachFirst OAuth2 authentication backend."""
setti... | |
15daff9a7823ddd7dbc3fb6f141d539d6b636301 | project/timeslot/migrations/0008_auto_20160622_0937.py | project/timeslot/migrations/0008_auto_20160622_0937.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('timeslot', '0007_auto_20160616_0049'),
]
operations = [
migrations.AlterField(
model_name='config',
... | Add description field to Config | Add description field to Config
| Python | agpl-3.0 | Xicnet/radioflow-scheduler,Xicnet/radioflow-scheduler,Xicnet/radioflow-scheduler,Xicnet/radioflow-scheduler,Xicnet/radioflow-scheduler | Add description field to Config | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('timeslot', '0007_auto_20160616_0049'),
]
operations = [
migrations.AlterField(
model_name='config',
... | <commit_before><commit_msg>Add description field to Config<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('timeslot', '0007_auto_20160616_0049'),
]
operations = [
migrations.AlterField(
model_name='config',
... | Add description field to Config# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('timeslot', '0007_auto_20160616_0049'),
]
operations = [
migrations.AlterField(
mo... | <commit_before><commit_msg>Add description field to Config<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('timeslot', '0007_auto_20160616_0049'),
]
operations = [
... | |
757812e63c42f38ad065c31744427c5902a5d322 | data-preprocessor/listFile.py | data-preprocessor/listFile.py | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 11 10:23:38 2016
@author: SISQUAKE
"""
import os
def listFilePath(path):
File = [];
Dir = [];
for (dirpath, dirnames, filenames) in os.walk(path):
for name in filenames:
tmp = os.path.join(dirpath, name);
File.app... | Move some Utils outside of the main script. | Move some Utils outside of the main script.
| Python | mit | BrakeValve/dataflow,BrakeValve/brake-valve-server,BrakeValve/brake-valve-server,BrakeValve/dataflow | Move some Utils outside of the main script. | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 11 10:23:38 2016
@author: SISQUAKE
"""
import os
def listFilePath(path):
File = [];
Dir = [];
for (dirpath, dirnames, filenames) in os.walk(path):
for name in filenames:
tmp = os.path.join(dirpath, name);
File.app... | <commit_before><commit_msg>Move some Utils outside of the main script.<commit_after> | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 11 10:23:38 2016
@author: SISQUAKE
"""
import os
def listFilePath(path):
File = [];
Dir = [];
for (dirpath, dirnames, filenames) in os.walk(path):
for name in filenames:
tmp = os.path.join(dirpath, name);
File.app... | Move some Utils outside of the main script.# -*- coding: utf-8 -*-
"""
Created on Sun Sep 11 10:23:38 2016
@author: SISQUAKE
"""
import os
def listFilePath(path):
File = [];
Dir = [];
for (dirpath, dirnames, filenames) in os.walk(path):
for name in filenames:
tmp = os.path... | <commit_before><commit_msg>Move some Utils outside of the main script.<commit_after># -*- coding: utf-8 -*-
"""
Created on Sun Sep 11 10:23:38 2016
@author: SISQUAKE
"""
import os
def listFilePath(path):
File = [];
Dir = [];
for (dirpath, dirnames, filenames) in os.walk(path):
for name... | |
efc8d3182f79111b3a1b7df445dafd46fef9862a | controlbeast/utils/yaml.py | controlbeast/utils/yaml.py | # -*- coding: utf-8 -*-
"""
controlbeast.utils.yaml
~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2014 by the ControlBeast team, see AUTHORS.
:license: ISC, see LICENSE for details.
"""
import os
import yaml
from controlbeast.conf import CbConf
from controlbeast.utils.dynamic import CbDynamicIterable
f... | Add YAML wrapper allowing conf strings to be used in YAML source files | Add YAML wrapper allowing conf strings to be used in YAML source files
| Python | isc | daemotron/controlbeast,daemotron/controlbeast | Add YAML wrapper allowing conf strings to be used in YAML source files | # -*- coding: utf-8 -*-
"""
controlbeast.utils.yaml
~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2014 by the ControlBeast team, see AUTHORS.
:license: ISC, see LICENSE for details.
"""
import os
import yaml
from controlbeast.conf import CbConf
from controlbeast.utils.dynamic import CbDynamicIterable
f... | <commit_before><commit_msg>Add YAML wrapper allowing conf strings to be used in YAML source files<commit_after> | # -*- coding: utf-8 -*-
"""
controlbeast.utils.yaml
~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2014 by the ControlBeast team, see AUTHORS.
:license: ISC, see LICENSE for details.
"""
import os
import yaml
from controlbeast.conf import CbConf
from controlbeast.utils.dynamic import CbDynamicIterable
f... | Add YAML wrapper allowing conf strings to be used in YAML source files# -*- coding: utf-8 -*-
"""
controlbeast.utils.yaml
~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2014 by the ControlBeast team, see AUTHORS.
:license: ISC, see LICENSE for details.
"""
import os
import yaml
from controlbeast.conf im... | <commit_before><commit_msg>Add YAML wrapper allowing conf strings to be used in YAML source files<commit_after># -*- coding: utf-8 -*-
"""
controlbeast.utils.yaml
~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2014 by the ControlBeast team, see AUTHORS.
:license: ISC, see LICENSE for details.
"""
import... | |
79f92d050fbf9ebe4f088aeabb5e832abeefe0d5 | tests/test_coursera.py | tests/test_coursera.py | import unittest
from mooc_aggregator_restful_api import coursera
class CourseraTestCase(unittest.TestCase):
'''
Unit Tests for module udacity
'''
def setUp(self):
self.coursera_test_object = coursera.CourseraAPI()
def test_coursera_api_courses_response(self):
self.assertEqual(s... | Initialize unit tests for Coursera API module | Initialize unit tests for Coursera API module
| Python | mit | ueg1990/mooc_aggregator_restful_api | Initialize unit tests for Coursera API module | import unittest
from mooc_aggregator_restful_api import coursera
class CourseraTestCase(unittest.TestCase):
'''
Unit Tests for module udacity
'''
def setUp(self):
self.coursera_test_object = coursera.CourseraAPI()
def test_coursera_api_courses_response(self):
self.assertEqual(s... | <commit_before><commit_msg>Initialize unit tests for Coursera API module<commit_after> | import unittest
from mooc_aggregator_restful_api import coursera
class CourseraTestCase(unittest.TestCase):
'''
Unit Tests for module udacity
'''
def setUp(self):
self.coursera_test_object = coursera.CourseraAPI()
def test_coursera_api_courses_response(self):
self.assertEqual(s... | Initialize unit tests for Coursera API moduleimport unittest
from mooc_aggregator_restful_api import coursera
class CourseraTestCase(unittest.TestCase):
'''
Unit Tests for module udacity
'''
def setUp(self):
self.coursera_test_object = coursera.CourseraAPI()
def test_coursera_api_cours... | <commit_before><commit_msg>Initialize unit tests for Coursera API module<commit_after>import unittest
from mooc_aggregator_restful_api import coursera
class CourseraTestCase(unittest.TestCase):
'''
Unit Tests for module udacity
'''
def setUp(self):
self.coursera_test_object = coursera.Cours... | |
abea1f4598928fddf750358efcedbfaade019bf4 | zerver/migrations/0386_fix_attachment_caches.py | zerver/migrations/0386_fix_attachment_caches.py | # Generated by Django 3.2.12 on 2022-03-23 04:32
from django.db import migrations, models
from django.db.backends.postgresql.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
from django.db.models import Exists, Model, OuterRef
def fix_attachment_caches(apps: StateApps, schema_edito... | Add migration to fix Attachment cache. | migrations: Add migration to fix Attachment cache.
This migration needs to be run after the previous commit is deployed
to a given Zulip installation, to fix any stale values of
is_realm_public and is_web_public.
| Python | apache-2.0 | kou/zulip,kou/zulip,zulip/zulip,kou/zulip,kou/zulip,zulip/zulip,andersk/zulip,zulip/zulip,andersk/zulip,rht/zulip,rht/zulip,zulip/zulip,rht/zulip,andersk/zulip,rht/zulip,kou/zulip,zulip/zulip,kou/zulip,andersk/zulip,andersk/zulip,zulip/zulip,andersk/zulip,andersk/zulip,rht/zulip,zulip/zulip,rht/zulip,rht/zulip,kou/zuli... | migrations: Add migration to fix Attachment cache.
This migration needs to be run after the previous commit is deployed
to a given Zulip installation, to fix any stale values of
is_realm_public and is_web_public. | # Generated by Django 3.2.12 on 2022-03-23 04:32
from django.db import migrations, models
from django.db.backends.postgresql.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
from django.db.models import Exists, Model, OuterRef
def fix_attachment_caches(apps: StateApps, schema_edito... | <commit_before><commit_msg>migrations: Add migration to fix Attachment cache.
This migration needs to be run after the previous commit is deployed
to a given Zulip installation, to fix any stale values of
is_realm_public and is_web_public.<commit_after> | # Generated by Django 3.2.12 on 2022-03-23 04:32
from django.db import migrations, models
from django.db.backends.postgresql.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
from django.db.models import Exists, Model, OuterRef
def fix_attachment_caches(apps: StateApps, schema_edito... | migrations: Add migration to fix Attachment cache.
This migration needs to be run after the previous commit is deployed
to a given Zulip installation, to fix any stale values of
is_realm_public and is_web_public.# Generated by Django 3.2.12 on 2022-03-23 04:32
from django.db import migrations, models
from django.db.b... | <commit_before><commit_msg>migrations: Add migration to fix Attachment cache.
This migration needs to be run after the previous commit is deployed
to a given Zulip installation, to fix any stale values of
is_realm_public and is_web_public.<commit_after># Generated by Django 3.2.12 on 2022-03-23 04:32
from django.db i... | |
0f251e6c8620e19fc5e16e88b1ffbd5d51f7a7be | gcmstools/datastore.py | gcmstools/datastore.py | import numpy as np
import pandas as pd
import tables as tb
class HDFStore(object):
def __init__(self, hdfname):
self.pdh5 = pd.HDFStore(hdfname, mode='a', complevel=9,
complib='blosc')
self.h5 = self.pdh5._handle
self._filters = tb.Filters(complevel=9, complib='blosc')
... | Add initial HDF storage class | Add initial HDF storage class
| Python | bsd-3-clause | rnelsonchem/gcmstools | Add initial HDF storage class | import numpy as np
import pandas as pd
import tables as tb
class HDFStore(object):
def __init__(self, hdfname):
self.pdh5 = pd.HDFStore(hdfname, mode='a', complevel=9,
complib='blosc')
self.h5 = self.pdh5._handle
self._filters = tb.Filters(complevel=9, complib='blosc')
... | <commit_before><commit_msg>Add initial HDF storage class<commit_after> | import numpy as np
import pandas as pd
import tables as tb
class HDFStore(object):
def __init__(self, hdfname):
self.pdh5 = pd.HDFStore(hdfname, mode='a', complevel=9,
complib='blosc')
self.h5 = self.pdh5._handle
self._filters = tb.Filters(complevel=9, complib='blosc')
... | Add initial HDF storage classimport numpy as np
import pandas as pd
import tables as tb
class HDFStore(object):
def __init__(self, hdfname):
self.pdh5 = pd.HDFStore(hdfname, mode='a', complevel=9,
complib='blosc')
self.h5 = self.pdh5._handle
self._filters = tb.Filters(comple... | <commit_before><commit_msg>Add initial HDF storage class<commit_after>import numpy as np
import pandas as pd
import tables as tb
class HDFStore(object):
def __init__(self, hdfname):
self.pdh5 = pd.HDFStore(hdfname, mode='a', complevel=9,
complib='blosc')
self.h5 = self.pdh5._handle
... | |
c86b61a23ad9b3a152bb6644cb5dde5a4b42fbc9 | readthedocs/projects/management/commands/dump_project_remote_repo_relation.py | readthedocs/projects/management/commands/dump_project_remote_repo_relation.py | import json
from django.core.management.base import BaseCommand
from readthedocs.projects.models import Project
class Command(BaseCommand):
help = "Dump Project and RemoteRepository Relationship in JSON format"
def handle(self, *args, **options):
data = []
queryset = Project.objects.filter... | Add Management Command to Dump Project and RemoteRepository Relationship in JSON format | Add Management Command to Dump Project and RemoteRepository Relationship in JSON format
| Python | mit | rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org | Add Management Command to Dump Project and RemoteRepository Relationship in JSON format | import json
from django.core.management.base import BaseCommand
from readthedocs.projects.models import Project
class Command(BaseCommand):
help = "Dump Project and RemoteRepository Relationship in JSON format"
def handle(self, *args, **options):
data = []
queryset = Project.objects.filter... | <commit_before><commit_msg>Add Management Command to Dump Project and RemoteRepository Relationship in JSON format<commit_after> | import json
from django.core.management.base import BaseCommand
from readthedocs.projects.models import Project
class Command(BaseCommand):
help = "Dump Project and RemoteRepository Relationship in JSON format"
def handle(self, *args, **options):
data = []
queryset = Project.objects.filter... | Add Management Command to Dump Project and RemoteRepository Relationship in JSON formatimport json
from django.core.management.base import BaseCommand
from readthedocs.projects.models import Project
class Command(BaseCommand):
help = "Dump Project and RemoteRepository Relationship in JSON format"
def handl... | <commit_before><commit_msg>Add Management Command to Dump Project and RemoteRepository Relationship in JSON format<commit_after>import json
from django.core.management.base import BaseCommand
from readthedocs.projects.models import Project
class Command(BaseCommand):
help = "Dump Project and RemoteRepository Re... | |
b6e0daa9ee06961743ad5a5f728f3385bfdb0b4c | playbooks/roles/ironic-install/files/parse_zuul_changes.py | playbooks/roles/ironic-install/files/parse_zuul_changes.py | #!/usr/bin/env python
# (c) 2015, Hewlett-Packard Development Company, L.P.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ver... | Add a helper script to apply changes in zuul | Add a helper script to apply changes in zuul
In order to aappropriately test dependencies in a CI scenario,
specificially in the case of OpenStack CI, we need to be able to
parse and act upon the changes defined by Zuul since we manage
the installation of our dependencies.
| Python | apache-2.0 | EntropyWorks/bifrost,bcornec/bifrost,juliakreger/bifrost,devananda/bifrost,openstack/bifrost,openstack/bifrost,EntropyWorks/bifrost,devananda/bifrost,bcornec/bifrost,juliakreger/bifrost | Add a helper script to apply changes in zuul
In order to aappropriately test dependencies in a CI scenario,
specificially in the case of OpenStack CI, we need to be able to
parse and act upon the changes defined by Zuul since we manage
the installation of our dependencies. | #!/usr/bin/env python
# (c) 2015, Hewlett-Packard Development Company, L.P.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ver... | <commit_before><commit_msg>Add a helper script to apply changes in zuul
In order to aappropriately test dependencies in a CI scenario,
specificially in the case of OpenStack CI, we need to be able to
parse and act upon the changes defined by Zuul since we manage
the installation of our dependencies.<commit_after> | #!/usr/bin/env python
# (c) 2015, Hewlett-Packard Development Company, L.P.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ver... | Add a helper script to apply changes in zuul
In order to aappropriately test dependencies in a CI scenario,
specificially in the case of OpenStack CI, we need to be able to
parse and act upon the changes defined by Zuul since we manage
the installation of our dependencies.#!/usr/bin/env python
# (c) 2015, Hewlett-Pac... | <commit_before><commit_msg>Add a helper script to apply changes in zuul
In order to aappropriately test dependencies in a CI scenario,
specificially in the case of OpenStack CI, we need to be able to
parse and act upon the changes defined by Zuul since we manage
the installation of our dependencies.<commit_after>#!/us... | |
cfec967be4602dff636adb951b582d1db114f578 | tensorflow_datasets/scripts/document_dataset_version.py | tensorflow_datasets/scripts/document_dataset_version.py | # coding=utf-8
# Copyright 2020 The TensorFlow Datasets Authors.
#
# 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 appl... | Add single dataset doc gen | Add single dataset doc gen
| Python | apache-2.0 | tensorflow/datasets,tensorflow/datasets,tensorflow/datasets,tensorflow/datasets,tensorflow/datasets | Add single dataset doc gen | # coding=utf-8
# Copyright 2020 The TensorFlow Datasets Authors.
#
# 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 appl... | <commit_before><commit_msg>Add single dataset doc gen<commit_after> | # coding=utf-8
# Copyright 2020 The TensorFlow Datasets Authors.
#
# 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 appl... | Add single dataset doc gen# coding=utf-8
# Copyright 2020 The TensorFlow Datasets Authors.
#
# 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
#... | <commit_before><commit_msg>Add single dataset doc gen<commit_after># coding=utf-8
# Copyright 2020 The TensorFlow Datasets Authors.
#
# 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
#
# htt... | |
a189203bf2dc7ddd925ed8cfbeb191ee52d43711 | src/aws_scripts/benchmark_s3.py | src/aws_scripts/benchmark_s3.py | from __future__ import print_function
import boto3
import subprocess
import os
import pandas as pd
import time
def DownloadFile(local_file, bucket, bucket_path):
print("Downloading file...", end="")
s3 = boto3.resource('s3')
s3.Bucket(bucket).download_file(bucket_path, local_file)
print("Done!")
def U... | Add Python script to investigate s3 speeds | Add Python script to investigate s3 speeds
Signed-off-by: Cody W. Eilar <c951a9dfd6009d72a7222f9697e33f76af2d5e79@Gmail.com>
| Python | mit | AcidLeroy/OpticalFlow,AcidLeroy/OpticalFlow,AcidLeroy/OpticalFlow,AcidLeroy/OpticalFlow | Add Python script to investigate s3 speeds
Signed-off-by: Cody W. Eilar <c951a9dfd6009d72a7222f9697e33f76af2d5e79@Gmail.com> | from __future__ import print_function
import boto3
import subprocess
import os
import pandas as pd
import time
def DownloadFile(local_file, bucket, bucket_path):
print("Downloading file...", end="")
s3 = boto3.resource('s3')
s3.Bucket(bucket).download_file(bucket_path, local_file)
print("Done!")
def U... | <commit_before><commit_msg>Add Python script to investigate s3 speeds
Signed-off-by: Cody W. Eilar <c951a9dfd6009d72a7222f9697e33f76af2d5e79@Gmail.com><commit_after> | from __future__ import print_function
import boto3
import subprocess
import os
import pandas as pd
import time
def DownloadFile(local_file, bucket, bucket_path):
print("Downloading file...", end="")
s3 = boto3.resource('s3')
s3.Bucket(bucket).download_file(bucket_path, local_file)
print("Done!")
def U... | Add Python script to investigate s3 speeds
Signed-off-by: Cody W. Eilar <c951a9dfd6009d72a7222f9697e33f76af2d5e79@Gmail.com>from __future__ import print_function
import boto3
import subprocess
import os
import pandas as pd
import time
def DownloadFile(local_file, bucket, bucket_path):
print("Downloading file...",... | <commit_before><commit_msg>Add Python script to investigate s3 speeds
Signed-off-by: Cody W. Eilar <c951a9dfd6009d72a7222f9697e33f76af2d5e79@Gmail.com><commit_after>from __future__ import print_function
import boto3
import subprocess
import os
import pandas as pd
import time
def DownloadFile(local_file, bucket, bucke... | |
182d4229f6293eec791a5eba716917ace3bcfaca | cal_pipe/manual_outlier_flag.py | cal_pipe/manual_outlier_flag.py |
import sys
'''
Check for garbage points in a MS by SPW.
'''
try:
vis_name = sys.argv[1]
corrstring = sys.argv[2]
starting_spw = int(sys.argv[3])
except IndexError:
vis_name = raw_input("MS Name? : ")
corrstring = raw_input("Corrstring? : ")
starting_spw = int(raw_input("SPW to start at? : "))... | Make looking for outliers easier | Make looking for outliers easier
| Python | mit | e-koch/canfar_scripts,e-koch/canfar_scripts | Make looking for outliers easier |
import sys
'''
Check for garbage points in a MS by SPW.
'''
try:
vis_name = sys.argv[1]
corrstring = sys.argv[2]
starting_spw = int(sys.argv[3])
except IndexError:
vis_name = raw_input("MS Name? : ")
corrstring = raw_input("Corrstring? : ")
starting_spw = int(raw_input("SPW to start at? : "))... | <commit_before><commit_msg>Make looking for outliers easier<commit_after> |
import sys
'''
Check for garbage points in a MS by SPW.
'''
try:
vis_name = sys.argv[1]
corrstring = sys.argv[2]
starting_spw = int(sys.argv[3])
except IndexError:
vis_name = raw_input("MS Name? : ")
corrstring = raw_input("Corrstring? : ")
starting_spw = int(raw_input("SPW to start at? : "))... | Make looking for outliers easier
import sys
'''
Check for garbage points in a MS by SPW.
'''
try:
vis_name = sys.argv[1]
corrstring = sys.argv[2]
starting_spw = int(sys.argv[3])
except IndexError:
vis_name = raw_input("MS Name? : ")
corrstring = raw_input("Corrstring? : ")
starting_spw = int(r... | <commit_before><commit_msg>Make looking for outliers easier<commit_after>
import sys
'''
Check for garbage points in a MS by SPW.
'''
try:
vis_name = sys.argv[1]
corrstring = sys.argv[2]
starting_spw = int(sys.argv[3])
except IndexError:
vis_name = raw_input("MS Name? : ")
corrstring = raw_input("... | |
34206ab96b5546e617b1478f59357a6a3f7ed8b6 | st2common/st2common/util/gunicorn_workers.py | st2common/st2common/util/gunicorn_workers.py | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | Add a custom gunicorn Sync worker implementation which works around some issues which occur when eventlet monkey patching is used with sync worker. | Add a custom gunicorn Sync worker implementation which works around some issues
which occur when eventlet monkey patching is used with sync worker.
| Python | apache-2.0 | nzlosh/st2,emedvedev/st2,StackStorm/st2,peak6/st2,tonybaloney/st2,lakshmi-kannan/st2,lakshmi-kannan/st2,punalpatel/st2,Plexxi/st2,nzlosh/st2,Plexxi/st2,peak6/st2,lakshmi-kannan/st2,Plexxi/st2,StackStorm/st2,tonybaloney/st2,pixelrebel/st2,StackStorm/st2,punalpatel/st2,nzlosh/st2,punalpatel/st2,pixelrebel/st2,pixelrebel/... | Add a custom gunicorn Sync worker implementation which works around some issues
which occur when eventlet monkey patching is used with sync worker. | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | <commit_before><commit_msg>Add a custom gunicorn Sync worker implementation which works around some issues
which occur when eventlet monkey patching is used with sync worker.<commit_after> | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | Add a custom gunicorn Sync worker implementation which works around some issues
which occur when eventlet monkey patching is used with sync worker.# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional informa... | <commit_before><commit_msg>Add a custom gunicorn Sync worker implementation which works around some issues
which occur when eventlet monkey patching is used with sync worker.<commit_after># Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distribute... | |
7b688747a02f9ac29d4f119bf142f7ef0ad805e9 | comtypes/test/test_collections.py | comtypes/test/test_collections.py | import unittest
from comtypes.client import CreateObject, GetModule #, Constants
from find_memleak import find_memleak
from ctypes import ArgumentError
class Test(unittest.TestCase):
def test_IEnumVARIANT(self):
# The XP firewall manager.
fwmgr = CreateObject('HNetCfg.FwMgr')
# apps has a ... | Test for COM collections; IEnumVariant so far only. | Test for COM collections; IEnumVariant so far only.
--HG--
extra : convert_revision : svn%3Aa2f44796-8cc0-49ac-b43f-6a96d556d52d/trunk%40142
| Python | mit | denfromufa/comtypes,denfromufa/comtypes,denfromufa/comtypes,denfromufa/comtypes,denfromufa/comtypes | Test for COM collections; IEnumVariant so far only.
--HG--
extra : convert_revision : svn%3Aa2f44796-8cc0-49ac-b43f-6a96d556d52d/trunk%40142 | import unittest
from comtypes.client import CreateObject, GetModule #, Constants
from find_memleak import find_memleak
from ctypes import ArgumentError
class Test(unittest.TestCase):
def test_IEnumVARIANT(self):
# The XP firewall manager.
fwmgr = CreateObject('HNetCfg.FwMgr')
# apps has a ... | <commit_before><commit_msg>Test for COM collections; IEnumVariant so far only.
--HG--
extra : convert_revision : svn%3Aa2f44796-8cc0-49ac-b43f-6a96d556d52d/trunk%40142<commit_after> | import unittest
from comtypes.client import CreateObject, GetModule #, Constants
from find_memleak import find_memleak
from ctypes import ArgumentError
class Test(unittest.TestCase):
def test_IEnumVARIANT(self):
# The XP firewall manager.
fwmgr = CreateObject('HNetCfg.FwMgr')
# apps has a ... | Test for COM collections; IEnumVariant so far only.
--HG--
extra : convert_revision : svn%3Aa2f44796-8cc0-49ac-b43f-6a96d556d52d/trunk%40142import unittest
from comtypes.client import CreateObject, GetModule #, Constants
from find_memleak import find_memleak
from ctypes import ArgumentError
class Test(unittest.TestCa... | <commit_before><commit_msg>Test for COM collections; IEnumVariant so far only.
--HG--
extra : convert_revision : svn%3Aa2f44796-8cc0-49ac-b43f-6a96d556d52d/trunk%40142<commit_after>import unittest
from comtypes.client import CreateObject, GetModule #, Constants
from find_memleak import find_memleak
from ctypes import ... | |
6917e3b8689ace77bda912f82163f0f91a1a881b | digikey/migrations/0022_merge.py | digikey/migrations/0022_merge.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('digikey', '0019_merge'),
('digikey', '0021_auto_20151125_1353'),
]
operations = [
]
| Solve conflict in DB schema for circle CI | Solve conflict in DB schema for circle CI
| Python | mit | sonicyang/chiphub,sonicyang/chiphub,sonicyang/chiphub | Solve conflict in DB schema for circle CI | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('digikey', '0019_merge'),
('digikey', '0021_auto_20151125_1353'),
]
operations = [
]
| <commit_before><commit_msg>Solve conflict in DB schema for circle CI<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('digikey', '0019_merge'),
('digikey', '0021_auto_20151125_1353'),
]
operations = [
]
| Solve conflict in DB schema for circle CI# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('digikey', '0019_merge'),
('digikey', '0021_auto_20151125_1353'),
]
operations = [
... | <commit_before><commit_msg>Solve conflict in DB schema for circle CI<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('digikey', '0019_merge'),
('digikey', '0021_auto_201... | |
10ac7ea7a67b7a15146ae7c9c0ba9ba74876df81 | tests/test_gems.py | tests/test_gems.py | from tests.helper import ExternalVersionTestCase
class RubyGemsTest(ExternalVersionTestCase):
def test_gems(self):
self.assertEqual(self.sync_get_version("example", {"gems": None}), "1.0.2")
| Add a testcase for RubyGems | Add a testcase for RubyGems
| Python | mit | lilydjwg/nvchecker | Add a testcase for RubyGems | from tests.helper import ExternalVersionTestCase
class RubyGemsTest(ExternalVersionTestCase):
def test_gems(self):
self.assertEqual(self.sync_get_version("example", {"gems": None}), "1.0.2")
| <commit_before><commit_msg>Add a testcase for RubyGems<commit_after> | from tests.helper import ExternalVersionTestCase
class RubyGemsTest(ExternalVersionTestCase):
def test_gems(self):
self.assertEqual(self.sync_get_version("example", {"gems": None}), "1.0.2")
| Add a testcase for RubyGemsfrom tests.helper import ExternalVersionTestCase
class RubyGemsTest(ExternalVersionTestCase):
def test_gems(self):
self.assertEqual(self.sync_get_version("example", {"gems": None}), "1.0.2")
| <commit_before><commit_msg>Add a testcase for RubyGems<commit_after>from tests.helper import ExternalVersionTestCase
class RubyGemsTest(ExternalVersionTestCase):
def test_gems(self):
self.assertEqual(self.sync_get_version("example", {"gems": None}), "1.0.2")
| |
2f0bf45ec747778d38801892e97d5a902443841d | src/ggrc/migrations/versions/20170207134238_562ec606ff7c_add_assessment_updated_notification_type.py | src/ggrc/migrations/versions/20170207134238_562ec606ff7c_add_assessment_updated_notification_type.py | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Add Assessment updated notification type
Create Date: 2017-02-07 13:42:38.921370
"""
# disable Invalid constant name pylint warning for mandatory Alembic variables.
# pylint: disable=invalid-name
from ... | Define "Assessment updated" notification type | Define "Assessment updated" notification type
| Python | apache-2.0 | VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,AleksNeStu/ggrc-core | Define "Assessment updated" notification type | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Add Assessment updated notification type
Create Date: 2017-02-07 13:42:38.921370
"""
# disable Invalid constant name pylint warning for mandatory Alembic variables.
# pylint: disable=invalid-name
from ... | <commit_before><commit_msg>Define "Assessment updated" notification type<commit_after> | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Add Assessment updated notification type
Create Date: 2017-02-07 13:42:38.921370
"""
# disable Invalid constant name pylint warning for mandatory Alembic variables.
# pylint: disable=invalid-name
from ... | Define "Assessment updated" notification type# Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Add Assessment updated notification type
Create Date: 2017-02-07 13:42:38.921370
"""
# disable Invalid constant name pylint warning for mandatory Alembic var... | <commit_before><commit_msg>Define "Assessment updated" notification type<commit_after># Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Add Assessment updated notification type
Create Date: 2017-02-07 13:42:38.921370
"""
# disable Invalid constant name... | |
fe11a1b638b1779e51da87eaa30f1f12b2d0911c | cf2cdm/datamodels.py | cf2cdm/datamodels.py | #
# Copyright 2017-2018 European Centre for Medium-Range Weather Forecasts (ECMWF).
#
# 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... | Add a module for known data models: CDS, ECMWF, etc. | Add a module for known data models: CDS, ECMWF, etc.
| Python | apache-2.0 | ecmwf/cfgrib | Add a module for known data models: CDS, ECMWF, etc. | #
# Copyright 2017-2018 European Centre for Medium-Range Weather Forecasts (ECMWF).
#
# 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... | <commit_before><commit_msg>Add a module for known data models: CDS, ECMWF, etc.<commit_after> | #
# Copyright 2017-2018 European Centre for Medium-Range Weather Forecasts (ECMWF).
#
# 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... | Add a module for known data models: CDS, ECMWF, etc.#
# Copyright 2017-2018 European Centre for Medium-Range Weather Forecasts (ECMWF).
#
# 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
#
# h... | <commit_before><commit_msg>Add a module for known data models: CDS, ECMWF, etc.<commit_after>#
# Copyright 2017-2018 European Centre for Medium-Range Weather Forecasts (ECMWF).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ma... | |
1a1ee9eff1f04d6e40c9288e15dc3fad7515c2b8 | tests/cupy_tests/core_tests/test_carray.py | tests/cupy_tests/core_tests/test_carray.py | import unittest
import cupy
from cupy import testing
class TestCArray(unittest.TestCase):
def test_size(self):
x = cupy.arange(3).astype('i')
y = cupy.ElementwiseKernel(
'raw int32 x', 'int32 y', 'y = x.size()', 'test_carray_size',
)(x, size=1)
self.assertEqual(int(y[... | Make a unittest for CArray class | Make a unittest for CArray class
| Python | mit | rezoo/chainer,keisuke-umezawa/chainer,ronekko/chainer,ktnyt/chainer,chainer/chainer,wkentaro/chainer,wkentaro/chainer,okuta/chainer,ktnyt/chainer,chainer/chainer,wkentaro/chainer,aonotas/chainer,pfnet/chainer,kashif/chainer,jnishi/chainer,hvy/chainer,okuta/chainer,niboshi/chainer,keisuke-umezawa/chainer,niboshi/chainer... | Make a unittest for CArray class | import unittest
import cupy
from cupy import testing
class TestCArray(unittest.TestCase):
def test_size(self):
x = cupy.arange(3).astype('i')
y = cupy.ElementwiseKernel(
'raw int32 x', 'int32 y', 'y = x.size()', 'test_carray_size',
)(x, size=1)
self.assertEqual(int(y[... | <commit_before><commit_msg>Make a unittest for CArray class<commit_after> | import unittest
import cupy
from cupy import testing
class TestCArray(unittest.TestCase):
def test_size(self):
x = cupy.arange(3).astype('i')
y = cupy.ElementwiseKernel(
'raw int32 x', 'int32 y', 'y = x.size()', 'test_carray_size',
)(x, size=1)
self.assertEqual(int(y[... | Make a unittest for CArray classimport unittest
import cupy
from cupy import testing
class TestCArray(unittest.TestCase):
def test_size(self):
x = cupy.arange(3).astype('i')
y = cupy.ElementwiseKernel(
'raw int32 x', 'int32 y', 'y = x.size()', 'test_carray_size',
)(x, size=1)... | <commit_before><commit_msg>Make a unittest for CArray class<commit_after>import unittest
import cupy
from cupy import testing
class TestCArray(unittest.TestCase):
def test_size(self):
x = cupy.arange(3).astype('i')
y = cupy.ElementwiseKernel(
'raw int32 x', 'int32 y', 'y = x.size()',... | |
2cf5f7baf115511c9dd8a8a0333a9b579455b9a3 | tests/rules_tests/FromSymbolComputeTest.py | tests/rules_tests/FromSymbolComputeTest.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import main, TestCase
from grammpy import Rule
class FromSymbolComputeTest(TestCase):
pass
if __name__ == '__main__':
main()
| Add file for rule's symbol tests | Add file for rule's symbol tests
| Python | mit | PatrikValkovic/grammpy | Add file for rule's symbol tests | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import main, TestCase
from grammpy import Rule
class FromSymbolComputeTest(TestCase):
pass
if __name__ == '__main__':
main()
| <commit_before><commit_msg>Add file for rule's symbol tests<commit_after> | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import main, TestCase
from grammpy import Rule
class FromSymbolComputeTest(TestCase):
pass
if __name__ == '__main__':
main()
| Add file for rule's symbol tests#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import main, TestCase
from grammpy import Rule
class FromSymbolComputeTest(TestCase):
pass
if __name__ == '__main__':
main()
| <commit_before><commit_msg>Add file for rule's symbol tests<commit_after>#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import main, TestCase
from grammpy import Rule
class FromSymbolComputeTest(TestCase):
pass
if __name__ == '__mai... | |
3247ff26cbe63d875a493382c3f567f112de8b58 | bin/maintenance/update_menus.py | bin/maintenance/update_menus.py | from __future__ import division
from collections import Counter
from indico.core.db import DBMgr
from indico.util.console import conferenceHolderIterator, success
from MaKaC.conference import ConferenceHolder
from MaKaC.webinterface.displayMgr import ConfDisplayMgrRegistery
def update_menus(dbi):
links = ('coll... | Add maintenance script to fix missing menu links | Add maintenance script to fix missing menu links
| Python | mit | DirkHoffmann/indico,mic4ael/indico,mic4ael/indico,indico/indico,mvidalgarcia/indico,ThiefMaster/indico,OmeGak/indico,DirkHoffmann/indico,mvidalgarcia/indico,pferreir/indico,OmeGak/indico,pferreir/indico,indico/indico,mvidalgarcia/indico,ThiefMaster/indico,mvidalgarcia/indico,ThiefMaster/indico,mic4ael/indico,ThiefMaste... | Add maintenance script to fix missing menu links | from __future__ import division
from collections import Counter
from indico.core.db import DBMgr
from indico.util.console import conferenceHolderIterator, success
from MaKaC.conference import ConferenceHolder
from MaKaC.webinterface.displayMgr import ConfDisplayMgrRegistery
def update_menus(dbi):
links = ('coll... | <commit_before><commit_msg>Add maintenance script to fix missing menu links<commit_after> | from __future__ import division
from collections import Counter
from indico.core.db import DBMgr
from indico.util.console import conferenceHolderIterator, success
from MaKaC.conference import ConferenceHolder
from MaKaC.webinterface.displayMgr import ConfDisplayMgrRegistery
def update_menus(dbi):
links = ('coll... | Add maintenance script to fix missing menu linksfrom __future__ import division
from collections import Counter
from indico.core.db import DBMgr
from indico.util.console import conferenceHolderIterator, success
from MaKaC.conference import ConferenceHolder
from MaKaC.webinterface.displayMgr import ConfDisplayMgrRegis... | <commit_before><commit_msg>Add maintenance script to fix missing menu links<commit_after>from __future__ import division
from collections import Counter
from indico.core.db import DBMgr
from indico.util.console import conferenceHolderIterator, success
from MaKaC.conference import ConferenceHolder
from MaKaC.webinterf... | |
2a81e39a843e31181af455a89ad2b200b7d2f024 | director/sessions_/migrations/0005_auto_20160316_2124.py | director/sessions_/migrations/0005_auto_20160316_2124.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-03-16 21:24
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sessions_', '0004_auto_20160124_0931'),
]
operations = [
migrations.AddField... | Add migrations for session changes | Add migrations for session changes
| Python | apache-2.0 | stencila/hub,stencila/hub,stencila/hub,stencila/hub,stencila/hub | Add migrations for session changes | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-03-16 21:24
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sessions_', '0004_auto_20160124_0931'),
]
operations = [
migrations.AddField... | <commit_before><commit_msg>Add migrations for session changes<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-03-16 21:24
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sessions_', '0004_auto_20160124_0931'),
]
operations = [
migrations.AddField... | Add migrations for session changes# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-03-16 21:24
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sessions_', '0004_auto_20160124_0931'),
]
operatio... | <commit_before><commit_msg>Add migrations for session changes<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-03-16 21:24
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sessions_', '0004_... | |
fd2cc81feab4b24b276c8f4a0a8efc16cacef60b | Lab/09/Template_09_A.py | Lab/09/Template_09_A.py |
class Bangunan:
def __init__(self, nama, lama_sewa, harga_sewa):
self.nama = nama
self.lama_sewa = lama_sewa
self.harga_sewa = harga_sewa
def getHargaSewa(self):
return self.harga_sewa
class Restoran(Object):
def __init__(self, nama, lama_sewa):
Bangunan.__init__(s... | Add template for lab 09 class A | Add template for lab 09 class A
| Python | mit | giovanism/TarungLab,laymonage/TarungLab | Add template for lab 09 class A |
class Bangunan:
def __init__(self, nama, lama_sewa, harga_sewa):
self.nama = nama
self.lama_sewa = lama_sewa
self.harga_sewa = harga_sewa
def getHargaSewa(self):
return self.harga_sewa
class Restoran(Object):
def __init__(self, nama, lama_sewa):
Bangunan.__init__(s... | <commit_before><commit_msg>Add template for lab 09 class A<commit_after> |
class Bangunan:
def __init__(self, nama, lama_sewa, harga_sewa):
self.nama = nama
self.lama_sewa = lama_sewa
self.harga_sewa = harga_sewa
def getHargaSewa(self):
return self.harga_sewa
class Restoran(Object):
def __init__(self, nama, lama_sewa):
Bangunan.__init__(s... | Add template for lab 09 class A
class Bangunan:
def __init__(self, nama, lama_sewa, harga_sewa):
self.nama = nama
self.lama_sewa = lama_sewa
self.harga_sewa = harga_sewa
def getHargaSewa(self):
return self.harga_sewa
class Restoran(Object):
def __init__(self, nama, lama_sew... | <commit_before><commit_msg>Add template for lab 09 class A<commit_after>
class Bangunan:
def __init__(self, nama, lama_sewa, harga_sewa):
self.nama = nama
self.lama_sewa = lama_sewa
self.harga_sewa = harga_sewa
def getHargaSewa(self):
return self.harga_sewa
class Restoran(Objec... | |
cee5313906b2ee7e4fb01fc772e2afc6c4de1072 | launch.py | launch.py | from twisted.application import internet, service
from twisted.names import dns
from twisted.names import server
from openvpnzone import OpenVpnStatusAuthority, extract_status_file_path
def createOpenvpn2DnsService():
zones = [OpenVpnStatusAuthority(extract_status_file_path('server.conf'))]
f = server.DNSSer... | Add simple lauch script without configuration options | Add simple lauch script without configuration options
| Python | mit | mswart/openvpn2dns,mswart/openvpn2dns | Add simple lauch script without configuration options | from twisted.application import internet, service
from twisted.names import dns
from twisted.names import server
from openvpnzone import OpenVpnStatusAuthority, extract_status_file_path
def createOpenvpn2DnsService():
zones = [OpenVpnStatusAuthority(extract_status_file_path('server.conf'))]
f = server.DNSSer... | <commit_before><commit_msg>Add simple lauch script without configuration options<commit_after> | from twisted.application import internet, service
from twisted.names import dns
from twisted.names import server
from openvpnzone import OpenVpnStatusAuthority, extract_status_file_path
def createOpenvpn2DnsService():
zones = [OpenVpnStatusAuthority(extract_status_file_path('server.conf'))]
f = server.DNSSer... | Add simple lauch script without configuration optionsfrom twisted.application import internet, service
from twisted.names import dns
from twisted.names import server
from openvpnzone import OpenVpnStatusAuthority, extract_status_file_path
def createOpenvpn2DnsService():
zones = [OpenVpnStatusAuthority(extract_sta... | <commit_before><commit_msg>Add simple lauch script without configuration options<commit_after>from twisted.application import internet, service
from twisted.names import dns
from twisted.names import server
from openvpnzone import OpenVpnStatusAuthority, extract_status_file_path
def createOpenvpn2DnsService():
zo... | |
ced30f90907909090c0da0e468c855f400d9da92 | tests/spin_one_half_gen_test.py | tests/spin_one_half_gen_test.py | """Tests for the general model with explicit one-half spin."""
import pytest
from drudge import UP, DOWN, SpinOneHalfGenDrudge
@pytest.fixture(scope='module')
def dr(spark_ctx):
"""The fixture with a general spin one-half drudge."""
return SpinOneHalfGenDrudge(spark_ctx)
def test_spin_one_half_general_dru... | Add shallow tests for spin-1/2 general drudge | Add shallow tests for spin-1/2 general drudge
Here, just the number of terms in the Hamiltonian is tried to be counted
without actual inspection of the content.
| Python | mit | tschijnmo/drudge,tschijnmo/drudge,tschijnmo/drudge | Add shallow tests for spin-1/2 general drudge
Here, just the number of terms in the Hamiltonian is tried to be counted
without actual inspection of the content. | """Tests for the general model with explicit one-half spin."""
import pytest
from drudge import UP, DOWN, SpinOneHalfGenDrudge
@pytest.fixture(scope='module')
def dr(spark_ctx):
"""The fixture with a general spin one-half drudge."""
return SpinOneHalfGenDrudge(spark_ctx)
def test_spin_one_half_general_dru... | <commit_before><commit_msg>Add shallow tests for spin-1/2 general drudge
Here, just the number of terms in the Hamiltonian is tried to be counted
without actual inspection of the content.<commit_after> | """Tests for the general model with explicit one-half spin."""
import pytest
from drudge import UP, DOWN, SpinOneHalfGenDrudge
@pytest.fixture(scope='module')
def dr(spark_ctx):
"""The fixture with a general spin one-half drudge."""
return SpinOneHalfGenDrudge(spark_ctx)
def test_spin_one_half_general_dru... | Add shallow tests for spin-1/2 general drudge
Here, just the number of terms in the Hamiltonian is tried to be counted
without actual inspection of the content."""Tests for the general model with explicit one-half spin."""
import pytest
from drudge import UP, DOWN, SpinOneHalfGenDrudge
@pytest.fixture(scope='modul... | <commit_before><commit_msg>Add shallow tests for spin-1/2 general drudge
Here, just the number of terms in the Hamiltonian is tried to be counted
without actual inspection of the content.<commit_after>"""Tests for the general model with explicit one-half spin."""
import pytest
from drudge import UP, DOWN, SpinOneHal... | |
59f9e552d16e7d4dca73b1232c0804d4ef3154a7 | training_sequence_classifier.py | training_sequence_classifier.py | import tensorflow as tf
import numpy as np
tf.set_random_seed(5)
n_steps = 28
n_inputs = 28
n_neurons = 150
n_outputs = 10
learning_rate = 0.001
X = tf.placeholder(tf.float32, [None, n_steps, n_inputs])
y = tf.placeholder(tf.int32, [None])
with tf.variable_scope('rnn', initializer=tf.contrib.layers.variance_scalin... | Add functioning code for training sequence | Add functioning code for training sequence
RNN works reasonably well
| Python | mit | KT12/hands_on_machine_learning | Add functioning code for training sequence
RNN works reasonably well | import tensorflow as tf
import numpy as np
tf.set_random_seed(5)
n_steps = 28
n_inputs = 28
n_neurons = 150
n_outputs = 10
learning_rate = 0.001
X = tf.placeholder(tf.float32, [None, n_steps, n_inputs])
y = tf.placeholder(tf.int32, [None])
with tf.variable_scope('rnn', initializer=tf.contrib.layers.variance_scalin... | <commit_before><commit_msg>Add functioning code for training sequence
RNN works reasonably well<commit_after> | import tensorflow as tf
import numpy as np
tf.set_random_seed(5)
n_steps = 28
n_inputs = 28
n_neurons = 150
n_outputs = 10
learning_rate = 0.001
X = tf.placeholder(tf.float32, [None, n_steps, n_inputs])
y = tf.placeholder(tf.int32, [None])
with tf.variable_scope('rnn', initializer=tf.contrib.layers.variance_scalin... | Add functioning code for training sequence
RNN works reasonably wellimport tensorflow as tf
import numpy as np
tf.set_random_seed(5)
n_steps = 28
n_inputs = 28
n_neurons = 150
n_outputs = 10
learning_rate = 0.001
X = tf.placeholder(tf.float32, [None, n_steps, n_inputs])
y = tf.placeholder(tf.int32, [None])
with t... | <commit_before><commit_msg>Add functioning code for training sequence
RNN works reasonably well<commit_after>import tensorflow as tf
import numpy as np
tf.set_random_seed(5)
n_steps = 28
n_inputs = 28
n_neurons = 150
n_outputs = 10
learning_rate = 0.001
X = tf.placeholder(tf.float32, [None, n_steps, n_inputs])
y =... | |
231029d867171ad5ee708c61d8a0aed60127aa9a | cybox/test/objects/link_test.py | cybox/test/objects/link_test.py | # Copyright (c) 2015, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import unittest
from mixbox.vendor.six import u
from cybox.objects.link_object import Link
from cybox.objects.uri_object import URI
from cybox.test.objects import ObjectTestCase
class TestLink(ObjectTestCase, un... | Add test for Link object. | Add test for Link object.
| Python | bsd-3-clause | CybOXProject/python-cybox | Add test for Link object. | # Copyright (c) 2015, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import unittest
from mixbox.vendor.six import u
from cybox.objects.link_object import Link
from cybox.objects.uri_object import URI
from cybox.test.objects import ObjectTestCase
class TestLink(ObjectTestCase, un... | <commit_before><commit_msg>Add test for Link object.<commit_after> | # Copyright (c) 2015, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import unittest
from mixbox.vendor.six import u
from cybox.objects.link_object import Link
from cybox.objects.uri_object import URI
from cybox.test.objects import ObjectTestCase
class TestLink(ObjectTestCase, un... | Add test for Link object.# Copyright (c) 2015, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import unittest
from mixbox.vendor.six import u
from cybox.objects.link_object import Link
from cybox.objects.uri_object import URI
from cybox.test.objects import ObjectTestCase
class Te... | <commit_before><commit_msg>Add test for Link object.<commit_after># Copyright (c) 2015, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import unittest
from mixbox.vendor.six import u
from cybox.objects.link_object import Link
from cybox.objects.uri_object import URI
from cybox.test... | |
979dbd0ff0fba03847ca96beaf4d68a0f4e5c9eb | data/b5_scuba2_850um_addbeam.py | data/b5_scuba2_850um_addbeam.py | import os
from astropy.io import fits
file_scuba2_raw='B5_850um_ext_v2_regrid.fits'
file_scuba2_out='B5_850um_ext_v2_regrid_beam.fits'
hdu = fits.open(file_scuba2_raw)
hdr =hdu[0].header
data=hdu[0].data
hdu.close()
hdr.append(('BMAJ', 14.6/3600.))
hdr.append(('BMIN', 14.6/3600.))
hdr.append(('BPA', 0.0))
os.system(... | Add beam information to 850um file | Add beam information to 850um file
-Add python script to add beam information into 850um FITS header.
| Python | mit | jpinedaf/B5_wide_multiple | Add beam information to 850um file
-Add python script to add beam information into 850um FITS header. | import os
from astropy.io import fits
file_scuba2_raw='B5_850um_ext_v2_regrid.fits'
file_scuba2_out='B5_850um_ext_v2_regrid_beam.fits'
hdu = fits.open(file_scuba2_raw)
hdr =hdu[0].header
data=hdu[0].data
hdu.close()
hdr.append(('BMAJ', 14.6/3600.))
hdr.append(('BMIN', 14.6/3600.))
hdr.append(('BPA', 0.0))
os.system(... | <commit_before><commit_msg>Add beam information to 850um file
-Add python script to add beam information into 850um FITS header.<commit_after> | import os
from astropy.io import fits
file_scuba2_raw='B5_850um_ext_v2_regrid.fits'
file_scuba2_out='B5_850um_ext_v2_regrid_beam.fits'
hdu = fits.open(file_scuba2_raw)
hdr =hdu[0].header
data=hdu[0].data
hdu.close()
hdr.append(('BMAJ', 14.6/3600.))
hdr.append(('BMIN', 14.6/3600.))
hdr.append(('BPA', 0.0))
os.system(... | Add beam information to 850um file
-Add python script to add beam information into 850um FITS header.import os
from astropy.io import fits
file_scuba2_raw='B5_850um_ext_v2_regrid.fits'
file_scuba2_out='B5_850um_ext_v2_regrid_beam.fits'
hdu = fits.open(file_scuba2_raw)
hdr =hdu[0].header
data=hdu[0].data
hdu.close()
... | <commit_before><commit_msg>Add beam information to 850um file
-Add python script to add beam information into 850um FITS header.<commit_after>import os
from astropy.io import fits
file_scuba2_raw='B5_850um_ext_v2_regrid.fits'
file_scuba2_out='B5_850um_ext_v2_regrid_beam.fits'
hdu = fits.open(file_scuba2_raw)
hdr =hd... | |
64c21a3e01d50cdc6a719f0e4e48f925d5dd9e03 | src/testers/unittests/test_ast_deep.py | src/testers/unittests/test_ast_deep.py | import unittest
from triton import *
DEPTH = 10000
class TestDeep(unittest.TestCase):
def setUp(self):
"""Define the arch."""
self.triton = TritonContext()
self.triton.setArchitecture(ARCH.X86_64)
self.ctx = self.triton.getAstContext()
sym_var = self.ctx.variable(self.tr... | Add tests for very big AST trees | Add tests for very big AST trees
| Python | apache-2.0 | JonathanSalwan/Triton,JonathanSalwan/Triton,JonathanSalwan/Triton,JonathanSalwan/Triton,JonathanSalwan/Triton | Add tests for very big AST trees | import unittest
from triton import *
DEPTH = 10000
class TestDeep(unittest.TestCase):
def setUp(self):
"""Define the arch."""
self.triton = TritonContext()
self.triton.setArchitecture(ARCH.X86_64)
self.ctx = self.triton.getAstContext()
sym_var = self.ctx.variable(self.tr... | <commit_before><commit_msg>Add tests for very big AST trees<commit_after> | import unittest
from triton import *
DEPTH = 10000
class TestDeep(unittest.TestCase):
def setUp(self):
"""Define the arch."""
self.triton = TritonContext()
self.triton.setArchitecture(ARCH.X86_64)
self.ctx = self.triton.getAstContext()
sym_var = self.ctx.variable(self.tr... | Add tests for very big AST treesimport unittest
from triton import *
DEPTH = 10000
class TestDeep(unittest.TestCase):
def setUp(self):
"""Define the arch."""
self.triton = TritonContext()
self.triton.setArchitecture(ARCH.X86_64)
self.ctx = self.triton.getAstContext()
sym... | <commit_before><commit_msg>Add tests for very big AST trees<commit_after>import unittest
from triton import *
DEPTH = 10000
class TestDeep(unittest.TestCase):
def setUp(self):
"""Define the arch."""
self.triton = TritonContext()
self.triton.setArchitecture(ARCH.X86_64)
self.ctx =... | |
c2f79200689171a49c5bd72e6354ba56ee09a6b6 | script/lib/config.py | script/lib/config.py | #!/usr/bin/env python
import platform
import sys
NODE_VERSION = 'v0.11.13'
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = 'bb664e4665851fe923ce904e620ba43d8d010ba5'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.architecture()[... | #!/usr/bin/env python
import platform
import sys
NODE_VERSION = 'v0.11.13'
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = '432720d4613e3aac939f127fe55b9d44fea349e5'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.architecture()[... | Upgrade libchromiumcontent to contain printing headers. | Upgrade libchromiumcontent to contain printing headers.
| Python | mit | simonfork/electron,anko/electron,kazupon/electron,Faiz7412/electron,JesselJohn/electron,etiktin/electron,rajatsingla28/electron,oiledCode/electron,brave/electron,Zagorakiss/electron,voidbridge/electron,thomsonreuters/electron,pirafrank/electron,sky7sea/electron,mattdesl/electron,evgenyzinoviev/electron,yan-foto/electro... | #!/usr/bin/env python
import platform
import sys
NODE_VERSION = 'v0.11.13'
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = 'bb664e4665851fe923ce904e620ba43d8d010ba5'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.architecture()[... | #!/usr/bin/env python
import platform
import sys
NODE_VERSION = 'v0.11.13'
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = '432720d4613e3aac939f127fe55b9d44fea349e5'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.architecture()[... | <commit_before>#!/usr/bin/env python
import platform
import sys
NODE_VERSION = 'v0.11.13'
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = 'bb664e4665851fe923ce904e620ba43d8d010ba5'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.... | #!/usr/bin/env python
import platform
import sys
NODE_VERSION = 'v0.11.13'
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = '432720d4613e3aac939f127fe55b9d44fea349e5'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.architecture()[... | #!/usr/bin/env python
import platform
import sys
NODE_VERSION = 'v0.11.13'
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = 'bb664e4665851fe923ce904e620ba43d8d010ba5'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.architecture()[... | <commit_before>#!/usr/bin/env python
import platform
import sys
NODE_VERSION = 'v0.11.13'
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = 'bb664e4665851fe923ce904e620ba43d8d010ba5'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.... |
ddf0a5a4438531e4bfa29d8709c1c76d8ca17f59 | volttron/platform/kwonlyargs.py | volttron/platform/kwonlyargs.py | '''Support functions for implementing keyword-only arguments.
This module is designed to make it easy to support keyword-only
arguments in Python 2.7 while providing the same kind of exceptions one
would see with Python 3.x.
Basic usage:
def foo(arg1, *args, **kwargs):
# Use required context manager to c... | Add helper module for keyword-only arguments. | Add helper module for keyword-only arguments.
| Python | bsd-2-clause | schandrika/volttron,schandrika/volttron,schandrika/volttron,schandrika/volttron | Add helper module for keyword-only arguments. | '''Support functions for implementing keyword-only arguments.
This module is designed to make it easy to support keyword-only
arguments in Python 2.7 while providing the same kind of exceptions one
would see with Python 3.x.
Basic usage:
def foo(arg1, *args, **kwargs):
# Use required context manager to c... | <commit_before><commit_msg>Add helper module for keyword-only arguments.<commit_after> | '''Support functions for implementing keyword-only arguments.
This module is designed to make it easy to support keyword-only
arguments in Python 2.7 while providing the same kind of exceptions one
would see with Python 3.x.
Basic usage:
def foo(arg1, *args, **kwargs):
# Use required context manager to c... | Add helper module for keyword-only arguments.'''Support functions for implementing keyword-only arguments.
This module is designed to make it easy to support keyword-only
arguments in Python 2.7 while providing the same kind of exceptions one
would see with Python 3.x.
Basic usage:
def foo(arg1, *args, **kwargs)... | <commit_before><commit_msg>Add helper module for keyword-only arguments.<commit_after>'''Support functions for implementing keyword-only arguments.
This module is designed to make it easy to support keyword-only
arguments in Python 2.7 while providing the same kind of exceptions one
would see with Python 3.x.
Basic u... | |
420ebb50cfb5a366b35d058ad6018857b899a19e | hiora_cartpole/offswitch_hfa.py | hiora_cartpole/offswitch_hfa.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
# HO … higher-order
class SliceHOFeatureVec(object):
def __init__(self, slice_i, entries_per_slice, feature_vec):
self.feature_vec = feature_vec
self.slice = slice(slice_i * entries_per_slice,
(s... | Add function approximator to deal with off-switch | Add function approximator to deal with off-switch
I had forgotten to add this one earlier.
| Python | mit | rmoehn/cartpole | Add function approximator to deal with off-switch
I had forgotten to add this one earlier. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
# HO … higher-order
class SliceHOFeatureVec(object):
def __init__(self, slice_i, entries_per_slice, feature_vec):
self.feature_vec = feature_vec
self.slice = slice(slice_i * entries_per_slice,
(s... | <commit_before><commit_msg>Add function approximator to deal with off-switch
I had forgotten to add this one earlier.<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
# HO … higher-order
class SliceHOFeatureVec(object):
def __init__(self, slice_i, entries_per_slice, feature_vec):
self.feature_vec = feature_vec
self.slice = slice(slice_i * entries_per_slice,
(s... | Add function approximator to deal with off-switch
I had forgotten to add this one earlier.# -*- coding: utf-8 -*-
from __future__ import unicode_literals
# HO … higher-order
class SliceHOFeatureVec(object):
def __init__(self, slice_i, entries_per_slice, feature_vec):
self.feature_vec = feature_vec
... | <commit_before><commit_msg>Add function approximator to deal with off-switch
I had forgotten to add this one earlier.<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
# HO … higher-order
class SliceHOFeatureVec(object):
def __init__(self, slice_i, entries_per_slice, feature_vec):
... | |
2db2727dcccf81c3dca2e86efabd8e40afb223d1 | transfers/pre-transfer/add_metadata.py | transfers/pre-transfer/add_metadata.py | #!/usr/bin/env python2
import json
import os
import sys
def main(transfer_path):
basename = os.path.basename(transfer_path)
try:
_, dc_id, _ = basename.split('---')
except ValueError:
return 1
metadata = [
{
'parts': 'objects',
'dc.identifier': dc_id,
... | Automate Transfers: Add another pre-transfer script | Automate Transfers: Add another pre-transfer script
refs #7369
Create metadata.json based on directory name.
| Python | agpl-3.0 | artefactual/automation-tools,artefactual/automation-tools,finoradin/automation-tools | Automate Transfers: Add another pre-transfer script
refs #7369
Create metadata.json based on directory name. | #!/usr/bin/env python2
import json
import os
import sys
def main(transfer_path):
basename = os.path.basename(transfer_path)
try:
_, dc_id, _ = basename.split('---')
except ValueError:
return 1
metadata = [
{
'parts': 'objects',
'dc.identifier': dc_id,
... | <commit_before><commit_msg>Automate Transfers: Add another pre-transfer script
refs #7369
Create metadata.json based on directory name.<commit_after> | #!/usr/bin/env python2
import json
import os
import sys
def main(transfer_path):
basename = os.path.basename(transfer_path)
try:
_, dc_id, _ = basename.split('---')
except ValueError:
return 1
metadata = [
{
'parts': 'objects',
'dc.identifier': dc_id,
... | Automate Transfers: Add another pre-transfer script
refs #7369
Create metadata.json based on directory name.#!/usr/bin/env python2
import json
import os
import sys
def main(transfer_path):
basename = os.path.basename(transfer_path)
try:
_, dc_id, _ = basename.split('---')
except ValueError:
... | <commit_before><commit_msg>Automate Transfers: Add another pre-transfer script
refs #7369
Create metadata.json based on directory name.<commit_after>#!/usr/bin/env python2
import json
import os
import sys
def main(transfer_path):
basename = os.path.basename(transfer_path)
try:
_, dc_id, _ = basename... | |
53306793268cb31944d42caf95c275afcbe97e6d | course_discovery/apps/edx_catalog_extensions/migrations/0002_create_professional_certificate_program_type.py | course_discovery/apps/edx_catalog_extensions/migrations/0002_create_professional_certificate_program_type.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2016-12-19 19:51
from __future__ import unicode_literals
from django.db import migrations
PAID_SEAT_TYPES = ('credit', 'professional', 'verified',)
PROGRAM_TYPE = 'Professional Certificate'
def add_program_type(apps, schema_editor):
SeatType = apps.get_mod... | Add migration for creating the Professional Certificate program type | Add migration for creating the Professional Certificate program type
ECOM-6594
| Python | agpl-3.0 | edx/course-discovery,edx/course-discovery,edx/course-discovery,edx/course-discovery | Add migration for creating the Professional Certificate program type
ECOM-6594 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2016-12-19 19:51
from __future__ import unicode_literals
from django.db import migrations
PAID_SEAT_TYPES = ('credit', 'professional', 'verified',)
PROGRAM_TYPE = 'Professional Certificate'
def add_program_type(apps, schema_editor):
SeatType = apps.get_mod... | <commit_before><commit_msg>Add migration for creating the Professional Certificate program type
ECOM-6594<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2016-12-19 19:51
from __future__ import unicode_literals
from django.db import migrations
PAID_SEAT_TYPES = ('credit', 'professional', 'verified',)
PROGRAM_TYPE = 'Professional Certificate'
def add_program_type(apps, schema_editor):
SeatType = apps.get_mod... | Add migration for creating the Professional Certificate program type
ECOM-6594# -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2016-12-19 19:51
from __future__ import unicode_literals
from django.db import migrations
PAID_SEAT_TYPES = ('credit', 'professional', 'verified',)
PROGRAM_TYPE = 'Professional Certif... | <commit_before><commit_msg>Add migration for creating the Professional Certificate program type
ECOM-6594<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2016-12-19 19:51
from __future__ import unicode_literals
from django.db import migrations
PAID_SEAT_TYPES = ('credit', 'professional', 'verifi... | |
d9486bc6180a2dfe38a953eb84184e0410e1cb66 | enthought/enable/null/quartz.py | enthought/enable/null/quartz.py | #------------------------------------------------------------------------------
# Copyright (c) 2011, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions describe... | Add a Quartz backend for the null toolkit | Add a Quartz backend for the null toolkit
| Python | bsd-3-clause | tommy-u/enable,tommy-u/enable,tommy-u/enable,tommy-u/enable | Add a Quartz backend for the null toolkit | #------------------------------------------------------------------------------
# Copyright (c) 2011, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions describe... | <commit_before><commit_msg>Add a Quartz backend for the null toolkit<commit_after> | #------------------------------------------------------------------------------
# Copyright (c) 2011, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions describe... | Add a Quartz backend for the null toolkit#------------------------------------------------------------------------------
# Copyright (c) 2011, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistrib... | <commit_before><commit_msg>Add a Quartz backend for the null toolkit<commit_after>#------------------------------------------------------------------------------
# Copyright (c) 2011, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in e... | |
d604429f1d27f8753b8d9665a55111a3b90f0699 | scrapi/util/logging.py | scrapi/util/logging.py | import logging
from datetime import datetime
from fluent import sender
class FluentHandler(logging.Handler):
'''
Logging Handler for fluent.
'''
def __init__(self,
tag,
host='localhost',
port=24224,
timeout=3.0,
verb... | Add homebrew version of fluentd logger | Add homebrew version of fluentd logger
| Python | apache-2.0 | erinspace/scrapi,jeffreyliu3230/scrapi,icereval/scrapi,erinspace/scrapi,CenterForOpenScience/scrapi,CenterForOpenScience/scrapi,felliott/scrapi,alexgarciac/scrapi,ostwald/scrapi,mehanig/scrapi,felliott/scrapi,fabianvf/scrapi,mehanig/scrapi,fabianvf/scrapi | Add homebrew version of fluentd logger | import logging
from datetime import datetime
from fluent import sender
class FluentHandler(logging.Handler):
'''
Logging Handler for fluent.
'''
def __init__(self,
tag,
host='localhost',
port=24224,
timeout=3.0,
verb... | <commit_before><commit_msg>Add homebrew version of fluentd logger<commit_after> | import logging
from datetime import datetime
from fluent import sender
class FluentHandler(logging.Handler):
'''
Logging Handler for fluent.
'''
def __init__(self,
tag,
host='localhost',
port=24224,
timeout=3.0,
verb... | Add homebrew version of fluentd loggerimport logging
from datetime import datetime
from fluent import sender
class FluentHandler(logging.Handler):
'''
Logging Handler for fluent.
'''
def __init__(self,
tag,
host='localhost',
port=24224,
... | <commit_before><commit_msg>Add homebrew version of fluentd logger<commit_after>import logging
from datetime import datetime
from fluent import sender
class FluentHandler(logging.Handler):
'''
Logging Handler for fluent.
'''
def __init__(self,
tag,
host='localhost',
... | |
8fda2e1330277e98b62d3286e5c208d320fc07db | server.py | server.py | from flask import Flask
from flask import json
from flask import Response
import redis
app = Flask(__name__)
r = redis.StrictRedis(host='localhost', port=6379, db=0)
@app.route("/")
def hello():
return "Hello ld!"
@app.route('/properties/')
def show_properties():
props = r.smembers('daftpunk:properties')
... | Add simple api to redis with flask | Add simple api to redis with flask
| Python | mit | keoghpe/daftpunk,nicr9/daftpunk,keoghpe/daftpunk,nicr9/daftpunk,keoghpe/daftpunk,nicr9/daftpunk | Add simple api to redis with flask | from flask import Flask
from flask import json
from flask import Response
import redis
app = Flask(__name__)
r = redis.StrictRedis(host='localhost', port=6379, db=0)
@app.route("/")
def hello():
return "Hello ld!"
@app.route('/properties/')
def show_properties():
props = r.smembers('daftpunk:properties')
... | <commit_before><commit_msg>Add simple api to redis with flask<commit_after> | from flask import Flask
from flask import json
from flask import Response
import redis
app = Flask(__name__)
r = redis.StrictRedis(host='localhost', port=6379, db=0)
@app.route("/")
def hello():
return "Hello ld!"
@app.route('/properties/')
def show_properties():
props = r.smembers('daftpunk:properties')
... | Add simple api to redis with flaskfrom flask import Flask
from flask import json
from flask import Response
import redis
app = Flask(__name__)
r = redis.StrictRedis(host='localhost', port=6379, db=0)
@app.route("/")
def hello():
return "Hello ld!"
@app.route('/properties/')
def show_properties():
props = r.s... | <commit_before><commit_msg>Add simple api to redis with flask<commit_after>from flask import Flask
from flask import json
from flask import Response
import redis
app = Flask(__name__)
r = redis.StrictRedis(host='localhost', port=6379, db=0)
@app.route("/")
def hello():
return "Hello ld!"
@app.route('/properties/... | |
a0702b8ac74c4976cf747880bdfeb86088a16715 | packages/syft/src/syft/core/node/common/node_service/generic_payload/syft_message.py | packages/syft/src/syft/core/node/common/node_service/generic_payload/syft_message.py | # stdlib
from typing import Any
from typing import Dict
from typing import Optional
# third party
from nacl.signing import VerifyKey
# relative
from .....common.message import ImmediateSyftMessage, SignedMessage
from .....common.uid import UID
from .....io.address import Address
from ....abstract.node_service_interfa... | CREATE new Syft Message structure | CREATE new Syft Message structure
| Python | apache-2.0 | OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft | CREATE new Syft Message structure | # stdlib
from typing import Any
from typing import Dict
from typing import Optional
# third party
from nacl.signing import VerifyKey
# relative
from .....common.message import ImmediateSyftMessage, SignedMessage
from .....common.uid import UID
from .....io.address import Address
from ....abstract.node_service_interfa... | <commit_before><commit_msg>CREATE new Syft Message structure<commit_after> | # stdlib
from typing import Any
from typing import Dict
from typing import Optional
# third party
from nacl.signing import VerifyKey
# relative
from .....common.message import ImmediateSyftMessage, SignedMessage
from .....common.uid import UID
from .....io.address import Address
from ....abstract.node_service_interfa... | CREATE new Syft Message structure# stdlib
from typing import Any
from typing import Dict
from typing import Optional
# third party
from nacl.signing import VerifyKey
# relative
from .....common.message import ImmediateSyftMessage, SignedMessage
from .....common.uid import UID
from .....io.address import Address
from ... | <commit_before><commit_msg>CREATE new Syft Message structure<commit_after># stdlib
from typing import Any
from typing import Dict
from typing import Optional
# third party
from nacl.signing import VerifyKey
# relative
from .....common.message import ImmediateSyftMessage, SignedMessage
from .....common.uid import UID
... | |
558c68060903608abe0bbe15303f192eacf529eb | proto_main.py | proto_main.py | from importlib import import_module
def call_harvester(source_name, **kwargs):
harvester = import_module("mdf_indexers.harvesters." + source_name + "_harvester")
harvester.harvest(**kwargs)
def call_converter(sources, input_path=None, metadata=None, verbose=False):
if type(sources) is not list:
so... | Add way to call converters/harvesters in 0.2.0 | Add way to call converters/harvesters in 0.2.0
Converters in 0.2.0 cannot be run directly (breaks relative imports)
and therefore must be imported as modules. proto_main makes this
process easier.
| Python | apache-2.0 | materials-data-facility/forge | Add way to call converters/harvesters in 0.2.0
Converters in 0.2.0 cannot be run directly (breaks relative imports)
and therefore must be imported as modules. proto_main makes this
process easier. | from importlib import import_module
def call_harvester(source_name, **kwargs):
harvester = import_module("mdf_indexers.harvesters." + source_name + "_harvester")
harvester.harvest(**kwargs)
def call_converter(sources, input_path=None, metadata=None, verbose=False):
if type(sources) is not list:
so... | <commit_before><commit_msg>Add way to call converters/harvesters in 0.2.0
Converters in 0.2.0 cannot be run directly (breaks relative imports)
and therefore must be imported as modules. proto_main makes this
process easier.<commit_after> | from importlib import import_module
def call_harvester(source_name, **kwargs):
harvester = import_module("mdf_indexers.harvesters." + source_name + "_harvester")
harvester.harvest(**kwargs)
def call_converter(sources, input_path=None, metadata=None, verbose=False):
if type(sources) is not list:
so... | Add way to call converters/harvesters in 0.2.0
Converters in 0.2.0 cannot be run directly (breaks relative imports)
and therefore must be imported as modules. proto_main makes this
process easier.from importlib import import_module
def call_harvester(source_name, **kwargs):
harvester = import_module("mdf_indexers... | <commit_before><commit_msg>Add way to call converters/harvesters in 0.2.0
Converters in 0.2.0 cannot be run directly (breaks relative imports)
and therefore must be imported as modules. proto_main makes this
process easier.<commit_after>from importlib import import_module
def call_harvester(source_name, **kwargs):
... | |
3bb4f078f2a03b334c2b44378be2b01e54fb7b37 | datasets/management/commands/load_beginner_categories.py | datasets/management/commands/load_beginner_categories.py | from django.core.management.base import BaseCommand
import json
from datasets.models import Dataset, TaxonomyNode
class Command(BaseCommand):
help = 'Load field easy categories from json taxonomy file. ' \
'Use it as python manage.py load_beginner_categories.py ' \
'DATASET_ID PATH/TO/TAOXNO... | Add command load beginner categories | Add command load beginner categories
| Python | agpl-3.0 | MTG/freesound-datasets,MTG/freesound-datasets,MTG/freesound-datasets,MTG/freesound-datasets | Add command load beginner categories | from django.core.management.base import BaseCommand
import json
from datasets.models import Dataset, TaxonomyNode
class Command(BaseCommand):
help = 'Load field easy categories from json taxonomy file. ' \
'Use it as python manage.py load_beginner_categories.py ' \
'DATASET_ID PATH/TO/TAOXNO... | <commit_before><commit_msg>Add command load beginner categories<commit_after> | from django.core.management.base import BaseCommand
import json
from datasets.models import Dataset, TaxonomyNode
class Command(BaseCommand):
help = 'Load field easy categories from json taxonomy file. ' \
'Use it as python manage.py load_beginner_categories.py ' \
'DATASET_ID PATH/TO/TAOXNO... | Add command load beginner categoriesfrom django.core.management.base import BaseCommand
import json
from datasets.models import Dataset, TaxonomyNode
class Command(BaseCommand):
help = 'Load field easy categories from json taxonomy file. ' \
'Use it as python manage.py load_beginner_categories.py ' \
... | <commit_before><commit_msg>Add command load beginner categories<commit_after>from django.core.management.base import BaseCommand
import json
from datasets.models import Dataset, TaxonomyNode
class Command(BaseCommand):
help = 'Load field easy categories from json taxonomy file. ' \
'Use it as python ma... | |
703d97150de1c74b7c1a62b59c1ff7081dec8256 | examples/resolver.py | examples/resolver.py | #!/usr/bin/env python3
""" Example of resolving a service with a known name """
import logging
import sys
from zeroconf import Zeroconf
TYPE = '_test._tcp.local.'
NAME = 'My Service Name'
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
if len(sys.argv) > 1:
assert sys.argv[1:] =... | Add an example of resolving a known service by service name | examples: Add an example of resolving a known service by service name
To use:
* `avahi-publish-service -s 'My Service Name' _test._tcp 0`
* `./examples/resolver.py` should print a `ServiceInfo`
* Kill the `avahi-publish-service` process
* `./examples/resolver.py` should print `None`
Signed-off-by: Simon McVittie <0e1... | Python | lgpl-2.1 | jstasiak/python-zeroconf | examples: Add an example of resolving a known service by service name
To use:
* `avahi-publish-service -s 'My Service Name' _test._tcp 0`
* `./examples/resolver.py` should print a `ServiceInfo`
* Kill the `avahi-publish-service` process
* `./examples/resolver.py` should print `None`
Signed-off-by: Simon McVittie <0e1... | #!/usr/bin/env python3
""" Example of resolving a service with a known name """
import logging
import sys
from zeroconf import Zeroconf
TYPE = '_test._tcp.local.'
NAME = 'My Service Name'
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
if len(sys.argv) > 1:
assert sys.argv[1:] =... | <commit_before><commit_msg>examples: Add an example of resolving a known service by service name
To use:
* `avahi-publish-service -s 'My Service Name' _test._tcp 0`
* `./examples/resolver.py` should print a `ServiceInfo`
* Kill the `avahi-publish-service` process
* `./examples/resolver.py` should print `None`
Signed-... | #!/usr/bin/env python3
""" Example of resolving a service with a known name """
import logging
import sys
from zeroconf import Zeroconf
TYPE = '_test._tcp.local.'
NAME = 'My Service Name'
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
if len(sys.argv) > 1:
assert sys.argv[1:] =... | examples: Add an example of resolving a known service by service name
To use:
* `avahi-publish-service -s 'My Service Name' _test._tcp 0`
* `./examples/resolver.py` should print a `ServiceInfo`
* Kill the `avahi-publish-service` process
* `./examples/resolver.py` should print `None`
Signed-off-by: Simon McVittie <0e1... | <commit_before><commit_msg>examples: Add an example of resolving a known service by service name
To use:
* `avahi-publish-service -s 'My Service Name' _test._tcp 0`
* `./examples/resolver.py` should print a `ServiceInfo`
* Kill the `avahi-publish-service` process
* `./examples/resolver.py` should print `None`
Signed-... | |
039a07bde5975cb6ce40edc43bbd3d931ac5cc92 | exp/influence2/test/RankAggregatorTest.py | exp/influence2/test/RankAggregatorTest.py | import numpy
import unittest
import logging
from exp.influence2.RankAggregator import RankAggregator
import scipy.stats.mstats
import numpy.testing as nptst
class RankAggregatorTest(unittest.TestCase):
def setUp(self):
numpy.random.seed(22)
def testSpearmanFootrule(self):
lis... | Test borda ranking and spearman. | Test borda ranking and spearman.
| Python | bsd-3-clause | charanpald/APGL | Test borda ranking and spearman. | import numpy
import unittest
import logging
from exp.influence2.RankAggregator import RankAggregator
import scipy.stats.mstats
import numpy.testing as nptst
class RankAggregatorTest(unittest.TestCase):
def setUp(self):
numpy.random.seed(22)
def testSpearmanFootrule(self):
lis... | <commit_before><commit_msg>Test borda ranking and spearman.<commit_after> | import numpy
import unittest
import logging
from exp.influence2.RankAggregator import RankAggregator
import scipy.stats.mstats
import numpy.testing as nptst
class RankAggregatorTest(unittest.TestCase):
def setUp(self):
numpy.random.seed(22)
def testSpearmanFootrule(self):
lis... | Test borda ranking and spearman.import numpy
import unittest
import logging
from exp.influence2.RankAggregator import RankAggregator
import scipy.stats.mstats
import numpy.testing as nptst
class RankAggregatorTest(unittest.TestCase):
def setUp(self):
numpy.random.seed(22)
def testSpea... | <commit_before><commit_msg>Test borda ranking and spearman.<commit_after>import numpy
import unittest
import logging
from exp.influence2.RankAggregator import RankAggregator
import scipy.stats.mstats
import numpy.testing as nptst
class RankAggregatorTest(unittest.TestCase):
def setUp(self):
numpy.ra... | |
bcfd9808377878f440cc030178b33e76eb4f031c | chrome/app/PRESUBMIT.py | chrome/app/PRESUBMIT.py | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script for changes affecting chrome/app/
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the... | Add presubmit check to catch use of PRODUCT_NAME in resources. | Add presubmit check to catch use of PRODUCT_NAME in resources.
We should not be adding any new strings resources that use a PRODUCT_NAME
placeholder, because it is difficult to localize in some languages. Add a
presubmit check which shows a warning whenever a line is that contains
PRODUCT_NAME is changed in a .grd fil... | Python | bsd-3-clause | anirudhSK/chromium,ChromiumWebApps/chromium,Fireblend/chromium-crosswalk,jaruba/chromium.src,Jonekee/chromium.src,dednal/chromium.src,crosswalk-project/chromium-crosswalk-efl,markYoungH/chromium.src,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,ondra-novak/chromium.src,Jonekee/chromium.src,Pluto-tv/chromium-crossw... | Add presubmit check to catch use of PRODUCT_NAME in resources.
We should not be adding any new strings resources that use a PRODUCT_NAME
placeholder, because it is difficult to localize in some languages. Add a
presubmit check which shows a warning whenever a line is that contains
PRODUCT_NAME is changed in a .grd fil... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script for changes affecting chrome/app/
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the... | <commit_before><commit_msg>Add presubmit check to catch use of PRODUCT_NAME in resources.
We should not be adding any new strings resources that use a PRODUCT_NAME
placeholder, because it is difficult to localize in some languages. Add a
presubmit check which shows a warning whenever a line is that contains
PRODUCT_NA... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script for changes affecting chrome/app/
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the... | Add presubmit check to catch use of PRODUCT_NAME in resources.
We should not be adding any new strings resources that use a PRODUCT_NAME
placeholder, because it is difficult to localize in some languages. Add a
presubmit check which shows a warning whenever a line is that contains
PRODUCT_NAME is changed in a .grd fil... | <commit_before><commit_msg>Add presubmit check to catch use of PRODUCT_NAME in resources.
We should not be adding any new strings resources that use a PRODUCT_NAME
placeholder, because it is difficult to localize in some languages. Add a
presubmit check which shows a warning whenever a line is that contains
PRODUCT_NA... | |
91773cb6a09f710002e5be03ab9ec0c19b2d6ea3 | src/Scripts/show-term-convert.py | src/Scripts/show-term-convert.py | # Convert from show term to list of rows associated with each term.
import re
term_regex = re.compile("Term\(\"(\S+)\"\)")
rowid_regex = re.compile("\s+RowId\((\S+),\s+(\S+)\)")
this_term = ""
with open("/tmp/show.results.txt") as f:
for line in f:
rowid_match = rowid_regex.match(line)
if rowid_ma... | Add script to extract rows from terms. | Add script to extract rows from terms.
| Python | mit | BitFunnel/BitFunnel,BitFunnel/BitFunnel,danluu/BitFunnel,danluu/BitFunnel,BitFunnel/BitFunnel,danluu/BitFunnel,danluu/BitFunnel,BitFunnel/BitFunnel,danluu/BitFunnel,BitFunnel/BitFunnel,danluu/BitFunnel,BitFunnel/BitFunnel | Add script to extract rows from terms. | # Convert from show term to list of rows associated with each term.
import re
term_regex = re.compile("Term\(\"(\S+)\"\)")
rowid_regex = re.compile("\s+RowId\((\S+),\s+(\S+)\)")
this_term = ""
with open("/tmp/show.results.txt") as f:
for line in f:
rowid_match = rowid_regex.match(line)
if rowid_ma... | <commit_before><commit_msg>Add script to extract rows from terms.<commit_after> | # Convert from show term to list of rows associated with each term.
import re
term_regex = re.compile("Term\(\"(\S+)\"\)")
rowid_regex = re.compile("\s+RowId\((\S+),\s+(\S+)\)")
this_term = ""
with open("/tmp/show.results.txt") as f:
for line in f:
rowid_match = rowid_regex.match(line)
if rowid_ma... | Add script to extract rows from terms.# Convert from show term to list of rows associated with each term.
import re
term_regex = re.compile("Term\(\"(\S+)\"\)")
rowid_regex = re.compile("\s+RowId\((\S+),\s+(\S+)\)")
this_term = ""
with open("/tmp/show.results.txt") as f:
for line in f:
rowid_match = rowid... | <commit_before><commit_msg>Add script to extract rows from terms.<commit_after># Convert from show term to list of rows associated with each term.
import re
term_regex = re.compile("Term\(\"(\S+)\"\)")
rowid_regex = re.compile("\s+RowId\((\S+),\s+(\S+)\)")
this_term = ""
with open("/tmp/show.results.txt") as f:
f... | |
56f8dd435981a28bcb026da0edb395aabd515c29 | opal/tests/test_command_create_random_data.py | opal/tests/test_command_create_random_data.py | """
Unittests for opal.management.commands.create_random_data
"""
from mock import patch, MagicMock
from opal.core.test import OpalTestCase
from opal.management.commands import create_random_data as crd
class StringGeneratorTestCase(OpalTestCase):
def test_string_generator(self):
mock_field = MagicMock(n... | Add a frist test for create_random_data | Add a frist test for create_random_data
| Python | agpl-3.0 | khchine5/opal,khchine5/opal,khchine5/opal | Add a frist test for create_random_data | """
Unittests for opal.management.commands.create_random_data
"""
from mock import patch, MagicMock
from opal.core.test import OpalTestCase
from opal.management.commands import create_random_data as crd
class StringGeneratorTestCase(OpalTestCase):
def test_string_generator(self):
mock_field = MagicMock(n... | <commit_before><commit_msg>Add a frist test for create_random_data<commit_after> | """
Unittests for opal.management.commands.create_random_data
"""
from mock import patch, MagicMock
from opal.core.test import OpalTestCase
from opal.management.commands import create_random_data as crd
class StringGeneratorTestCase(OpalTestCase):
def test_string_generator(self):
mock_field = MagicMock(n... | Add a frist test for create_random_data"""
Unittests for opal.management.commands.create_random_data
"""
from mock import patch, MagicMock
from opal.core.test import OpalTestCase
from opal.management.commands import create_random_data as crd
class StringGeneratorTestCase(OpalTestCase):
def test_string_generator(... | <commit_before><commit_msg>Add a frist test for create_random_data<commit_after>"""
Unittests for opal.management.commands.create_random_data
"""
from mock import patch, MagicMock
from opal.core.test import OpalTestCase
from opal.management.commands import create_random_data as crd
class StringGeneratorTestCase(Opal... | |
787f956539eb5e41467e04b8239ae571fad60da7 | all-domains/tutorials/cracking-the-coding-interview/strings-making-anagrams/solution.py | all-domains/tutorials/cracking-the-coding-interview/strings-making-anagrams/solution.py | # https://www.hackerrank.com/challenges/ctci-making-anagrams
# Python 3
def delete_char_at(s, i):
return s[:i] + s[i+1:]
def number_needed(a, b):
counter = 0
loop_over, reference = (a, b) if len(a) > len(b) else (b, a)
for character in loop_over:
index = reference.find(character)
if i... | Implement code to return how many characters to delete to make 2 strings into an anagram | Implement code to return how many characters to delete to make 2 strings into an anagram
https://www.hackerrank.com/challenges/ctci-making-anagrams
| Python | mit | arvinsim/hackerrank-solutions | Implement code to return how many characters to delete to make 2 strings into an anagram
https://www.hackerrank.com/challenges/ctci-making-anagrams | # https://www.hackerrank.com/challenges/ctci-making-anagrams
# Python 3
def delete_char_at(s, i):
return s[:i] + s[i+1:]
def number_needed(a, b):
counter = 0
loop_over, reference = (a, b) if len(a) > len(b) else (b, a)
for character in loop_over:
index = reference.find(character)
if i... | <commit_before><commit_msg>Implement code to return how many characters to delete to make 2 strings into an anagram
https://www.hackerrank.com/challenges/ctci-making-anagrams<commit_after> | # https://www.hackerrank.com/challenges/ctci-making-anagrams
# Python 3
def delete_char_at(s, i):
return s[:i] + s[i+1:]
def number_needed(a, b):
counter = 0
loop_over, reference = (a, b) if len(a) > len(b) else (b, a)
for character in loop_over:
index = reference.find(character)
if i... | Implement code to return how many characters to delete to make 2 strings into an anagram
https://www.hackerrank.com/challenges/ctci-making-anagrams# https://www.hackerrank.com/challenges/ctci-making-anagrams
# Python 3
def delete_char_at(s, i):
return s[:i] + s[i+1:]
def number_needed(a, b):
counter = 0
... | <commit_before><commit_msg>Implement code to return how many characters to delete to make 2 strings into an anagram
https://www.hackerrank.com/challenges/ctci-making-anagrams<commit_after># https://www.hackerrank.com/challenges/ctci-making-anagrams
# Python 3
def delete_char_at(s, i):
return s[:i] + s[i+1:]
def ... | |
b906082034822a825ec2963864b32d6619cf938a | skimage/segmentation/tests/test_join.py | skimage/segmentation/tests/test_join.py | import numpy as np
from numpy.testing import assert_array_equal, assert_raises
from skimage.segmentation import join_segmentations, relabel_from_one
def test_join_segmentations():
s1 = np.array([[0, 0, 1, 1],
[0, 2, 1, 1],
[2, 2, 2, 1]])
s2 = np.array([[0, 1, 1, 0],
... | Add testing functions for join and relabel | Add testing functions for join and relabel
| Python | bsd-3-clause | pratapvardhan/scikit-image,oew1v07/scikit-image,paalge/scikit-image,GaZ3ll3/scikit-image,emon10005/scikit-image,rjeli/scikit-image,youprofit/scikit-image,ajaybhat/scikit-image,pratapvardhan/scikit-image,warmspringwinds/scikit-image,ofgulban/scikit-image,SamHames/scikit-image,chintak/scikit-image,vighneshbirodkar/scikit... | Add testing functions for join and relabel | import numpy as np
from numpy.testing import assert_array_equal, assert_raises
from skimage.segmentation import join_segmentations, relabel_from_one
def test_join_segmentations():
s1 = np.array([[0, 0, 1, 1],
[0, 2, 1, 1],
[2, 2, 2, 1]])
s2 = np.array([[0, 1, 1, 0],
... | <commit_before><commit_msg>Add testing functions for join and relabel<commit_after> | import numpy as np
from numpy.testing import assert_array_equal, assert_raises
from skimage.segmentation import join_segmentations, relabel_from_one
def test_join_segmentations():
s1 = np.array([[0, 0, 1, 1],
[0, 2, 1, 1],
[2, 2, 2, 1]])
s2 = np.array([[0, 1, 1, 0],
... | Add testing functions for join and relabelimport numpy as np
from numpy.testing import assert_array_equal, assert_raises
from skimage.segmentation import join_segmentations, relabel_from_one
def test_join_segmentations():
s1 = np.array([[0, 0, 1, 1],
[0, 2, 1, 1],
[2, 2, 2, 1]... | <commit_before><commit_msg>Add testing functions for join and relabel<commit_after>import numpy as np
from numpy.testing import assert_array_equal, assert_raises
from skimage.segmentation import join_segmentations, relabel_from_one
def test_join_segmentations():
s1 = np.array([[0, 0, 1, 1],
[0, ... | |
59160eeb24f6311dafce2db34a40f8ba879fd516 | python/ql/test/experimental/dataflow/tainttracking/defaultAdditionalTaintStep/test_attr.py | python/ql/test/experimental/dataflow/tainttracking/defaultAdditionalTaintStep/test_attr.py | # Add taintlib to PATH so it can be imported during runtime without any hassle
import sys; import os; sys.path.append(os.path.dirname(os.path.dirname((__file__))))
from taintlib import *
# This has no runtime impact, but allows autocomplete to work
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from ..taintlib... | Add test showing taint for attr store | Python: Add test showing taint for attr store
In `x.arg = TAINTED_STRING` there is a store step to the attribute `arg`
of `x`. In our taint modeling, we allow _any_ store step with the code
below. This means that we also say there is a taint-step directly from
`TAINTED_STRING` to `x` :|
```codeql
// construction by... | Python | mit | github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql | Python: Add test showing taint for attr store
In `x.arg = TAINTED_STRING` there is a store step to the attribute `arg`
of `x`. In our taint modeling, we allow _any_ store step with the code
below. This means that we also say there is a taint-step directly from
`TAINTED_STRING` to `x` :|
```codeql
// construction by... | # Add taintlib to PATH so it can be imported during runtime without any hassle
import sys; import os; sys.path.append(os.path.dirname(os.path.dirname((__file__))))
from taintlib import *
# This has no runtime impact, but allows autocomplete to work
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from ..taintlib... | <commit_before><commit_msg>Python: Add test showing taint for attr store
In `x.arg = TAINTED_STRING` there is a store step to the attribute `arg`
of `x`. In our taint modeling, we allow _any_ store step with the code
below. This means that we also say there is a taint-step directly from
`TAINTED_STRING` to `x` :|
```... | # Add taintlib to PATH so it can be imported during runtime without any hassle
import sys; import os; sys.path.append(os.path.dirname(os.path.dirname((__file__))))
from taintlib import *
# This has no runtime impact, but allows autocomplete to work
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from ..taintlib... | Python: Add test showing taint for attr store
In `x.arg = TAINTED_STRING` there is a store step to the attribute `arg`
of `x`. In our taint modeling, we allow _any_ store step with the code
below. This means that we also say there is a taint-step directly from
`TAINTED_STRING` to `x` :|
```codeql
// construction by... | <commit_before><commit_msg>Python: Add test showing taint for attr store
In `x.arg = TAINTED_STRING` there is a store step to the attribute `arg`
of `x`. In our taint modeling, we allow _any_ store step with the code
below. This means that we also say there is a taint-step directly from
`TAINTED_STRING` to `x` :|
```... | |
1f92af62d1a58e496c2ce4251676fca3b571e8f1 | django_project/localities/tests/test_model_Specification.py | django_project/localities/tests/test_model_Specification.py | # -*- coding: utf-8 -*-
from django.test import TestCase
from django.db import IntegrityError
from .model_factories import (
SpecificationF,
DomainF,
AttributeF
)
class TestModelSpecification(TestCase):
def test_model_repr(self):
dom = DomainF.create(id=1, name='A domain')
attr = Att... | Add missing specification model tests | Add missing specification model tests
| Python | bsd-2-clause | ismailsunni/healthsites,ismailsunni/healthsites,ismailsunni/healthsites,ismailsunni/healthsites | Add missing specification model tests | # -*- coding: utf-8 -*-
from django.test import TestCase
from django.db import IntegrityError
from .model_factories import (
SpecificationF,
DomainF,
AttributeF
)
class TestModelSpecification(TestCase):
def test_model_repr(self):
dom = DomainF.create(id=1, name='A domain')
attr = Att... | <commit_before><commit_msg>Add missing specification model tests<commit_after> | # -*- coding: utf-8 -*-
from django.test import TestCase
from django.db import IntegrityError
from .model_factories import (
SpecificationF,
DomainF,
AttributeF
)
class TestModelSpecification(TestCase):
def test_model_repr(self):
dom = DomainF.create(id=1, name='A domain')
attr = Att... | Add missing specification model tests# -*- coding: utf-8 -*-
from django.test import TestCase
from django.db import IntegrityError
from .model_factories import (
SpecificationF,
DomainF,
AttributeF
)
class TestModelSpecification(TestCase):
def test_model_repr(self):
dom = DomainF.create(id=1... | <commit_before><commit_msg>Add missing specification model tests<commit_after># -*- coding: utf-8 -*-
from django.test import TestCase
from django.db import IntegrityError
from .model_factories import (
SpecificationF,
DomainF,
AttributeF
)
class TestModelSpecification(TestCase):
def test_model_repr... | |
02bf100a05ed6267ab3fb618c52150fc2d4884f2 | tests/test_contact_parsing.py | tests/test_contact_parsing.py | import aiosip
def test_simple_header():
header = aiosip.Contact.from_header('<sip:pytest@127.0.0.1:7000>')
assert not header['name']
assert dict(header['params']) == {}
assert dict(header['uri']) == {'scheme': 'sip',
'user': 'pytest',
... | Add some basic tests around contact parsing | Add some basic tests around contact parsing
| Python | apache-2.0 | Eyepea/aiosip,sangoma/aiosip | Add some basic tests around contact parsing | import aiosip
def test_simple_header():
header = aiosip.Contact.from_header('<sip:pytest@127.0.0.1:7000>')
assert not header['name']
assert dict(header['params']) == {}
assert dict(header['uri']) == {'scheme': 'sip',
'user': 'pytest',
... | <commit_before><commit_msg>Add some basic tests around contact parsing<commit_after> | import aiosip
def test_simple_header():
header = aiosip.Contact.from_header('<sip:pytest@127.0.0.1:7000>')
assert not header['name']
assert dict(header['params']) == {}
assert dict(header['uri']) == {'scheme': 'sip',
'user': 'pytest',
... | Add some basic tests around contact parsingimport aiosip
def test_simple_header():
header = aiosip.Contact.from_header('<sip:pytest@127.0.0.1:7000>')
assert not header['name']
assert dict(header['params']) == {}
assert dict(header['uri']) == {'scheme': 'sip',
'user':... | <commit_before><commit_msg>Add some basic tests around contact parsing<commit_after>import aiosip
def test_simple_header():
header = aiosip.Contact.from_header('<sip:pytest@127.0.0.1:7000>')
assert not header['name']
assert dict(header['params']) == {}
assert dict(header['uri']) == {'scheme': 'sip',
... | |
f5720f2609bcb19ffca308a3589c8e6171d1f8b7 | tests/test_removepunctuation.py | tests/test_removepunctuation.py | #
import pytest
from sdsc.textutil import removepunctuation
@pytest.mark.parametrize("end", [True, False])
@pytest.mark.parametrize("start", [True, False])
@pytest.mark.parametrize("data", [
# 0 - no quotes
'word',
# 1 - single quote at the start
'¸word',
# 2 - single quote at the end
'word... | Add test cases for removepunctuation | Add test cases for removepunctuation
| Python | lgpl-2.1 | sknorr/suse-doc-style-checker,sknorr/suse-doc-style-checker,sknorr/suse-doc-style-checker | Add test cases for removepunctuation | #
import pytest
from sdsc.textutil import removepunctuation
@pytest.mark.parametrize("end", [True, False])
@pytest.mark.parametrize("start", [True, False])
@pytest.mark.parametrize("data", [
# 0 - no quotes
'word',
# 1 - single quote at the start
'¸word',
# 2 - single quote at the end
'word... | <commit_before><commit_msg>Add test cases for removepunctuation<commit_after> | #
import pytest
from sdsc.textutil import removepunctuation
@pytest.mark.parametrize("end", [True, False])
@pytest.mark.parametrize("start", [True, False])
@pytest.mark.parametrize("data", [
# 0 - no quotes
'word',
# 1 - single quote at the start
'¸word',
# 2 - single quote at the end
'word... | Add test cases for removepunctuation#
import pytest
from sdsc.textutil import removepunctuation
@pytest.mark.parametrize("end", [True, False])
@pytest.mark.parametrize("start", [True, False])
@pytest.mark.parametrize("data", [
# 0 - no quotes
'word',
# 1 - single quote at the start
'¸word',
# 2... | <commit_before><commit_msg>Add test cases for removepunctuation<commit_after>#
import pytest
from sdsc.textutil import removepunctuation
@pytest.mark.parametrize("end", [True, False])
@pytest.mark.parametrize("start", [True, False])
@pytest.mark.parametrize("data", [
# 0 - no quotes
'word',
# 1 - singl... | |
052dbe05c0e1d3e2821857a035e469be2a1055ae | plugins/pass_the_butter.py | plugins/pass_the_butter.py | from espresso.main import robot
@robot.respond(r"(?i)pass the butter")
def pass_the_butter(res):
res.reply(res.msg.user, "What is my purpose in life?")
@robot.respond(r"(?i)you pass butter")
def you_pass_butter(res):
res.send("Oh my god.")
| Add "what is my purpose in life" plugin | Add "what is my purpose in life" plugin
| Python | bsd-3-clause | ratchetrobotics/espresso | Add "what is my purpose in life" plugin | from espresso.main import robot
@robot.respond(r"(?i)pass the butter")
def pass_the_butter(res):
res.reply(res.msg.user, "What is my purpose in life?")
@robot.respond(r"(?i)you pass butter")
def you_pass_butter(res):
res.send("Oh my god.")
| <commit_before><commit_msg>Add "what is my purpose in life" plugin<commit_after> | from espresso.main import robot
@robot.respond(r"(?i)pass the butter")
def pass_the_butter(res):
res.reply(res.msg.user, "What is my purpose in life?")
@robot.respond(r"(?i)you pass butter")
def you_pass_butter(res):
res.send("Oh my god.")
| Add "what is my purpose in life" pluginfrom espresso.main import robot
@robot.respond(r"(?i)pass the butter")
def pass_the_butter(res):
res.reply(res.msg.user, "What is my purpose in life?")
@robot.respond(r"(?i)you pass butter")
def you_pass_butter(res):
res.send("Oh my god.")
| <commit_before><commit_msg>Add "what is my purpose in life" plugin<commit_after>from espresso.main import robot
@robot.respond(r"(?i)pass the butter")
def pass_the_butter(res):
res.reply(res.msg.user, "What is my purpose in life?")
@robot.respond(r"(?i)you pass butter")
def you_pass_butter(res):
res.send("Oh ... | |
5b57686868b595fb4e7b431822fe4c7bf2de6cfb | test/test_uploadbot.py | test/test_uploadbot.py | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Unit tests."""
import unittest
from uploadlibrary.UploadBot import _cut_title
class TestUploadBot(unittest.TestCase):
"""Testing UploadBot methods."""
def test_cut_title_witout_cutting(self):
"""Test _cut_title() without cutting"""
inputs ... | Add unittests for title handling methods | Add unittests for title handling methods
We add some test for our new title cutting method.
| Python | mit | Commonists/MassUploadLibrary | Add unittests for title handling methods
We add some test for our new title cutting method. | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Unit tests."""
import unittest
from uploadlibrary.UploadBot import _cut_title
class TestUploadBot(unittest.TestCase):
"""Testing UploadBot methods."""
def test_cut_title_witout_cutting(self):
"""Test _cut_title() without cutting"""
inputs ... | <commit_before><commit_msg>Add unittests for title handling methods
We add some test for our new title cutting method.<commit_after> | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Unit tests."""
import unittest
from uploadlibrary.UploadBot import _cut_title
class TestUploadBot(unittest.TestCase):
"""Testing UploadBot methods."""
def test_cut_title_witout_cutting(self):
"""Test _cut_title() without cutting"""
inputs ... | Add unittests for title handling methods
We add some test for our new title cutting method.#!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Unit tests."""
import unittest
from uploadlibrary.UploadBot import _cut_title
class TestUploadBot(unittest.TestCase):
"""Testing UploadBot methods."""
def test_cut... | <commit_before><commit_msg>Add unittests for title handling methods
We add some test for our new title cutting method.<commit_after>#!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Unit tests."""
import unittest
from uploadlibrary.UploadBot import _cut_title
class TestUploadBot(unittest.TestCase):
"""Testin... | |
b15c7c044b0c514285bcb8c29b7bcfc8cf777c8b | ormcache/tests/test_signals.py | ormcache/tests/test_signals.py | from django.core.cache import cache
from django.test import SimpleTestCase
from ormcache.signals import cache_hit, cache_missed, cache_invalidated
from ormcache.tests.testapp.models import CachedDummyModel
class SignalsTestCase(SimpleTestCase):
def setUp(self):
self.signal_called = False
self.in... | Add tests for the signals | Add tests for the signals
| Python | mit | educreations/django-ormcache | Add tests for the signals | from django.core.cache import cache
from django.test import SimpleTestCase
from ormcache.signals import cache_hit, cache_missed, cache_invalidated
from ormcache.tests.testapp.models import CachedDummyModel
class SignalsTestCase(SimpleTestCase):
def setUp(self):
self.signal_called = False
self.in... | <commit_before><commit_msg>Add tests for the signals<commit_after> | from django.core.cache import cache
from django.test import SimpleTestCase
from ormcache.signals import cache_hit, cache_missed, cache_invalidated
from ormcache.tests.testapp.models import CachedDummyModel
class SignalsTestCase(SimpleTestCase):
def setUp(self):
self.signal_called = False
self.in... | Add tests for the signalsfrom django.core.cache import cache
from django.test import SimpleTestCase
from ormcache.signals import cache_hit, cache_missed, cache_invalidated
from ormcache.tests.testapp.models import CachedDummyModel
class SignalsTestCase(SimpleTestCase):
def setUp(self):
self.signal_calle... | <commit_before><commit_msg>Add tests for the signals<commit_after>from django.core.cache import cache
from django.test import SimpleTestCase
from ormcache.signals import cache_hit, cache_missed, cache_invalidated
from ormcache.tests.testapp.models import CachedDummyModel
class SignalsTestCase(SimpleTestCase):
d... | |
bf2cc99162389c6b5c18051f01756e17d9d11ce6 | tests/integration/test_rename.py | tests/integration/test_rename.py | """
Test 'rename'.
"""
import subprocess
import unittest
from ._constants import _CLI
from ._misc import Service
@unittest.skip("Wating for Rename")
class Rename1TestCase(unittest.TestCase):
"""
Test 'rename' when pool is non-existant.
"""
_MENU = ['rename']
_POOLNAME = 'deadpool'
_NEW_POOL... | Add a test for rename. | Add a test for rename.
Signed-off-by: mulhern <7b51bcf507bcd7afb72bf8663752c0ddbeb517f6@redhat.com>
| Python | apache-2.0 | stratis-storage/stratis-cli,stratis-storage/stratis-cli | Add a test for rename.
Signed-off-by: mulhern <7b51bcf507bcd7afb72bf8663752c0ddbeb517f6@redhat.com> | """
Test 'rename'.
"""
import subprocess
import unittest
from ._constants import _CLI
from ._misc import Service
@unittest.skip("Wating for Rename")
class Rename1TestCase(unittest.TestCase):
"""
Test 'rename' when pool is non-existant.
"""
_MENU = ['rename']
_POOLNAME = 'deadpool'
_NEW_POOL... | <commit_before><commit_msg>Add a test for rename.
Signed-off-by: mulhern <7b51bcf507bcd7afb72bf8663752c0ddbeb517f6@redhat.com><commit_after> | """
Test 'rename'.
"""
import subprocess
import unittest
from ._constants import _CLI
from ._misc import Service
@unittest.skip("Wating for Rename")
class Rename1TestCase(unittest.TestCase):
"""
Test 'rename' when pool is non-existant.
"""
_MENU = ['rename']
_POOLNAME = 'deadpool'
_NEW_POOL... | Add a test for rename.
Signed-off-by: mulhern <7b51bcf507bcd7afb72bf8663752c0ddbeb517f6@redhat.com>"""
Test 'rename'.
"""
import subprocess
import unittest
from ._constants import _CLI
from ._misc import Service
@unittest.skip("Wating for Rename")
class Rename1TestCase(unittest.TestCase):
"""
Test 'rename... | <commit_before><commit_msg>Add a test for rename.
Signed-off-by: mulhern <7b51bcf507bcd7afb72bf8663752c0ddbeb517f6@redhat.com><commit_after>"""
Test 'rename'.
"""
import subprocess
import unittest
from ._constants import _CLI
from ._misc import Service
@unittest.skip("Wating for Rename")
class Rename1TestCase(uni... | |
59e8fe848da5cfa3874c82776205082764efbe63 | tests/test_python3_regression.py | tests/test_python3_regression.py | from __future__ import absolute_import, division, print_function
def test_no_new_python3_incompatible_code_is_introduced_into_this_module():
import i19
import pytest
import dials.test.python3_regression as py3test
result = py3test.find_new_python3_incompatible_code(i19)
if result is None:
pytest.skip('No... | Enable Jenkins Python3 monster for i19 | Enable Jenkins Python3 monster for i19
| Python | bsd-3-clause | xia2/i19 | Enable Jenkins Python3 monster for i19 | from __future__ import absolute_import, division, print_function
def test_no_new_python3_incompatible_code_is_introduced_into_this_module():
import i19
import pytest
import dials.test.python3_regression as py3test
result = py3test.find_new_python3_incompatible_code(i19)
if result is None:
pytest.skip('No... | <commit_before><commit_msg>Enable Jenkins Python3 monster for i19<commit_after> | from __future__ import absolute_import, division, print_function
def test_no_new_python3_incompatible_code_is_introduced_into_this_module():
import i19
import pytest
import dials.test.python3_regression as py3test
result = py3test.find_new_python3_incompatible_code(i19)
if result is None:
pytest.skip('No... | Enable Jenkins Python3 monster for i19from __future__ import absolute_import, division, print_function
def test_no_new_python3_incompatible_code_is_introduced_into_this_module():
import i19
import pytest
import dials.test.python3_regression as py3test
result = py3test.find_new_python3_incompatible_code(i19)
... | <commit_before><commit_msg>Enable Jenkins Python3 monster for i19<commit_after>from __future__ import absolute_import, division, print_function
def test_no_new_python3_incompatible_code_is_introduced_into_this_module():
import i19
import pytest
import dials.test.python3_regression as py3test
result = py3test.f... | |
391e145b6e82aaa87e2ab23cfea53cb7ae98bc2a | tlsenum/parse_hello.py | tlsenum/parse_hello.py | import construct
from tlsenum import hello_constructs
class ClientHello(object):
@property
def protocol_version(self):
return self._protocol_version
@protocol_version.setter
def protocol_version(self, protocol_version):
assert protocol_version in ["3.0", "1.0", "1.1", "1.2"]
... | Add a work-in-progress parser for the ClientHello message. | Add a work-in-progress parser for the ClientHello message.
| Python | mit | Ayrx/tlsenum,Ayrx/tlsenum | Add a work-in-progress parser for the ClientHello message. | import construct
from tlsenum import hello_constructs
class ClientHello(object):
@property
def protocol_version(self):
return self._protocol_version
@protocol_version.setter
def protocol_version(self, protocol_version):
assert protocol_version in ["3.0", "1.0", "1.1", "1.2"]
... | <commit_before><commit_msg>Add a work-in-progress parser for the ClientHello message.<commit_after> | import construct
from tlsenum import hello_constructs
class ClientHello(object):
@property
def protocol_version(self):
return self._protocol_version
@protocol_version.setter
def protocol_version(self, protocol_version):
assert protocol_version in ["3.0", "1.0", "1.1", "1.2"]
... | Add a work-in-progress parser for the ClientHello message.import construct
from tlsenum import hello_constructs
class ClientHello(object):
@property
def protocol_version(self):
return self._protocol_version
@protocol_version.setter
def protocol_version(self, protocol_version):
asser... | <commit_before><commit_msg>Add a work-in-progress parser for the ClientHello message.<commit_after>import construct
from tlsenum import hello_constructs
class ClientHello(object):
@property
def protocol_version(self):
return self._protocol_version
@protocol_version.setter
def protocol_versi... | |
dbc761530b77c606038f62ed498c192b67321e8f | statsmodels/datasets/tests/test_data.py | statsmodels/datasets/tests/test_data.py | from statsmodels.datasets import co2
def test_co2_python3():
# this failed in pd.to_datetime on Python 3 with pandas <= 0.12.0
dta = co2.load_pandas()
| Test co2 load_data for Python 3. | TST: Test co2 load_data for Python 3.
| Python | bsd-3-clause | nvoron23/statsmodels,wwf5067/statsmodels,wkfwkf/statsmodels,hainm/statsmodels,jstoxrocky/statsmodels,musically-ut/statsmodels,musically-ut/statsmodels,ChadFulton/statsmodels,ChadFulton/statsmodels,ChadFulton/statsmodels,bert9bert/statsmodels,cbmoore/statsmodels,alekz112/statsmodels,bsipocz/statsmodels,bashtage/statsmod... | TST: Test co2 load_data for Python 3. | from statsmodels.datasets import co2
def test_co2_python3():
# this failed in pd.to_datetime on Python 3 with pandas <= 0.12.0
dta = co2.load_pandas()
| <commit_before><commit_msg>TST: Test co2 load_data for Python 3.<commit_after> | from statsmodels.datasets import co2
def test_co2_python3():
# this failed in pd.to_datetime on Python 3 with pandas <= 0.12.0
dta = co2.load_pandas()
| TST: Test co2 load_data for Python 3.from statsmodels.datasets import co2
def test_co2_python3():
# this failed in pd.to_datetime on Python 3 with pandas <= 0.12.0
dta = co2.load_pandas()
| <commit_before><commit_msg>TST: Test co2 load_data for Python 3.<commit_after>from statsmodels.datasets import co2
def test_co2_python3():
# this failed in pd.to_datetime on Python 3 with pandas <= 0.12.0
dta = co2.load_pandas()
| |
bb065a747215b6665eec78c5141b0a0d82296dac | migrations/versions/1400_repair_contact_information_emails_post_data_retention_removal.py | migrations/versions/1400_repair_contact_information_emails_post_data_retention_removal.py | """Replace '<removed>' with '<removed>@{uuid}.com'.format(uuid=str(uuid4())) in contact_information to pass validation.
Revision ID: 1400
Revises: 1390
Create Date: 2019-10-29 09:09:00.000000
"""
from uuid import uuid4
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import table, column
# revisio... | Add migration to replace '<removed>' with '<removed>@{uuid}.com'.format(uuid=str(uuid4())) in contact_information.email to pass validation | Add migration to replace '<removed>' with '<removed>@{uuid}.com'.format(uuid=str(uuid4())) in contact_information.email to pass validation
| Python | mit | alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api | Add migration to replace '<removed>' with '<removed>@{uuid}.com'.format(uuid=str(uuid4())) in contact_information.email to pass validation | """Replace '<removed>' with '<removed>@{uuid}.com'.format(uuid=str(uuid4())) in contact_information to pass validation.
Revision ID: 1400
Revises: 1390
Create Date: 2019-10-29 09:09:00.000000
"""
from uuid import uuid4
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import table, column
# revisio... | <commit_before><commit_msg>Add migration to replace '<removed>' with '<removed>@{uuid}.com'.format(uuid=str(uuid4())) in contact_information.email to pass validation<commit_after> | """Replace '<removed>' with '<removed>@{uuid}.com'.format(uuid=str(uuid4())) in contact_information to pass validation.
Revision ID: 1400
Revises: 1390
Create Date: 2019-10-29 09:09:00.000000
"""
from uuid import uuid4
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import table, column
# revisio... | Add migration to replace '<removed>' with '<removed>@{uuid}.com'.format(uuid=str(uuid4())) in contact_information.email to pass validation"""Replace '<removed>' with '<removed>@{uuid}.com'.format(uuid=str(uuid4())) in contact_information to pass validation.
Revision ID: 1400
Revises: 1390
Create Date: 2019-10-29 09:09... | <commit_before><commit_msg>Add migration to replace '<removed>' with '<removed>@{uuid}.com'.format(uuid=str(uuid4())) in contact_information.email to pass validation<commit_after>"""Replace '<removed>' with '<removed>@{uuid}.com'.format(uuid=str(uuid4())) in contact_information to pass validation.
Revision ID: 1400
Re... | |
5a2042ebd62cefdda82b6e288b4b6d5b0f527fcd | repomgmt/management/commands/repo-add-uploader.py | repomgmt/management/commands/repo-add-uploader.py | #
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# 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... | Add script to add uplaoders to a repo | Add script to add uplaoders to a repo
| Python | apache-2.0 | sorenh/python-django-repomgmt,sorenh/python-django-repomgmt | Add script to add uplaoders to a repo | #
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# 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... | <commit_before><commit_msg>Add script to add uplaoders to a repo<commit_after> | #
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# 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... | Add script to add uplaoders to a repo#
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# 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
#
# h... | <commit_before><commit_msg>Add script to add uplaoders to a repo<commit_after>#
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may ob... | |
4fe8df5d09c554b45d5097ca0574b47703c9b581 | tests/strings/string_format_f_simple.py | tests/strings/string_format_f_simple.py | a = 1.123456
b = 10
c = -30
d = 34
e = 123.456789
f = 892122.129899
# form 0
s = "b=%f" % a
print s
# form 1
s = "b,c,d=%f+%f+%f" % (a, e, f)
print s
| Add another simpler test for %f | Add another simpler test for %f
| Python | mit | buchuki/pyjaco,mattpap/py2js,chrivers/pyjaco,mattpap/py2js,qsnake/py2js,chrivers/pyjaco,chrivers/pyjaco,buchuki/pyjaco,buchuki/pyjaco,qsnake/py2js | Add another simpler test for %f | a = 1.123456
b = 10
c = -30
d = 34
e = 123.456789
f = 892122.129899
# form 0
s = "b=%f" % a
print s
# form 1
s = "b,c,d=%f+%f+%f" % (a, e, f)
print s
| <commit_before><commit_msg>Add another simpler test for %f<commit_after> | a = 1.123456
b = 10
c = -30
d = 34
e = 123.456789
f = 892122.129899
# form 0
s = "b=%f" % a
print s
# form 1
s = "b,c,d=%f+%f+%f" % (a, e, f)
print s
| Add another simpler test for %fa = 1.123456
b = 10
c = -30
d = 34
e = 123.456789
f = 892122.129899
# form 0
s = "b=%f" % a
print s
# form 1
s = "b,c,d=%f+%f+%f" % (a, e, f)
print s
| <commit_before><commit_msg>Add another simpler test for %f<commit_after>a = 1.123456
b = 10
c = -30
d = 34
e = 123.456789
f = 892122.129899
# form 0
s = "b=%f" % a
print s
# form 1
s = "b,c,d=%f+%f+%f" % (a, e, f)
print s
| |
2322b349aac06395382d26a95b5d965ab0f0b326 | statsmodels/tsa/statespace/tests/test_save.py | statsmodels/tsa/statespace/tests/test_save.py | """
Tests of save / load / remove_data state space functionality.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
import pandas as pd
import os
from statsmodels import datasets
from statsmodels.tsa.statespace import (sarimax, structural, varmax,
... | Test save, load functionality in Statespace | TST: Test save, load functionality in Statespace | Python | bsd-3-clause | josef-pkt/statsmodels,josef-pkt/statsmodels,statsmodels/statsmodels,bashtage/statsmodels,jseabold/statsmodels,statsmodels/statsmodels,statsmodels/statsmodels,ChadFulton/statsmodels,bert9bert/statsmodels,bashtage/statsmodels,jseabold/statsmodels,jseabold/statsmodels,bashtage/statsmodels,yl565/statsmodels,jseabold/statsm... | TST: Test save, load functionality in Statespace | """
Tests of save / load / remove_data state space functionality.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
import pandas as pd
import os
from statsmodels import datasets
from statsmodels.tsa.statespace import (sarimax, structural, varmax,
... | <commit_before><commit_msg>TST: Test save, load functionality in Statespace<commit_after> | """
Tests of save / load / remove_data state space functionality.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
import pandas as pd
import os
from statsmodels import datasets
from statsmodels.tsa.statespace import (sarimax, structural, varmax,
... | TST: Test save, load functionality in Statespace"""
Tests of save / load / remove_data state space functionality.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
import pandas as pd
import os
from statsmodels import datasets
from statsmodels.tsa.statespace import (sarimax, str... | <commit_before><commit_msg>TST: Test save, load functionality in Statespace<commit_after>"""
Tests of save / load / remove_data state space functionality.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
import pandas as pd
import os
from statsmodels import datasets
from statsm... | |
83cfb4d135b5eb3eaa4efb3f74ce13d44afb4c5a | tests/test_main.py | tests/test_main.py | import pytest
from cutadapt.__main__ import main
def test_help():
with pytest.raises(SystemExit) as e:
main(["--help"])
assert e.value.args[0] == 0
| Add a test for __main__ | Add a test for __main__
| Python | mit | marcelm/cutadapt | Add a test for __main__ | import pytest
from cutadapt.__main__ import main
def test_help():
with pytest.raises(SystemExit) as e:
main(["--help"])
assert e.value.args[0] == 0
| <commit_before><commit_msg>Add a test for __main__<commit_after> | import pytest
from cutadapt.__main__ import main
def test_help():
with pytest.raises(SystemExit) as e:
main(["--help"])
assert e.value.args[0] == 0
| Add a test for __main__import pytest
from cutadapt.__main__ import main
def test_help():
with pytest.raises(SystemExit) as e:
main(["--help"])
assert e.value.args[0] == 0
| <commit_before><commit_msg>Add a test for __main__<commit_after>import pytest
from cutadapt.__main__ import main
def test_help():
with pytest.raises(SystemExit) as e:
main(["--help"])
assert e.value.args[0] == 0
| |
eb15e17e99212f2d779ef33a1a9dfa7293ad96ad | shoop/core/utils/form_mixins.py | shoop/core/utils/form_mixins.py | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.utils.translation import ugettext_lazy as _
class ProtectedFi... | Add `ProtectedFieldsMixin` for use with `ChangeProtected`s | Add `ProtectedFieldsMixin` for use with `ChangeProtected`s
Refs SHOOP-1896
| Python | agpl-3.0 | shawnadelic/shuup,suutari-ai/shoop,akx/shoop,shawnadelic/shuup,jorge-marques/shoop,akx/shoop,shoopio/shoop,shoopio/shoop,jorge-marques/shoop,taedori81/shoop,hrayr-artunyan/shuup,suutari/shoop,suutari-ai/shoop,suutari/shoop,suutari-ai/shoop,shoopio/shoop,taedori81/shoop,taedori81/shoop,jorge-marques/shoop,akx/shoop,hray... | Add `ProtectedFieldsMixin` for use with `ChangeProtected`s
Refs SHOOP-1896 | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.utils.translation import ugettext_lazy as _
class ProtectedFi... | <commit_before><commit_msg>Add `ProtectedFieldsMixin` for use with `ChangeProtected`s
Refs SHOOP-1896<commit_after> | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.utils.translation import ugettext_lazy as _
class ProtectedFi... | Add `ProtectedFieldsMixin` for use with `ChangeProtected`s
Refs SHOOP-1896# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
... | <commit_before><commit_msg>Add `ProtectedFieldsMixin` for use with `ChangeProtected`s
Refs SHOOP-1896<commit_after># -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in ... | |
e42fcd8a7dfd213c3de8ccc925410ab3dfe68a3c | src/test/trajectory/test_lemniscate_trajectory.py | src/test/trajectory/test_lemniscate_trajectory.py | #!/usr/bin/env python
import unittest
from geometry_msgs.msg import Point
from trajectory.lemniscate_trajectory import LemniscateTrajectory
class LemniscateTrajectoryTest(unittest.TestCase):
def setUp(self):
self.trajectory = LemniscateTrajectory(5, 4)
self.expected_position = Point()
def ... | Test Lemniscate of Bernoulli trajectory | test: Test Lemniscate of Bernoulli trajectory
| Python | mit | bit0001/trajectory_tracking,bit0001/trajectory_tracking | test: Test Lemniscate of Bernoulli trajectory | #!/usr/bin/env python
import unittest
from geometry_msgs.msg import Point
from trajectory.lemniscate_trajectory import LemniscateTrajectory
class LemniscateTrajectoryTest(unittest.TestCase):
def setUp(self):
self.trajectory = LemniscateTrajectory(5, 4)
self.expected_position = Point()
def ... | <commit_before><commit_msg>test: Test Lemniscate of Bernoulli trajectory<commit_after> | #!/usr/bin/env python
import unittest
from geometry_msgs.msg import Point
from trajectory.lemniscate_trajectory import LemniscateTrajectory
class LemniscateTrajectoryTest(unittest.TestCase):
def setUp(self):
self.trajectory = LemniscateTrajectory(5, 4)
self.expected_position = Point()
def ... | test: Test Lemniscate of Bernoulli trajectory#!/usr/bin/env python
import unittest
from geometry_msgs.msg import Point
from trajectory.lemniscate_trajectory import LemniscateTrajectory
class LemniscateTrajectoryTest(unittest.TestCase):
def setUp(self):
self.trajectory = LemniscateTrajectory(5, 4)
... | <commit_before><commit_msg>test: Test Lemniscate of Bernoulli trajectory<commit_after>#!/usr/bin/env python
import unittest
from geometry_msgs.msg import Point
from trajectory.lemniscate_trajectory import LemniscateTrajectory
class LemniscateTrajectoryTest(unittest.TestCase):
def setUp(self):
self.traj... | |
74bfc85ef4533e93a4edf4c16e5a7a6bb175f36b | onetime/views.py | onetime/views.py | from datetime import datetime
from django.http import HttpResponseRedirect, HttpResponseGone
from django.contrib.auth import login
from django.conf import settings
from onetime import utils
from onetime.models import Key
def cleanup(request):
utils.cleanup()
def login(request, key, redirect_invalid_to=None, red... | from datetime import datetime
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseGone
from django.contrib import auth
from django.conf import settings
from onetime import utils
from onetime.models import Key
def cleanup(request):
utils.cleanup()
return HttpResponse('ok', content_type='te... | Simplify the view as the validation logic has already moved to the model | Simplify the view as the validation logic has already moved to
the model
| Python | agpl-3.0 | ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,fajran/django-loginurl,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,vanschelven/cmsplugin-journal,ISIFoundation/influenzanet-website,uploadcare/django-loginurl,ISIFoundation/influenzanet-web... | from datetime import datetime
from django.http import HttpResponseRedirect, HttpResponseGone
from django.contrib.auth import login
from django.conf import settings
from onetime import utils
from onetime.models import Key
def cleanup(request):
utils.cleanup()
def login(request, key, redirect_invalid_to=None, red... | from datetime import datetime
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseGone
from django.contrib import auth
from django.conf import settings
from onetime import utils
from onetime.models import Key
def cleanup(request):
utils.cleanup()
return HttpResponse('ok', content_type='te... | <commit_before>from datetime import datetime
from django.http import HttpResponseRedirect, HttpResponseGone
from django.contrib.auth import login
from django.conf import settings
from onetime import utils
from onetime.models import Key
def cleanup(request):
utils.cleanup()
def login(request, key, redirect_inval... | from datetime import datetime
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseGone
from django.contrib import auth
from django.conf import settings
from onetime import utils
from onetime.models import Key
def cleanup(request):
utils.cleanup()
return HttpResponse('ok', content_type='te... | from datetime import datetime
from django.http import HttpResponseRedirect, HttpResponseGone
from django.contrib.auth import login
from django.conf import settings
from onetime import utils
from onetime.models import Key
def cleanup(request):
utils.cleanup()
def login(request, key, redirect_invalid_to=None, red... | <commit_before>from datetime import datetime
from django.http import HttpResponseRedirect, HttpResponseGone
from django.contrib.auth import login
from django.conf import settings
from onetime import utils
from onetime.models import Key
def cleanup(request):
utils.cleanup()
def login(request, key, redirect_inval... |
0d85832a82c0973c89f3f321e1f2e2486a197882 | bin/partial_upload.py | bin/partial_upload.py | #!/bin/env python
# -*- coding: utf8 -*-
""" Triggers a partial upload process with the specified raw.xz URL. """
import argparse
from fedimg.config import AWS_ACCESS_ID
from fedimg.config import AWS_SECRET_KEY
from fedimg.config import AWS_BASE_REGION, AWS_REGIONS
from fedimg.services.ec2.ec2copy import main as ec2c... | Add script to perform partial upload | scripts: Add script to perform partial upload
Signed-off-by: Sayan Chowdhury <5f0367a2b3b757615b57f51d912cf16f2c0ad827@gmail.com>
| Python | agpl-3.0 | fedora-infra/fedimg,fedora-infra/fedimg | scripts: Add script to perform partial upload
Signed-off-by: Sayan Chowdhury <5f0367a2b3b757615b57f51d912cf16f2c0ad827@gmail.com> | #!/bin/env python
# -*- coding: utf8 -*-
""" Triggers a partial upload process with the specified raw.xz URL. """
import argparse
from fedimg.config import AWS_ACCESS_ID
from fedimg.config import AWS_SECRET_KEY
from fedimg.config import AWS_BASE_REGION, AWS_REGIONS
from fedimg.services.ec2.ec2copy import main as ec2c... | <commit_before><commit_msg>scripts: Add script to perform partial upload
Signed-off-by: Sayan Chowdhury <5f0367a2b3b757615b57f51d912cf16f2c0ad827@gmail.com><commit_after> | #!/bin/env python
# -*- coding: utf8 -*-
""" Triggers a partial upload process with the specified raw.xz URL. """
import argparse
from fedimg.config import AWS_ACCESS_ID
from fedimg.config import AWS_SECRET_KEY
from fedimg.config import AWS_BASE_REGION, AWS_REGIONS
from fedimg.services.ec2.ec2copy import main as ec2c... | scripts: Add script to perform partial upload
Signed-off-by: Sayan Chowdhury <5f0367a2b3b757615b57f51d912cf16f2c0ad827@gmail.com>#!/bin/env python
# -*- coding: utf8 -*-
""" Triggers a partial upload process with the specified raw.xz URL. """
import argparse
from fedimg.config import AWS_ACCESS_ID
from fedimg.config... | <commit_before><commit_msg>scripts: Add script to perform partial upload
Signed-off-by: Sayan Chowdhury <5f0367a2b3b757615b57f51d912cf16f2c0ad827@gmail.com><commit_after>#!/bin/env python
# -*- coding: utf8 -*-
""" Triggers a partial upload process with the specified raw.xz URL. """
import argparse
from fedimg.confi... | |
1a49426497819c13ccf858d51e5fa333d95f1f7d | src/autobot/src/udpRemote_test.py | src/autobot/src/udpRemote_test.py | #!/usr/bin/env python
import unittest
from udpRemote import parseCommand
class MockDriveParam:
velocity = 0.0
angle = 0.0
class UdpRemoteTest(unittest.TestCase):
def testValidParse(self):
p = MockDriveParam()
p = parseCommand("V44.4", p)
self.assertEqual(p.velocity, 44.4)
... | Add basic unit test for parseCommand | Add basic unit test for parseCommand
| Python | mit | atkvo/masters-bot,atkvo/masters-bot,atkvo/masters-bot,atkvo/masters-bot,atkvo/masters-bot | Add basic unit test for parseCommand | #!/usr/bin/env python
import unittest
from udpRemote import parseCommand
class MockDriveParam:
velocity = 0.0
angle = 0.0
class UdpRemoteTest(unittest.TestCase):
def testValidParse(self):
p = MockDriveParam()
p = parseCommand("V44.4", p)
self.assertEqual(p.velocity, 44.4)
... | <commit_before><commit_msg>Add basic unit test for parseCommand<commit_after> | #!/usr/bin/env python
import unittest
from udpRemote import parseCommand
class MockDriveParam:
velocity = 0.0
angle = 0.0
class UdpRemoteTest(unittest.TestCase):
def testValidParse(self):
p = MockDriveParam()
p = parseCommand("V44.4", p)
self.assertEqual(p.velocity, 44.4)
... | Add basic unit test for parseCommand#!/usr/bin/env python
import unittest
from udpRemote import parseCommand
class MockDriveParam:
velocity = 0.0
angle = 0.0
class UdpRemoteTest(unittest.TestCase):
def testValidParse(self):
p = MockDriveParam()
p = parseCommand("V44.4", p)
self.... | <commit_before><commit_msg>Add basic unit test for parseCommand<commit_after>#!/usr/bin/env python
import unittest
from udpRemote import parseCommand
class MockDriveParam:
velocity = 0.0
angle = 0.0
class UdpRemoteTest(unittest.TestCase):
def testValidParse(self):
p = MockDriveParam()
p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.