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
4ad06836e009309c7b5c00f0f932f9db38dff15c
examples/weather/gensvcbind.py
examples/weather/gensvcbind.py
import pyxb.Namespace import pyxb.xmlschema as xs import sys import pyxb.standard.bindings.wsdl as wsdl import pyxb.standard.bindings.soaphttp as soaphttp from xml.dom import Node from xml.dom import minidom import pyxb.binding.generate import pyxb.utils.domutils as domutils doc = minidom.parse('weather.wsdl') root =...
import pyxb.Namespace import pyxb.xmlschema as xs import sys import pyxb.standard.bindings.wsdl as wsdl from xml.dom import Node from xml.dom import minidom import pyxb.binding.generate import pyxb.utils.domutils as domutils doc = minidom.parse('weather.wsdl') root = doc.documentElement attribute_map = domutils.Attr...
Update how schema is built
Update how schema is built
Python
apache-2.0
balanced/PyXB,CantemoInternal/pyxb,pabigot/pyxb,jonfoster/pyxb-upstream-mirror,jonfoster/pyxb1,CantemoInternal/pyxb,jonfoster/pyxb1,jonfoster/pyxb2,jonfoster/pyxb2,balanced/PyXB,CantemoInternal/pyxb,balanced/PyXB,jonfoster/pyxb-upstream-mirror,jonfoster/pyxb-upstream-mirror,pabigot/pyxb,jonfoster/pyxb2
import pyxb.Namespace import pyxb.xmlschema as xs import sys import pyxb.standard.bindings.wsdl as wsdl import pyxb.standard.bindings.soaphttp as soaphttp from xml.dom import Node from xml.dom import minidom import pyxb.binding.generate import pyxb.utils.domutils as domutils doc = minidom.parse('weather.wsdl') root =...
import pyxb.Namespace import pyxb.xmlschema as xs import sys import pyxb.standard.bindings.wsdl as wsdl from xml.dom import Node from xml.dom import minidom import pyxb.binding.generate import pyxb.utils.domutils as domutils doc = minidom.parse('weather.wsdl') root = doc.documentElement attribute_map = domutils.Attr...
<commit_before>import pyxb.Namespace import pyxb.xmlschema as xs import sys import pyxb.standard.bindings.wsdl as wsdl import pyxb.standard.bindings.soaphttp as soaphttp from xml.dom import Node from xml.dom import minidom import pyxb.binding.generate import pyxb.utils.domutils as domutils doc = minidom.parse('weathe...
import pyxb.Namespace import pyxb.xmlschema as xs import sys import pyxb.standard.bindings.wsdl as wsdl from xml.dom import Node from xml.dom import minidom import pyxb.binding.generate import pyxb.utils.domutils as domutils doc = minidom.parse('weather.wsdl') root = doc.documentElement attribute_map = domutils.Attr...
import pyxb.Namespace import pyxb.xmlschema as xs import sys import pyxb.standard.bindings.wsdl as wsdl import pyxb.standard.bindings.soaphttp as soaphttp from xml.dom import Node from xml.dom import minidom import pyxb.binding.generate import pyxb.utils.domutils as domutils doc = minidom.parse('weather.wsdl') root =...
<commit_before>import pyxb.Namespace import pyxb.xmlschema as xs import sys import pyxb.standard.bindings.wsdl as wsdl import pyxb.standard.bindings.soaphttp as soaphttp from xml.dom import Node from xml.dom import minidom import pyxb.binding.generate import pyxb.utils.domutils as domutils doc = minidom.parse('weathe...
52a4a10d54374b08c5835d02077fd1edcdc547ac
tests/test_union_energy_grids/results.py
tests/test_union_energy_grids/results.py
#!/usr/bin/env python import sys # import statepoint sys.path.insert(0, '../../src/utils') import statepoint # read in statepoint file if len(sys.argv) > 1: sp = statepoint.StatePoint(sys.argv[1]) else: sp = statepoint.StatePoint('statepoint.10.binary') sp.read_results() # set up output string outstr = '' ...
#!/usr/bin/env python import sys sys.path.insert(0, '../../src/utils') from openmc.statepoint import StatePoint # read in statepoint file if len(sys.argv) > 1: print(sys.argv) sp = StatePoint(sys.argv[1]) else: sp = StatePoint('statepoint.10.binary') sp.read_results() # set up output string outstr = '' ...
Fix import for statepoint for test_union_energy_grids
Fix import for statepoint for test_union_energy_grids
Python
mit
smharper/openmc,paulromano/openmc,mit-crpg/openmc,bhermanmit/openmc,wbinventor/openmc,paulromano/openmc,samuelshaner/openmc,mit-crpg/openmc,smharper/openmc,samuelshaner/openmc,johnnyliu27/openmc,mit-crpg/openmc,lilulu/openmc,walshjon/openmc,shikhar413/openmc,liangjg/openmc,shikhar413/openmc,walshjon/openmc,paulromano/o...
#!/usr/bin/env python import sys # import statepoint sys.path.insert(0, '../../src/utils') import statepoint # read in statepoint file if len(sys.argv) > 1: sp = statepoint.StatePoint(sys.argv[1]) else: sp = statepoint.StatePoint('statepoint.10.binary') sp.read_results() # set up output string outstr = '' ...
#!/usr/bin/env python import sys sys.path.insert(0, '../../src/utils') from openmc.statepoint import StatePoint # read in statepoint file if len(sys.argv) > 1: print(sys.argv) sp = StatePoint(sys.argv[1]) else: sp = StatePoint('statepoint.10.binary') sp.read_results() # set up output string outstr = '' ...
<commit_before>#!/usr/bin/env python import sys # import statepoint sys.path.insert(0, '../../src/utils') import statepoint # read in statepoint file if len(sys.argv) > 1: sp = statepoint.StatePoint(sys.argv[1]) else: sp = statepoint.StatePoint('statepoint.10.binary') sp.read_results() # set up output strin...
#!/usr/bin/env python import sys sys.path.insert(0, '../../src/utils') from openmc.statepoint import StatePoint # read in statepoint file if len(sys.argv) > 1: print(sys.argv) sp = StatePoint(sys.argv[1]) else: sp = StatePoint('statepoint.10.binary') sp.read_results() # set up output string outstr = '' ...
#!/usr/bin/env python import sys # import statepoint sys.path.insert(0, '../../src/utils') import statepoint # read in statepoint file if len(sys.argv) > 1: sp = statepoint.StatePoint(sys.argv[1]) else: sp = statepoint.StatePoint('statepoint.10.binary') sp.read_results() # set up output string outstr = '' ...
<commit_before>#!/usr/bin/env python import sys # import statepoint sys.path.insert(0, '../../src/utils') import statepoint # read in statepoint file if len(sys.argv) > 1: sp = statepoint.StatePoint(sys.argv[1]) else: sp = statepoint.StatePoint('statepoint.10.binary') sp.read_results() # set up output strin...
b9441dd6e41aa8a73ca61df0963e086bb97ab4ef
src/eyeflask/__init__.py
src/eyeflask/__init__.py
from flask import Flask import os import os.path __version__ = "0.1.0" def create_app(config=None): app = Flask(__name__, instance_relative_config=True) config_name = "eyeflask.cfg" # Use user specified config file if provided. if config: config_path = os.path.abspath(config) # Load fr...
from flask import Flask import os import os.path __version__ = "0.1.0" def create_app(config=None): app = Flask(__name__, instance_relative_config=True) config_name = "eyeflask.cfg" # Use user specified config file if provided. if config: config_path = os.path.abspath(config) # Load fr...
Add time to debug log format
Add time to debug log format
Python
mit
n8henrie/eyeflask
from flask import Flask import os import os.path __version__ = "0.1.0" def create_app(config=None): app = Flask(__name__, instance_relative_config=True) config_name = "eyeflask.cfg" # Use user specified config file if provided. if config: config_path = os.path.abspath(config) # Load fr...
from flask import Flask import os import os.path __version__ = "0.1.0" def create_app(config=None): app = Flask(__name__, instance_relative_config=True) config_name = "eyeflask.cfg" # Use user specified config file if provided. if config: config_path = os.path.abspath(config) # Load fr...
<commit_before>from flask import Flask import os import os.path __version__ = "0.1.0" def create_app(config=None): app = Flask(__name__, instance_relative_config=True) config_name = "eyeflask.cfg" # Use user specified config file if provided. if config: config_path = os.path.abspath(config)...
from flask import Flask import os import os.path __version__ = "0.1.0" def create_app(config=None): app = Flask(__name__, instance_relative_config=True) config_name = "eyeflask.cfg" # Use user specified config file if provided. if config: config_path = os.path.abspath(config) # Load fr...
from flask import Flask import os import os.path __version__ = "0.1.0" def create_app(config=None): app = Flask(__name__, instance_relative_config=True) config_name = "eyeflask.cfg" # Use user specified config file if provided. if config: config_path = os.path.abspath(config) # Load fr...
<commit_before>from flask import Flask import os import os.path __version__ = "0.1.0" def create_app(config=None): app = Flask(__name__, instance_relative_config=True) config_name = "eyeflask.cfg" # Use user specified config file if provided. if config: config_path = os.path.abspath(config)...
193ef7e8e4f6629e8534083e705826656c908cab
ws-tests/test_amendment_list.py
ws-tests/test_amendment_list.py
#!/usr/bin/env python import sys, os from opentreetesting import test_http_json_method, config DOMAIN = config('host', 'apihost') SUBMIT_URI = DOMAIN + 'v3/amendments/list_all' r = test_http_json_method(SUBMIT_URI, 'GET', expected_status=200, ...
#!/usr/bin/env python import sys, os from opentreetesting import test_http_json_method, config DOMAIN = config('host', 'apihost') SUBMIT_URI = DOMAIN + '/v3/amendments/list_all' r = test_http_json_method(SUBMIT_URI, 'GET', expected_status=200, ...
Use typical domain value (no trailing slash)
Use typical domain value (no trailing slash)
Python
bsd-2-clause
OpenTreeOfLife/phylesystem-api,OpenTreeOfLife/phylesystem-api,OpenTreeOfLife/phylesystem-api
#!/usr/bin/env python import sys, os from opentreetesting import test_http_json_method, config DOMAIN = config('host', 'apihost') SUBMIT_URI = DOMAIN + 'v3/amendments/list_all' r = test_http_json_method(SUBMIT_URI, 'GET', expected_status=200, ...
#!/usr/bin/env python import sys, os from opentreetesting import test_http_json_method, config DOMAIN = config('host', 'apihost') SUBMIT_URI = DOMAIN + '/v3/amendments/list_all' r = test_http_json_method(SUBMIT_URI, 'GET', expected_status=200, ...
<commit_before>#!/usr/bin/env python import sys, os from opentreetesting import test_http_json_method, config DOMAIN = config('host', 'apihost') SUBMIT_URI = DOMAIN + 'v3/amendments/list_all' r = test_http_json_method(SUBMIT_URI, 'GET', expected_status=200, ...
#!/usr/bin/env python import sys, os from opentreetesting import test_http_json_method, config DOMAIN = config('host', 'apihost') SUBMIT_URI = DOMAIN + '/v3/amendments/list_all' r = test_http_json_method(SUBMIT_URI, 'GET', expected_status=200, ...
#!/usr/bin/env python import sys, os from opentreetesting import test_http_json_method, config DOMAIN = config('host', 'apihost') SUBMIT_URI = DOMAIN + 'v3/amendments/list_all' r = test_http_json_method(SUBMIT_URI, 'GET', expected_status=200, ...
<commit_before>#!/usr/bin/env python import sys, os from opentreetesting import test_http_json_method, config DOMAIN = config('host', 'apihost') SUBMIT_URI = DOMAIN + 'v3/amendments/list_all' r = test_http_json_method(SUBMIT_URI, 'GET', expected_status=200, ...
ccaf9cce478c077040a45340b498063ea8b7fc50
elfi/__init__.py
elfi/__init__.py
# -*- coding: utf-8 -*- from elfi.core import Transform, Simulator, Summary, Discrepancy from elfi.distributions import * from elfi.result import * from elfi.methods import * from elfi.storage import * from elfi.visualization import * from elfi.inference_task import InferenceTask from elfi.wrapper import * from elfi.en...
# -*- coding: utf-8 -*- from elfi.core import Transform, Simulator, Summary, Discrepancy from elfi.distributions import * from elfi.result import * from elfi.methods import * from elfi.storage import * from elfi.visualization import * from elfi.inference_task import InferenceTask from elfi.wrapper import * from elfi.en...
Revert "Change version for dev"
Revert "Change version for dev" This reverts commit 56a9db4cfeda91235313c5e72cb06420a6110673.
Python
bsd-3-clause
HIIT/elfi,elfi-dev/elfi,lintusj1/elfi,elfi-dev/elfi,lintusj1/elfi
# -*- coding: utf-8 -*- from elfi.core import Transform, Simulator, Summary, Discrepancy from elfi.distributions import * from elfi.result import * from elfi.methods import * from elfi.storage import * from elfi.visualization import * from elfi.inference_task import InferenceTask from elfi.wrapper import * from elfi.en...
# -*- coding: utf-8 -*- from elfi.core import Transform, Simulator, Summary, Discrepancy from elfi.distributions import * from elfi.result import * from elfi.methods import * from elfi.storage import * from elfi.visualization import * from elfi.inference_task import InferenceTask from elfi.wrapper import * from elfi.en...
<commit_before># -*- coding: utf-8 -*- from elfi.core import Transform, Simulator, Summary, Discrepancy from elfi.distributions import * from elfi.result import * from elfi.methods import * from elfi.storage import * from elfi.visualization import * from elfi.inference_task import InferenceTask from elfi.wrapper import...
# -*- coding: utf-8 -*- from elfi.core import Transform, Simulator, Summary, Discrepancy from elfi.distributions import * from elfi.result import * from elfi.methods import * from elfi.storage import * from elfi.visualization import * from elfi.inference_task import InferenceTask from elfi.wrapper import * from elfi.en...
# -*- coding: utf-8 -*- from elfi.core import Transform, Simulator, Summary, Discrepancy from elfi.distributions import * from elfi.result import * from elfi.methods import * from elfi.storage import * from elfi.visualization import * from elfi.inference_task import InferenceTask from elfi.wrapper import * from elfi.en...
<commit_before># -*- coding: utf-8 -*- from elfi.core import Transform, Simulator, Summary, Discrepancy from elfi.distributions import * from elfi.result import * from elfi.methods import * from elfi.storage import * from elfi.visualization import * from elfi.inference_task import InferenceTask from elfi.wrapper import...
b544361b2e3f7942a82a911a8d6d314a2044be97
almostfunded/wsgi.py
almostfunded/wsgi.py
""" WSGI config for untitled1 project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SET...
""" WSGI config for untitled1 project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application from whitenoise.django import Djan...
Add missing import statement for whitenoise
Add missing import statement for whitenoise
Python
mit
lorenanicole/almost_funded,lorenanicole/almost_funded,lorenanicole/almost_funded
""" WSGI config for untitled1 project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SET...
""" WSGI config for untitled1 project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application from whitenoise.django import Djan...
<commit_before>""" WSGI config for untitled1 project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefa...
""" WSGI config for untitled1 project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application from whitenoise.django import Djan...
""" WSGI config for untitled1 project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SET...
<commit_before>""" WSGI config for untitled1 project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefa...
b18aa2f4400deab98cc0e27c798ee6d7893232cd
utils/text.py
utils/text.py
def restrict_len(content): if len(content) > 320: content = content[:310].strip() + '...' return content def detect_language(config, langs, word): from yandex_translate import YandexTranslate translator = YandexTranslate(config['yandex_translate_key']) russian = 'абвгдеёжзийклмнопрстуфхцчш...
def restrict_len(content): if len(content) > 320: content = content[:310].strip() + '...' return content def detect_language(config, langs, word): from yandex_translate import YandexTranslate, YandexTranslateException translator = YandexTranslate(config['yandex_translate_key']) russian = '...
Add unknown language error catching
Add unknown language error catching
Python
mit
Elishanto/HarryBotter
def restrict_len(content): if len(content) > 320: content = content[:310].strip() + '...' return content def detect_language(config, langs, word): from yandex_translate import YandexTranslate translator = YandexTranslate(config['yandex_translate_key']) russian = 'абвгдеёжзийклмнопрстуфхцчш...
def restrict_len(content): if len(content) > 320: content = content[:310].strip() + '...' return content def detect_language(config, langs, word): from yandex_translate import YandexTranslate, YandexTranslateException translator = YandexTranslate(config['yandex_translate_key']) russian = '...
<commit_before>def restrict_len(content): if len(content) > 320: content = content[:310].strip() + '...' return content def detect_language(config, langs, word): from yandex_translate import YandexTranslate translator = YandexTranslate(config['yandex_translate_key']) russian = 'абвгдеёжзий...
def restrict_len(content): if len(content) > 320: content = content[:310].strip() + '...' return content def detect_language(config, langs, word): from yandex_translate import YandexTranslate, YandexTranslateException translator = YandexTranslate(config['yandex_translate_key']) russian = '...
def restrict_len(content): if len(content) > 320: content = content[:310].strip() + '...' return content def detect_language(config, langs, word): from yandex_translate import YandexTranslate translator = YandexTranslate(config['yandex_translate_key']) russian = 'абвгдеёжзийклмнопрстуфхцчш...
<commit_before>def restrict_len(content): if len(content) > 320: content = content[:310].strip() + '...' return content def detect_language(config, langs, word): from yandex_translate import YandexTranslate translator = YandexTranslate(config['yandex_translate_key']) russian = 'абвгдеёжзий...
41fe44e99361d9006a8b196e9b886ffdb3e8e460
functional_tests/test_evexml.py
functional_tests/test_evexml.py
"""Functional tests for the xml api part of aniauth project. This is a temporary app as EVE Online's xml api is deprecated and will be disabled March 2018. """ from django.contrib.staticfiles.testing import StaticLiveServerTestCase from django.test import tag from django.shortcuts import reverse from selenium import ...
"""Functional tests for the xml api part of aniauth project. This is a temporary app as EVE Online's xml api is deprecated and will be disabled March 2018. """ from django.contrib.staticfiles.testing import StaticLiveServerTestCase from django.test import tag from django.shortcuts import reverse from selenium import ...
Make test get correct url
Make test get correct url
Python
mit
randomic/aniauth-tdd,randomic/aniauth-tdd
"""Functional tests for the xml api part of aniauth project. This is a temporary app as EVE Online's xml api is deprecated and will be disabled March 2018. """ from django.contrib.staticfiles.testing import StaticLiveServerTestCase from django.test import tag from django.shortcuts import reverse from selenium import ...
"""Functional tests for the xml api part of aniauth project. This is a temporary app as EVE Online's xml api is deprecated and will be disabled March 2018. """ from django.contrib.staticfiles.testing import StaticLiveServerTestCase from django.test import tag from django.shortcuts import reverse from selenium import ...
<commit_before>"""Functional tests for the xml api part of aniauth project. This is a temporary app as EVE Online's xml api is deprecated and will be disabled March 2018. """ from django.contrib.staticfiles.testing import StaticLiveServerTestCase from django.test import tag from django.shortcuts import reverse from s...
"""Functional tests for the xml api part of aniauth project. This is a temporary app as EVE Online's xml api is deprecated and will be disabled March 2018. """ from django.contrib.staticfiles.testing import StaticLiveServerTestCase from django.test import tag from django.shortcuts import reverse from selenium import ...
"""Functional tests for the xml api part of aniauth project. This is a temporary app as EVE Online's xml api is deprecated and will be disabled March 2018. """ from django.contrib.staticfiles.testing import StaticLiveServerTestCase from django.test import tag from django.shortcuts import reverse from selenium import ...
<commit_before>"""Functional tests for the xml api part of aniauth project. This is a temporary app as EVE Online's xml api is deprecated and will be disabled March 2018. """ from django.contrib.staticfiles.testing import StaticLiveServerTestCase from django.test import tag from django.shortcuts import reverse from s...
f468ea8123768a3f66621bfecae20814fa83017b
website_sale_clear_line/controllers/main.py
website_sale_clear_line/controllers/main.py
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp.http import request from openerp impo...
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp.http import request from openerp impo...
FIX website sale clear line
FIX website sale clear line
Python
agpl-3.0
ingadhoc/website
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp.http import request from openerp impo...
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp.http import request from openerp impo...
<commit_before># -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp.http import request fr...
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp.http import request from openerp impo...
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp.http import request from openerp impo...
<commit_before># -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp.http import request fr...
8efab7ddd356a9b2e2209b668d3ed83a5ac9faf2
tests/test_logic.py
tests/test_logic.py
from context import core from context import models from models import model from core import logic import unittest class test_logic(unittest.TestCase): def test_create_room_office(self): new_office = logic.create_room('office', 'orange') self.assertIsInstance(new_office, model.Office) def test_create_room_li...
from context import core from context import models from models import model from core import logic import unittest class test_logic(unittest.TestCase): def setUp(self): self.white_char_in_name = logic.create_room('office', "name ") self.white_char_in_typr = logic.create_room('livingspace ...
Add test case to test non-standard input
Add test case to test non-standard input
Python
mit
georgreen/Geoogreen-Mamboleo-Dojo-Project
from context import core from context import models from models import model from core import logic import unittest class test_logic(unittest.TestCase): def test_create_room_office(self): new_office = logic.create_room('office', 'orange') self.assertIsInstance(new_office, model.Office) def test_create_room_li...
from context import core from context import models from models import model from core import logic import unittest class test_logic(unittest.TestCase): def setUp(self): self.white_char_in_name = logic.create_room('office', "name ") self.white_char_in_typr = logic.create_room('livingspace ...
<commit_before>from context import core from context import models from models import model from core import logic import unittest class test_logic(unittest.TestCase): def test_create_room_office(self): new_office = logic.create_room('office', 'orange') self.assertIsInstance(new_office, model.Office) def test...
from context import core from context import models from models import model from core import logic import unittest class test_logic(unittest.TestCase): def setUp(self): self.white_char_in_name = logic.create_room('office', "name ") self.white_char_in_typr = logic.create_room('livingspace ...
from context import core from context import models from models import model from core import logic import unittest class test_logic(unittest.TestCase): def test_create_room_office(self): new_office = logic.create_room('office', 'orange') self.assertIsInstance(new_office, model.Office) def test_create_room_li...
<commit_before>from context import core from context import models from models import model from core import logic import unittest class test_logic(unittest.TestCase): def test_create_room_office(self): new_office = logic.create_room('office', 'orange') self.assertIsInstance(new_office, model.Office) def test...
b457ab3abc0dbcfd94b26f7107144af67b8a85f4
utils/checks.py
utils/checks.py
from discord.ext import commands def is_owner_or(**perms): async def predicate(ctx): owner = ctx.bot.is_owner(ctx.author) permissions = ctx.channel.permissions_for(ctx.author) return all(getattr(permissions, perm, None) == value for perm, value in perms.items()) ...
from discord.ext import commands def is_owner_or(**perms): async def predicate(ctx): owner = await ctx.bot.is_owner(ctx.author) permissions = ctx.channel.permissions_for(ctx.author) return all(getattr(permissions, perm, None) == value for perm, value in perms.ite...
Make is_owner_or not return True always
Make is_owner_or not return True always
Python
mit
BeatButton/beattie-bot,BeatButton/beattie
from discord.ext import commands def is_owner_or(**perms): async def predicate(ctx): owner = ctx.bot.is_owner(ctx.author) permissions = ctx.channel.permissions_for(ctx.author) return all(getattr(permissions, perm, None) == value for perm, value in perms.items()) ...
from discord.ext import commands def is_owner_or(**perms): async def predicate(ctx): owner = await ctx.bot.is_owner(ctx.author) permissions = ctx.channel.permissions_for(ctx.author) return all(getattr(permissions, perm, None) == value for perm, value in perms.ite...
<commit_before>from discord.ext import commands def is_owner_or(**perms): async def predicate(ctx): owner = ctx.bot.is_owner(ctx.author) permissions = ctx.channel.permissions_for(ctx.author) return all(getattr(permissions, perm, None) == value for perm, value in ...
from discord.ext import commands def is_owner_or(**perms): async def predicate(ctx): owner = await ctx.bot.is_owner(ctx.author) permissions = ctx.channel.permissions_for(ctx.author) return all(getattr(permissions, perm, None) == value for perm, value in perms.ite...
from discord.ext import commands def is_owner_or(**perms): async def predicate(ctx): owner = ctx.bot.is_owner(ctx.author) permissions = ctx.channel.permissions_for(ctx.author) return all(getattr(permissions, perm, None) == value for perm, value in perms.items()) ...
<commit_before>from discord.ext import commands def is_owner_or(**perms): async def predicate(ctx): owner = ctx.bot.is_owner(ctx.author) permissions = ctx.channel.permissions_for(ctx.author) return all(getattr(permissions, perm, None) == value for perm, value in ...
87881f594836b7cf92ffce69dbb643ee05df88d1
utils/config_utils.py
utils/config_utils.py
import sys import yaml def job_config(args): try: config_file = './config/{0}.yml'.format(args[0]) except IndexError: sys.exit("Job name is a required argument. Example: chicago_cta") try: with open(config_file, 'r') as file: config = yaml.safe_load(file) except IOError: sys.exit("Missing config file ...
import sys import yaml def main_config(): config_file = './config/.main.yml' try: with open(config_file, 'r') as file: config = yaml.safe_load(file) except IOError: sys.exit("Missing main config file: '{0}'".format(config_file)) return config, config_file def job_config(args): try: config_file = './...
Add util for loading main config
Add util for loading main config
Python
mit
projectweekend/Transit-Stop-Collector
import sys import yaml def job_config(args): try: config_file = './config/{0}.yml'.format(args[0]) except IndexError: sys.exit("Job name is a required argument. Example: chicago_cta") try: with open(config_file, 'r') as file: config = yaml.safe_load(file) except IOError: sys.exit("Missing config file ...
import sys import yaml def main_config(): config_file = './config/.main.yml' try: with open(config_file, 'r') as file: config = yaml.safe_load(file) except IOError: sys.exit("Missing main config file: '{0}'".format(config_file)) return config, config_file def job_config(args): try: config_file = './...
<commit_before>import sys import yaml def job_config(args): try: config_file = './config/{0}.yml'.format(args[0]) except IndexError: sys.exit("Job name is a required argument. Example: chicago_cta") try: with open(config_file, 'r') as file: config = yaml.safe_load(file) except IOError: sys.exit("Missi...
import sys import yaml def main_config(): config_file = './config/.main.yml' try: with open(config_file, 'r') as file: config = yaml.safe_load(file) except IOError: sys.exit("Missing main config file: '{0}'".format(config_file)) return config, config_file def job_config(args): try: config_file = './...
import sys import yaml def job_config(args): try: config_file = './config/{0}.yml'.format(args[0]) except IndexError: sys.exit("Job name is a required argument. Example: chicago_cta") try: with open(config_file, 'r') as file: config = yaml.safe_load(file) except IOError: sys.exit("Missing config file ...
<commit_before>import sys import yaml def job_config(args): try: config_file = './config/{0}.yml'.format(args[0]) except IndexError: sys.exit("Job name is a required argument. Example: chicago_cta") try: with open(config_file, 'r') as file: config = yaml.safe_load(file) except IOError: sys.exit("Missi...
f699281496950a10ec59651ed93f61e8ef79c1e7
admin/__init__.py
admin/__init__.py
from database import User, Paste, ApiKey from flask import abort, current_app from flask_login import current_user from flask_admin import BaseView, Admin from flask_admin.contrib.mongoengine import ModelView def is_admin(): if current_user.is_anonymous: abort(403) else: return current_user.ad...
from database import User, Paste, ApiKey from flask import abort, current_app from flask_login import current_user from flask_admin import BaseView, Admin from flask_admin.contrib.mongoengine import ModelView def is_admin(): if current_user.is_anonymous(): abort(403) else: return current_user....
Revert "Fix 502 on admin page, is_authenticated() is now a boolean"
Revert "Fix 502 on admin page, is_authenticated() is now a boolean" This reverts commit 0d9a7f86c1d988b4e0f4617c5e4f0409c0754e19.
Python
mit
zifnab06/zifb.in,zifnab06/zifb.in
from database import User, Paste, ApiKey from flask import abort, current_app from flask_login import current_user from flask_admin import BaseView, Admin from flask_admin.contrib.mongoengine import ModelView def is_admin(): if current_user.is_anonymous: abort(403) else: return current_user.ad...
from database import User, Paste, ApiKey from flask import abort, current_app from flask_login import current_user from flask_admin import BaseView, Admin from flask_admin.contrib.mongoengine import ModelView def is_admin(): if current_user.is_anonymous(): abort(403) else: return current_user....
<commit_before>from database import User, Paste, ApiKey from flask import abort, current_app from flask_login import current_user from flask_admin import BaseView, Admin from flask_admin.contrib.mongoengine import ModelView def is_admin(): if current_user.is_anonymous: abort(403) else: return ...
from database import User, Paste, ApiKey from flask import abort, current_app from flask_login import current_user from flask_admin import BaseView, Admin from flask_admin.contrib.mongoengine import ModelView def is_admin(): if current_user.is_anonymous(): abort(403) else: return current_user....
from database import User, Paste, ApiKey from flask import abort, current_app from flask_login import current_user from flask_admin import BaseView, Admin from flask_admin.contrib.mongoengine import ModelView def is_admin(): if current_user.is_anonymous: abort(403) else: return current_user.ad...
<commit_before>from database import User, Paste, ApiKey from flask import abort, current_app from flask_login import current_user from flask_admin import BaseView, Admin from flask_admin.contrib.mongoengine import ModelView def is_admin(): if current_user.is_anonymous: abort(403) else: return ...
a8da08a6cf3bff12ce1668c5f4f99710317e42f0
tests/unit/test_place.py
tests/unit/test_place.py
"""Tests for the isort import placement module""" from functools import partial from isort import place, sections from isort.settings import Config def test_module(src_path): place_tester = partial(place.module, config=Config(src_paths=[src_path])) assert place_tester("isort") == sections.FIRSTPARTY asse...
"""Tests for the isort import placement module""" from functools import partial from isort import place, sections from isort.settings import Config def test_module(src_path): place_tester = partial(place.module, config=Config(src_paths=[src_path])) assert place_tester("isort") == sections.FIRSTPARTY asse...
Add unit test case for desired placement behavior
Add unit test case for desired placement behavior
Python
mit
PyCQA/isort,PyCQA/isort
"""Tests for the isort import placement module""" from functools import partial from isort import place, sections from isort.settings import Config def test_module(src_path): place_tester = partial(place.module, config=Config(src_paths=[src_path])) assert place_tester("isort") == sections.FIRSTPARTY asse...
"""Tests for the isort import placement module""" from functools import partial from isort import place, sections from isort.settings import Config def test_module(src_path): place_tester = partial(place.module, config=Config(src_paths=[src_path])) assert place_tester("isort") == sections.FIRSTPARTY asse...
<commit_before>"""Tests for the isort import placement module""" from functools import partial from isort import place, sections from isort.settings import Config def test_module(src_path): place_tester = partial(place.module, config=Config(src_paths=[src_path])) assert place_tester("isort") == sections.FIRS...
"""Tests for the isort import placement module""" from functools import partial from isort import place, sections from isort.settings import Config def test_module(src_path): place_tester = partial(place.module, config=Config(src_paths=[src_path])) assert place_tester("isort") == sections.FIRSTPARTY asse...
"""Tests for the isort import placement module""" from functools import partial from isort import place, sections from isort.settings import Config def test_module(src_path): place_tester = partial(place.module, config=Config(src_paths=[src_path])) assert place_tester("isort") == sections.FIRSTPARTY asse...
<commit_before>"""Tests for the isort import placement module""" from functools import partial from isort import place, sections from isort.settings import Config def test_module(src_path): place_tester = partial(place.module, config=Config(src_paths=[src_path])) assert place_tester("isort") == sections.FIRS...
ad278fdc71140dfb4be27895e747356e668e3b6c
teuthology/lockstatus.py
teuthology/lockstatus.py
import requests import os from .config import config def get_status(name): uri = os.path.join(config.lock_server, 'nodes', name, '') response = requests.get(uri) success = response.ok if success: return response.json() return None
import requests import os from .config import config from .misc import canonicalize_hostname def get_status(name): name = canonicalize_hostname(name, user=None) uri = os.path.join(config.lock_server, 'nodes', name, '') response = requests.get(uri) success = response.ok if success: return r...
Remove the 'user@' prefix before checking status
Remove the 'user@' prefix before checking status Signed-off-by: Zack Cerza <[email protected]>
Python
mit
ceph/teuthology,t-miyamae/teuthology,zhouyuan/teuthology,caibo2014/teuthology,tchaikov/teuthology,dmick/teuthology,robbat2/teuthology,dreamhost/teuthology,ivotron/teuthology,ivotron/teuthology,SUSE/teuthology,robbat2/teuthology,michaelsevilla/teuthology,tchaikov/teuthology,michaelsevilla/teuthology,ceph/teuthology,drea...
import requests import os from .config import config def get_status(name): uri = os.path.join(config.lock_server, 'nodes', name, '') response = requests.get(uri) success = response.ok if success: return response.json() return None Remove the 'user@' prefix before checking status Signed-of...
import requests import os from .config import config from .misc import canonicalize_hostname def get_status(name): name = canonicalize_hostname(name, user=None) uri = os.path.join(config.lock_server, 'nodes', name, '') response = requests.get(uri) success = response.ok if success: return r...
<commit_before>import requests import os from .config import config def get_status(name): uri = os.path.join(config.lock_server, 'nodes', name, '') response = requests.get(uri) success = response.ok if success: return response.json() return None <commit_msg>Remove the 'user@' prefix before...
import requests import os from .config import config from .misc import canonicalize_hostname def get_status(name): name = canonicalize_hostname(name, user=None) uri = os.path.join(config.lock_server, 'nodes', name, '') response = requests.get(uri) success = response.ok if success: return r...
import requests import os from .config import config def get_status(name): uri = os.path.join(config.lock_server, 'nodes', name, '') response = requests.get(uri) success = response.ok if success: return response.json() return None Remove the 'user@' prefix before checking status Signed-of...
<commit_before>import requests import os from .config import config def get_status(name): uri = os.path.join(config.lock_server, 'nodes', name, '') response = requests.get(uri) success = response.ok if success: return response.json() return None <commit_msg>Remove the 'user@' prefix before...
e1acfc8a05f1a131dc4b146837e007efa58a2ebf
theano/learning_rates.py
theano/learning_rates.py
""" Classes that simplify learning rate modification. """ import theano import theano.tensor as TT class _LearningRate(object): """ Suplerclass for learning rates. """ def __init__(self, initial_rate): """ Args: initial_rate: Initial value of the learning rate. """ self._rate = initial_rate ...
""" Classes that simplify learning rate modification. """ import theano import theano.tensor as TT class _LearningRate(object): """ Suplerclass for learning rates. """ def __init__(self, initial_rate): """ Args: initial_rate: Initial value of the learning rate. """ self._rate = initial_rate ...
Make fixed learning rates not crash.
Make fixed learning rates not crash. There was a slight bug in this code before, which I fixed.
Python
mit
djpetti/rpinets,djpetti/rpinets
""" Classes that simplify learning rate modification. """ import theano import theano.tensor as TT class _LearningRate(object): """ Suplerclass for learning rates. """ def __init__(self, initial_rate): """ Args: initial_rate: Initial value of the learning rate. """ self._rate = initial_rate ...
""" Classes that simplify learning rate modification. """ import theano import theano.tensor as TT class _LearningRate(object): """ Suplerclass for learning rates. """ def __init__(self, initial_rate): """ Args: initial_rate: Initial value of the learning rate. """ self._rate = initial_rate ...
<commit_before>""" Classes that simplify learning rate modification. """ import theano import theano.tensor as TT class _LearningRate(object): """ Suplerclass for learning rates. """ def __init__(self, initial_rate): """ Args: initial_rate: Initial value of the learning rate. """ self._rate =...
""" Classes that simplify learning rate modification. """ import theano import theano.tensor as TT class _LearningRate(object): """ Suplerclass for learning rates. """ def __init__(self, initial_rate): """ Args: initial_rate: Initial value of the learning rate. """ self._rate = initial_rate ...
""" Classes that simplify learning rate modification. """ import theano import theano.tensor as TT class _LearningRate(object): """ Suplerclass for learning rates. """ def __init__(self, initial_rate): """ Args: initial_rate: Initial value of the learning rate. """ self._rate = initial_rate ...
<commit_before>""" Classes that simplify learning rate modification. """ import theano import theano.tensor as TT class _LearningRate(object): """ Suplerclass for learning rates. """ def __init__(self, initial_rate): """ Args: initial_rate: Initial value of the learning rate. """ self._rate =...
e469ae00a815b25ab7d0e45c7f8076c56ae834b4
test/__init__.py
test/__init__.py
import unittest class TestCase(unittest.TestCase): """ Parent TestCase to use for all tests. """ pass
import unittest class TestCase(unittest.TestCase): """ Parent TestCase to use for all tests. """ pass def assertGreaterEqual(self, first, second, msg=None): """ Test that first is respectively >= than second depending on the method name. If not, the test will fail. ...
Implement unittest.TestCase.assertGreaterEqual for pythons less than 2.7
Implement unittest.TestCase.assertGreaterEqual for pythons less than 2.7
Python
mit
pombredanne/jsonstats,pombredanne/jsonstats,RHInception/jsonstats,RHInception/jsonstats
import unittest class TestCase(unittest.TestCase): """ Parent TestCase to use for all tests. """ pass Implement unittest.TestCase.assertGreaterEqual for pythons less than 2.7
import unittest class TestCase(unittest.TestCase): """ Parent TestCase to use for all tests. """ pass def assertGreaterEqual(self, first, second, msg=None): """ Test that first is respectively >= than second depending on the method name. If not, the test will fail. ...
<commit_before> import unittest class TestCase(unittest.TestCase): """ Parent TestCase to use for all tests. """ pass <commit_msg>Implement unittest.TestCase.assertGreaterEqual for pythons less than 2.7<commit_after>
import unittest class TestCase(unittest.TestCase): """ Parent TestCase to use for all tests. """ pass def assertGreaterEqual(self, first, second, msg=None): """ Test that first is respectively >= than second depending on the method name. If not, the test will fail. ...
import unittest class TestCase(unittest.TestCase): """ Parent TestCase to use for all tests. """ pass Implement unittest.TestCase.assertGreaterEqual for pythons less than 2.7 import unittest class TestCase(unittest.TestCase): """ Parent TestCase to use for all tests. """ pass d...
<commit_before> import unittest class TestCase(unittest.TestCase): """ Parent TestCase to use for all tests. """ pass <commit_msg>Implement unittest.TestCase.assertGreaterEqual for pythons less than 2.7<commit_after> import unittest class TestCase(unittest.TestCase): """ Parent TestCase to u...
5fa20295eadf01e4567d89713e406ce82b738cf5
ephemeral-cluster.py
ephemeral-cluster.py
#!/usr/bin/env python import subprocess import sys import uuid usage = """\ Run a command using a temporary docker-compose cluster, removing all containers \ and associated volumes after command completion (regardless of success or \ failure.) Generally, this would be used with the ``run`` command to provide a clean...
#!/usr/bin/env python import itertools import subprocess import sys import uuid def get_images_for_project(project): """ Returns a set of image names associated with a project label. """ p = subprocess.Popen(['docker', 'images'], stdout=subprocess.PIPE) images = set() while p.returncode is Non...
Clean up built images for ephemeral cluster.
Clean up built images for ephemeral cluster. Reviewers: tail, pi, jeff Reviewed By: jeff Differential Revision: http://phabricator.local.disqus.net/D19797
Python
apache-2.0
fuziontech/pgshovel,fuziontech/pgshovel,disqus/pgshovel,disqus/pgshovel,fuziontech/pgshovel
#!/usr/bin/env python import subprocess import sys import uuid usage = """\ Run a command using a temporary docker-compose cluster, removing all containers \ and associated volumes after command completion (regardless of success or \ failure.) Generally, this would be used with the ``run`` command to provide a clean...
#!/usr/bin/env python import itertools import subprocess import sys import uuid def get_images_for_project(project): """ Returns a set of image names associated with a project label. """ p = subprocess.Popen(['docker', 'images'], stdout=subprocess.PIPE) images = set() while p.returncode is Non...
<commit_before>#!/usr/bin/env python import subprocess import sys import uuid usage = """\ Run a command using a temporary docker-compose cluster, removing all containers \ and associated volumes after command completion (regardless of success or \ failure.) Generally, this would be used with the ``run`` command to ...
#!/usr/bin/env python import itertools import subprocess import sys import uuid def get_images_for_project(project): """ Returns a set of image names associated with a project label. """ p = subprocess.Popen(['docker', 'images'], stdout=subprocess.PIPE) images = set() while p.returncode is Non...
#!/usr/bin/env python import subprocess import sys import uuid usage = """\ Run a command using a temporary docker-compose cluster, removing all containers \ and associated volumes after command completion (regardless of success or \ failure.) Generally, this would be used with the ``run`` command to provide a clean...
<commit_before>#!/usr/bin/env python import subprocess import sys import uuid usage = """\ Run a command using a temporary docker-compose cluster, removing all containers \ and associated volumes after command completion (regardless of success or \ failure.) Generally, this would be used with the ``run`` command to ...
3e2baaed603ef9d904926049414bf51b48898776
trex/serializers.py
trex/serializers.py
# -*- coding: utf-8 -*- # # (c) 2014 Bjoern Ricks <[email protected]> # # See LICENSE comming with the source of 'trex' for details. # from rest_framework.serializers import ( HyperlinkedModelSerializer, HyperlinkedIdentityField, ) from trex.models.project import Project, Entry, Tag class ProjectSerializer...
# -*- coding: utf-8 -*- # # (c) 2014 Bjoern Ricks <[email protected]> # # See LICENSE comming with the source of 'trex' for details. # from rest_framework.serializers import ( HyperlinkedModelSerializer, HyperlinkedIdentityField, ) from trex.models.project import Project, Entry, Tag class ProjectSerializer...
Add a TagDetailSerializer for returning more details of a Tag then id and name
Add a TagDetailSerializer for returning more details of a Tag then id and name
Python
mit
bjoernricks/trex,bjoernricks/trex
# -*- coding: utf-8 -*- # # (c) 2014 Bjoern Ricks <[email protected]> # # See LICENSE comming with the source of 'trex' for details. # from rest_framework.serializers import ( HyperlinkedModelSerializer, HyperlinkedIdentityField, ) from trex.models.project import Project, Entry, Tag class ProjectSerializer...
# -*- coding: utf-8 -*- # # (c) 2014 Bjoern Ricks <[email protected]> # # See LICENSE comming with the source of 'trex' for details. # from rest_framework.serializers import ( HyperlinkedModelSerializer, HyperlinkedIdentityField, ) from trex.models.project import Project, Entry, Tag class ProjectSerializer...
<commit_before># -*- coding: utf-8 -*- # # (c) 2014 Bjoern Ricks <[email protected]> # # See LICENSE comming with the source of 'trex' for details. # from rest_framework.serializers import ( HyperlinkedModelSerializer, HyperlinkedIdentityField, ) from trex.models.project import Project, Entry, Tag class Pr...
# -*- coding: utf-8 -*- # # (c) 2014 Bjoern Ricks <[email protected]> # # See LICENSE comming with the source of 'trex' for details. # from rest_framework.serializers import ( HyperlinkedModelSerializer, HyperlinkedIdentityField, ) from trex.models.project import Project, Entry, Tag class ProjectSerializer...
# -*- coding: utf-8 -*- # # (c) 2014 Bjoern Ricks <[email protected]> # # See LICENSE comming with the source of 'trex' for details. # from rest_framework.serializers import ( HyperlinkedModelSerializer, HyperlinkedIdentityField, ) from trex.models.project import Project, Entry, Tag class ProjectSerializer...
<commit_before># -*- coding: utf-8 -*- # # (c) 2014 Bjoern Ricks <[email protected]> # # See LICENSE comming with the source of 'trex' for details. # from rest_framework.serializers import ( HyperlinkedModelSerializer, HyperlinkedIdentityField, ) from trex.models.project import Project, Entry, Tag class Pr...
1c16c8e98845550b19f6c75db5253805f656c636
http_requests.py
http_requests.py
import sublime, sublime_plugin import requests from requests import delete, get, head, options, patch, post, put class RequestCommand(sublime_plugin.TextCommand): def run(self, edit): self.import_variables() request = self.view.substr(self.view.line(self.view.sel()[0])) response = eval(r...
import sublime, sublime_plugin import requests from requests import delete, get, head, options, patch, post, put class RequestCommand(sublime_plugin.TextCommand): def run(self, edit): self.import_variables() selections = self.get_selections() for s in selections: response = e...
Allow multiple requests to be made at once by iterating over selections
Allow multiple requests to be made at once by iterating over selections
Python
mit
kylebebak/Requester,kylebebak/Requester
import sublime, sublime_plugin import requests from requests import delete, get, head, options, patch, post, put class RequestCommand(sublime_plugin.TextCommand): def run(self, edit): self.import_variables() request = self.view.substr(self.view.line(self.view.sel()[0])) response = eval(r...
import sublime, sublime_plugin import requests from requests import delete, get, head, options, patch, post, put class RequestCommand(sublime_plugin.TextCommand): def run(self, edit): self.import_variables() selections = self.get_selections() for s in selections: response = e...
<commit_before>import sublime, sublime_plugin import requests from requests import delete, get, head, options, patch, post, put class RequestCommand(sublime_plugin.TextCommand): def run(self, edit): self.import_variables() request = self.view.substr(self.view.line(self.view.sel()[0])) re...
import sublime, sublime_plugin import requests from requests import delete, get, head, options, patch, post, put class RequestCommand(sublime_plugin.TextCommand): def run(self, edit): self.import_variables() selections = self.get_selections() for s in selections: response = e...
import sublime, sublime_plugin import requests from requests import delete, get, head, options, patch, post, put class RequestCommand(sublime_plugin.TextCommand): def run(self, edit): self.import_variables() request = self.view.substr(self.view.line(self.view.sel()[0])) response = eval(r...
<commit_before>import sublime, sublime_plugin import requests from requests import delete, get, head, options, patch, post, put class RequestCommand(sublime_plugin.TextCommand): def run(self, edit): self.import_variables() request = self.view.substr(self.view.line(self.view.sel()[0])) re...
8d99b27125af58aacbb9556c68774bdaf27fdda5
tests/helpers.py
tests/helpers.py
import asana import requests import responses import unittest import json from six import next from responses import GET, PUT, POST, DELETE # Define JSON primitives so we can just copy in JSON: false = False true = True null = None # From https://github.com/dropbox/responses/issues/31#issuecomment-63165210 from ins...
import json import unittest import asana import requests import responses from six import add_metaclass, next from responses import GET, PUT, POST, DELETE # Define JSON primitives so we can just copy in JSON: false = False true = True null = None def create_decorating_metaclass(decorators, prefix='test_'): clas...
Fix broken unittests in Python 2.7.
Fix broken unittests in Python 2.7. Originally all test classes were decorated by going over the class via inspection - however, this doesn't work in Python 2.7 because the methods that are returned from getmembers are all unbound (in Python 3+, this is fixed as all methods are just function objects). Now this uses a...
Python
mit
asana/python-asana,Asana/python-asana,asana/python-asana
import asana import requests import responses import unittest import json from six import next from responses import GET, PUT, POST, DELETE # Define JSON primitives so we can just copy in JSON: false = False true = True null = None # From https://github.com/dropbox/responses/issues/31#issuecomment-63165210 from ins...
import json import unittest import asana import requests import responses from six import add_metaclass, next from responses import GET, PUT, POST, DELETE # Define JSON primitives so we can just copy in JSON: false = False true = True null = None def create_decorating_metaclass(decorators, prefix='test_'): clas...
<commit_before> import asana import requests import responses import unittest import json from six import next from responses import GET, PUT, POST, DELETE # Define JSON primitives so we can just copy in JSON: false = False true = True null = None # From https://github.com/dropbox/responses/issues/31#issuecomment-63...
import json import unittest import asana import requests import responses from six import add_metaclass, next from responses import GET, PUT, POST, DELETE # Define JSON primitives so we can just copy in JSON: false = False true = True null = None def create_decorating_metaclass(decorators, prefix='test_'): clas...
import asana import requests import responses import unittest import json from six import next from responses import GET, PUT, POST, DELETE # Define JSON primitives so we can just copy in JSON: false = False true = True null = None # From https://github.com/dropbox/responses/issues/31#issuecomment-63165210 from ins...
<commit_before> import asana import requests import responses import unittest import json from six import next from responses import GET, PUT, POST, DELETE # Define JSON primitives so we can just copy in JSON: false = False true = True null = None # From https://github.com/dropbox/responses/issues/31#issuecomment-63...
53234eb1ab0bafe49b8e198336d7958fed3e3f61
awx/main/managers.py
awx/main/managers.py
# Copyright (c) 2014 Ansible, Inc. # All Rights Reserved. from django.conf import settings from django.db import models from django.utils.functional import cached_property class InstanceManager(models.Manager): """A custom manager class for the Instance model. Provides "table-level" methods including gettin...
# Copyright (c) 2014 Ansible, Inc. # All Rights Reserved. import sys from django.conf import settings from django.db import models from django.utils.functional import cached_property class InstanceManager(models.Manager): """A custom manager class for the Instance model. Provides "table-level" methods incl...
Return stub records in testing.
Return stub records in testing.
Python
apache-2.0
snahelou/awx,wwitzel3/awx,snahelou/awx,wwitzel3/awx,snahelou/awx,wwitzel3/awx,snahelou/awx,wwitzel3/awx
# Copyright (c) 2014 Ansible, Inc. # All Rights Reserved. from django.conf import settings from django.db import models from django.utils.functional import cached_property class InstanceManager(models.Manager): """A custom manager class for the Instance model. Provides "table-level" methods including gettin...
# Copyright (c) 2014 Ansible, Inc. # All Rights Reserved. import sys from django.conf import settings from django.db import models from django.utils.functional import cached_property class InstanceManager(models.Manager): """A custom manager class for the Instance model. Provides "table-level" methods incl...
<commit_before># Copyright (c) 2014 Ansible, Inc. # All Rights Reserved. from django.conf import settings from django.db import models from django.utils.functional import cached_property class InstanceManager(models.Manager): """A custom manager class for the Instance model. Provides "table-level" methods i...
# Copyright (c) 2014 Ansible, Inc. # All Rights Reserved. import sys from django.conf import settings from django.db import models from django.utils.functional import cached_property class InstanceManager(models.Manager): """A custom manager class for the Instance model. Provides "table-level" methods incl...
# Copyright (c) 2014 Ansible, Inc. # All Rights Reserved. from django.conf import settings from django.db import models from django.utils.functional import cached_property class InstanceManager(models.Manager): """A custom manager class for the Instance model. Provides "table-level" methods including gettin...
<commit_before># Copyright (c) 2014 Ansible, Inc. # All Rights Reserved. from django.conf import settings from django.db import models from django.utils.functional import cached_property class InstanceManager(models.Manager): """A custom manager class for the Instance model. Provides "table-level" methods i...
a0791aeead7eb77ddf1553a3392f1302a1a5acbb
Instanssi/ext_blog/views.py
Instanssi/ext_blog/views.py
# -*- coding: utf-8 -*- from django.contrib.syndication.views import Feed, FeedDoesNotExist from django.shortcuts import get_object_or_404 from Instanssi.ext_blog.models import BlogEntry from Instanssi.kompomaatti.models import Event class blog_feed(Feed): title = "Instanssi.org Blogi" link = "http://instanss...
# -*- coding: utf-8 -*- from django.contrib.syndication.views import Feed, FeedDoesNotExist from django.shortcuts import get_object_or_404 from Instanssi.ext_blog.models import BlogEntry from Instanssi.kompomaatti.models import Event class blog_feed(Feed): title = "Instanssi.org Blogi" link = "http://instanss...
Sort by date, remove post limit.
ext_blog: Sort by date, remove post limit.
Python
mit
Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org
# -*- coding: utf-8 -*- from django.contrib.syndication.views import Feed, FeedDoesNotExist from django.shortcuts import get_object_or_404 from Instanssi.ext_blog.models import BlogEntry from Instanssi.kompomaatti.models import Event class blog_feed(Feed): title = "Instanssi.org Blogi" link = "http://instanss...
# -*- coding: utf-8 -*- from django.contrib.syndication.views import Feed, FeedDoesNotExist from django.shortcuts import get_object_or_404 from Instanssi.ext_blog.models import BlogEntry from Instanssi.kompomaatti.models import Event class blog_feed(Feed): title = "Instanssi.org Blogi" link = "http://instanss...
<commit_before># -*- coding: utf-8 -*- from django.contrib.syndication.views import Feed, FeedDoesNotExist from django.shortcuts import get_object_or_404 from Instanssi.ext_blog.models import BlogEntry from Instanssi.kompomaatti.models import Event class blog_feed(Feed): title = "Instanssi.org Blogi" link = "...
# -*- coding: utf-8 -*- from django.contrib.syndication.views import Feed, FeedDoesNotExist from django.shortcuts import get_object_or_404 from Instanssi.ext_blog.models import BlogEntry from Instanssi.kompomaatti.models import Event class blog_feed(Feed): title = "Instanssi.org Blogi" link = "http://instanss...
# -*- coding: utf-8 -*- from django.contrib.syndication.views import Feed, FeedDoesNotExist from django.shortcuts import get_object_or_404 from Instanssi.ext_blog.models import BlogEntry from Instanssi.kompomaatti.models import Event class blog_feed(Feed): title = "Instanssi.org Blogi" link = "http://instanss...
<commit_before># -*- coding: utf-8 -*- from django.contrib.syndication.views import Feed, FeedDoesNotExist from django.shortcuts import get_object_or_404 from Instanssi.ext_blog.models import BlogEntry from Instanssi.kompomaatti.models import Event class blog_feed(Feed): title = "Instanssi.org Blogi" link = "...
b860372a9e874e8bc06efc9711f7b58591300e81
tohu/__init__.py
tohu/__init__.py
from distutils.version import StrictVersion from platform import python_version min_supported_python_version = '3.6' if StrictVersion(python_version()) < StrictVersion(min_supported_python_version): error_msg = ( "Tohu requires Python {min_supported_python_version} or greater to run " "(currently ...
from distutils.version import LooseVersion from platform import python_version min_supported_python_version = '3.6' if LooseVersion(python_version()) < LooseVersion(min_supported_python_version): error_msg = ( "Tohu requires Python {min_supported_python_version} or greater to run " "(currently run...
Use LooseVersion in version check (to avoid errors for e.g. '3.7.2+')
Use LooseVersion in version check (to avoid errors for e.g. '3.7.2+')
Python
mit
maxalbert/tohu
from distutils.version import StrictVersion from platform import python_version min_supported_python_version = '3.6' if StrictVersion(python_version()) < StrictVersion(min_supported_python_version): error_msg = ( "Tohu requires Python {min_supported_python_version} or greater to run " "(currently ...
from distutils.version import LooseVersion from platform import python_version min_supported_python_version = '3.6' if LooseVersion(python_version()) < LooseVersion(min_supported_python_version): error_msg = ( "Tohu requires Python {min_supported_python_version} or greater to run " "(currently run...
<commit_before>from distutils.version import StrictVersion from platform import python_version min_supported_python_version = '3.6' if StrictVersion(python_version()) < StrictVersion(min_supported_python_version): error_msg = ( "Tohu requires Python {min_supported_python_version} or greater to run " ...
from distutils.version import LooseVersion from platform import python_version min_supported_python_version = '3.6' if LooseVersion(python_version()) < LooseVersion(min_supported_python_version): error_msg = ( "Tohu requires Python {min_supported_python_version} or greater to run " "(currently run...
from distutils.version import StrictVersion from platform import python_version min_supported_python_version = '3.6' if StrictVersion(python_version()) < StrictVersion(min_supported_python_version): error_msg = ( "Tohu requires Python {min_supported_python_version} or greater to run " "(currently ...
<commit_before>from distutils.version import StrictVersion from platform import python_version min_supported_python_version = '3.6' if StrictVersion(python_version()) < StrictVersion(min_supported_python_version): error_msg = ( "Tohu requires Python {min_supported_python_version} or greater to run " ...
715dcb62966b5c80544ed9eee79a6c69d3b9d927
blog/posts/models.py
blog/posts/models.py
from django.db import models class Post(models.Model): body = models.TextField() title = models.CharField(max_length=50) display_title = models.CharField(max_length=50) publication_date = models.DateTimeField(auto_now_add=True) def __unicode__(self): return self.title class Comment(models...
from django.db import models class Post(models.Model): body = models.TextField() title = models.CharField(max_length=50) publication_date = models.DateTimeField(auto_now_add=True) def __unicode__(self): return self.title class Comment(models.Model): text = models.TextField() author = ...
Remove display_title field from Post model.
Remove display_title field from Post model. It wasn't being used anyway.
Python
mit
Lukasa/minimalog
from django.db import models class Post(models.Model): body = models.TextField() title = models.CharField(max_length=50) display_title = models.CharField(max_length=50) publication_date = models.DateTimeField(auto_now_add=True) def __unicode__(self): return self.title class Comment(models...
from django.db import models class Post(models.Model): body = models.TextField() title = models.CharField(max_length=50) publication_date = models.DateTimeField(auto_now_add=True) def __unicode__(self): return self.title class Comment(models.Model): text = models.TextField() author = ...
<commit_before>from django.db import models class Post(models.Model): body = models.TextField() title = models.CharField(max_length=50) display_title = models.CharField(max_length=50) publication_date = models.DateTimeField(auto_now_add=True) def __unicode__(self): return self.title class...
from django.db import models class Post(models.Model): body = models.TextField() title = models.CharField(max_length=50) publication_date = models.DateTimeField(auto_now_add=True) def __unicode__(self): return self.title class Comment(models.Model): text = models.TextField() author = ...
from django.db import models class Post(models.Model): body = models.TextField() title = models.CharField(max_length=50) display_title = models.CharField(max_length=50) publication_date = models.DateTimeField(auto_now_add=True) def __unicode__(self): return self.title class Comment(models...
<commit_before>from django.db import models class Post(models.Model): body = models.TextField() title = models.CharField(max_length=50) display_title = models.CharField(max_length=50) publication_date = models.DateTimeField(auto_now_add=True) def __unicode__(self): return self.title class...
d8b4acd0617dc93646e177ac56b0205be1b7ff88
seaweb_project/seaweb_project/urls.py
seaweb_project/seaweb_project/urls.py
from django.conf.urls import patterns, url, include from django.views.generic.base import TemplateView from django.contrib.auth.decorators import login_required from django.contrib.auth import views as auth_views from django.contrib import admin admin.autodiscover() from rest_framework.routers import DefaultRouter fro...
from django.conf.urls import patterns, url, include from django.views.generic.base import TemplateView from django.contrib.auth.decorators import login_required from django.contrib.auth import views as auth_views from django.contrib import admin admin.autodiscover() from rest_framework.routers import DefaultRouter fro...
Disable indexing via robots.txt url.
Disable indexing via robots.txt url.
Python
mit
grollins/sea-web-django
from django.conf.urls import patterns, url, include from django.views.generic.base import TemplateView from django.contrib.auth.decorators import login_required from django.contrib.auth import views as auth_views from django.contrib import admin admin.autodiscover() from rest_framework.routers import DefaultRouter fro...
from django.conf.urls import patterns, url, include from django.views.generic.base import TemplateView from django.contrib.auth.decorators import login_required from django.contrib.auth import views as auth_views from django.contrib import admin admin.autodiscover() from rest_framework.routers import DefaultRouter fro...
<commit_before>from django.conf.urls import patterns, url, include from django.views.generic.base import TemplateView from django.contrib.auth.decorators import login_required from django.contrib.auth import views as auth_views from django.contrib import admin admin.autodiscover() from rest_framework.routers import De...
from django.conf.urls import patterns, url, include from django.views.generic.base import TemplateView from django.contrib.auth.decorators import login_required from django.contrib.auth import views as auth_views from django.contrib import admin admin.autodiscover() from rest_framework.routers import DefaultRouter fro...
from django.conf.urls import patterns, url, include from django.views.generic.base import TemplateView from django.contrib.auth.decorators import login_required from django.contrib.auth import views as auth_views from django.contrib import admin admin.autodiscover() from rest_framework.routers import DefaultRouter fro...
<commit_before>from django.conf.urls import patterns, url, include from django.views.generic.base import TemplateView from django.contrib.auth.decorators import login_required from django.contrib.auth import views as auth_views from django.contrib import admin admin.autodiscover() from rest_framework.routers import De...
88a83ebcfe5a3841db4cf75985a2365df87395f8
tests/test_create_elb.py
tests/test_create_elb.py
"""Test ELB creation functions.""" from foremast.elb.create_elb import SpinnakerELB def test_splay(): """Splay should split Health Checks properly.""" health = SpinnakerELB.splay_health('HTTP:80/test') assert health.path == '/test' assert health.port == '80' assert health.proto == 'HTTP' asser...
"""Test ELB creation functions.""" from foremast.elb.splay_health import splay_health def test_splay(): """Splay should split Health Checks properly.""" health = splay_health('HTTP:80/test') assert health.path == '/test' assert health.port == '80' assert health.proto == 'HTTP' assert health.ta...
Update splay_health() test to new module
tests: Update splay_health() test to new module
Python
apache-2.0
gogoair/foremast,gogoair/foremast
"""Test ELB creation functions.""" from foremast.elb.create_elb import SpinnakerELB def test_splay(): """Splay should split Health Checks properly.""" health = SpinnakerELB.splay_health('HTTP:80/test') assert health.path == '/test' assert health.port == '80' assert health.proto == 'HTTP' asser...
"""Test ELB creation functions.""" from foremast.elb.splay_health import splay_health def test_splay(): """Splay should split Health Checks properly.""" health = splay_health('HTTP:80/test') assert health.path == '/test' assert health.port == '80' assert health.proto == 'HTTP' assert health.ta...
<commit_before>"""Test ELB creation functions.""" from foremast.elb.create_elb import SpinnakerELB def test_splay(): """Splay should split Health Checks properly.""" health = SpinnakerELB.splay_health('HTTP:80/test') assert health.path == '/test' assert health.port == '80' assert health.proto == '...
"""Test ELB creation functions.""" from foremast.elb.splay_health import splay_health def test_splay(): """Splay should split Health Checks properly.""" health = splay_health('HTTP:80/test') assert health.path == '/test' assert health.port == '80' assert health.proto == 'HTTP' assert health.ta...
"""Test ELB creation functions.""" from foremast.elb.create_elb import SpinnakerELB def test_splay(): """Splay should split Health Checks properly.""" health = SpinnakerELB.splay_health('HTTP:80/test') assert health.path == '/test' assert health.port == '80' assert health.proto == 'HTTP' asser...
<commit_before>"""Test ELB creation functions.""" from foremast.elb.create_elb import SpinnakerELB def test_splay(): """Splay should split Health Checks properly.""" health = SpinnakerELB.splay_health('HTTP:80/test') assert health.path == '/test' assert health.port == '80' assert health.proto == '...
c9e11c04bd5981f810b47a659f0777d1976cb01f
vaux/storage/metadata.py
vaux/storage/metadata.py
import rethinkdb as r class MetaEngine(object): def __init__(self, hostname, port, db, table): self.rdb = r.connect(host=hostname, port=port, db=db, timeout=20) self.table = table def get_all(self): for item in r.table(self.table).run(self.rdb): yield item def put(sel...
import rethinkdb as r class MetaEngine(object): def __init__(self, hostname, port, db, table): self.rdb = r.connect(host=hostname, port=port, timeout=20) try: self.rdb.db_create(db).run() except Exception, e: pass self.rdb.close() self.rdb = r....
Create the database and table if they don't exist
Create the database and table if they don't exist I think... :/
Python
mit
VauxIo/core
import rethinkdb as r class MetaEngine(object): def __init__(self, hostname, port, db, table): self.rdb = r.connect(host=hostname, port=port, db=db, timeout=20) self.table = table def get_all(self): for item in r.table(self.table).run(self.rdb): yield item def put(sel...
import rethinkdb as r class MetaEngine(object): def __init__(self, hostname, port, db, table): self.rdb = r.connect(host=hostname, port=port, timeout=20) try: self.rdb.db_create(db).run() except Exception, e: pass self.rdb.close() self.rdb = r....
<commit_before>import rethinkdb as r class MetaEngine(object): def __init__(self, hostname, port, db, table): self.rdb = r.connect(host=hostname, port=port, db=db, timeout=20) self.table = table def get_all(self): for item in r.table(self.table).run(self.rdb): yield item ...
import rethinkdb as r class MetaEngine(object): def __init__(self, hostname, port, db, table): self.rdb = r.connect(host=hostname, port=port, timeout=20) try: self.rdb.db_create(db).run() except Exception, e: pass self.rdb.close() self.rdb = r....
import rethinkdb as r class MetaEngine(object): def __init__(self, hostname, port, db, table): self.rdb = r.connect(host=hostname, port=port, db=db, timeout=20) self.table = table def get_all(self): for item in r.table(self.table).run(self.rdb): yield item def put(sel...
<commit_before>import rethinkdb as r class MetaEngine(object): def __init__(self, hostname, port, db, table): self.rdb = r.connect(host=hostname, port=port, db=db, timeout=20) self.table = table def get_all(self): for item in r.table(self.table).run(self.rdb): yield item ...
82aca6b352de3133f1fba454d82e1a20f3da2436
src/auditlog_tests/test_settings.py
src/auditlog_tests/test_settings.py
""" Settings file for the Auditlog test suite. """ SECRET_KEY = 'test' INSTALLED_APPS = [ 'django.contrib.auth', 'django.contrib.contenttypes', 'auditlog', 'auditlog_tests', ] MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'auditlog.middleware.AuditlogMiddleware', ) DATA...
""" Settings file for the Auditlog test suite. """ SECRET_KEY = 'test' INSTALLED_APPS = [ 'django.contrib.auth', 'django.contrib.contenttypes', 'auditlog', 'auditlog_tests', ] MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'auditlog.middleware.AuditlogMiddleware', ) DATA...
Make Django 1.9+ accept the settings file
Make Django 1.9+ accept the settings file
Python
mit
Zmeylol/auditlog,jjkester/django-auditlog,kbussell/django-auditlog,chris-griffin/django-auditlog
""" Settings file for the Auditlog test suite. """ SECRET_KEY = 'test' INSTALLED_APPS = [ 'django.contrib.auth', 'django.contrib.contenttypes', 'auditlog', 'auditlog_tests', ] MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'auditlog.middleware.AuditlogMiddleware', ) DATA...
""" Settings file for the Auditlog test suite. """ SECRET_KEY = 'test' INSTALLED_APPS = [ 'django.contrib.auth', 'django.contrib.contenttypes', 'auditlog', 'auditlog_tests', ] MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'auditlog.middleware.AuditlogMiddleware', ) DATA...
<commit_before>""" Settings file for the Auditlog test suite. """ SECRET_KEY = 'test' INSTALLED_APPS = [ 'django.contrib.auth', 'django.contrib.contenttypes', 'auditlog', 'auditlog_tests', ] MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'auditlog.middleware.AuditlogMiddl...
""" Settings file for the Auditlog test suite. """ SECRET_KEY = 'test' INSTALLED_APPS = [ 'django.contrib.auth', 'django.contrib.contenttypes', 'auditlog', 'auditlog_tests', ] MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'auditlog.middleware.AuditlogMiddleware', ) DATA...
""" Settings file for the Auditlog test suite. """ SECRET_KEY = 'test' INSTALLED_APPS = [ 'django.contrib.auth', 'django.contrib.contenttypes', 'auditlog', 'auditlog_tests', ] MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'auditlog.middleware.AuditlogMiddleware', ) DATA...
<commit_before>""" Settings file for the Auditlog test suite. """ SECRET_KEY = 'test' INSTALLED_APPS = [ 'django.contrib.auth', 'django.contrib.contenttypes', 'auditlog', 'auditlog_tests', ] MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'auditlog.middleware.AuditlogMiddl...
3d2a67ab4b46bf389376544fb21341163b57e8fa
mptt/signals.py
mptt/signals.py
import django.dispatch # Behaves like Djangos normal pre-/post_save signals signals with the # added arguments ``target`` and ``position`` that matches those of # ``move_to``. # If the signal is called from ``save`` it'll not be pass position. node_moved = django.dispatch.Signal(providing_args=[ 'instance', 't...
from django.db.models.signals import ModelSignal as Signal # Behaves like Djangos normal pre-/post_save signals signals with the # added arguments ``target`` and ``position`` that matches those of # ``move_to``. # If the signal is called from ``save`` it'll not be pass position. node_moved = Signal(providing_args=[ ...
Use ModelSignal over plain Signal
Use ModelSignal over plain Signal
Python
mit
matthiask/django-mptt,matthiask/django-mptt,matthiask/django-mptt,matthiask/django-mptt
import django.dispatch # Behaves like Djangos normal pre-/post_save signals signals with the # added arguments ``target`` and ``position`` that matches those of # ``move_to``. # If the signal is called from ``save`` it'll not be pass position. node_moved = django.dispatch.Signal(providing_args=[ 'instance', 't...
from django.db.models.signals import ModelSignal as Signal # Behaves like Djangos normal pre-/post_save signals signals with the # added arguments ``target`` and ``position`` that matches those of # ``move_to``. # If the signal is called from ``save`` it'll not be pass position. node_moved = Signal(providing_args=[ ...
<commit_before>import django.dispatch # Behaves like Djangos normal pre-/post_save signals signals with the # added arguments ``target`` and ``position`` that matches those of # ``move_to``. # If the signal is called from ``save`` it'll not be pass position. node_moved = django.dispatch.Signal(providing_args=[ 'in...
from django.db.models.signals import ModelSignal as Signal # Behaves like Djangos normal pre-/post_save signals signals with the # added arguments ``target`` and ``position`` that matches those of # ``move_to``. # If the signal is called from ``save`` it'll not be pass position. node_moved = Signal(providing_args=[ ...
import django.dispatch # Behaves like Djangos normal pre-/post_save signals signals with the # added arguments ``target`` and ``position`` that matches those of # ``move_to``. # If the signal is called from ``save`` it'll not be pass position. node_moved = django.dispatch.Signal(providing_args=[ 'instance', 't...
<commit_before>import django.dispatch # Behaves like Djangos normal pre-/post_save signals signals with the # added arguments ``target`` and ``position`` that matches those of # ``move_to``. # If the signal is called from ``save`` it'll not be pass position. node_moved = django.dispatch.Signal(providing_args=[ 'in...
d054180fe1ff5ff7f4a0bc5b62f8dfcbb15a9c09
winthrop/people/admin.py
winthrop/people/admin.py
from django.contrib import admin from .models import Person, Residence, RelationshipType, Relationship admin.site.register(Person) admin.site.register(Residence) admin.site.register(RelationshipType) admin.site.register(Relationship)
from django.contrib import admin from .models import Person, Residence, RelationshipType, Relationship class ResidenceInline(admin.TabularInline): '''Inline class for Residence''' model = Residence class PersonAdmin(admin.ModelAdmin): inlines = [ ResidenceInline ] admin.site.register(Pers...
Add residence as an inline to person/people
Add residence as an inline to person/people
Python
apache-2.0
Princeton-CDH/winthrop-django,Princeton-CDH/winthrop-django,Princeton-CDH/winthrop-django
from django.contrib import admin from .models import Person, Residence, RelationshipType, Relationship admin.site.register(Person) admin.site.register(Residence) admin.site.register(RelationshipType) admin.site.register(Relationship) Add residence as an inline to person/people
from django.contrib import admin from .models import Person, Residence, RelationshipType, Relationship class ResidenceInline(admin.TabularInline): '''Inline class for Residence''' model = Residence class PersonAdmin(admin.ModelAdmin): inlines = [ ResidenceInline ] admin.site.register(Pers...
<commit_before>from django.contrib import admin from .models import Person, Residence, RelationshipType, Relationship admin.site.register(Person) admin.site.register(Residence) admin.site.register(RelationshipType) admin.site.register(Relationship) <commit_msg>Add residence as an inline to person/people<commit_after...
from django.contrib import admin from .models import Person, Residence, RelationshipType, Relationship class ResidenceInline(admin.TabularInline): '''Inline class for Residence''' model = Residence class PersonAdmin(admin.ModelAdmin): inlines = [ ResidenceInline ] admin.site.register(Pers...
from django.contrib import admin from .models import Person, Residence, RelationshipType, Relationship admin.site.register(Person) admin.site.register(Residence) admin.site.register(RelationshipType) admin.site.register(Relationship) Add residence as an inline to person/peoplefrom django.contrib import admin from ....
<commit_before>from django.contrib import admin from .models import Person, Residence, RelationshipType, Relationship admin.site.register(Person) admin.site.register(Residence) admin.site.register(RelationshipType) admin.site.register(Relationship) <commit_msg>Add residence as an inline to person/people<commit_after...
26bac2e3f01ed6b7b631f9dec8d2c3156e9ce01a
blog/blog/urls.py
blog/blog/urls.py
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('posts.views', # Examples: url(r'^$', 'home', name='blog_home'), url(r'^blog/(?P<post_year>\d{4})/(?P<post_month>\d{2})/(...
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('posts.views', # Examples: url(r'^$', 'home', name='blog_home'), url(r'^(?P<post_year>\d{4})/(?P<post_month>\d{2})/(?P<po...
Remove '/blog/' from the post url.
Remove '/blog/' from the post url. Was pretty unnecessary.
Python
mit
Lukasa/minimalog
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('posts.views', # Examples: url(r'^$', 'home', name='blog_home'), url(r'^blog/(?P<post_year>\d{4})/(?P<post_month>\d{2})/(...
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('posts.views', # Examples: url(r'^$', 'home', name='blog_home'), url(r'^(?P<post_year>\d{4})/(?P<post_month>\d{2})/(?P<po...
<commit_before>from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('posts.views', # Examples: url(r'^$', 'home', name='blog_home'), url(r'^blog/(?P<post_year>\d{4})/(?P<post...
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('posts.views', # Examples: url(r'^$', 'home', name='blog_home'), url(r'^(?P<post_year>\d{4})/(?P<post_month>\d{2})/(?P<po...
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('posts.views', # Examples: url(r'^$', 'home', name='blog_home'), url(r'^blog/(?P<post_year>\d{4})/(?P<post_month>\d{2})/(...
<commit_before>from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('posts.views', # Examples: url(r'^$', 'home', name='blog_home'), url(r'^blog/(?P<post_year>\d{4})/(?P<post...
fc6202425e0c855dc29980904949b60c0ac48bbf
preparation/tools/build_assets.py
preparation/tools/build_assets.py
from copy import copy from preparation.resources.Resource import names_registered, resource_by_name from hb_res.storage import get_storage def rebuild_from_resource(resource_name: str): resource = resource_by_name(resource_name)() with get_storage(resource_name.replace('Resource', '')) as out_storage: ...
from copy import copy from preparation.resources.Resource import names_registered, resource_by_name from hb_res.storage import get_storage def rebuild_from_resource(resource_name: str): resource = resource_by_name(resource_name)() trunk = resource_name.replace('Resource', '') with get_storage(trunk) as o...
Add start/finish debug info while generating
Add start/finish debug info while generating
Python
mit
hatbot-team/hatbot_resources
from copy import copy from preparation.resources.Resource import names_registered, resource_by_name from hb_res.storage import get_storage def rebuild_from_resource(resource_name: str): resource = resource_by_name(resource_name)() with get_storage(resource_name.replace('Resource', '')) as out_storage: ...
from copy import copy from preparation.resources.Resource import names_registered, resource_by_name from hb_res.storage import get_storage def rebuild_from_resource(resource_name: str): resource = resource_by_name(resource_name)() trunk = resource_name.replace('Resource', '') with get_storage(trunk) as o...
<commit_before>from copy import copy from preparation.resources.Resource import names_registered, resource_by_name from hb_res.storage import get_storage def rebuild_from_resource(resource_name: str): resource = resource_by_name(resource_name)() with get_storage(resource_name.replace('Resource', '')) as out_...
from copy import copy from preparation.resources.Resource import names_registered, resource_by_name from hb_res.storage import get_storage def rebuild_from_resource(resource_name: str): resource = resource_by_name(resource_name)() trunk = resource_name.replace('Resource', '') with get_storage(trunk) as o...
from copy import copy from preparation.resources.Resource import names_registered, resource_by_name from hb_res.storage import get_storage def rebuild_from_resource(resource_name: str): resource = resource_by_name(resource_name)() with get_storage(resource_name.replace('Resource', '')) as out_storage: ...
<commit_before>from copy import copy from preparation.resources.Resource import names_registered, resource_by_name from hb_res.storage import get_storage def rebuild_from_resource(resource_name: str): resource = resource_by_name(resource_name)() with get_storage(resource_name.replace('Resource', '')) as out_...
248b43bdfe0ad42772bf76f2e64b1624460ce494
deployer/__init__.py
deployer/__init__.py
from __future__ import absolute_import import deployer.logger from celery.signals import setup_logging __version__ = '0.3.8' __author__ = 'sukrit' deployer.logger.init_logging() setup_logging.connect(deployer.logger.init_celery_logging)
from __future__ import absolute_import import deployer.logger from celery.signals import setup_logging __version__ = '0.3.9' __author__ = 'sukrit' deployer.logger.init_logging() setup_logging.connect(deployer.logger.init_celery_logging)
Prepare for next dev version
Prepare for next dev version
Python
mit
totem/cluster-deployer,totem/cluster-deployer,totem/cluster-deployer
from __future__ import absolute_import import deployer.logger from celery.signals import setup_logging __version__ = '0.3.8' __author__ = 'sukrit' deployer.logger.init_logging() setup_logging.connect(deployer.logger.init_celery_logging) Prepare for next dev version
from __future__ import absolute_import import deployer.logger from celery.signals import setup_logging __version__ = '0.3.9' __author__ = 'sukrit' deployer.logger.init_logging() setup_logging.connect(deployer.logger.init_celery_logging)
<commit_before>from __future__ import absolute_import import deployer.logger from celery.signals import setup_logging __version__ = '0.3.8' __author__ = 'sukrit' deployer.logger.init_logging() setup_logging.connect(deployer.logger.init_celery_logging) <commit_msg>Prepare for next dev version<commit_after>
from __future__ import absolute_import import deployer.logger from celery.signals import setup_logging __version__ = '0.3.9' __author__ = 'sukrit' deployer.logger.init_logging() setup_logging.connect(deployer.logger.init_celery_logging)
from __future__ import absolute_import import deployer.logger from celery.signals import setup_logging __version__ = '0.3.8' __author__ = 'sukrit' deployer.logger.init_logging() setup_logging.connect(deployer.logger.init_celery_logging) Prepare for next dev versionfrom __future__ import absolute_import import deploy...
<commit_before>from __future__ import absolute_import import deployer.logger from celery.signals import setup_logging __version__ = '0.3.8' __author__ = 'sukrit' deployer.logger.init_logging() setup_logging.connect(deployer.logger.init_celery_logging) <commit_msg>Prepare for next dev version<commit_after>from __futu...
52fa13e103b77365acc9769f205d6b92af94b738
lambda/lambda.py
lambda/lambda.py
from __future__ import print_function from ses import email_message_from_s3_bucket, event_msg_is_to_command, recipient_destination_overlap from cnc import handle_command import boto3 ses = boto3.client('ses') from config import email_bucket from listcfg import ListConfiguration def lambda_handler(event, context):...
from __future__ import print_function from ses import email_message_from_s3_bucket, event_msg_is_to_command, msg_get_header, recipient_destination_overlap from cnc import handle_command import boto3 ses = boto3.client('ses') from config import email_bucket from listcfg import ListConfiguration def lambda_handler(...
Remove any existing DKIM signature and set the Sender: header before sending.
Remove any existing DKIM signature and set the Sender: header before sending.
Python
mit
ilg/LambdaMLM
from __future__ import print_function from ses import email_message_from_s3_bucket, event_msg_is_to_command, recipient_destination_overlap from cnc import handle_command import boto3 ses = boto3.client('ses') from config import email_bucket from listcfg import ListConfiguration def lambda_handler(event, context):...
from __future__ import print_function from ses import email_message_from_s3_bucket, event_msg_is_to_command, msg_get_header, recipient_destination_overlap from cnc import handle_command import boto3 ses = boto3.client('ses') from config import email_bucket from listcfg import ListConfiguration def lambda_handler(...
<commit_before>from __future__ import print_function from ses import email_message_from_s3_bucket, event_msg_is_to_command, recipient_destination_overlap from cnc import handle_command import boto3 ses = boto3.client('ses') from config import email_bucket from listcfg import ListConfiguration def lambda_handler(e...
from __future__ import print_function from ses import email_message_from_s3_bucket, event_msg_is_to_command, msg_get_header, recipient_destination_overlap from cnc import handle_command import boto3 ses = boto3.client('ses') from config import email_bucket from listcfg import ListConfiguration def lambda_handler(...
from __future__ import print_function from ses import email_message_from_s3_bucket, event_msg_is_to_command, recipient_destination_overlap from cnc import handle_command import boto3 ses = boto3.client('ses') from config import email_bucket from listcfg import ListConfiguration def lambda_handler(event, context):...
<commit_before>from __future__ import print_function from ses import email_message_from_s3_bucket, event_msg_is_to_command, recipient_destination_overlap from cnc import handle_command import boto3 ses = boto3.client('ses') from config import email_bucket from listcfg import ListConfiguration def lambda_handler(e...
40688413e59aaabd4a92dba4d2f402fb42fee143
1-multiples-of-3-and-5.py
1-multiples-of-3-and-5.py
from itertools import chain def threes_and_fives_gen(num=1000): for i in range(num): if i % 3 == 0 or i % 5 == 0: yield i def threes_and_fives_fun(n): return set(chain(range(3, n+1, 3), range(5, n+1, 5))) def solve(n): return sum( filter(lambda x: x%3==0 or x%5==0, ...
from itertools import chain def threes_and_fives_gen(num=1000): for i in range(num): if i % 3 == 0 or i % 5 == 0: yield i def threes_and_fives_fun(n): return set(chain(range(3, n+1, 3), range(5, n+1, 5))) def solve(n): return sum( filter(lambda x: x%3==0 or x%5==0, ...
Add gen exp solution to 1
Add gen exp solution to 1
Python
mit
dawran6/project-euler
from itertools import chain def threes_and_fives_gen(num=1000): for i in range(num): if i % 3 == 0 or i % 5 == 0: yield i def threes_and_fives_fun(n): return set(chain(range(3, n+1, 3), range(5, n+1, 5))) def solve(n): return sum( filter(lambda x: x%3==0 or x%5==0, ...
from itertools import chain def threes_and_fives_gen(num=1000): for i in range(num): if i % 3 == 0 or i % 5 == 0: yield i def threes_and_fives_fun(n): return set(chain(range(3, n+1, 3), range(5, n+1, 5))) def solve(n): return sum( filter(lambda x: x%3==0 or x%5==0, ...
<commit_before>from itertools import chain def threes_and_fives_gen(num=1000): for i in range(num): if i % 3 == 0 or i % 5 == 0: yield i def threes_and_fives_fun(n): return set(chain(range(3, n+1, 3), range(5, n+1, 5))) def solve(n): return sum( filter(lambda x: x%3==0 or x%5=...
from itertools import chain def threes_and_fives_gen(num=1000): for i in range(num): if i % 3 == 0 or i % 5 == 0: yield i def threes_and_fives_fun(n): return set(chain(range(3, n+1, 3), range(5, n+1, 5))) def solve(n): return sum( filter(lambda x: x%3==0 or x%5==0, ...
from itertools import chain def threes_and_fives_gen(num=1000): for i in range(num): if i % 3 == 0 or i % 5 == 0: yield i def threes_and_fives_fun(n): return set(chain(range(3, n+1, 3), range(5, n+1, 5))) def solve(n): return sum( filter(lambda x: x%3==0 or x%5==0, ...
<commit_before>from itertools import chain def threes_and_fives_gen(num=1000): for i in range(num): if i % 3 == 0 or i % 5 == 0: yield i def threes_and_fives_fun(n): return set(chain(range(3, n+1, 3), range(5, n+1, 5))) def solve(n): return sum( filter(lambda x: x%3==0 or x%5=...
ac8e58e1430ca7418f64bb547e3513032d5b49e8
tests/lexer_test.py
tests/lexer_test.py
from whitepy.lexerconstants import * import whitepy.lexer as lexer import unittest class TestLexer(unittest.TestCase): def _get_lexer(self, line): return lexer.Lexer(line=line) def _valid_ws(self): return self._get_lexer(" \t\n") def test_get_int(self): lexer = self._valid_ws(...
from nose.tools import * from whitepy.lexerconstants import * import unittest import whitepy.lexer as lexer class TestLexer(unittest.TestCase): def _get_lexer(self, line): return lexer.Lexer(line=line) def _sample_ws(self, ws_type): ws_samples = { 'valid': " \t\n", ...
Add test for invalid integer
Add test for invalid integer A valid integer in Whitesapce ends with '\n', if an invalid integer is found the code should raise a IntError exception. As part of this, I have renamed `_valid_ws()` to `_sample_ws()`, which now takes a argument for the type of whitespace needed.
Python
apache-2.0
yasn77/whitepy
from whitepy.lexerconstants import * import whitepy.lexer as lexer import unittest class TestLexer(unittest.TestCase): def _get_lexer(self, line): return lexer.Lexer(line=line) def _valid_ws(self): return self._get_lexer(" \t\n") def test_get_int(self): lexer = self._valid_ws(...
from nose.tools import * from whitepy.lexerconstants import * import unittest import whitepy.lexer as lexer class TestLexer(unittest.TestCase): def _get_lexer(self, line): return lexer.Lexer(line=line) def _sample_ws(self, ws_type): ws_samples = { 'valid': " \t\n", ...
<commit_before>from whitepy.lexerconstants import * import whitepy.lexer as lexer import unittest class TestLexer(unittest.TestCase): def _get_lexer(self, line): return lexer.Lexer(line=line) def _valid_ws(self): return self._get_lexer(" \t\n") def test_get_int(self): lexer = ...
from nose.tools import * from whitepy.lexerconstants import * import unittest import whitepy.lexer as lexer class TestLexer(unittest.TestCase): def _get_lexer(self, line): return lexer.Lexer(line=line) def _sample_ws(self, ws_type): ws_samples = { 'valid': " \t\n", ...
from whitepy.lexerconstants import * import whitepy.lexer as lexer import unittest class TestLexer(unittest.TestCase): def _get_lexer(self, line): return lexer.Lexer(line=line) def _valid_ws(self): return self._get_lexer(" \t\n") def test_get_int(self): lexer = self._valid_ws(...
<commit_before>from whitepy.lexerconstants import * import whitepy.lexer as lexer import unittest class TestLexer(unittest.TestCase): def _get_lexer(self, line): return lexer.Lexer(line=line) def _valid_ws(self): return self._get_lexer(" \t\n") def test_get_int(self): lexer = ...
53878700a4da22e80114ef67a4aee340846abf91
us_ignite/search/urls.py
us_ignite/search/urls.py
from django.conf.urls import patterns, url urlpatterns = patterns( 'us_ignite.search.views', url(r'apps/', 'search_apps', name='search_apps'), url(r'events/', 'search_events', name='search_events'), url(r'hubs/', 'search_hubs', name='search_hubs'), url(r'orgs/', 'search_organizations', name='searc...
from django.conf.urls import patterns, url urlpatterns = patterns( 'us_ignite.search.views', url(r'^apps/$', 'search_apps', name='search_apps'), url(r'^events/$', 'search_events', name='search_events'), url(r'^hubs/$', 'search_hubs', name='search_hubs'), url(r'^orgs/$', 'search_organizations', nam...
Fix broad regex for the ``search`` URLs.
Fix broad regex for the ``search`` URLs.
Python
bsd-3-clause
us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite
from django.conf.urls import patterns, url urlpatterns = patterns( 'us_ignite.search.views', url(r'apps/', 'search_apps', name='search_apps'), url(r'events/', 'search_events', name='search_events'), url(r'hubs/', 'search_hubs', name='search_hubs'), url(r'orgs/', 'search_organizations', name='searc...
from django.conf.urls import patterns, url urlpatterns = patterns( 'us_ignite.search.views', url(r'^apps/$', 'search_apps', name='search_apps'), url(r'^events/$', 'search_events', name='search_events'), url(r'^hubs/$', 'search_hubs', name='search_hubs'), url(r'^orgs/$', 'search_organizations', nam...
<commit_before>from django.conf.urls import patterns, url urlpatterns = patterns( 'us_ignite.search.views', url(r'apps/', 'search_apps', name='search_apps'), url(r'events/', 'search_events', name='search_events'), url(r'hubs/', 'search_hubs', name='search_hubs'), url(r'orgs/', 'search_organization...
from django.conf.urls import patterns, url urlpatterns = patterns( 'us_ignite.search.views', url(r'^apps/$', 'search_apps', name='search_apps'), url(r'^events/$', 'search_events', name='search_events'), url(r'^hubs/$', 'search_hubs', name='search_hubs'), url(r'^orgs/$', 'search_organizations', nam...
from django.conf.urls import patterns, url urlpatterns = patterns( 'us_ignite.search.views', url(r'apps/', 'search_apps', name='search_apps'), url(r'events/', 'search_events', name='search_events'), url(r'hubs/', 'search_hubs', name='search_hubs'), url(r'orgs/', 'search_organizations', name='searc...
<commit_before>from django.conf.urls import patterns, url urlpatterns = patterns( 'us_ignite.search.views', url(r'apps/', 'search_apps', name='search_apps'), url(r'events/', 'search_events', name='search_events'), url(r'hubs/', 'search_hubs', name='search_hubs'), url(r'orgs/', 'search_organization...
1d8fc0e63e5527b6f65da4899b432dcdfa243557
ava/text_to_speech/__init__.py
ava/text_to_speech/__init__.py
import time import os from tempfile import NamedTemporaryFile from sys import platform as _platform from gtts import gTTS from .playsound import playsound from ..queues import QueueTtS from ..components import _BaseComponent class TextToSpeech(_BaseComponent): def __init__(self): super().__init__() ...
import time import os from tempfile import NamedTemporaryFile from sys import platform as _platform from gtts import gTTS from .playsound import playsound from ..queues import QueueTtS from ..components import _BaseComponent class TextToSpeech(_BaseComponent): def __init__(self): super().__init__() ...
Allow user to use ava without TTS on Linux
Allow user to use ava without TTS on Linux
Python
mit
ava-project/AVA
import time import os from tempfile import NamedTemporaryFile from sys import platform as _platform from gtts import gTTS from .playsound import playsound from ..queues import QueueTtS from ..components import _BaseComponent class TextToSpeech(_BaseComponent): def __init__(self): super().__init__() ...
import time import os from tempfile import NamedTemporaryFile from sys import platform as _platform from gtts import gTTS from .playsound import playsound from ..queues import QueueTtS from ..components import _BaseComponent class TextToSpeech(_BaseComponent): def __init__(self): super().__init__() ...
<commit_before>import time import os from tempfile import NamedTemporaryFile from sys import platform as _platform from gtts import gTTS from .playsound import playsound from ..queues import QueueTtS from ..components import _BaseComponent class TextToSpeech(_BaseComponent): def __init__(self): super(...
import time import os from tempfile import NamedTemporaryFile from sys import platform as _platform from gtts import gTTS from .playsound import playsound from ..queues import QueueTtS from ..components import _BaseComponent class TextToSpeech(_BaseComponent): def __init__(self): super().__init__() ...
import time import os from tempfile import NamedTemporaryFile from sys import platform as _platform from gtts import gTTS from .playsound import playsound from ..queues import QueueTtS from ..components import _BaseComponent class TextToSpeech(_BaseComponent): def __init__(self): super().__init__() ...
<commit_before>import time import os from tempfile import NamedTemporaryFile from sys import platform as _platform from gtts import gTTS from .playsound import playsound from ..queues import QueueTtS from ..components import _BaseComponent class TextToSpeech(_BaseComponent): def __init__(self): super(...
f6194866a98dccdb8e1c1a1dfee40b11034461ba
src/nyct-json.py
src/nyct-json.py
#!/usr/bin/env python import json import settings import os import urllib2 from proto import gtfs_realtime_pb2 message = gtfs_realtime_pb2.FeedMessage() url = urllib2.urlopen('http://datamine.mta.info/mta_esi.php?key={0}&feed_id={1}'.format(settings.MTA_API_KEY, settings.MTA_FEED_ID)) message.ParseFromString(url.read...
#!/usr/bin/env python import json import settings import os import urllib2 from proto import gtfs_realtime_pb2 message = gtfs_realtime_pb2.FeedMessage() url = urllib2.urlopen('http://datamine.mta.info/mta_esi.php?key={0}&feed_id={1}'.format(settings.MTA_API_KEY, settings.MTA_FEED_ID)) message.ParseFromString(url.read...
Use a function to write.
Use a function to write.
Python
isc
natestedman/nyct-json,natestedman/nyct-json
#!/usr/bin/env python import json import settings import os import urllib2 from proto import gtfs_realtime_pb2 message = gtfs_realtime_pb2.FeedMessage() url = urllib2.urlopen('http://datamine.mta.info/mta_esi.php?key={0}&feed_id={1}'.format(settings.MTA_API_KEY, settings.MTA_FEED_ID)) message.ParseFromString(url.read...
#!/usr/bin/env python import json import settings import os import urllib2 from proto import gtfs_realtime_pb2 message = gtfs_realtime_pb2.FeedMessage() url = urllib2.urlopen('http://datamine.mta.info/mta_esi.php?key={0}&feed_id={1}'.format(settings.MTA_API_KEY, settings.MTA_FEED_ID)) message.ParseFromString(url.read...
<commit_before>#!/usr/bin/env python import json import settings import os import urllib2 from proto import gtfs_realtime_pb2 message = gtfs_realtime_pb2.FeedMessage() url = urllib2.urlopen('http://datamine.mta.info/mta_esi.php?key={0}&feed_id={1}'.format(settings.MTA_API_KEY, settings.MTA_FEED_ID)) message.ParseFrom...
#!/usr/bin/env python import json import settings import os import urllib2 from proto import gtfs_realtime_pb2 message = gtfs_realtime_pb2.FeedMessage() url = urllib2.urlopen('http://datamine.mta.info/mta_esi.php?key={0}&feed_id={1}'.format(settings.MTA_API_KEY, settings.MTA_FEED_ID)) message.ParseFromString(url.read...
#!/usr/bin/env python import json import settings import os import urllib2 from proto import gtfs_realtime_pb2 message = gtfs_realtime_pb2.FeedMessage() url = urllib2.urlopen('http://datamine.mta.info/mta_esi.php?key={0}&feed_id={1}'.format(settings.MTA_API_KEY, settings.MTA_FEED_ID)) message.ParseFromString(url.read...
<commit_before>#!/usr/bin/env python import json import settings import os import urllib2 from proto import gtfs_realtime_pb2 message = gtfs_realtime_pb2.FeedMessage() url = urllib2.urlopen('http://datamine.mta.info/mta_esi.php?key={0}&feed_id={1}'.format(settings.MTA_API_KEY, settings.MTA_FEED_ID)) message.ParseFrom...
e31192cf4989c1cef481eb92d6a91ae99dd8e5f5
src/pip/_internal/distributions/__init__.py
src/pip/_internal/distributions/__init__.py
from pip._internal.distributions.source import SourceDistribution from pip._internal.distributions.wheel import WheelDistribution from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: from pip._internal.distributions.base import AbstractDistribution from pip._internal.req.req_instal...
from pip._internal.distributions.source import SourceDistribution from pip._internal.distributions.wheel import WheelDistribution from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: from pip._internal.distributions.base import AbstractDistribution from pip._internal.req.req_instal...
Simplify conditional for choosing WheelDistribution
Simplify conditional for choosing WheelDistribution
Python
mit
xavfernandez/pip,pradyunsg/pip,rouge8/pip,rouge8/pip,sbidoul/pip,sbidoul/pip,pypa/pip,pfmoore/pip,pradyunsg/pip,xavfernandez/pip,pfmoore/pip,xavfernandez/pip,pypa/pip,rouge8/pip
from pip._internal.distributions.source import SourceDistribution from pip._internal.distributions.wheel import WheelDistribution from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: from pip._internal.distributions.base import AbstractDistribution from pip._internal.req.req_instal...
from pip._internal.distributions.source import SourceDistribution from pip._internal.distributions.wheel import WheelDistribution from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: from pip._internal.distributions.base import AbstractDistribution from pip._internal.req.req_instal...
<commit_before>from pip._internal.distributions.source import SourceDistribution from pip._internal.distributions.wheel import WheelDistribution from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: from pip._internal.distributions.base import AbstractDistribution from pip._internal...
from pip._internal.distributions.source import SourceDistribution from pip._internal.distributions.wheel import WheelDistribution from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: from pip._internal.distributions.base import AbstractDistribution from pip._internal.req.req_instal...
from pip._internal.distributions.source import SourceDistribution from pip._internal.distributions.wheel import WheelDistribution from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: from pip._internal.distributions.base import AbstractDistribution from pip._internal.req.req_instal...
<commit_before>from pip._internal.distributions.source import SourceDistribution from pip._internal.distributions.wheel import WheelDistribution from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: from pip._internal.distributions.base import AbstractDistribution from pip._internal...
26579d307d44f00fe71853fa6c13957018fe5c0f
capnp/__init__.py
capnp/__init__.py
"""A python library wrapping the Cap'n Proto C++ library Example Usage:: import capnp addressbook = capnp.load('addressbook.capnp') # Building addresses = addressbook.AddressBook.newMessage() people = addresses.init('people', 1) alice = people[0] alice.id = 123 alice.name = 'Ali...
"""A python library wrapping the Cap'n Proto C++ library Example Usage:: import capnp addressbook = capnp.load('addressbook.capnp') # Building addresses = addressbook.AddressBook.newMessage() people = addresses.init('people', 1) alice = people[0] alice.id = 123 alice.name = 'Ali...
Enable import hook by default
Enable import hook by default
Python
bsd-2-clause
rcrowder/pycapnp,SymbiFlow/pycapnp,jparyani/pycapnp,SymbiFlow/pycapnp,SymbiFlow/pycapnp,tempbottle/pycapnp,tempbottle/pycapnp,jparyani/pycapnp,rcrowder/pycapnp,SymbiFlow/pycapnp,jparyani/pycapnp,jparyani/pycapnp,tempbottle/pycapnp,rcrowder/pycapnp,rcrowder/pycapnp,tempbottle/pycapnp
"""A python library wrapping the Cap'n Proto C++ library Example Usage:: import capnp addressbook = capnp.load('addressbook.capnp') # Building addresses = addressbook.AddressBook.newMessage() people = addresses.init('people', 1) alice = people[0] alice.id = 123 alice.name = 'Ali...
"""A python library wrapping the Cap'n Proto C++ library Example Usage:: import capnp addressbook = capnp.load('addressbook.capnp') # Building addresses = addressbook.AddressBook.newMessage() people = addresses.init('people', 1) alice = people[0] alice.id = 123 alice.name = 'Ali...
<commit_before>"""A python library wrapping the Cap'n Proto C++ library Example Usage:: import capnp addressbook = capnp.load('addressbook.capnp') # Building addresses = addressbook.AddressBook.newMessage() people = addresses.init('people', 1) alice = people[0] alice.id = 123 al...
"""A python library wrapping the Cap'n Proto C++ library Example Usage:: import capnp addressbook = capnp.load('addressbook.capnp') # Building addresses = addressbook.AddressBook.newMessage() people = addresses.init('people', 1) alice = people[0] alice.id = 123 alice.name = 'Ali...
"""A python library wrapping the Cap'n Proto C++ library Example Usage:: import capnp addressbook = capnp.load('addressbook.capnp') # Building addresses = addressbook.AddressBook.newMessage() people = addresses.init('people', 1) alice = people[0] alice.id = 123 alice.name = 'Ali...
<commit_before>"""A python library wrapping the Cap'n Proto C++ library Example Usage:: import capnp addressbook = capnp.load('addressbook.capnp') # Building addresses = addressbook.AddressBook.newMessage() people = addresses.init('people', 1) alice = people[0] alice.id = 123 al...
003c7f9b7c6d35e176a9a4d5c56b61b0b4f96281
webapp/tests/__init__.py
webapp/tests/__init__.py
# -*- coding: utf-8 -*- from unittest import TestCase from byceps.application import create_app from byceps.blueprints.brand.models import Brand from byceps.blueprints.party.models import Party from byceps.database import db class AbstractAppTestCase(TestCase): def setUp(self): self.app = create_app('t...
# -*- coding: utf-8 -*- from unittest import TestCase from byceps.application import create_app from byceps.blueprints.brand.models import Brand from byceps.blueprints.party.models import Party from byceps.database import db class AbstractAppTestCase(TestCase): def setUp(self, env='test'): self.app = c...
Allow use of a custom environment for tests.
Allow use of a custom environment for tests.
Python
bsd-3-clause
m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps,m-ober/byceps
# -*- coding: utf-8 -*- from unittest import TestCase from byceps.application import create_app from byceps.blueprints.brand.models import Brand from byceps.blueprints.party.models import Party from byceps.database import db class AbstractAppTestCase(TestCase): def setUp(self): self.app = create_app('t...
# -*- coding: utf-8 -*- from unittest import TestCase from byceps.application import create_app from byceps.blueprints.brand.models import Brand from byceps.blueprints.party.models import Party from byceps.database import db class AbstractAppTestCase(TestCase): def setUp(self, env='test'): self.app = c...
<commit_before># -*- coding: utf-8 -*- from unittest import TestCase from byceps.application import create_app from byceps.blueprints.brand.models import Brand from byceps.blueprints.party.models import Party from byceps.database import db class AbstractAppTestCase(TestCase): def setUp(self): self.app ...
# -*- coding: utf-8 -*- from unittest import TestCase from byceps.application import create_app from byceps.blueprints.brand.models import Brand from byceps.blueprints.party.models import Party from byceps.database import db class AbstractAppTestCase(TestCase): def setUp(self, env='test'): self.app = c...
# -*- coding: utf-8 -*- from unittest import TestCase from byceps.application import create_app from byceps.blueprints.brand.models import Brand from byceps.blueprints.party.models import Party from byceps.database import db class AbstractAppTestCase(TestCase): def setUp(self): self.app = create_app('t...
<commit_before># -*- coding: utf-8 -*- from unittest import TestCase from byceps.application import create_app from byceps.blueprints.brand.models import Brand from byceps.blueprints.party.models import Party from byceps.database import db class AbstractAppTestCase(TestCase): def setUp(self): self.app ...
685365af5126c6e83db468eef24b008fc1526462
tools/game_utils.py
tools/game_utils.py
import scipy.misc import scipy.special def get_num_hole_card_combinations(game): num_players = game.get_num_players() num_hole_cards = game.get_num_hole_cards() num_cards = game.get_num_suits() * game.get_num_ranks() num_total_hole_cards = num_players * num_hole_cards return scipy.misc.comb(num_ca...
import numpy as np import scipy.misc import scipy.special from tools.walk_tree import walk_tree from tools.game_tree.nodes import ActionNode def get_num_hole_card_combinations(game): num_players = game.get_num_players() num_hole_cards = game.get_num_hole_cards() num_cards = game.get_num_suits() * game.ge...
Add method to verify that all strategy probabilities add to 1
Add method to verify that all strategy probabilities add to 1
Python
mit
JakubPetriska/poker-cfr,JakubPetriska/poker-cfr
import scipy.misc import scipy.special def get_num_hole_card_combinations(game): num_players = game.get_num_players() num_hole_cards = game.get_num_hole_cards() num_cards = game.get_num_suits() * game.get_num_ranks() num_total_hole_cards = num_players * num_hole_cards return scipy.misc.comb(num_ca...
import numpy as np import scipy.misc import scipy.special from tools.walk_tree import walk_tree from tools.game_tree.nodes import ActionNode def get_num_hole_card_combinations(game): num_players = game.get_num_players() num_hole_cards = game.get_num_hole_cards() num_cards = game.get_num_suits() * game.ge...
<commit_before>import scipy.misc import scipy.special def get_num_hole_card_combinations(game): num_players = game.get_num_players() num_hole_cards = game.get_num_hole_cards() num_cards = game.get_num_suits() * game.get_num_ranks() num_total_hole_cards = num_players * num_hole_cards return scipy.m...
import numpy as np import scipy.misc import scipy.special from tools.walk_tree import walk_tree from tools.game_tree.nodes import ActionNode def get_num_hole_card_combinations(game): num_players = game.get_num_players() num_hole_cards = game.get_num_hole_cards() num_cards = game.get_num_suits() * game.ge...
import scipy.misc import scipy.special def get_num_hole_card_combinations(game): num_players = game.get_num_players() num_hole_cards = game.get_num_hole_cards() num_cards = game.get_num_suits() * game.get_num_ranks() num_total_hole_cards = num_players * num_hole_cards return scipy.misc.comb(num_ca...
<commit_before>import scipy.misc import scipy.special def get_num_hole_card_combinations(game): num_players = game.get_num_players() num_hole_cards = game.get_num_hole_cards() num_cards = game.get_num_suits() * game.get_num_ranks() num_total_hole_cards = num_players * num_hole_cards return scipy.m...
4368567e44c144e85fa9fcdb72f2648c13eb8158
rest_framework_jsonp/renderers.py
rest_framework_jsonp/renderers.py
""" Provides JSONP rendering support. """ from __future__ import unicode_literals from rest_framework.renderers import JSONRenderer class JSONPRenderer(JSONRenderer): """ Renderer which serializes to json, wrapping the json output in a callback function. """ media_type = 'application/javascript'...
""" Provides JSONP rendering support. """ from __future__ import unicode_literals from rest_framework.renderers import JSONRenderer class JSONPRenderer(JSONRenderer): """ Renderer which serializes to json, wrapping the json output in a callback function. """ media_type = 'application/javascript'...
Update for compat w/ djangorestframework 3.2
Update for compat w/ djangorestframework 3.2 Change request.QUERY_PARAMS to request.query_params
Python
isc
baxrob/django-rest-framework-jsonp
""" Provides JSONP rendering support. """ from __future__ import unicode_literals from rest_framework.renderers import JSONRenderer class JSONPRenderer(JSONRenderer): """ Renderer which serializes to json, wrapping the json output in a callback function. """ media_type = 'application/javascript'...
""" Provides JSONP rendering support. """ from __future__ import unicode_literals from rest_framework.renderers import JSONRenderer class JSONPRenderer(JSONRenderer): """ Renderer which serializes to json, wrapping the json output in a callback function. """ media_type = 'application/javascript'...
<commit_before>""" Provides JSONP rendering support. """ from __future__ import unicode_literals from rest_framework.renderers import JSONRenderer class JSONPRenderer(JSONRenderer): """ Renderer which serializes to json, wrapping the json output in a callback function. """ media_type = 'applicat...
""" Provides JSONP rendering support. """ from __future__ import unicode_literals from rest_framework.renderers import JSONRenderer class JSONPRenderer(JSONRenderer): """ Renderer which serializes to json, wrapping the json output in a callback function. """ media_type = 'application/javascript'...
""" Provides JSONP rendering support. """ from __future__ import unicode_literals from rest_framework.renderers import JSONRenderer class JSONPRenderer(JSONRenderer): """ Renderer which serializes to json, wrapping the json output in a callback function. """ media_type = 'application/javascript'...
<commit_before>""" Provides JSONP rendering support. """ from __future__ import unicode_literals from rest_framework.renderers import JSONRenderer class JSONPRenderer(JSONRenderer): """ Renderer which serializes to json, wrapping the json output in a callback function. """ media_type = 'applicat...
d095277e1d54da6b9fcef7c5a79e86dc3f759e81
word-count/word_count.py
word-count/word_count.py
def word_count(s): words = strip_punc(s.lower()).split() return {word: words.count(word) for word in set(words)} def strip_punc(s): return "".join(ch if ch.isalnum() else " " for ch in s)
def word_count(s): words = strip_punc(s).lower().split() return {word: words.count(word) for word in set(words)} def strip_punc(s): return "".join(ch if ch.isalnum() else " " for ch in s)
Move .lower() method call for readability
Move .lower() method call for readability
Python
agpl-3.0
CubicComet/exercism-python-solutions
def word_count(s): words = strip_punc(s.lower()).split() return {word: words.count(word) for word in set(words)} def strip_punc(s): return "".join(ch if ch.isalnum() else " " for ch in s) Move .lower() method call for readability
def word_count(s): words = strip_punc(s).lower().split() return {word: words.count(word) for word in set(words)} def strip_punc(s): return "".join(ch if ch.isalnum() else " " for ch in s)
<commit_before>def word_count(s): words = strip_punc(s.lower()).split() return {word: words.count(word) for word in set(words)} def strip_punc(s): return "".join(ch if ch.isalnum() else " " for ch in s) <commit_msg>Move .lower() method call for readability<commit_after>
def word_count(s): words = strip_punc(s).lower().split() return {word: words.count(word) for word in set(words)} def strip_punc(s): return "".join(ch if ch.isalnum() else " " for ch in s)
def word_count(s): words = strip_punc(s.lower()).split() return {word: words.count(word) for word in set(words)} def strip_punc(s): return "".join(ch if ch.isalnum() else " " for ch in s) Move .lower() method call for readabilitydef word_count(s): words = strip_punc(s).lower().split() return {wor...
<commit_before>def word_count(s): words = strip_punc(s.lower()).split() return {word: words.count(word) for word in set(words)} def strip_punc(s): return "".join(ch if ch.isalnum() else " " for ch in s) <commit_msg>Move .lower() method call for readability<commit_after>def word_count(s): words = stri...
e9c32014093af49edc6a12b6db37b44a04d12892
test/integration/ggrc_workflows/__init__.py
test/integration/ggrc_workflows/__init__.py
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: [email protected] # Maintained By: [email protected]
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: [email protected] # Maintained By: [email protected] from integration.ggrc import TestCase from integration.ggrc_workflows.generator i...
Add WorkflowTestCase to integration tests
Add WorkflowTestCase to integration tests
Python
apache-2.0
josthkko/ggrc-core,plamut/ggrc-core,selahssea/ggrc-core,VinnieJohns/ggrc-core,VinnieJohns/ggrc-core,selahssea/ggrc-core,j0gurt/ggrc-core,NejcZupec/ggrc-core,VinnieJohns/ggrc-core,edofic/ggrc-core,kr41/ggrc-core,selahssea/ggrc-core,j0gurt/ggrc-core,plamut/ggrc-core,AleksNeStu/ggrc-core,andrei-karalionak/ggrc-core,selahs...
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: [email protected] # Maintained By: [email protected] Add WorkflowTestCase to integration tests
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: [email protected] # Maintained By: [email protected] from integration.ggrc import TestCase from integration.ggrc_workflows.generator i...
<commit_before># Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: [email protected] # Maintained By: [email protected] <commit_msg>Add WorkflowTestCase to integration tests<commit_after...
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: [email protected] # Maintained By: [email protected] from integration.ggrc import TestCase from integration.ggrc_workflows.generator i...
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: [email protected] # Maintained By: [email protected] Add WorkflowTestCase to integration tests# Copyright (C) 2015 Google Inc., author...
<commit_before># Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: [email protected] # Maintained By: [email protected] <commit_msg>Add WorkflowTestCase to integration tests<commit_after...
edae3aa862d6266ee1f2f96a2427e88af994f590
Nested_list.py
Nested_list.py
''' Given the names and grades for each student in a Physics class of N students, store them in a nested list and print the name(s) of any student(s) having the second lowest grade. Note: If there are multiple students with the same grade, order their names alphabetically and print each name on a new line. By HackerR...
''' Given the names and grades for each student in a Physics class of N students, store them in a nested list and print the name(s) of any student(s) having the second lowest grade. Note: If there are multiple students with the same grade, order their names alphabetically and print each name on a new line. By HackerR...
Fix indentation for break keyword.
Fix indentation for break keyword.
Python
unlicense
jasielserra/PythonDevs
''' Given the names and grades for each student in a Physics class of N students, store them in a nested list and print the name(s) of any student(s) having the second lowest grade. Note: If there are multiple students with the same grade, order their names alphabetically and print each name on a new line. By HackerR...
''' Given the names and grades for each student in a Physics class of N students, store them in a nested list and print the name(s) of any student(s) having the second lowest grade. Note: If there are multiple students with the same grade, order their names alphabetically and print each name on a new line. By HackerR...
<commit_before>''' Given the names and grades for each student in a Physics class of N students, store them in a nested list and print the name(s) of any student(s) having the second lowest grade. Note: If there are multiple students with the same grade, order their names alphabetically and print each name on a new li...
''' Given the names and grades for each student in a Physics class of N students, store them in a nested list and print the name(s) of any student(s) having the second lowest grade. Note: If there are multiple students with the same grade, order their names alphabetically and print each name on a new line. By HackerR...
''' Given the names and grades for each student in a Physics class of N students, store them in a nested list and print the name(s) of any student(s) having the second lowest grade. Note: If there are multiple students with the same grade, order their names alphabetically and print each name on a new line. By HackerR...
<commit_before>''' Given the names and grades for each student in a Physics class of N students, store them in a nested list and print the name(s) of any student(s) having the second lowest grade. Note: If there are multiple students with the same grade, order their names alphabetically and print each name on a new li...
7d43df8d861b73ffb7c5e11531f3848a248bcc6a
trial_search_app.py
trial_search_app.py
from flask import Flask, render_template from flask_bootstrap import Bootstrap from flask_nav import Nav from flask_wtf import FlaskForm from wtforms import StringField from wtforms.validators import DataRequired class SimpleSearchForm(FlaskForm): nct_id = StringField('nct_id', validators=[DataRequired()]) impo...
from flask import Flask, render_template, redirect, url_for from flask_bootstrap import Bootstrap from flask_nav import Nav from flask_wtf import FlaskForm from wtforms import StringField from wtforms.validators import DataRequired class SimpleSearchForm(FlaskForm): nct_id = StringField('nct_id', validators=[Dat...
Correct redirect after search from submission
Correct redirect after search from submission
Python
apache-2.0
hniedner/ctrp_rest_client,hniedner/ctrp_rest_client,hniedner/ctrp_rest_client
from flask import Flask, render_template from flask_bootstrap import Bootstrap from flask_nav import Nav from flask_wtf import FlaskForm from wtforms import StringField from wtforms.validators import DataRequired class SimpleSearchForm(FlaskForm): nct_id = StringField('nct_id', validators=[DataRequired()]) impo...
from flask import Flask, render_template, redirect, url_for from flask_bootstrap import Bootstrap from flask_nav import Nav from flask_wtf import FlaskForm from wtforms import StringField from wtforms.validators import DataRequired class SimpleSearchForm(FlaskForm): nct_id = StringField('nct_id', validators=[Dat...
<commit_before>from flask import Flask, render_template from flask_bootstrap import Bootstrap from flask_nav import Nav from flask_wtf import FlaskForm from wtforms import StringField from wtforms.validators import DataRequired class SimpleSearchForm(FlaskForm): nct_id = StringField('nct_id', validators=[DataReq...
from flask import Flask, render_template, redirect, url_for from flask_bootstrap import Bootstrap from flask_nav import Nav from flask_wtf import FlaskForm from wtforms import StringField from wtforms.validators import DataRequired class SimpleSearchForm(FlaskForm): nct_id = StringField('nct_id', validators=[Dat...
from flask import Flask, render_template from flask_bootstrap import Bootstrap from flask_nav import Nav from flask_wtf import FlaskForm from wtforms import StringField from wtforms.validators import DataRequired class SimpleSearchForm(FlaskForm): nct_id = StringField('nct_id', validators=[DataRequired()]) impo...
<commit_before>from flask import Flask, render_template from flask_bootstrap import Bootstrap from flask_nav import Nav from flask_wtf import FlaskForm from wtforms import StringField from wtforms.validators import DataRequired class SimpleSearchForm(FlaskForm): nct_id = StringField('nct_id', validators=[DataReq...
606cb3475e2e4220822f924d13881dfaefb51aa4
teryt_tree/rest_framework_ext/viewsets.py
teryt_tree/rest_framework_ext/viewsets.py
import django_filters from django.shortcuts import get_object_or_404 try: from django_filters import rest_framework as filters except ImportError: # Back-ward compatible for django-rest-framework<3.7 from rest_framework import filters from rest_framework import viewsets from teryt_tree.models import JednostkaA...
import django_filters from django.shortcuts import get_object_or_404 from django.utils.translation import ugettext_lazy as _ try: from django_filters import rest_framework as filters except ImportError: # Back-ward compatible for django-rest-framework<3.7 from rest_framework import filters from rest_framework...
Update JednostkaAdministracyjnaFilter for new django-filters
Update JednostkaAdministracyjnaFilter for new django-filters
Python
bsd-3-clause
ad-m/django-teryt-tree
import django_filters from django.shortcuts import get_object_or_404 try: from django_filters import rest_framework as filters except ImportError: # Back-ward compatible for django-rest-framework<3.7 from rest_framework import filters from rest_framework import viewsets from teryt_tree.models import JednostkaA...
import django_filters from django.shortcuts import get_object_or_404 from django.utils.translation import ugettext_lazy as _ try: from django_filters import rest_framework as filters except ImportError: # Back-ward compatible for django-rest-framework<3.7 from rest_framework import filters from rest_framework...
<commit_before>import django_filters from django.shortcuts import get_object_or_404 try: from django_filters import rest_framework as filters except ImportError: # Back-ward compatible for django-rest-framework<3.7 from rest_framework import filters from rest_framework import viewsets from teryt_tree.models im...
import django_filters from django.shortcuts import get_object_or_404 from django.utils.translation import ugettext_lazy as _ try: from django_filters import rest_framework as filters except ImportError: # Back-ward compatible for django-rest-framework<3.7 from rest_framework import filters from rest_framework...
import django_filters from django.shortcuts import get_object_or_404 try: from django_filters import rest_framework as filters except ImportError: # Back-ward compatible for django-rest-framework<3.7 from rest_framework import filters from rest_framework import viewsets from teryt_tree.models import JednostkaA...
<commit_before>import django_filters from django.shortcuts import get_object_or_404 try: from django_filters import rest_framework as filters except ImportError: # Back-ward compatible for django-rest-framework<3.7 from rest_framework import filters from rest_framework import viewsets from teryt_tree.models im...
1090acb35ea4ce5c8d17db716539d3354feabc12
nodeconductor/iaas/migrations/0038_securitygroup_state.py
nodeconductor/iaas/migrations/0038_securitygroup_state.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django_fsm class Migration(migrations.Migration): dependencies = [ ('iaas', '0037_init_security_groups_quotas'), ] operations = [ migrations.AddField( model_name='...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django_fsm def mark_security_groups_as_synced(apps, schema_editor): SecurityGroup = apps.get_model('iaas', 'SecurityGroup') SecurityGroup.objects.all().update(state=3) class Migration(migrations....
Mark all exist security groups as synced
Mark all exist security groups as synced - itacloud-4843
Python
mit
opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django_fsm class Migration(migrations.Migration): dependencies = [ ('iaas', '0037_init_security_groups_quotas'), ] operations = [ migrations.AddField( model_name='...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django_fsm def mark_security_groups_as_synced(apps, schema_editor): SecurityGroup = apps.get_model('iaas', 'SecurityGroup') SecurityGroup.objects.all().update(state=3) class Migration(migrations....
<commit_before># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django_fsm class Migration(migrations.Migration): dependencies = [ ('iaas', '0037_init_security_groups_quotas'), ] operations = [ migrations.AddField( ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django_fsm def mark_security_groups_as_synced(apps, schema_editor): SecurityGroup = apps.get_model('iaas', 'SecurityGroup') SecurityGroup.objects.all().update(state=3) class Migration(migrations....
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django_fsm class Migration(migrations.Migration): dependencies = [ ('iaas', '0037_init_security_groups_quotas'), ] operations = [ migrations.AddField( model_name='...
<commit_before># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django_fsm class Migration(migrations.Migration): dependencies = [ ('iaas', '0037_init_security_groups_quotas'), ] operations = [ migrations.AddField( ...
3e6e485443a901660a461dbbc8b324bfe4c19c8f
tests/v5/conftest.py
tests/v5/conftest.py
import pytest from .context import tohu from tohu.v5.primitive_generators import * EXEMPLAR_GENERATORS = [ Constant("quux"), Boolean(p=0.3), ] @pytest.fixture def exemplar_generators(): """ Return a list of generators which contains an example for each type of generator supported by tohu. "...
import pytest from .context import tohu from tohu.v5.primitive_generators import * EXEMPLAR_PRIMITIVE_GENERATORS = [ Constant("quux"), Boolean(p=0.3), ] @pytest.fixture def exemplar_generators(): """ Return a list of generators which contains an example for each type of generator supported by t...
Add fixture for exemplar primitive generators
Add fixture for exemplar primitive generators
Python
mit
maxalbert/tohu
import pytest from .context import tohu from tohu.v5.primitive_generators import * EXEMPLAR_GENERATORS = [ Constant("quux"), Boolean(p=0.3), ] @pytest.fixture def exemplar_generators(): """ Return a list of generators which contains an example for each type of generator supported by tohu. "...
import pytest from .context import tohu from tohu.v5.primitive_generators import * EXEMPLAR_PRIMITIVE_GENERATORS = [ Constant("quux"), Boolean(p=0.3), ] @pytest.fixture def exemplar_generators(): """ Return a list of generators which contains an example for each type of generator supported by t...
<commit_before>import pytest from .context import tohu from tohu.v5.primitive_generators import * EXEMPLAR_GENERATORS = [ Constant("quux"), Boolean(p=0.3), ] @pytest.fixture def exemplar_generators(): """ Return a list of generators which contains an example for each type of generator supported...
import pytest from .context import tohu from tohu.v5.primitive_generators import * EXEMPLAR_PRIMITIVE_GENERATORS = [ Constant("quux"), Boolean(p=0.3), ] @pytest.fixture def exemplar_generators(): """ Return a list of generators which contains an example for each type of generator supported by t...
import pytest from .context import tohu from tohu.v5.primitive_generators import * EXEMPLAR_GENERATORS = [ Constant("quux"), Boolean(p=0.3), ] @pytest.fixture def exemplar_generators(): """ Return a list of generators which contains an example for each type of generator supported by tohu. "...
<commit_before>import pytest from .context import tohu from tohu.v5.primitive_generators import * EXEMPLAR_GENERATORS = [ Constant("quux"), Boolean(p=0.3), ] @pytest.fixture def exemplar_generators(): """ Return a list of generators which contains an example for each type of generator supported...
5d44a67c1e416f8024bac1cbef5f3b3516ffd42a
cms_shiny/urls.py
cms_shiny/urls.py
from django.conf.urls import patterns, url from cms_shiny.views import ShinyAppListView, ShinyAppDetailView urlpatterns = patterns('', url(r'^$', ShinyAppListView.as_view(), name='shiny_list'), url(r'^(?P<slug>[^/]+)$', ShinyAppDetailView.as_view(), name='shiny_detail'), )
from django.conf.urls import patterns, url from cms_shiny.views import ShinyAppListView, ShinyAppDetailView urlpatterns = patterns('', url(r'^$', ShinyAppListView.as_view(), name='shiny_list'), url(r'^(?P<slug>[^/]+)/$', ShinyAppDetailView.as_view(), name='shiny_detail'), )
Append trailing slash to detail URL
Append trailing slash to detail URL
Python
bsd-3-clause
mfcovington/djangocms-shiny-app,mfcovington/djangocms-shiny-app,mfcovington/djangocms-shiny-app
from django.conf.urls import patterns, url from cms_shiny.views import ShinyAppListView, ShinyAppDetailView urlpatterns = patterns('', url(r'^$', ShinyAppListView.as_view(), name='shiny_list'), url(r'^(?P<slug>[^/]+)$', ShinyAppDetailView.as_view(), name='shiny_detail'), ) Append trailing slash to detail URL
from django.conf.urls import patterns, url from cms_shiny.views import ShinyAppListView, ShinyAppDetailView urlpatterns = patterns('', url(r'^$', ShinyAppListView.as_view(), name='shiny_list'), url(r'^(?P<slug>[^/]+)/$', ShinyAppDetailView.as_view(), name='shiny_detail'), )
<commit_before>from django.conf.urls import patterns, url from cms_shiny.views import ShinyAppListView, ShinyAppDetailView urlpatterns = patterns('', url(r'^$', ShinyAppListView.as_view(), name='shiny_list'), url(r'^(?P<slug>[^/]+)$', ShinyAppDetailView.as_view(), name='shiny_detail'), ) <commit_msg>Append tra...
from django.conf.urls import patterns, url from cms_shiny.views import ShinyAppListView, ShinyAppDetailView urlpatterns = patterns('', url(r'^$', ShinyAppListView.as_view(), name='shiny_list'), url(r'^(?P<slug>[^/]+)/$', ShinyAppDetailView.as_view(), name='shiny_detail'), )
from django.conf.urls import patterns, url from cms_shiny.views import ShinyAppListView, ShinyAppDetailView urlpatterns = patterns('', url(r'^$', ShinyAppListView.as_view(), name='shiny_list'), url(r'^(?P<slug>[^/]+)$', ShinyAppDetailView.as_view(), name='shiny_detail'), ) Append trailing slash to detail URLfr...
<commit_before>from django.conf.urls import patterns, url from cms_shiny.views import ShinyAppListView, ShinyAppDetailView urlpatterns = patterns('', url(r'^$', ShinyAppListView.as_view(), name='shiny_list'), url(r'^(?P<slug>[^/]+)$', ShinyAppDetailView.as_view(), name='shiny_detail'), ) <commit_msg>Append tra...
0d302a13475b4e8ae073cad8c667019419a6a7e8
vdb/zika_download.py
vdb/zika_download.py
import os,datetime from download import download from download import get_parser class zika_download(download): def __init__(self, **kwargs): download.__init__(self, **kwargs) if __name__=="__main__": parser = get_parser() args = parser.parse_args() fasta_fields = ['strain', 'virus', 'accessio...
import os,datetime from download import download from download import get_parser class zika_download(download): def __init__(self, **kwargs): download.__init__(self, **kwargs) if __name__=="__main__": parser = get_parser() args = parser.parse_args() fasta_fields = ['strain', 'virus', 'accessio...
Remove lat/long from zika download
Remove lat/long from zika download
Python
agpl-3.0
nextstrain/fauna,blab/nextstrain-db,blab/nextstrain-db,nextstrain/fauna
import os,datetime from download import download from download import get_parser class zika_download(download): def __init__(self, **kwargs): download.__init__(self, **kwargs) if __name__=="__main__": parser = get_parser() args = parser.parse_args() fasta_fields = ['strain', 'virus', 'accessio...
import os,datetime from download import download from download import get_parser class zika_download(download): def __init__(self, **kwargs): download.__init__(self, **kwargs) if __name__=="__main__": parser = get_parser() args = parser.parse_args() fasta_fields = ['strain', 'virus', 'accessio...
<commit_before>import os,datetime from download import download from download import get_parser class zika_download(download): def __init__(self, **kwargs): download.__init__(self, **kwargs) if __name__=="__main__": parser = get_parser() args = parser.parse_args() fasta_fields = ['strain', 'vi...
import os,datetime from download import download from download import get_parser class zika_download(download): def __init__(self, **kwargs): download.__init__(self, **kwargs) if __name__=="__main__": parser = get_parser() args = parser.parse_args() fasta_fields = ['strain', 'virus', 'accessio...
import os,datetime from download import download from download import get_parser class zika_download(download): def __init__(self, **kwargs): download.__init__(self, **kwargs) if __name__=="__main__": parser = get_parser() args = parser.parse_args() fasta_fields = ['strain', 'virus', 'accessio...
<commit_before>import os,datetime from download import download from download import get_parser class zika_download(download): def __init__(self, **kwargs): download.__init__(self, **kwargs) if __name__=="__main__": parser = get_parser() args = parser.parse_args() fasta_fields = ['strain', 'vi...
f946ca92b74bb945c3884fcfa3e515132ec56b06
virtool/processes.py
virtool/processes.py
STEP_COUNTS = { "import_reference": 0, "setup_remote_reference": 0, "update_remote_reference": 0, "update_software": 0, "install_hmms": 0 } FIRST_STEPS = { "import_reference": "load_file", "setup_remote_reference": "", "update_remote_reference": "", "update_software": "", "insta...
STEP_COUNTS = { "import_reference": 0, "setup_remote_reference": 0, "update_remote_reference": 0, "update_software": 0, "install_hmms": 0 } FIRST_STEPS = { "import_reference": "load_file", "setup_remote_reference": "", "update_remote_reference": "", "update_software": "", "insta...
Add ProgressTracker class for tracking progress in long operations
Add ProgressTracker class for tracking progress in long operations
Python
mit
virtool/virtool,igboyes/virtool,igboyes/virtool,virtool/virtool
STEP_COUNTS = { "import_reference": 0, "setup_remote_reference": 0, "update_remote_reference": 0, "update_software": 0, "install_hmms": 0 } FIRST_STEPS = { "import_reference": "load_file", "setup_remote_reference": "", "update_remote_reference": "", "update_software": "", "insta...
STEP_COUNTS = { "import_reference": 0, "setup_remote_reference": 0, "update_remote_reference": 0, "update_software": 0, "install_hmms": 0 } FIRST_STEPS = { "import_reference": "load_file", "setup_remote_reference": "", "update_remote_reference": "", "update_software": "", "insta...
<commit_before>STEP_COUNTS = { "import_reference": 0, "setup_remote_reference": 0, "update_remote_reference": 0, "update_software": 0, "install_hmms": 0 } FIRST_STEPS = { "import_reference": "load_file", "setup_remote_reference": "", "update_remote_reference": "", "update_software":...
STEP_COUNTS = { "import_reference": 0, "setup_remote_reference": 0, "update_remote_reference": 0, "update_software": 0, "install_hmms": 0 } FIRST_STEPS = { "import_reference": "load_file", "setup_remote_reference": "", "update_remote_reference": "", "update_software": "", "insta...
STEP_COUNTS = { "import_reference": 0, "setup_remote_reference": 0, "update_remote_reference": 0, "update_software": 0, "install_hmms": 0 } FIRST_STEPS = { "import_reference": "load_file", "setup_remote_reference": "", "update_remote_reference": "", "update_software": "", "insta...
<commit_before>STEP_COUNTS = { "import_reference": 0, "setup_remote_reference": 0, "update_remote_reference": 0, "update_software": 0, "install_hmms": 0 } FIRST_STEPS = { "import_reference": "load_file", "setup_remote_reference": "", "update_remote_reference": "", "update_software":...
63c0cd90ff9e9a721b175cdd4af8dc52ed6412ad
flatkeys/__init__.py
flatkeys/__init__.py
# -*- coding: UTF-8 -*- __version__ = '0.1.0' def flatkeys(d, sep="."): """ Flatten a dictionary: build a new dictionary from a given one where all non-dict values are left untouched but nested ``dict``s are recursively merged in the new one with their keys prefixed by their parent key. >>> flat...
# -*- coding: UTF-8 -*- import collections __version__ = '0.1.0' def flatkeys(d, sep="."): """ Flatten a dictionary: build a new dictionary from a given one where all non-dict values are left untouched but nested ``dict``s are recursively merged in the new one with their keys prefixed by their parent...
Use isinstance check so library can be used for more types
Use isinstance check so library can be used for more types
Python
mit
bfontaine/flatkeys
# -*- coding: UTF-8 -*- __version__ = '0.1.0' def flatkeys(d, sep="."): """ Flatten a dictionary: build a new dictionary from a given one where all non-dict values are left untouched but nested ``dict``s are recursively merged in the new one with their keys prefixed by their parent key. >>> flat...
# -*- coding: UTF-8 -*- import collections __version__ = '0.1.0' def flatkeys(d, sep="."): """ Flatten a dictionary: build a new dictionary from a given one where all non-dict values are left untouched but nested ``dict``s are recursively merged in the new one with their keys prefixed by their parent...
<commit_before># -*- coding: UTF-8 -*- __version__ = '0.1.0' def flatkeys(d, sep="."): """ Flatten a dictionary: build a new dictionary from a given one where all non-dict values are left untouched but nested ``dict``s are recursively merged in the new one with their keys prefixed by their parent key...
# -*- coding: UTF-8 -*- import collections __version__ = '0.1.0' def flatkeys(d, sep="."): """ Flatten a dictionary: build a new dictionary from a given one where all non-dict values are left untouched but nested ``dict``s are recursively merged in the new one with their keys prefixed by their parent...
# -*- coding: UTF-8 -*- __version__ = '0.1.0' def flatkeys(d, sep="."): """ Flatten a dictionary: build a new dictionary from a given one where all non-dict values are left untouched but nested ``dict``s are recursively merged in the new one with their keys prefixed by their parent key. >>> flat...
<commit_before># -*- coding: UTF-8 -*- __version__ = '0.1.0' def flatkeys(d, sep="."): """ Flatten a dictionary: build a new dictionary from a given one where all non-dict values are left untouched but nested ``dict``s are recursively merged in the new one with their keys prefixed by their parent key...
df04444b3932f7481562dde62c7ae1f8ffb8bd7e
webapp/controllers/contact.py
webapp/controllers/contact.py
# -*- coding: utf-8 -*- ### required - do no delete def user(): return dict(form=auth()) def download(): return response.download(request,db) def call(): return service() ### end requires def index(): return dict()
# -*- coding: utf-8 -*- from opentreewebapputil import (get_opentree_services_method_urls, fetch_current_TNRS_context_names) ### required - do no delete def user(): return dict(form=auth()) def download(): return response.download(request,db) def call(): return service() ### end requir...
Fix missing search-context list on Contact page.
Fix missing search-context list on Contact page.
Python
bsd-2-clause
OpenTreeOfLife/opentree,OpenTreeOfLife/opentree,OpenTreeOfLife/opentree,OpenTreeOfLife/opentree,OpenTreeOfLife/opentree,OpenTreeOfLife/opentree
# -*- coding: utf-8 -*- ### required - do no delete def user(): return dict(form=auth()) def download(): return response.download(request,db) def call(): return service() ### end requires def index(): return dict() Fix missing search-context list on Contact page.
# -*- coding: utf-8 -*- from opentreewebapputil import (get_opentree_services_method_urls, fetch_current_TNRS_context_names) ### required - do no delete def user(): return dict(form=auth()) def download(): return response.download(request,db) def call(): return service() ### end requir...
<commit_before># -*- coding: utf-8 -*- ### required - do no delete def user(): return dict(form=auth()) def download(): return response.download(request,db) def call(): return service() ### end requires def index(): return dict() <commit_msg>Fix missing search-context list on Contact page.<commit_after>
# -*- coding: utf-8 -*- from opentreewebapputil import (get_opentree_services_method_urls, fetch_current_TNRS_context_names) ### required - do no delete def user(): return dict(form=auth()) def download(): return response.download(request,db) def call(): return service() ### end requir...
# -*- coding: utf-8 -*- ### required - do no delete def user(): return dict(form=auth()) def download(): return response.download(request,db) def call(): return service() ### end requires def index(): return dict() Fix missing search-context list on Contact page.# -*- coding: utf-8 -*- from opentreewebapputil im...
<commit_before># -*- coding: utf-8 -*- ### required - do no delete def user(): return dict(form=auth()) def download(): return response.download(request,db) def call(): return service() ### end requires def index(): return dict() <commit_msg>Fix missing search-context list on Contact page.<commit_after># -*- cod...
d4607cec7bc4fb4bcfc601fc8f1c35ea93131d3d
generate_c_arrays.py
generate_c_arrays.py
"""Generates color arrays for use in a C project. This scipt generates a dump of array/color data for use in a A project. This simplifies the need to hand-create and edit the data in many projects. This is useful, for instance, with Arduino projects. """ # Module imports import glowcolors.encode import glowcolors.mes...
"""Generates color arrays for use in a C project. This scipt generates a dump of array/color data for use in a A project. This simplifies the need to hand-create and edit the data in many projects. This is useful, for instance, with Arduino projects. """ # Module imports import glowcolors.encode import glowcolors.mes...
Fix for generate colors py
Fix for generate colors py
Python
mit
evilsoapbox/GlowColors
"""Generates color arrays for use in a C project. This scipt generates a dump of array/color data for use in a A project. This simplifies the need to hand-create and edit the data in many projects. This is useful, for instance, with Arduino projects. """ # Module imports import glowcolors.encode import glowcolors.mes...
"""Generates color arrays for use in a C project. This scipt generates a dump of array/color data for use in a A project. This simplifies the need to hand-create and edit the data in many projects. This is useful, for instance, with Arduino projects. """ # Module imports import glowcolors.encode import glowcolors.mes...
<commit_before>"""Generates color arrays for use in a C project. This scipt generates a dump of array/color data for use in a A project. This simplifies the need to hand-create and edit the data in many projects. This is useful, for instance, with Arduino projects. """ # Module imports import glowcolors.encode import...
"""Generates color arrays for use in a C project. This scipt generates a dump of array/color data for use in a A project. This simplifies the need to hand-create and edit the data in many projects. This is useful, for instance, with Arduino projects. """ # Module imports import glowcolors.encode import glowcolors.mes...
"""Generates color arrays for use in a C project. This scipt generates a dump of array/color data for use in a A project. This simplifies the need to hand-create and edit the data in many projects. This is useful, for instance, with Arduino projects. """ # Module imports import glowcolors.encode import glowcolors.mes...
<commit_before>"""Generates color arrays for use in a C project. This scipt generates a dump of array/color data for use in a A project. This simplifies the need to hand-create and edit the data in many projects. This is useful, for instance, with Arduino projects. """ # Module imports import glowcolors.encode import...
721f9d02645ba91c542e9eba243ddb617db0975e
Steamworks.NET_CodeGen.py
Steamworks.NET_CodeGen.py
import sys from SteamworksParser import steamworksparser import interfaces import constants import enums import structs def main(): if len(sys.argv) != 2: print("TODO: Usage Instructions") return steamworksparser.Settings.fake_gameserver_interfaces = True ___parser = steamworksparser.parse...
import sys from SteamworksParser import steamworksparser import interfaces import constants import enums import structs import typedefs def main(): if len(sys.argv) != 2: print("TODO: Usage Instructions") return steamworksparser.Settings.fake_gameserver_interfaces = True ___parser = steamw...
Add typedef generation to the main script
Add typedef generation to the main script
Python
mit
rlabrecque/Steamworks.NET-CodeGen,rlabrecque/Steamworks.NET-CodeGen,rlabrecque/Steamworks.NET-CodeGen,rlabrecque/Steamworks.NET-CodeGen
import sys from SteamworksParser import steamworksparser import interfaces import constants import enums import structs def main(): if len(sys.argv) != 2: print("TODO: Usage Instructions") return steamworksparser.Settings.fake_gameserver_interfaces = True ___parser = steamworksparser.parse...
import sys from SteamworksParser import steamworksparser import interfaces import constants import enums import structs import typedefs def main(): if len(sys.argv) != 2: print("TODO: Usage Instructions") return steamworksparser.Settings.fake_gameserver_interfaces = True ___parser = steamw...
<commit_before>import sys from SteamworksParser import steamworksparser import interfaces import constants import enums import structs def main(): if len(sys.argv) != 2: print("TODO: Usage Instructions") return steamworksparser.Settings.fake_gameserver_interfaces = True ___parser = steamwo...
import sys from SteamworksParser import steamworksparser import interfaces import constants import enums import structs import typedefs def main(): if len(sys.argv) != 2: print("TODO: Usage Instructions") return steamworksparser.Settings.fake_gameserver_interfaces = True ___parser = steamw...
import sys from SteamworksParser import steamworksparser import interfaces import constants import enums import structs def main(): if len(sys.argv) != 2: print("TODO: Usage Instructions") return steamworksparser.Settings.fake_gameserver_interfaces = True ___parser = steamworksparser.parse...
<commit_before>import sys from SteamworksParser import steamworksparser import interfaces import constants import enums import structs def main(): if len(sys.argv) != 2: print("TODO: Usage Instructions") return steamworksparser.Settings.fake_gameserver_interfaces = True ___parser = steamwo...
555d441053731957f9648e835e4dbbd686f2f7e5
whack/operations.py
whack/operations.py
import os from catchy import HttpCacher, DirectoryCacher, NoCachingStrategy from .installer import Installer from .sources import PackageSourceFetcher from .providers import CachingPackageProvider from .deployer import PackageDeployer def create(caching): if not caching.enabled: cacher = NoCachingStrate...
import os from catchy import HttpCacher, xdg_directory_cacher, NoCachingStrategy from .installer import Installer from .sources import PackageSourceFetcher from .providers import CachingPackageProvider from .deployer import PackageDeployer def create(caching): if not caching.enabled: cacher = NoCachingS...
Use XDG directory for caching
Use XDG directory for caching
Python
bsd-2-clause
mwilliamson/whack
import os from catchy import HttpCacher, DirectoryCacher, NoCachingStrategy from .installer import Installer from .sources import PackageSourceFetcher from .providers import CachingPackageProvider from .deployer import PackageDeployer def create(caching): if not caching.enabled: cacher = NoCachingStrate...
import os from catchy import HttpCacher, xdg_directory_cacher, NoCachingStrategy from .installer import Installer from .sources import PackageSourceFetcher from .providers import CachingPackageProvider from .deployer import PackageDeployer def create(caching): if not caching.enabled: cacher = NoCachingS...
<commit_before>import os from catchy import HttpCacher, DirectoryCacher, NoCachingStrategy from .installer import Installer from .sources import PackageSourceFetcher from .providers import CachingPackageProvider from .deployer import PackageDeployer def create(caching): if not caching.enabled: cacher = ...
import os from catchy import HttpCacher, xdg_directory_cacher, NoCachingStrategy from .installer import Installer from .sources import PackageSourceFetcher from .providers import CachingPackageProvider from .deployer import PackageDeployer def create(caching): if not caching.enabled: cacher = NoCachingS...
import os from catchy import HttpCacher, DirectoryCacher, NoCachingStrategy from .installer import Installer from .sources import PackageSourceFetcher from .providers import CachingPackageProvider from .deployer import PackageDeployer def create(caching): if not caching.enabled: cacher = NoCachingStrate...
<commit_before>import os from catchy import HttpCacher, DirectoryCacher, NoCachingStrategy from .installer import Installer from .sources import PackageSourceFetcher from .providers import CachingPackageProvider from .deployer import PackageDeployer def create(caching): if not caching.enabled: cacher = ...
504bd32e2f91b074595e1b86065eed318a22da8c
gitcommitautosave.py
gitcommitautosave.py
"""Git Commit Auto Save. Sublime Text 3 package to auto save commit messages when the window is closed. This allows the user to close the window without having to save before, or having to deal with the "Save File" popup. """ import sublime_plugin class GitCommitAutoSave(sublime_plugin.EventListener): def on_load(s...
"""Git Commit Auto Save. Sublime Text 3 package to auto save commit messages when the window is closed. This allows the user to close the window without having to save before, or having to deal with the "Save File" popup. """ import sublime_plugin class GitCommitAutoSave(sublime_plugin.EventListener): def on_load(s...
Add file created when using add -p
Add file created when using add -p When using 'git add -p' or 'git checkout -p', if the user chooses to manually edit the .diff file, Git creates a file called 'addp-hunk-edit.diff' (same file name for both operations).
Python
mit
aristidesfl/sublime-git-commit-message-auto-save
"""Git Commit Auto Save. Sublime Text 3 package to auto save commit messages when the window is closed. This allows the user to close the window without having to save before, or having to deal with the "Save File" popup. """ import sublime_plugin class GitCommitAutoSave(sublime_plugin.EventListener): def on_load(s...
"""Git Commit Auto Save. Sublime Text 3 package to auto save commit messages when the window is closed. This allows the user to close the window without having to save before, or having to deal with the "Save File" popup. """ import sublime_plugin class GitCommitAutoSave(sublime_plugin.EventListener): def on_load(s...
<commit_before>"""Git Commit Auto Save. Sublime Text 3 package to auto save commit messages when the window is closed. This allows the user to close the window without having to save before, or having to deal with the "Save File" popup. """ import sublime_plugin class GitCommitAutoSave(sublime_plugin.EventListener):...
"""Git Commit Auto Save. Sublime Text 3 package to auto save commit messages when the window is closed. This allows the user to close the window without having to save before, or having to deal with the "Save File" popup. """ import sublime_plugin class GitCommitAutoSave(sublime_plugin.EventListener): def on_load(s...
"""Git Commit Auto Save. Sublime Text 3 package to auto save commit messages when the window is closed. This allows the user to close the window without having to save before, or having to deal with the "Save File" popup. """ import sublime_plugin class GitCommitAutoSave(sublime_plugin.EventListener): def on_load(s...
<commit_before>"""Git Commit Auto Save. Sublime Text 3 package to auto save commit messages when the window is closed. This allows the user to close the window without having to save before, or having to deal with the "Save File" popup. """ import sublime_plugin class GitCommitAutoSave(sublime_plugin.EventListener):...
ac1f9ab2cb06be4060100fd8c0714e26a9e5c970
openacademy/model/openacademy_course.py
openacademy/model/openacademy_course.py
from openerp import fields, models ''' ...
from openerp import api,fields, models ''' ...
Modify copy method into inherit
[REF] openacademy: Modify copy method into inherit
Python
apache-2.0
hellomoto6/openacademy
from openerp import fields, models ''' ...
from openerp import api,fields, models ''' ...
<commit_before>from openerp import fields, models ''' ...
from openerp import api,fields, models ''' ...
from openerp import fields, models ''' ...
<commit_before>from openerp import fields, models ''' ...
2548ecd64d6a26b09fe79f5a369f731c66410aa0
dadd/master/admin.py
dadd/master/admin.py
from flask.ext.admin import Admin from flask.ext.admin.contrib.sqla import ModelView from dadd.master import models def admin(app): admin = Admin(app) session = models.db.session admin.add_view(ModelView(models.Process, session)) admin.add_view(ModelView(models.Host, session)) admin.add_view(Mode...
from flask.ext.admin import Admin from flask.ext.admin.contrib.sqla import ModelView from dadd.master import models class ProcessModelView(ModelView): # Make the latest first column_default_sort = ('start_time', True) def __init__(self, session): super(ProcessModelView, self).__init__(models.Pro...
Sort the processes by start time by default in the Admin.
Sort the processes by start time by default in the Admin.
Python
bsd-3-clause
ionrock/dadd,ionrock/dadd,ionrock/dadd,ionrock/dadd
from flask.ext.admin import Admin from flask.ext.admin.contrib.sqla import ModelView from dadd.master import models def admin(app): admin = Admin(app) session = models.db.session admin.add_view(ModelView(models.Process, session)) admin.add_view(ModelView(models.Host, session)) admin.add_view(Mode...
from flask.ext.admin import Admin from flask.ext.admin.contrib.sqla import ModelView from dadd.master import models class ProcessModelView(ModelView): # Make the latest first column_default_sort = ('start_time', True) def __init__(self, session): super(ProcessModelView, self).__init__(models.Pro...
<commit_before>from flask.ext.admin import Admin from flask.ext.admin.contrib.sqla import ModelView from dadd.master import models def admin(app): admin = Admin(app) session = models.db.session admin.add_view(ModelView(models.Process, session)) admin.add_view(ModelView(models.Host, session)) admi...
from flask.ext.admin import Admin from flask.ext.admin.contrib.sqla import ModelView from dadd.master import models class ProcessModelView(ModelView): # Make the latest first column_default_sort = ('start_time', True) def __init__(self, session): super(ProcessModelView, self).__init__(models.Pro...
from flask.ext.admin import Admin from flask.ext.admin.contrib.sqla import ModelView from dadd.master import models def admin(app): admin = Admin(app) session = models.db.session admin.add_view(ModelView(models.Process, session)) admin.add_view(ModelView(models.Host, session)) admin.add_view(Mode...
<commit_before>from flask.ext.admin import Admin from flask.ext.admin.contrib.sqla import ModelView from dadd.master import models def admin(app): admin = Admin(app) session = models.db.session admin.add_view(ModelView(models.Process, session)) admin.add_view(ModelView(models.Host, session)) admi...
1fdcb2a94f4af2357c24d528ecdba356074d4101
database_setup.py
database_setup.py
import json from meetup_facebook_bot import server from meetup_facebook_bot.models import base, talk, speaker base.Base.metadata.create_all(bind=server.engine) session = server.Session() # This part of the script provides the app with mockup data # TODO: replace it with actually working method json_talks = [] with ...
import json from meetup_facebook_bot import server from meetup_facebook_bot.models import base, talk, speaker base.Base.metadata.create_all(bind=server.engine) session = server.Session() # This part of the script provides the app with mockup data # TODO: replace it with actually working method json_talks = [] with ...
Fix the path to fake database data
Fix the path to fake database data
Python
mit
Stark-Mountain/meetup-facebook-bot,Stark-Mountain/meetup-facebook-bot
import json from meetup_facebook_bot import server from meetup_facebook_bot.models import base, talk, speaker base.Base.metadata.create_all(bind=server.engine) session = server.Session() # This part of the script provides the app with mockup data # TODO: replace it with actually working method json_talks = [] with ...
import json from meetup_facebook_bot import server from meetup_facebook_bot.models import base, talk, speaker base.Base.metadata.create_all(bind=server.engine) session = server.Session() # This part of the script provides the app with mockup data # TODO: replace it with actually working method json_talks = [] with ...
<commit_before>import json from meetup_facebook_bot import server from meetup_facebook_bot.models import base, talk, speaker base.Base.metadata.create_all(bind=server.engine) session = server.Session() # This part of the script provides the app with mockup data # TODO: replace it with actually working method json_t...
import json from meetup_facebook_bot import server from meetup_facebook_bot.models import base, talk, speaker base.Base.metadata.create_all(bind=server.engine) session = server.Session() # This part of the script provides the app with mockup data # TODO: replace it with actually working method json_talks = [] with ...
import json from meetup_facebook_bot import server from meetup_facebook_bot.models import base, talk, speaker base.Base.metadata.create_all(bind=server.engine) session = server.Session() # This part of the script provides the app with mockup data # TODO: replace it with actually working method json_talks = [] with ...
<commit_before>import json from meetup_facebook_bot import server from meetup_facebook_bot.models import base, talk, speaker base.Base.metadata.create_all(bind=server.engine) session = server.Session() # This part of the script provides the app with mockup data # TODO: replace it with actually working method json_t...
f5c5c9297bb5c7dfa0ee6c3077329c8e7fa00b06
talon_one/exceptions.py
talon_one/exceptions.py
import json import requests class TalonOneAPIError(Exception): """ TalonOne API Exceptions """ def __init__(self, message, *args): self.message = message # try to enhance with detailed error from API if len(args) > 0 and isinstance(args[0], requests.exceptions.HTTPError): ...
import json import requests class TalonOneAPIError(Exception): """ TalonOne API Exceptions """ def __init__(self, message, *args): self.message = message # try to enhance with detailed error from API if len(args) > 0 and isinstance(args[0], requests.exceptions.HTTPError): ...
Include API validation response into `TalonOneAPIError` details
Include API validation response into `TalonOneAPIError` details
Python
mit
talon-one/talon_one.py,talon-one/talon_one.py
import json import requests class TalonOneAPIError(Exception): """ TalonOne API Exceptions """ def __init__(self, message, *args): self.message = message # try to enhance with detailed error from API if len(args) > 0 and isinstance(args[0], requests.exceptions.HTTPError): ...
import json import requests class TalonOneAPIError(Exception): """ TalonOne API Exceptions """ def __init__(self, message, *args): self.message = message # try to enhance with detailed error from API if len(args) > 0 and isinstance(args[0], requests.exceptions.HTTPError): ...
<commit_before>import json import requests class TalonOneAPIError(Exception): """ TalonOne API Exceptions """ def __init__(self, message, *args): self.message = message # try to enhance with detailed error from API if len(args) > 0 and isinstance(args[0], requests.exceptions.HT...
import json import requests class TalonOneAPIError(Exception): """ TalonOne API Exceptions """ def __init__(self, message, *args): self.message = message # try to enhance with detailed error from API if len(args) > 0 and isinstance(args[0], requests.exceptions.HTTPError): ...
import json import requests class TalonOneAPIError(Exception): """ TalonOne API Exceptions """ def __init__(self, message, *args): self.message = message # try to enhance with detailed error from API if len(args) > 0 and isinstance(args[0], requests.exceptions.HTTPError): ...
<commit_before>import json import requests class TalonOneAPIError(Exception): """ TalonOne API Exceptions """ def __init__(self, message, *args): self.message = message # try to enhance with detailed error from API if len(args) > 0 and isinstance(args[0], requests.exceptions.HT...
30e050b836a4e8df3f918738b78552a070a1a176
jarbas/core/views.py
jarbas/core/views.py
from django.shortcuts import get_object_or_404 from rest_framework.generics import RetrieveAPIView from jarbas.core.models import Company from jarbas.core.serializers import CompanySerializer from jarbas.chamber_of_deputies.serializers import format_cnpj class CompanyDetailView(RetrieveAPIView): lookup_field = '...
from django.shortcuts import get_object_or_404 from rest_framework.generics import RetrieveAPIView from jarbas.core.models import Company from jarbas.core.serializers import CompanySerializer from jarbas.chamber_of_deputies.serializers import format_cnpj class CompanyDetailView(RetrieveAPIView): lookup_field = ...
Add blank line - pep8
Add blank line - pep8
Python
mit
datasciencebr/serenata-de-amor,marcusrehm/serenata-de-amor,marcusrehm/serenata-de-amor,datasciencebr/jarbas,marcusrehm/serenata-de-amor,datasciencebr/jarbas,datasciencebr/serenata-de-amor,datasciencebr/jarbas,marcusrehm/serenata-de-amor,datasciencebr/jarbas
from django.shortcuts import get_object_or_404 from rest_framework.generics import RetrieveAPIView from jarbas.core.models import Company from jarbas.core.serializers import CompanySerializer from jarbas.chamber_of_deputies.serializers import format_cnpj class CompanyDetailView(RetrieveAPIView): lookup_field = '...
from django.shortcuts import get_object_or_404 from rest_framework.generics import RetrieveAPIView from jarbas.core.models import Company from jarbas.core.serializers import CompanySerializer from jarbas.chamber_of_deputies.serializers import format_cnpj class CompanyDetailView(RetrieveAPIView): lookup_field = ...
<commit_before>from django.shortcuts import get_object_or_404 from rest_framework.generics import RetrieveAPIView from jarbas.core.models import Company from jarbas.core.serializers import CompanySerializer from jarbas.chamber_of_deputies.serializers import format_cnpj class CompanyDetailView(RetrieveAPIView): l...
from django.shortcuts import get_object_or_404 from rest_framework.generics import RetrieveAPIView from jarbas.core.models import Company from jarbas.core.serializers import CompanySerializer from jarbas.chamber_of_deputies.serializers import format_cnpj class CompanyDetailView(RetrieveAPIView): lookup_field = ...
from django.shortcuts import get_object_or_404 from rest_framework.generics import RetrieveAPIView from jarbas.core.models import Company from jarbas.core.serializers import CompanySerializer from jarbas.chamber_of_deputies.serializers import format_cnpj class CompanyDetailView(RetrieveAPIView): lookup_field = '...
<commit_before>from django.shortcuts import get_object_or_404 from rest_framework.generics import RetrieveAPIView from jarbas.core.models import Company from jarbas.core.serializers import CompanySerializer from jarbas.chamber_of_deputies.serializers import format_cnpj class CompanyDetailView(RetrieveAPIView): l...
6fecc53b63023e6d25722aa66038285be3b4d46b
arcutils/response.py
arcutils/response.py
from django.contrib.auth import REDIRECT_FIELD_NAME from django.utils.http import is_safe_url def get_redirect_location(request, redirect_field_name=REDIRECT_FIELD_NAME, default='/'): """Attempt to choose an optimal redirect location. If a location is specified via a request parameter, that location will...
from urllib.parse import urlparse, urlunparse from django.contrib.auth import REDIRECT_FIELD_NAME from django.utils.http import is_safe_url def get_redirect_location(request, redirect_field_name=REDIRECT_FIELD_NAME, default='/'): """Attempt to choose an optimal redirect location. If a location is specified ...
Return just path when getting redirect location from REFERER
Return just path when getting redirect location from REFERER In response.get_redirect_location(). There's no need to include the scheme and host in a redirect back to the same site. Removing them makes redirect URLs more concise.
Python
mit
PSU-OIT-ARC/django-arcutils,wylee/django-arcutils,PSU-OIT-ARC/django-arcutils,wylee/django-arcutils
from django.contrib.auth import REDIRECT_FIELD_NAME from django.utils.http import is_safe_url def get_redirect_location(request, redirect_field_name=REDIRECT_FIELD_NAME, default='/'): """Attempt to choose an optimal redirect location. If a location is specified via a request parameter, that location will...
from urllib.parse import urlparse, urlunparse from django.contrib.auth import REDIRECT_FIELD_NAME from django.utils.http import is_safe_url def get_redirect_location(request, redirect_field_name=REDIRECT_FIELD_NAME, default='/'): """Attempt to choose an optimal redirect location. If a location is specified ...
<commit_before>from django.contrib.auth import REDIRECT_FIELD_NAME from django.utils.http import is_safe_url def get_redirect_location(request, redirect_field_name=REDIRECT_FIELD_NAME, default='/'): """Attempt to choose an optimal redirect location. If a location is specified via a request parameter, that lo...
from urllib.parse import urlparse, urlunparse from django.contrib.auth import REDIRECT_FIELD_NAME from django.utils.http import is_safe_url def get_redirect_location(request, redirect_field_name=REDIRECT_FIELD_NAME, default='/'): """Attempt to choose an optimal redirect location. If a location is specified ...
from django.contrib.auth import REDIRECT_FIELD_NAME from django.utils.http import is_safe_url def get_redirect_location(request, redirect_field_name=REDIRECT_FIELD_NAME, default='/'): """Attempt to choose an optimal redirect location. If a location is specified via a request parameter, that location will...
<commit_before>from django.contrib.auth import REDIRECT_FIELD_NAME from django.utils.http import is_safe_url def get_redirect_location(request, redirect_field_name=REDIRECT_FIELD_NAME, default='/'): """Attempt to choose an optimal redirect location. If a location is specified via a request parameter, that lo...
9d8b648163ede522eed6d9b742e8e7393dc2f6dc
vispy/testing/__init__.py
vispy/testing/__init__.py
# -*- coding: utf-8 -*- # Copyright (c) 2014, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. from ._testing import (SkipTest, requires_application, requires_img_lib, # noqa has_backend, requires_pyopengl, # noqa requires_s...
# -*- coding: utf-8 -*- # Copyright (c) 2014, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ Testing ======= This module provides functions useful for running tests in vispy. Tests can be run in a few ways: * From Python, you can import ``vispy`` and do ``vis...
Document test system a bit
DOC: Document test system a bit
Python
bsd-3-clause
Eric89GXL/vispy,michaelaye/vispy,Eric89GXL/vispy,drufat/vispy,dchilds7/Deysha-Star-Formation,bollu/vispy,jdreaver/vispy,jdreaver/vispy,bollu/vispy,sbtlaarzc/vispy,jay3sh/vispy,inclement/vispy,sh4wn/vispy,drufat/vispy,hronoses/vispy,bollu/vispy,julienr/vispy,ghisvail/vispy,sbtlaarzc/vispy,kkuunnddaannkk/vispy,sh4wn/visp...
# -*- coding: utf-8 -*- # Copyright (c) 2014, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. from ._testing import (SkipTest, requires_application, requires_img_lib, # noqa has_backend, requires_pyopengl, # noqa requires_s...
# -*- coding: utf-8 -*- # Copyright (c) 2014, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ Testing ======= This module provides functions useful for running tests in vispy. Tests can be run in a few ways: * From Python, you can import ``vispy`` and do ``vis...
<commit_before># -*- coding: utf-8 -*- # Copyright (c) 2014, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. from ._testing import (SkipTest, requires_application, requires_img_lib, # noqa has_backend, requires_pyopengl, # noqa ...
# -*- coding: utf-8 -*- # Copyright (c) 2014, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ Testing ======= This module provides functions useful for running tests in vispy. Tests can be run in a few ways: * From Python, you can import ``vispy`` and do ``vis...
# -*- coding: utf-8 -*- # Copyright (c) 2014, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. from ._testing import (SkipTest, requires_application, requires_img_lib, # noqa has_backend, requires_pyopengl, # noqa requires_s...
<commit_before># -*- coding: utf-8 -*- # Copyright (c) 2014, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. from ._testing import (SkipTest, requires_application, requires_img_lib, # noqa has_backend, requires_pyopengl, # noqa ...
92a44ab657cf56dc6effd4fa841187d88ead879b
piper/__init__.py
piper/__init__.py
import sys from piper.core import Piper def main(): # TODO: dat argparse env_key = sys.argv[1] set_key = sys.argv[2] piper = Piper(env_key, set_key) piper.setup() piper.execute()
import sys import jsonschema from piper.core import Piper def main(): # TODO: dat argparse env_key = sys.argv[1] set_key = sys.argv[2] piper = Piper(env_key, set_key) try: piper.setup() piper.execute() except jsonschema.exceptions.ValidationError as e: print(e) ...
Implement very simple main executor
Implement very simple main executor
Python
mit
thiderman/piper
import sys from piper.core import Piper def main(): # TODO: dat argparse env_key = sys.argv[1] set_key = sys.argv[2] piper = Piper(env_key, set_key) piper.setup() piper.execute() Implement very simple main executor
import sys import jsonschema from piper.core import Piper def main(): # TODO: dat argparse env_key = sys.argv[1] set_key = sys.argv[2] piper = Piper(env_key, set_key) try: piper.setup() piper.execute() except jsonschema.exceptions.ValidationError as e: print(e) ...
<commit_before>import sys from piper.core import Piper def main(): # TODO: dat argparse env_key = sys.argv[1] set_key = sys.argv[2] piper = Piper(env_key, set_key) piper.setup() piper.execute() <commit_msg>Implement very simple main executor<commit_after>
import sys import jsonschema from piper.core import Piper def main(): # TODO: dat argparse env_key = sys.argv[1] set_key = sys.argv[2] piper = Piper(env_key, set_key) try: piper.setup() piper.execute() except jsonschema.exceptions.ValidationError as e: print(e) ...
import sys from piper.core import Piper def main(): # TODO: dat argparse env_key = sys.argv[1] set_key = sys.argv[2] piper = Piper(env_key, set_key) piper.setup() piper.execute() Implement very simple main executorimport sys import jsonschema from piper.core import Piper def main(): #...
<commit_before>import sys from piper.core import Piper def main(): # TODO: dat argparse env_key = sys.argv[1] set_key = sys.argv[2] piper = Piper(env_key, set_key) piper.setup() piper.execute() <commit_msg>Implement very simple main executor<commit_after>import sys import jsonschema from pi...
e4297f0f7149763f6e93536746e3c87f9d1fa699
tests/test_watchmedo.py
tests/test_watchmedo.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from watchdog import watchmedo import pytest import yaml import os def test_load_config_valid(tmpdir): """Verifies the load of a valid yaml file""" yaml_file = os.path.join(tmpdir, 'config_file.yaml') with open(yaml_file, 'w') as f: ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from watchdog import watchmedo import pytest from yaml.constructor import ConstructorError from yaml.scanner import ScannerError import os def test_load_config_valid(tmpdir): """Verifies the load of a valid yaml file""" yaml_file = os.path.join...
Fix watchmedo tests in Windows
Fix watchmedo tests in Windows Unexpectedly, but on test_load_config_invalid running, PyYAML get_single_data() raises different execptions for Linux and Windows. This PR adds ScannerError for passing tests under Windows.
Python
apache-2.0
gorakhargosh/watchdog,gorakhargosh/watchdog
# -*- coding: utf-8 -*- from __future__ import unicode_literals from watchdog import watchmedo import pytest import yaml import os def test_load_config_valid(tmpdir): """Verifies the load of a valid yaml file""" yaml_file = os.path.join(tmpdir, 'config_file.yaml') with open(yaml_file, 'w') as f: ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from watchdog import watchmedo import pytest from yaml.constructor import ConstructorError from yaml.scanner import ScannerError import os def test_load_config_valid(tmpdir): """Verifies the load of a valid yaml file""" yaml_file = os.path.join...
<commit_before># -*- coding: utf-8 -*- from __future__ import unicode_literals from watchdog import watchmedo import pytest import yaml import os def test_load_config_valid(tmpdir): """Verifies the load of a valid yaml file""" yaml_file = os.path.join(tmpdir, 'config_file.yaml') with open(yaml_file, 'w'...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from watchdog import watchmedo import pytest from yaml.constructor import ConstructorError from yaml.scanner import ScannerError import os def test_load_config_valid(tmpdir): """Verifies the load of a valid yaml file""" yaml_file = os.path.join...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from watchdog import watchmedo import pytest import yaml import os def test_load_config_valid(tmpdir): """Verifies the load of a valid yaml file""" yaml_file = os.path.join(tmpdir, 'config_file.yaml') with open(yaml_file, 'w') as f: ...
<commit_before># -*- coding: utf-8 -*- from __future__ import unicode_literals from watchdog import watchmedo import pytest import yaml import os def test_load_config_valid(tmpdir): """Verifies the load of a valid yaml file""" yaml_file = os.path.join(tmpdir, 'config_file.yaml') with open(yaml_file, 'w'...
5076055b54d18ea2441abaf604a4ea4dd79353c5
cybox/test/objects/__init__.py
cybox/test/objects/__init__.py
import cybox.utils class ObjectTestCase(object): """A base class for testing all subclasses of ObjectProperties. Each subclass of ObjectTestCase should subclass both unittest.TestCase and ObjectTestCase, and defined two class-level fields: - klass: the ObjectProperties subclass being tested - obj...
import cybox.utils class ObjectTestCase(object): """A base class for testing all subclasses of ObjectProperties. Each subclass of ObjectTestCase should subclass both unittest.TestCase and ObjectTestCase, and defined two class-level fields: - klass: the ObjectProperties subclass being tested - obj...
Expand default testing on new object types
Expand default testing on new object types
Python
bsd-3-clause
CybOXProject/python-cybox
import cybox.utils class ObjectTestCase(object): """A base class for testing all subclasses of ObjectProperties. Each subclass of ObjectTestCase should subclass both unittest.TestCase and ObjectTestCase, and defined two class-level fields: - klass: the ObjectProperties subclass being tested - obj...
import cybox.utils class ObjectTestCase(object): """A base class for testing all subclasses of ObjectProperties. Each subclass of ObjectTestCase should subclass both unittest.TestCase and ObjectTestCase, and defined two class-level fields: - klass: the ObjectProperties subclass being tested - obj...
<commit_before>import cybox.utils class ObjectTestCase(object): """A base class for testing all subclasses of ObjectProperties. Each subclass of ObjectTestCase should subclass both unittest.TestCase and ObjectTestCase, and defined two class-level fields: - klass: the ObjectProperties subclass being t...
import cybox.utils class ObjectTestCase(object): """A base class for testing all subclasses of ObjectProperties. Each subclass of ObjectTestCase should subclass both unittest.TestCase and ObjectTestCase, and defined two class-level fields: - klass: the ObjectProperties subclass being tested - obj...
import cybox.utils class ObjectTestCase(object): """A base class for testing all subclasses of ObjectProperties. Each subclass of ObjectTestCase should subclass both unittest.TestCase and ObjectTestCase, and defined two class-level fields: - klass: the ObjectProperties subclass being tested - obj...
<commit_before>import cybox.utils class ObjectTestCase(object): """A base class for testing all subclasses of ObjectProperties. Each subclass of ObjectTestCase should subclass both unittest.TestCase and ObjectTestCase, and defined two class-level fields: - klass: the ObjectProperties subclass being t...
7aff5878747c000c5868e3a5ddd8b205d74770b0
thinc/extra/load_nlp.py
thinc/extra/load_nlp.py
import numpy try: import spacy except ImportError: spacy = None SPACY_MODELS = {} VECTORS = {} def get_spacy(lang, **kwargs): global SPACY_MODELS if spacy is None: raise ImportError("Could not import spacy. Is it installed?") if lang not in SPACY_MODELS: SPACY_MODELS[lang] = spacy...
import numpy SPACY_MODELS = {} VECTORS = {} def get_spacy(lang, **kwargs): global SPACY_MODELS import spacy if lang not in SPACY_MODELS: SPACY_MODELS[lang] = spacy.load(lang, **kwargs) return SPACY_MODELS[lang] def get_vectors(ops, lang): global VECTORS key = (ops.device, lang) ...
Improve import of spaCy, to prevent cycles
Improve import of spaCy, to prevent cycles
Python
mit
explosion/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc,spacy-io/thinc
import numpy try: import spacy except ImportError: spacy = None SPACY_MODELS = {} VECTORS = {} def get_spacy(lang, **kwargs): global SPACY_MODELS if spacy is None: raise ImportError("Could not import spacy. Is it installed?") if lang not in SPACY_MODELS: SPACY_MODELS[lang] = spacy...
import numpy SPACY_MODELS = {} VECTORS = {} def get_spacy(lang, **kwargs): global SPACY_MODELS import spacy if lang not in SPACY_MODELS: SPACY_MODELS[lang] = spacy.load(lang, **kwargs) return SPACY_MODELS[lang] def get_vectors(ops, lang): global VECTORS key = (ops.device, lang) ...
<commit_before>import numpy try: import spacy except ImportError: spacy = None SPACY_MODELS = {} VECTORS = {} def get_spacy(lang, **kwargs): global SPACY_MODELS if spacy is None: raise ImportError("Could not import spacy. Is it installed?") if lang not in SPACY_MODELS: SPACY_MODEL...
import numpy SPACY_MODELS = {} VECTORS = {} def get_spacy(lang, **kwargs): global SPACY_MODELS import spacy if lang not in SPACY_MODELS: SPACY_MODELS[lang] = spacy.load(lang, **kwargs) return SPACY_MODELS[lang] def get_vectors(ops, lang): global VECTORS key = (ops.device, lang) ...
import numpy try: import spacy except ImportError: spacy = None SPACY_MODELS = {} VECTORS = {} def get_spacy(lang, **kwargs): global SPACY_MODELS if spacy is None: raise ImportError("Could not import spacy. Is it installed?") if lang not in SPACY_MODELS: SPACY_MODELS[lang] = spacy...
<commit_before>import numpy try: import spacy except ImportError: spacy = None SPACY_MODELS = {} VECTORS = {} def get_spacy(lang, **kwargs): global SPACY_MODELS if spacy is None: raise ImportError("Could not import spacy. Is it installed?") if lang not in SPACY_MODELS: SPACY_MODEL...
486e2fc3f2db9afabaf0dd279be0675439304d83
app/__init__.py
app/__init__.py
from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.socketio import SocketIO import os # The main application folder _basedir = os.path.abspath(os.path.dirname('..')) SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(_basedir, 'test.db') app = Flask(__name__) app.debug = True app.co...
from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.socketio import SocketIO import os # The main application folder _basedir = os.path.abspath(os.path.dirname('..')) SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(_basedir, 'test.db') app = Flask(__name__) app.debug = True app.co...
Add secret key for session use
Add secret key for session use
Python
mit
jawrainey/healthchat,jawrainey/healthchat
from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.socketio import SocketIO import os # The main application folder _basedir = os.path.abspath(os.path.dirname('..')) SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(_basedir, 'test.db') app = Flask(__name__) app.debug = True app.co...
from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.socketio import SocketIO import os # The main application folder _basedir = os.path.abspath(os.path.dirname('..')) SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(_basedir, 'test.db') app = Flask(__name__) app.debug = True app.co...
<commit_before>from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.socketio import SocketIO import os # The main application folder _basedir = os.path.abspath(os.path.dirname('..')) SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(_basedir, 'test.db') app = Flask(__name__) app.debu...
from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.socketio import SocketIO import os # The main application folder _basedir = os.path.abspath(os.path.dirname('..')) SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(_basedir, 'test.db') app = Flask(__name__) app.debug = True app.co...
from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.socketio import SocketIO import os # The main application folder _basedir = os.path.abspath(os.path.dirname('..')) SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(_basedir, 'test.db') app = Flask(__name__) app.debug = True app.co...
<commit_before>from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.socketio import SocketIO import os # The main application folder _basedir = os.path.abspath(os.path.dirname('..')) SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(_basedir, 'test.db') app = Flask(__name__) app.debu...
0cf18a615ef671e6bee44da386016d8ab1b8b012
Generator.py
Generator.py
import random def generateWord(meaning, form, categories, settings, formrules=None): '''Takes an English string, desired form, generation categories, settings, and optional form-specific rules. Returns a generated word. ''' word = "" minS = settings["minS"] maxS = settings["maxS"] def...
import random import re def generateWord(meaning, form, categories, settings, phonotactics, formrules=None): '''Takes an English string, desired form, generation categories, settings, and optional form-specific rules. Returns a generated word. ''' word = "" minS = settings["m...
Add applyPhonotactics() and use it in generation
Add applyPhonotactics() and use it in generation
Python
mit
kdelwat/Lexeme
import random def generateWord(meaning, form, categories, settings, formrules=None): '''Takes an English string, desired form, generation categories, settings, and optional form-specific rules. Returns a generated word. ''' word = "" minS = settings["minS"] maxS = settings["maxS"] def...
import random import re def generateWord(meaning, form, categories, settings, phonotactics, formrules=None): '''Takes an English string, desired form, generation categories, settings, and optional form-specific rules. Returns a generated word. ''' word = "" minS = settings["m...
<commit_before>import random def generateWord(meaning, form, categories, settings, formrules=None): '''Takes an English string, desired form, generation categories, settings, and optional form-specific rules. Returns a generated word. ''' word = "" minS = settings["minS"] maxS = settings[...
import random import re def generateWord(meaning, form, categories, settings, phonotactics, formrules=None): '''Takes an English string, desired form, generation categories, settings, and optional form-specific rules. Returns a generated word. ''' word = "" minS = settings["m...
import random def generateWord(meaning, form, categories, settings, formrules=None): '''Takes an English string, desired form, generation categories, settings, and optional form-specific rules. Returns a generated word. ''' word = "" minS = settings["minS"] maxS = settings["maxS"] def...
<commit_before>import random def generateWord(meaning, form, categories, settings, formrules=None): '''Takes an English string, desired form, generation categories, settings, and optional form-specific rules. Returns a generated word. ''' word = "" minS = settings["minS"] maxS = settings[...
f97b5ec83601430ae63ac6c0a6e651cc7a0cf90d
project/encode.py
project/encode.py
from msgpack import packb, Unpacker from snappy import compress, decompress # noqa from btree import Tree, Node, Leaf, LazyNode def encode_btree(obj): if isinstance(obj, (Tree, Node, Leaf)): return {'__class__': obj.__class__.__name__, 'data': obj.to_json()} elif isinstance(obj, LazyN...
from msgpack import packb, unpackb, Unpacker from snappy import compress, decompress # noqa from btree import Tree, Node, Leaf, LazyNode from checksum import add_integrity, check_integrity def encode_btree(obj): if isinstance(obj, (Tree, Node, Leaf)): return {'__class__': obj.__class__.__name__, ...
Add compression and integrity checks
Add compression and integrity checks
Python
mit
Snuggert/moda
from msgpack import packb, Unpacker from snappy import compress, decompress # noqa from btree import Tree, Node, Leaf, LazyNode def encode_btree(obj): if isinstance(obj, (Tree, Node, Leaf)): return {'__class__': obj.__class__.__name__, 'data': obj.to_json()} elif isinstance(obj, LazyN...
from msgpack import packb, unpackb, Unpacker from snappy import compress, decompress # noqa from btree import Tree, Node, Leaf, LazyNode from checksum import add_integrity, check_integrity def encode_btree(obj): if isinstance(obj, (Tree, Node, Leaf)): return {'__class__': obj.__class__.__name__, ...
<commit_before>from msgpack import packb, Unpacker from snappy import compress, decompress # noqa from btree import Tree, Node, Leaf, LazyNode def encode_btree(obj): if isinstance(obj, (Tree, Node, Leaf)): return {'__class__': obj.__class__.__name__, 'data': obj.to_json()} elif isinst...
from msgpack import packb, unpackb, Unpacker from snappy import compress, decompress # noqa from btree import Tree, Node, Leaf, LazyNode from checksum import add_integrity, check_integrity def encode_btree(obj): if isinstance(obj, (Tree, Node, Leaf)): return {'__class__': obj.__class__.__name__, ...
from msgpack import packb, Unpacker from snappy import compress, decompress # noqa from btree import Tree, Node, Leaf, LazyNode def encode_btree(obj): if isinstance(obj, (Tree, Node, Leaf)): return {'__class__': obj.__class__.__name__, 'data': obj.to_json()} elif isinstance(obj, LazyN...
<commit_before>from msgpack import packb, Unpacker from snappy import compress, decompress # noqa from btree import Tree, Node, Leaf, LazyNode def encode_btree(obj): if isinstance(obj, (Tree, Node, Leaf)): return {'__class__': obj.__class__.__name__, 'data': obj.to_json()} elif isinst...
7cc968f90407745b84bd2f663e5f64b9c0923605
project/manage.py
project/manage.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import environ if __name__ == "__main__": if os.path.isfile('.env'): environ.Env.read_env('.env') os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local") from django.core.management import execute_from_command_lin...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import environ ROOT_DIR = environ.Path(__file__) - 1 if __name__ == "__main__": if os.path.isfile(str(ROOT_DIR + '.env')): environ.Env.read_env(str(ROOT_DIR + '.env')) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.lo...
Use full path in case the working dir is not the same
Use full path in case the working dir is not the same
Python
mit
hacklab-fi/asylum,hacklab-fi/asylum,HelsinkiHacklab/asylum,jautero/asylum,hacklab-fi/asylum,HelsinkiHacklab/asylum,jautero/asylum,hacklab-fi/asylum,rambo/asylum,jautero/asylum,rambo/asylum,rambo/asylum,rambo/asylum,jautero/asylum,HelsinkiHacklab/asylum,HelsinkiHacklab/asylum
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import environ if __name__ == "__main__": if os.path.isfile('.env'): environ.Env.read_env('.env') os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local") from django.core.management import execute_from_command_lin...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import environ ROOT_DIR = environ.Path(__file__) - 1 if __name__ == "__main__": if os.path.isfile(str(ROOT_DIR + '.env')): environ.Env.read_env(str(ROOT_DIR + '.env')) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.lo...
<commit_before>#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import environ if __name__ == "__main__": if os.path.isfile('.env'): environ.Env.read_env('.env') os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local") from django.core.management import execute_f...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import environ ROOT_DIR = environ.Path(__file__) - 1 if __name__ == "__main__": if os.path.isfile(str(ROOT_DIR + '.env')): environ.Env.read_env(str(ROOT_DIR + '.env')) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.lo...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import environ if __name__ == "__main__": if os.path.isfile('.env'): environ.Env.read_env('.env') os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local") from django.core.management import execute_from_command_lin...
<commit_before>#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import environ if __name__ == "__main__": if os.path.isfile('.env'): environ.Env.read_env('.env') os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local") from django.core.management import execute_f...
fff1312d506b4268be2e2ce7c333d9f25babdd59
fuzzyfinder/main.py
fuzzyfinder/main.py
# -*- coding: utf-8 -*- import re from . import export @export def fuzzyfinder(text, collection): """ Args: text (str): A partial string which is typically entered by a user. collection (iterable): A collection of strings which will be filtered based on the input ...
# -*- coding: utf-8 -*- import re from . import export @export def fuzzyfinder(text, collection): """ Args: text (str): A partial string which is typically entered by a user. collection (iterable): A collection of strings which will be filtered based on the input ...
Remove the unnecessary capturing group.
Remove the unnecessary capturing group.
Python
bsd-3-clause
harrisonfeng/fuzzyfinder,amjith/fuzzyfinder,adammenges/fuzzyfinder
# -*- coding: utf-8 -*- import re from . import export @export def fuzzyfinder(text, collection): """ Args: text (str): A partial string which is typically entered by a user. collection (iterable): A collection of strings which will be filtered based on the input ...
# -*- coding: utf-8 -*- import re from . import export @export def fuzzyfinder(text, collection): """ Args: text (str): A partial string which is typically entered by a user. collection (iterable): A collection of strings which will be filtered based on the input ...
<commit_before># -*- coding: utf-8 -*- import re from . import export @export def fuzzyfinder(text, collection): """ Args: text (str): A partial string which is typically entered by a user. collection (iterable): A collection of strings which will be filtered base...
# -*- coding: utf-8 -*- import re from . import export @export def fuzzyfinder(text, collection): """ Args: text (str): A partial string which is typically entered by a user. collection (iterable): A collection of strings which will be filtered based on the input ...
# -*- coding: utf-8 -*- import re from . import export @export def fuzzyfinder(text, collection): """ Args: text (str): A partial string which is typically entered by a user. collection (iterable): A collection of strings which will be filtered based on the input ...
<commit_before># -*- coding: utf-8 -*- import re from . import export @export def fuzzyfinder(text, collection): """ Args: text (str): A partial string which is typically entered by a user. collection (iterable): A collection of strings which will be filtered base...
d33d791a5e90ab1a389d85b5e93df7f07167eb5b
tests/integration/test_home_page.py
tests/integration/test_home_page.py
from flask import url_for import pytest from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions from selenium.webdriver.support.wait import WebDriverWait from tests.helpers import slow @pytest.mark.usefixtures('live_server') @slow def test_home_page_accessible(selenium)...
from flask import url_for import pytest from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions from selenium.webdriver.support.wait import WebDriverWait from tests.helpers import slow @pytest.mark.usefixtures('live_server') @slow def test_home_page_accessible(selenium)...
Update tests to reflect title change
Update tests to reflect title change
Python
isc
textbook/flash,textbook/flash,textbook/flash
from flask import url_for import pytest from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions from selenium.webdriver.support.wait import WebDriverWait from tests.helpers import slow @pytest.mark.usefixtures('live_server') @slow def test_home_page_accessible(selenium)...
from flask import url_for import pytest from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions from selenium.webdriver.support.wait import WebDriverWait from tests.helpers import slow @pytest.mark.usefixtures('live_server') @slow def test_home_page_accessible(selenium)...
<commit_before>from flask import url_for import pytest from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions from selenium.webdriver.support.wait import WebDriverWait from tests.helpers import slow @pytest.mark.usefixtures('live_server') @slow def test_home_page_acces...
from flask import url_for import pytest from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions from selenium.webdriver.support.wait import WebDriverWait from tests.helpers import slow @pytest.mark.usefixtures('live_server') @slow def test_home_page_accessible(selenium)...
from flask import url_for import pytest from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions from selenium.webdriver.support.wait import WebDriverWait from tests.helpers import slow @pytest.mark.usefixtures('live_server') @slow def test_home_page_accessible(selenium)...
<commit_before>from flask import url_for import pytest from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions from selenium.webdriver.support.wait import WebDriverWait from tests.helpers import slow @pytest.mark.usefixtures('live_server') @slow def test_home_page_acces...
c28f0313a96be4f4095f542ba2a9524c129c88f7
luigi_td/__init__.py
luigi_td/__init__.py
from luigi_td.bulk_import import BulkImport from luigi_td.client import ResultProxy from luigi_td.config import Config, get_config from luigi_td.task import DatabaseTask, TableTask, Query from luigi_td.targets.result import ResultTarget from luigi_td.targets.s3 import S3ResultTarget from luigi_td.targets.tableau import...
from luigi_td.bulk_import import BulkImport from luigi_td.client import ResultProxy from luigi_td.config import Config, get_config from luigi_td.task import DatabaseTask, TableTask, Query from luigi_td.targets.result import ResultTarget from luigi_td.targets.s3 import S3ResultTarget from luigi_td.targets.tableau import...
Fix variable names in __all__
Fix variable names in __all__
Python
apache-2.0
treasure-data/luigi-td
from luigi_td.bulk_import import BulkImport from luigi_td.client import ResultProxy from luigi_td.config import Config, get_config from luigi_td.task import DatabaseTask, TableTask, Query from luigi_td.targets.result import ResultTarget from luigi_td.targets.s3 import S3ResultTarget from luigi_td.targets.tableau import...
from luigi_td.bulk_import import BulkImport from luigi_td.client import ResultProxy from luigi_td.config import Config, get_config from luigi_td.task import DatabaseTask, TableTask, Query from luigi_td.targets.result import ResultTarget from luigi_td.targets.s3 import S3ResultTarget from luigi_td.targets.tableau import...
<commit_before>from luigi_td.bulk_import import BulkImport from luigi_td.client import ResultProxy from luigi_td.config import Config, get_config from luigi_td.task import DatabaseTask, TableTask, Query from luigi_td.targets.result import ResultTarget from luigi_td.targets.s3 import S3ResultTarget from luigi_td.targets...
from luigi_td.bulk_import import BulkImport from luigi_td.client import ResultProxy from luigi_td.config import Config, get_config from luigi_td.task import DatabaseTask, TableTask, Query from luigi_td.targets.result import ResultTarget from luigi_td.targets.s3 import S3ResultTarget from luigi_td.targets.tableau import...
from luigi_td.bulk_import import BulkImport from luigi_td.client import ResultProxy from luigi_td.config import Config, get_config from luigi_td.task import DatabaseTask, TableTask, Query from luigi_td.targets.result import ResultTarget from luigi_td.targets.s3 import S3ResultTarget from luigi_td.targets.tableau import...
<commit_before>from luigi_td.bulk_import import BulkImport from luigi_td.client import ResultProxy from luigi_td.config import Config, get_config from luigi_td.task import DatabaseTask, TableTask, Query from luigi_td.targets.result import ResultTarget from luigi_td.targets.s3 import S3ResultTarget from luigi_td.targets...
24d148e33218a3f08a56a95052b0cfe8ecb0cecd
pykka/__init__.py
pykka/__init__.py
""" Pykka is a concurrency abstraction which makes actors look like regular objects. See http://jodal.github.com/pykka/ for more information. """ from pykka.actor import Actor from pykka.future import Future, get_all, wait_all from pykka.proxy import ActorProxy, CallableProxy from pykka.registry import ActorRegistry ...
from pykka.actor import Actor from pykka.future import Future, get_all, wait_all from pykka.proxy import ActorProxy, CallableProxy from pykka.registry import ActorRegistry __all__ = ['Actor', 'ActorProxy', 'ActorRegistry', 'CallableProxy', 'Future', 'get_all', 'wait_all'] VERSION = (0, 4) def get_version(): ...
Remove docstring which only repeats the readme
Remove docstring which only repeats the readme
Python
apache-2.0
jodal/pykka,tamland/pykka,tempbottle/pykka
""" Pykka is a concurrency abstraction which makes actors look like regular objects. See http://jodal.github.com/pykka/ for more information. """ from pykka.actor import Actor from pykka.future import Future, get_all, wait_all from pykka.proxy import ActorProxy, CallableProxy from pykka.registry import ActorRegistry ...
from pykka.actor import Actor from pykka.future import Future, get_all, wait_all from pykka.proxy import ActorProxy, CallableProxy from pykka.registry import ActorRegistry __all__ = ['Actor', 'ActorProxy', 'ActorRegistry', 'CallableProxy', 'Future', 'get_all', 'wait_all'] VERSION = (0, 4) def get_version(): ...
<commit_before>""" Pykka is a concurrency abstraction which makes actors look like regular objects. See http://jodal.github.com/pykka/ for more information. """ from pykka.actor import Actor from pykka.future import Future, get_all, wait_all from pykka.proxy import ActorProxy, CallableProxy from pykka.registry import...
from pykka.actor import Actor from pykka.future import Future, get_all, wait_all from pykka.proxy import ActorProxy, CallableProxy from pykka.registry import ActorRegistry __all__ = ['Actor', 'ActorProxy', 'ActorRegistry', 'CallableProxy', 'Future', 'get_all', 'wait_all'] VERSION = (0, 4) def get_version(): ...
""" Pykka is a concurrency abstraction which makes actors look like regular objects. See http://jodal.github.com/pykka/ for more information. """ from pykka.actor import Actor from pykka.future import Future, get_all, wait_all from pykka.proxy import ActorProxy, CallableProxy from pykka.registry import ActorRegistry ...
<commit_before>""" Pykka is a concurrency abstraction which makes actors look like regular objects. See http://jodal.github.com/pykka/ for more information. """ from pykka.actor import Actor from pykka.future import Future, get_all, wait_all from pykka.proxy import ActorProxy, CallableProxy from pykka.registry import...
b74971eaf180c14fef68142bffc689b1bc7340f4
approvaltests/Namer.py
approvaltests/Namer.py
import inspect import os class Namer(object): ClassName = '' MethodName = '' Directory = '' def setForStack(self, caller): stackFrame = caller[self.frame] self.MethodName = stackFrame[3] self.ClassName = stackFrame[0].f_globals["__name__"] self.Directory = os.path.dirn...
import inspect import os class Namer(object): ClassName = '' MethodName = '' Directory = '' def setForStack(self, caller): stackFrame = caller[self.frame] self.MethodName = stackFrame[3] self.ClassName = stackFrame[0].f_globals["__name__"] self.Directory = os.path.dirn...
Create approval file path that works on Linux and Windows.
Create approval file path that works on Linux and Windows.
Python
apache-2.0
approvals/ApprovalTests.Python,approvals/ApprovalTests.Python,approvals/ApprovalTests.Python,tdpreece/ApprovalTests.Python
import inspect import os class Namer(object): ClassName = '' MethodName = '' Directory = '' def setForStack(self, caller): stackFrame = caller[self.frame] self.MethodName = stackFrame[3] self.ClassName = stackFrame[0].f_globals["__name__"] self.Directory = os.path.dirn...
import inspect import os class Namer(object): ClassName = '' MethodName = '' Directory = '' def setForStack(self, caller): stackFrame = caller[self.frame] self.MethodName = stackFrame[3] self.ClassName = stackFrame[0].f_globals["__name__"] self.Directory = os.path.dirn...
<commit_before>import inspect import os class Namer(object): ClassName = '' MethodName = '' Directory = '' def setForStack(self, caller): stackFrame = caller[self.frame] self.MethodName = stackFrame[3] self.ClassName = stackFrame[0].f_globals["__name__"] self.Directory...
import inspect import os class Namer(object): ClassName = '' MethodName = '' Directory = '' def setForStack(self, caller): stackFrame = caller[self.frame] self.MethodName = stackFrame[3] self.ClassName = stackFrame[0].f_globals["__name__"] self.Directory = os.path.dirn...
import inspect import os class Namer(object): ClassName = '' MethodName = '' Directory = '' def setForStack(self, caller): stackFrame = caller[self.frame] self.MethodName = stackFrame[3] self.ClassName = stackFrame[0].f_globals["__name__"] self.Directory = os.path.dirn...
<commit_before>import inspect import os class Namer(object): ClassName = '' MethodName = '' Directory = '' def setForStack(self, caller): stackFrame = caller[self.frame] self.MethodName = stackFrame[3] self.ClassName = stackFrame[0].f_globals["__name__"] self.Directory...
832256925a08c0bbfe3f507ef613d51e11ac8103
feature_extraction/extraction.py
feature_extraction/extraction.py
import numpy as np def extract_features(image, measurements): """ Given an image as a Numpy array and a set of measurement objects implementing a compute method returning a feature vector, return a combined feature vector. """ # TODO(liam): parallelize multiple measurements on an image by using Celery return...
import numpy as np def extract_features(image, measurements): """ Given an image as a Numpy array and a set of measurement objects implementing a compute method returning a feature vector, return a combined feature vector. """ # TODO(liam): parallelize multiple measurements on an image by using Celery return...
Add a function to normalize the feature vectors
Add a function to normalize the feature vectors
Python
apache-2.0
widoptimization-willett/feature-extraction
import numpy as np def extract_features(image, measurements): """ Given an image as a Numpy array and a set of measurement objects implementing a compute method returning a feature vector, return a combined feature vector. """ # TODO(liam): parallelize multiple measurements on an image by using Celery return...
import numpy as np def extract_features(image, measurements): """ Given an image as a Numpy array and a set of measurement objects implementing a compute method returning a feature vector, return a combined feature vector. """ # TODO(liam): parallelize multiple measurements on an image by using Celery return...
<commit_before>import numpy as np def extract_features(image, measurements): """ Given an image as a Numpy array and a set of measurement objects implementing a compute method returning a feature vector, return a combined feature vector. """ # TODO(liam): parallelize multiple measurements on an image by using C...
import numpy as np def extract_features(image, measurements): """ Given an image as a Numpy array and a set of measurement objects implementing a compute method returning a feature vector, return a combined feature vector. """ # TODO(liam): parallelize multiple measurements on an image by using Celery return...
import numpy as np def extract_features(image, measurements): """ Given an image as a Numpy array and a set of measurement objects implementing a compute method returning a feature vector, return a combined feature vector. """ # TODO(liam): parallelize multiple measurements on an image by using Celery return...
<commit_before>import numpy as np def extract_features(image, measurements): """ Given an image as a Numpy array and a set of measurement objects implementing a compute method returning a feature vector, return a combined feature vector. """ # TODO(liam): parallelize multiple measurements on an image by using C...
9ea35a99c30f2ec7ed3946e71a286e689d2a50a3
api/tests/test_signup.py
api/tests/test_signup.py
from django.test import TestCase from api.views.signup import signup from rest_framework.test import APIRequestFactory from api import factories, serializers from api.models import User from api.serializers import UserSerializer class SignupTest(TestCase): PASSWORD = 'test' def setUp(self): self.fac...
from django.test import TestCase from api.views.signup import signup from rest_framework.test import APIRequestFactory from api import factories from api.serializers import UserSerializer class SignupTest(TestCase): PASSWORD = 'test' REQUIRED_FIELD_ERROR = 'This field is required.' def setUp(self): ...
Add test for errors, but User fields need to become required first
Add test for errors, but User fields need to become required first
Python
mit
frostblooded/kanq,frostblooded/kanq,frostblooded/kanq,frostblooded/kanq,frostblooded/kanq
from django.test import TestCase from api.views.signup import signup from rest_framework.test import APIRequestFactory from api import factories, serializers from api.models import User from api.serializers import UserSerializer class SignupTest(TestCase): PASSWORD = 'test' def setUp(self): self.fac...
from django.test import TestCase from api.views.signup import signup from rest_framework.test import APIRequestFactory from api import factories from api.serializers import UserSerializer class SignupTest(TestCase): PASSWORD = 'test' REQUIRED_FIELD_ERROR = 'This field is required.' def setUp(self): ...
<commit_before>from django.test import TestCase from api.views.signup import signup from rest_framework.test import APIRequestFactory from api import factories, serializers from api.models import User from api.serializers import UserSerializer class SignupTest(TestCase): PASSWORD = 'test' def setUp(self): ...
from django.test import TestCase from api.views.signup import signup from rest_framework.test import APIRequestFactory from api import factories from api.serializers import UserSerializer class SignupTest(TestCase): PASSWORD = 'test' REQUIRED_FIELD_ERROR = 'This field is required.' def setUp(self): ...
from django.test import TestCase from api.views.signup import signup from rest_framework.test import APIRequestFactory from api import factories, serializers from api.models import User from api.serializers import UserSerializer class SignupTest(TestCase): PASSWORD = 'test' def setUp(self): self.fac...
<commit_before>from django.test import TestCase from api.views.signup import signup from rest_framework.test import APIRequestFactory from api import factories, serializers from api.models import User from api.serializers import UserSerializer class SignupTest(TestCase): PASSWORD = 'test' def setUp(self): ...
de9e8ab1a91e2a0e69971f9c23377f97e717b048
app/__init__.py
app/__init__.py
from app.main import bundle_app # noqa # NOTE: uncomment out while genrating migration # app = bundle_app({'MIGRATION': True})
import os from app.main import bundle_app # noqa # NOTE: uncomment out while genrating migration # app = bundle_app({'MIGRATION': True}) application = bundle_app({ 'CLI_OR_DEPLOY': True, 'GUNICORN': 'gunicorn' in os.environ.get('SERVER_SOFTWARE', '')}) # noqa
Add additional application for gunicorn.
Add additional application for gunicorn.
Python
mpl-2.0
mrf345/FQM,mrf345/FQM,mrf345/FQM,mrf345/FQM
from app.main import bundle_app # noqa # NOTE: uncomment out while genrating migration # app = bundle_app({'MIGRATION': True}) Add additional application for gunicorn.
import os from app.main import bundle_app # noqa # NOTE: uncomment out while genrating migration # app = bundle_app({'MIGRATION': True}) application = bundle_app({ 'CLI_OR_DEPLOY': True, 'GUNICORN': 'gunicorn' in os.environ.get('SERVER_SOFTWARE', '')}) # noqa
<commit_before>from app.main import bundle_app # noqa # NOTE: uncomment out while genrating migration # app = bundle_app({'MIGRATION': True}) <commit_msg>Add additional application for gunicorn.<commit_after>
import os from app.main import bundle_app # noqa # NOTE: uncomment out while genrating migration # app = bundle_app({'MIGRATION': True}) application = bundle_app({ 'CLI_OR_DEPLOY': True, 'GUNICORN': 'gunicorn' in os.environ.get('SERVER_SOFTWARE', '')}) # noqa
from app.main import bundle_app # noqa # NOTE: uncomment out while genrating migration # app = bundle_app({'MIGRATION': True}) Add additional application for gunicorn.import os from app.main import bundle_app # noqa # NOTE: uncomment out while genrating migration # app = bundle_app({'MIGRATION': True}) application =...
<commit_before>from app.main import bundle_app # noqa # NOTE: uncomment out while genrating migration # app = bundle_app({'MIGRATION': True}) <commit_msg>Add additional application for gunicorn.<commit_after>import os from app.main import bundle_app # noqa # NOTE: uncomment out while genrating migration # app = bundl...
4bd4c209862db759102c869da324db3e74347880
gold_digger/settings/__init__.py
gold_digger/settings/__init__.py
# -*- coding: utf-8 -*- from os import environ, path from ._settings_default import * from ..exceptions import ImproperlyConfigured PROFILE = environ.get("GOLD_DIGGER_PROFILE", "local") if PROFILE == "master": from ._settings_master import * elif PROFILE == "local": try: from ._settings_local import...
# -*- coding: utf-8 -*- from os import environ, path from ._settings_default import * from ..exceptions import ImproperlyConfigured PROFILE = environ.get("GOLD_DIGGER_PROFILE", "local") if PROFILE == "master": from ._settings_master import * elif PROFILE == "local": try: from ._settings_local import...
Remove staging from supported profiles
Remove staging from supported profiles
Python
apache-2.0
business-factory/gold-digger
# -*- coding: utf-8 -*- from os import environ, path from ._settings_default import * from ..exceptions import ImproperlyConfigured PROFILE = environ.get("GOLD_DIGGER_PROFILE", "local") if PROFILE == "master": from ._settings_master import * elif PROFILE == "local": try: from ._settings_local import...
# -*- coding: utf-8 -*- from os import environ, path from ._settings_default import * from ..exceptions import ImproperlyConfigured PROFILE = environ.get("GOLD_DIGGER_PROFILE", "local") if PROFILE == "master": from ._settings_master import * elif PROFILE == "local": try: from ._settings_local import...
<commit_before># -*- coding: utf-8 -*- from os import environ, path from ._settings_default import * from ..exceptions import ImproperlyConfigured PROFILE = environ.get("GOLD_DIGGER_PROFILE", "local") if PROFILE == "master": from ._settings_master import * elif PROFILE == "local": try: from ._settin...
# -*- coding: utf-8 -*- from os import environ, path from ._settings_default import * from ..exceptions import ImproperlyConfigured PROFILE = environ.get("GOLD_DIGGER_PROFILE", "local") if PROFILE == "master": from ._settings_master import * elif PROFILE == "local": try: from ._settings_local import...
# -*- coding: utf-8 -*- from os import environ, path from ._settings_default import * from ..exceptions import ImproperlyConfigured PROFILE = environ.get("GOLD_DIGGER_PROFILE", "local") if PROFILE == "master": from ._settings_master import * elif PROFILE == "local": try: from ._settings_local import...
<commit_before># -*- coding: utf-8 -*- from os import environ, path from ._settings_default import * from ..exceptions import ImproperlyConfigured PROFILE = environ.get("GOLD_DIGGER_PROFILE", "local") if PROFILE == "master": from ._settings_master import * elif PROFILE == "local": try: from ._settin...
60f666a7d3aac09b5fa8e3df29d0ff08b67eac3c
tools/gyp/find_mac_gcc_version.py
tools/gyp/find_mac_gcc_version.py
#!/usr/bin/env python # Copyright (c) 2013, 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 re import subprocess import sys def main(): job = subprocess.Popen(['xcode...
#!/usr/bin/env python # Copyright (c) 2013, 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 re import subprocess import sys def main(): job = subprocess.Popen(['xcode...
Revert "Revert "Use clang on mac if XCode >= 4.5""
Revert "Revert "Use clang on mac if XCode >= 4.5"" The V8 dependency has been removed, so we should be able to enable clang on mac again. [email protected] Review URL: https://codereview.chromium.org//14751012 git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@22304 260f80e4-7a28-3924-810f-c04153c831b5
Python
bsd-3-clause
dartino/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dartino/dart-sdk...
#!/usr/bin/env python # Copyright (c) 2013, 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 re import subprocess import sys def main(): job = subprocess.Popen(['xcode...
#!/usr/bin/env python # Copyright (c) 2013, 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 re import subprocess import sys def main(): job = subprocess.Popen(['xcode...
<commit_before>#!/usr/bin/env python # Copyright (c) 2013, 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 re import subprocess import sys def main(): job = subproces...
#!/usr/bin/env python # Copyright (c) 2013, 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 re import subprocess import sys def main(): job = subprocess.Popen(['xcode...
#!/usr/bin/env python # Copyright (c) 2013, 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 re import subprocess import sys def main(): job = subprocess.Popen(['xcode...
<commit_before>#!/usr/bin/env python # Copyright (c) 2013, 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 re import subprocess import sys def main(): job = subproces...
2206b4b96805e35a612f471fb8f843b35fe45021
code/dstruct/Word.py
code/dstruct/Word.py
#! /usr/bin/env python3 """ A Word class Originally obtained from the 'pharm' repository, but modified. """ class Word(object): doc_id = None sent_id = None insent_idx = None word = None pos = None ner = None lemma = None dep_path = None dep_parent = None sent_id = None ...
#! /usr/bin/env python3 """ A Word class Originally obtained from the 'pharm' repository, but modified. """ class Word(object): doc_id = None sent_id = None in_sent_idx = None word = None pos = None ner = None lemma = None dep_path = None dep_parent = None sent_id = None ...
Fix name of an attribute and PEP8-ify
Fix name of an attribute and PEP8-ify
Python
apache-2.0
HazyResearch/dd-genomics,HazyResearch/dd-genomics,HazyResearch/dd-genomics,amwenger/dd-genomics,HazyResearch/dd-genomics,rionda/dd-genomics,rionda/dd-genomics,amwenger/dd-genomics,amwenger/dd-genomics,HazyResearch/dd-genomics
#! /usr/bin/env python3 """ A Word class Originally obtained from the 'pharm' repository, but modified. """ class Word(object): doc_id = None sent_id = None insent_idx = None word = None pos = None ner = None lemma = None dep_path = None dep_parent = None sent_id = None ...
#! /usr/bin/env python3 """ A Word class Originally obtained from the 'pharm' repository, but modified. """ class Word(object): doc_id = None sent_id = None in_sent_idx = None word = None pos = None ner = None lemma = None dep_path = None dep_parent = None sent_id = None ...
<commit_before>#! /usr/bin/env python3 """ A Word class Originally obtained from the 'pharm' repository, but modified. """ class Word(object): doc_id = None sent_id = None insent_idx = None word = None pos = None ner = None lemma = None dep_path = None dep_parent = None sent...
#! /usr/bin/env python3 """ A Word class Originally obtained from the 'pharm' repository, but modified. """ class Word(object): doc_id = None sent_id = None in_sent_idx = None word = None pos = None ner = None lemma = None dep_path = None dep_parent = None sent_id = None ...
#! /usr/bin/env python3 """ A Word class Originally obtained from the 'pharm' repository, but modified. """ class Word(object): doc_id = None sent_id = None insent_idx = None word = None pos = None ner = None lemma = None dep_path = None dep_parent = None sent_id = None ...
<commit_before>#! /usr/bin/env python3 """ A Word class Originally obtained from the 'pharm' repository, but modified. """ class Word(object): doc_id = None sent_id = None insent_idx = None word = None pos = None ner = None lemma = None dep_path = None dep_parent = None sent...
85a047ce00f86727b2d260c609049f82927825ff
byteaccess/__init__.py
byteaccess/__init__.py
from byteaccess.byteaccess import ByteAccess, access_over_file from byteaccess.winmemaccess import access_over_process
from byteaccess.byteaccess import ByteAccess, access_over_file from byteaccess.winmemaccess import access_over_process __version__ = 'TODO: Figure out Python 3 version conventions'
Add version placeholder for now
Add version placeholder for now
Python
bsd-2-clause
ChadSki/byteaccess,ChadSki/halolib
from byteaccess.byteaccess import ByteAccess, access_over_file from byteaccess.winmemaccess import access_over_process Add version placeholder for now
from byteaccess.byteaccess import ByteAccess, access_over_file from byteaccess.winmemaccess import access_over_process __version__ = 'TODO: Figure out Python 3 version conventions'
<commit_before>from byteaccess.byteaccess import ByteAccess, access_over_file from byteaccess.winmemaccess import access_over_process <commit_msg>Add version placeholder for now<commit_after>
from byteaccess.byteaccess import ByteAccess, access_over_file from byteaccess.winmemaccess import access_over_process __version__ = 'TODO: Figure out Python 3 version conventions'
from byteaccess.byteaccess import ByteAccess, access_over_file from byteaccess.winmemaccess import access_over_process Add version placeholder for nowfrom byteaccess.byteaccess import ByteAccess, access_over_file from byteaccess.winmemaccess import access_over_process __version__ = 'TODO: Figure out Python 3 version c...
<commit_before>from byteaccess.byteaccess import ByteAccess, access_over_file from byteaccess.winmemaccess import access_over_process <commit_msg>Add version placeholder for now<commit_after>from byteaccess.byteaccess import ByteAccess, access_over_file from byteaccess.winmemaccess import access_over_process __version...
2d1c8a62295ed5150f31e11cdbbf98d4d74498d8
bin/cgroup-limits.py
bin/cgroup-limits.py
#!/usr/bin/python env_vars = {} def read_file(path): try: with open(path, 'r') as f: return f.read().strip() except IOError: return None def get_memory_limit(): limit = read_file('/sys/fs/cgroup/memory/memory.limit_in_bytes') if limit: env_vars['MEMORY_LIMIT_IN_B...
#!/usr/bin/python env_vars = {} def read_file(path): try: with open(path, 'r') as f: return f.read().strip() except IOError: return None def get_memory_limit(): limit = read_file('/sys/fs/cgroup/memory/memory.limit_in_bytes') if limit: env_vars['MEMORY_LIMIT_IN_B...
Set MAX_MEMORY_LIMIT_IN_BYTES to number returned by cgroups where there is no limit
Set MAX_MEMORY_LIMIT_IN_BYTES to number returned by cgroups where there is no limit
Python
apache-2.0
openshift/sti-base,hhorak/sti-base,soltysh/sti-base,openshift/sti-base,bparees/sti-base,sclorg/s2i-base-container,mfojtik/sti-base,mfojtik/sti-base,bparees/sti-base
#!/usr/bin/python env_vars = {} def read_file(path): try: with open(path, 'r') as f: return f.read().strip() except IOError: return None def get_memory_limit(): limit = read_file('/sys/fs/cgroup/memory/memory.limit_in_bytes') if limit: env_vars['MEMORY_LIMIT_IN_B...
#!/usr/bin/python env_vars = {} def read_file(path): try: with open(path, 'r') as f: return f.read().strip() except IOError: return None def get_memory_limit(): limit = read_file('/sys/fs/cgroup/memory/memory.limit_in_bytes') if limit: env_vars['MEMORY_LIMIT_IN_B...
<commit_before>#!/usr/bin/python env_vars = {} def read_file(path): try: with open(path, 'r') as f: return f.read().strip() except IOError: return None def get_memory_limit(): limit = read_file('/sys/fs/cgroup/memory/memory.limit_in_bytes') if limit: env_vars['ME...
#!/usr/bin/python env_vars = {} def read_file(path): try: with open(path, 'r') as f: return f.read().strip() except IOError: return None def get_memory_limit(): limit = read_file('/sys/fs/cgroup/memory/memory.limit_in_bytes') if limit: env_vars['MEMORY_LIMIT_IN_B...
#!/usr/bin/python env_vars = {} def read_file(path): try: with open(path, 'r') as f: return f.read().strip() except IOError: return None def get_memory_limit(): limit = read_file('/sys/fs/cgroup/memory/memory.limit_in_bytes') if limit: env_vars['MEMORY_LIMIT_IN_B...
<commit_before>#!/usr/bin/python env_vars = {} def read_file(path): try: with open(path, 'r') as f: return f.read().strip() except IOError: return None def get_memory_limit(): limit = read_file('/sys/fs/cgroup/memory/memory.limit_in_bytes') if limit: env_vars['ME...
911c79f8f76187601ac2df835541d6d76f172b3b
decorators.py
decorators.py
from django.db.models.signals import pre_save from django.dispatch import receiver def cleans_field(field_ref): """Decorator to registers a field cleaning methods on the pre_save signal. Args: field_ref (str): a label for the model field to clean, following the convention `app_name.ModelN...
from django.db.models.signals import pre_save from django.dispatch import receiver class NoValue(object): """Empty class for disambiguating calls to getattr""" pass def cleans_field(field_ref): """Decorator to registers a field cleaning methods on the pre_save signal. Args: field_ref (str):...
Create NoValue class to disambiguate getattr calls
Create NoValue class to disambiguate getattr calls
Python
mit
lamarmeigs/django-clean-fields
from django.db.models.signals import pre_save from django.dispatch import receiver def cleans_field(field_ref): """Decorator to registers a field cleaning methods on the pre_save signal. Args: field_ref (str): a label for the model field to clean, following the convention `app_name.ModelN...
from django.db.models.signals import pre_save from django.dispatch import receiver class NoValue(object): """Empty class for disambiguating calls to getattr""" pass def cleans_field(field_ref): """Decorator to registers a field cleaning methods on the pre_save signal. Args: field_ref (str):...
<commit_before>from django.db.models.signals import pre_save from django.dispatch import receiver def cleans_field(field_ref): """Decorator to registers a field cleaning methods on the pre_save signal. Args: field_ref (str): a label for the model field to clean, following the convention `...
from django.db.models.signals import pre_save from django.dispatch import receiver class NoValue(object): """Empty class for disambiguating calls to getattr""" pass def cleans_field(field_ref): """Decorator to registers a field cleaning methods on the pre_save signal. Args: field_ref (str):...
from django.db.models.signals import pre_save from django.dispatch import receiver def cleans_field(field_ref): """Decorator to registers a field cleaning methods on the pre_save signal. Args: field_ref (str): a label for the model field to clean, following the convention `app_name.ModelN...
<commit_before>from django.db.models.signals import pre_save from django.dispatch import receiver def cleans_field(field_ref): """Decorator to registers a field cleaning methods on the pre_save signal. Args: field_ref (str): a label for the model field to clean, following the convention `...
25dfc009b380b2a63619651dbcba2c7d7ade929c
deep_parse.py
deep_parse.py
#!/usr/bin/env python """Simple library for parsing deeply nested structure (dict, json) into regular object. You can specify fields to extract, and argument names in created object. Example content = { 'name': 'Bob', 'details': { 'email': '[email protected]', } } fields = ...
#!/usr/bin/env python """Simple library for parsing deeply nested structure (dict, json) into regular object. You can specify fields to extract, and argument names in created object. Example content = { 'name': 'Bob', 'details': { 'email': '[email protected]', } } fields = ...
Add __repr__ and __str__ methods to dummy object.
Add __repr__ and __str__ methods to dummy object.
Python
mit
bradojevic/deep-parse
#!/usr/bin/env python """Simple library for parsing deeply nested structure (dict, json) into regular object. You can specify fields to extract, and argument names in created object. Example content = { 'name': 'Bob', 'details': { 'email': '[email protected]', } } fields = ...
#!/usr/bin/env python """Simple library for parsing deeply nested structure (dict, json) into regular object. You can specify fields to extract, and argument names in created object. Example content = { 'name': 'Bob', 'details': { 'email': '[email protected]', } } fields = ...
<commit_before>#!/usr/bin/env python """Simple library for parsing deeply nested structure (dict, json) into regular object. You can specify fields to extract, and argument names in created object. Example content = { 'name': 'Bob', 'details': { 'email': '[email protected]', } ...
#!/usr/bin/env python """Simple library for parsing deeply nested structure (dict, json) into regular object. You can specify fields to extract, and argument names in created object. Example content = { 'name': 'Bob', 'details': { 'email': '[email protected]', } } fields = ...
#!/usr/bin/env python """Simple library for parsing deeply nested structure (dict, json) into regular object. You can specify fields to extract, and argument names in created object. Example content = { 'name': 'Bob', 'details': { 'email': '[email protected]', } } fields = ...
<commit_before>#!/usr/bin/env python """Simple library for parsing deeply nested structure (dict, json) into regular object. You can specify fields to extract, and argument names in created object. Example content = { 'name': 'Bob', 'details': { 'email': '[email protected]', } ...
905b7849d319e5147653754ceaead333873bd401
packager/rpm/test/test_build.py
packager/rpm/test/test_build.py
#! /usr/bin/python from build_rpm import BuildModelRPM from nose.tools import * @raises(TypeError) def test_fail_with_no_parameters(): BuildModelRPM(None) @raises(TypeError) def test_fail_with_one_parameter(): BuildModelRPM("hydrotrend") def test_hydrotrend_version_none(): BuildModelRPM("hydrotrend", No...
#! /usr/bin/python from packager.rpm.build import BuildRPM from nose.tools import * @raises(TypeError) def test_fail_with_no_parameters(): BuildRPM(None) @raises(TypeError) def test_fail_with_one_parameter(): BuildRPM("hydrotrend") def test_hydrotrend_version_none(): BuildRPM("hydrotrend", None) def te...
Update unit tests for packager.rpm.build.py
Update unit tests for packager.rpm.build.py
Python
mit
csdms/packagebuilder
#! /usr/bin/python from build_rpm import BuildModelRPM from nose.tools import * @raises(TypeError) def test_fail_with_no_parameters(): BuildModelRPM(None) @raises(TypeError) def test_fail_with_one_parameter(): BuildModelRPM("hydrotrend") def test_hydrotrend_version_none(): BuildModelRPM("hydrotrend", No...
#! /usr/bin/python from packager.rpm.build import BuildRPM from nose.tools import * @raises(TypeError) def test_fail_with_no_parameters(): BuildRPM(None) @raises(TypeError) def test_fail_with_one_parameter(): BuildRPM("hydrotrend") def test_hydrotrend_version_none(): BuildRPM("hydrotrend", None) def te...
<commit_before>#! /usr/bin/python from build_rpm import BuildModelRPM from nose.tools import * @raises(TypeError) def test_fail_with_no_parameters(): BuildModelRPM(None) @raises(TypeError) def test_fail_with_one_parameter(): BuildModelRPM("hydrotrend") def test_hydrotrend_version_none(): BuildModelRPM("...
#! /usr/bin/python from packager.rpm.build import BuildRPM from nose.tools import * @raises(TypeError) def test_fail_with_no_parameters(): BuildRPM(None) @raises(TypeError) def test_fail_with_one_parameter(): BuildRPM("hydrotrend") def test_hydrotrend_version_none(): BuildRPM("hydrotrend", None) def te...
#! /usr/bin/python from build_rpm import BuildModelRPM from nose.tools import * @raises(TypeError) def test_fail_with_no_parameters(): BuildModelRPM(None) @raises(TypeError) def test_fail_with_one_parameter(): BuildModelRPM("hydrotrend") def test_hydrotrend_version_none(): BuildModelRPM("hydrotrend", No...
<commit_before>#! /usr/bin/python from build_rpm import BuildModelRPM from nose.tools import * @raises(TypeError) def test_fail_with_no_parameters(): BuildModelRPM(None) @raises(TypeError) def test_fail_with_one_parameter(): BuildModelRPM("hydrotrend") def test_hydrotrend_version_none(): BuildModelRPM("...
cbcd4ebcc01646382595ce9ee10d278120ce00ce
pets/common/views.py
pets/common/views.py
from django.db.models import Count from django.shortcuts import render from django.views.generic import TemplateView from django.views.generic.base import ContextMixin from meupet import models def get_adoption_kinds(): return get_kind_list([models.Pet.FOR_ADOPTION, models.Pet.ADOPTED]) def get_lost_kinds(): ...
from django.db.models import Count from django.shortcuts import render from django.views.generic import TemplateView from django.views.generic.base import ContextMixin from meupet import models def get_adoption_kinds(): return get_kind_list([models.Pet.FOR_ADOPTION, models.Pet.ADOPTED]) def get_lost_kinds(): ...
Remove useless code from the home view
Remove useless code from the home view
Python
mit
dirtycoder/pets,dirtycoder/pets,dirtycoder/pets
from django.db.models import Count from django.shortcuts import render from django.views.generic import TemplateView from django.views.generic.base import ContextMixin from meupet import models def get_adoption_kinds(): return get_kind_list([models.Pet.FOR_ADOPTION, models.Pet.ADOPTED]) def get_lost_kinds(): ...
from django.db.models import Count from django.shortcuts import render from django.views.generic import TemplateView from django.views.generic.base import ContextMixin from meupet import models def get_adoption_kinds(): return get_kind_list([models.Pet.FOR_ADOPTION, models.Pet.ADOPTED]) def get_lost_kinds(): ...
<commit_before>from django.db.models import Count from django.shortcuts import render from django.views.generic import TemplateView from django.views.generic.base import ContextMixin from meupet import models def get_adoption_kinds(): return get_kind_list([models.Pet.FOR_ADOPTION, models.Pet.ADOPTED]) def get_...
from django.db.models import Count from django.shortcuts import render from django.views.generic import TemplateView from django.views.generic.base import ContextMixin from meupet import models def get_adoption_kinds(): return get_kind_list([models.Pet.FOR_ADOPTION, models.Pet.ADOPTED]) def get_lost_kinds(): ...
from django.db.models import Count from django.shortcuts import render from django.views.generic import TemplateView from django.views.generic.base import ContextMixin from meupet import models def get_adoption_kinds(): return get_kind_list([models.Pet.FOR_ADOPTION, models.Pet.ADOPTED]) def get_lost_kinds(): ...
<commit_before>from django.db.models import Count from django.shortcuts import render from django.views.generic import TemplateView from django.views.generic.base import ContextMixin from meupet import models def get_adoption_kinds(): return get_kind_list([models.Pet.FOR_ADOPTION, models.Pet.ADOPTED]) def get_...
a8c824741ac0c4bd9a12c2fa62050b2608e7ad22
kqml/kqml_string.py
kqml/kqml_string.py
from io import BytesIO from kqml import KQMLObject from .util import safe_decode class KQMLString(object): def __init__(self, data=None): if data is None: self.data = '' else: self.data = safe_decode(data) def __len__(self): return len(self.data) def char_a...
from io import BytesIO from kqml import KQMLObject from .util import safe_decode class KQMLString(KQMLObject): def __init__(self, data=None): if data is None: self.data = '' else: self.data = safe_decode(data) def __len__(self): return len(self.data) def c...
Make KQMLString subclass of KQMLObject.
Make KQMLString subclass of KQMLObject.
Python
bsd-2-clause
bgyori/pykqml
from io import BytesIO from kqml import KQMLObject from .util import safe_decode class KQMLString(object): def __init__(self, data=None): if data is None: self.data = '' else: self.data = safe_decode(data) def __len__(self): return len(self.data) def char_a...
from io import BytesIO from kqml import KQMLObject from .util import safe_decode class KQMLString(KQMLObject): def __init__(self, data=None): if data is None: self.data = '' else: self.data = safe_decode(data) def __len__(self): return len(self.data) def c...
<commit_before>from io import BytesIO from kqml import KQMLObject from .util import safe_decode class KQMLString(object): def __init__(self, data=None): if data is None: self.data = '' else: self.data = safe_decode(data) def __len__(self): return len(self.data) ...
from io import BytesIO from kqml import KQMLObject from .util import safe_decode class KQMLString(KQMLObject): def __init__(self, data=None): if data is None: self.data = '' else: self.data = safe_decode(data) def __len__(self): return len(self.data) def c...
from io import BytesIO from kqml import KQMLObject from .util import safe_decode class KQMLString(object): def __init__(self, data=None): if data is None: self.data = '' else: self.data = safe_decode(data) def __len__(self): return len(self.data) def char_a...
<commit_before>from io import BytesIO from kqml import KQMLObject from .util import safe_decode class KQMLString(object): def __init__(self, data=None): if data is None: self.data = '' else: self.data = safe_decode(data) def __len__(self): return len(self.data) ...
736d4b8207cb63bda86f4338c08cc8719416fbe7
gauge/__init__.py
gauge/__init__.py
# -*- coding: utf-8 -*- """ gauge ~~~~~ Deterministic linear gauge library. :copyright: (c) 2013-2017 by What! Studio :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from gauge.__about__ import __version__ # noqa from gauge.constants import CLAMP, ERROR, OK, O...
# -*- coding: utf-8 -*- """ gauge ~~~~~ Deterministic linear gauge library. :copyright: (c) 2013-2017 by What! Studio :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from gauge.__about__ import __version__ # noqa from gauge.constants import CLAMP, ERROR, OK, O...
Fix pickle failure in PyPy
Fix pickle failure in PyPy
Python
bsd-3-clause
what-studio/gauge
# -*- coding: utf-8 -*- """ gauge ~~~~~ Deterministic linear gauge library. :copyright: (c) 2013-2017 by What! Studio :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from gauge.__about__ import __version__ # noqa from gauge.constants import CLAMP, ERROR, OK, O...
# -*- coding: utf-8 -*- """ gauge ~~~~~ Deterministic linear gauge library. :copyright: (c) 2013-2017 by What! Studio :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from gauge.__about__ import __version__ # noqa from gauge.constants import CLAMP, ERROR, OK, O...
<commit_before># -*- coding: utf-8 -*- """ gauge ~~~~~ Deterministic linear gauge library. :copyright: (c) 2013-2017 by What! Studio :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from gauge.__about__ import __version__ # noqa from gauge.constants import CLAM...
# -*- coding: utf-8 -*- """ gauge ~~~~~ Deterministic linear gauge library. :copyright: (c) 2013-2017 by What! Studio :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from gauge.__about__ import __version__ # noqa from gauge.constants import CLAMP, ERROR, OK, O...
# -*- coding: utf-8 -*- """ gauge ~~~~~ Deterministic linear gauge library. :copyright: (c) 2013-2017 by What! Studio :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from gauge.__about__ import __version__ # noqa from gauge.constants import CLAMP, ERROR, OK, O...
<commit_before># -*- coding: utf-8 -*- """ gauge ~~~~~ Deterministic linear gauge library. :copyright: (c) 2013-2017 by What! Studio :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from gauge.__about__ import __version__ # noqa from gauge.constants import CLAM...
cfcd3aa71001f74915a938aa0ec1ae58c4db3e06
src/oscar_accounts/__init__.py
src/oscar_accounts/__init__.py
# Setting for template directory not found by app_directories.Loader. This # allows templates to be identified by two paths which enables a template to be # extended by a template with the same identifier. TEMPLATE_DIR = os.path.join( os.path.dirname(os.path.abspath(__file__)), 'templates/accounts') default_...
import os # Setting for template directory not found by app_directories.Loader. This # allows templates to be identified by two paths which enables a template to be # extended by a template with the same identifier. TEMPLATE_DIR = os.path.join( os.path.dirname(os.path.abspath(__file__)), 'templates/accounts'...
Undo removing `import os` statement
Undo removing `import os` statement
Python
bsd-3-clause
django-oscar/django-oscar-accounts,django-oscar/django-oscar-accounts
# Setting for template directory not found by app_directories.Loader. This # allows templates to be identified by two paths which enables a template to be # extended by a template with the same identifier. TEMPLATE_DIR = os.path.join( os.path.dirname(os.path.abspath(__file__)), 'templates/accounts') default_...
import os # Setting for template directory not found by app_directories.Loader. This # allows templates to be identified by two paths which enables a template to be # extended by a template with the same identifier. TEMPLATE_DIR = os.path.join( os.path.dirname(os.path.abspath(__file__)), 'templates/accounts'...
<commit_before># Setting for template directory not found by app_directories.Loader. This # allows templates to be identified by two paths which enables a template to be # extended by a template with the same identifier. TEMPLATE_DIR = os.path.join( os.path.dirname(os.path.abspath(__file__)), 'templates/accoun...
import os # Setting for template directory not found by app_directories.Loader. This # allows templates to be identified by two paths which enables a template to be # extended by a template with the same identifier. TEMPLATE_DIR = os.path.join( os.path.dirname(os.path.abspath(__file__)), 'templates/accounts'...
# Setting for template directory not found by app_directories.Loader. This # allows templates to be identified by two paths which enables a template to be # extended by a template with the same identifier. TEMPLATE_DIR = os.path.join( os.path.dirname(os.path.abspath(__file__)), 'templates/accounts') default_...
<commit_before># Setting for template directory not found by app_directories.Loader. This # allows templates to be identified by two paths which enables a template to be # extended by a template with the same identifier. TEMPLATE_DIR = os.path.join( os.path.dirname(os.path.abspath(__file__)), 'templates/accoun...
9a239c993502e3f317edd478a5d8b5f225c24b18
globus_cli/run.py
globus_cli/run.py
from globus_cli.parsing import globus_main_func from globus_cli.login import login_command from globus_cli.list_commands import list_commands from globus_cli.config_command import config_command from globus_cli.helpers import common_options from globus_cli.services.auth import auth_command from globus_cli.services.tr...
from globus_cli.parsing import globus_main_func from globus_cli.login import login_command from globus_cli.list_commands import list_commands from globus_cli.config_command import config_command from globus_cli.services.auth import auth_command from globus_cli.services.transfer import transfer_command @globus_main_...
Fix doubled-help on main command
Fix doubled-help on main command Main command was being doubly decorated with the common options. As a result, it had funky looking helptext.
Python
apache-2.0
globus/globus-cli,globus/globus-cli
from globus_cli.parsing import globus_main_func from globus_cli.login import login_command from globus_cli.list_commands import list_commands from globus_cli.config_command import config_command from globus_cli.helpers import common_options from globus_cli.services.auth import auth_command from globus_cli.services.tr...
from globus_cli.parsing import globus_main_func from globus_cli.login import login_command from globus_cli.list_commands import list_commands from globus_cli.config_command import config_command from globus_cli.services.auth import auth_command from globus_cli.services.transfer import transfer_command @globus_main_...
<commit_before>from globus_cli.parsing import globus_main_func from globus_cli.login import login_command from globus_cli.list_commands import list_commands from globus_cli.config_command import config_command from globus_cli.helpers import common_options from globus_cli.services.auth import auth_command from globus_...
from globus_cli.parsing import globus_main_func from globus_cli.login import login_command from globus_cli.list_commands import list_commands from globus_cli.config_command import config_command from globus_cli.services.auth import auth_command from globus_cli.services.transfer import transfer_command @globus_main_...
from globus_cli.parsing import globus_main_func from globus_cli.login import login_command from globus_cli.list_commands import list_commands from globus_cli.config_command import config_command from globus_cli.helpers import common_options from globus_cli.services.auth import auth_command from globus_cli.services.tr...
<commit_before>from globus_cli.parsing import globus_main_func from globus_cli.login import login_command from globus_cli.list_commands import list_commands from globus_cli.config_command import config_command from globus_cli.helpers import common_options from globus_cli.services.auth import auth_command from globus_...
d406aa60f31f5e318a46e84539546a4452574ce6
src/rtruffle/source_section.py
src/rtruffle/source_section.py
class SourceCoordinate(object): _immutable_fields_ = ['_start_line', '_start_column', '_char_idx'] def __init__(self, start_line, start_column, char_idx): self._start_line = start_line self._start_column = start_column self._char_idx = char_idx def get_start_line(self): ...
class SourceCoordinate(object): _immutable_fields_ = ['_start_line', '_start_column', '_char_idx'] def __init__(self, start_line, start_column, char_idx): self._start_line = start_line self._start_column = start_column self._char_idx = char_idx def get_start_line(self): ...
Initialize char_length with a number
Initialize char_length with a number And make var name `file` less ambiguous by using `file_name` instead. Signed-off-by: Stefan Marr <[email protected]>
Python
mit
SOM-st/RPySOM,smarr/RTruffleSOM,SOM-st/RTruffleSOM,smarr/PySOM,SOM-st/PySOM,SOM-st/RPySOM,smarr/RTruffleSOM,SOM-st/RTruffleSOM,smarr/PySOM,SOM-st/PySOM
class SourceCoordinate(object): _immutable_fields_ = ['_start_line', '_start_column', '_char_idx'] def __init__(self, start_line, start_column, char_idx): self._start_line = start_line self._start_column = start_column self._char_idx = char_idx def get_start_line(self): ...
class SourceCoordinate(object): _immutable_fields_ = ['_start_line', '_start_column', '_char_idx'] def __init__(self, start_line, start_column, char_idx): self._start_line = start_line self._start_column = start_column self._char_idx = char_idx def get_start_line(self): ...
<commit_before>class SourceCoordinate(object): _immutable_fields_ = ['_start_line', '_start_column', '_char_idx'] def __init__(self, start_line, start_column, char_idx): self._start_line = start_line self._start_column = start_column self._char_idx = char_idx def get_start_l...
class SourceCoordinate(object): _immutable_fields_ = ['_start_line', '_start_column', '_char_idx'] def __init__(self, start_line, start_column, char_idx): self._start_line = start_line self._start_column = start_column self._char_idx = char_idx def get_start_line(self): ...
class SourceCoordinate(object): _immutable_fields_ = ['_start_line', '_start_column', '_char_idx'] def __init__(self, start_line, start_column, char_idx): self._start_line = start_line self._start_column = start_column self._char_idx = char_idx def get_start_line(self): ...
<commit_before>class SourceCoordinate(object): _immutable_fields_ = ['_start_line', '_start_column', '_char_idx'] def __init__(self, start_line, start_column, char_idx): self._start_line = start_line self._start_column = start_column self._char_idx = char_idx def get_start_l...
321a0cea6a71e29a3f00116c52c1056d7dcfef7e
daskfunk/__init__.py
daskfunk/__init__.py
from __future__ import absolute_import, division, print_function from .core import compile from ._info import __version__
from __future__ import absolute_import, division, print_function from .core import compile
Remove import of deleted file
Remove import of deleted file
Python
mit
Savvysherpa/dask-funk
from __future__ import absolute_import, division, print_function from .core import compile from ._info import __version__ Remove import of deleted file
from __future__ import absolute_import, division, print_function from .core import compile
<commit_before>from __future__ import absolute_import, division, print_function from .core import compile from ._info import __version__ <commit_msg>Remove import of deleted file<commit_after>
from __future__ import absolute_import, division, print_function from .core import compile
from __future__ import absolute_import, division, print_function from .core import compile from ._info import __version__ Remove import of deleted filefrom __future__ import absolute_import, division, print_function from .core import compile
<commit_before>from __future__ import absolute_import, division, print_function from .core import compile from ._info import __version__ <commit_msg>Remove import of deleted file<commit_after>from __future__ import absolute_import, division, print_function from .core import compile
aff8945aef3f10fa9d1243b25301e84611c27422
aleph/views/status_api.py
aleph/views/status_api.py
import logging from flask import Blueprint, request from aleph.model import Collection from aleph.queues import get_active_collection_status from aleph.views.util import jsonify from aleph.logic import resolver from aleph.views.util import require log = logging.getLogger(__name__) blueprint = Blueprint('status_api',...
import logging from flask import Blueprint, request from aleph.model import Collection from aleph.queues import get_active_collection_status from aleph.views.util import jsonify from aleph.views.util import require log = logging.getLogger(__name__) blueprint = Blueprint('status_api', __name__) @blueprint.route('/a...
Load only the active collections instead of all accessible collections
Load only the active collections instead of all accessible collections
Python
mit
alephdata/aleph,alephdata/aleph,pudo/aleph,alephdata/aleph,pudo/aleph,pudo/aleph,alephdata/aleph,alephdata/aleph
import logging from flask import Blueprint, request from aleph.model import Collection from aleph.queues import get_active_collection_status from aleph.views.util import jsonify from aleph.logic import resolver from aleph.views.util import require log = logging.getLogger(__name__) blueprint = Blueprint('status_api',...
import logging from flask import Blueprint, request from aleph.model import Collection from aleph.queues import get_active_collection_status from aleph.views.util import jsonify from aleph.views.util import require log = logging.getLogger(__name__) blueprint = Blueprint('status_api', __name__) @blueprint.route('/a...
<commit_before>import logging from flask import Blueprint, request from aleph.model import Collection from aleph.queues import get_active_collection_status from aleph.views.util import jsonify from aleph.logic import resolver from aleph.views.util import require log = logging.getLogger(__name__) blueprint = Blueprin...
import logging from flask import Blueprint, request from aleph.model import Collection from aleph.queues import get_active_collection_status from aleph.views.util import jsonify from aleph.views.util import require log = logging.getLogger(__name__) blueprint = Blueprint('status_api', __name__) @blueprint.route('/a...
import logging from flask import Blueprint, request from aleph.model import Collection from aleph.queues import get_active_collection_status from aleph.views.util import jsonify from aleph.logic import resolver from aleph.views.util import require log = logging.getLogger(__name__) blueprint = Blueprint('status_api',...
<commit_before>import logging from flask import Blueprint, request from aleph.model import Collection from aleph.queues import get_active_collection_status from aleph.views.util import jsonify from aleph.logic import resolver from aleph.views.util import require log = logging.getLogger(__name__) blueprint = Blueprin...