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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11889613df601a54a169bb51511e6eb54dec3988 | tree.py | tree.py | import math
def succ_fcn(x):
"""
takes an element of the Calkin Wilf tree and returns the next element
following a breadth first traversal
"""
return 1 / (math.floor(x) + 1 - (x % 1))
def get_nth(n):
"""
takes a natural number n and returns the nth element of the Calkin Wilf tree
foll... | import math
def succ_fcn(x):
"""
takes an element of the Calkin Wilf tree and returns the next element
following a breadth first traversal
"""
return 1 / (math.floor(x) + 1 - (x % 1))
def get_nth(n):
"""
takes a natural number n and returns the nth element of the Calkin Wilf tree
fol... | Add basic breadth first return | Add basic breadth first return
| Python | mit | richardmillson/Calkin_Wilf_tree | import math
def succ_fcn(x):
"""
takes an element of the Calkin Wilf tree and returns the next element
following a breadth first traversal
"""
return 1 / (math.floor(x) + 1 - (x % 1))
def get_nth(n):
"""
takes a natural number n and returns the nth element of the Calkin Wilf tree
foll... | import math
def succ_fcn(x):
"""
takes an element of the Calkin Wilf tree and returns the next element
following a breadth first traversal
"""
return 1 / (math.floor(x) + 1 - (x % 1))
def get_nth(n):
"""
takes a natural number n and returns the nth element of the Calkin Wilf tree
fol... | <commit_before>import math
def succ_fcn(x):
"""
takes an element of the Calkin Wilf tree and returns the next element
following a breadth first traversal
"""
return 1 / (math.floor(x) + 1 - (x % 1))
def get_nth(n):
"""
takes a natural number n and returns the nth element of the Calkin Wil... | import math
def succ_fcn(x):
"""
takes an element of the Calkin Wilf tree and returns the next element
following a breadth first traversal
"""
return 1 / (math.floor(x) + 1 - (x % 1))
def get_nth(n):
"""
takes a natural number n and returns the nth element of the Calkin Wilf tree
fol... | import math
def succ_fcn(x):
"""
takes an element of the Calkin Wilf tree and returns the next element
following a breadth first traversal
"""
return 1 / (math.floor(x) + 1 - (x % 1))
def get_nth(n):
"""
takes a natural number n and returns the nth element of the Calkin Wilf tree
foll... | <commit_before>import math
def succ_fcn(x):
"""
takes an element of the Calkin Wilf tree and returns the next element
following a breadth first traversal
"""
return 1 / (math.floor(x) + 1 - (x % 1))
def get_nth(n):
"""
takes a natural number n and returns the nth element of the Calkin Wil... |
feb630b75f2a28bb098a4a192a4bbb528e2251fa | addons/email/res_partner.py | addons/email/res_partner.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | Remove history domain in partner in eamil module. | Remove history domain in partner in eamil module.
bzr revid: ysa@tinyerp.com-20110204091248-wnzm7ft6cx3v34p1 | Python | agpl-3.0 | gsmartway/odoo,odootr/odoo,gdgellatly/OCB1,frouty/odoo_oph,waytai/odoo,NeovaHealth/odoo,jpshort/odoo,zchking/odoo,Elico-Corp/odoo_OCB,Maspear/odoo,takis/odoo,Gitlab11/odoo,0k/OpenUpgrade,gsmartway/odoo,grap/OpenUpgrade,cloud9UG/odoo,jfpla/odoo,syci/OCB,joariasl/odoo,vrenaville/ngo-addons-backport,mmbtba/odoo,osvalr/odo... | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | <commit_before># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the t... | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | <commit_before># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the t... |
a80297b8e52ccc2560bcd0b8a204dad7eab4c925 | website_payment_v10/__init__.py | website_payment_v10/__init__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
| Use global LICENSE/COPYRIGHT files, remove boilerplate text | [LEGAL] Use global LICENSE/COPYRIGHT files, remove boilerplate text
- Preserved explicit 3rd-party copyright notices
- Explicit boilerplate should not be necessary - copyright law applies
automatically in all countries thanks to Berne Convention + WTO rules,
and a reference to the applicable license is clear enoug... | Python | agpl-3.0 | nicolas-petit/website,JayVora-SerpentCS/website,RoelAdriaans-B-informed/website,Tecnativa/website,RoelAdriaans-B-informed/website,khaeusler/website,khaeusler/website,Tecnativa/website,nicolas-petit/website,nicolas-petit/website,JayVora-SerpentCS/website,RoelAdriaans-B-informed/website,RoelAdriaans-B-informed/website,kh... | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
| <commit_before># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it u... | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
| # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | <commit_before># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it u... |
70a9da61f49b3f9a59cf0717daf23acb638851c1 | powerline/lib/shell.py | powerline/lib/shell.py | # vim:fileencoding=utf-8:noet
from subprocess import Popen, PIPE
def run_cmd(pl, cmd, stdin=None):
try:
p = Popen(cmd, stdout=PIPE, stdin=PIPE)
except OSError as e:
pl.exception('Could not execute command ({0}): {1}'.format(e, cmd))
return None
else:
stdout, err = p.communicate(stdin)
return stdout.strip... | # vim:fileencoding=utf-8:noet
from subprocess import Popen, PIPE
def run_cmd(pl, cmd, stdin=None):
try:
p = Popen(cmd, stdout=PIPE, stdin=PIPE)
except OSError as e:
pl.exception('Could not execute command ({0}): {1}', e, cmd)
return None
else:
stdout, err = p.communicate(stdin)
return stdout.strip()
de... | Format in PowerlineLogger._log, not in pl.exception arguments | Format in PowerlineLogger._log, not in pl.exception arguments
| Python | mit | blindFS/powerline,dragon788/powerline,EricSB/powerline,DoctorJellyface/powerline,cyrixhero/powerline,russellb/powerline,lukw00/powerline,bartvm/powerline,junix/powerline,kenrachynski/powerline,junix/powerline,dragon788/powerline,IvanAli/powerline,darac/powerline,blindFS/powerline,prvnkumar/powerline,wfscheper/powerline... | # vim:fileencoding=utf-8:noet
from subprocess import Popen, PIPE
def run_cmd(pl, cmd, stdin=None):
try:
p = Popen(cmd, stdout=PIPE, stdin=PIPE)
except OSError as e:
pl.exception('Could not execute command ({0}): {1}'.format(e, cmd))
return None
else:
stdout, err = p.communicate(stdin)
return stdout.strip... | # vim:fileencoding=utf-8:noet
from subprocess import Popen, PIPE
def run_cmd(pl, cmd, stdin=None):
try:
p = Popen(cmd, stdout=PIPE, stdin=PIPE)
except OSError as e:
pl.exception('Could not execute command ({0}): {1}', e, cmd)
return None
else:
stdout, err = p.communicate(stdin)
return stdout.strip()
de... | <commit_before># vim:fileencoding=utf-8:noet
from subprocess import Popen, PIPE
def run_cmd(pl, cmd, stdin=None):
try:
p = Popen(cmd, stdout=PIPE, stdin=PIPE)
except OSError as e:
pl.exception('Could not execute command ({0}): {1}'.format(e, cmd))
return None
else:
stdout, err = p.communicate(stdin)
retu... | # vim:fileencoding=utf-8:noet
from subprocess import Popen, PIPE
def run_cmd(pl, cmd, stdin=None):
try:
p = Popen(cmd, stdout=PIPE, stdin=PIPE)
except OSError as e:
pl.exception('Could not execute command ({0}): {1}', e, cmd)
return None
else:
stdout, err = p.communicate(stdin)
return stdout.strip()
de... | # vim:fileencoding=utf-8:noet
from subprocess import Popen, PIPE
def run_cmd(pl, cmd, stdin=None):
try:
p = Popen(cmd, stdout=PIPE, stdin=PIPE)
except OSError as e:
pl.exception('Could not execute command ({0}): {1}'.format(e, cmd))
return None
else:
stdout, err = p.communicate(stdin)
return stdout.strip... | <commit_before># vim:fileencoding=utf-8:noet
from subprocess import Popen, PIPE
def run_cmd(pl, cmd, stdin=None):
try:
p = Popen(cmd, stdout=PIPE, stdin=PIPE)
except OSError as e:
pl.exception('Could not execute command ({0}): {1}'.format(e, cmd))
return None
else:
stdout, err = p.communicate(stdin)
retu... |
e7805528be294374b128dd6e40e3f8990b03cdac | main.py | main.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Run the Better Bomb Defusal Manual
:Copyright: 2015 Jochen Kupperschmidt
:License: MIT, see LICENSE for details.
"""
from importlib import import_module
from bombdefusalmanual.ui.console import ConsoleUI
from bombdefusalmanual.ui.models import Answer
ANSWERS = [
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Run the Better Bomb Defusal Manual
:Copyright: 2015 Jochen Kupperschmidt
:License: MIT, see LICENSE for details.
"""
from argparse import ArgumentParser
from importlib import import_module
from bombdefusalmanual.ui.console import ConsoleUI
from bombdefusalmanual.ui.m... | Allow to enable graphical UI via command line option. | Allow to enable graphical UI via command line option.
| Python | mit | homeworkprod/better-bomb-defusal-manual,homeworkprod/better-bomb-defusal-manual | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Run the Better Bomb Defusal Manual
:Copyright: 2015 Jochen Kupperschmidt
:License: MIT, see LICENSE for details.
"""
from importlib import import_module
from bombdefusalmanual.ui.console import ConsoleUI
from bombdefusalmanual.ui.models import Answer
ANSWERS = [
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Run the Better Bomb Defusal Manual
:Copyright: 2015 Jochen Kupperschmidt
:License: MIT, see LICENSE for details.
"""
from argparse import ArgumentParser
from importlib import import_module
from bombdefusalmanual.ui.console import ConsoleUI
from bombdefusalmanual.ui.m... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Run the Better Bomb Defusal Manual
:Copyright: 2015 Jochen Kupperschmidt
:License: MIT, see LICENSE for details.
"""
from importlib import import_module
from bombdefusalmanual.ui.console import ConsoleUI
from bombdefusalmanual.ui.models import Answer
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Run the Better Bomb Defusal Manual
:Copyright: 2015 Jochen Kupperschmidt
:License: MIT, see LICENSE for details.
"""
from argparse import ArgumentParser
from importlib import import_module
from bombdefusalmanual.ui.console import ConsoleUI
from bombdefusalmanual.ui.m... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Run the Better Bomb Defusal Manual
:Copyright: 2015 Jochen Kupperschmidt
:License: MIT, see LICENSE for details.
"""
from importlib import import_module
from bombdefusalmanual.ui.console import ConsoleUI
from bombdefusalmanual.ui.models import Answer
ANSWERS = [
... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Run the Better Bomb Defusal Manual
:Copyright: 2015 Jochen Kupperschmidt
:License: MIT, see LICENSE for details.
"""
from importlib import import_module
from bombdefusalmanual.ui.console import ConsoleUI
from bombdefusalmanual.ui.models import Answer
... |
8541737b5a3a50188162349727a0d0230613e630 | test/features/test_create_pages.py | test/features/test_create_pages.py | from hamcrest import *
from nose.tools import nottest
from test.features import BrowserTest
class test_create_pages(BrowserTest):
def test_about_page(self):
self.browser.visit("http://0.0.0.0:8000/high-volume-services/by-transactions-per-year/descending")
assert_that(self.browser.find_by_css('h1... | from hamcrest import *
from nose.tools import nottest
from test.features import BrowserTest
class test_create_pages(BrowserTest):
def test_about_page(self):
self.browser.visit("http://0.0.0.0:8000/high-volume-services/"
"by-transactions-per-year/descending")
assert_tha... | Change services number in test | Change services number in test
| Python | mit | alphagov/transactions-explorer,gds-attic/transactions-explorer,alphagov/transactions-explorer,alphagov/transactions-explorer,gds-attic/transactions-explorer,gds-attic/transactions-explorer,alphagov/transactions-explorer,alphagov/transactions-explorer,gds-attic/transactions-explorer,gds-attic/transactions-explorer | from hamcrest import *
from nose.tools import nottest
from test.features import BrowserTest
class test_create_pages(BrowserTest):
def test_about_page(self):
self.browser.visit("http://0.0.0.0:8000/high-volume-services/by-transactions-per-year/descending")
assert_that(self.browser.find_by_css('h1... | from hamcrest import *
from nose.tools import nottest
from test.features import BrowserTest
class test_create_pages(BrowserTest):
def test_about_page(self):
self.browser.visit("http://0.0.0.0:8000/high-volume-services/"
"by-transactions-per-year/descending")
assert_tha... | <commit_before>from hamcrest import *
from nose.tools import nottest
from test.features import BrowserTest
class test_create_pages(BrowserTest):
def test_about_page(self):
self.browser.visit("http://0.0.0.0:8000/high-volume-services/by-transactions-per-year/descending")
assert_that(self.browser.... | from hamcrest import *
from nose.tools import nottest
from test.features import BrowserTest
class test_create_pages(BrowserTest):
def test_about_page(self):
self.browser.visit("http://0.0.0.0:8000/high-volume-services/"
"by-transactions-per-year/descending")
assert_tha... | from hamcrest import *
from nose.tools import nottest
from test.features import BrowserTest
class test_create_pages(BrowserTest):
def test_about_page(self):
self.browser.visit("http://0.0.0.0:8000/high-volume-services/by-transactions-per-year/descending")
assert_that(self.browser.find_by_css('h1... | <commit_before>from hamcrest import *
from nose.tools import nottest
from test.features import BrowserTest
class test_create_pages(BrowserTest):
def test_about_page(self):
self.browser.visit("http://0.0.0.0:8000/high-volume-services/by-transactions-per-year/descending")
assert_that(self.browser.... |
9696b687a31a249fc228e58773ff55eacf8beaaa | src/vrun/compat.py | src/vrun/compat.py | # flake8: noqa
import sys
PY2 = sys.version_info[0] == 2
try:
from configparser import ConfigParser
except ImportError:
from ConfigParser import SafeConfigParser as ConfigParser
| # flake8: noqa
import sys
PY2 = sys.version_info[0] == 2
try:
from configparser import ConfigParser
except ImportError:
from ConfigParser import SafeConfigParser as ConfigParser
if not hasattr(ConfigParser, 'read_dict'):
def read_dict(self, dictionary, source='<dict>'):
for (section, options) in... | Add a read_dict function if it does not exist | Add a read_dict function if it does not exist
This is used for testing purposes, but when we drop Py2 support we can
more easily remove it here than worrying about removing a monkeypatch in
the testing code.
| Python | isc | bertjwregeer/vrun | # flake8: noqa
import sys
PY2 = sys.version_info[0] == 2
try:
from configparser import ConfigParser
except ImportError:
from ConfigParser import SafeConfigParser as ConfigParser
Add a read_dict function if it does not exist
This is used for testing purposes, but when we drop Py2 support we can
more easily r... | # flake8: noqa
import sys
PY2 = sys.version_info[0] == 2
try:
from configparser import ConfigParser
except ImportError:
from ConfigParser import SafeConfigParser as ConfigParser
if not hasattr(ConfigParser, 'read_dict'):
def read_dict(self, dictionary, source='<dict>'):
for (section, options) in... | <commit_before># flake8: noqa
import sys
PY2 = sys.version_info[0] == 2
try:
from configparser import ConfigParser
except ImportError:
from ConfigParser import SafeConfigParser as ConfigParser
<commit_msg>Add a read_dict function if it does not exist
This is used for testing purposes, but when we drop Py2 s... | # flake8: noqa
import sys
PY2 = sys.version_info[0] == 2
try:
from configparser import ConfigParser
except ImportError:
from ConfigParser import SafeConfigParser as ConfigParser
if not hasattr(ConfigParser, 'read_dict'):
def read_dict(self, dictionary, source='<dict>'):
for (section, options) in... | # flake8: noqa
import sys
PY2 = sys.version_info[0] == 2
try:
from configparser import ConfigParser
except ImportError:
from ConfigParser import SafeConfigParser as ConfigParser
Add a read_dict function if it does not exist
This is used for testing purposes, but when we drop Py2 support we can
more easily r... | <commit_before># flake8: noqa
import sys
PY2 = sys.version_info[0] == 2
try:
from configparser import ConfigParser
except ImportError:
from ConfigParser import SafeConfigParser as ConfigParser
<commit_msg>Add a read_dict function if it does not exist
This is used for testing purposes, but when we drop Py2 s... |
a1a6312a34bebec7045169727192380a3e76cf39 | tests/app/main/test_application.py | tests/app/main/test_application.py | import mock
from nose.tools import assert_equal, assert_true
from ..helpers import BaseApplicationTest
class TestApplication(BaseApplicationTest):
def setup(self):
super(TestApplication, self).setup()
def test_analytics_code_should_be_in_javascript(self):
res = self.client.get('/suppliers/sta... | import mock
from nose.tools import assert_equal, assert_true
from ..helpers import BaseApplicationTest
class TestApplication(BaseApplicationTest):
def setup(self):
super(TestApplication, self).setup()
def test_analytics_code_should_be_in_javascript(self):
res = self.client.get('/suppliers/sta... | Allow test for analytics to deal with compiled JS | Allow test for analytics to deal with compiled JS
| Python | mit | alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend | import mock
from nose.tools import assert_equal, assert_true
from ..helpers import BaseApplicationTest
class TestApplication(BaseApplicationTest):
def setup(self):
super(TestApplication, self).setup()
def test_analytics_code_should_be_in_javascript(self):
res = self.client.get('/suppliers/sta... | import mock
from nose.tools import assert_equal, assert_true
from ..helpers import BaseApplicationTest
class TestApplication(BaseApplicationTest):
def setup(self):
super(TestApplication, self).setup()
def test_analytics_code_should_be_in_javascript(self):
res = self.client.get('/suppliers/sta... | <commit_before>import mock
from nose.tools import assert_equal, assert_true
from ..helpers import BaseApplicationTest
class TestApplication(BaseApplicationTest):
def setup(self):
super(TestApplication, self).setup()
def test_analytics_code_should_be_in_javascript(self):
res = self.client.get(... | import mock
from nose.tools import assert_equal, assert_true
from ..helpers import BaseApplicationTest
class TestApplication(BaseApplicationTest):
def setup(self):
super(TestApplication, self).setup()
def test_analytics_code_should_be_in_javascript(self):
res = self.client.get('/suppliers/sta... | import mock
from nose.tools import assert_equal, assert_true
from ..helpers import BaseApplicationTest
class TestApplication(BaseApplicationTest):
def setup(self):
super(TestApplication, self).setup()
def test_analytics_code_should_be_in_javascript(self):
res = self.client.get('/suppliers/sta... | <commit_before>import mock
from nose.tools import assert_equal, assert_true
from ..helpers import BaseApplicationTest
class TestApplication(BaseApplicationTest):
def setup(self):
super(TestApplication, self).setup()
def test_analytics_code_should_be_in_javascript(self):
res = self.client.get(... |
5da3928442a884c7b5905ca2b17362ca99fffc2c | marten/__init__.py | marten/__init__.py | """Stupid simple Python configuration management"""
from __future__ import absolute_import
import os as _os
__version__ = '0.5.0'
# Attempt to auto-load a default configuration from files in <cwd>/.marten/ based on the MARTEN_ENV env variable
# MARTEN_ENV defaults to 'default'
config = None
_marten_dir = _os.path... | """Stupid simple Python configuration management"""
from __future__ import absolute_import
import os as _os
__version__ = '0.5.1'
# Attempt to auto-load a default configuration from files in <cwd>/.marten/ based on the MARTEN_ENV env variable
# MARTEN_ENV defaults to 'default'
_marten_dir = _os.path.join(_os.getc... | Return empty Configuration instance when .marten/ directory is missing | Return empty Configuration instance when .marten/ directory is missing
| Python | mit | nick-allen/marten | """Stupid simple Python configuration management"""
from __future__ import absolute_import
import os as _os
__version__ = '0.5.0'
# Attempt to auto-load a default configuration from files in <cwd>/.marten/ based on the MARTEN_ENV env variable
# MARTEN_ENV defaults to 'default'
config = None
_marten_dir = _os.path... | """Stupid simple Python configuration management"""
from __future__ import absolute_import
import os as _os
__version__ = '0.5.1'
# Attempt to auto-load a default configuration from files in <cwd>/.marten/ based on the MARTEN_ENV env variable
# MARTEN_ENV defaults to 'default'
_marten_dir = _os.path.join(_os.getc... | <commit_before>"""Stupid simple Python configuration management"""
from __future__ import absolute_import
import os as _os
__version__ = '0.5.0'
# Attempt to auto-load a default configuration from files in <cwd>/.marten/ based on the MARTEN_ENV env variable
# MARTEN_ENV defaults to 'default'
config = None
_marten... | """Stupid simple Python configuration management"""
from __future__ import absolute_import
import os as _os
__version__ = '0.5.1'
# Attempt to auto-load a default configuration from files in <cwd>/.marten/ based on the MARTEN_ENV env variable
# MARTEN_ENV defaults to 'default'
_marten_dir = _os.path.join(_os.getc... | """Stupid simple Python configuration management"""
from __future__ import absolute_import
import os as _os
__version__ = '0.5.0'
# Attempt to auto-load a default configuration from files in <cwd>/.marten/ based on the MARTEN_ENV env variable
# MARTEN_ENV defaults to 'default'
config = None
_marten_dir = _os.path... | <commit_before>"""Stupid simple Python configuration management"""
from __future__ import absolute_import
import os as _os
__version__ = '0.5.0'
# Attempt to auto-load a default configuration from files in <cwd>/.marten/ based on the MARTEN_ENV env variable
# MARTEN_ENV defaults to 'default'
config = None
_marten... |
c39d3801beece54d7403b1a1c7956839aa20df79 | plot.py | plot.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import matplotlib.pyplot as plt
import pandas as pd
parser = argparse.ArgumentParser(description='Plot data from output of the n-body simulation.')
parser.add_argument('--output', type=str, default='output_int.dat',
help='The output file (d... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import matplotlib.pyplot as plt
import pandas as pd
parser = argparse.ArgumentParser(description='Plot data from output of the n-body simulation.')
parser.add_argument('--output', type=str, default='output_int.dat',
help='The output file (d... | Use absolute value for E and logscale | Use absolute value for E and logscale
| Python | mit | cphyc/n-body,cphyc/n-body | #!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import matplotlib.pyplot as plt
import pandas as pd
parser = argparse.ArgumentParser(description='Plot data from output of the n-body simulation.')
parser.add_argument('--output', type=str, default='output_int.dat',
help='The output file (d... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import matplotlib.pyplot as plt
import pandas as pd
parser = argparse.ArgumentParser(description='Plot data from output of the n-body simulation.')
parser.add_argument('--output', type=str, default='output_int.dat',
help='The output file (d... | <commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import matplotlib.pyplot as plt
import pandas as pd
parser = argparse.ArgumentParser(description='Plot data from output of the n-body simulation.')
parser.add_argument('--output', type=str, default='output_int.dat',
help='The... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import matplotlib.pyplot as plt
import pandas as pd
parser = argparse.ArgumentParser(description='Plot data from output of the n-body simulation.')
parser.add_argument('--output', type=str, default='output_int.dat',
help='The output file (d... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import matplotlib.pyplot as plt
import pandas as pd
parser = argparse.ArgumentParser(description='Plot data from output of the n-body simulation.')
parser.add_argument('--output', type=str, default='output_int.dat',
help='The output file (d... | <commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import matplotlib.pyplot as plt
import pandas as pd
parser = argparse.ArgumentParser(description='Plot data from output of the n-body simulation.')
parser.add_argument('--output', type=str, default='output_int.dat',
help='The... |
2d5c1064b951f3628e8a4f4a6fadc9c45d490094 | tools/bots/pub_integration_test.py | tools/bots/pub_integration_test.py | #!/usr/bin/env python
# Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import os
import subprocess
import sys
import shutil
import tempfile
PUBSPEC = """n... | #!/usr/bin/env python
# Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import os
import subprocess
import sys
import shutil
import tempfile
PUBSPEC = """n... | Add .bat to pub command on Windows | [infra] Add .bat to pub command on Windows
#32656
Change-Id: I3a34bf2c81676eea0ab112a8aad701962590a6c3
Reviewed-on: https://dart-review.googlesource.com/55165
Commit-Queue: Alexander Thomas <29642742b6693024c89de8232f2e2542cf7eedf7@google.com>
Reviewed-by: William Hesse <a821cddceae7dc400f272e3cb1a72f400f9fed6d@googl... | Python | bsd-3-clause | dart-lang/sdk,dartino/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dartino/dart-sdk,da... | #!/usr/bin/env python
# Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import os
import subprocess
import sys
import shutil
import tempfile
PUBSPEC = """n... | #!/usr/bin/env python
# Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import os
import subprocess
import sys
import shutil
import tempfile
PUBSPEC = """n... | <commit_before>#!/usr/bin/env python
# Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import os
import subprocess
import sys
import shutil
import tempfile
... | #!/usr/bin/env python
# Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import os
import subprocess
import sys
import shutil
import tempfile
PUBSPEC = """n... | #!/usr/bin/env python
# Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import os
import subprocess
import sys
import shutil
import tempfile
PUBSPEC = """n... | <commit_before>#!/usr/bin/env python
# Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import os
import subprocess
import sys
import shutil
import tempfile
... |
5a7c6c38ee28a584b117d3509a11cd8c868712f3 | importscan/compat.py | importscan/compat.py | import sys
PY3 = sys.version_info[0] == 3
if PY3:
def is_nonstr_iter(v):
if isinstance(v, str): # pragma: no cover
return False
return hasattr(v, '__iter__')
else: # pragma: no cover
def is_nonstr_iter(v):
return hasattr(v, '__iter__')
if PY3:
INT_TYPES = (int,)
else... | import sys
PY3 = sys.version_info[0] == 3
if PY3:
def is_nonstr_iter(v):
if isinstance(v, str): # pragma: no cover
return False
return hasattr(v, '__iter__')
else: # pragma: no cover
def is_nonstr_iter(v):
return hasattr(v, '__iter__')
if PY3:
INT_TYPES = (int,)
else... | Exclude Python 2 specific code from pep8 | Exclude Python 2 specific code from pep8
| Python | bsd-3-clause | faassen/importscan | import sys
PY3 = sys.version_info[0] == 3
if PY3:
def is_nonstr_iter(v):
if isinstance(v, str): # pragma: no cover
return False
return hasattr(v, '__iter__')
else: # pragma: no cover
def is_nonstr_iter(v):
return hasattr(v, '__iter__')
if PY3:
INT_TYPES = (int,)
else... | import sys
PY3 = sys.version_info[0] == 3
if PY3:
def is_nonstr_iter(v):
if isinstance(v, str): # pragma: no cover
return False
return hasattr(v, '__iter__')
else: # pragma: no cover
def is_nonstr_iter(v):
return hasattr(v, '__iter__')
if PY3:
INT_TYPES = (int,)
else... | <commit_before>import sys
PY3 = sys.version_info[0] == 3
if PY3:
def is_nonstr_iter(v):
if isinstance(v, str): # pragma: no cover
return False
return hasattr(v, '__iter__')
else: # pragma: no cover
def is_nonstr_iter(v):
return hasattr(v, '__iter__')
if PY3:
INT_TYPE... | import sys
PY3 = sys.version_info[0] == 3
if PY3:
def is_nonstr_iter(v):
if isinstance(v, str): # pragma: no cover
return False
return hasattr(v, '__iter__')
else: # pragma: no cover
def is_nonstr_iter(v):
return hasattr(v, '__iter__')
if PY3:
INT_TYPES = (int,)
else... | import sys
PY3 = sys.version_info[0] == 3
if PY3:
def is_nonstr_iter(v):
if isinstance(v, str): # pragma: no cover
return False
return hasattr(v, '__iter__')
else: # pragma: no cover
def is_nonstr_iter(v):
return hasattr(v, '__iter__')
if PY3:
INT_TYPES = (int,)
else... | <commit_before>import sys
PY3 = sys.version_info[0] == 3
if PY3:
def is_nonstr_iter(v):
if isinstance(v, str): # pragma: no cover
return False
return hasattr(v, '__iter__')
else: # pragma: no cover
def is_nonstr_iter(v):
return hasattr(v, '__iter__')
if PY3:
INT_TYPE... |
7325eacc1066970a98be30b56fdf4cd31ecc2f57 | db_file_storage/views.py | db_file_storage/views.py | # django
from wsgiref.util import FileWrapper
from django.http import HttpResponse, HttpResponseBadRequest
from django.utils.translation import ugettext as _
# project
from db_file_storage.storage import DatabaseFileStorage
storage = DatabaseFileStorage()
def get_file(request, add_attachment_headers):
name = re... | # django
from wsgiref.util import FileWrapper
from django.http import HttpResponse, HttpResponseBadRequest
from django.utils.translation import ugettext as _
# project
from db_file_storage.storage import DatabaseFileStorage
storage = DatabaseFileStorage()
def get_file(request, add_attachment_headers):
name = re... | Set Content-Length header in get_file view | Set Content-Length header in get_file view
| Python | mit | victor-o-silva/db_file_storage,victor-o-silva/db_file_storage | # django
from wsgiref.util import FileWrapper
from django.http import HttpResponse, HttpResponseBadRequest
from django.utils.translation import ugettext as _
# project
from db_file_storage.storage import DatabaseFileStorage
storage = DatabaseFileStorage()
def get_file(request, add_attachment_headers):
name = re... | # django
from wsgiref.util import FileWrapper
from django.http import HttpResponse, HttpResponseBadRequest
from django.utils.translation import ugettext as _
# project
from db_file_storage.storage import DatabaseFileStorage
storage = DatabaseFileStorage()
def get_file(request, add_attachment_headers):
name = re... | <commit_before># django
from wsgiref.util import FileWrapper
from django.http import HttpResponse, HttpResponseBadRequest
from django.utils.translation import ugettext as _
# project
from db_file_storage.storage import DatabaseFileStorage
storage = DatabaseFileStorage()
def get_file(request, add_attachment_headers)... | # django
from wsgiref.util import FileWrapper
from django.http import HttpResponse, HttpResponseBadRequest
from django.utils.translation import ugettext as _
# project
from db_file_storage.storage import DatabaseFileStorage
storage = DatabaseFileStorage()
def get_file(request, add_attachment_headers):
name = re... | # django
from wsgiref.util import FileWrapper
from django.http import HttpResponse, HttpResponseBadRequest
from django.utils.translation import ugettext as _
# project
from db_file_storage.storage import DatabaseFileStorage
storage = DatabaseFileStorage()
def get_file(request, add_attachment_headers):
name = re... | <commit_before># django
from wsgiref.util import FileWrapper
from django.http import HttpResponse, HttpResponseBadRequest
from django.utils.translation import ugettext as _
# project
from db_file_storage.storage import DatabaseFileStorage
storage = DatabaseFileStorage()
def get_file(request, add_attachment_headers)... |
9413b4b24c318df4bf68069038081d08fa9ad2e8 | vumi/transports/infobip/__init__.py | vumi/transports/infobip/__init__.py | """Infobip transport."""
from vumi.transports.infobip.infobip import InfobipTransport
__all__ = ['InfobipTransport']
| """Infobip transport."""
from vumi.transports.infobip.infobip import InfobipTransport, InfobipError
__all__ = ['InfobipTransport', 'InfobipError']
| Add InfobipError to things exported by Infobip package. | Add InfobipError to things exported by Infobip package.
| Python | bsd-3-clause | TouK/vumi,harrissoerja/vumi,vishwaprakashmishra/xmatrix,TouK/vumi,TouK/vumi,vishwaprakashmishra/xmatrix,harrissoerja/vumi,harrissoerja/vumi,vishwaprakashmishra/xmatrix | """Infobip transport."""
from vumi.transports.infobip.infobip import InfobipTransport
__all__ = ['InfobipTransport']
Add InfobipError to things exported by Infobip package. | """Infobip transport."""
from vumi.transports.infobip.infobip import InfobipTransport, InfobipError
__all__ = ['InfobipTransport', 'InfobipError']
| <commit_before>"""Infobip transport."""
from vumi.transports.infobip.infobip import InfobipTransport
__all__ = ['InfobipTransport']
<commit_msg>Add InfobipError to things exported by Infobip package.<commit_after> | """Infobip transport."""
from vumi.transports.infobip.infobip import InfobipTransport, InfobipError
__all__ = ['InfobipTransport', 'InfobipError']
| """Infobip transport."""
from vumi.transports.infobip.infobip import InfobipTransport
__all__ = ['InfobipTransport']
Add InfobipError to things exported by Infobip package."""Infobip transport."""
from vumi.transports.infobip.infobip import InfobipTransport, InfobipError
__all__ = ['InfobipTransport', 'InfobipError... | <commit_before>"""Infobip transport."""
from vumi.transports.infobip.infobip import InfobipTransport
__all__ = ['InfobipTransport']
<commit_msg>Add InfobipError to things exported by Infobip package.<commit_after>"""Infobip transport."""
from vumi.transports.infobip.infobip import InfobipTransport, InfobipError
__a... |
a1e331935c91a5ce542020bdfe7b05c29599dac7 | aiohttp/__init__.py | aiohttp/__init__.py | # This relies on each of the submodules having an __all__ variable.
__version__ = '0.12.1dev'
from .protocol import * # noqa
from .connector import * # noqa
from .client import * # noqa
from .errors import * # noqa
from .helpers import * # noqa
from .parsers import * # noqa
from .streams import * # noqa
__a... | # This relies on each of the submodules having an __all__ variable.
__version__ = '0.12.1a'
from .protocol import * # noqa
from .connector import * # noqa
from .client import * # noqa
from .errors import * # noqa
from .helpers import * # noqa
from .parsers import * # noqa
from .streams import * # noqa
__all... | Change version schema from 0.12.1dev to 0.12.1a for sake of following pep 440 | Change version schema from 0.12.1dev to 0.12.1a for sake of following pep 440
| Python | apache-2.0 | rutsky/aiohttp,hellysmile/aiohttp,jettify/aiohttp,Srogozins/aiohttp,vedun/aiohttp,moden-py/aiohttp,z2v/aiohttp,alexsdutton/aiohttp,rutsky/aiohttp,rutsky/aiohttp,juliatem/aiohttp,mind1master/aiohttp,noplay/aiohttp,KeepSafe/aiohttp,sterwill/aiohttp,AlexLisovoy/aiohttp,alex-eri/aiohttp-1,AraHaanOrg/aiohttp,arthurdarcet/ai... | # This relies on each of the submodules having an __all__ variable.
__version__ = '0.12.1dev'
from .protocol import * # noqa
from .connector import * # noqa
from .client import * # noqa
from .errors import * # noqa
from .helpers import * # noqa
from .parsers import * # noqa
from .streams import * # noqa
__a... | # This relies on each of the submodules having an __all__ variable.
__version__ = '0.12.1a'
from .protocol import * # noqa
from .connector import * # noqa
from .client import * # noqa
from .errors import * # noqa
from .helpers import * # noqa
from .parsers import * # noqa
from .streams import * # noqa
__all... | <commit_before># This relies on each of the submodules having an __all__ variable.
__version__ = '0.12.1dev'
from .protocol import * # noqa
from .connector import * # noqa
from .client import * # noqa
from .errors import * # noqa
from .helpers import * # noqa
from .parsers import * # noqa
from .streams import ... | # This relies on each of the submodules having an __all__ variable.
__version__ = '0.12.1a'
from .protocol import * # noqa
from .connector import * # noqa
from .client import * # noqa
from .errors import * # noqa
from .helpers import * # noqa
from .parsers import * # noqa
from .streams import * # noqa
__all... | # This relies on each of the submodules having an __all__ variable.
__version__ = '0.12.1dev'
from .protocol import * # noqa
from .connector import * # noqa
from .client import * # noqa
from .errors import * # noqa
from .helpers import * # noqa
from .parsers import * # noqa
from .streams import * # noqa
__a... | <commit_before># This relies on each of the submodules having an __all__ variable.
__version__ = '0.12.1dev'
from .protocol import * # noqa
from .connector import * # noqa
from .client import * # noqa
from .errors import * # noqa
from .helpers import * # noqa
from .parsers import * # noqa
from .streams import ... |
c13d3584a8cb95b619af7fa876cb87d5b987a5dd | akari/log_config.py | akari/log_config.py | import logging.config
_logging_config = dict(
version=1,
disable_existing_loggers=False,
formatters={
'verbose': {
'format': '%(asctime)s [%(levelname)s] %(message)s'
},
},
handlers={
'console': {
'class': 'logging.StreamHandler',
'format... | import logging.config
_logging_config = dict(
version=1,
disable_existing_loggers=False,
formatters={
'verbose': {
'format': '%(asctime)s [%(levelname)s] %(message)s'
},
},
handlers={
'console': {
'class': 'logging.StreamHandler',
'format... | Set root log level to INFO | Set root log level to INFO
| Python | mit | kennydo/akari | import logging.config
_logging_config = dict(
version=1,
disable_existing_loggers=False,
formatters={
'verbose': {
'format': '%(asctime)s [%(levelname)s] %(message)s'
},
},
handlers={
'console': {
'class': 'logging.StreamHandler',
'format... | import logging.config
_logging_config = dict(
version=1,
disable_existing_loggers=False,
formatters={
'verbose': {
'format': '%(asctime)s [%(levelname)s] %(message)s'
},
},
handlers={
'console': {
'class': 'logging.StreamHandler',
'format... | <commit_before>import logging.config
_logging_config = dict(
version=1,
disable_existing_loggers=False,
formatters={
'verbose': {
'format': '%(asctime)s [%(levelname)s] %(message)s'
},
},
handlers={
'console': {
'class': 'logging.StreamHandler',
... | import logging.config
_logging_config = dict(
version=1,
disable_existing_loggers=False,
formatters={
'verbose': {
'format': '%(asctime)s [%(levelname)s] %(message)s'
},
},
handlers={
'console': {
'class': 'logging.StreamHandler',
'format... | import logging.config
_logging_config = dict(
version=1,
disable_existing_loggers=False,
formatters={
'verbose': {
'format': '%(asctime)s [%(levelname)s] %(message)s'
},
},
handlers={
'console': {
'class': 'logging.StreamHandler',
'format... | <commit_before>import logging.config
_logging_config = dict(
version=1,
disable_existing_loggers=False,
formatters={
'verbose': {
'format': '%(asctime)s [%(levelname)s] %(message)s'
},
},
handlers={
'console': {
'class': 'logging.StreamHandler',
... |
4ead2d0b2bc987bcc75a5f94c31553a8024aa8a8 | src/vault.py | src/vault.py | from fabric.api import task, local
from buildercore import project
import utils
import sys
import logging
LOG = logging.getLogger(__name__)
def vault_addr():
defaults, _ = project.raw_project_map()
return defaults['aws']['vault']['address']
def vault_policy():
return 'builder-user'
@task
def login():
... | from fabric.api import task, local
from buildercore import project
import utils
import sys
import logging
LOG = logging.getLogger(__name__)
def vault_addr():
defaults, _ = project.raw_project_map()
return defaults['aws']['vault']['address']
def vault_policy():
return 'builder-user'
@task
def login():
... | Add task to update policies | Add task to update policies
| Python | mit | elifesciences/builder,elifesciences/builder | from fabric.api import task, local
from buildercore import project
import utils
import sys
import logging
LOG = logging.getLogger(__name__)
def vault_addr():
defaults, _ = project.raw_project_map()
return defaults['aws']['vault']['address']
def vault_policy():
return 'builder-user'
@task
def login():
... | from fabric.api import task, local
from buildercore import project
import utils
import sys
import logging
LOG = logging.getLogger(__name__)
def vault_addr():
defaults, _ = project.raw_project_map()
return defaults['aws']['vault']['address']
def vault_policy():
return 'builder-user'
@task
def login():
... | <commit_before>from fabric.api import task, local
from buildercore import project
import utils
import sys
import logging
LOG = logging.getLogger(__name__)
def vault_addr():
defaults, _ = project.raw_project_map()
return defaults['aws']['vault']['address']
def vault_policy():
return 'builder-user'
@task
d... | from fabric.api import task, local
from buildercore import project
import utils
import sys
import logging
LOG = logging.getLogger(__name__)
def vault_addr():
defaults, _ = project.raw_project_map()
return defaults['aws']['vault']['address']
def vault_policy():
return 'builder-user'
@task
def login():
... | from fabric.api import task, local
from buildercore import project
import utils
import sys
import logging
LOG = logging.getLogger(__name__)
def vault_addr():
defaults, _ = project.raw_project_map()
return defaults['aws']['vault']['address']
def vault_policy():
return 'builder-user'
@task
def login():
... | <commit_before>from fabric.api import task, local
from buildercore import project
import utils
import sys
import logging
LOG = logging.getLogger(__name__)
def vault_addr():
defaults, _ = project.raw_project_map()
return defaults['aws']['vault']['address']
def vault_policy():
return 'builder-user'
@task
d... |
5f6a404f8a4357c3de72b7ac506168e1bec810a8 | quicksort/quicksort.py | quicksort/quicksort.py | from random import randint
def sort(arr, start, length):
if length <= 1:
return arr
pivot = choose_pivot(arr, length)
i = j = start + 1
while j < length:
if arr[j] < pivot:
swap(arr, j, i)
i += 1
j += 1
swap(arr, start, i-1)
return (arr, length, pivot)
def swap(arr, x, y):
temp = arr[x]
arr[... | from random import randint
def sort(arr, start, length):
if length <= 1:
return arr
pivot = choose_pivot(arr, length)
i = j = start + 1
while j < length:
if arr[j] < pivot:
swap(arr, j, i)
i += 1
j += 1
swap(arr, start, i-1)
first_part = sort(arr[start:i], start, i)
second_part = sort(arr[i:len... | Sort list by recursing through both parts | Sort list by recursing through both parts
The array is split into two parts: everything up to and including
the pivot, and everything after the pivot. Sort() is called on
each part and the resulting arrays are combined and returned. This
sorts the array.
| Python | mit | timpel/stanford-algs,timpel/stanford-algs | from random import randint
def sort(arr, start, length):
if length <= 1:
return arr
pivot = choose_pivot(arr, length)
i = j = start + 1
while j < length:
if arr[j] < pivot:
swap(arr, j, i)
i += 1
j += 1
swap(arr, start, i-1)
return (arr, length, pivot)
def swap(arr, x, y):
temp = arr[x]
arr[... | from random import randint
def sort(arr, start, length):
if length <= 1:
return arr
pivot = choose_pivot(arr, length)
i = j = start + 1
while j < length:
if arr[j] < pivot:
swap(arr, j, i)
i += 1
j += 1
swap(arr, start, i-1)
first_part = sort(arr[start:i], start, i)
second_part = sort(arr[i:len... | <commit_before>from random import randint
def sort(arr, start, length):
if length <= 1:
return arr
pivot = choose_pivot(arr, length)
i = j = start + 1
while j < length:
if arr[j] < pivot:
swap(arr, j, i)
i += 1
j += 1
swap(arr, start, i-1)
return (arr, length, pivot)
def swap(arr, x, y):
temp... | from random import randint
def sort(arr, start, length):
if length <= 1:
return arr
pivot = choose_pivot(arr, length)
i = j = start + 1
while j < length:
if arr[j] < pivot:
swap(arr, j, i)
i += 1
j += 1
swap(arr, start, i-1)
first_part = sort(arr[start:i], start, i)
second_part = sort(arr[i:len... | from random import randint
def sort(arr, start, length):
if length <= 1:
return arr
pivot = choose_pivot(arr, length)
i = j = start + 1
while j < length:
if arr[j] < pivot:
swap(arr, j, i)
i += 1
j += 1
swap(arr, start, i-1)
return (arr, length, pivot)
def swap(arr, x, y):
temp = arr[x]
arr[... | <commit_before>from random import randint
def sort(arr, start, length):
if length <= 1:
return arr
pivot = choose_pivot(arr, length)
i = j = start + 1
while j < length:
if arr[j] < pivot:
swap(arr, j, i)
i += 1
j += 1
swap(arr, start, i-1)
return (arr, length, pivot)
def swap(arr, x, y):
temp... |
ed8d7e8a4f474573b629c418898cb88c35366a58 | scripts/looptmp.py | scripts/looptmp.py | # Input: ${SGE_TASK_ID}
# Output: generated models in *.B* files, calculated energies in *.E* files
#
from modeller import *
from modeller.automodel import *
import sys
# to get different starting models for each task
taskid = int(sys.argv[1])
env = environ(rand_seed=-1000-taskid)
class myloop(loopmodel):
def se... | # Input: ${SGE_TASK_ID}
# Output: generated models in *.B* files, calculated energies in *.E* files
#
from modeller import *
from modeller.automodel import *
import sys
# to get different starting models for each task
taskid = int(sys.argv[1])
env = environ(rand_seed=-1000-taskid)
class MyLoop(loopmodel):
def se... | Use Python PEP 8 naming for derived class. | Use Python PEP 8 naming for derived class.
| Python | lgpl-2.1 | salilab/modloop,salilab/modloop | # Input: ${SGE_TASK_ID}
# Output: generated models in *.B* files, calculated energies in *.E* files
#
from modeller import *
from modeller.automodel import *
import sys
# to get different starting models for each task
taskid = int(sys.argv[1])
env = environ(rand_seed=-1000-taskid)
class myloop(loopmodel):
def se... | # Input: ${SGE_TASK_ID}
# Output: generated models in *.B* files, calculated energies in *.E* files
#
from modeller import *
from modeller.automodel import *
import sys
# to get different starting models for each task
taskid = int(sys.argv[1])
env = environ(rand_seed=-1000-taskid)
class MyLoop(loopmodel):
def se... | <commit_before># Input: ${SGE_TASK_ID}
# Output: generated models in *.B* files, calculated energies in *.E* files
#
from modeller import *
from modeller.automodel import *
import sys
# to get different starting models for each task
taskid = int(sys.argv[1])
env = environ(rand_seed=-1000-taskid)
class myloop(loopmod... | # Input: ${SGE_TASK_ID}
# Output: generated models in *.B* files, calculated energies in *.E* files
#
from modeller import *
from modeller.automodel import *
import sys
# to get different starting models for each task
taskid = int(sys.argv[1])
env = environ(rand_seed=-1000-taskid)
class MyLoop(loopmodel):
def se... | # Input: ${SGE_TASK_ID}
# Output: generated models in *.B* files, calculated energies in *.E* files
#
from modeller import *
from modeller.automodel import *
import sys
# to get different starting models for each task
taskid = int(sys.argv[1])
env = environ(rand_seed=-1000-taskid)
class myloop(loopmodel):
def se... | <commit_before># Input: ${SGE_TASK_ID}
# Output: generated models in *.B* files, calculated energies in *.E* files
#
from modeller import *
from modeller.automodel import *
import sys
# to get different starting models for each task
taskid = int(sys.argv[1])
env = environ(rand_seed=-1000-taskid)
class myloop(loopmod... |
ee070606be405b86bfcc6e6796bbe322a78511ed | ui/assetmanager.py | ui/assetmanager.py | """Loads and manages art assets"""
import pyglet
_ASSET_PATHS = ["res"]
_ASSET_FILE_NAMES = [
"black_key_down.png",
"black_key_up.png",
"white_key_down.png",
"white_key_up.png",
"staff_line.png",
]
class Assets(object):
_loadedAssets = None
@staticmethod
def loadAssets():
Ass... | """Loads and manages art assets"""
import pyglet
import os
_ASSET_PATHS = ["res"]
_ASSET_FILE_NAMES = [
"black_key_down.png",
"black_key_up.png",
"white_key_down.png",
"white_key_up.png",
"staff_line.png",
]
class Assets(object):
_loadedAssets = None
@staticmethod
def loadAssets():
... | Use absolute resource path in Pyglet | Use absolute resource path in Pyglet
It appears that a recent change in Pyglet causes relative paths to fail here.
| Python | bsd-2-clause | aschmied/keyzer | """Loads and manages art assets"""
import pyglet
_ASSET_PATHS = ["res"]
_ASSET_FILE_NAMES = [
"black_key_down.png",
"black_key_up.png",
"white_key_down.png",
"white_key_up.png",
"staff_line.png",
]
class Assets(object):
_loadedAssets = None
@staticmethod
def loadAssets():
Ass... | """Loads and manages art assets"""
import pyglet
import os
_ASSET_PATHS = ["res"]
_ASSET_FILE_NAMES = [
"black_key_down.png",
"black_key_up.png",
"white_key_down.png",
"white_key_up.png",
"staff_line.png",
]
class Assets(object):
_loadedAssets = None
@staticmethod
def loadAssets():
... | <commit_before>"""Loads and manages art assets"""
import pyglet
_ASSET_PATHS = ["res"]
_ASSET_FILE_NAMES = [
"black_key_down.png",
"black_key_up.png",
"white_key_down.png",
"white_key_up.png",
"staff_line.png",
]
class Assets(object):
_loadedAssets = None
@staticmethod
def loadAssets... | """Loads and manages art assets"""
import pyglet
import os
_ASSET_PATHS = ["res"]
_ASSET_FILE_NAMES = [
"black_key_down.png",
"black_key_up.png",
"white_key_down.png",
"white_key_up.png",
"staff_line.png",
]
class Assets(object):
_loadedAssets = None
@staticmethod
def loadAssets():
... | """Loads and manages art assets"""
import pyglet
_ASSET_PATHS = ["res"]
_ASSET_FILE_NAMES = [
"black_key_down.png",
"black_key_up.png",
"white_key_down.png",
"white_key_up.png",
"staff_line.png",
]
class Assets(object):
_loadedAssets = None
@staticmethod
def loadAssets():
Ass... | <commit_before>"""Loads and manages art assets"""
import pyglet
_ASSET_PATHS = ["res"]
_ASSET_FILE_NAMES = [
"black_key_down.png",
"black_key_up.png",
"white_key_down.png",
"white_key_up.png",
"staff_line.png",
]
class Assets(object):
_loadedAssets = None
@staticmethod
def loadAssets... |
6e1cef7cc97640dc745a8b8975cd5d31d0ffa485 | selectable/base.py | selectable/base.py | from django.core.urlresolvers import reverse
from django.utils.encoding import smart_unicode
class LookupBase(object):
def _name(cls):
app_name = cls.__module__.split('.')[-2].lower()
class_name = cls.__name__.lower()
name = u'%s-%s' % (app_name, class_name)
return name
... | from django.core.urlresolvers import reverse
from django.utils.encoding import smart_unicode
class LookupBase(object):
def _name(cls):
app_name = cls.__module__.split('.')[-2].lower()
class_name = cls.__name__.lower()
name = u'%s-%s' % (app_name, class_name)
return name
... | Change to return 'label' not 'name'. | Change to return 'label' not 'name'.
| Python | bsd-2-clause | makinacorpus/django-selectable,mlavin/django-selectable,affan2/django-selectable,affan2/django-selectable,mlavin/django-selectable,makinacorpus/django-selectable,mlavin/django-selectable,affan2/django-selectable | from django.core.urlresolvers import reverse
from django.utils.encoding import smart_unicode
class LookupBase(object):
def _name(cls):
app_name = cls.__module__.split('.')[-2].lower()
class_name = cls.__name__.lower()
name = u'%s-%s' % (app_name, class_name)
return name
... | from django.core.urlresolvers import reverse
from django.utils.encoding import smart_unicode
class LookupBase(object):
def _name(cls):
app_name = cls.__module__.split('.')[-2].lower()
class_name = cls.__name__.lower()
name = u'%s-%s' % (app_name, class_name)
return name
... | <commit_before>from django.core.urlresolvers import reverse
from django.utils.encoding import smart_unicode
class LookupBase(object):
def _name(cls):
app_name = cls.__module__.split('.')[-2].lower()
class_name = cls.__name__.lower()
name = u'%s-%s' % (app_name, class_name)
... | from django.core.urlresolvers import reverse
from django.utils.encoding import smart_unicode
class LookupBase(object):
def _name(cls):
app_name = cls.__module__.split('.')[-2].lower()
class_name = cls.__name__.lower()
name = u'%s-%s' % (app_name, class_name)
return name
... | from django.core.urlresolvers import reverse
from django.utils.encoding import smart_unicode
class LookupBase(object):
def _name(cls):
app_name = cls.__module__.split('.')[-2].lower()
class_name = cls.__name__.lower()
name = u'%s-%s' % (app_name, class_name)
return name
... | <commit_before>from django.core.urlresolvers import reverse
from django.utils.encoding import smart_unicode
class LookupBase(object):
def _name(cls):
app_name = cls.__module__.split('.')[-2].lower()
class_name = cls.__name__.lower()
name = u'%s-%s' % (app_name, class_name)
... |
dd9f11f36668717ee349b357b2f32a7a52e38863 | pagerduty_events_api/pagerduty_incident.py | pagerduty_events_api/pagerduty_incident.py | from pagerduty_events_api.pagerduty_rest_client import PagerdutyRestClient
class PagerdutyIncident:
def __init__(self, service_key, incident_key):
self.__service_key = service_key
self.__incident_key = incident_key
def get_service_key(self):
return self.__service_key
def get_inci... | from pagerduty_events_api.pagerduty_rest_client import PagerdutyRestClient
class PagerdutyIncident:
def __init__(self, service_key, incident_key):
self.__service_key = service_key
self.__incident_key = incident_key
def get_service_key(self):
return self.__service_key
def get_inci... | Remove code duplication from PD Incident class. | Remove code duplication from PD Incident class.
| Python | mit | BlasiusVonSzerencsi/pagerduty-events-api | from pagerduty_events_api.pagerduty_rest_client import PagerdutyRestClient
class PagerdutyIncident:
def __init__(self, service_key, incident_key):
self.__service_key = service_key
self.__incident_key = incident_key
def get_service_key(self):
return self.__service_key
def get_inci... | from pagerduty_events_api.pagerduty_rest_client import PagerdutyRestClient
class PagerdutyIncident:
def __init__(self, service_key, incident_key):
self.__service_key = service_key
self.__incident_key = incident_key
def get_service_key(self):
return self.__service_key
def get_inci... | <commit_before>from pagerduty_events_api.pagerduty_rest_client import PagerdutyRestClient
class PagerdutyIncident:
def __init__(self, service_key, incident_key):
self.__service_key = service_key
self.__incident_key = incident_key
def get_service_key(self):
return self.__service_key
... | from pagerduty_events_api.pagerduty_rest_client import PagerdutyRestClient
class PagerdutyIncident:
def __init__(self, service_key, incident_key):
self.__service_key = service_key
self.__incident_key = incident_key
def get_service_key(self):
return self.__service_key
def get_inci... | from pagerduty_events_api.pagerduty_rest_client import PagerdutyRestClient
class PagerdutyIncident:
def __init__(self, service_key, incident_key):
self.__service_key = service_key
self.__incident_key = incident_key
def get_service_key(self):
return self.__service_key
def get_inci... | <commit_before>from pagerduty_events_api.pagerduty_rest_client import PagerdutyRestClient
class PagerdutyIncident:
def __init__(self, service_key, incident_key):
self.__service_key = service_key
self.__incident_key = incident_key
def get_service_key(self):
return self.__service_key
... |
1cf7cbf8c1ed35e70e92b39d2475b120ad17ae3d | server/settings.py | server/settings.py | # TODO @Sumukh Better Secret Management System
class TestConfig(object):
DEBUG = True
SECRET_KEY = 'Testing*ok*server*'
RESTFUL_JSON = {'indent': 4}
TESTING_LOGIN = True # Do NOT turn on for prod
class DevConfig(TestConfig):
ENV = 'dev'
DEBUG_TB_INTERCEPT_REDIRECTS = False
SQLALCHEMY_DATA... | # TODO @Sumukh Better Secret Management System
class TestConfig(object):
DEBUG = True
SECRET_KEY = 'Testing*ok*server*'
RESTFUL_JSON = {'indent': 4}
TESTING_LOGIN = True
class DevConfig(TestConfig):
ENV = 'dev'
DEBUG_TB_INTERCEPT_REDIRECTS = False
SQLALCHEMY_DATABASE_URI = 'postgresql://po... | Remove ominous TESTING_LOGIN config comment | Remove ominous TESTING_LOGIN config comment
| Python | apache-2.0 | Cal-CS-61A-Staff/ok,Cal-CS-61A-Staff/ok,Cal-CS-61A-Staff/ok,Cal-CS-61A-Staff/ok,Cal-CS-61A-Staff/ok | # TODO @Sumukh Better Secret Management System
class TestConfig(object):
DEBUG = True
SECRET_KEY = 'Testing*ok*server*'
RESTFUL_JSON = {'indent': 4}
TESTING_LOGIN = True # Do NOT turn on for prod
class DevConfig(TestConfig):
ENV = 'dev'
DEBUG_TB_INTERCEPT_REDIRECTS = False
SQLALCHEMY_DATA... | # TODO @Sumukh Better Secret Management System
class TestConfig(object):
DEBUG = True
SECRET_KEY = 'Testing*ok*server*'
RESTFUL_JSON = {'indent': 4}
TESTING_LOGIN = True
class DevConfig(TestConfig):
ENV = 'dev'
DEBUG_TB_INTERCEPT_REDIRECTS = False
SQLALCHEMY_DATABASE_URI = 'postgresql://po... | <commit_before># TODO @Sumukh Better Secret Management System
class TestConfig(object):
DEBUG = True
SECRET_KEY = 'Testing*ok*server*'
RESTFUL_JSON = {'indent': 4}
TESTING_LOGIN = True # Do NOT turn on for prod
class DevConfig(TestConfig):
ENV = 'dev'
DEBUG_TB_INTERCEPT_REDIRECTS = False
... | # TODO @Sumukh Better Secret Management System
class TestConfig(object):
DEBUG = True
SECRET_KEY = 'Testing*ok*server*'
RESTFUL_JSON = {'indent': 4}
TESTING_LOGIN = True
class DevConfig(TestConfig):
ENV = 'dev'
DEBUG_TB_INTERCEPT_REDIRECTS = False
SQLALCHEMY_DATABASE_URI = 'postgresql://po... | # TODO @Sumukh Better Secret Management System
class TestConfig(object):
DEBUG = True
SECRET_KEY = 'Testing*ok*server*'
RESTFUL_JSON = {'indent': 4}
TESTING_LOGIN = True # Do NOT turn on for prod
class DevConfig(TestConfig):
ENV = 'dev'
DEBUG_TB_INTERCEPT_REDIRECTS = False
SQLALCHEMY_DATA... | <commit_before># TODO @Sumukh Better Secret Management System
class TestConfig(object):
DEBUG = True
SECRET_KEY = 'Testing*ok*server*'
RESTFUL_JSON = {'indent': 4}
TESTING_LOGIN = True # Do NOT turn on for prod
class DevConfig(TestConfig):
ENV = 'dev'
DEBUG_TB_INTERCEPT_REDIRECTS = False
... |
b64b4f804137bc5fae5bdac28e4763ed01b71164 | imagr_site/urls.py | imagr_site/urls.py | from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
url(r'^', include('imagr.urls', namespace='imagr')),
url(r'^admin/', include(admin.site.urls)),
url(r'^accounts/', include('registration.backends.default.urls'))
)
| from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
url(r'^imagr/', include('imagr.urls', namespace='imagr')),
url(r'^admin/', include(admin.site.urls)),
url(r'^accounts/', include('registration.backends.default.urls'))
)
| Change back the url so site root is at /imagr again | Change back the url so site root is at /imagr again
| Python | mit | markableidinger/django_imagr | from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
url(r'^', include('imagr.urls', namespace='imagr')),
url(r'^admin/', include(admin.site.urls)),
url(r'^accounts/', include('registration.backends.default.urls'))
)
Change back the url so site roo... | from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
url(r'^imagr/', include('imagr.urls', namespace='imagr')),
url(r'^admin/', include(admin.site.urls)),
url(r'^accounts/', include('registration.backends.default.urls'))
)
| <commit_before>from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
url(r'^', include('imagr.urls', namespace='imagr')),
url(r'^admin/', include(admin.site.urls)),
url(r'^accounts/', include('registration.backends.default.urls'))
)
<commit_msg>Chan... | from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
url(r'^imagr/', include('imagr.urls', namespace='imagr')),
url(r'^admin/', include(admin.site.urls)),
url(r'^accounts/', include('registration.backends.default.urls'))
)
| from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
url(r'^', include('imagr.urls', namespace='imagr')),
url(r'^admin/', include(admin.site.urls)),
url(r'^accounts/', include('registration.backends.default.urls'))
)
Change back the url so site roo... | <commit_before>from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
url(r'^', include('imagr.urls', namespace='imagr')),
url(r'^admin/', include(admin.site.urls)),
url(r'^accounts/', include('registration.backends.default.urls'))
)
<commit_msg>Chan... |
67fadc0ed846a95f6d603827313b555e98985959 | skimage/viewer/qt.py | skimage/viewer/qt.py | has_qt = True
try:
from matplotlib.backends.qt_compat import QtGui, QtCore, QtWidgets
except ImportError:
try:
from matplotlib.backends.qt4_compat import QtGui, QtCore
QtWidgets = QtGui
except ImportError:
# Mock objects
class QtGui(object):
QMainWindow = object
... | has_qt = True
try:
from matplotlib.backends.qt_compat import QtGui, QtCore, QtWidgets
except ImportError:
try:
from matplotlib.backends.qt4_compat import QtGui, QtCore
QtWidgets = QtGui
except ImportError:
# Mock objects
class QtGui_cls(object):
QMainWindow = obj... | Fix mock Qt objects again | Fix mock Qt objects again
| Python | bsd-3-clause | jwiggins/scikit-image,Hiyorimi/scikit-image,paalge/scikit-image,michaelaye/scikit-image,ajaybhat/scikit-image,ofgulban/scikit-image,oew1v07/scikit-image,newville/scikit-image,juliusbierk/scikit-image,chriscrosscutler/scikit-image,vighneshbirodkar/scikit-image,newville/scikit-image,keflavich/scikit-image,bennlich/scikit... | has_qt = True
try:
from matplotlib.backends.qt_compat import QtGui, QtCore, QtWidgets
except ImportError:
try:
from matplotlib.backends.qt4_compat import QtGui, QtCore
QtWidgets = QtGui
except ImportError:
# Mock objects
class QtGui(object):
QMainWindow = object
... | has_qt = True
try:
from matplotlib.backends.qt_compat import QtGui, QtCore, QtWidgets
except ImportError:
try:
from matplotlib.backends.qt4_compat import QtGui, QtCore
QtWidgets = QtGui
except ImportError:
# Mock objects
class QtGui_cls(object):
QMainWindow = obj... | <commit_before>has_qt = True
try:
from matplotlib.backends.qt_compat import QtGui, QtCore, QtWidgets
except ImportError:
try:
from matplotlib.backends.qt4_compat import QtGui, QtCore
QtWidgets = QtGui
except ImportError:
# Mock objects
class QtGui(object):
QMainW... | has_qt = True
try:
from matplotlib.backends.qt_compat import QtGui, QtCore, QtWidgets
except ImportError:
try:
from matplotlib.backends.qt4_compat import QtGui, QtCore
QtWidgets = QtGui
except ImportError:
# Mock objects
class QtGui_cls(object):
QMainWindow = obj... | has_qt = True
try:
from matplotlib.backends.qt_compat import QtGui, QtCore, QtWidgets
except ImportError:
try:
from matplotlib.backends.qt4_compat import QtGui, QtCore
QtWidgets = QtGui
except ImportError:
# Mock objects
class QtGui(object):
QMainWindow = object
... | <commit_before>has_qt = True
try:
from matplotlib.backends.qt_compat import QtGui, QtCore, QtWidgets
except ImportError:
try:
from matplotlib.backends.qt4_compat import QtGui, QtCore
QtWidgets = QtGui
except ImportError:
# Mock objects
class QtGui(object):
QMainW... |
0f04e6ed48227c6904d75a78be9c893f47f9cb80 | joku/cogs/_common.py | joku/cogs/_common.py | from collections import OrderedDict
import threading
from joku.bot import Jokusoramame
class _CogMeta(type):
def __prepare__(*args, **kwargs):
# Use an OrderedDict for the class body.
return OrderedDict()
class Cog(metaclass=_CogMeta):
"""
A common class for all cogs. This makes the cl... | from collections import OrderedDict
import threading
from joku.bot import Jokusoramame
class _CogMeta(type):
def __prepare__(*args, **kwargs):
# Use an OrderedDict for the class body.
return OrderedDict()
class Cog(metaclass=_CogMeta):
def __init__(self, bot: Jokusoramame):
self._b... | Remove false docstring from common cog. | Remove false docstring from common cog.
| Python | mit | MJB47/Jokusoramame,MJB47/Jokusoramame,MJB47/Jokusoramame | from collections import OrderedDict
import threading
from joku.bot import Jokusoramame
class _CogMeta(type):
def __prepare__(*args, **kwargs):
# Use an OrderedDict for the class body.
return OrderedDict()
class Cog(metaclass=_CogMeta):
"""
A common class for all cogs. This makes the cl... | from collections import OrderedDict
import threading
from joku.bot import Jokusoramame
class _CogMeta(type):
def __prepare__(*args, **kwargs):
# Use an OrderedDict for the class body.
return OrderedDict()
class Cog(metaclass=_CogMeta):
def __init__(self, bot: Jokusoramame):
self._b... | <commit_before>from collections import OrderedDict
import threading
from joku.bot import Jokusoramame
class _CogMeta(type):
def __prepare__(*args, **kwargs):
# Use an OrderedDict for the class body.
return OrderedDict()
class Cog(metaclass=_CogMeta):
"""
A common class for all cogs. Th... | from collections import OrderedDict
import threading
from joku.bot import Jokusoramame
class _CogMeta(type):
def __prepare__(*args, **kwargs):
# Use an OrderedDict for the class body.
return OrderedDict()
class Cog(metaclass=_CogMeta):
def __init__(self, bot: Jokusoramame):
self._b... | from collections import OrderedDict
import threading
from joku.bot import Jokusoramame
class _CogMeta(type):
def __prepare__(*args, **kwargs):
# Use an OrderedDict for the class body.
return OrderedDict()
class Cog(metaclass=_CogMeta):
"""
A common class for all cogs. This makes the cl... | <commit_before>from collections import OrderedDict
import threading
from joku.bot import Jokusoramame
class _CogMeta(type):
def __prepare__(*args, **kwargs):
# Use an OrderedDict for the class body.
return OrderedDict()
class Cog(metaclass=_CogMeta):
"""
A common class for all cogs. Th... |
225f4ba42e2184b09b49e7d6a933748d436f7d3e | eultheme/__init__.py | eultheme/__init__.py | __version_info__ = (0, 4, 0, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join(str(i) for i in __version_info__[:-1])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],)) | __version_info__ = (0, 5, 0, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join(str(i) for i in __version_info__[:-1])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],)) | Update version number for release | Update version number for release
| Python | apache-2.0 | emory-libraries/django-eultheme,emory-libraries/django-eultheme,emory-libraries/django-eultheme | __version_info__ = (0, 4, 0, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join(str(i) for i in __version_info__[:-1])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))Update version number for release | __version_info__ = (0, 5, 0, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join(str(i) for i in __version_info__[:-1])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],)) | <commit_before>__version_info__ = (0, 4, 0, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join(str(i) for i in __version_info__[:-1])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))<commit_msg>Update version number for release<comm... | __version_info__ = (0, 5, 0, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join(str(i) for i in __version_info__[:-1])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],)) | __version_info__ = (0, 4, 0, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join(str(i) for i in __version_info__[:-1])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))Update version number for release__version_info__ = (0, 5, 0, Non... | <commit_before>__version_info__ = (0, 4, 0, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join(str(i) for i in __version_info__[:-1])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))<commit_msg>Update version number for release<comm... |
87ba878afe9fac0e8ebe3b11719982148b8ac89a | conanfile.py | conanfile.py | from conans import ConanFile
from conans.tools import download, unzip
import os
VERSION = "0.0.2"
class VeraPPTargetCmakeConan(ConanFile):
name = "verapp-target-cmake"
version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION)
generators = "cmake"
requires = ("cmake-include-guard/master@smspillaz/cm... | from conans import ConanFile
from conans.tools import download, unzip
import os
VERSION = "0.0.2"
class VeraPPTargetCmakeConan(ConanFile):
name = "verapp-target-cmake"
version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION)
generators = "cmake"
requires = ("cmake-include-guard/master@smspillaz/cm... | Copy find modules to root of module path | conan: Copy find modules to root of module path
| Python | mit | polysquare/veracpp-cmake,polysquare/verapp-cmake | from conans import ConanFile
from conans.tools import download, unzip
import os
VERSION = "0.0.2"
class VeraPPTargetCmakeConan(ConanFile):
name = "verapp-target-cmake"
version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION)
generators = "cmake"
requires = ("cmake-include-guard/master@smspillaz/cm... | from conans import ConanFile
from conans.tools import download, unzip
import os
VERSION = "0.0.2"
class VeraPPTargetCmakeConan(ConanFile):
name = "verapp-target-cmake"
version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION)
generators = "cmake"
requires = ("cmake-include-guard/master@smspillaz/cm... | <commit_before>from conans import ConanFile
from conans.tools import download, unzip
import os
VERSION = "0.0.2"
class VeraPPTargetCmakeConan(ConanFile):
name = "verapp-target-cmake"
version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION)
generators = "cmake"
requires = ("cmake-include-guard/mast... | from conans import ConanFile
from conans.tools import download, unzip
import os
VERSION = "0.0.2"
class VeraPPTargetCmakeConan(ConanFile):
name = "verapp-target-cmake"
version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION)
generators = "cmake"
requires = ("cmake-include-guard/master@smspillaz/cm... | from conans import ConanFile
from conans.tools import download, unzip
import os
VERSION = "0.0.2"
class VeraPPTargetCmakeConan(ConanFile):
name = "verapp-target-cmake"
version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION)
generators = "cmake"
requires = ("cmake-include-guard/master@smspillaz/cm... | <commit_before>from conans import ConanFile
from conans.tools import download, unzip
import os
VERSION = "0.0.2"
class VeraPPTargetCmakeConan(ConanFile):
name = "verapp-target-cmake"
version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION)
generators = "cmake"
requires = ("cmake-include-guard/mast... |
0d8ce87cda68a0e882cf1108066e2bde6c9cb1fa | shopping_app/forms.py | shopping_app/forms.py | from wtforms import Form, BooleanField, StringField, PasswordField, validators
from wtforms.validators import DataRequired, InputRequired
class LoginForm(Form):
username = StringField('username', validators=[InputRequired(), DataRequired()])
password = PasswordField('password', validators=[InputRequired(), Da... | from wtforms import Form, DecimalField, IntegerField, StringField, PasswordField, validators, ValidationError
from wtforms.validators import DataRequired, InputRequired
from .utils.helpers import check_duplicate_item_name
class LoginForm(Form):
username = StringField('username', validators=[InputRequired(), DataR... | Add create shopping item form | Add create shopping item form
| Python | mit | gr1d99/shopping-list,gr1d99/shopping-list,gr1d99/shopping-list | from wtforms import Form, BooleanField, StringField, PasswordField, validators
from wtforms.validators import DataRequired, InputRequired
class LoginForm(Form):
username = StringField('username', validators=[InputRequired(), DataRequired()])
password = PasswordField('password', validators=[InputRequired(), Da... | from wtforms import Form, DecimalField, IntegerField, StringField, PasswordField, validators, ValidationError
from wtforms.validators import DataRequired, InputRequired
from .utils.helpers import check_duplicate_item_name
class LoginForm(Form):
username = StringField('username', validators=[InputRequired(), DataR... | <commit_before>from wtforms import Form, BooleanField, StringField, PasswordField, validators
from wtforms.validators import DataRequired, InputRequired
class LoginForm(Form):
username = StringField('username', validators=[InputRequired(), DataRequired()])
password = PasswordField('password', validators=[Inpu... | from wtforms import Form, DecimalField, IntegerField, StringField, PasswordField, validators, ValidationError
from wtforms.validators import DataRequired, InputRequired
from .utils.helpers import check_duplicate_item_name
class LoginForm(Form):
username = StringField('username', validators=[InputRequired(), DataR... | from wtforms import Form, BooleanField, StringField, PasswordField, validators
from wtforms.validators import DataRequired, InputRequired
class LoginForm(Form):
username = StringField('username', validators=[InputRequired(), DataRequired()])
password = PasswordField('password', validators=[InputRequired(), Da... | <commit_before>from wtforms import Form, BooleanField, StringField, PasswordField, validators
from wtforms.validators import DataRequired, InputRequired
class LoginForm(Form):
username = StringField('username', validators=[InputRequired(), DataRequired()])
password = PasswordField('password', validators=[Inpu... |
5f8069d61eff6241dc036409a5e6862fd8baac27 | examples/graphviz.py | examples/graphviz.py | #!/usr/bin/env python
"""
Pandoc filter to process code blocks with class "graphviz" into
graphviz-generated images.
"""
import pygraphviz
import hashlib
import os
import sys
from pandocfilters import toJSONFilter, Str, Para, Image
def sha1(x):
return hashlib.sha1(x).hexdigest()
imagedir = "graphviz-images"
def ... | #!/usr/bin/env python
"""
Pandoc filter to process code blocks with class "graphviz" into
graphviz-generated images.
"""
import pygraphviz
import hashlib
import os
import sys
from pandocfilters import toJSONFilter, Str, Para, Image
def sha1(x):
return hashlib.sha1(x).hexdigest()
imagedir = "graphviz-images"
def ... | Fix creation of json for image (pandoc 1.12.3.3) | Fix creation of json for image (pandoc 1.12.3.3)
At least with pandoc 1.12.3.3 otherwise you get an error
pandoc: when expecting a [a], encountered Object instead | Python | bsd-3-clause | AugustH/pandocfilters,alycosta/pandocfilters,silvio/pandocfilters,jgm/pandocfilters,infotroph/pandocfilters,timtylin/scholdoc-filters | #!/usr/bin/env python
"""
Pandoc filter to process code blocks with class "graphviz" into
graphviz-generated images.
"""
import pygraphviz
import hashlib
import os
import sys
from pandocfilters import toJSONFilter, Str, Para, Image
def sha1(x):
return hashlib.sha1(x).hexdigest()
imagedir = "graphviz-images"
def ... | #!/usr/bin/env python
"""
Pandoc filter to process code blocks with class "graphviz" into
graphviz-generated images.
"""
import pygraphviz
import hashlib
import os
import sys
from pandocfilters import toJSONFilter, Str, Para, Image
def sha1(x):
return hashlib.sha1(x).hexdigest()
imagedir = "graphviz-images"
def ... | <commit_before>#!/usr/bin/env python
"""
Pandoc filter to process code blocks with class "graphviz" into
graphviz-generated images.
"""
import pygraphviz
import hashlib
import os
import sys
from pandocfilters import toJSONFilter, Str, Para, Image
def sha1(x):
return hashlib.sha1(x).hexdigest()
imagedir = "graphvi... | #!/usr/bin/env python
"""
Pandoc filter to process code blocks with class "graphviz" into
graphviz-generated images.
"""
import pygraphviz
import hashlib
import os
import sys
from pandocfilters import toJSONFilter, Str, Para, Image
def sha1(x):
return hashlib.sha1(x).hexdigest()
imagedir = "graphviz-images"
def ... | #!/usr/bin/env python
"""
Pandoc filter to process code blocks with class "graphviz" into
graphviz-generated images.
"""
import pygraphviz
import hashlib
import os
import sys
from pandocfilters import toJSONFilter, Str, Para, Image
def sha1(x):
return hashlib.sha1(x).hexdigest()
imagedir = "graphviz-images"
def ... | <commit_before>#!/usr/bin/env python
"""
Pandoc filter to process code blocks with class "graphviz" into
graphviz-generated images.
"""
import pygraphviz
import hashlib
import os
import sys
from pandocfilters import toJSONFilter, Str, Para, Image
def sha1(x):
return hashlib.sha1(x).hexdigest()
imagedir = "graphvi... |
83c92b4e5d28ae94c57c69aa19448f6763c48bc9 | f8a_jobs/defaults.py | f8a_jobs/defaults.py | #!/usr/bin/env python3
import os
from datetime import timedelta
_BAYESIAN_JOBS_DIR = os.path.dirname(os.path.realpath(__file__))
DEFAULT_SERVICE_PORT = 34000
SWAGGER_YAML_PATH = os.path.join(_BAYESIAN_JOBS_DIR, 'swagger.yaml')
DEFAULT_JOB_DIR = os.path.join(_BAYESIAN_JOBS_DIR, 'default_jobs')
TOKEN_VALID_TIME = timed... | #!/usr/bin/env python3
import os
from datetime import timedelta
_BAYESIAN_JOBS_DIR = os.path.dirname(os.path.realpath(__file__))
DEFAULT_SERVICE_PORT = 34000
SWAGGER_YAML_PATH = os.path.join(_BAYESIAN_JOBS_DIR, 'swagger.yaml')
DEFAULT_JOB_DIR = os.path.join(_BAYESIAN_JOBS_DIR, 'default_jobs')
TOKEN_VALID_TIME = timed... | Fix typo in name of variable | Fix typo in name of variable
| Python | apache-2.0 | fabric8-analytics/fabric8-analytics-jobs,fabric8-analytics/fabric8-analytics-jobs | #!/usr/bin/env python3
import os
from datetime import timedelta
_BAYESIAN_JOBS_DIR = os.path.dirname(os.path.realpath(__file__))
DEFAULT_SERVICE_PORT = 34000
SWAGGER_YAML_PATH = os.path.join(_BAYESIAN_JOBS_DIR, 'swagger.yaml')
DEFAULT_JOB_DIR = os.path.join(_BAYESIAN_JOBS_DIR, 'default_jobs')
TOKEN_VALID_TIME = timed... | #!/usr/bin/env python3
import os
from datetime import timedelta
_BAYESIAN_JOBS_DIR = os.path.dirname(os.path.realpath(__file__))
DEFAULT_SERVICE_PORT = 34000
SWAGGER_YAML_PATH = os.path.join(_BAYESIAN_JOBS_DIR, 'swagger.yaml')
DEFAULT_JOB_DIR = os.path.join(_BAYESIAN_JOBS_DIR, 'default_jobs')
TOKEN_VALID_TIME = timed... | <commit_before>#!/usr/bin/env python3
import os
from datetime import timedelta
_BAYESIAN_JOBS_DIR = os.path.dirname(os.path.realpath(__file__))
DEFAULT_SERVICE_PORT = 34000
SWAGGER_YAML_PATH = os.path.join(_BAYESIAN_JOBS_DIR, 'swagger.yaml')
DEFAULT_JOB_DIR = os.path.join(_BAYESIAN_JOBS_DIR, 'default_jobs')
TOKEN_VAL... | #!/usr/bin/env python3
import os
from datetime import timedelta
_BAYESIAN_JOBS_DIR = os.path.dirname(os.path.realpath(__file__))
DEFAULT_SERVICE_PORT = 34000
SWAGGER_YAML_PATH = os.path.join(_BAYESIAN_JOBS_DIR, 'swagger.yaml')
DEFAULT_JOB_DIR = os.path.join(_BAYESIAN_JOBS_DIR, 'default_jobs')
TOKEN_VALID_TIME = timed... | #!/usr/bin/env python3
import os
from datetime import timedelta
_BAYESIAN_JOBS_DIR = os.path.dirname(os.path.realpath(__file__))
DEFAULT_SERVICE_PORT = 34000
SWAGGER_YAML_PATH = os.path.join(_BAYESIAN_JOBS_DIR, 'swagger.yaml')
DEFAULT_JOB_DIR = os.path.join(_BAYESIAN_JOBS_DIR, 'default_jobs')
TOKEN_VALID_TIME = timed... | <commit_before>#!/usr/bin/env python3
import os
from datetime import timedelta
_BAYESIAN_JOBS_DIR = os.path.dirname(os.path.realpath(__file__))
DEFAULT_SERVICE_PORT = 34000
SWAGGER_YAML_PATH = os.path.join(_BAYESIAN_JOBS_DIR, 'swagger.yaml')
DEFAULT_JOB_DIR = os.path.join(_BAYESIAN_JOBS_DIR, 'default_jobs')
TOKEN_VAL... |
582460dcfeb85e2132705ba789eb88d1c67ae022 | counting_sort.py | counting_sort.py | import random
import time
def counting_sort(array):
k = max(array)
counts = [0]*(k+1)
for x in array:
counts[x] += 1
total = 0
for i in range(0,k+1):
c = counts[i]
counts[i] = total
total = total + c
output = [0]*len(array)
for x in array:
output[co... | import random
import time
def counting_sort(array):
k = max(array)
counts = [0]*(k+1)
for x in array:
counts[x] += 1
output = []
for x in xrange(k+1):
output += [x]*counts[x]
return output
if __name__ == "__main__":
assert counting_sort([5,3,2,1]) == [1,2,3,5]
x = []... | Use a much simpler (and faster) output building step. | Use a much simpler (and faster) output building step.
This implementation is much easeir to read, and is a lot clearer
about what's going on. It turns out that it's about 3 times faster
in python too!
| Python | mit | samphippen/linear_sort | import random
import time
def counting_sort(array):
k = max(array)
counts = [0]*(k+1)
for x in array:
counts[x] += 1
total = 0
for i in range(0,k+1):
c = counts[i]
counts[i] = total
total = total + c
output = [0]*len(array)
for x in array:
output[co... | import random
import time
def counting_sort(array):
k = max(array)
counts = [0]*(k+1)
for x in array:
counts[x] += 1
output = []
for x in xrange(k+1):
output += [x]*counts[x]
return output
if __name__ == "__main__":
assert counting_sort([5,3,2,1]) == [1,2,3,5]
x = []... | <commit_before>import random
import time
def counting_sort(array):
k = max(array)
counts = [0]*(k+1)
for x in array:
counts[x] += 1
total = 0
for i in range(0,k+1):
c = counts[i]
counts[i] = total
total = total + c
output = [0]*len(array)
for x in array:
... | import random
import time
def counting_sort(array):
k = max(array)
counts = [0]*(k+1)
for x in array:
counts[x] += 1
output = []
for x in xrange(k+1):
output += [x]*counts[x]
return output
if __name__ == "__main__":
assert counting_sort([5,3,2,1]) == [1,2,3,5]
x = []... | import random
import time
def counting_sort(array):
k = max(array)
counts = [0]*(k+1)
for x in array:
counts[x] += 1
total = 0
for i in range(0,k+1):
c = counts[i]
counts[i] = total
total = total + c
output = [0]*len(array)
for x in array:
output[co... | <commit_before>import random
import time
def counting_sort(array):
k = max(array)
counts = [0]*(k+1)
for x in array:
counts[x] += 1
total = 0
for i in range(0,k+1):
c = counts[i]
counts[i] = total
total = total + c
output = [0]*len(array)
for x in array:
... |
71671f30589464c4d714110a6f00ca6ab327c5c6 | blogs/middleware.py | blogs/middleware.py | from django.shortcuts import get_object_or_404
from django.contrib.auth.models import User
from annoying.functions import get_object_or_None
class BlogMiddleware:
def process_request(self, request):
request.blog_user = None
host = request.META.get('HTTP_HOST', '')
host_s = host.replace('... | from django.shortcuts import get_object_or_404
from django.contrib.auth.models import User
from annoying.functions import get_object_or_None
class BlogMiddleware:
def process_request(self, request):
request.blog_user = None
host = request.META.get('HTTP_HOST', '')
host_s = host.replace('... | Allow Pro users to specify multiple domains to serve their blog. Specifically for www/non-www setups. | Allow Pro users to specify multiple domains to serve their blog. Specifically for www/non-www setups.
| Python | mit | nicksergeant/snipt,nicksergeant/snipt,nicksergeant/snipt | from django.shortcuts import get_object_or_404
from django.contrib.auth.models import User
from annoying.functions import get_object_or_None
class BlogMiddleware:
def process_request(self, request):
request.blog_user = None
host = request.META.get('HTTP_HOST', '')
host_s = host.replace('... | from django.shortcuts import get_object_or_404
from django.contrib.auth.models import User
from annoying.functions import get_object_or_None
class BlogMiddleware:
def process_request(self, request):
request.blog_user = None
host = request.META.get('HTTP_HOST', '')
host_s = host.replace('... | <commit_before>from django.shortcuts import get_object_or_404
from django.contrib.auth.models import User
from annoying.functions import get_object_or_None
class BlogMiddleware:
def process_request(self, request):
request.blog_user = None
host = request.META.get('HTTP_HOST', '')
host_s =... | from django.shortcuts import get_object_or_404
from django.contrib.auth.models import User
from annoying.functions import get_object_or_None
class BlogMiddleware:
def process_request(self, request):
request.blog_user = None
host = request.META.get('HTTP_HOST', '')
host_s = host.replace('... | from django.shortcuts import get_object_or_404
from django.contrib.auth.models import User
from annoying.functions import get_object_or_None
class BlogMiddleware:
def process_request(self, request):
request.blog_user = None
host = request.META.get('HTTP_HOST', '')
host_s = host.replace('... | <commit_before>from django.shortcuts import get_object_or_404
from django.contrib.auth.models import User
from annoying.functions import get_object_or_None
class BlogMiddleware:
def process_request(self, request):
request.blog_user = None
host = request.META.get('HTTP_HOST', '')
host_s =... |
99e443f51e5cab27b4a511d1ff9db8e5fc571a62 | hostmonitor/management/commands/addhost.py | hostmonitor/management/commands/addhost.py | from iptools import validate_ip, validate_cidr, IpRange
from django.core.management.base import BaseCommand, CommandError
from hostmonitor.models import Host
class Command(BaseCommand):
args = '<target target ...>'
help = 'Add the specified hosts or CIDR networks (not network/broadcast)'
def add_host(sel... | import socket
from django.core.management.base import BaseCommand, CommandError
from django.db.utils import IntegrityError
from iptools import validate_ip, validate_cidr, IpRange
from hostmonitor.models import Host
def resolve_dns(name):
return set([x[4][0] for x in socket.getaddrinfo(name, 80)])
class Comman... | Support adding hosts by DNS | Support adding hosts by DNS | Python | mit | kapsiry/vahti | from iptools import validate_ip, validate_cidr, IpRange
from django.core.management.base import BaseCommand, CommandError
from hostmonitor.models import Host
class Command(BaseCommand):
args = '<target target ...>'
help = 'Add the specified hosts or CIDR networks (not network/broadcast)'
def add_host(sel... | import socket
from django.core.management.base import BaseCommand, CommandError
from django.db.utils import IntegrityError
from iptools import validate_ip, validate_cidr, IpRange
from hostmonitor.models import Host
def resolve_dns(name):
return set([x[4][0] for x in socket.getaddrinfo(name, 80)])
class Comman... | <commit_before>from iptools import validate_ip, validate_cidr, IpRange
from django.core.management.base import BaseCommand, CommandError
from hostmonitor.models import Host
class Command(BaseCommand):
args = '<target target ...>'
help = 'Add the specified hosts or CIDR networks (not network/broadcast)'
d... | import socket
from django.core.management.base import BaseCommand, CommandError
from django.db.utils import IntegrityError
from iptools import validate_ip, validate_cidr, IpRange
from hostmonitor.models import Host
def resolve_dns(name):
return set([x[4][0] for x in socket.getaddrinfo(name, 80)])
class Comman... | from iptools import validate_ip, validate_cidr, IpRange
from django.core.management.base import BaseCommand, CommandError
from hostmonitor.models import Host
class Command(BaseCommand):
args = '<target target ...>'
help = 'Add the specified hosts or CIDR networks (not network/broadcast)'
def add_host(sel... | <commit_before>from iptools import validate_ip, validate_cidr, IpRange
from django.core.management.base import BaseCommand, CommandError
from hostmonitor.models import Host
class Command(BaseCommand):
args = '<target target ...>'
help = 'Add the specified hosts or CIDR networks (not network/broadcast)'
d... |
6f0519eebb8449fdc384bdfdd724405cb06b45eb | main.py | main.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from website.app import init_app
app = init_app('website.settings', set_backends=True, routes=True)
if __name__ == '__main__':
app.run(host='127.0.0.1', port=5000)
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from website.app import init_app
app = init_app('website.settings', set_backends=True, routes=True)
if __name__ == '__main__':
host = os.environ.get('OSF_HOST', None)
port = os.environ.get('OSF_PORT', None)
app.run(host=host, port=port)
| Make host and port configurable thru envvars | Make host and port configurable thru envvars
| Python | apache-2.0 | alexschiller/osf.io,binoculars/osf.io,sbt9uc/osf.io,adlius/osf.io,MerlinZhang/osf.io,samanehsan/osf.io,monikagrabowska/osf.io,ZobairAlijan/osf.io,dplorimer/osf,samchrisinger/osf.io,zachjanicki/osf.io,samchrisinger/osf.io,leb2dg/osf.io,zkraime/osf.io,petermalcolm/osf.io,chrisseto/osf.io,mfraezz/osf.io,hmoco/osf.io,Cente... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from website.app import init_app
app = init_app('website.settings', set_backends=True, routes=True)
if __name__ == '__main__':
app.run(host='127.0.0.1', port=5000)
Make host and port configurable thru envvars | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from website.app import init_app
app = init_app('website.settings', set_backends=True, routes=True)
if __name__ == '__main__':
host = os.environ.get('OSF_HOST', None)
port = os.environ.get('OSF_PORT', None)
app.run(host=host, port=port)
| <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from website.app import init_app
app = init_app('website.settings', set_backends=True, routes=True)
if __name__ == '__main__':
app.run(host='127.0.0.1', port=5000)
<commit_msg>Make host and port configurable thru envvars<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from website.app import init_app
app = init_app('website.settings', set_backends=True, routes=True)
if __name__ == '__main__':
host = os.environ.get('OSF_HOST', None)
port = os.environ.get('OSF_PORT', None)
app.run(host=host, port=port)
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
from website.app import init_app
app = init_app('website.settings', set_backends=True, routes=True)
if __name__ == '__main__':
app.run(host='127.0.0.1', port=5000)
Make host and port configurable thru envvars#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
fr... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from website.app import init_app
app = init_app('website.settings', set_backends=True, routes=True)
if __name__ == '__main__':
app.run(host='127.0.0.1', port=5000)
<commit_msg>Make host and port configurable thru envvars<commit_after>#!/usr/bin/env pyt... |
4f0c3e800fbbfab2d576a82b5a1db20d7feb676e | linked_accounts/authentication.py | linked_accounts/authentication.py | from django.http import HttpResponse
from django.template import loader
from django.utils.crypto import salted_hmac, constant_time_compare
from django.contrib.auth.models import User
class HMACAuth(object):
def __init__(self, realm='API'):
self.realm = realm
def process_request(self, request):
... | from django.http import HttpResponse
from django.template import loader
from django.utils.crypto import salted_hmac, constant_time_compare
from django.contrib.auth.models import User
class HMACAuth(object):
def __init__(self, realm='API'):
self.realm = realm
def process_request(self, request):
... | Return is_authenticated true if we got user and it is active | Return is_authenticated true if we got user and it is active
| Python | mit | zen4ever/django-linked-accounts,zen4ever/django-linked-accounts | from django.http import HttpResponse
from django.template import loader
from django.utils.crypto import salted_hmac, constant_time_compare
from django.contrib.auth.models import User
class HMACAuth(object):
def __init__(self, realm='API'):
self.realm = realm
def process_request(self, request):
... | from django.http import HttpResponse
from django.template import loader
from django.utils.crypto import salted_hmac, constant_time_compare
from django.contrib.auth.models import User
class HMACAuth(object):
def __init__(self, realm='API'):
self.realm = realm
def process_request(self, request):
... | <commit_before>from django.http import HttpResponse
from django.template import loader
from django.utils.crypto import salted_hmac, constant_time_compare
from django.contrib.auth.models import User
class HMACAuth(object):
def __init__(self, realm='API'):
self.realm = realm
def process_request(self,... | from django.http import HttpResponse
from django.template import loader
from django.utils.crypto import salted_hmac, constant_time_compare
from django.contrib.auth.models import User
class HMACAuth(object):
def __init__(self, realm='API'):
self.realm = realm
def process_request(self, request):
... | from django.http import HttpResponse
from django.template import loader
from django.utils.crypto import salted_hmac, constant_time_compare
from django.contrib.auth.models import User
class HMACAuth(object):
def __init__(self, realm='API'):
self.realm = realm
def process_request(self, request):
... | <commit_before>from django.http import HttpResponse
from django.template import loader
from django.utils.crypto import salted_hmac, constant_time_compare
from django.contrib.auth.models import User
class HMACAuth(object):
def __init__(self, realm='API'):
self.realm = realm
def process_request(self,... |
ba3210b802c9cc1395edee1ad84cea025cc275cf | regconfig/reg_d.py | regconfig/reg_d.py | #### Regulation D
INCLUDE_DEFINITIONS_IN_PART_1004 = [
('Alternative mortgage transaction', 'Alternative mortgage transaction'),
('Creditor', 'Creditor'),
('State', 'State'),
('State law', 'State law'),
]
PARAGRAPH_HIERARCHY_1004 = {
'1004.2': [
1,
1,
2, 2, 2,
1,
... | #### Regulation D
INCLUDE_DEFINITIONS_IN_PART_1004 = [
('Creditor', 'Creditor shall have the same meaning as in 12 CFR 226.2'),
]
PARAGRAPH_HIERARCHY_1004 = {
'1004.2': [
1,
1,
2, 2, 2,
1,
1,
2, 2, 2, 2,
1,
1,
],
}
| Fix reg d included definitions | Fix reg d included definitions
| Python | cc0-1.0 | cfpb/regulations-configs,ascott1/regulations-configs,grapesmoker/regulations-configs | #### Regulation D
INCLUDE_DEFINITIONS_IN_PART_1004 = [
('Alternative mortgage transaction', 'Alternative mortgage transaction'),
('Creditor', 'Creditor'),
('State', 'State'),
('State law', 'State law'),
]
PARAGRAPH_HIERARCHY_1004 = {
'1004.2': [
1,
1,
2, 2, 2,
1,
... | #### Regulation D
INCLUDE_DEFINITIONS_IN_PART_1004 = [
('Creditor', 'Creditor shall have the same meaning as in 12 CFR 226.2'),
]
PARAGRAPH_HIERARCHY_1004 = {
'1004.2': [
1,
1,
2, 2, 2,
1,
1,
2, 2, 2, 2,
1,
1,
],
}
| <commit_before>#### Regulation D
INCLUDE_DEFINITIONS_IN_PART_1004 = [
('Alternative mortgage transaction', 'Alternative mortgage transaction'),
('Creditor', 'Creditor'),
('State', 'State'),
('State law', 'State law'),
]
PARAGRAPH_HIERARCHY_1004 = {
'1004.2': [
1,
1,
2, 2, 2... | #### Regulation D
INCLUDE_DEFINITIONS_IN_PART_1004 = [
('Creditor', 'Creditor shall have the same meaning as in 12 CFR 226.2'),
]
PARAGRAPH_HIERARCHY_1004 = {
'1004.2': [
1,
1,
2, 2, 2,
1,
1,
2, 2, 2, 2,
1,
1,
],
}
| #### Regulation D
INCLUDE_DEFINITIONS_IN_PART_1004 = [
('Alternative mortgage transaction', 'Alternative mortgage transaction'),
('Creditor', 'Creditor'),
('State', 'State'),
('State law', 'State law'),
]
PARAGRAPH_HIERARCHY_1004 = {
'1004.2': [
1,
1,
2, 2, 2,
1,
... | <commit_before>#### Regulation D
INCLUDE_DEFINITIONS_IN_PART_1004 = [
('Alternative mortgage transaction', 'Alternative mortgage transaction'),
('Creditor', 'Creditor'),
('State', 'State'),
('State law', 'State law'),
]
PARAGRAPH_HIERARCHY_1004 = {
'1004.2': [
1,
1,
2, 2, 2... |
e6acee0000b68bf57a59d13bda0ca3b547d11c2b | tests/acceptance/test_dcos_command.py | tests/acceptance/test_dcos_command.py | from shakedown import *
def test_run_command():
exit_status, output = run_command(master_ip(), 'cat /etc/motd')
assert exit_status
def test_run_command_on_master():
exit_status, output = run_command_on_master('uname -a')
assert exit_status
assert output.startswith('Linux')
def test_run_command_o... | from shakedown import *
def test_run_command():
exit_status, output = run_command(master_ip(), 'cat /etc/motd')
assert exit_status
def test_run_command_on_master():
exit_status, output = run_command_on_master('uname -a')
assert exit_status
assert output.startswith('Linux')
def test_run_command_o... | Make test_run_command_on_agent connect to all agents | Make test_run_command_on_agent connect to all agents
Increase testing of SSH connection handling by connecting to all
agents in the cluster.
| Python | apache-2.0 | dcos/shakedown | from shakedown import *
def test_run_command():
exit_status, output = run_command(master_ip(), 'cat /etc/motd')
assert exit_status
def test_run_command_on_master():
exit_status, output = run_command_on_master('uname -a')
assert exit_status
assert output.startswith('Linux')
def test_run_command_o... | from shakedown import *
def test_run_command():
exit_status, output = run_command(master_ip(), 'cat /etc/motd')
assert exit_status
def test_run_command_on_master():
exit_status, output = run_command_on_master('uname -a')
assert exit_status
assert output.startswith('Linux')
def test_run_command_o... | <commit_before>from shakedown import *
def test_run_command():
exit_status, output = run_command(master_ip(), 'cat /etc/motd')
assert exit_status
def test_run_command_on_master():
exit_status, output = run_command_on_master('uname -a')
assert exit_status
assert output.startswith('Linux')
def tes... | from shakedown import *
def test_run_command():
exit_status, output = run_command(master_ip(), 'cat /etc/motd')
assert exit_status
def test_run_command_on_master():
exit_status, output = run_command_on_master('uname -a')
assert exit_status
assert output.startswith('Linux')
def test_run_command_o... | from shakedown import *
def test_run_command():
exit_status, output = run_command(master_ip(), 'cat /etc/motd')
assert exit_status
def test_run_command_on_master():
exit_status, output = run_command_on_master('uname -a')
assert exit_status
assert output.startswith('Linux')
def test_run_command_o... | <commit_before>from shakedown import *
def test_run_command():
exit_status, output = run_command(master_ip(), 'cat /etc/motd')
assert exit_status
def test_run_command_on_master():
exit_status, output = run_command_on_master('uname -a')
assert exit_status
assert output.startswith('Linux')
def tes... |
db4620130cf8444dec7c42bc1f907acdec89dfed | maws.py | maws.py | #!/usr/bin/python3
import argparse
import sys
from mawslib.manager import Manager
configfile="cloudconfig.yaml"
parser = argparse.ArgumentParser(
#add_help=False,
description='AWS Manager',
usage='''maws [<options>] <command> <subcommand> [<args>]
For help:
maws help
maws <command> help
maws <c... | #!/usr/bin/python3
import argparse
import sys
from mawslib.manager import Manager
import importlib
configfile="cloudconfig.yaml"
parser = argparse.ArgumentParser(
#add_help=False,
description='AWS Manager',
usage='''maws [<options>] <command> <subcommand> [<args>]
For help:
maws help
maws <command... | Use importlib instead of exec (exec was pretty ugly) | Use importlib instead of exec (exec was pretty ugly)
| Python | mit | uva-its/awstools | #!/usr/bin/python3
import argparse
import sys
from mawslib.manager import Manager
configfile="cloudconfig.yaml"
parser = argparse.ArgumentParser(
#add_help=False,
description='AWS Manager',
usage='''maws [<options>] <command> <subcommand> [<args>]
For help:
maws help
maws <command> help
maws <c... | #!/usr/bin/python3
import argparse
import sys
from mawslib.manager import Manager
import importlib
configfile="cloudconfig.yaml"
parser = argparse.ArgumentParser(
#add_help=False,
description='AWS Manager',
usage='''maws [<options>] <command> <subcommand> [<args>]
For help:
maws help
maws <command... | <commit_before>#!/usr/bin/python3
import argparse
import sys
from mawslib.manager import Manager
configfile="cloudconfig.yaml"
parser = argparse.ArgumentParser(
#add_help=False,
description='AWS Manager',
usage='''maws [<options>] <command> <subcommand> [<args>]
For help:
maws help
maws <command> ... | #!/usr/bin/python3
import argparse
import sys
from mawslib.manager import Manager
import importlib
configfile="cloudconfig.yaml"
parser = argparse.ArgumentParser(
#add_help=False,
description='AWS Manager',
usage='''maws [<options>] <command> <subcommand> [<args>]
For help:
maws help
maws <command... | #!/usr/bin/python3
import argparse
import sys
from mawslib.manager import Manager
configfile="cloudconfig.yaml"
parser = argparse.ArgumentParser(
#add_help=False,
description='AWS Manager',
usage='''maws [<options>] <command> <subcommand> [<args>]
For help:
maws help
maws <command> help
maws <c... | <commit_before>#!/usr/bin/python3
import argparse
import sys
from mawslib.manager import Manager
configfile="cloudconfig.yaml"
parser = argparse.ArgumentParser(
#add_help=False,
description='AWS Manager',
usage='''maws [<options>] <command> <subcommand> [<args>]
For help:
maws help
maws <command> ... |
4851e57059e496b311fb68fc566e47e3d76745fb | string/first-str-substr-occr.py | string/first-str-substr-occr.py | # Implement a function that takes two strings, s and x, as arguments and finds the first occurrence of the string x in s. The function should return an integer indicating the index in s of the first occurrence of x. If there are no occurrences of x in s, return -1
def find_substring(string, substr):
string_len = len(... | # Implement a function that takes two strings, s and x, as arguments and finds the first occurrence of the string x in s. The function should return an integer indicating the index in s of the first occurrence of x. If there are no occurrences of x in s, return -1
def find_substring(string, substr):
string_len = len(... | Debug and add first test case | Debug and add first test case
| Python | mit | derekmpham/interview-prep,derekmpham/interview-prep | # Implement a function that takes two strings, s and x, as arguments and finds the first occurrence of the string x in s. The function should return an integer indicating the index in s of the first occurrence of x. If there are no occurrences of x in s, return -1
def find_substring(string, substr):
string_len = len(... | # Implement a function that takes two strings, s and x, as arguments and finds the first occurrence of the string x in s. The function should return an integer indicating the index in s of the first occurrence of x. If there are no occurrences of x in s, return -1
def find_substring(string, substr):
string_len = len(... | <commit_before># Implement a function that takes two strings, s and x, as arguments and finds the first occurrence of the string x in s. The function should return an integer indicating the index in s of the first occurrence of x. If there are no occurrences of x in s, return -1
def find_substring(string, substr):
st... | # Implement a function that takes two strings, s and x, as arguments and finds the first occurrence of the string x in s. The function should return an integer indicating the index in s of the first occurrence of x. If there are no occurrences of x in s, return -1
def find_substring(string, substr):
string_len = len(... | # Implement a function that takes two strings, s and x, as arguments and finds the first occurrence of the string x in s. The function should return an integer indicating the index in s of the first occurrence of x. If there are no occurrences of x in s, return -1
def find_substring(string, substr):
string_len = len(... | <commit_before># Implement a function that takes two strings, s and x, as arguments and finds the first occurrence of the string x in s. The function should return an integer indicating the index in s of the first occurrence of x. If there are no occurrences of x in s, return -1
def find_substring(string, substr):
st... |
beaa9f56cc76dc9ebd531d84e595420a4037a9a9 | tests/factories/user.py | tests/factories/user.py | # -*- coding: utf-8 -*-
# Copyright (c) 2016 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
import factory
from factory.faker import Faker
from pycroft.model.user import User
from... | # -*- coding: utf-8 -*-
# Copyright (c) 2016 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
import factory
from factory.faker import Faker
from pycroft.model.user import User, Roo... | Add correct room_history_entry in UserFactory | Add correct room_history_entry in UserFactory
| Python | apache-2.0 | agdsn/pycroft,agdsn/pycroft,agdsn/pycroft,agdsn/pycroft,agdsn/pycroft | # -*- coding: utf-8 -*-
# Copyright (c) 2016 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
import factory
from factory.faker import Faker
from pycroft.model.user import User
from... | # -*- coding: utf-8 -*-
# Copyright (c) 2016 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
import factory
from factory.faker import Faker
from pycroft.model.user import User, Roo... | <commit_before># -*- coding: utf-8 -*-
# Copyright (c) 2016 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
import factory
from factory.faker import Faker
from pycroft.model.user i... | # -*- coding: utf-8 -*-
# Copyright (c) 2016 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
import factory
from factory.faker import Faker
from pycroft.model.user import User, Roo... | # -*- coding: utf-8 -*-
# Copyright (c) 2016 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
import factory
from factory.faker import Faker
from pycroft.model.user import User
from... | <commit_before># -*- coding: utf-8 -*-
# Copyright (c) 2016 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
import factory
from factory.faker import Faker
from pycroft.model.user i... |
327d9c762ddbbfb2c90cea347dd5612499ade3d4 | tests/setup_teardown.py | tests/setup_teardown.py | import os
from skidl import *
files_at_start = set([])
def setup_function(f):
global files_at_start
files_at_start = set(os.listdir('.'))
# Make this test directory the library search paths for all ECAD tools
for tool_lib_path in lib_search_paths:
tool_lib_path = [os.path.dirname(os.path.abs... | import os
from skidl import *
files_at_start = set([])
def setup_function(f):
global files_at_start
files_at_start = set(os.listdir('.'))
default_circuit.mini_reset()
lib_search_paths.clear()
lib_search_paths.update({
KICAD: [".", get_filename(".")],
SKIDL: [".", get_filename("../s... | Set up library search paths for tests. | Set up library search paths for tests.
When running tests, exclusively use the libraries that are either
built-in, or are provided with the test suite.
| Python | mit | xesscorp/skidl,xesscorp/skidl | import os
from skidl import *
files_at_start = set([])
def setup_function(f):
global files_at_start
files_at_start = set(os.listdir('.'))
# Make this test directory the library search paths for all ECAD tools
for tool_lib_path in lib_search_paths:
tool_lib_path = [os.path.dirname(os.path.abs... | import os
from skidl import *
files_at_start = set([])
def setup_function(f):
global files_at_start
files_at_start = set(os.listdir('.'))
default_circuit.mini_reset()
lib_search_paths.clear()
lib_search_paths.update({
KICAD: [".", get_filename(".")],
SKIDL: [".", get_filename("../s... | <commit_before>import os
from skidl import *
files_at_start = set([])
def setup_function(f):
global files_at_start
files_at_start = set(os.listdir('.'))
# Make this test directory the library search paths for all ECAD tools
for tool_lib_path in lib_search_paths:
tool_lib_path = [os.path.dirn... | import os
from skidl import *
files_at_start = set([])
def setup_function(f):
global files_at_start
files_at_start = set(os.listdir('.'))
default_circuit.mini_reset()
lib_search_paths.clear()
lib_search_paths.update({
KICAD: [".", get_filename(".")],
SKIDL: [".", get_filename("../s... | import os
from skidl import *
files_at_start = set([])
def setup_function(f):
global files_at_start
files_at_start = set(os.listdir('.'))
# Make this test directory the library search paths for all ECAD tools
for tool_lib_path in lib_search_paths:
tool_lib_path = [os.path.dirname(os.path.abs... | <commit_before>import os
from skidl import *
files_at_start = set([])
def setup_function(f):
global files_at_start
files_at_start = set(os.listdir('.'))
# Make this test directory the library search paths for all ECAD tools
for tool_lib_path in lib_search_paths:
tool_lib_path = [os.path.dirn... |
6ef2973fe269ec17d607f63b565ac3a82ff86c0a | examples/treeping64.py | examples/treeping64.py | #!/usr/bin/python
"Create a 64-node tree network, and test connectivity using ping."
from mininet.log import setLogLevel
from mininet.net import init, Mininet
from mininet.node import KernelSwitch, UserSwitch, OVSKernelSwitch
from mininet.topolib import TreeNet
def treePing64():
"Run ping test on 64-node tree ne... | #!/usr/bin/python
"Create a 64-node tree network, and test connectivity using ping."
from mininet.log import setLogLevel
from mininet.net import init, Mininet
from mininet.node import KernelSwitch, UserSwitch, OVSKernelSwitch
from mininet.topolib import TreeNet
def treePing64():
"Run ping test on 64-node tree ne... | Use switches rather than switches.keys(). | Use switches rather than switches.keys().
Minor cosmetic change, really.
| Python | bsd-3-clause | mininet/mininet,mininet/mininet,mininet/mininet | #!/usr/bin/python
"Create a 64-node tree network, and test connectivity using ping."
from mininet.log import setLogLevel
from mininet.net import init, Mininet
from mininet.node import KernelSwitch, UserSwitch, OVSKernelSwitch
from mininet.topolib import TreeNet
def treePing64():
"Run ping test on 64-node tree ne... | #!/usr/bin/python
"Create a 64-node tree network, and test connectivity using ping."
from mininet.log import setLogLevel
from mininet.net import init, Mininet
from mininet.node import KernelSwitch, UserSwitch, OVSKernelSwitch
from mininet.topolib import TreeNet
def treePing64():
"Run ping test on 64-node tree ne... | <commit_before>#!/usr/bin/python
"Create a 64-node tree network, and test connectivity using ping."
from mininet.log import setLogLevel
from mininet.net import init, Mininet
from mininet.node import KernelSwitch, UserSwitch, OVSKernelSwitch
from mininet.topolib import TreeNet
def treePing64():
"Run ping test on ... | #!/usr/bin/python
"Create a 64-node tree network, and test connectivity using ping."
from mininet.log import setLogLevel
from mininet.net import init, Mininet
from mininet.node import KernelSwitch, UserSwitch, OVSKernelSwitch
from mininet.topolib import TreeNet
def treePing64():
"Run ping test on 64-node tree ne... | #!/usr/bin/python
"Create a 64-node tree network, and test connectivity using ping."
from mininet.log import setLogLevel
from mininet.net import init, Mininet
from mininet.node import KernelSwitch, UserSwitch, OVSKernelSwitch
from mininet.topolib import TreeNet
def treePing64():
"Run ping test on 64-node tree ne... | <commit_before>#!/usr/bin/python
"Create a 64-node tree network, and test connectivity using ping."
from mininet.log import setLogLevel
from mininet.net import init, Mininet
from mininet.node import KernelSwitch, UserSwitch, OVSKernelSwitch
from mininet.topolib import TreeNet
def treePing64():
"Run ping test on ... |
9188c2bd910d86a4dc2e57c991d9ce21aecc3316 | malcolm/core/vmetas/choicemeta.py | malcolm/core/vmetas/choicemeta.py | from malcolm.compat import str_
from malcolm.core.serializable import Serializable, deserialize_object
from malcolm.core.vmeta import VMeta
@Serializable.register_subclass("malcolm:core/ChoiceMeta:1.0")
class ChoiceMeta(VMeta):
"""Meta object containing information for a enum"""
endpoints = ["description", "... | from malcolm.compat import str_
from malcolm.core.serializable import Serializable, deserialize_object
from malcolm.core.vmeta import VMeta
@Serializable.register_subclass("malcolm:core/ChoiceMeta:1.0")
class ChoiceMeta(VMeta):
"""Meta object containing information for a enum"""
endpoints = ["description", "... | Fix PandA firmware issue with a hack | Fix PandA firmware issue with a hack
| Python | apache-2.0 | dls-controls/pymalcolm,dls-controls/pymalcolm,dls-controls/pymalcolm | from malcolm.compat import str_
from malcolm.core.serializable import Serializable, deserialize_object
from malcolm.core.vmeta import VMeta
@Serializable.register_subclass("malcolm:core/ChoiceMeta:1.0")
class ChoiceMeta(VMeta):
"""Meta object containing information for a enum"""
endpoints = ["description", "... | from malcolm.compat import str_
from malcolm.core.serializable import Serializable, deserialize_object
from malcolm.core.vmeta import VMeta
@Serializable.register_subclass("malcolm:core/ChoiceMeta:1.0")
class ChoiceMeta(VMeta):
"""Meta object containing information for a enum"""
endpoints = ["description", "... | <commit_before>from malcolm.compat import str_
from malcolm.core.serializable import Serializable, deserialize_object
from malcolm.core.vmeta import VMeta
@Serializable.register_subclass("malcolm:core/ChoiceMeta:1.0")
class ChoiceMeta(VMeta):
"""Meta object containing information for a enum"""
endpoints = ["... | from malcolm.compat import str_
from malcolm.core.serializable import Serializable, deserialize_object
from malcolm.core.vmeta import VMeta
@Serializable.register_subclass("malcolm:core/ChoiceMeta:1.0")
class ChoiceMeta(VMeta):
"""Meta object containing information for a enum"""
endpoints = ["description", "... | from malcolm.compat import str_
from malcolm.core.serializable import Serializable, deserialize_object
from malcolm.core.vmeta import VMeta
@Serializable.register_subclass("malcolm:core/ChoiceMeta:1.0")
class ChoiceMeta(VMeta):
"""Meta object containing information for a enum"""
endpoints = ["description", "... | <commit_before>from malcolm.compat import str_
from malcolm.core.serializable import Serializable, deserialize_object
from malcolm.core.vmeta import VMeta
@Serializable.register_subclass("malcolm:core/ChoiceMeta:1.0")
class ChoiceMeta(VMeta):
"""Meta object containing information for a enum"""
endpoints = ["... |
c8a7a53f09f72d9dbe44b1bcb5b85c8ee5ba2c2c | services/migrations/0012_unit_data_source.py | services/migrations/0012_unit_data_source.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('services', '0011_unit_extensions'),
]
operations = [
migrations.AddField(
model_name='unit',
name='d... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('services', '0011_unit_extensions'),
]
operations = [
migrations.AddField(
model_name='unit',
name='d... | Add default to data_source migration. | Add default to data_source migration.
| Python | agpl-3.0 | City-of-Helsinki/smbackend,City-of-Helsinki/smbackend | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('services', '0011_unit_extensions'),
]
operations = [
migrations.AddField(
model_name='unit',
name='d... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('services', '0011_unit_extensions'),
]
operations = [
migrations.AddField(
model_name='unit',
name='d... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('services', '0011_unit_extensions'),
]
operations = [
migrations.AddField(
model_name='unit',
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('services', '0011_unit_extensions'),
]
operations = [
migrations.AddField(
model_name='unit',
name='d... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('services', '0011_unit_extensions'),
]
operations = [
migrations.AddField(
model_name='unit',
name='d... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('services', '0011_unit_extensions'),
]
operations = [
migrations.AddField(
model_name='unit',
... |
c86569d46aac2372107a5e2af66208de8c4a4c1d | kaleo/receivers.py | kaleo/receivers.py | from django.db.models.signals import post_save
from django.dispatch import receiver
from django.contrib.auth.models import User
from account.models import SignupCodeResult, EmailConfirmation
from account.signals import signup_code_used, email_confirmed
from kaleo.models import JoinInvitation, InvitationStat
@recei... | from django.db.models.signals import post_save
from django.dispatch import receiver
from django.contrib.auth.models import User
from account.models import SignupCodeResult, EmailConfirmation
from account.signals import signup_code_used, email_confirmed, user_signed_up
from kaleo.models import JoinInvitation, Invitat... | Handle case where a user skips email confirmation | Handle case where a user skips email confirmation
In DUA, if you are invited to a site and you end
up signing up with the same email address, DUA will
skip the confirmation cycle and count it as
confirmed already.
| Python | bsd-3-clause | JPWKU/kaleo,abramia/kaleo,rizumu/pinax-invitations,ntucker/kaleo,jacobwegner/pinax-invitations,pinax/pinax-invitations,eldarion/kaleo | from django.db.models.signals import post_save
from django.dispatch import receiver
from django.contrib.auth.models import User
from account.models import SignupCodeResult, EmailConfirmation
from account.signals import signup_code_used, email_confirmed
from kaleo.models import JoinInvitation, InvitationStat
@recei... | from django.db.models.signals import post_save
from django.dispatch import receiver
from django.contrib.auth.models import User
from account.models import SignupCodeResult, EmailConfirmation
from account.signals import signup_code_used, email_confirmed, user_signed_up
from kaleo.models import JoinInvitation, Invitat... | <commit_before>from django.db.models.signals import post_save
from django.dispatch import receiver
from django.contrib.auth.models import User
from account.models import SignupCodeResult, EmailConfirmation
from account.signals import signup_code_used, email_confirmed
from kaleo.models import JoinInvitation, Invitati... | from django.db.models.signals import post_save
from django.dispatch import receiver
from django.contrib.auth.models import User
from account.models import SignupCodeResult, EmailConfirmation
from account.signals import signup_code_used, email_confirmed, user_signed_up
from kaleo.models import JoinInvitation, Invitat... | from django.db.models.signals import post_save
from django.dispatch import receiver
from django.contrib.auth.models import User
from account.models import SignupCodeResult, EmailConfirmation
from account.signals import signup_code_used, email_confirmed
from kaleo.models import JoinInvitation, InvitationStat
@recei... | <commit_before>from django.db.models.signals import post_save
from django.dispatch import receiver
from django.contrib.auth.models import User
from account.models import SignupCodeResult, EmailConfirmation
from account.signals import signup_code_used, email_confirmed
from kaleo.models import JoinInvitation, Invitati... |
52c8a9e3224330e8ddec063fce0bb0822d28f3c4 | src/home/views.py | src/home/views.py | from django.shortcuts import render
from django.http import HttpResponse
from django.template import loader
from MinecrunchWeb import settings
# Create your views here.
def index(request):
template = loader.get_template('home/home.html')
return HttpResponse(template.render())
# Create your views here.
... | from django.shortcuts import render
from django.http import HttpResponse
from django.template import loader
#from MinecrunchWeb import settings
# Create your views here.
def index(request):
template = loader.get_template('home/home.html')
return HttpResponse(template.render())
# Create your views here.... | Comment out import line to prevent error | Comment out import line to prevent error
| Python | mit | Jonpro03/Minecrunch_Web,Jonpro03/Minecrunch_Web,Jonpro03/Minecrunch_Web | from django.shortcuts import render
from django.http import HttpResponse
from django.template import loader
from MinecrunchWeb import settings
# Create your views here.
def index(request):
template = loader.get_template('home/home.html')
return HttpResponse(template.render())
# Create your views here.
... | from django.shortcuts import render
from django.http import HttpResponse
from django.template import loader
#from MinecrunchWeb import settings
# Create your views here.
def index(request):
template = loader.get_template('home/home.html')
return HttpResponse(template.render())
# Create your views here.... | <commit_before>from django.shortcuts import render
from django.http import HttpResponse
from django.template import loader
from MinecrunchWeb import settings
# Create your views here.
def index(request):
template = loader.get_template('home/home.html')
return HttpResponse(template.render())
# Create yo... | from django.shortcuts import render
from django.http import HttpResponse
from django.template import loader
#from MinecrunchWeb import settings
# Create your views here.
def index(request):
template = loader.get_template('home/home.html')
return HttpResponse(template.render())
# Create your views here.... | from django.shortcuts import render
from django.http import HttpResponse
from django.template import loader
from MinecrunchWeb import settings
# Create your views here.
def index(request):
template = loader.get_template('home/home.html')
return HttpResponse(template.render())
# Create your views here.
... | <commit_before>from django.shortcuts import render
from django.http import HttpResponse
from django.template import loader
from MinecrunchWeb import settings
# Create your views here.
def index(request):
template = loader.get_template('home/home.html')
return HttpResponse(template.render())
# Create yo... |
d12884572175cc74ea9e410909128e590a29d1d8 | pygments/styles/igor.py | pygments/styles/igor.py | from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic
class IgorStyle(Style):
default_style = ""
styles = {
Comment: 'italic #FF0000',
Keyword: '#0000FF',
Name.Function: ... | from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic
class IgorStyle(Style):
"""
Pygments version of the official colors for Igor Pro procedures.
"""
default_style = ""
styles = {
Comment: 'italic ... | Add class comment and a custom color for the decorator | Add class comment and a custom color for the decorator
| Python | bsd-2-clause | spencerlyon2/pygments,spencerlyon2/pygments,spencerlyon2/pygments,spencerlyon2/pygments,spencerlyon2/pygments,spencerlyon2/pygments,spencerlyon2/pygments,spencerlyon2/pygments,spencerlyon2/pygments,spencerlyon2/pygments,spencerlyon2/pygments,spencerlyon2/pygments,spencerlyon2/pygments,spencerlyon2/pygments,spencerlyon2... | from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic
class IgorStyle(Style):
default_style = ""
styles = {
Comment: 'italic #FF0000',
Keyword: '#0000FF',
Name.Function: ... | from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic
class IgorStyle(Style):
"""
Pygments version of the official colors for Igor Pro procedures.
"""
default_style = ""
styles = {
Comment: 'italic ... | <commit_before>from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic
class IgorStyle(Style):
default_style = ""
styles = {
Comment: 'italic #FF0000',
Keyword: '#0000FF',
Name.Func... | from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic
class IgorStyle(Style):
"""
Pygments version of the official colors for Igor Pro procedures.
"""
default_style = ""
styles = {
Comment: 'italic ... | from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic
class IgorStyle(Style):
default_style = ""
styles = {
Comment: 'italic #FF0000',
Keyword: '#0000FF',
Name.Function: ... | <commit_before>from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic
class IgorStyle(Style):
default_style = ""
styles = {
Comment: 'italic #FF0000',
Keyword: '#0000FF',
Name.Func... |
27839484173c4d505ddb9f949da3576f180b8266 | tests/test_short_url.py | tests/test_short_url.py | # -*- coding: utf-8 -*-
from random import randrange
from pytest import raises
import short_url
def test_custom_alphabet():
encoder = short_url.UrlEncoder(alphabet='ab')
url = encoder.encode_url(12)
assert url == 'bbaaaaaaaaaaaaaaaaaaaa'
key = encoder.decode_url('bbaaaaaaaaaaaaaaaaaaaa')
ass... | # -*- coding: utf-8 -*-
import os
from random import randrange
from pytest import raises
import short_url
TEST_DATA = os.path.dirname(os.path.abspath(os.path.dirname(__file__)))
TEST_DATA = os.path.join(TEST_DATA, 'tests/data')
def generate_test_data(count=10000):
result = {}
for i in range(1000):
... | Add function for generating test data | Add function for generating test data
| Python | mit | Alir3z4/python-short_url | # -*- coding: utf-8 -*-
from random import randrange
from pytest import raises
import short_url
def test_custom_alphabet():
encoder = short_url.UrlEncoder(alphabet='ab')
url = encoder.encode_url(12)
assert url == 'bbaaaaaaaaaaaaaaaaaaaa'
key = encoder.decode_url('bbaaaaaaaaaaaaaaaaaaaa')
ass... | # -*- coding: utf-8 -*-
import os
from random import randrange
from pytest import raises
import short_url
TEST_DATA = os.path.dirname(os.path.abspath(os.path.dirname(__file__)))
TEST_DATA = os.path.join(TEST_DATA, 'tests/data')
def generate_test_data(count=10000):
result = {}
for i in range(1000):
... | <commit_before># -*- coding: utf-8 -*-
from random import randrange
from pytest import raises
import short_url
def test_custom_alphabet():
encoder = short_url.UrlEncoder(alphabet='ab')
url = encoder.encode_url(12)
assert url == 'bbaaaaaaaaaaaaaaaaaaaa'
key = encoder.decode_url('bbaaaaaaaaaaaaaaa... | # -*- coding: utf-8 -*-
import os
from random import randrange
from pytest import raises
import short_url
TEST_DATA = os.path.dirname(os.path.abspath(os.path.dirname(__file__)))
TEST_DATA = os.path.join(TEST_DATA, 'tests/data')
def generate_test_data(count=10000):
result = {}
for i in range(1000):
... | # -*- coding: utf-8 -*-
from random import randrange
from pytest import raises
import short_url
def test_custom_alphabet():
encoder = short_url.UrlEncoder(alphabet='ab')
url = encoder.encode_url(12)
assert url == 'bbaaaaaaaaaaaaaaaaaaaa'
key = encoder.decode_url('bbaaaaaaaaaaaaaaaaaaaa')
ass... | <commit_before># -*- coding: utf-8 -*-
from random import randrange
from pytest import raises
import short_url
def test_custom_alphabet():
encoder = short_url.UrlEncoder(alphabet='ab')
url = encoder.encode_url(12)
assert url == 'bbaaaaaaaaaaaaaaaaaaaa'
key = encoder.decode_url('bbaaaaaaaaaaaaaaa... |
d6b8b7bf471f6e78147eb0b8ad518c4f8964deb3 | cle/backends/cgc.py | cle/backends/cgc.py | from .elf import ELF
from ..loader import Loader
ELF_HEADER = "7f45 4c46 0101 0100 0000 0000 0000 0000".replace(" ","").decode('hex')
class CGC(ELF):
def __init__(self, path, *args, **kwargs):
self.elf_path = Loader._make_tmp_copy(path)
f = open(self.elf_path, 'r+b')
f.write(ELF_HEADER)
... | from .elf import ELF
from ..loader import Loader
ELF_HEADER = "7f45 4c46 0101 0100 0000 0000 0000 0000".replace(" ","").decode('hex')
CGC_HEADER = "7f43 4743 0101 0143 014d 6572 696e 6f00".replace(" ","").decode('hex')
class CGC(ELF):
def __init__(self, path, *args, **kwargs):
self.elf_path = Loader._make... | Repair CGC file header after loading | Repair CGC file header after loading
| Python | bsd-2-clause | chubbymaggie/cle,angr/cle | from .elf import ELF
from ..loader import Loader
ELF_HEADER = "7f45 4c46 0101 0100 0000 0000 0000 0000".replace(" ","").decode('hex')
class CGC(ELF):
def __init__(self, path, *args, **kwargs):
self.elf_path = Loader._make_tmp_copy(path)
f = open(self.elf_path, 'r+b')
f.write(ELF_HEADER)
... | from .elf import ELF
from ..loader import Loader
ELF_HEADER = "7f45 4c46 0101 0100 0000 0000 0000 0000".replace(" ","").decode('hex')
CGC_HEADER = "7f43 4743 0101 0143 014d 6572 696e 6f00".replace(" ","").decode('hex')
class CGC(ELF):
def __init__(self, path, *args, **kwargs):
self.elf_path = Loader._make... | <commit_before>from .elf import ELF
from ..loader import Loader
ELF_HEADER = "7f45 4c46 0101 0100 0000 0000 0000 0000".replace(" ","").decode('hex')
class CGC(ELF):
def __init__(self, path, *args, **kwargs):
self.elf_path = Loader._make_tmp_copy(path)
f = open(self.elf_path, 'r+b')
f.write... | from .elf import ELF
from ..loader import Loader
ELF_HEADER = "7f45 4c46 0101 0100 0000 0000 0000 0000".replace(" ","").decode('hex')
CGC_HEADER = "7f43 4743 0101 0143 014d 6572 696e 6f00".replace(" ","").decode('hex')
class CGC(ELF):
def __init__(self, path, *args, **kwargs):
self.elf_path = Loader._make... | from .elf import ELF
from ..loader import Loader
ELF_HEADER = "7f45 4c46 0101 0100 0000 0000 0000 0000".replace(" ","").decode('hex')
class CGC(ELF):
def __init__(self, path, *args, **kwargs):
self.elf_path = Loader._make_tmp_copy(path)
f = open(self.elf_path, 'r+b')
f.write(ELF_HEADER)
... | <commit_before>from .elf import ELF
from ..loader import Loader
ELF_HEADER = "7f45 4c46 0101 0100 0000 0000 0000 0000".replace(" ","").decode('hex')
class CGC(ELF):
def __init__(self, path, *args, **kwargs):
self.elf_path = Loader._make_tmp_copy(path)
f = open(self.elf_path, 'r+b')
f.write... |
e0a5b6d44de699dab48cb9de1f745f77c3674352 | blackgate/executor.py | blackgate/executor.py | # -*- coding: utf-8 -*-
import sys
from concurrent.futures import ThreadPoolExecutor
from tornado import gen, queues
from tornado.concurrent import Future, run_on_executor
class WorkItem(object):
executor = ThreadPoolExecutor(20)
def __init__(self, future, fn, args, kwargs):
self.future = future
... | # -*- coding: utf-8 -*-
import sys
from concurrent.futures import ThreadPoolExecutor
from tornado import gen, queues
from tornado.concurrent import Future, run_on_executor
class WorkItem(object):
executor = ThreadPoolExecutor(20)
def __init__(self, future, fn, args, kwargs):
self.future = future
... | Fix exc info setter for future. | Fix exc info setter for future.
| Python | mit | soasme/blackgate | # -*- coding: utf-8 -*-
import sys
from concurrent.futures import ThreadPoolExecutor
from tornado import gen, queues
from tornado.concurrent import Future, run_on_executor
class WorkItem(object):
executor = ThreadPoolExecutor(20)
def __init__(self, future, fn, args, kwargs):
self.future = future
... | # -*- coding: utf-8 -*-
import sys
from concurrent.futures import ThreadPoolExecutor
from tornado import gen, queues
from tornado.concurrent import Future, run_on_executor
class WorkItem(object):
executor = ThreadPoolExecutor(20)
def __init__(self, future, fn, args, kwargs):
self.future = future
... | <commit_before># -*- coding: utf-8 -*-
import sys
from concurrent.futures import ThreadPoolExecutor
from tornado import gen, queues
from tornado.concurrent import Future, run_on_executor
class WorkItem(object):
executor = ThreadPoolExecutor(20)
def __init__(self, future, fn, args, kwargs):
self.futu... | # -*- coding: utf-8 -*-
import sys
from concurrent.futures import ThreadPoolExecutor
from tornado import gen, queues
from tornado.concurrent import Future, run_on_executor
class WorkItem(object):
executor = ThreadPoolExecutor(20)
def __init__(self, future, fn, args, kwargs):
self.future = future
... | # -*- coding: utf-8 -*-
import sys
from concurrent.futures import ThreadPoolExecutor
from tornado import gen, queues
from tornado.concurrent import Future, run_on_executor
class WorkItem(object):
executor = ThreadPoolExecutor(20)
def __init__(self, future, fn, args, kwargs):
self.future = future
... | <commit_before># -*- coding: utf-8 -*-
import sys
from concurrent.futures import ThreadPoolExecutor
from tornado import gen, queues
from tornado.concurrent import Future, run_on_executor
class WorkItem(object):
executor = ThreadPoolExecutor(20)
def __init__(self, future, fn, args, kwargs):
self.futu... |
ab2f98539272c8dfb64031cd009c70f7987be359 | importer/importer/indices.py | importer/importer/indices.py | import aioes
import os.path
from datetime import datetime
from .utils import read_json_file
from .settings import ELASTICSEARCH_ALIAS
def create_new_index(elastic):
print("Creating new index...")
module_path = os.path.dirname(__file__)
config_filename = os.path.join(module_path, 'configuration', 'index.... | import elasticsearch
import os.path
from datetime import datetime
from .utils import read_json_file
from .settings import ELASTICSEARCH_ALIAS
def create_new_index(elastic):
print("Creating new index...")
module_path = os.path.dirname(__file__)
config_filename = os.path.join(module_path, 'configuration',... | Replace one last place where aioes was used | Replace one last place where aioes was used
| Python | mit | despawnerer/theatrics,despawnerer/theatrics,despawnerer/theatrics | import aioes
import os.path
from datetime import datetime
from .utils import read_json_file
from .settings import ELASTICSEARCH_ALIAS
def create_new_index(elastic):
print("Creating new index...")
module_path = os.path.dirname(__file__)
config_filename = os.path.join(module_path, 'configuration', 'index.... | import elasticsearch
import os.path
from datetime import datetime
from .utils import read_json_file
from .settings import ELASTICSEARCH_ALIAS
def create_new_index(elastic):
print("Creating new index...")
module_path = os.path.dirname(__file__)
config_filename = os.path.join(module_path, 'configuration',... | <commit_before>import aioes
import os.path
from datetime import datetime
from .utils import read_json_file
from .settings import ELASTICSEARCH_ALIAS
def create_new_index(elastic):
print("Creating new index...")
module_path = os.path.dirname(__file__)
config_filename = os.path.join(module_path, 'configur... | import elasticsearch
import os.path
from datetime import datetime
from .utils import read_json_file
from .settings import ELASTICSEARCH_ALIAS
def create_new_index(elastic):
print("Creating new index...")
module_path = os.path.dirname(__file__)
config_filename = os.path.join(module_path, 'configuration',... | import aioes
import os.path
from datetime import datetime
from .utils import read_json_file
from .settings import ELASTICSEARCH_ALIAS
def create_new_index(elastic):
print("Creating new index...")
module_path = os.path.dirname(__file__)
config_filename = os.path.join(module_path, 'configuration', 'index.... | <commit_before>import aioes
import os.path
from datetime import datetime
from .utils import read_json_file
from .settings import ELASTICSEARCH_ALIAS
def create_new_index(elastic):
print("Creating new index...")
module_path = os.path.dirname(__file__)
config_filename = os.path.join(module_path, 'configur... |
20450788fd0ddb59f80397542b02a2165333e963 | intercom/__main__.py | intercom/__main__.py | import cherrypy
import click
from intercom.roots import IntercomRoot
CLICK_FILE_TYPE = click.Path(exists=True, dir_okay=False)
def run_server(global_config_filename, app_config_filename):
cherrypy.config.update(global_config_filename)
cherrypy.quickstart(root=IntercomRoot(), config=app_config_filename)
@cl... | import cherrypy
import click
from intercom.roots import IntercomRoot
from cherrypy.process.plugins import Daemonizer, PIDFile
def run_server(
global_config_filename,
app_config_filename,
daemon_pid_filename=None):
if daemon_pid_filename is not None:
Daemonizer(cherrypy.engine).subs... | Add support for daemon mode. | Add support for daemon mode.
| Python | isc | alexhanson/intercom | import cherrypy
import click
from intercom.roots import IntercomRoot
CLICK_FILE_TYPE = click.Path(exists=True, dir_okay=False)
def run_server(global_config_filename, app_config_filename):
cherrypy.config.update(global_config_filename)
cherrypy.quickstart(root=IntercomRoot(), config=app_config_filename)
@cl... | import cherrypy
import click
from intercom.roots import IntercomRoot
from cherrypy.process.plugins import Daemonizer, PIDFile
def run_server(
global_config_filename,
app_config_filename,
daemon_pid_filename=None):
if daemon_pid_filename is not None:
Daemonizer(cherrypy.engine).subs... | <commit_before>import cherrypy
import click
from intercom.roots import IntercomRoot
CLICK_FILE_TYPE = click.Path(exists=True, dir_okay=False)
def run_server(global_config_filename, app_config_filename):
cherrypy.config.update(global_config_filename)
cherrypy.quickstart(root=IntercomRoot(), config=app_config_... | import cherrypy
import click
from intercom.roots import IntercomRoot
from cherrypy.process.plugins import Daemonizer, PIDFile
def run_server(
global_config_filename,
app_config_filename,
daemon_pid_filename=None):
if daemon_pid_filename is not None:
Daemonizer(cherrypy.engine).subs... | import cherrypy
import click
from intercom.roots import IntercomRoot
CLICK_FILE_TYPE = click.Path(exists=True, dir_okay=False)
def run_server(global_config_filename, app_config_filename):
cherrypy.config.update(global_config_filename)
cherrypy.quickstart(root=IntercomRoot(), config=app_config_filename)
@cl... | <commit_before>import cherrypy
import click
from intercom.roots import IntercomRoot
CLICK_FILE_TYPE = click.Path(exists=True, dir_okay=False)
def run_server(global_config_filename, app_config_filename):
cherrypy.config.update(global_config_filename)
cherrypy.quickstart(root=IntercomRoot(), config=app_config_... |
a7dc058cf8a1d08d02b16a635b7a05d93ab42c1f | shuup/core/utils/db.py | shuup/core/utils/db.py | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
import math
def extend_sqlite_functions(connection=None, **kwarg... | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
import math
def float_wrap(value, func):
try:
return... | Add wrapper to parse values to float in SQLite | Add wrapper to parse values to float in SQLite
Refs TREES-359
| Python | agpl-3.0 | suutari-ai/shoop,shoopio/shoop,shoopio/shoop,suutari-ai/shoop,suutari-ai/shoop,shoopio/shoop | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
import math
def extend_sqlite_functions(connection=None, **kwarg... | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
import math
def float_wrap(value, func):
try:
return... | <commit_before># -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
import math
def extend_sqlite_functions(connectio... | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
import math
def float_wrap(value, func):
try:
return... | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
import math
def extend_sqlite_functions(connection=None, **kwarg... | <commit_before># -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
import math
def extend_sqlite_functions(connectio... |
3602759b633f0643979c8f0970e088f29644b758 | icekit/plugins/brightcove/models.py | icekit/plugins/brightcove/models.py | from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from fluent_contents.models import ContentItem
try:
from django_brightcove.fields import BrightcoveField
except ImportError:
raise NotImplementedError(
_(
'Please install `... | from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from fluent_contents.models import ContentItem
try:
from django_brightcove.fields import BrightcoveField
except ImportError:
raise NotImplementedError(
_(
'Please install `... | Remove comment as media addition automatically happens. | Remove comment as media addition automatically happens.
| Python | mit | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit | from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from fluent_contents.models import ContentItem
try:
from django_brightcove.fields import BrightcoveField
except ImportError:
raise NotImplementedError(
_(
'Please install `... | from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from fluent_contents.models import ContentItem
try:
from django_brightcove.fields import BrightcoveField
except ImportError:
raise NotImplementedError(
_(
'Please install `... | <commit_before>from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from fluent_contents.models import ContentItem
try:
from django_brightcove.fields import BrightcoveField
except ImportError:
raise NotImplementedError(
_(
'P... | from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from fluent_contents.models import ContentItem
try:
from django_brightcove.fields import BrightcoveField
except ImportError:
raise NotImplementedError(
_(
'Please install `... | from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from fluent_contents.models import ContentItem
try:
from django_brightcove.fields import BrightcoveField
except ImportError:
raise NotImplementedError(
_(
'Please install `... | <commit_before>from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from fluent_contents.models import ContentItem
try:
from django_brightcove.fields import BrightcoveField
except ImportError:
raise NotImplementedError(
_(
'P... |
aa49e27f1dd385b7cfa3706e4e1a25ad8a72f00e | tardis/io/tests/test_decay.py | tardis/io/tests/test_decay.py | import pytest
import pandas as pd
from tardis.io.decay import IsotopeAbundances
@pytest.fixture
def simple_abundance_model():
index = pd.MultiIndex.from_tuples([(28, 56)],
names=['atomic_number', 'mass_number'])
return IsotopeAbundances([[1.0, 1.0]], index=index)
def te... | import pytest
import pandas as pd
from tardis.io.decay import IsotopeAbundances
from numpy.testing import assert_almost_equal
@pytest.fixture
def simple_abundance_model():
index = pd.MultiIndex.from_tuples([(28, 56)],
names=['atomic_number', 'mass_number'])
return Isotope... | Add unit test for decay method | Add unit test for decay method
| Python | bsd-3-clause | kaushik94/tardis,kaushik94/tardis,kaushik94/tardis,kaushik94/tardis | import pytest
import pandas as pd
from tardis.io.decay import IsotopeAbundances
@pytest.fixture
def simple_abundance_model():
index = pd.MultiIndex.from_tuples([(28, 56)],
names=['atomic_number', 'mass_number'])
return IsotopeAbundances([[1.0, 1.0]], index=index)
def te... | import pytest
import pandas as pd
from tardis.io.decay import IsotopeAbundances
from numpy.testing import assert_almost_equal
@pytest.fixture
def simple_abundance_model():
index = pd.MultiIndex.from_tuples([(28, 56)],
names=['atomic_number', 'mass_number'])
return Isotope... | <commit_before>import pytest
import pandas as pd
from tardis.io.decay import IsotopeAbundances
@pytest.fixture
def simple_abundance_model():
index = pd.MultiIndex.from_tuples([(28, 56)],
names=['atomic_number', 'mass_number'])
return IsotopeAbundances([[1.0, 1.0]], index=... | import pytest
import pandas as pd
from tardis.io.decay import IsotopeAbundances
from numpy.testing import assert_almost_equal
@pytest.fixture
def simple_abundance_model():
index = pd.MultiIndex.from_tuples([(28, 56)],
names=['atomic_number', 'mass_number'])
return Isotope... | import pytest
import pandas as pd
from tardis.io.decay import IsotopeAbundances
@pytest.fixture
def simple_abundance_model():
index = pd.MultiIndex.from_tuples([(28, 56)],
names=['atomic_number', 'mass_number'])
return IsotopeAbundances([[1.0, 1.0]], index=index)
def te... | <commit_before>import pytest
import pandas as pd
from tardis.io.decay import IsotopeAbundances
@pytest.fixture
def simple_abundance_model():
index = pd.MultiIndex.from_tuples([(28, 56)],
names=['atomic_number', 'mass_number'])
return IsotopeAbundances([[1.0, 1.0]], index=... |
f86c925604356b25a8c5c0c71644f0df6f1b48f8 | setup_directory.py | setup_directory.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import argparse
import os
import subprocess as sp
from contextlib import contextmanager
import tempfile
try:
import urllib.request as urllib2
except ImportError:
import urllib2
MINICONDA_URL = 'https... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import argparse
import os
import subprocess as sp
from contextlib import contextmanager
import tempfile
try:
import urllib.request as urllib2
except ImportError:
import urllib2
MINICONDA_URL = 'https... | Add function to install miniconda | Add function to install miniconda
| Python | mit | NGTS/pipeline-output-analysis-setup-script | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import argparse
import os
import subprocess as sp
from contextlib import contextmanager
import tempfile
try:
import urllib.request as urllib2
except ImportError:
import urllib2
MINICONDA_URL = 'https... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import argparse
import os
import subprocess as sp
from contextlib import contextmanager
import tempfile
try:
import urllib.request as urllib2
except ImportError:
import urllib2
MINICONDA_URL = 'https... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import argparse
import os
import subprocess as sp
from contextlib import contextmanager
import tempfile
try:
import urllib.request as urllib2
except ImportError:
import urllib2
MINICON... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import argparse
import os
import subprocess as sp
from contextlib import contextmanager
import tempfile
try:
import urllib.request as urllib2
except ImportError:
import urllib2
MINICONDA_URL = 'https... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import argparse
import os
import subprocess as sp
from contextlib import contextmanager
import tempfile
try:
import urllib.request as urllib2
except ImportError:
import urllib2
MINICONDA_URL = 'https... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import argparse
import os
import subprocess as sp
from contextlib import contextmanager
import tempfile
try:
import urllib.request as urllib2
except ImportError:
import urllib2
MINICON... |
f965e5d32e79789cac0ac2f2bae80a399cbeea8a | sirius/__init__.py | sirius/__init__.py | import os as _os
from . import LI_V01_01
from . import TB_V01_03
from . import BO_V03_02
from . import TS_V03_03
from . import SI_V21_02
from . import coordinate_system
from . import discs
with open(_os.path.join(__path__[0], 'VERSION'), 'r') as _f:
__version__ = _f.read().strip()
__all__ = ['LI_V01_01', 'TB_V01_... | import os as _os
from . import LI_V01_01
from . import TB_V01_03
from . import BO_V03_02
from . import TS_V03_03
from . import SI_V21_02
from . import coordinate_system
with open(_os.path.join(__path__[0], 'VERSION'), 'r') as _f:
__version__ = _f.read().strip()
__all__ = ['LI_V01_01', 'TB_V01_03', 'BO_V03_02', '... | Fix bug in deletion of discs | Fix bug in deletion of discs
| Python | mit | lnls-fac/sirius | import os as _os
from . import LI_V01_01
from . import TB_V01_03
from . import BO_V03_02
from . import TS_V03_03
from . import SI_V21_02
from . import coordinate_system
from . import discs
with open(_os.path.join(__path__[0], 'VERSION'), 'r') as _f:
__version__ = _f.read().strip()
__all__ = ['LI_V01_01', 'TB_V01_... | import os as _os
from . import LI_V01_01
from . import TB_V01_03
from . import BO_V03_02
from . import TS_V03_03
from . import SI_V21_02
from . import coordinate_system
with open(_os.path.join(__path__[0], 'VERSION'), 'r') as _f:
__version__ = _f.read().strip()
__all__ = ['LI_V01_01', 'TB_V01_03', 'BO_V03_02', '... | <commit_before>import os as _os
from . import LI_V01_01
from . import TB_V01_03
from . import BO_V03_02
from . import TS_V03_03
from . import SI_V21_02
from . import coordinate_system
from . import discs
with open(_os.path.join(__path__[0], 'VERSION'), 'r') as _f:
__version__ = _f.read().strip()
__all__ = ['LI_V0... | import os as _os
from . import LI_V01_01
from . import TB_V01_03
from . import BO_V03_02
from . import TS_V03_03
from . import SI_V21_02
from . import coordinate_system
with open(_os.path.join(__path__[0], 'VERSION'), 'r') as _f:
__version__ = _f.read().strip()
__all__ = ['LI_V01_01', 'TB_V01_03', 'BO_V03_02', '... | import os as _os
from . import LI_V01_01
from . import TB_V01_03
from . import BO_V03_02
from . import TS_V03_03
from . import SI_V21_02
from . import coordinate_system
from . import discs
with open(_os.path.join(__path__[0], 'VERSION'), 'r') as _f:
__version__ = _f.read().strip()
__all__ = ['LI_V01_01', 'TB_V01_... | <commit_before>import os as _os
from . import LI_V01_01
from . import TB_V01_03
from . import BO_V03_02
from . import TS_V03_03
from . import SI_V21_02
from . import coordinate_system
from . import discs
with open(_os.path.join(__path__[0], 'VERSION'), 'r') as _f:
__version__ = _f.read().strip()
__all__ = ['LI_V0... |
f0e76bbe2f73514b5663f65dfdc394e02485bc33 | hello.py | hello.py | # Hello World
import sys
def hello(thing):
print "Hello {}".format(thing)
return
if __name__ == "__main__":
sys.exit(hello())
| # Hello World
import sys
def hello(thing):
print "Hello {}".format(thing)
return
if __name__ == "__main__":
user_thing = sys.argv[-1]
sys.exit(hello(user_thing))
| Allow user to specify thing. | Allow user to specify thing.
| Python | mit | fgalloway/hg-git-test | # Hello World
import sys
def hello(thing):
print "Hello {}".format(thing)
return
if __name__ == "__main__":
sys.exit(hello())
Allow user to specify thing. | # Hello World
import sys
def hello(thing):
print "Hello {}".format(thing)
return
if __name__ == "__main__":
user_thing = sys.argv[-1]
sys.exit(hello(user_thing))
| <commit_before># Hello World
import sys
def hello(thing):
print "Hello {}".format(thing)
return
if __name__ == "__main__":
sys.exit(hello())
<commit_msg>Allow user to specify thing.<commit_after> | # Hello World
import sys
def hello(thing):
print "Hello {}".format(thing)
return
if __name__ == "__main__":
user_thing = sys.argv[-1]
sys.exit(hello(user_thing))
| # Hello World
import sys
def hello(thing):
print "Hello {}".format(thing)
return
if __name__ == "__main__":
sys.exit(hello())
Allow user to specify thing.# Hello World
import sys
def hello(thing):
print "Hello {}".format(thing)
return
if __name__ == "__main__":
user_thing = sys.argv[-1... | <commit_before># Hello World
import sys
def hello(thing):
print "Hello {}".format(thing)
return
if __name__ == "__main__":
sys.exit(hello())
<commit_msg>Allow user to specify thing.<commit_after># Hello World
import sys
def hello(thing):
print "Hello {}".format(thing)
return
if __name__ ==... |
9f64d5e2f9447233df8d3b841c519196c3213e05 | pyflation/analysis/tests/test_deltaprel.py | pyflation/analysis/tests/test_deltaprel.py | ''' test_deltaprel - Test functions for deltaprel module
Author: Ian Huston
For license and copyright information see LICENSE.txt which was distributed with this file.
'''
import numpy as np
from numpy.testing import assert_, assert_raises
from pyflation.analysis import deltaprel
import nose
class TestSoundSpeeds... | ''' test_deltaprel - Test functions for deltaprel module
Author: Ian Huston
For license and copyright information see LICENSE.txt which was distributed with this file.
'''
import numpy as np
from numpy.testing import assert_, assert_raises
from pyflation.analysis import deltaprel
import nose
class TestSoundSpeeds... | Add test for scalar values. | Add test for scalar values.
| Python | bsd-3-clause | ihuston/pyflation,ihuston/pyflation | ''' test_deltaprel - Test functions for deltaprel module
Author: Ian Huston
For license and copyright information see LICENSE.txt which was distributed with this file.
'''
import numpy as np
from numpy.testing import assert_, assert_raises
from pyflation.analysis import deltaprel
import nose
class TestSoundSpeeds... | ''' test_deltaprel - Test functions for deltaprel module
Author: Ian Huston
For license and copyright information see LICENSE.txt which was distributed with this file.
'''
import numpy as np
from numpy.testing import assert_, assert_raises
from pyflation.analysis import deltaprel
import nose
class TestSoundSpeeds... | <commit_before>''' test_deltaprel - Test functions for deltaprel module
Author: Ian Huston
For license and copyright information see LICENSE.txt which was distributed with this file.
'''
import numpy as np
from numpy.testing import assert_, assert_raises
from pyflation.analysis import deltaprel
import nose
class ... | ''' test_deltaprel - Test functions for deltaprel module
Author: Ian Huston
For license and copyright information see LICENSE.txt which was distributed with this file.
'''
import numpy as np
from numpy.testing import assert_, assert_raises
from pyflation.analysis import deltaprel
import nose
class TestSoundSpeeds... | ''' test_deltaprel - Test functions for deltaprel module
Author: Ian Huston
For license and copyright information see LICENSE.txt which was distributed with this file.
'''
import numpy as np
from numpy.testing import assert_, assert_raises
from pyflation.analysis import deltaprel
import nose
class TestSoundSpeeds... | <commit_before>''' test_deltaprel - Test functions for deltaprel module
Author: Ian Huston
For license and copyright information see LICENSE.txt which was distributed with this file.
'''
import numpy as np
from numpy.testing import assert_, assert_raises
from pyflation.analysis import deltaprel
import nose
class ... |
aad8bf692884a2074ad74601e2547ced4ae569bd | comics/comics/nemi.py | comics/comics/nemi.py | from comics.aggregator.crawler import DagbladetCrawlerBase
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'Nemi (db.no)'
language = 'no'
url = 'http://www.dagbladet.no/tegneserie/nemi/'
start_date = '1997-01-01'
rights = 'Lise Myhre'
class Crawler(Dagblad... | from comics.aggregator.crawler import DagbladetCrawlerBase
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'Nemi (db.no)'
language = 'no'
url = 'http://www.dagbladet.no/tegneserie/nemi/'
start_date = '1997-01-01'
rights = 'Lise Myhre'
class Crawler(Dagblad... | Increase history capability and correct schedule | Increase history capability and correct schedule
| Python | agpl-3.0 | jodal/comics,jodal/comics,jodal/comics,datagutten/comics,datagutten/comics,datagutten/comics,jodal/comics,datagutten/comics | from comics.aggregator.crawler import DagbladetCrawlerBase
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'Nemi (db.no)'
language = 'no'
url = 'http://www.dagbladet.no/tegneserie/nemi/'
start_date = '1997-01-01'
rights = 'Lise Myhre'
class Crawler(Dagblad... | from comics.aggregator.crawler import DagbladetCrawlerBase
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'Nemi (db.no)'
language = 'no'
url = 'http://www.dagbladet.no/tegneserie/nemi/'
start_date = '1997-01-01'
rights = 'Lise Myhre'
class Crawler(Dagblad... | <commit_before>from comics.aggregator.crawler import DagbladetCrawlerBase
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'Nemi (db.no)'
language = 'no'
url = 'http://www.dagbladet.no/tegneserie/nemi/'
start_date = '1997-01-01'
rights = 'Lise Myhre'
class ... | from comics.aggregator.crawler import DagbladetCrawlerBase
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'Nemi (db.no)'
language = 'no'
url = 'http://www.dagbladet.no/tegneserie/nemi/'
start_date = '1997-01-01'
rights = 'Lise Myhre'
class Crawler(Dagblad... | from comics.aggregator.crawler import DagbladetCrawlerBase
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'Nemi (db.no)'
language = 'no'
url = 'http://www.dagbladet.no/tegneserie/nemi/'
start_date = '1997-01-01'
rights = 'Lise Myhre'
class Crawler(Dagblad... | <commit_before>from comics.aggregator.crawler import DagbladetCrawlerBase
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'Nemi (db.no)'
language = 'no'
url = 'http://www.dagbladet.no/tegneserie/nemi/'
start_date = '1997-01-01'
rights = 'Lise Myhre'
class ... |
5cb049385aa3d3ae57d18dc4b7d12f3d5e6f1ae4 | tests/intervaltrigger_test.py | tests/intervaltrigger_test.py | import time
import mock
import pytest
import spreadsplug.intervaltrigger as intervaltrigger
@pytest.fixture
def plugin(config):
config['intervaltrigger']['interval'] = 0.1
return intervaltrigger.IntervalTrigger(config)
def test_trigger_loop(plugin):
cbmock = mock.Mock()
plugin.start_trigger_loop(c... | import time
import mock
import pytest
import spreadsplug.intervaltrigger as intervaltrigger
@pytest.fixture
def plugin(config):
config['intervaltrigger']['interval'] = 0.1
return intervaltrigger.IntervalTrigger(config)
def test_trigger_loop(plugin):
cbmock = mock.Mock()
plugin.start_trigger_loop(c... | Increase sleep-time in intervaltrigger tests | Increase sleep-time in intervaltrigger tests
| Python | agpl-3.0 | jbaiter/spreads,DIYBookScanner/spreads,nafraf/spreads,adongy/spreads,jbaiter/spreads,miloh/spreads,gareth8118/spreads,gareth8118/spreads,nafraf/spreads,gareth8118/spreads,jbaiter/spreads,DIYBookScanner/spreads,DIYBookScanner/spreads,nafraf/spreads,adongy/spreads,miloh/spreads,adongy/spreads,miloh/spreads | import time
import mock
import pytest
import spreadsplug.intervaltrigger as intervaltrigger
@pytest.fixture
def plugin(config):
config['intervaltrigger']['interval'] = 0.1
return intervaltrigger.IntervalTrigger(config)
def test_trigger_loop(plugin):
cbmock = mock.Mock()
plugin.start_trigger_loop(c... | import time
import mock
import pytest
import spreadsplug.intervaltrigger as intervaltrigger
@pytest.fixture
def plugin(config):
config['intervaltrigger']['interval'] = 0.1
return intervaltrigger.IntervalTrigger(config)
def test_trigger_loop(plugin):
cbmock = mock.Mock()
plugin.start_trigger_loop(c... | <commit_before>import time
import mock
import pytest
import spreadsplug.intervaltrigger as intervaltrigger
@pytest.fixture
def plugin(config):
config['intervaltrigger']['interval'] = 0.1
return intervaltrigger.IntervalTrigger(config)
def test_trigger_loop(plugin):
cbmock = mock.Mock()
plugin.start... | import time
import mock
import pytest
import spreadsplug.intervaltrigger as intervaltrigger
@pytest.fixture
def plugin(config):
config['intervaltrigger']['interval'] = 0.1
return intervaltrigger.IntervalTrigger(config)
def test_trigger_loop(plugin):
cbmock = mock.Mock()
plugin.start_trigger_loop(c... | import time
import mock
import pytest
import spreadsplug.intervaltrigger as intervaltrigger
@pytest.fixture
def plugin(config):
config['intervaltrigger']['interval'] = 0.1
return intervaltrigger.IntervalTrigger(config)
def test_trigger_loop(plugin):
cbmock = mock.Mock()
plugin.start_trigger_loop(c... | <commit_before>import time
import mock
import pytest
import spreadsplug.intervaltrigger as intervaltrigger
@pytest.fixture
def plugin(config):
config['intervaltrigger']['interval'] = 0.1
return intervaltrigger.IntervalTrigger(config)
def test_trigger_loop(plugin):
cbmock = mock.Mock()
plugin.start... |
9f514f3bde4fd5ca901a08d59e76735861cb9bc9 | wsgi.py | wsgi.py | import os
import sys
current_directory = os.path.dirname(__file__)
module_name = os.path.basename(current_directory)
activate_this = '/home/met/venv/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))
sys.path.append(current_directory)
os.environ['DJANGO_SETTINGS_MODULE'] = 'met.settings'
im... | import os
import sys
current_directory = os.path.dirname(__file__)
module_name = os.path.basename(current_directory)
activate_this = '/home/met/met-venv/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))
sys.path.append(current_directory)
os.environ['DJANGO_SETTINGS_MODULE'] = 'met.settings... | Relocate virtualenv location to documentation | Relocate virtualenv location to documentation
| Python | bsd-2-clause | biancini/met,biancini/met,biancini/met,GEANT/met,TERENA/met,TERENA/met,biancini/met,GEANT/met,TERENA/met,TERENA/met,GEANT/met,GEANT/met | import os
import sys
current_directory = os.path.dirname(__file__)
module_name = os.path.basename(current_directory)
activate_this = '/home/met/venv/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))
sys.path.append(current_directory)
os.environ['DJANGO_SETTINGS_MODULE'] = 'met.settings'
im... | import os
import sys
current_directory = os.path.dirname(__file__)
module_name = os.path.basename(current_directory)
activate_this = '/home/met/met-venv/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))
sys.path.append(current_directory)
os.environ['DJANGO_SETTINGS_MODULE'] = 'met.settings... | <commit_before>import os
import sys
current_directory = os.path.dirname(__file__)
module_name = os.path.basename(current_directory)
activate_this = '/home/met/venv/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))
sys.path.append(current_directory)
os.environ['DJANGO_SETTINGS_MODULE'] = 'm... | import os
import sys
current_directory = os.path.dirname(__file__)
module_name = os.path.basename(current_directory)
activate_this = '/home/met/met-venv/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))
sys.path.append(current_directory)
os.environ['DJANGO_SETTINGS_MODULE'] = 'met.settings... | import os
import sys
current_directory = os.path.dirname(__file__)
module_name = os.path.basename(current_directory)
activate_this = '/home/met/venv/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))
sys.path.append(current_directory)
os.environ['DJANGO_SETTINGS_MODULE'] = 'met.settings'
im... | <commit_before>import os
import sys
current_directory = os.path.dirname(__file__)
module_name = os.path.basename(current_directory)
activate_this = '/home/met/venv/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))
sys.path.append(current_directory)
os.environ['DJANGO_SETTINGS_MODULE'] = 'm... |
28e00395cd29dee1449ec522b55d08f68518eb70 | pyoctree/__init__.py | pyoctree/__init__.py | # -*- coding: utf-8 -*-
# Copyright (C) 2015 Michael Hogg
# This file is part of pyoctree - See LICENSE.txt for information on usage and redistribution
# Version
import version
__version__ = version.__version__
| # -*- coding: utf-8 -*-
# Copyright (C) 2017 Michael Hogg
# This file is part of pyoctree - See LICENSE.txt for information on usage and redistribution
# Version
from .version import __version__
__version__ = version.__version__
| Fix import bug in Python 3 | Fix import bug in Python 3 | Python | mit | mhogg/pyoctree,mhogg/pyoctree | # -*- coding: utf-8 -*-
# Copyright (C) 2015 Michael Hogg
# This file is part of pyoctree - See LICENSE.txt for information on usage and redistribution
# Version
import version
__version__ = version.__version__
Fix import bug in Python 3 | # -*- coding: utf-8 -*-
# Copyright (C) 2017 Michael Hogg
# This file is part of pyoctree - See LICENSE.txt for information on usage and redistribution
# Version
from .version import __version__
__version__ = version.__version__
| <commit_before># -*- coding: utf-8 -*-
# Copyright (C) 2015 Michael Hogg
# This file is part of pyoctree - See LICENSE.txt for information on usage and redistribution
# Version
import version
__version__ = version.__version__
<commit_msg>Fix import bug in Python 3<commit_after> | # -*- coding: utf-8 -*-
# Copyright (C) 2017 Michael Hogg
# This file is part of pyoctree - See LICENSE.txt for information on usage and redistribution
# Version
from .version import __version__
__version__ = version.__version__
| # -*- coding: utf-8 -*-
# Copyright (C) 2015 Michael Hogg
# This file is part of pyoctree - See LICENSE.txt for information on usage and redistribution
# Version
import version
__version__ = version.__version__
Fix import bug in Python 3# -*- coding: utf-8 -*-
# Copyright (C) 2017 Michael Hogg
# This file is part ... | <commit_before># -*- coding: utf-8 -*-
# Copyright (C) 2015 Michael Hogg
# This file is part of pyoctree - See LICENSE.txt for information on usage and redistribution
# Version
import version
__version__ = version.__version__
<commit_msg>Fix import bug in Python 3<commit_after># -*- coding: utf-8 -*-
# Copyright (C... |
4a1bb5f658eb3fa7b419ca5eb23217cc21db003a | ssl-cert-parse.py | ssl-cert-parse.py | #!/usr/bin/env python3
import datetime
import ssl
import OpenSSL
def GetCert(SiteName, Port):
return ssl.get_server_certificate((SiteName, Port))
def ParseCert(CertRaw):
Cert = OpenSSL.crypto.load_certificate(
OpenSSL.crypto.FILETYPE_PEM, CertRaw)
CertSubject = str(Cert.get_subject())[18:-2]
... | #!/usr/bin/env python3
import datetime
import ssl
import OpenSSL
def GetCert(SiteName, Port):
return ssl.get_server_certificate((SiteName, Port))
def ParseCert(CertRaw):
Cert = OpenSSL.crypto.load_certificate(
OpenSSL.crypto.FILETYPE_PEM, CertRaw)
CertSubject = str(Cert.get_subject())[18:-2]
... | Fix wrong value assignment for CertSubject in the return statement of ParseCert() function | Fix wrong value assignment for CertSubject in the return statement of ParseCert() function
| Python | apache-2.0 | ivuk/ssl-cert-parse | #!/usr/bin/env python3
import datetime
import ssl
import OpenSSL
def GetCert(SiteName, Port):
return ssl.get_server_certificate((SiteName, Port))
def ParseCert(CertRaw):
Cert = OpenSSL.crypto.load_certificate(
OpenSSL.crypto.FILETYPE_PEM, CertRaw)
CertSubject = str(Cert.get_subject())[18:-2]
... | #!/usr/bin/env python3
import datetime
import ssl
import OpenSSL
def GetCert(SiteName, Port):
return ssl.get_server_certificate((SiteName, Port))
def ParseCert(CertRaw):
Cert = OpenSSL.crypto.load_certificate(
OpenSSL.crypto.FILETYPE_PEM, CertRaw)
CertSubject = str(Cert.get_subject())[18:-2]
... | <commit_before>#!/usr/bin/env python3
import datetime
import ssl
import OpenSSL
def GetCert(SiteName, Port):
return ssl.get_server_certificate((SiteName, Port))
def ParseCert(CertRaw):
Cert = OpenSSL.crypto.load_certificate(
OpenSSL.crypto.FILETYPE_PEM, CertRaw)
CertSubject = str(Cert.get_sub... | #!/usr/bin/env python3
import datetime
import ssl
import OpenSSL
def GetCert(SiteName, Port):
return ssl.get_server_certificate((SiteName, Port))
def ParseCert(CertRaw):
Cert = OpenSSL.crypto.load_certificate(
OpenSSL.crypto.FILETYPE_PEM, CertRaw)
CertSubject = str(Cert.get_subject())[18:-2]
... | #!/usr/bin/env python3
import datetime
import ssl
import OpenSSL
def GetCert(SiteName, Port):
return ssl.get_server_certificate((SiteName, Port))
def ParseCert(CertRaw):
Cert = OpenSSL.crypto.load_certificate(
OpenSSL.crypto.FILETYPE_PEM, CertRaw)
CertSubject = str(Cert.get_subject())[18:-2]
... | <commit_before>#!/usr/bin/env python3
import datetime
import ssl
import OpenSSL
def GetCert(SiteName, Port):
return ssl.get_server_certificate((SiteName, Port))
def ParseCert(CertRaw):
Cert = OpenSSL.crypto.load_certificate(
OpenSSL.crypto.FILETYPE_PEM, CertRaw)
CertSubject = str(Cert.get_sub... |
bfd887bdb77ea2c8fb4d67895d98d8c923135045 | Lib/dbhash.py | Lib/dbhash.py | """Provide a (g)dbm-compatible interface to bsdhash.hashopen."""
import bsddb
error = bsddb.error
def open(file, flag, mode=0666):
return bsddb.hashopen(file, flag, mode)
| """Provide a (g)dbm-compatible interface to bsdhash.hashopen."""
import bsddb
error = bsddb.error # Exported for anydbm
def open(file, flag, mode=0666):
return bsddb.hashopen(file, flag, mode)
| Clarify why we define error. Suggested by Andrew Dalke. | Clarify why we define error. Suggested by Andrew Dalke.
| Python | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | """Provide a (g)dbm-compatible interface to bsdhash.hashopen."""
import bsddb
error = bsddb.error
def open(file, flag, mode=0666):
return bsddb.hashopen(file, flag, mode)
Clarify why we define error. Suggested by Andrew Dalke. | """Provide a (g)dbm-compatible interface to bsdhash.hashopen."""
import bsddb
error = bsddb.error # Exported for anydbm
def open(file, flag, mode=0666):
return bsddb.hashopen(file, flag, mode)
| <commit_before>"""Provide a (g)dbm-compatible interface to bsdhash.hashopen."""
import bsddb
error = bsddb.error
def open(file, flag, mode=0666):
return bsddb.hashopen(file, flag, mode)
<commit_msg>Clarify why we define error. Suggested by Andrew Dalke.<commit_after> | """Provide a (g)dbm-compatible interface to bsdhash.hashopen."""
import bsddb
error = bsddb.error # Exported for anydbm
def open(file, flag, mode=0666):
return bsddb.hashopen(file, flag, mode)
| """Provide a (g)dbm-compatible interface to bsdhash.hashopen."""
import bsddb
error = bsddb.error
def open(file, flag, mode=0666):
return bsddb.hashopen(file, flag, mode)
Clarify why we define error. Suggested by Andrew Dalke."""Provide a (g)dbm-compatible interface to bsdhash.hashopen."""
import bsddb
error ... | <commit_before>"""Provide a (g)dbm-compatible interface to bsdhash.hashopen."""
import bsddb
error = bsddb.error
def open(file, flag, mode=0666):
return bsddb.hashopen(file, flag, mode)
<commit_msg>Clarify why we define error. Suggested by Andrew Dalke.<commit_after>"""Provide a (g)dbm-compatible interface to b... |
785892356bde4c20da265844ae77773266d7c01b | tests/iris_test.py | tests/iris_test.py | #!/usr/bin/env python
from sklearn import datasets
from random import shuffle
# This example loads the IRIS dataset and classifies
# using our neural network implementation.
# The results are visualized in a 2D-plot.
def main():
iris = datasets.load_iris()
X = iris.data
Y = iris.target
# Randomize (s... | #!/usr/bin/env python
from sklearn import datasets
from random import shuffle
import numpy as np
from neuralnet import NeuralNet
# This example loads the IRIS dataset and classifies
# using our neural network implementation.
# The results are visualized in a 2D-plot.
def main():
iris = datasets.load_iris()
X... | Convert output values from int to binary for neural network | Convert output values from int to binary for neural network
| Python | mit | akajuvonen/simple-neuralnet-python | #!/usr/bin/env python
from sklearn import datasets
from random import shuffle
# This example loads the IRIS dataset and classifies
# using our neural network implementation.
# The results are visualized in a 2D-plot.
def main():
iris = datasets.load_iris()
X = iris.data
Y = iris.target
# Randomize (s... | #!/usr/bin/env python
from sklearn import datasets
from random import shuffle
import numpy as np
from neuralnet import NeuralNet
# This example loads the IRIS dataset and classifies
# using our neural network implementation.
# The results are visualized in a 2D-plot.
def main():
iris = datasets.load_iris()
X... | <commit_before>#!/usr/bin/env python
from sklearn import datasets
from random import shuffle
# This example loads the IRIS dataset and classifies
# using our neural network implementation.
# The results are visualized in a 2D-plot.
def main():
iris = datasets.load_iris()
X = iris.data
Y = iris.target
... | #!/usr/bin/env python
from sklearn import datasets
from random import shuffle
import numpy as np
from neuralnet import NeuralNet
# This example loads the IRIS dataset and classifies
# using our neural network implementation.
# The results are visualized in a 2D-plot.
def main():
iris = datasets.load_iris()
X... | #!/usr/bin/env python
from sklearn import datasets
from random import shuffle
# This example loads the IRIS dataset and classifies
# using our neural network implementation.
# The results are visualized in a 2D-plot.
def main():
iris = datasets.load_iris()
X = iris.data
Y = iris.target
# Randomize (s... | <commit_before>#!/usr/bin/env python
from sklearn import datasets
from random import shuffle
# This example loads the IRIS dataset and classifies
# using our neural network implementation.
# The results are visualized in a 2D-plot.
def main():
iris = datasets.load_iris()
X = iris.data
Y = iris.target
... |
5e4e246b5b30afc946e202696e84000a715bc895 | bookmarks/__init__.py | bookmarks/__init__.py | VERSION = (0, 1, 3, "dev")
def get_version():
if VERSION[3] != "final":
return "%s.%s.%s%s" % (VERSION[0], VERSION[1], VERSION[2], VERSION[3])
else:
return "%s.%s.%s" % (VERSION[0], VERSION[1], VERSION[2])
__version__ = get_version()
| VERSION = (0, 1, 3,)
def get_version():
if VERSION[3] != "final":
return "%s.%s.%s%s" % (VERSION[0], VERSION[1], VERSION[2], VERSION[3])
else:
return "%s.%s.%s" % (VERSION[0], VERSION[1], VERSION[2])
__version__ = get_version()
| Remove dev from version string | Remove dev from version string
| Python | mit | incuna/incuna-bookmarks,incuna/incuna-bookmarks | VERSION = (0, 1, 3, "dev")
def get_version():
if VERSION[3] != "final":
return "%s.%s.%s%s" % (VERSION[0], VERSION[1], VERSION[2], VERSION[3])
else:
return "%s.%s.%s" % (VERSION[0], VERSION[1], VERSION[2])
__version__ = get_version()
Remove dev from version string | VERSION = (0, 1, 3,)
def get_version():
if VERSION[3] != "final":
return "%s.%s.%s%s" % (VERSION[0], VERSION[1], VERSION[2], VERSION[3])
else:
return "%s.%s.%s" % (VERSION[0], VERSION[1], VERSION[2])
__version__ = get_version()
| <commit_before>VERSION = (0, 1, 3, "dev")
def get_version():
if VERSION[3] != "final":
return "%s.%s.%s%s" % (VERSION[0], VERSION[1], VERSION[2], VERSION[3])
else:
return "%s.%s.%s" % (VERSION[0], VERSION[1], VERSION[2])
__version__ = get_version()
<commit_msg>Remove dev from version string<co... | VERSION = (0, 1, 3,)
def get_version():
if VERSION[3] != "final":
return "%s.%s.%s%s" % (VERSION[0], VERSION[1], VERSION[2], VERSION[3])
else:
return "%s.%s.%s" % (VERSION[0], VERSION[1], VERSION[2])
__version__ = get_version()
| VERSION = (0, 1, 3, "dev")
def get_version():
if VERSION[3] != "final":
return "%s.%s.%s%s" % (VERSION[0], VERSION[1], VERSION[2], VERSION[3])
else:
return "%s.%s.%s" % (VERSION[0], VERSION[1], VERSION[2])
__version__ = get_version()
Remove dev from version stringVERSION = (0, 1, 3,)
def get_... | <commit_before>VERSION = (0, 1, 3, "dev")
def get_version():
if VERSION[3] != "final":
return "%s.%s.%s%s" % (VERSION[0], VERSION[1], VERSION[2], VERSION[3])
else:
return "%s.%s.%s" % (VERSION[0], VERSION[1], VERSION[2])
__version__ = get_version()
<commit_msg>Remove dev from version string<co... |
3906e118f56b3bcd158c35426955b9f827ad0de8 | teams/viewsets.py | teams/viewsets.py | from rest_framework.viewsets import ModelViewSet
from . import models
from rest_framework.permissions import BasePermission
class IsOwnerPermission(BasePermission):
def has_object_permission(self, request, view, obj):
return request.user == obj.owner
class TeamViewSet(ModelViewSet):
model = models.Te... | from rest_framework.viewsets import ModelViewSet
from . import models
from . import permisssions
class TeamViewSet(ModelViewSet):
model = models.Team
permission_classes = (permisssions.IsOwnerPermission, )
class PlayerViewSet(ModelViewSet):
model = models.Player
| Move to a module permissions | Move to a module permissions
| Python | mit | mfernandezmsistemas/phyton1,migonzalvar/teamroulette | from rest_framework.viewsets import ModelViewSet
from . import models
from rest_framework.permissions import BasePermission
class IsOwnerPermission(BasePermission):
def has_object_permission(self, request, view, obj):
return request.user == obj.owner
class TeamViewSet(ModelViewSet):
model = models.Te... | from rest_framework.viewsets import ModelViewSet
from . import models
from . import permisssions
class TeamViewSet(ModelViewSet):
model = models.Team
permission_classes = (permisssions.IsOwnerPermission, )
class PlayerViewSet(ModelViewSet):
model = models.Player
| <commit_before>from rest_framework.viewsets import ModelViewSet
from . import models
from rest_framework.permissions import BasePermission
class IsOwnerPermission(BasePermission):
def has_object_permission(self, request, view, obj):
return request.user == obj.owner
class TeamViewSet(ModelViewSet):
mo... | from rest_framework.viewsets import ModelViewSet
from . import models
from . import permisssions
class TeamViewSet(ModelViewSet):
model = models.Team
permission_classes = (permisssions.IsOwnerPermission, )
class PlayerViewSet(ModelViewSet):
model = models.Player
| from rest_framework.viewsets import ModelViewSet
from . import models
from rest_framework.permissions import BasePermission
class IsOwnerPermission(BasePermission):
def has_object_permission(self, request, view, obj):
return request.user == obj.owner
class TeamViewSet(ModelViewSet):
model = models.Te... | <commit_before>from rest_framework.viewsets import ModelViewSet
from . import models
from rest_framework.permissions import BasePermission
class IsOwnerPermission(BasePermission):
def has_object_permission(self, request, view, obj):
return request.user == obj.owner
class TeamViewSet(ModelViewSet):
mo... |
8fef7f60ed99e3dd92b3d5ef04a1a9ce3140ffaf | measurator/main.py | measurator/main.py | import argparse, csv, datetime, time
def run_main():
fails = 0
succeeds = 0
not_yet = list()
path = file_path()
# read file
with open(path) as f:
reader = csv.reader(f)
for row in reader:
status = row[0]
if status == 'F':
fails = fails + 1... | import argparse, csv, datetime, time
def run_main():
fails = list()
succeeds = list()
not_yet = list()
path = file_path()
# read file
with open(path) as f:
reader = csv.reader(f)
for row in reader:
status = row[0]
if status == 'F':
fails.a... | Read all records from the file | Read all records from the file
| Python | mit | ahitrin-attic/measurator-proto | import argparse, csv, datetime, time
def run_main():
fails = 0
succeeds = 0
not_yet = list()
path = file_path()
# read file
with open(path) as f:
reader = csv.reader(f)
for row in reader:
status = row[0]
if status == 'F':
fails = fails + 1... | import argparse, csv, datetime, time
def run_main():
fails = list()
succeeds = list()
not_yet = list()
path = file_path()
# read file
with open(path) as f:
reader = csv.reader(f)
for row in reader:
status = row[0]
if status == 'F':
fails.a... | <commit_before>import argparse, csv, datetime, time
def run_main():
fails = 0
succeeds = 0
not_yet = list()
path = file_path()
# read file
with open(path) as f:
reader = csv.reader(f)
for row in reader:
status = row[0]
if status == 'F':
fa... | import argparse, csv, datetime, time
def run_main():
fails = list()
succeeds = list()
not_yet = list()
path = file_path()
# read file
with open(path) as f:
reader = csv.reader(f)
for row in reader:
status = row[0]
if status == 'F':
fails.a... | import argparse, csv, datetime, time
def run_main():
fails = 0
succeeds = 0
not_yet = list()
path = file_path()
# read file
with open(path) as f:
reader = csv.reader(f)
for row in reader:
status = row[0]
if status == 'F':
fails = fails + 1... | <commit_before>import argparse, csv, datetime, time
def run_main():
fails = 0
succeeds = 0
not_yet = list()
path = file_path()
# read file
with open(path) as f:
reader = csv.reader(f)
for row in reader:
status = row[0]
if status == 'F':
fa... |
0106ca8c4204aaa818ad14878452b29e7dd62f8c | tests/__init__.py | tests/__init__.py | # -*- coding: utf-8 -*-
import os
from hycc.util import hycc_main
def clean():
for path in os.listdir("tests/resources"):
if path not in ["hello.hy", "__init__.py"]:
path = os.path.join("tests/resources", path)
if os.path.isdir(path):
os.rmdir(path)
else... | # -*- coding: utf-8 -*-
import os
import shutil
from hycc.util import hycc_main
def clean():
for path in os.listdir("tests/resources"):
if path not in ["hello.hy", "__init__.py"]:
path = os.path.join("tests/resources", path)
if os.path.isdir(path):
shutil.rmtree(pat... | Change to use 'shutil.rmtree' instead of 'os.rmdir' | Change to use 'shutil.rmtree' instead of 'os.rmdir'
| Python | mit | koji-kojiro/hylang-hycc | # -*- coding: utf-8 -*-
import os
from hycc.util import hycc_main
def clean():
for path in os.listdir("tests/resources"):
if path not in ["hello.hy", "__init__.py"]:
path = os.path.join("tests/resources", path)
if os.path.isdir(path):
os.rmdir(path)
else... | # -*- coding: utf-8 -*-
import os
import shutil
from hycc.util import hycc_main
def clean():
for path in os.listdir("tests/resources"):
if path not in ["hello.hy", "__init__.py"]:
path = os.path.join("tests/resources", path)
if os.path.isdir(path):
shutil.rmtree(pat... | <commit_before># -*- coding: utf-8 -*-
import os
from hycc.util import hycc_main
def clean():
for path in os.listdir("tests/resources"):
if path not in ["hello.hy", "__init__.py"]:
path = os.path.join("tests/resources", path)
if os.path.isdir(path):
os.rmdir(path)
... | # -*- coding: utf-8 -*-
import os
import shutil
from hycc.util import hycc_main
def clean():
for path in os.listdir("tests/resources"):
if path not in ["hello.hy", "__init__.py"]:
path = os.path.join("tests/resources", path)
if os.path.isdir(path):
shutil.rmtree(pat... | # -*- coding: utf-8 -*-
import os
from hycc.util import hycc_main
def clean():
for path in os.listdir("tests/resources"):
if path not in ["hello.hy", "__init__.py"]:
path = os.path.join("tests/resources", path)
if os.path.isdir(path):
os.rmdir(path)
else... | <commit_before># -*- coding: utf-8 -*-
import os
from hycc.util import hycc_main
def clean():
for path in os.listdir("tests/resources"):
if path not in ["hello.hy", "__init__.py"]:
path = os.path.join("tests/resources", path)
if os.path.isdir(path):
os.rmdir(path)
... |
ad53de29a29d495fb8958c4e5d1a2cfe206de03e | tests/settings.py | tests/settings.py | import warnings
warnings.simplefilter('always')
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
}
USE_I18N = True
USE_L10N = True
INSTALLED_APPS = [
'django_superform',
'tests',
]
STATIC_URL = '/static/'
SECRET_KEY = '0'
import django
if django.VERSION < (1, 6):
T... | import warnings
warnings.simplefilter('always')
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
}
USE_I18N = True
USE_L10N = True
INSTALLED_APPS = [
'django_superform',
'tests',
]
MIDDLEWARE_CLASSES = ()
STATIC_URL = '/static/'
SECRET_KEY = '0'
import django
if djang... | Remove warning about not-set MIDDLEWARE_CLASSES setting. | Remove warning about not-set MIDDLEWARE_CLASSES setting.
| Python | bsd-3-clause | gregmuellegger/django-superform,gregmuellegger/django-superform | import warnings
warnings.simplefilter('always')
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
}
USE_I18N = True
USE_L10N = True
INSTALLED_APPS = [
'django_superform',
'tests',
]
STATIC_URL = '/static/'
SECRET_KEY = '0'
import django
if django.VERSION < (1, 6):
T... | import warnings
warnings.simplefilter('always')
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
}
USE_I18N = True
USE_L10N = True
INSTALLED_APPS = [
'django_superform',
'tests',
]
MIDDLEWARE_CLASSES = ()
STATIC_URL = '/static/'
SECRET_KEY = '0'
import django
if djang... | <commit_before>import warnings
warnings.simplefilter('always')
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
}
USE_I18N = True
USE_L10N = True
INSTALLED_APPS = [
'django_superform',
'tests',
]
STATIC_URL = '/static/'
SECRET_KEY = '0'
import django
if django.VERSION ... | import warnings
warnings.simplefilter('always')
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
}
USE_I18N = True
USE_L10N = True
INSTALLED_APPS = [
'django_superform',
'tests',
]
MIDDLEWARE_CLASSES = ()
STATIC_URL = '/static/'
SECRET_KEY = '0'
import django
if djang... | import warnings
warnings.simplefilter('always')
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
}
USE_I18N = True
USE_L10N = True
INSTALLED_APPS = [
'django_superform',
'tests',
]
STATIC_URL = '/static/'
SECRET_KEY = '0'
import django
if django.VERSION < (1, 6):
T... | <commit_before>import warnings
warnings.simplefilter('always')
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
}
USE_I18N = True
USE_L10N = True
INSTALLED_APPS = [
'django_superform',
'tests',
]
STATIC_URL = '/static/'
SECRET_KEY = '0'
import django
if django.VERSION ... |
ab434ccb502a5bc0dc0581fb64a0d00ec5f08f0f | tests/urls.py | tests/urls.py | from django.conf.urls import include, url
urlpatterns = [
url('', include('rest_friendship.urls', namespace='rest_friendship')),
]
| from django.urls import path, include
urlpatterns = [
path('', include(('rest_friendship.urls', 'rest_friendship'), namespace='rest_friendship')),
]
| Fix deprecated url import, (to path) | Fix deprecated url import, (to path)
| Python | isc | dnmellen/django-rest-friendship | from django.conf.urls import include, url
urlpatterns = [
url('', include('rest_friendship.urls', namespace='rest_friendship')),
]
Fix deprecated url import, (to path) | from django.urls import path, include
urlpatterns = [
path('', include(('rest_friendship.urls', 'rest_friendship'), namespace='rest_friendship')),
]
| <commit_before>from django.conf.urls import include, url
urlpatterns = [
url('', include('rest_friendship.urls', namespace='rest_friendship')),
]
<commit_msg>Fix deprecated url import, (to path)<commit_after> | from django.urls import path, include
urlpatterns = [
path('', include(('rest_friendship.urls', 'rest_friendship'), namespace='rest_friendship')),
]
| from django.conf.urls import include, url
urlpatterns = [
url('', include('rest_friendship.urls', namespace='rest_friendship')),
]
Fix deprecated url import, (to path)from django.urls import path, include
urlpatterns = [
path('', include(('rest_friendship.urls', 'rest_friendship'), namespace='rest_friendship'... | <commit_before>from django.conf.urls import include, url
urlpatterns = [
url('', include('rest_friendship.urls', namespace='rest_friendship')),
]
<commit_msg>Fix deprecated url import, (to path)<commit_after>from django.urls import path, include
urlpatterns = [
path('', include(('rest_friendship.urls', 'rest_... |
dab4ca109b852154bc34c468ffe598b22abf7040 | marathon_acme/cli.py | marathon_acme/cli.py | import click
import sys
@click.command()
@click.option('--acme',
help='The address for the ACME Directory Resource',
default='https://acme-v01.api.letsencrypt.org/directory',
show_default=True)
@click.option('--email',
help=("Email address for Let's Encrypt cert... | import click
import sys
@click.command()
@click.option('--acme',
help='The address for the ACME Directory Resource',
default='https://acme-v01.api.letsencrypt.org/directory',
show_default=True)
@click.option('--email',
help=("Email address for Let's Encrypt cert... | Remove imaginary event server CLI options | Remove imaginary event server CLI options
| Python | mit | praekeltfoundation/certbot,praekeltfoundation/certbot | import click
import sys
@click.command()
@click.option('--acme',
help='The address for the ACME Directory Resource',
default='https://acme-v01.api.letsencrypt.org/directory',
show_default=True)
@click.option('--email',
help=("Email address for Let's Encrypt cert... | import click
import sys
@click.command()
@click.option('--acme',
help='The address for the ACME Directory Resource',
default='https://acme-v01.api.letsencrypt.org/directory',
show_default=True)
@click.option('--email',
help=("Email address for Let's Encrypt cert... | <commit_before>import click
import sys
@click.command()
@click.option('--acme',
help='The address for the ACME Directory Resource',
default='https://acme-v01.api.letsencrypt.org/directory',
show_default=True)
@click.option('--email',
help=("Email address for Let... | import click
import sys
@click.command()
@click.option('--acme',
help='The address for the ACME Directory Resource',
default='https://acme-v01.api.letsencrypt.org/directory',
show_default=True)
@click.option('--email',
help=("Email address for Let's Encrypt cert... | import click
import sys
@click.command()
@click.option('--acme',
help='The address for the ACME Directory Resource',
default='https://acme-v01.api.letsencrypt.org/directory',
show_default=True)
@click.option('--email',
help=("Email address for Let's Encrypt cert... | <commit_before>import click
import sys
@click.command()
@click.option('--acme',
help='The address for the ACME Directory Resource',
default='https://acme-v01.api.letsencrypt.org/directory',
show_default=True)
@click.option('--email',
help=("Email address for Let... |
86066890322e3c3654946a49c8d1cd2e1a1c2980 | celery/tests/test_backends/__init__.py | celery/tests/test_backends/__init__.py | import unittest2 as unittest
from celery import backends
from celery.backends.amqp import AMQPBackend
from celery.backends.pyredis import RedisBackend
class TestBackends(unittest.TestCase):
def test_get_backend_aliases(self):
expects = [("amqp", AMQPBackend),
("redis", RedisBackend)]
... | import unittest2 as unittest
from celery import backends
from celery.backends.amqp import AMQPBackend
from celery.backends.database import DatabaseBackend
class TestBackends(unittest.TestCase):
def test_get_backend_aliases(self):
expects = [("amqp", AMQPBackend),
("database", Database... | Test using DatabaseBackend instead of RedisBackend, as the latter requires the redis module to be installed. | tests.backends: Test using DatabaseBackend instead of RedisBackend, as the latter requires the redis module to be installed.
| Python | bsd-3-clause | WoLpH/celery,ask/celery,mitsuhiko/celery,mitsuhiko/celery,WoLpH/celery,frac/celery,cbrepo/celery,cbrepo/celery,frac/celery,ask/celery | import unittest2 as unittest
from celery import backends
from celery.backends.amqp import AMQPBackend
from celery.backends.pyredis import RedisBackend
class TestBackends(unittest.TestCase):
def test_get_backend_aliases(self):
expects = [("amqp", AMQPBackend),
("redis", RedisBackend)]
... | import unittest2 as unittest
from celery import backends
from celery.backends.amqp import AMQPBackend
from celery.backends.database import DatabaseBackend
class TestBackends(unittest.TestCase):
def test_get_backend_aliases(self):
expects = [("amqp", AMQPBackend),
("database", Database... | <commit_before>import unittest2 as unittest
from celery import backends
from celery.backends.amqp import AMQPBackend
from celery.backends.pyredis import RedisBackend
class TestBackends(unittest.TestCase):
def test_get_backend_aliases(self):
expects = [("amqp", AMQPBackend),
("redis", ... | import unittest2 as unittest
from celery import backends
from celery.backends.amqp import AMQPBackend
from celery.backends.database import DatabaseBackend
class TestBackends(unittest.TestCase):
def test_get_backend_aliases(self):
expects = [("amqp", AMQPBackend),
("database", Database... | import unittest2 as unittest
from celery import backends
from celery.backends.amqp import AMQPBackend
from celery.backends.pyredis import RedisBackend
class TestBackends(unittest.TestCase):
def test_get_backend_aliases(self):
expects = [("amqp", AMQPBackend),
("redis", RedisBackend)]
... | <commit_before>import unittest2 as unittest
from celery import backends
from celery.backends.amqp import AMQPBackend
from celery.backends.pyredis import RedisBackend
class TestBackends(unittest.TestCase):
def test_get_backend_aliases(self):
expects = [("amqp", AMQPBackend),
("redis", ... |
dc87c5d000f06e1618c7fbd0daae602131e0602e | commands/globaladd.py | commands/globaladd.py | from devbot import chat
def call(message: str, name, protocol, cfg, commands):
if ' ' in message:
chat.say('/msg {} Sorry, that was not a valid player name: It contains spaces.'.format(name))
return
chat.say_wrap('/msg {}',
'You have been added to global chat. Use /g GlobalCh... | from devbot import chat
def call(message: str, name, protocol, cfg, commands):
if ' ' in message:
chat.say('/msg {} Sorry, that was not a valid player name: It contains spaces.'.format(name))
return
chat.say('/msg {} Invited {} to GlobalChat'.format(name, message))
chat.say_wrap('/msg {}'.... | Fix formatting issues with gadd | Fix formatting issues with gadd
| Python | mit | Ameliorate/DevotedBot,Ameliorate/DevotedBot | from devbot import chat
def call(message: str, name, protocol, cfg, commands):
if ' ' in message:
chat.say('/msg {} Sorry, that was not a valid player name: It contains spaces.'.format(name))
return
chat.say_wrap('/msg {}',
'You have been added to global chat. Use /g GlobalCh... | from devbot import chat
def call(message: str, name, protocol, cfg, commands):
if ' ' in message:
chat.say('/msg {} Sorry, that was not a valid player name: It contains spaces.'.format(name))
return
chat.say('/msg {} Invited {} to GlobalChat'.format(name, message))
chat.say_wrap('/msg {}'.... | <commit_before>from devbot import chat
def call(message: str, name, protocol, cfg, commands):
if ' ' in message:
chat.say('/msg {} Sorry, that was not a valid player name: It contains spaces.'.format(name))
return
chat.say_wrap('/msg {}',
'You have been added to global chat. ... | from devbot import chat
def call(message: str, name, protocol, cfg, commands):
if ' ' in message:
chat.say('/msg {} Sorry, that was not a valid player name: It contains spaces.'.format(name))
return
chat.say('/msg {} Invited {} to GlobalChat'.format(name, message))
chat.say_wrap('/msg {}'.... | from devbot import chat
def call(message: str, name, protocol, cfg, commands):
if ' ' in message:
chat.say('/msg {} Sorry, that was not a valid player name: It contains spaces.'.format(name))
return
chat.say_wrap('/msg {}',
'You have been added to global chat. Use /g GlobalCh... | <commit_before>from devbot import chat
def call(message: str, name, protocol, cfg, commands):
if ' ' in message:
chat.say('/msg {} Sorry, that was not a valid player name: It contains spaces.'.format(name))
return
chat.say_wrap('/msg {}',
'You have been added to global chat. ... |
551ab95d733ed89fb88c9d6b91659499e0efcd7a | twilix/app.py | twilix/app.py | from flask import Flask, request
from flask.ext.sqlalchemy import SQLAlchemy
from twilio import twiml
import subprocess
import os
from cmd import cmds
app = Flask(__name__)
#app.config.from_object('config')
db = SQLAlchemy(app)
ACCOUNT_SID = "" #os.environ['ACCOUNT_SID']
AUTH_TOKEN = "" #os.environ['AUTH_TOKEN']
APP... | from flask import Flask, request
from flask.ext.sqlalchemy import SQLAlchemy
from twilio import twiml
import subprocess
import os
from cmd import cmds
app = Flask(__name__)
#app.config.from_object('config')
db = SQLAlchemy(app)
ACCOUNT_SID = os.environ['ACCOUNT_SID']
AUTH_TOKEN = os.environ['AUTH_TOKEN']
APP_SID = o... | Replace all keys/tokens/passwords by env variables | Replace all keys/tokens/passwords by env variables
| Python | mit | ueg1990/twilix,ueg1990/twilix | from flask import Flask, request
from flask.ext.sqlalchemy import SQLAlchemy
from twilio import twiml
import subprocess
import os
from cmd import cmds
app = Flask(__name__)
#app.config.from_object('config')
db = SQLAlchemy(app)
ACCOUNT_SID = "" #os.environ['ACCOUNT_SID']
AUTH_TOKEN = "" #os.environ['AUTH_TOKEN']
APP... | from flask import Flask, request
from flask.ext.sqlalchemy import SQLAlchemy
from twilio import twiml
import subprocess
import os
from cmd import cmds
app = Flask(__name__)
#app.config.from_object('config')
db = SQLAlchemy(app)
ACCOUNT_SID = os.environ['ACCOUNT_SID']
AUTH_TOKEN = os.environ['AUTH_TOKEN']
APP_SID = o... | <commit_before>from flask import Flask, request
from flask.ext.sqlalchemy import SQLAlchemy
from twilio import twiml
import subprocess
import os
from cmd import cmds
app = Flask(__name__)
#app.config.from_object('config')
db = SQLAlchemy(app)
ACCOUNT_SID = "" #os.environ['ACCOUNT_SID']
AUTH_TOKEN = "" #os.environ['A... | from flask import Flask, request
from flask.ext.sqlalchemy import SQLAlchemy
from twilio import twiml
import subprocess
import os
from cmd import cmds
app = Flask(__name__)
#app.config.from_object('config')
db = SQLAlchemy(app)
ACCOUNT_SID = os.environ['ACCOUNT_SID']
AUTH_TOKEN = os.environ['AUTH_TOKEN']
APP_SID = o... | from flask import Flask, request
from flask.ext.sqlalchemy import SQLAlchemy
from twilio import twiml
import subprocess
import os
from cmd import cmds
app = Flask(__name__)
#app.config.from_object('config')
db = SQLAlchemy(app)
ACCOUNT_SID = "" #os.environ['ACCOUNT_SID']
AUTH_TOKEN = "" #os.environ['AUTH_TOKEN']
APP... | <commit_before>from flask import Flask, request
from flask.ext.sqlalchemy import SQLAlchemy
from twilio import twiml
import subprocess
import os
from cmd import cmds
app = Flask(__name__)
#app.config.from_object('config')
db = SQLAlchemy(app)
ACCOUNT_SID = "" #os.environ['ACCOUNT_SID']
AUTH_TOKEN = "" #os.environ['A... |
2913ab59af16fe1d2861c11fb12420b2bbd4a880 | udp_client.py | udp_client.py | import socket
import time
UDP_IP = "127.0.0.1"
UDP_PORT = 1234
MESSAGES = ["start_horn", "stop_horn", "classic_destroy"]
for message in MESSAGES:
print "UDP target IP:", UDP_IP
print "UDP target port:", UDP_PORT
print "message:", message
sock = socket.socket(socket.AF_INET, # Internet
socke... | import socket
import time
UDP_IP = "127.0.0.1"
UDP_PORT = 1234
MESSAGES = ["start_horn", "classic_destroy", "stop_horn"]
for message in MESSAGES:
print "UDP target IP:", UDP_IP
print "UDP target port:", UDP_PORT
print "message:", message
sock = socket.socket(socket.AF_INET, # Internet
socke... | Put them in the right order | Put them in the right order
| Python | mit | BenIanGifford/Key-Button,BenIanGifford/Key-Button | import socket
import time
UDP_IP = "127.0.0.1"
UDP_PORT = 1234
MESSAGES = ["start_horn", "stop_horn", "classic_destroy"]
for message in MESSAGES:
print "UDP target IP:", UDP_IP
print "UDP target port:", UDP_PORT
print "message:", message
sock = socket.socket(socket.AF_INET, # Internet
socke... | import socket
import time
UDP_IP = "127.0.0.1"
UDP_PORT = 1234
MESSAGES = ["start_horn", "classic_destroy", "stop_horn"]
for message in MESSAGES:
print "UDP target IP:", UDP_IP
print "UDP target port:", UDP_PORT
print "message:", message
sock = socket.socket(socket.AF_INET, # Internet
socke... | <commit_before>import socket
import time
UDP_IP = "127.0.0.1"
UDP_PORT = 1234
MESSAGES = ["start_horn", "stop_horn", "classic_destroy"]
for message in MESSAGES:
print "UDP target IP:", UDP_IP
print "UDP target port:", UDP_PORT
print "message:", message
sock = socket.socket(socket.AF_INET, # Internet
... | import socket
import time
UDP_IP = "127.0.0.1"
UDP_PORT = 1234
MESSAGES = ["start_horn", "classic_destroy", "stop_horn"]
for message in MESSAGES:
print "UDP target IP:", UDP_IP
print "UDP target port:", UDP_PORT
print "message:", message
sock = socket.socket(socket.AF_INET, # Internet
socke... | import socket
import time
UDP_IP = "127.0.0.1"
UDP_PORT = 1234
MESSAGES = ["start_horn", "stop_horn", "classic_destroy"]
for message in MESSAGES:
print "UDP target IP:", UDP_IP
print "UDP target port:", UDP_PORT
print "message:", message
sock = socket.socket(socket.AF_INET, # Internet
socke... | <commit_before>import socket
import time
UDP_IP = "127.0.0.1"
UDP_PORT = 1234
MESSAGES = ["start_horn", "stop_horn", "classic_destroy"]
for message in MESSAGES:
print "UDP target IP:", UDP_IP
print "UDP target port:", UDP_PORT
print "message:", message
sock = socket.socket(socket.AF_INET, # Internet
... |
39a16e50ad5f4164aed6cce58fb828cc78a9e4f3 | myhome/blog/tests.py | myhome/blog/tests.py | from django.test import SimpleTestCase, Client
from .models import BlogPost
class BlogTestCase(SimpleTestCase):
def setUp(self):
BlogPost.objects.create(
datetime='2014-01-01 12:00:00',
title='title',
content='content',
live=True)
def _test_get(self, url... | from test_base import MyHomeTest
from .models import BlogPost
class BlogTestCase(MyHomeTest):
def setUp(self):
BlogPost.objects.create(
datetime='2014-01-01T12:00:00Z',
title='livetitle',
content='livecontent',
live=True)
BlogPost.objects.create(
... | Adjust blog test to use the base class | Adjust blog test to use the base class
| Python | mit | plumdog/myhome,plumdog/myhome,plumdog/myhome,plumdog/myhome | from django.test import SimpleTestCase, Client
from .models import BlogPost
class BlogTestCase(SimpleTestCase):
def setUp(self):
BlogPost.objects.create(
datetime='2014-01-01 12:00:00',
title='title',
content='content',
live=True)
def _test_get(self, url... | from test_base import MyHomeTest
from .models import BlogPost
class BlogTestCase(MyHomeTest):
def setUp(self):
BlogPost.objects.create(
datetime='2014-01-01T12:00:00Z',
title='livetitle',
content='livecontent',
live=True)
BlogPost.objects.create(
... | <commit_before>from django.test import SimpleTestCase, Client
from .models import BlogPost
class BlogTestCase(SimpleTestCase):
def setUp(self):
BlogPost.objects.create(
datetime='2014-01-01 12:00:00',
title='title',
content='content',
live=True)
def _tes... | from test_base import MyHomeTest
from .models import BlogPost
class BlogTestCase(MyHomeTest):
def setUp(self):
BlogPost.objects.create(
datetime='2014-01-01T12:00:00Z',
title='livetitle',
content='livecontent',
live=True)
BlogPost.objects.create(
... | from django.test import SimpleTestCase, Client
from .models import BlogPost
class BlogTestCase(SimpleTestCase):
def setUp(self):
BlogPost.objects.create(
datetime='2014-01-01 12:00:00',
title='title',
content='content',
live=True)
def _test_get(self, url... | <commit_before>from django.test import SimpleTestCase, Client
from .models import BlogPost
class BlogTestCase(SimpleTestCase):
def setUp(self):
BlogPost.objects.create(
datetime='2014-01-01 12:00:00',
title='title',
content='content',
live=True)
def _tes... |
27923a5490e5e5d2c0503c84fd979b5af6bcba13 | nn/tests/mlp_test.py | nn/tests/mlp_test.py | from sklearn.datasets import make_classification, make_regression
from sklearn.metrics import log_loss
from ..mlp import MLP
class TestFitting(object):
def __init__(self):
self.X_cl, self.y_cl = make_classification(100)
self.X_re, self.y_re = make_classification(100)
def test_if_fit_classifi... | from sklearn.datasets import make_classification, make_regression
from sklearn.metrics import log_loss
from sklearn.preprocessing import StandardScaler
from ..mlp import MLP
class TestFitting(object):
def __init__(self):
sc = StandardScaler()
self.X_cl, self.y_cl = make_classification(100)
... | Scale inputs in test cases | Scale inputs in test cases
| Python | mit | JakeMick/graymatter | from sklearn.datasets import make_classification, make_regression
from sklearn.metrics import log_loss
from ..mlp import MLP
class TestFitting(object):
def __init__(self):
self.X_cl, self.y_cl = make_classification(100)
self.X_re, self.y_re = make_classification(100)
def test_if_fit_classifi... | from sklearn.datasets import make_classification, make_regression
from sklearn.metrics import log_loss
from sklearn.preprocessing import StandardScaler
from ..mlp import MLP
class TestFitting(object):
def __init__(self):
sc = StandardScaler()
self.X_cl, self.y_cl = make_classification(100)
... | <commit_before>from sklearn.datasets import make_classification, make_regression
from sklearn.metrics import log_loss
from ..mlp import MLP
class TestFitting(object):
def __init__(self):
self.X_cl, self.y_cl = make_classification(100)
self.X_re, self.y_re = make_classification(100)
def test_... | from sklearn.datasets import make_classification, make_regression
from sklearn.metrics import log_loss
from sklearn.preprocessing import StandardScaler
from ..mlp import MLP
class TestFitting(object):
def __init__(self):
sc = StandardScaler()
self.X_cl, self.y_cl = make_classification(100)
... | from sklearn.datasets import make_classification, make_regression
from sklearn.metrics import log_loss
from ..mlp import MLP
class TestFitting(object):
def __init__(self):
self.X_cl, self.y_cl = make_classification(100)
self.X_re, self.y_re = make_classification(100)
def test_if_fit_classifi... | <commit_before>from sklearn.datasets import make_classification, make_regression
from sklearn.metrics import log_loss
from ..mlp import MLP
class TestFitting(object):
def __init__(self):
self.X_cl, self.y_cl = make_classification(100)
self.X_re, self.y_re = make_classification(100)
def test_... |
9667e0c6737334ca8ceb4347792e3df39ae52b3a | app/errors.py | app/errors.py | import bugsnag
from aiohttp.client_exceptions import ClientPayloadError
from sanic.exceptions import MethodNotSupported, NotFound
from sanic.handlers import ErrorHandler
from . import settings
IGNORED_EXCEPTIONS = (NotFound, MethodNotSupported, ClientPayloadError)
bugsnag.configure(
api_key=settings.BUGSNAG_API_... | import bugsnag
from aiohttp.client_exceptions import ClientPayloadError
from sanic.exceptions import MethodNotSupported, NotFound
from sanic.handlers import ErrorHandler
from . import settings
IGNORED_EXCEPTIONS = (NotFound, MethodNotSupported, ClientPayloadError)
bugsnag.configure(
api_key=settings.BUGSNAG_API_... | Change methods not using its bound instance to staticmethods | Change methods not using its bound instance to staticmethods
Signed-off-by: shubhendra <c6e99d273726c3152867e7854a0feab4e6ae83c6@gmail.com>
| Python | mit | jacebrowning/memegen,jacebrowning/memegen | import bugsnag
from aiohttp.client_exceptions import ClientPayloadError
from sanic.exceptions import MethodNotSupported, NotFound
from sanic.handlers import ErrorHandler
from . import settings
IGNORED_EXCEPTIONS = (NotFound, MethodNotSupported, ClientPayloadError)
bugsnag.configure(
api_key=settings.BUGSNAG_API_... | import bugsnag
from aiohttp.client_exceptions import ClientPayloadError
from sanic.exceptions import MethodNotSupported, NotFound
from sanic.handlers import ErrorHandler
from . import settings
IGNORED_EXCEPTIONS = (NotFound, MethodNotSupported, ClientPayloadError)
bugsnag.configure(
api_key=settings.BUGSNAG_API_... | <commit_before>import bugsnag
from aiohttp.client_exceptions import ClientPayloadError
from sanic.exceptions import MethodNotSupported, NotFound
from sanic.handlers import ErrorHandler
from . import settings
IGNORED_EXCEPTIONS = (NotFound, MethodNotSupported, ClientPayloadError)
bugsnag.configure(
api_key=settin... | import bugsnag
from aiohttp.client_exceptions import ClientPayloadError
from sanic.exceptions import MethodNotSupported, NotFound
from sanic.handlers import ErrorHandler
from . import settings
IGNORED_EXCEPTIONS = (NotFound, MethodNotSupported, ClientPayloadError)
bugsnag.configure(
api_key=settings.BUGSNAG_API_... | import bugsnag
from aiohttp.client_exceptions import ClientPayloadError
from sanic.exceptions import MethodNotSupported, NotFound
from sanic.handlers import ErrorHandler
from . import settings
IGNORED_EXCEPTIONS = (NotFound, MethodNotSupported, ClientPayloadError)
bugsnag.configure(
api_key=settings.BUGSNAG_API_... | <commit_before>import bugsnag
from aiohttp.client_exceptions import ClientPayloadError
from sanic.exceptions import MethodNotSupported, NotFound
from sanic.handlers import ErrorHandler
from . import settings
IGNORED_EXCEPTIONS = (NotFound, MethodNotSupported, ClientPayloadError)
bugsnag.configure(
api_key=settin... |
5432ba5b64902f3dd2b491504d06af8237926e37 | aws/awslib.py | aws/awslib.py | import boto3
def await_volume(client, volumeId, waitingState, finishedState):
while True:
volumes = client.describe_volumes(VolumeIds=[volumeId])
state = volumes['Volumes'][0]['State']
if state != waitingState:
break
if state != finishedState:
print 'Unexpected volu... | import boto3
import time
def await_volume(client, volumeId, waitingState, finishedState):
while True:
volumes = client.describe_volumes(VolumeIds=[volumeId])
state = volumes['Volumes'][0]['State']
if state != waitingState:
break
time.sleep(1)
if state != finishedSta... | Add sleep calls for AWS loops | Add sleep calls for AWS loops
| Python | mpl-2.0 | bill-mccloskey/searchfox,bill-mccloskey/mozsearch,bill-mccloskey/mozsearch,bill-mccloskey/searchfox,bill-mccloskey/mozsearch,bill-mccloskey/mozsearch,bill-mccloskey/searchfox,bill-mccloskey/searchfox,bill-mccloskey/mozsearch,bill-mccloskey/mozsearch,bill-mccloskey/searchfox,bill-mccloskey/searchfox | import boto3
def await_volume(client, volumeId, waitingState, finishedState):
while True:
volumes = client.describe_volumes(VolumeIds=[volumeId])
state = volumes['Volumes'][0]['State']
if state != waitingState:
break
if state != finishedState:
print 'Unexpected volu... | import boto3
import time
def await_volume(client, volumeId, waitingState, finishedState):
while True:
volumes = client.describe_volumes(VolumeIds=[volumeId])
state = volumes['Volumes'][0]['State']
if state != waitingState:
break
time.sleep(1)
if state != finishedSta... | <commit_before>import boto3
def await_volume(client, volumeId, waitingState, finishedState):
while True:
volumes = client.describe_volumes(VolumeIds=[volumeId])
state = volumes['Volumes'][0]['State']
if state != waitingState:
break
if state != finishedState:
print '... | import boto3
import time
def await_volume(client, volumeId, waitingState, finishedState):
while True:
volumes = client.describe_volumes(VolumeIds=[volumeId])
state = volumes['Volumes'][0]['State']
if state != waitingState:
break
time.sleep(1)
if state != finishedSta... | import boto3
def await_volume(client, volumeId, waitingState, finishedState):
while True:
volumes = client.describe_volumes(VolumeIds=[volumeId])
state = volumes['Volumes'][0]['State']
if state != waitingState:
break
if state != finishedState:
print 'Unexpected volu... | <commit_before>import boto3
def await_volume(client, volumeId, waitingState, finishedState):
while True:
volumes = client.describe_volumes(VolumeIds=[volumeId])
state = volumes['Volumes'][0]['State']
if state != waitingState:
break
if state != finishedState:
print '... |
2bcf457d03610b5b4ade891446b7645721b74480 | sum.py | sum.py | import sublime, sublime_plugin
class SumCommand(sublime_plugin.TextCommand):
def run(self, edit):
sum_view = self.view.window().new_file()
sum_view.set_name('Sum')
file_text = self.view.substr(sublime.Region(0, self.view.size()))
numbers = []
for s in file_text.split():
... | import sublime, sublime_plugin
class SumCommand(sublime_plugin.TextCommand):
def run(self, edit):
sum_view = self.view.window().new_file()
sum_view.set_name('Sum')
file_text = self.view.substr(sublime.Region(0, self.view.size()))
numbers = [to_number(s) for s in file_text.split() i... | Refactor using functions and a list comprehension | Refactor using functions and a list comprehension
| Python | mit | jbrudvik/sublime-sum,jbrudvik/sublime-sum | import sublime, sublime_plugin
class SumCommand(sublime_plugin.TextCommand):
def run(self, edit):
sum_view = self.view.window().new_file()
sum_view.set_name('Sum')
file_text = self.view.substr(sublime.Region(0, self.view.size()))
numbers = []
for s in file_text.split():
... | import sublime, sublime_plugin
class SumCommand(sublime_plugin.TextCommand):
def run(self, edit):
sum_view = self.view.window().new_file()
sum_view.set_name('Sum')
file_text = self.view.substr(sublime.Region(0, self.view.size()))
numbers = [to_number(s) for s in file_text.split() i... | <commit_before>import sublime, sublime_plugin
class SumCommand(sublime_plugin.TextCommand):
def run(self, edit):
sum_view = self.view.window().new_file()
sum_view.set_name('Sum')
file_text = self.view.substr(sublime.Region(0, self.view.size()))
numbers = []
for s in file_t... | import sublime, sublime_plugin
class SumCommand(sublime_plugin.TextCommand):
def run(self, edit):
sum_view = self.view.window().new_file()
sum_view.set_name('Sum')
file_text = self.view.substr(sublime.Region(0, self.view.size()))
numbers = [to_number(s) for s in file_text.split() i... | import sublime, sublime_plugin
class SumCommand(sublime_plugin.TextCommand):
def run(self, edit):
sum_view = self.view.window().new_file()
sum_view.set_name('Sum')
file_text = self.view.substr(sublime.Region(0, self.view.size()))
numbers = []
for s in file_text.split():
... | <commit_before>import sublime, sublime_plugin
class SumCommand(sublime_plugin.TextCommand):
def run(self, edit):
sum_view = self.view.window().new_file()
sum_view.set_name('Sum')
file_text = self.view.substr(sublime.Region(0, self.view.size()))
numbers = []
for s in file_t... |
49af73f2903580d55093e8e001585010fb3a3c46 | locarise_drf_oauth2_support/users/factories.py | locarise_drf_oauth2_support/users/factories.py | from datetime import timedelta
from django.utils import timezone
from locarise_drf_oauth2_support.users.models import User
try:
import factory
class UserF(factory.DjangoModelFactory):
first_name = factory.Sequence(lambda n: "first_name%s" % n)
last_name = factory.Sequence(lambda n: "last_name... | from datetime import timedelta
from django.utils import timezone
from locarise_drf_oauth2_support.users.models import User
try:
import factory
class UserF(factory.DjangoModelFactory):
first_name = factory.Sequence(lambda n: "first_name%s" % n)
last_name = factory.Sequence(lambda n: "last_name... | Add organization_set field in UserF | Add organization_set field in UserF
| Python | mit | locarise/locarise-drf-oauth2-support,locarise/locarise-drf-oauth2-support | from datetime import timedelta
from django.utils import timezone
from locarise_drf_oauth2_support.users.models import User
try:
import factory
class UserF(factory.DjangoModelFactory):
first_name = factory.Sequence(lambda n: "first_name%s" % n)
last_name = factory.Sequence(lambda n: "last_name... | from datetime import timedelta
from django.utils import timezone
from locarise_drf_oauth2_support.users.models import User
try:
import factory
class UserF(factory.DjangoModelFactory):
first_name = factory.Sequence(lambda n: "first_name%s" % n)
last_name = factory.Sequence(lambda n: "last_name... | <commit_before>from datetime import timedelta
from django.utils import timezone
from locarise_drf_oauth2_support.users.models import User
try:
import factory
class UserF(factory.DjangoModelFactory):
first_name = factory.Sequence(lambda n: "first_name%s" % n)
last_name = factory.Sequence(lambd... | from datetime import timedelta
from django.utils import timezone
from locarise_drf_oauth2_support.users.models import User
try:
import factory
class UserF(factory.DjangoModelFactory):
first_name = factory.Sequence(lambda n: "first_name%s" % n)
last_name = factory.Sequence(lambda n: "last_name... | from datetime import timedelta
from django.utils import timezone
from locarise_drf_oauth2_support.users.models import User
try:
import factory
class UserF(factory.DjangoModelFactory):
first_name = factory.Sequence(lambda n: "first_name%s" % n)
last_name = factory.Sequence(lambda n: "last_name... | <commit_before>from datetime import timedelta
from django.utils import timezone
from locarise_drf_oauth2_support.users.models import User
try:
import factory
class UserF(factory.DjangoModelFactory):
first_name = factory.Sequence(lambda n: "first_name%s" % n)
last_name = factory.Sequence(lambd... |
18c4ba9325fe7a460c9c92ffd7bae3ce5d257332 | tests/test_database.py | tests/test_database.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
from io import StringIO
import pytest
from django.core.management import call_command
def test_for_missing_migrations(... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
from io import StringIO
import pytest
from django.core.management import call_command
def test_for_missing_migrations(... | Use new command line option for checking if all migrations have been applied. | Use new command line option for checking if all migrations have been applied.
| Python | mpl-2.0 | mozilla/telemetry-analysis-service,mozilla/telemetry-analysis-service,mozilla/telemetry-analysis-service,mozilla/telemetry-analysis-service | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
from io import StringIO
import pytest
from django.core.management import call_command
def test_for_missing_migrations(... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
from io import StringIO
import pytest
from django.core.management import call_command
def test_for_missing_migrations(... | <commit_before># This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
from io import StringIO
import pytest
from django.core.management import call_command
def test_for_miss... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
from io import StringIO
import pytest
from django.core.management import call_command
def test_for_missing_migrations(... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
from io import StringIO
import pytest
from django.core.management import call_command
def test_for_missing_migrations(... | <commit_before># This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
from io import StringIO
import pytest
from django.core.management import call_command
def test_for_miss... |
ee7b5353c039d6e1d2aeabcb084aee79e07b71f8 | emoji/templatetags/emoji_tags.py | emoji/templatetags/emoji_tags.py | from django import template
from django.core.urlresolvers import reverse, NoReverseMatch
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe
from emoji import Emoji
register = template.Library()
@register.filter(name='emoji_replace', is_safe=True)
@stringfilter
def... | from django import template
from django.core.urlresolvers import reverse, NoReverseMatch
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe, SafeData
from django.utils.html import escape
from emoji import Emoji
register = template.Library()
@register.filter(name='... | Update the filters to escape the characters before replacing them. | Update the filters to escape the characters before replacing them.
This prevents the filters from allowing XSS attacks. This follows
the pattern used by django's linebreaksbr filter.
| Python | mit | gaqzi/django-emoji,gaqzi/django-emoji,gaqzi/django-emoji | from django import template
from django.core.urlresolvers import reverse, NoReverseMatch
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe
from emoji import Emoji
register = template.Library()
@register.filter(name='emoji_replace', is_safe=True)
@stringfilter
def... | from django import template
from django.core.urlresolvers import reverse, NoReverseMatch
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe, SafeData
from django.utils.html import escape
from emoji import Emoji
register = template.Library()
@register.filter(name='... | <commit_before>from django import template
from django.core.urlresolvers import reverse, NoReverseMatch
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe
from emoji import Emoji
register = template.Library()
@register.filter(name='emoji_replace', is_safe=True)
@s... | from django import template
from django.core.urlresolvers import reverse, NoReverseMatch
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe, SafeData
from django.utils.html import escape
from emoji import Emoji
register = template.Library()
@register.filter(name='... | from django import template
from django.core.urlresolvers import reverse, NoReverseMatch
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe
from emoji import Emoji
register = template.Library()
@register.filter(name='emoji_replace', is_safe=True)
@stringfilter
def... | <commit_before>from django import template
from django.core.urlresolvers import reverse, NoReverseMatch
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe
from emoji import Emoji
register = template.Library()
@register.filter(name='emoji_replace', is_safe=True)
@s... |
649c87174711de93261cd7703e67032281e2e8ee | salt/modules/scsi.py | salt/modules/scsi.py | # -*- coding: utf-8 -*-
"""
SCSI administration module
"""
import logging
log = logging.getLogger(__name__)
def lsscsi():
'''
List scsi devices
CLI Example:
.. code-block:: bash
salt '*' scsi.lsscsi
'''
cmd = 'lsscsi'
return __salt__['cmd.run'](cmd).splitlines()
def rescan_all(host):... | # -*- coding: utf-8 -*-
'''
SCSI administration module
'''
import os.path
import logging
log = logging.getLogger(__name__)
def lsscsi():
'''
List SCSI devices
CLI Example:
.. code-block:: bash
salt '*' scsi.lsscsi
'''
cmd = 'lsscsi'
return __salt__['cmd.run'](cmd).splitlines()... | Update formatting to Salt guidelines | Update formatting to Salt guidelines
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | # -*- coding: utf-8 -*-
"""
SCSI administration module
"""
import logging
log = logging.getLogger(__name__)
def lsscsi():
'''
List scsi devices
CLI Example:
.. code-block:: bash
salt '*' scsi.lsscsi
'''
cmd = 'lsscsi'
return __salt__['cmd.run'](cmd).splitlines()
def rescan_all(host):... | # -*- coding: utf-8 -*-
'''
SCSI administration module
'''
import os.path
import logging
log = logging.getLogger(__name__)
def lsscsi():
'''
List SCSI devices
CLI Example:
.. code-block:: bash
salt '*' scsi.lsscsi
'''
cmd = 'lsscsi'
return __salt__['cmd.run'](cmd).splitlines()... | <commit_before># -*- coding: utf-8 -*-
"""
SCSI administration module
"""
import logging
log = logging.getLogger(__name__)
def lsscsi():
'''
List scsi devices
CLI Example:
.. code-block:: bash
salt '*' scsi.lsscsi
'''
cmd = 'lsscsi'
return __salt__['cmd.run'](cmd).splitlines()
def re... | # -*- coding: utf-8 -*-
'''
SCSI administration module
'''
import os.path
import logging
log = logging.getLogger(__name__)
def lsscsi():
'''
List SCSI devices
CLI Example:
.. code-block:: bash
salt '*' scsi.lsscsi
'''
cmd = 'lsscsi'
return __salt__['cmd.run'](cmd).splitlines()... | # -*- coding: utf-8 -*-
"""
SCSI administration module
"""
import logging
log = logging.getLogger(__name__)
def lsscsi():
'''
List scsi devices
CLI Example:
.. code-block:: bash
salt '*' scsi.lsscsi
'''
cmd = 'lsscsi'
return __salt__['cmd.run'](cmd).splitlines()
def rescan_all(host):... | <commit_before># -*- coding: utf-8 -*-
"""
SCSI administration module
"""
import logging
log = logging.getLogger(__name__)
def lsscsi():
'''
List scsi devices
CLI Example:
.. code-block:: bash
salt '*' scsi.lsscsi
'''
cmd = 'lsscsi'
return __salt__['cmd.run'](cmd).splitlines()
def re... |
a3b8297ca5eafd7694f4fde3f2ee351cdb599a9d | derrida/__init__.py | derrida/__init__.py | __version_info__ = (1, 3, 1, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environm... | __version_info__ = (1, 3, 2, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environm... | Update version number for hotfix 1.3.2 | Update version number for hotfix 1.3.2
| Python | apache-2.0 | Princeton-CDH/derrida-django,Princeton-CDH/derrida-django,Princeton-CDH/derrida-django,Princeton-CDH/derrida-django | __version_info__ = (1, 3, 1, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environm... | __version_info__ = (1, 3, 2, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environm... | <commit_before>__version_info__ = (1, 3, 1, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the te... | __version_info__ = (1, 3, 2, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environm... | __version_info__ = (1, 3, 1, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environm... | <commit_before>__version_info__ = (1, 3, 1, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the te... |
eb5944d9e55f01687aaf53992bc975c2cac5047a | code/marv/marv_webapi/__init__.py | code/marv/marv_webapi/__init__.py | # -*- coding: utf-8 -*-
#
# Copyright 2016 - 2018 Ternaris.
# SPDX-License-Identifier: AGPL-3.0-only
from __future__ import absolute_import, division, print_function
from .auth import auth
from .comment import comment
from .dataset import dataset
from .delete import delete
from .tag import tag
from .collection impor... | # -*- coding: utf-8 -*-
#
# Copyright 2016 - 2018 Ternaris.
# SPDX-License-Identifier: AGPL-3.0-only
from __future__ import absolute_import, division, print_function
from pkg_resources import iter_entry_points
from .auth import auth
from .comment import comment
from .dataset import dataset
from .delete import delet... | Support webapi extension via entry points | [marv] Support webapi extension via entry points
| Python | agpl-3.0 | ternaris/marv-robotics,ternaris/marv-robotics | # -*- coding: utf-8 -*-
#
# Copyright 2016 - 2018 Ternaris.
# SPDX-License-Identifier: AGPL-3.0-only
from __future__ import absolute_import, division, print_function
from .auth import auth
from .comment import comment
from .dataset import dataset
from .delete import delete
from .tag import tag
from .collection impor... | # -*- coding: utf-8 -*-
#
# Copyright 2016 - 2018 Ternaris.
# SPDX-License-Identifier: AGPL-3.0-only
from __future__ import absolute_import, division, print_function
from pkg_resources import iter_entry_points
from .auth import auth
from .comment import comment
from .dataset import dataset
from .delete import delet... | <commit_before># -*- coding: utf-8 -*-
#
# Copyright 2016 - 2018 Ternaris.
# SPDX-License-Identifier: AGPL-3.0-only
from __future__ import absolute_import, division, print_function
from .auth import auth
from .comment import comment
from .dataset import dataset
from .delete import delete
from .tag import tag
from .c... | # -*- coding: utf-8 -*-
#
# Copyright 2016 - 2018 Ternaris.
# SPDX-License-Identifier: AGPL-3.0-only
from __future__ import absolute_import, division, print_function
from pkg_resources import iter_entry_points
from .auth import auth
from .comment import comment
from .dataset import dataset
from .delete import delet... | # -*- coding: utf-8 -*-
#
# Copyright 2016 - 2018 Ternaris.
# SPDX-License-Identifier: AGPL-3.0-only
from __future__ import absolute_import, division, print_function
from .auth import auth
from .comment import comment
from .dataset import dataset
from .delete import delete
from .tag import tag
from .collection impor... | <commit_before># -*- coding: utf-8 -*-
#
# Copyright 2016 - 2018 Ternaris.
# SPDX-License-Identifier: AGPL-3.0-only
from __future__ import absolute_import, division, print_function
from .auth import auth
from .comment import comment
from .dataset import dataset
from .delete import delete
from .tag import tag
from .c... |
ecb0922db7aca55bde6177e37b5e20f94fb59b60 | copy/opt/core/bin/remove_mailbox.py | copy/opt/core/bin/remove_mailbox.py | #!/usr/bin/env python
import redis
import os.path
import shutil
import glob
""" ***** CONFIG START ***** """
REDIS_SOCKET = '/tmp/redis.sock'
MAILDIR = '/var/mail'
""" ***** CONFIG END ***** """
os.chdir(MAILDIR)
r = redis.Redis(unix_socket_path=REDIS_SOCKET)
filesDepth = glob.glob('*/*')
dirsDepth = filter(... | #!/usr/bin/env python
# Thomas Merkel <tm@core.io>
import redis
import os
import shutil
import glob
import time
""" ***** CONFIG START ***** """
REDIS_SOCKET = '/tmp/redis.sock'
MAILDIR = '/var/mail'
ARCHIVE = '/var/mail/.archive'
RM_FILE = 'core-remove-mailbox'
""" ***** CONFIG END ***** """
os.chd... | Rebuild mailbox remove script with some verify checks | Rebuild mailbox remove script with some verify checks
We should not remove a mailbox and only archive it. Also it should
be good to be sure the mailbox doesn't exists in redis anymore after
two runs.
| Python | mit | skylime/mi-core-mbox,skylime/mi-core-mbox | #!/usr/bin/env python
import redis
import os.path
import shutil
import glob
""" ***** CONFIG START ***** """
REDIS_SOCKET = '/tmp/redis.sock'
MAILDIR = '/var/mail'
""" ***** CONFIG END ***** """
os.chdir(MAILDIR)
r = redis.Redis(unix_socket_path=REDIS_SOCKET)
filesDepth = glob.glob('*/*')
dirsDepth = filter(... | #!/usr/bin/env python
# Thomas Merkel <tm@core.io>
import redis
import os
import shutil
import glob
import time
""" ***** CONFIG START ***** """
REDIS_SOCKET = '/tmp/redis.sock'
MAILDIR = '/var/mail'
ARCHIVE = '/var/mail/.archive'
RM_FILE = 'core-remove-mailbox'
""" ***** CONFIG END ***** """
os.chd... | <commit_before>#!/usr/bin/env python
import redis
import os.path
import shutil
import glob
""" ***** CONFIG START ***** """
REDIS_SOCKET = '/tmp/redis.sock'
MAILDIR = '/var/mail'
""" ***** CONFIG END ***** """
os.chdir(MAILDIR)
r = redis.Redis(unix_socket_path=REDIS_SOCKET)
filesDepth = glob.glob('*/*')
dirs... | #!/usr/bin/env python
# Thomas Merkel <tm@core.io>
import redis
import os
import shutil
import glob
import time
""" ***** CONFIG START ***** """
REDIS_SOCKET = '/tmp/redis.sock'
MAILDIR = '/var/mail'
ARCHIVE = '/var/mail/.archive'
RM_FILE = 'core-remove-mailbox'
""" ***** CONFIG END ***** """
os.chd... | #!/usr/bin/env python
import redis
import os.path
import shutil
import glob
""" ***** CONFIG START ***** """
REDIS_SOCKET = '/tmp/redis.sock'
MAILDIR = '/var/mail'
""" ***** CONFIG END ***** """
os.chdir(MAILDIR)
r = redis.Redis(unix_socket_path=REDIS_SOCKET)
filesDepth = glob.glob('*/*')
dirsDepth = filter(... | <commit_before>#!/usr/bin/env python
import redis
import os.path
import shutil
import glob
""" ***** CONFIG START ***** """
REDIS_SOCKET = '/tmp/redis.sock'
MAILDIR = '/var/mail'
""" ***** CONFIG END ***** """
os.chdir(MAILDIR)
r = redis.Redis(unix_socket_path=REDIS_SOCKET)
filesDepth = glob.glob('*/*')
dirs... |
c44c0751dbf1ffdeeb050f6ef00762f8dec9e51c | boot.py | boot.py | # Only .py files at the top-level of a Sublime package are considered "plugins".
# Make Sublime aware of our *{Command,Listener,Handler} classes by importing them:
from .src.blame import * # noqa: F401,F403
from .src.blame_all import * # noqa: F401,F403
from .src.blame_inline import * # noqa: F401,F403
from .src.bla... | # Only .py files at the top-level of a Sublime package are considered "plugins".
# Make Sublime aware of our *{Command,Listener,Handler} classes by importing them:
from .src.blame import * # noqa: F401,F403
from .src.blame_all import * # noqa: F401,F403
from .src.blame_inline import * # noqa: F401,F403
from .src.bla... | Stop defining plugin_{,un}loaded functions that aren't doing anything | Stop defining plugin_{,un}loaded functions that aren't doing anything
| Python | mit | psykzz/st3-gitblame | # Only .py files at the top-level of a Sublime package are considered "plugins".
# Make Sublime aware of our *{Command,Listener,Handler} classes by importing them:
from .src.blame import * # noqa: F401,F403
from .src.blame_all import * # noqa: F401,F403
from .src.blame_inline import * # noqa: F401,F403
from .src.bla... | # Only .py files at the top-level of a Sublime package are considered "plugins".
# Make Sublime aware of our *{Command,Listener,Handler} classes by importing them:
from .src.blame import * # noqa: F401,F403
from .src.blame_all import * # noqa: F401,F403
from .src.blame_inline import * # noqa: F401,F403
from .src.bla... | <commit_before># Only .py files at the top-level of a Sublime package are considered "plugins".
# Make Sublime aware of our *{Command,Listener,Handler} classes by importing them:
from .src.blame import * # noqa: F401,F403
from .src.blame_all import * # noqa: F401,F403
from .src.blame_inline import * # noqa: F401,F40... | # Only .py files at the top-level of a Sublime package are considered "plugins".
# Make Sublime aware of our *{Command,Listener,Handler} classes by importing them:
from .src.blame import * # noqa: F401,F403
from .src.blame_all import * # noqa: F401,F403
from .src.blame_inline import * # noqa: F401,F403
from .src.bla... | # Only .py files at the top-level of a Sublime package are considered "plugins".
# Make Sublime aware of our *{Command,Listener,Handler} classes by importing them:
from .src.blame import * # noqa: F401,F403
from .src.blame_all import * # noqa: F401,F403
from .src.blame_inline import * # noqa: F401,F403
from .src.bla... | <commit_before># Only .py files at the top-level of a Sublime package are considered "plugins".
# Make Sublime aware of our *{Command,Listener,Handler} classes by importing them:
from .src.blame import * # noqa: F401,F403
from .src.blame_all import * # noqa: F401,F403
from .src.blame_inline import * # noqa: F401,F40... |
514997ba994f19b7933f9794e16f0668c7c64502 | kismetclient/handlers.py | kismetclient/handlers.py | from kismetclient.utils import csv
from kismetclient.exceptions import ServerError
def kismet(server, version, starttime, servername, dumpfiles, uid):
""" Handle server startup string. """
print version, servername, uid
def capability(server, CAPABILITY, capabilities):
""" Register a server's capability... | from kismetclient.utils import csv
from kismetclient.exceptions import ServerError
def kismet(client, version, starttime, servername, dumpfiles, uid):
""" Handle server startup string. """
print version, servername, uid
def capability(client, CAPABILITY, capabilities):
""" Register a server capability. ... | Switch first handler arg from "server" to "client". | Switch first handler arg from "server" to "client".
| Python | mit | PaulMcMillan/kismetclient | from kismetclient.utils import csv
from kismetclient.exceptions import ServerError
def kismet(server, version, starttime, servername, dumpfiles, uid):
""" Handle server startup string. """
print version, servername, uid
def capability(server, CAPABILITY, capabilities):
""" Register a server's capability... | from kismetclient.utils import csv
from kismetclient.exceptions import ServerError
def kismet(client, version, starttime, servername, dumpfiles, uid):
""" Handle server startup string. """
print version, servername, uid
def capability(client, CAPABILITY, capabilities):
""" Register a server capability. ... | <commit_before>from kismetclient.utils import csv
from kismetclient.exceptions import ServerError
def kismet(server, version, starttime, servername, dumpfiles, uid):
""" Handle server startup string. """
print version, servername, uid
def capability(server, CAPABILITY, capabilities):
""" Register a serv... | from kismetclient.utils import csv
from kismetclient.exceptions import ServerError
def kismet(client, version, starttime, servername, dumpfiles, uid):
""" Handle server startup string. """
print version, servername, uid
def capability(client, CAPABILITY, capabilities):
""" Register a server capability. ... | from kismetclient.utils import csv
from kismetclient.exceptions import ServerError
def kismet(server, version, starttime, servername, dumpfiles, uid):
""" Handle server startup string. """
print version, servername, uid
def capability(server, CAPABILITY, capabilities):
""" Register a server's capability... | <commit_before>from kismetclient.utils import csv
from kismetclient.exceptions import ServerError
def kismet(server, version, starttime, servername, dumpfiles, uid):
""" Handle server startup string. """
print version, servername, uid
def capability(server, CAPABILITY, capabilities):
""" Register a serv... |
6ccd9722a6db66666a9400caf7d124c5ac25ab08 | post_pizza_slices.py | post_pizza_slices.py | import boto3, json
sdb = boto3.client('sdb')
def lambda_handler(data, context):
"""
Handler for posting data to SimpleDB.
Args:
data -- Data to be stored (Dictionary).
context -- AWS context for the request (Object).
"""
if data['Password'] and data['Password'] == 'INSERT PASSWORD':
try:
for person in ['... | import boto3
sdb = boto3.client('sdb')
def lambda_handler(data, context):
"""
Handler for posting data to SimpleDB.
Args:
data -- Data to be stored (Dictionary).
context -- AWS context for the request (Object).
"""
if data['Password'] and data['Password'] == 'INSERT PASSWORD':
try:
for person in ['Sharon... | Remove JSON dependency in POST logic. | Remove JSON dependency in POST logic.
| Python | mit | ryandasher/pizza-tracker,ryandasher/pizza-tracker,ryandasher/pizza-tracker,ryandasher/pizza-tracker | import boto3, json
sdb = boto3.client('sdb')
def lambda_handler(data, context):
"""
Handler for posting data to SimpleDB.
Args:
data -- Data to be stored (Dictionary).
context -- AWS context for the request (Object).
"""
if data['Password'] and data['Password'] == 'INSERT PASSWORD':
try:
for person in ['... | import boto3
sdb = boto3.client('sdb')
def lambda_handler(data, context):
"""
Handler for posting data to SimpleDB.
Args:
data -- Data to be stored (Dictionary).
context -- AWS context for the request (Object).
"""
if data['Password'] and data['Password'] == 'INSERT PASSWORD':
try:
for person in ['Sharon... | <commit_before>import boto3, json
sdb = boto3.client('sdb')
def lambda_handler(data, context):
"""
Handler for posting data to SimpleDB.
Args:
data -- Data to be stored (Dictionary).
context -- AWS context for the request (Object).
"""
if data['Password'] and data['Password'] == 'INSERT PASSWORD':
try:
f... | import boto3
sdb = boto3.client('sdb')
def lambda_handler(data, context):
"""
Handler for posting data to SimpleDB.
Args:
data -- Data to be stored (Dictionary).
context -- AWS context for the request (Object).
"""
if data['Password'] and data['Password'] == 'INSERT PASSWORD':
try:
for person in ['Sharon... | import boto3, json
sdb = boto3.client('sdb')
def lambda_handler(data, context):
"""
Handler for posting data to SimpleDB.
Args:
data -- Data to be stored (Dictionary).
context -- AWS context for the request (Object).
"""
if data['Password'] and data['Password'] == 'INSERT PASSWORD':
try:
for person in ['... | <commit_before>import boto3, json
sdb = boto3.client('sdb')
def lambda_handler(data, context):
"""
Handler for posting data to SimpleDB.
Args:
data -- Data to be stored (Dictionary).
context -- AWS context for the request (Object).
"""
if data['Password'] and data['Password'] == 'INSERT PASSWORD':
try:
f... |
e128a1c594bc4ad826249420ed53a60841fecd5c | main.py | main.py | import logging
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop, PeriodicCallback
from caaas import app
from caaas.cleanup_thread import cleanup_task
from caaas.config_parser import config
DEBUG = True
log = logging.getLogger("caaas")
def main():
... | import logging
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop, PeriodicCallback
from caaas import app
from caaas.cleanup_thread import cleanup_task
from caaas.config_parser import config
DEBUG = True
log = logging.getLogger("caaas")
def main():
... | Change port from 5000 to 4000 | Change port from 5000 to 4000
| Python | apache-2.0 | DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe | import logging
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop, PeriodicCallback
from caaas import app
from caaas.cleanup_thread import cleanup_task
from caaas.config_parser import config
DEBUG = True
log = logging.getLogger("caaas")
def main():
... | import logging
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop, PeriodicCallback
from caaas import app
from caaas.cleanup_thread import cleanup_task
from caaas.config_parser import config
DEBUG = True
log = logging.getLogger("caaas")
def main():
... | <commit_before>import logging
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop, PeriodicCallback
from caaas import app
from caaas.cleanup_thread import cleanup_task
from caaas.config_parser import config
DEBUG = True
log = logging.getLogger("caaas")
... | import logging
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop, PeriodicCallback
from caaas import app
from caaas.cleanup_thread import cleanup_task
from caaas.config_parser import config
DEBUG = True
log = logging.getLogger("caaas")
def main():
... | import logging
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop, PeriodicCallback
from caaas import app
from caaas.cleanup_thread import cleanup_task
from caaas.config_parser import config
DEBUG = True
log = logging.getLogger("caaas")
def main():
... | <commit_before>import logging
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop, PeriodicCallback
from caaas import app
from caaas.cleanup_thread import cleanup_task
from caaas.config_parser import config
DEBUG = True
log = logging.getLogger("caaas")
... |
68db590eb373ea2b293f5619dcd7d6515f454507 | sparkback/__init__.py | sparkback/__init__.py | # -*- coding: utf-8 -*-
from __future__ import division
import argparse
ticks = ('β', 'β', 'β', 'β', 'β
', 'β', 'β', 'β')
def scale_data(data):
m = min(data)
n = (max(data) - m) / (len(ticks) - 1)
# if every element is the same height return all lower ticks, else compute
# the tick height
if n == ... | # -*- coding: utf-8 -*-
from __future__ import division
import argparse
ansi_ticks = ('β', 'β', 'β', 'β', 'β
', 'β', 'β', 'β')
def scale_data(data, ticks):
m = min(data)
n = (max(data) - m) / (len(ticks) - 1)
# if every element is the same height return all lower ticks, else compute
# the tick height
... | Make ticks passable argument to data | Make ticks passable argument to data
| Python | mit | mmichie/sparkback | # -*- coding: utf-8 -*-
from __future__ import division
import argparse
ticks = ('β', 'β', 'β', 'β', 'β
', 'β', 'β', 'β')
def scale_data(data):
m = min(data)
n = (max(data) - m) / (len(ticks) - 1)
# if every element is the same height return all lower ticks, else compute
# the tick height
if n == ... | # -*- coding: utf-8 -*-
from __future__ import division
import argparse
ansi_ticks = ('β', 'β', 'β', 'β', 'β
', 'β', 'β', 'β')
def scale_data(data, ticks):
m = min(data)
n = (max(data) - m) / (len(ticks) - 1)
# if every element is the same height return all lower ticks, else compute
# the tick height
... | <commit_before># -*- coding: utf-8 -*-
from __future__ import division
import argparse
ticks = ('β', 'β', 'β', 'β', 'β
', 'β', 'β', 'β')
def scale_data(data):
m = min(data)
n = (max(data) - m) / (len(ticks) - 1)
# if every element is the same height return all lower ticks, else compute
# the tick heig... | # -*- coding: utf-8 -*-
from __future__ import division
import argparse
ansi_ticks = ('β', 'β', 'β', 'β', 'β
', 'β', 'β', 'β')
def scale_data(data, ticks):
m = min(data)
n = (max(data) - m) / (len(ticks) - 1)
# if every element is the same height return all lower ticks, else compute
# the tick height
... | # -*- coding: utf-8 -*-
from __future__ import division
import argparse
ticks = ('β', 'β', 'β', 'β', 'β
', 'β', 'β', 'β')
def scale_data(data):
m = min(data)
n = (max(data) - m) / (len(ticks) - 1)
# if every element is the same height return all lower ticks, else compute
# the tick height
if n == ... | <commit_before># -*- coding: utf-8 -*-
from __future__ import division
import argparse
ticks = ('β', 'β', 'β', 'β', 'β
', 'β', 'β', 'β')
def scale_data(data):
m = min(data)
n = (max(data) - m) / (len(ticks) - 1)
# if every element is the same height return all lower ticks, else compute
# the tick heig... |
017182e317aa33c0bb4c13541ef19b11bb48e250 | members/views.py | members/views.py | from django.shortcuts import render
from django.http import HttpResponse
from .models import User
def homepage(request):
return render(request, "index.html", {})
def search(request, name):
members = User.objects.filter(first_name__icontains=name) or \
User.objects.filter(last_name__icontains=name) ... | from django.shortcuts import render
from django.http import HttpResponse
from hackfmi.utils import json_view
from .models import User
def homepage(request):
return render(request, "index.html", {})
@json_view
def search(request, name):
members = User.objects.filter(first_name__icontains=name) or \
... | Add view for searching users and return json format | Add view for searching users and return json format
| Python | mit | Hackfmi/Diaphanum,Hackfmi/Diaphanum | from django.shortcuts import render
from django.http import HttpResponse
from .models import User
def homepage(request):
return render(request, "index.html", {})
def search(request, name):
members = User.objects.filter(first_name__icontains=name) or \
User.objects.filter(last_name__icontains=name) ... | from django.shortcuts import render
from django.http import HttpResponse
from hackfmi.utils import json_view
from .models import User
def homepage(request):
return render(request, "index.html", {})
@json_view
def search(request, name):
members = User.objects.filter(first_name__icontains=name) or \
... | <commit_before>from django.shortcuts import render
from django.http import HttpResponse
from .models import User
def homepage(request):
return render(request, "index.html", {})
def search(request, name):
members = User.objects.filter(first_name__icontains=name) or \
User.objects.filter(last_name__i... | from django.shortcuts import render
from django.http import HttpResponse
from hackfmi.utils import json_view
from .models import User
def homepage(request):
return render(request, "index.html", {})
@json_view
def search(request, name):
members = User.objects.filter(first_name__icontains=name) or \
... | from django.shortcuts import render
from django.http import HttpResponse
from .models import User
def homepage(request):
return render(request, "index.html", {})
def search(request, name):
members = User.objects.filter(first_name__icontains=name) or \
User.objects.filter(last_name__icontains=name) ... | <commit_before>from django.shortcuts import render
from django.http import HttpResponse
from .models import User
def homepage(request):
return render(request, "index.html", {})
def search(request, name):
members = User.objects.filter(first_name__icontains=name) or \
User.objects.filter(last_name__i... |
375cff83beb17f52ead364eef6e690a8bd118be4 | app/assets.py | app/assets.py | from flask_assets import Bundle, Environment, Filter
# fixes missing semicolon in last statement of jquery.pjax.js
class ConcatFilter(Filter):
def concat(self, out, hunks, **kw):
out.write(';'.join([h.data() for h, info in hunks]))
js = Bundle(
'node_modules/jquery/dist/jquery.js',
'node_modules/j... | from flask_assets import Bundle, Environment, Filter
class ConcatFilter(Filter):
"""
Filter that merges files, placing a semicolon between them.
Fixes issues caused by missing semicolons at end of JS assets, for example
with last statement of jquery.pjax.js.
"""
def concat(self, out, hunks, **... | Move inline comment to class docstring | Move inline comment to class docstring
| Python | mit | cburmeister/flask-bones,cburmeister/flask-bones,cburmeister/flask-bones | from flask_assets import Bundle, Environment, Filter
# fixes missing semicolon in last statement of jquery.pjax.js
class ConcatFilter(Filter):
def concat(self, out, hunks, **kw):
out.write(';'.join([h.data() for h, info in hunks]))
js = Bundle(
'node_modules/jquery/dist/jquery.js',
'node_modules/j... | from flask_assets import Bundle, Environment, Filter
class ConcatFilter(Filter):
"""
Filter that merges files, placing a semicolon between them.
Fixes issues caused by missing semicolons at end of JS assets, for example
with last statement of jquery.pjax.js.
"""
def concat(self, out, hunks, **... | <commit_before>from flask_assets import Bundle, Environment, Filter
# fixes missing semicolon in last statement of jquery.pjax.js
class ConcatFilter(Filter):
def concat(self, out, hunks, **kw):
out.write(';'.join([h.data() for h, info in hunks]))
js = Bundle(
'node_modules/jquery/dist/jquery.js',
... | from flask_assets import Bundle, Environment, Filter
class ConcatFilter(Filter):
"""
Filter that merges files, placing a semicolon between them.
Fixes issues caused by missing semicolons at end of JS assets, for example
with last statement of jquery.pjax.js.
"""
def concat(self, out, hunks, **... | from flask_assets import Bundle, Environment, Filter
# fixes missing semicolon in last statement of jquery.pjax.js
class ConcatFilter(Filter):
def concat(self, out, hunks, **kw):
out.write(';'.join([h.data() for h, info in hunks]))
js = Bundle(
'node_modules/jquery/dist/jquery.js',
'node_modules/j... | <commit_before>from flask_assets import Bundle, Environment, Filter
# fixes missing semicolon in last statement of jquery.pjax.js
class ConcatFilter(Filter):
def concat(self, out, hunks, **kw):
out.write(';'.join([h.data() for h, info in hunks]))
js = Bundle(
'node_modules/jquery/dist/jquery.js',
... |
5363224395b26528465417ff550d6a2163cbe8e6 | spacy/zh/__init__.py | spacy/zh/__init__.py | from ..language import Language
from ..tokenizer import Tokenizer
from ..tagger import Tagger
class CharacterTokenizer(Tokenizer):
def __call__(self, text):
return self.tokens_from_list(list(text))
class Chinese(Language):
lang = u'zh'
def __call__(self, text):
doc = self.tokenizer.toke... | import jieba
from ..language import Language
from ..tokens import Doc
class Chinese(Language):
lang = u'zh'
def make_doc(self, text):
words = list(jieba.cut(text, cut_all=True))
return Doc(self.vocab, words=words, spaces=[False]*len(words))
| Add draft Jieba tokenizer for Chinese | Add draft Jieba tokenizer for Chinese
| Python | mit | spacy-io/spaCy,explosion/spaCy,oroszgy/spaCy.hu,explosion/spaCy,recognai/spaCy,honnibal/spaCy,banglakit/spaCy,explosion/spaCy,Gregory-Howard/spaCy,aikramer2/spaCy,recognai/spaCy,banglakit/spaCy,recognai/spaCy,oroszgy/spaCy.hu,oroszgy/spaCy.hu,spacy-io/spaCy,aikramer2/spaCy,aikramer2/spaCy,explosion/spaCy,honnibal/spaCy... | from ..language import Language
from ..tokenizer import Tokenizer
from ..tagger import Tagger
class CharacterTokenizer(Tokenizer):
def __call__(self, text):
return self.tokens_from_list(list(text))
class Chinese(Language):
lang = u'zh'
def __call__(self, text):
doc = self.tokenizer.toke... | import jieba
from ..language import Language
from ..tokens import Doc
class Chinese(Language):
lang = u'zh'
def make_doc(self, text):
words = list(jieba.cut(text, cut_all=True))
return Doc(self.vocab, words=words, spaces=[False]*len(words))
| <commit_before>from ..language import Language
from ..tokenizer import Tokenizer
from ..tagger import Tagger
class CharacterTokenizer(Tokenizer):
def __call__(self, text):
return self.tokens_from_list(list(text))
class Chinese(Language):
lang = u'zh'
def __call__(self, text):
doc = self... | import jieba
from ..language import Language
from ..tokens import Doc
class Chinese(Language):
lang = u'zh'
def make_doc(self, text):
words = list(jieba.cut(text, cut_all=True))
return Doc(self.vocab, words=words, spaces=[False]*len(words))
| from ..language import Language
from ..tokenizer import Tokenizer
from ..tagger import Tagger
class CharacterTokenizer(Tokenizer):
def __call__(self, text):
return self.tokens_from_list(list(text))
class Chinese(Language):
lang = u'zh'
def __call__(self, text):
doc = self.tokenizer.toke... | <commit_before>from ..language import Language
from ..tokenizer import Tokenizer
from ..tagger import Tagger
class CharacterTokenizer(Tokenizer):
def __call__(self, text):
return self.tokens_from_list(list(text))
class Chinese(Language):
lang = u'zh'
def __call__(self, text):
doc = self... |
37fa646f4ddafd4db36e5c29b738408f0e26346f | rejected/__init__.py | rejected/__init__.py | """
Rejected, a Python AMQP Consumer daemon
"""
__author__ = 'Gavin M. Roy <gmr@myyearbook.com>'
__date__ = "2009-09-10"
__version__ = "1.0.0"
__all__ = ['cli', 'common', 'mcp', 'utils']
| """
Rejected, a Python AMQP Consumer daemon
"""
__author__ = 'Gavin M. Roy <gmr@myyearbook.com>'
__since__ = "2009-09-10"
__version__ = "2.0.1"
__all__ = ['cli', 'common', 'mcp', 'utils']
| Fix the variable name for since and update the version number | Fix the variable name for since and update the version number
| Python | bsd-3-clause | gmr/rejected,gmr/rejected | """
Rejected, a Python AMQP Consumer daemon
"""
__author__ = 'Gavin M. Roy <gmr@myyearbook.com>'
__date__ = "2009-09-10"
__version__ = "1.0.0"
__all__ = ['cli', 'common', 'mcp', 'utils']
Fix the variable name for since and update the version number | """
Rejected, a Python AMQP Consumer daemon
"""
__author__ = 'Gavin M. Roy <gmr@myyearbook.com>'
__since__ = "2009-09-10"
__version__ = "2.0.1"
__all__ = ['cli', 'common', 'mcp', 'utils']
| <commit_before>"""
Rejected, a Python AMQP Consumer daemon
"""
__author__ = 'Gavin M. Roy <gmr@myyearbook.com>'
__date__ = "2009-09-10"
__version__ = "1.0.0"
__all__ = ['cli', 'common', 'mcp', 'utils']
<commit_msg>Fix the variable name for since and update the version number<commit_after> | """
Rejected, a Python AMQP Consumer daemon
"""
__author__ = 'Gavin M. Roy <gmr@myyearbook.com>'
__since__ = "2009-09-10"
__version__ = "2.0.1"
__all__ = ['cli', 'common', 'mcp', 'utils']
| """
Rejected, a Python AMQP Consumer daemon
"""
__author__ = 'Gavin M. Roy <gmr@myyearbook.com>'
__date__ = "2009-09-10"
__version__ = "1.0.0"
__all__ = ['cli', 'common', 'mcp', 'utils']
Fix the variable name for since and update the version number"""
Rejected, a Python AMQP Consumer daemon
"""
__author__ = 'Gavi... | <commit_before>"""
Rejected, a Python AMQP Consumer daemon
"""
__author__ = 'Gavin M. Roy <gmr@myyearbook.com>'
__date__ = "2009-09-10"
__version__ = "1.0.0"
__all__ = ['cli', 'common', 'mcp', 'utils']
<commit_msg>Fix the variable name for since and update the version number<commit_after>"""
Rejected, a Python AMQ... |
2bd4adcb742fbe2d59e18828f0445dff2fba68d9 | main.py | main.py | #!/usr/bin/env python
"""
This is the main file. The script finds the game window and sets up the
coordinates for each block.
The MIT License (MIT)
(c) 2016
"""
import pyautogui, logging, time
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s.%(msecs)03d: %(message)s', datefmt='%H:%M:%S')
# logging.d... | #!/usr/bin/env python
"""
This is the main file. The script finds the game window and sets up the
coordinates for each block.
The MIT License (MIT)
(c) 2016
"""
import pyautogui, logging, time
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s.%(msecs)03d: %(message)s', datefmt='%H:%M:%S')
# logging.d... | Add find_game_region() to return coors of game window | Add find_game_region() to return coors of game window
| Python | mit | hydrophilicsun/Automating-Minesweeper- | #!/usr/bin/env python
"""
This is the main file. The script finds the game window and sets up the
coordinates for each block.
The MIT License (MIT)
(c) 2016
"""
import pyautogui, logging, time
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s.%(msecs)03d: %(message)s', datefmt='%H:%M:%S')
# logging.d... | #!/usr/bin/env python
"""
This is the main file. The script finds the game window and sets up the
coordinates for each block.
The MIT License (MIT)
(c) 2016
"""
import pyautogui, logging, time
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s.%(msecs)03d: %(message)s', datefmt='%H:%M:%S')
# logging.d... | <commit_before>#!/usr/bin/env python
"""
This is the main file. The script finds the game window and sets up the
coordinates for each block.
The MIT License (MIT)
(c) 2016
"""
import pyautogui, logging, time
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s.%(msecs)03d: %(message)s', datefmt='%H:%M:%S... | #!/usr/bin/env python
"""
This is the main file. The script finds the game window and sets up the
coordinates for each block.
The MIT License (MIT)
(c) 2016
"""
import pyautogui, logging, time
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s.%(msecs)03d: %(message)s', datefmt='%H:%M:%S')
# logging.d... | #!/usr/bin/env python
"""
This is the main file. The script finds the game window and sets up the
coordinates for each block.
The MIT License (MIT)
(c) 2016
"""
import pyautogui, logging, time
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s.%(msecs)03d: %(message)s', datefmt='%H:%M:%S')
# logging.d... | <commit_before>#!/usr/bin/env python
"""
This is the main file. The script finds the game window and sets up the
coordinates for each block.
The MIT License (MIT)
(c) 2016
"""
import pyautogui, logging, time
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s.%(msecs)03d: %(message)s', datefmt='%H:%M:%S... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.