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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a2582b3352582034af1b8dff99d4ac39a15d9b54 | shuffler.py | shuffler.py | #!/usr/bin/env python3
import argparse
import random
import sys
DESCRIPTION = '''Shuffle the arguments received, if called without arguments
the lines read from stdin will be shuffled and printed to
stdout'''
def get_list():
return sys.stdin.readlines()
def print_list(list_):
... | #!/usr/bin/env python3
import argparse
import random
import sys
DESCRIPTION = '''Shuffle the arguments received, if called without arguments
the lines read from stdin will be shuffled and printed to
stdout'''
def get_list():
return sys.stdin.readlines()
def print_list(list_):... | Fix script to pass pep8 | Fix script to pass pep8
| Python | apache-2.0 | aebm/shuffler | #!/usr/bin/env python3
import argparse
import random
import sys
DESCRIPTION = '''Shuffle the arguments received, if called without arguments
the lines read from stdin will be shuffled and printed to
stdout'''
def get_list():
return sys.stdin.readlines()
def print_list(list_):
... | #!/usr/bin/env python3
import argparse
import random
import sys
DESCRIPTION = '''Shuffle the arguments received, if called without arguments
the lines read from stdin will be shuffled and printed to
stdout'''
def get_list():
return sys.stdin.readlines()
def print_list(list_):... | <commit_before>#!/usr/bin/env python3
import argparse
import random
import sys
DESCRIPTION = '''Shuffle the arguments received, if called without arguments
the lines read from stdin will be shuffled and printed to
stdout'''
def get_list():
return sys.stdin.readlines()
def prin... | #!/usr/bin/env python3
import argparse
import random
import sys
DESCRIPTION = '''Shuffle the arguments received, if called without arguments
the lines read from stdin will be shuffled and printed to
stdout'''
def get_list():
return sys.stdin.readlines()
def print_list(list_):... | #!/usr/bin/env python3
import argparse
import random
import sys
DESCRIPTION = '''Shuffle the arguments received, if called without arguments
the lines read from stdin will be shuffled and printed to
stdout'''
def get_list():
return sys.stdin.readlines()
def print_list(list_):
... | <commit_before>#!/usr/bin/env python3
import argparse
import random
import sys
DESCRIPTION = '''Shuffle the arguments received, if called without arguments
the lines read from stdin will be shuffled and printed to
stdout'''
def get_list():
return sys.stdin.readlines()
def prin... |
6a83c4808d7f1104aba832f53bcd25fb98be1686 | pycrs/__init__.py | pycrs/__init__.py | """
# PyCRS
PyCRS is a pure Python GIS package for reading, writing, and converting between various
common coordinate reference system (CRS) string and data source formats.
- [Home Page](http://github.com/karimbahgat/PyCRS)
- [API Documentation](http://pythonhosted.org/PyCRS)
"""
__version__ = "0.1.4"
from . imp... | """
# PyCRS
PyCRS is a pure Python GIS package for reading, writing, and converting between various
common coordinate reference system (CRS) string and data source formats.
- [Home Page](http://github.com/karimbahgat/PyCRS)
- [API Documentation](http://pythonhosted.org/PyCRS)
"""
__version__ = "1.0.0-dev"
from .... | Bump to 1.0 dev version | Bump to 1.0 dev version
| Python | mit | karimbahgat/PyCRS | """
# PyCRS
PyCRS is a pure Python GIS package for reading, writing, and converting between various
common coordinate reference system (CRS) string and data source formats.
- [Home Page](http://github.com/karimbahgat/PyCRS)
- [API Documentation](http://pythonhosted.org/PyCRS)
"""
__version__ = "0.1.4"
from . imp... | """
# PyCRS
PyCRS is a pure Python GIS package for reading, writing, and converting between various
common coordinate reference system (CRS) string and data source formats.
- [Home Page](http://github.com/karimbahgat/PyCRS)
- [API Documentation](http://pythonhosted.org/PyCRS)
"""
__version__ = "1.0.0-dev"
from .... | <commit_before>"""
# PyCRS
PyCRS is a pure Python GIS package for reading, writing, and converting between various
common coordinate reference system (CRS) string and data source formats.
- [Home Page](http://github.com/karimbahgat/PyCRS)
- [API Documentation](http://pythonhosted.org/PyCRS)
"""
__version__ = "0.1.... | """
# PyCRS
PyCRS is a pure Python GIS package for reading, writing, and converting between various
common coordinate reference system (CRS) string and data source formats.
- [Home Page](http://github.com/karimbahgat/PyCRS)
- [API Documentation](http://pythonhosted.org/PyCRS)
"""
__version__ = "1.0.0-dev"
from .... | """
# PyCRS
PyCRS is a pure Python GIS package for reading, writing, and converting between various
common coordinate reference system (CRS) string and data source formats.
- [Home Page](http://github.com/karimbahgat/PyCRS)
- [API Documentation](http://pythonhosted.org/PyCRS)
"""
__version__ = "0.1.4"
from . imp... | <commit_before>"""
# PyCRS
PyCRS is a pure Python GIS package for reading, writing, and converting between various
common coordinate reference system (CRS) string and data source formats.
- [Home Page](http://github.com/karimbahgat/PyCRS)
- [API Documentation](http://pythonhosted.org/PyCRS)
"""
__version__ = "0.1.... |
a510d20cebe2aff86a6bf842d063b5df8937a7ec | raven/contrib/pylons/__init__.py | raven/contrib/pylons/__init__.py | """
raven.contrib.pylons
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from raven.middleware import Sentry as Middleware
from raven.base import Client
class Sentry(Middleware):
def __init__(self, app, config):
... | """
raven.contrib.pylons
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from raven.middleware import Sentry as Middleware
from raven.base import Client
def list_from_setting(config, setting):
value = config.get(setting)... | Update site and project names for pylons integration. Fix behavior of empty lists. Add DSN. | Update site and project names for pylons integration. Fix behavior of empty lists. Add DSN.
| Python | bsd-3-clause | tarkatronic/opbeat_python,tarkatronic/opbeat_python,inspirehep/raven-python,ticosax/opbeat_python,jbarbuto/raven-python,jmagnusson/raven-python,ronaldevers/raven-python,akalipetis/raven-python,collective/mr.poe,patrys/opbeat_python,arthurlogilab/raven-python,percipient/raven-python,inspirehep/raven-python,ronaldevers/r... | """
raven.contrib.pylons
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from raven.middleware import Sentry as Middleware
from raven.base import Client
class Sentry(Middleware):
def __init__(self, app, config):
... | """
raven.contrib.pylons
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from raven.middleware import Sentry as Middleware
from raven.base import Client
def list_from_setting(config, setting):
value = config.get(setting)... | <commit_before>"""
raven.contrib.pylons
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from raven.middleware import Sentry as Middleware
from raven.base import Client
class Sentry(Middleware):
def __init__(self, app, c... | """
raven.contrib.pylons
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from raven.middleware import Sentry as Middleware
from raven.base import Client
def list_from_setting(config, setting):
value = config.get(setting)... | """
raven.contrib.pylons
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from raven.middleware import Sentry as Middleware
from raven.base import Client
class Sentry(Middleware):
def __init__(self, app, config):
... | <commit_before>"""
raven.contrib.pylons
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from raven.middleware import Sentry as Middleware
from raven.base import Client
class Sentry(Middleware):
def __init__(self, app, c... |
a3570205c90dd8757a833aed4f4069fbd33028e0 | course/views.py | course/views.py | from django.shortcuts import render, redirect, get_object_or_404
from django.urls import reverse
from mainmodels.models import Category, Course, CourseInCategory
from django.contrib.auth.models import User
# Create your views here.
def createCourse(req):
if req.method == 'POST':
try:
courseName ... | from django.shortcuts import render, redirect, get_object_or_404
from django.urls import reverse
from mainmodels.models import Category, Course, CourseInCategory
# Create your views here.
def createCourse(req):
if req.method == 'POST':
try:
courseName = req.POST['courseName']
courseC... | Remove fixed owner and make loged in user instead | Remove fixed owner and make loged in user instead
| Python | apache-2.0 | PNNutkung/Coursing-Field,PNNutkung/Coursing-Field,PNNutkung/Coursing-Field | from django.shortcuts import render, redirect, get_object_or_404
from django.urls import reverse
from mainmodels.models import Category, Course, CourseInCategory
from django.contrib.auth.models import User
# Create your views here.
def createCourse(req):
if req.method == 'POST':
try:
courseName ... | from django.shortcuts import render, redirect, get_object_or_404
from django.urls import reverse
from mainmodels.models import Category, Course, CourseInCategory
# Create your views here.
def createCourse(req):
if req.method == 'POST':
try:
courseName = req.POST['courseName']
courseC... | <commit_before>from django.shortcuts import render, redirect, get_object_or_404
from django.urls import reverse
from mainmodels.models import Category, Course, CourseInCategory
from django.contrib.auth.models import User
# Create your views here.
def createCourse(req):
if req.method == 'POST':
try:
... | from django.shortcuts import render, redirect, get_object_or_404
from django.urls import reverse
from mainmodels.models import Category, Course, CourseInCategory
# Create your views here.
def createCourse(req):
if req.method == 'POST':
try:
courseName = req.POST['courseName']
courseC... | from django.shortcuts import render, redirect, get_object_or_404
from django.urls import reverse
from mainmodels.models import Category, Course, CourseInCategory
from django.contrib.auth.models import User
# Create your views here.
def createCourse(req):
if req.method == 'POST':
try:
courseName ... | <commit_before>from django.shortcuts import render, redirect, get_object_or_404
from django.urls import reverse
from mainmodels.models import Category, Course, CourseInCategory
from django.contrib.auth.models import User
# Create your views here.
def createCourse(req):
if req.method == 'POST':
try:
... |
6f7890c8b29670f613b6a551ebac2b383f3a7a64 | tests/test_recipes.py | tests/test_recipes.py | import unittest
from brew.constants import IMPERIAL_UNITS
from brew.constants import SI_UNITS
from brew.recipes import Recipe
from fixtures import grain_additions
from fixtures import hop_additions
from fixtures import recipe
class TestRecipe(unittest.TestCase):
def setUp(self):
# Define Grains
... | import unittest
from brew.constants import IMPERIAL_UNITS
from brew.constants import SI_UNITS
from brew.recipes import Recipe
from fixtures import grain_additions
from fixtures import hop_additions
from fixtures import recipe
from fixtures import yeast
class TestRecipe(unittest.TestCase):
def setUp(self):
... | Test units mismatch in recipe | Test units mismatch in recipe
| Python | mit | chrisgilmerproj/brewday,chrisgilmerproj/brewday | import unittest
from brew.constants import IMPERIAL_UNITS
from brew.constants import SI_UNITS
from brew.recipes import Recipe
from fixtures import grain_additions
from fixtures import hop_additions
from fixtures import recipe
class TestRecipe(unittest.TestCase):
def setUp(self):
# Define Grains
... | import unittest
from brew.constants import IMPERIAL_UNITS
from brew.constants import SI_UNITS
from brew.recipes import Recipe
from fixtures import grain_additions
from fixtures import hop_additions
from fixtures import recipe
from fixtures import yeast
class TestRecipe(unittest.TestCase):
def setUp(self):
... | <commit_before>import unittest
from brew.constants import IMPERIAL_UNITS
from brew.constants import SI_UNITS
from brew.recipes import Recipe
from fixtures import grain_additions
from fixtures import hop_additions
from fixtures import recipe
class TestRecipe(unittest.TestCase):
def setUp(self):
# Define ... | import unittest
from brew.constants import IMPERIAL_UNITS
from brew.constants import SI_UNITS
from brew.recipes import Recipe
from fixtures import grain_additions
from fixtures import hop_additions
from fixtures import recipe
from fixtures import yeast
class TestRecipe(unittest.TestCase):
def setUp(self):
... | import unittest
from brew.constants import IMPERIAL_UNITS
from brew.constants import SI_UNITS
from brew.recipes import Recipe
from fixtures import grain_additions
from fixtures import hop_additions
from fixtures import recipe
class TestRecipe(unittest.TestCase):
def setUp(self):
# Define Grains
... | <commit_before>import unittest
from brew.constants import IMPERIAL_UNITS
from brew.constants import SI_UNITS
from brew.recipes import Recipe
from fixtures import grain_additions
from fixtures import hop_additions
from fixtures import recipe
class TestRecipe(unittest.TestCase):
def setUp(self):
# Define ... |
f0c374eba55cdeb56bf3526ea0da041556f6ffe2 | tests/test_yamlmod.py | tests/test_yamlmod.py | import os
import sys
from nose.tools import *
def setup_yamlmod():
import yamlmod
reload(yamlmod)
def teardown_yamlmod():
import yamlmod
for hook in sys.meta_path:
if isinstance(hook, yamlmod.YamlImportHook):
sys.meta_path.remove(hook)
break
@with_setup(setup_yamlmod, teardown_yamlmod)
def test_import_... | import os
import sys
from nose.tools import *
try:
from importlib import reload
except ImportError:
pass
def setup_yamlmod():
import yamlmod
reload(yamlmod)
def teardown_yamlmod():
import yamlmod
for hook in sys.meta_path:
if isinstance(hook, yamlmod.YamlImportHook):
sys.meta_path.remove(hook)
break
... | Fix tests on python 3 | Fix tests on python 3
| Python | mit | sciyoshi/yamlmod | import os
import sys
from nose.tools import *
def setup_yamlmod():
import yamlmod
reload(yamlmod)
def teardown_yamlmod():
import yamlmod
for hook in sys.meta_path:
if isinstance(hook, yamlmod.YamlImportHook):
sys.meta_path.remove(hook)
break
@with_setup(setup_yamlmod, teardown_yamlmod)
def test_import_... | import os
import sys
from nose.tools import *
try:
from importlib import reload
except ImportError:
pass
def setup_yamlmod():
import yamlmod
reload(yamlmod)
def teardown_yamlmod():
import yamlmod
for hook in sys.meta_path:
if isinstance(hook, yamlmod.YamlImportHook):
sys.meta_path.remove(hook)
break
... | <commit_before>import os
import sys
from nose.tools import *
def setup_yamlmod():
import yamlmod
reload(yamlmod)
def teardown_yamlmod():
import yamlmod
for hook in sys.meta_path:
if isinstance(hook, yamlmod.YamlImportHook):
sys.meta_path.remove(hook)
break
@with_setup(setup_yamlmod, teardown_yamlmod)
d... | import os
import sys
from nose.tools import *
try:
from importlib import reload
except ImportError:
pass
def setup_yamlmod():
import yamlmod
reload(yamlmod)
def teardown_yamlmod():
import yamlmod
for hook in sys.meta_path:
if isinstance(hook, yamlmod.YamlImportHook):
sys.meta_path.remove(hook)
break
... | import os
import sys
from nose.tools import *
def setup_yamlmod():
import yamlmod
reload(yamlmod)
def teardown_yamlmod():
import yamlmod
for hook in sys.meta_path:
if isinstance(hook, yamlmod.YamlImportHook):
sys.meta_path.remove(hook)
break
@with_setup(setup_yamlmod, teardown_yamlmod)
def test_import_... | <commit_before>import os
import sys
from nose.tools import *
def setup_yamlmod():
import yamlmod
reload(yamlmod)
def teardown_yamlmod():
import yamlmod
for hook in sys.meta_path:
if isinstance(hook, yamlmod.YamlImportHook):
sys.meta_path.remove(hook)
break
@with_setup(setup_yamlmod, teardown_yamlmod)
d... |
931a858dc1cfde1652d21e1ccd60a82dde683ce3 | moxie/butterfield.py | moxie/butterfield.py | import os
import json
import asyncio
from butterfield.utils import at_bot
from aiodocker import Docker
from aiocore import Service
WEB_ROOT = os.environ.get("MOXIE_WEB_URL", "http://localhost:8888")
@asyncio.coroutine
def events(bot):
docker = Docker()
events = docker.events
events.saferun()
stream... | import os
import json
import asyncio
from butterfield.utils import at_bot
from aiodocker import Docker
from aiocore import Service
WEB_ROOT = os.environ.get("MOXIE_WEB_URL", "http://localhost:8888")
@asyncio.coroutine
def events(bot):
docker = Docker()
events = docker.events
events.saferun()
stream... | Add simple "yo" bot command | Add simple "yo" bot command
| Python | mit | paultag/moxie,loandy/moxie,mileswwatkins/moxie,mileswwatkins/moxie,paultag/moxie,loandy/moxie,loandy/moxie,paultag/moxie,rshorey/moxie,rshorey/moxie,rshorey/moxie,mileswwatkins/moxie | import os
import json
import asyncio
from butterfield.utils import at_bot
from aiodocker import Docker
from aiocore import Service
WEB_ROOT = os.environ.get("MOXIE_WEB_URL", "http://localhost:8888")
@asyncio.coroutine
def events(bot):
docker = Docker()
events = docker.events
events.saferun()
stream... | import os
import json
import asyncio
from butterfield.utils import at_bot
from aiodocker import Docker
from aiocore import Service
WEB_ROOT = os.environ.get("MOXIE_WEB_URL", "http://localhost:8888")
@asyncio.coroutine
def events(bot):
docker = Docker()
events = docker.events
events.saferun()
stream... | <commit_before>import os
import json
import asyncio
from butterfield.utils import at_bot
from aiodocker import Docker
from aiocore import Service
WEB_ROOT = os.environ.get("MOXIE_WEB_URL", "http://localhost:8888")
@asyncio.coroutine
def events(bot):
docker = Docker()
events = docker.events
events.saferu... | import os
import json
import asyncio
from butterfield.utils import at_bot
from aiodocker import Docker
from aiocore import Service
WEB_ROOT = os.environ.get("MOXIE_WEB_URL", "http://localhost:8888")
@asyncio.coroutine
def events(bot):
docker = Docker()
events = docker.events
events.saferun()
stream... | import os
import json
import asyncio
from butterfield.utils import at_bot
from aiodocker import Docker
from aiocore import Service
WEB_ROOT = os.environ.get("MOXIE_WEB_URL", "http://localhost:8888")
@asyncio.coroutine
def events(bot):
docker = Docker()
events = docker.events
events.saferun()
stream... | <commit_before>import os
import json
import asyncio
from butterfield.utils import at_bot
from aiodocker import Docker
from aiocore import Service
WEB_ROOT = os.environ.get("MOXIE_WEB_URL", "http://localhost:8888")
@asyncio.coroutine
def events(bot):
docker = Docker()
events = docker.events
events.saferu... |
69baf66b13331d5936e8c540a2bb7eccb1d64cb7 | invoice/views.py | invoice/views.py | from django.shortcuts import get_object_or_404
from invoice.models import Invoice
from invoice.pdf import draw_pdf
from invoice.utils import pdf_response
def pdf_view(request, pk):
invoice = get_object_or_404(Invoice, pk=pk)
return pdf_response(draw_pdf, invoice.file_name(), invoice)
| from django.shortcuts import get_object_or_404
from invoice.models import Invoice
from invoice.pdf import draw_pdf
from invoice.utils import pdf_response
def pdf_view(request, pk):
invoice = get_object_or_404(Invoice, pk=pk)
return pdf_response(draw_pdf, invoice.file_name(), invoice)
def pdf_user_view(reque... | Add view for user to download invoice | Add view for user to download invoice
| Python | bsd-3-clause | Chris7/django-invoice,Chris7/django-invoice,simonluijk/django-invoice | from django.shortcuts import get_object_or_404
from invoice.models import Invoice
from invoice.pdf import draw_pdf
from invoice.utils import pdf_response
def pdf_view(request, pk):
invoice = get_object_or_404(Invoice, pk=pk)
return pdf_response(draw_pdf, invoice.file_name(), invoice)
Add view for user to down... | from django.shortcuts import get_object_or_404
from invoice.models import Invoice
from invoice.pdf import draw_pdf
from invoice.utils import pdf_response
def pdf_view(request, pk):
invoice = get_object_or_404(Invoice, pk=pk)
return pdf_response(draw_pdf, invoice.file_name(), invoice)
def pdf_user_view(reque... | <commit_before>from django.shortcuts import get_object_or_404
from invoice.models import Invoice
from invoice.pdf import draw_pdf
from invoice.utils import pdf_response
def pdf_view(request, pk):
invoice = get_object_or_404(Invoice, pk=pk)
return pdf_response(draw_pdf, invoice.file_name(), invoice)
<commit_ms... | from django.shortcuts import get_object_or_404
from invoice.models import Invoice
from invoice.pdf import draw_pdf
from invoice.utils import pdf_response
def pdf_view(request, pk):
invoice = get_object_or_404(Invoice, pk=pk)
return pdf_response(draw_pdf, invoice.file_name(), invoice)
def pdf_user_view(reque... | from django.shortcuts import get_object_or_404
from invoice.models import Invoice
from invoice.pdf import draw_pdf
from invoice.utils import pdf_response
def pdf_view(request, pk):
invoice = get_object_or_404(Invoice, pk=pk)
return pdf_response(draw_pdf, invoice.file_name(), invoice)
Add view for user to down... | <commit_before>from django.shortcuts import get_object_or_404
from invoice.models import Invoice
from invoice.pdf import draw_pdf
from invoice.utils import pdf_response
def pdf_view(request, pk):
invoice = get_object_or_404(Invoice, pk=pk)
return pdf_response(draw_pdf, invoice.file_name(), invoice)
<commit_ms... |
94f795dbbac32cbe1c83da1fb3cd3e55fdceef11 | testFile.py | testFile.py | __author__ = 'adrie_000'
import numpy as np
import numpy.matrixlib as nm
p = nm.matrix([[3, 3, 3], [3, 5, 7]])
q = p - p.mean(1)
print q
r = [np.array([q.getA()[0][k], q.getA()[1][k]]) for k in range(q.shape[1])]
print r
d = [np.linalg.norm(w) for w in r]
print d | __author__ = 'adrie_000'
import numpy as np
import numpy.matrixlib as nm
'test'
p = nm.matrix([[3, 3, 3], [3, 5, 7]])
q = p - p.mean(1)
print q
r = [np.array([q.getA()[0][k], q.getA()[1][k]]) for k in range(q.shape[1])]
print r
d = [np.linalg.norm(w) for w in r]
print d | Test de pycharm par Simon. | Test de pycharm par Simon.
| Python | apache-2.0 | adrien-bellaiche/ia-cdf-rob-2015 | __author__ = 'adrie_000'
import numpy as np
import numpy.matrixlib as nm
p = nm.matrix([[3, 3, 3], [3, 5, 7]])
q = p - p.mean(1)
print q
r = [np.array([q.getA()[0][k], q.getA()[1][k]]) for k in range(q.shape[1])]
print r
d = [np.linalg.norm(w) for w in r]
print dTest de pycharm par Simon. | __author__ = 'adrie_000'
import numpy as np
import numpy.matrixlib as nm
'test'
p = nm.matrix([[3, 3, 3], [3, 5, 7]])
q = p - p.mean(1)
print q
r = [np.array([q.getA()[0][k], q.getA()[1][k]]) for k in range(q.shape[1])]
print r
d = [np.linalg.norm(w) for w in r]
print d | <commit_before>__author__ = 'adrie_000'
import numpy as np
import numpy.matrixlib as nm
p = nm.matrix([[3, 3, 3], [3, 5, 7]])
q = p - p.mean(1)
print q
r = [np.array([q.getA()[0][k], q.getA()[1][k]]) for k in range(q.shape[1])]
print r
d = [np.linalg.norm(w) for w in r]
print d<commit_msg>Test de pycharm par Simon.<c... | __author__ = 'adrie_000'
import numpy as np
import numpy.matrixlib as nm
'test'
p = nm.matrix([[3, 3, 3], [3, 5, 7]])
q = p - p.mean(1)
print q
r = [np.array([q.getA()[0][k], q.getA()[1][k]]) for k in range(q.shape[1])]
print r
d = [np.linalg.norm(w) for w in r]
print d | __author__ = 'adrie_000'
import numpy as np
import numpy.matrixlib as nm
p = nm.matrix([[3, 3, 3], [3, 5, 7]])
q = p - p.mean(1)
print q
r = [np.array([q.getA()[0][k], q.getA()[1][k]]) for k in range(q.shape[1])]
print r
d = [np.linalg.norm(w) for w in r]
print dTest de pycharm par Simon.__author__ = 'adrie_000'
imp... | <commit_before>__author__ = 'adrie_000'
import numpy as np
import numpy.matrixlib as nm
p = nm.matrix([[3, 3, 3], [3, 5, 7]])
q = p - p.mean(1)
print q
r = [np.array([q.getA()[0][k], q.getA()[1][k]]) for k in range(q.shape[1])]
print r
d = [np.linalg.norm(w) for w in r]
print d<commit_msg>Test de pycharm par Simon.<c... |
013048e1d68174e71d4579e28efd0339144ce186 | 2017/11.07/python/jya_homework2.py | 2017/11.07/python/jya_homework2.py | ```python
i = -1
sum = 0
one_to_ten = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
while i < 10:
i += 1
sum += one_to_ten[i]
print(sum)
``` | ```python
i = -1
sum = 0
one_to_ten = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
while i < 10:
i += 1
sum += one_to_ten[i]
print(sum)
```
**Make function!**
`like:`
```python
def sum(number):
# .. TODO
return 0
```
`I want to reuse this function, like:`
```python
one_to_ten = sum(range(1,11))
one_to_five = sum(ra... | Make function! and Use 4 tabs, not 8 tabs. | Make function! and Use 4 tabs, not 8 tabs. | Python | mit | Yokan-Study/study,Yokan-Study/study,Yokan-Study/study | ```python
i = -1
sum = 0
one_to_ten = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
while i < 10:
i += 1
sum += one_to_ten[i]
print(sum)
```Make function! and Use 4 tabs, not 8 tabs. | ```python
i = -1
sum = 0
one_to_ten = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
while i < 10:
i += 1
sum += one_to_ten[i]
print(sum)
```
**Make function!**
`like:`
```python
def sum(number):
# .. TODO
return 0
```
`I want to reuse this function, like:`
```python
one_to_ten = sum(range(1,11))
one_to_five = sum(ra... | <commit_before>```python
i = -1
sum = 0
one_to_ten = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
while i < 10:
i += 1
sum += one_to_ten[i]
print(sum)
```<commit_msg>Make function! and Use 4 tabs, not 8 tabs.<commit_after> | ```python
i = -1
sum = 0
one_to_ten = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
while i < 10:
i += 1
sum += one_to_ten[i]
print(sum)
```
**Make function!**
`like:`
```python
def sum(number):
# .. TODO
return 0
```
`I want to reuse this function, like:`
```python
one_to_ten = sum(range(1,11))
one_to_five = sum(ra... | ```python
i = -1
sum = 0
one_to_ten = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
while i < 10:
i += 1
sum += one_to_ten[i]
print(sum)
```Make function! and Use 4 tabs, not 8 tabs.```python
i = -1
sum = 0
one_to_ten = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
while i < 10:
i += 1
sum += one_to_ten[i]
print(sum)
```
**Make fun... | <commit_before>```python
i = -1
sum = 0
one_to_ten = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
while i < 10:
i += 1
sum += one_to_ten[i]
print(sum)
```<commit_msg>Make function! and Use 4 tabs, not 8 tabs.<commit_after>```python
i = -1
sum = 0
one_to_ten = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
while i < 10:
i += 1
sum += o... |
f7b351a43d99a6063c49dfdf8db60c654fd89b74 | scrapi/processing/postgres.py | scrapi/processing/postgres.py | from __future__ import absolute_import
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webview.settings")
import logging
from api.webview.models import Document
from scrapi import events
from scrapi.processing.base import BaseProcessor
logger = logging.getLogger(__name__)
class PostgresProcessor(BasePr... | from __future__ import absolute_import
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webview.settings")
import django
import logging
from api.webview.models import Document
from scrapi import events
from scrapi.processing.base import BaseProcessor
django.setup()
logger = logging.getLogger(__name__)
... | Add django setup for some initialization | Add django setup for some initialization
| Python | apache-2.0 | CenterForOpenScience/scrapi,fabianvf/scrapi,erinspace/scrapi,CenterForOpenScience/scrapi,mehanig/scrapi,erinspace/scrapi,felliott/scrapi,mehanig/scrapi,fabianvf/scrapi,felliott/scrapi | from __future__ import absolute_import
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webview.settings")
import logging
from api.webview.models import Document
from scrapi import events
from scrapi.processing.base import BaseProcessor
logger = logging.getLogger(__name__)
class PostgresProcessor(BasePr... | from __future__ import absolute_import
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webview.settings")
import django
import logging
from api.webview.models import Document
from scrapi import events
from scrapi.processing.base import BaseProcessor
django.setup()
logger = logging.getLogger(__name__)
... | <commit_before>from __future__ import absolute_import
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webview.settings")
import logging
from api.webview.models import Document
from scrapi import events
from scrapi.processing.base import BaseProcessor
logger = logging.getLogger(__name__)
class PostgresP... | from __future__ import absolute_import
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webview.settings")
import django
import logging
from api.webview.models import Document
from scrapi import events
from scrapi.processing.base import BaseProcessor
django.setup()
logger = logging.getLogger(__name__)
... | from __future__ import absolute_import
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webview.settings")
import logging
from api.webview.models import Document
from scrapi import events
from scrapi.processing.base import BaseProcessor
logger = logging.getLogger(__name__)
class PostgresProcessor(BasePr... | <commit_before>from __future__ import absolute_import
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webview.settings")
import logging
from api.webview.models import Document
from scrapi import events
from scrapi.processing.base import BaseProcessor
logger = logging.getLogger(__name__)
class PostgresP... |
0ea1153438c1d98232a921c8d14d401a541e95fd | examples/regex/regex_parser.py | examples/regex/regex_parser.py | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
from parser_base import RegexParser
import model
class RegexSemantics(object):
def __init__(self):
super(RegexSemantics, self).__init__()
self._count = 0
def START(self, ast):
re... | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
from parser_base import RegexParser
import model
class RegexSemantics(object):
def __init__(self):
super(RegexSemantics, self).__init__()
self._count = 0
def START(self, ast):
re... | Fix regex example, the model must not be a unicode string. | Fix regex example, the model must not be a unicode string.
| Python | bsd-2-clause | vmuriart/grako,frnknglrt/grako | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
from parser_base import RegexParser
import model
class RegexSemantics(object):
def __init__(self):
super(RegexSemantics, self).__init__()
self._count = 0
def START(self, ast):
re... | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
from parser_base import RegexParser
import model
class RegexSemantics(object):
def __init__(self):
super(RegexSemantics, self).__init__()
self._count = 0
def START(self, ast):
re... | <commit_before># -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
from parser_base import RegexParser
import model
class RegexSemantics(object):
def __init__(self):
super(RegexSemantics, self).__init__()
self._count = 0
def START(self, a... | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
from parser_base import RegexParser
import model
class RegexSemantics(object):
def __init__(self):
super(RegexSemantics, self).__init__()
self._count = 0
def START(self, ast):
re... | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
from parser_base import RegexParser
import model
class RegexSemantics(object):
def __init__(self):
super(RegexSemantics, self).__init__()
self._count = 0
def START(self, ast):
re... | <commit_before># -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
from parser_base import RegexParser
import model
class RegexSemantics(object):
def __init__(self):
super(RegexSemantics, self).__init__()
self._count = 0
def START(self, a... |
0da74f42f7d7311859a340b0e72c1b8902287d5c | Python/tigre/utilities/sample_loader.py | Python/tigre/utilities/sample_loader.py | from __future__ import division
import os
import numpy as np
import scipy.io
import scipy.ndimage.interpolation
def load_head_phantom(number_of_voxels=None):
if number_of_voxels is None:
number_of_voxels = np.array((128, 128, 128))
dirname = os.path.dirname(__file__)
dirname = os.path.join(dirname... | from __future__ import division
import os
import numpy as np
import scipy.io
import scipy.ndimage.interpolation
def load_head_phantom(number_of_voxels=None):
if number_of_voxels is None:
number_of_voxels = np.array((128, 128, 128))
dirname = os.path.dirname(__file__)
dirname = os.path.join(dirname... | Allow for local run of example and demos installed with tool. | Allow for local run of example and demos installed with tool.
| Python | bsd-3-clause | CERN/TIGRE,CERN/TIGRE,CERN/TIGRE,CERN/TIGRE | from __future__ import division
import os
import numpy as np
import scipy.io
import scipy.ndimage.interpolation
def load_head_phantom(number_of_voxels=None):
if number_of_voxels is None:
number_of_voxels = np.array((128, 128, 128))
dirname = os.path.dirname(__file__)
dirname = os.path.join(dirname... | from __future__ import division
import os
import numpy as np
import scipy.io
import scipy.ndimage.interpolation
def load_head_phantom(number_of_voxels=None):
if number_of_voxels is None:
number_of_voxels = np.array((128, 128, 128))
dirname = os.path.dirname(__file__)
dirname = os.path.join(dirname... | <commit_before>from __future__ import division
import os
import numpy as np
import scipy.io
import scipy.ndimage.interpolation
def load_head_phantom(number_of_voxels=None):
if number_of_voxels is None:
number_of_voxels = np.array((128, 128, 128))
dirname = os.path.dirname(__file__)
dirname = os.pa... | from __future__ import division
import os
import numpy as np
import scipy.io
import scipy.ndimage.interpolation
def load_head_phantom(number_of_voxels=None):
if number_of_voxels is None:
number_of_voxels = np.array((128, 128, 128))
dirname = os.path.dirname(__file__)
dirname = os.path.join(dirname... | from __future__ import division
import os
import numpy as np
import scipy.io
import scipy.ndimage.interpolation
def load_head_phantom(number_of_voxels=None):
if number_of_voxels is None:
number_of_voxels = np.array((128, 128, 128))
dirname = os.path.dirname(__file__)
dirname = os.path.join(dirname... | <commit_before>from __future__ import division
import os
import numpy as np
import scipy.io
import scipy.ndimage.interpolation
def load_head_phantom(number_of_voxels=None):
if number_of_voxels is None:
number_of_voxels = np.array((128, 128, 128))
dirname = os.path.dirname(__file__)
dirname = os.pa... |
fcd85a1b15ca8b82f892bba171c21f9a1b4f6e4a | SOAPpy/tests/alanbushTest.py | SOAPpy/tests/alanbushTest.py | #!/usr/bin/env python
# Copyright (c) 2001 actzero, inc. All rights reserved.
import sys
sys.path.insert (1, '..')
import SOAP
ident = '$Id$'
SoapEndpointURL = 'http://www.alanbushtrust.org.uk/soap/compositions.asp'
MethodNamespaceURI = 'urn:alanbushtrust-org-uk:soap:methods'
SoapAction = MethodNamespaceURI + ... | #!/usr/bin/env python
# Copyright (c) 2001 actzero, inc. All rights reserved.
import sys
sys.path.insert (1, '..')
import SOAP
ident = '$Id$'
SoapEndpointURL = 'http://www.alanbushtrust.org.uk/soap/compositions.asp'
MethodNamespaceURI = 'urn:alanbushtrust-org-uk:soap.methods'
SoapAction = MethodNamespaceURI + ... | Correct URI and list categories | Correct URI and list categories
git-svn-id: c4afb4e777bcbfe9afa898413b708b5abcd43877@69 7150bf37-e60d-0410-b93f-83e91ef0e581
| Python | mit | acigna/pywez,acigna/pywez,acigna/pywez | #!/usr/bin/env python
# Copyright (c) 2001 actzero, inc. All rights reserved.
import sys
sys.path.insert (1, '..')
import SOAP
ident = '$Id$'
SoapEndpointURL = 'http://www.alanbushtrust.org.uk/soap/compositions.asp'
MethodNamespaceURI = 'urn:alanbushtrust-org-uk:soap:methods'
SoapAction = MethodNamespaceURI + ... | #!/usr/bin/env python
# Copyright (c) 2001 actzero, inc. All rights reserved.
import sys
sys.path.insert (1, '..')
import SOAP
ident = '$Id$'
SoapEndpointURL = 'http://www.alanbushtrust.org.uk/soap/compositions.asp'
MethodNamespaceURI = 'urn:alanbushtrust-org-uk:soap.methods'
SoapAction = MethodNamespaceURI + ... | <commit_before>#!/usr/bin/env python
# Copyright (c) 2001 actzero, inc. All rights reserved.
import sys
sys.path.insert (1, '..')
import SOAP
ident = '$Id$'
SoapEndpointURL = 'http://www.alanbushtrust.org.uk/soap/compositions.asp'
MethodNamespaceURI = 'urn:alanbushtrust-org-uk:soap:methods'
SoapAction = Method... | #!/usr/bin/env python
# Copyright (c) 2001 actzero, inc. All rights reserved.
import sys
sys.path.insert (1, '..')
import SOAP
ident = '$Id$'
SoapEndpointURL = 'http://www.alanbushtrust.org.uk/soap/compositions.asp'
MethodNamespaceURI = 'urn:alanbushtrust-org-uk:soap.methods'
SoapAction = MethodNamespaceURI + ... | #!/usr/bin/env python
# Copyright (c) 2001 actzero, inc. All rights reserved.
import sys
sys.path.insert (1, '..')
import SOAP
ident = '$Id$'
SoapEndpointURL = 'http://www.alanbushtrust.org.uk/soap/compositions.asp'
MethodNamespaceURI = 'urn:alanbushtrust-org-uk:soap:methods'
SoapAction = MethodNamespaceURI + ... | <commit_before>#!/usr/bin/env python
# Copyright (c) 2001 actzero, inc. All rights reserved.
import sys
sys.path.insert (1, '..')
import SOAP
ident = '$Id$'
SoapEndpointURL = 'http://www.alanbushtrust.org.uk/soap/compositions.asp'
MethodNamespaceURI = 'urn:alanbushtrust-org-uk:soap:methods'
SoapAction = Method... |
c5970991ed2d3285e6a3ef9badb6e73756ff876b | tests/test_session.py | tests/test_session.py | # Local imports
from uplink import session
def test_base_url(uplink_builder_mock):
# Setup
uplink_builder_mock.base_url = "https://api.github.com"
sess = session.Session(uplink_builder_mock)
# Run & Verify
assert uplink_builder_mock.base_url == sess.base_url
def test_headers(uplink_builder_mock... | # Local imports
from uplink import session
def test_base_url(uplink_builder_mock):
# Setup
uplink_builder_mock.base_url = "https://api.github.com"
sess = session.Session(uplink_builder_mock)
# Run & Verify
assert uplink_builder_mock.base_url == sess.base_url
def test_headers(uplink_builder_mock... | Fix `assert_called` usage for Python 3.5 build | Fix `assert_called` usage for Python 3.5 build
The `assert_called` method seems to invoke a bug caused by a type in the
unittest mock module. (The bug was ultimately tracked and fix here:
https://bugs.python.org/issue24656)
| Python | mit | prkumar/uplink | # Local imports
from uplink import session
def test_base_url(uplink_builder_mock):
# Setup
uplink_builder_mock.base_url = "https://api.github.com"
sess = session.Session(uplink_builder_mock)
# Run & Verify
assert uplink_builder_mock.base_url == sess.base_url
def test_headers(uplink_builder_mock... | # Local imports
from uplink import session
def test_base_url(uplink_builder_mock):
# Setup
uplink_builder_mock.base_url = "https://api.github.com"
sess = session.Session(uplink_builder_mock)
# Run & Verify
assert uplink_builder_mock.base_url == sess.base_url
def test_headers(uplink_builder_mock... | <commit_before># Local imports
from uplink import session
def test_base_url(uplink_builder_mock):
# Setup
uplink_builder_mock.base_url = "https://api.github.com"
sess = session.Session(uplink_builder_mock)
# Run & Verify
assert uplink_builder_mock.base_url == sess.base_url
def test_headers(upli... | # Local imports
from uplink import session
def test_base_url(uplink_builder_mock):
# Setup
uplink_builder_mock.base_url = "https://api.github.com"
sess = session.Session(uplink_builder_mock)
# Run & Verify
assert uplink_builder_mock.base_url == sess.base_url
def test_headers(uplink_builder_mock... | # Local imports
from uplink import session
def test_base_url(uplink_builder_mock):
# Setup
uplink_builder_mock.base_url = "https://api.github.com"
sess = session.Session(uplink_builder_mock)
# Run & Verify
assert uplink_builder_mock.base_url == sess.base_url
def test_headers(uplink_builder_mock... | <commit_before># Local imports
from uplink import session
def test_base_url(uplink_builder_mock):
# Setup
uplink_builder_mock.base_url = "https://api.github.com"
sess = session.Session(uplink_builder_mock)
# Run & Verify
assert uplink_builder_mock.base_url == sess.base_url
def test_headers(upli... |
3412b0db76f77a4772cf76c7794fbe61b58f5a25 | bakery/views.py | bakery/views.py | # -*- coding: utf-8 -*-
from django.core.urlresolvers import reverse
from django.views.generic import ListView, TemplateView, RedirectView
from django.contrib import auth
from bakery.cookies.models import Cookie
from bakery.socialize.models import Vote
class HomeView(ListView):
model = Cookie
template_name ... | # -*- coding: utf-8 -*-
from django.core.urlresolvers import reverse
from django.views.generic import ListView, TemplateView, RedirectView
from django.contrib import auth
from bakery.cookies.models import Cookie
from bakery.socialize.models import Vote
class HomeView(ListView):
model = Cookie
template_name ... | Select correct for vote detection | Select correct for vote detection
| Python | bsd-3-clause | muffins-on-dope/bakery,muffins-on-dope/bakery,muffins-on-dope/bakery | # -*- coding: utf-8 -*-
from django.core.urlresolvers import reverse
from django.views.generic import ListView, TemplateView, RedirectView
from django.contrib import auth
from bakery.cookies.models import Cookie
from bakery.socialize.models import Vote
class HomeView(ListView):
model = Cookie
template_name ... | # -*- coding: utf-8 -*-
from django.core.urlresolvers import reverse
from django.views.generic import ListView, TemplateView, RedirectView
from django.contrib import auth
from bakery.cookies.models import Cookie
from bakery.socialize.models import Vote
class HomeView(ListView):
model = Cookie
template_name ... | <commit_before># -*- coding: utf-8 -*-
from django.core.urlresolvers import reverse
from django.views.generic import ListView, TemplateView, RedirectView
from django.contrib import auth
from bakery.cookies.models import Cookie
from bakery.socialize.models import Vote
class HomeView(ListView):
model = Cookie
... | # -*- coding: utf-8 -*-
from django.core.urlresolvers import reverse
from django.views.generic import ListView, TemplateView, RedirectView
from django.contrib import auth
from bakery.cookies.models import Cookie
from bakery.socialize.models import Vote
class HomeView(ListView):
model = Cookie
template_name ... | # -*- coding: utf-8 -*-
from django.core.urlresolvers import reverse
from django.views.generic import ListView, TemplateView, RedirectView
from django.contrib import auth
from bakery.cookies.models import Cookie
from bakery.socialize.models import Vote
class HomeView(ListView):
model = Cookie
template_name ... | <commit_before># -*- coding: utf-8 -*-
from django.core.urlresolvers import reverse
from django.views.generic import ListView, TemplateView, RedirectView
from django.contrib import auth
from bakery.cookies.models import Cookie
from bakery.socialize.models import Vote
class HomeView(ListView):
model = Cookie
... |
d635fc9129bc4ccfd5384be6958ae1c14e9916ec | scripts/merge_translations.py | scripts/merge_translations.py | import sys
import yaml
def main(base_file, new_file, overwrite_language):
old = yaml.load(file(base_file).read())
new = yaml.load(file(new_file).read())
assert len(overwrite_language) == 2
for o, n in zip(old, new):
if overwrite_language in n['text']:
o['text'][overwrite_languag... | import sys
import yaml
def persona(old, new, overwrite_language):
old_t = old['translations']
new_t = new['translations']
for key in old_t:
if key in new_t and overwrite_language in new_t[key]:
old_t[key][overwrite_language] = new_t[key][overwrite_language]
def questions(old, new, ... | Add persona merging to translation merge script | Add persona merging to translation merge script | Python | mit | okfde/eucopyright,okfde/eucopyright,okfde/eucopyright | import sys
import yaml
def main(base_file, new_file, overwrite_language):
old = yaml.load(file(base_file).read())
new = yaml.load(file(new_file).read())
assert len(overwrite_language) == 2
for o, n in zip(old, new):
if overwrite_language in n['text']:
o['text'][overwrite_languag... | import sys
import yaml
def persona(old, new, overwrite_language):
old_t = old['translations']
new_t = new['translations']
for key in old_t:
if key in new_t and overwrite_language in new_t[key]:
old_t[key][overwrite_language] = new_t[key][overwrite_language]
def questions(old, new, ... | <commit_before>import sys
import yaml
def main(base_file, new_file, overwrite_language):
old = yaml.load(file(base_file).read())
new = yaml.load(file(new_file).read())
assert len(overwrite_language) == 2
for o, n in zip(old, new):
if overwrite_language in n['text']:
o['text'][ov... | import sys
import yaml
def persona(old, new, overwrite_language):
old_t = old['translations']
new_t = new['translations']
for key in old_t:
if key in new_t and overwrite_language in new_t[key]:
old_t[key][overwrite_language] = new_t[key][overwrite_language]
def questions(old, new, ... | import sys
import yaml
def main(base_file, new_file, overwrite_language):
old = yaml.load(file(base_file).read())
new = yaml.load(file(new_file).read())
assert len(overwrite_language) == 2
for o, n in zip(old, new):
if overwrite_language in n['text']:
o['text'][overwrite_languag... | <commit_before>import sys
import yaml
def main(base_file, new_file, overwrite_language):
old = yaml.load(file(base_file).read())
new = yaml.load(file(new_file).read())
assert len(overwrite_language) == 2
for o, n in zip(old, new):
if overwrite_language in n['text']:
o['text'][ov... |
03a78a509c0213f8f95223a7926a1bce547f05fe | rotterdam/proc.py | rotterdam/proc.py | import logging
import os
import signal
from setproctitle import setproctitle
class Proc(object):
signal_map = {}
def __init__(self):
self.logger = logging.getLogger(self.__module__)
self.pid = None
@property
def name(self):
return self.__class__.__name__.lower()
def s... | import logging
import os
import signal
from setproctitle import setproctitle
class Proc(object):
signal_map = {}
def __init__(self):
self.logger = logging.getLogger(self.__module__)
self.pid = None
self.parent_pid = None
@property
def name(self):
return self.__clas... | Initialize parent_pid in the Proc class init. | Initialize parent_pid in the Proc class init.
| Python | mit | wglass/rotterdam | import logging
import os
import signal
from setproctitle import setproctitle
class Proc(object):
signal_map = {}
def __init__(self):
self.logger = logging.getLogger(self.__module__)
self.pid = None
@property
def name(self):
return self.__class__.__name__.lower()
def s... | import logging
import os
import signal
from setproctitle import setproctitle
class Proc(object):
signal_map = {}
def __init__(self):
self.logger = logging.getLogger(self.__module__)
self.pid = None
self.parent_pid = None
@property
def name(self):
return self.__clas... | <commit_before>import logging
import os
import signal
from setproctitle import setproctitle
class Proc(object):
signal_map = {}
def __init__(self):
self.logger = logging.getLogger(self.__module__)
self.pid = None
@property
def name(self):
return self.__class__.__name__.low... | import logging
import os
import signal
from setproctitle import setproctitle
class Proc(object):
signal_map = {}
def __init__(self):
self.logger = logging.getLogger(self.__module__)
self.pid = None
self.parent_pid = None
@property
def name(self):
return self.__clas... | import logging
import os
import signal
from setproctitle import setproctitle
class Proc(object):
signal_map = {}
def __init__(self):
self.logger = logging.getLogger(self.__module__)
self.pid = None
@property
def name(self):
return self.__class__.__name__.lower()
def s... | <commit_before>import logging
import os
import signal
from setproctitle import setproctitle
class Proc(object):
signal_map = {}
def __init__(self):
self.logger = logging.getLogger(self.__module__)
self.pid = None
@property
def name(self):
return self.__class__.__name__.low... |
ce6a3a3833d498fa32a5317fd95e206cad9d5a83 | alg_gcd.py | alg_gcd.py | def gcd(m, n):
"""Greatest Common Divisor (GCD) by Euclid's Algorithm.
Time complexity: O(m%n).
"""
while n != 0:
m, n = n, m % n
return m
def main():
print(gcd(4, 2))
print(gcd(2, 4))
print(gcd(10, 4))
print(gcd(4, 10))
print(gcd(10, 1))
print(gcd(1, 10))
if _... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
def gcd(m, n):
"""Greatest Common Divisor (GCD) by Euclid's Algorithm.
Time complexity: O(m%n).
"""
while n != 0:
m, n = n, m % n
return m
def main():
print('gcd(4, 2): {}'.f... | Add importing from __future__ & revise main() | Add importing from __future__ & revise main()
| Python | bsd-2-clause | bowen0701/algorithms_data_structures | def gcd(m, n):
"""Greatest Common Divisor (GCD) by Euclid's Algorithm.
Time complexity: O(m%n).
"""
while n != 0:
m, n = n, m % n
return m
def main():
print(gcd(4, 2))
print(gcd(2, 4))
print(gcd(10, 4))
print(gcd(4, 10))
print(gcd(10, 1))
print(gcd(1, 10))
if _... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
def gcd(m, n):
"""Greatest Common Divisor (GCD) by Euclid's Algorithm.
Time complexity: O(m%n).
"""
while n != 0:
m, n = n, m % n
return m
def main():
print('gcd(4, 2): {}'.f... | <commit_before>def gcd(m, n):
"""Greatest Common Divisor (GCD) by Euclid's Algorithm.
Time complexity: O(m%n).
"""
while n != 0:
m, n = n, m % n
return m
def main():
print(gcd(4, 2))
print(gcd(2, 4))
print(gcd(10, 4))
print(gcd(4, 10))
print(gcd(10, 1))
print(gcd... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
def gcd(m, n):
"""Greatest Common Divisor (GCD) by Euclid's Algorithm.
Time complexity: O(m%n).
"""
while n != 0:
m, n = n, m % n
return m
def main():
print('gcd(4, 2): {}'.f... | def gcd(m, n):
"""Greatest Common Divisor (GCD) by Euclid's Algorithm.
Time complexity: O(m%n).
"""
while n != 0:
m, n = n, m % n
return m
def main():
print(gcd(4, 2))
print(gcd(2, 4))
print(gcd(10, 4))
print(gcd(4, 10))
print(gcd(10, 1))
print(gcd(1, 10))
if _... | <commit_before>def gcd(m, n):
"""Greatest Common Divisor (GCD) by Euclid's Algorithm.
Time complexity: O(m%n).
"""
while n != 0:
m, n = n, m % n
return m
def main():
print(gcd(4, 2))
print(gcd(2, 4))
print(gcd(10, 4))
print(gcd(4, 10))
print(gcd(10, 1))
print(gcd... |
0b45ec48955f73a0e88422660af82ff6fd89333b | tools/crons/newwoz.py | tools/crons/newwoz.py | import os
import django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "museum.settings")
django.setup()
print("NEW WOZZT TEST")
from museum_site.wozzt_queue import WoZZT_Queue # noqa: E402
def main():
entry = WoZZT_Queue.objects.all().order_by("-priority", "id")[0]
entry.send_tweet()
entry.delete_... | import os
import django
from datetime import datetime
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "museum.settings")
django.setup()
from museum_site.wozzt_queue import WoZZT_Queue # noqa: E402
def main():
now = datetime.now()
if now.weekday() == 1: # Tuesday
entry = WoZZT_Queue.objects.filt... | Use Tuesday branch on Tuesdays | Use Tuesday branch on Tuesdays
| Python | mit | DrDos0016/z2,DrDos0016/z2,DrDos0016/z2 | import os
import django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "museum.settings")
django.setup()
print("NEW WOZZT TEST")
from museum_site.wozzt_queue import WoZZT_Queue # noqa: E402
def main():
entry = WoZZT_Queue.objects.all().order_by("-priority", "id")[0]
entry.send_tweet()
entry.delete_... | import os
import django
from datetime import datetime
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "museum.settings")
django.setup()
from museum_site.wozzt_queue import WoZZT_Queue # noqa: E402
def main():
now = datetime.now()
if now.weekday() == 1: # Tuesday
entry = WoZZT_Queue.objects.filt... | <commit_before>import os
import django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "museum.settings")
django.setup()
print("NEW WOZZT TEST")
from museum_site.wozzt_queue import WoZZT_Queue # noqa: E402
def main():
entry = WoZZT_Queue.objects.all().order_by("-priority", "id")[0]
entry.send_tweet()
... | import os
import django
from datetime import datetime
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "museum.settings")
django.setup()
from museum_site.wozzt_queue import WoZZT_Queue # noqa: E402
def main():
now = datetime.now()
if now.weekday() == 1: # Tuesday
entry = WoZZT_Queue.objects.filt... | import os
import django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "museum.settings")
django.setup()
print("NEW WOZZT TEST")
from museum_site.wozzt_queue import WoZZT_Queue # noqa: E402
def main():
entry = WoZZT_Queue.objects.all().order_by("-priority", "id")[0]
entry.send_tweet()
entry.delete_... | <commit_before>import os
import django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "museum.settings")
django.setup()
print("NEW WOZZT TEST")
from museum_site.wozzt_queue import WoZZT_Queue # noqa: E402
def main():
entry = WoZZT_Queue.objects.all().order_by("-priority", "id")[0]
entry.send_tweet()
... |
ed89c92ac56e89648bf965ea3aa8963e840e3a5c | tests/test_excuses.py | tests/test_excuses.py | # Copyright 2017 Starbot Discord Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2017 Starbot Discord Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Fix the unit test :) | Fix the unit test :)
| Python | apache-2.0 | StarbotDiscord/Starbot,dhinakg/BitSTAR,StarbotDiscord/Starbot,dhinakg/BitSTAR | # Copyright 2017 Starbot Discord Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2017 Starbot Discord Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | <commit_before># Copyright 2017 Starbot Discord Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | # Copyright 2017 Starbot Discord Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2017 Starbot Discord Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | <commit_before># Copyright 2017 Starbot Discord Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
38749a0033c2acc6c9fd8971749c68f93cb9c0db | virtualenv/__init__.py | virtualenv/__init__.py | from __future__ import absolute_import, division, print_function
from virtualenv.__about__ import (
__author__, __copyright__, __email__, __license__, __summary__, __title__,
__uri__, __version__
)
__all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__author__",
"__email__", "__license... | from __future__ import absolute_import, division, print_function
from virtualenv.__about__ import (
__author__, __copyright__, __email__, __license__, __summary__, __title__,
__uri__, __version__
)
from virtualenv.core import create
__all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__aut... | Add virtualenv.create function to enable easy virtualenv creation | Add virtualenv.create function to enable easy virtualenv creation
| Python | mit | ionelmc/virtualenv,ionelmc/virtualenv,ionelmc/virtualenv | from __future__ import absolute_import, division, print_function
from virtualenv.__about__ import (
__author__, __copyright__, __email__, __license__, __summary__, __title__,
__uri__, __version__
)
__all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__author__",
"__email__", "__license... | from __future__ import absolute_import, division, print_function
from virtualenv.__about__ import (
__author__, __copyright__, __email__, __license__, __summary__, __title__,
__uri__, __version__
)
from virtualenv.core import create
__all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__aut... | <commit_before>from __future__ import absolute_import, division, print_function
from virtualenv.__about__ import (
__author__, __copyright__, __email__, __license__, __summary__, __title__,
__uri__, __version__
)
__all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__author__",
"__email... | from __future__ import absolute_import, division, print_function
from virtualenv.__about__ import (
__author__, __copyright__, __email__, __license__, __summary__, __title__,
__uri__, __version__
)
from virtualenv.core import create
__all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__aut... | from __future__ import absolute_import, division, print_function
from virtualenv.__about__ import (
__author__, __copyright__, __email__, __license__, __summary__, __title__,
__uri__, __version__
)
__all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__author__",
"__email__", "__license... | <commit_before>from __future__ import absolute_import, division, print_function
from virtualenv.__about__ import (
__author__, __copyright__, __email__, __license__, __summary__, __title__,
__uri__, __version__
)
__all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__author__",
"__email... |
3d813e9960a44bfacd94551b95caf489b85ea3bb | trac/upgrades/db11.py | trac/upgrades/db11.py | import os.path
import shutil
sql = """
-- Remove empty values from the milestone list
DELETE FROM milestone WHERE COALESCE(name,'')='';
-- Add a description column to the version table, and remove unnamed versions
CREATE TEMP TABLE version_old AS SELECT * FROM version;
DROP TABLE version;
CREATE TABLE version (
... | import os.path
import shutil
sql = """
-- Remove empty values from the milestone list
DELETE FROM milestone WHERE COALESCE(name,'')='';
-- Add a description column to the version table, and remove unnamed versions
CREATE TEMP TABLE version_old AS SELECT * FROM version;
DROP TABLE version;
CREATE TABLE version (
... | Fix typo in upgrade script | Fix typo in upgrade script
git-svn-id: f68c6b3b1dcd5d00a2560c384475aaef3bc99487@1647 af82e41b-90c4-0310-8c96-b1721e28e2e2
| Python | bsd-3-clause | exocad/exotrac,dafrito/trac-mirror,dokipen/trac,dokipen/trac,dokipen/trac,exocad/exotrac,exocad/exotrac,dafrito/trac-mirror,moreati/trac-gitsvn,moreati/trac-gitsvn,dafrito/trac-mirror,exocad/exotrac,moreati/trac-gitsvn,dafrito/trac-mirror,moreati/trac-gitsvn | import os.path
import shutil
sql = """
-- Remove empty values from the milestone list
DELETE FROM milestone WHERE COALESCE(name,'')='';
-- Add a description column to the version table, and remove unnamed versions
CREATE TEMP TABLE version_old AS SELECT * FROM version;
DROP TABLE version;
CREATE TABLE version (
... | import os.path
import shutil
sql = """
-- Remove empty values from the milestone list
DELETE FROM milestone WHERE COALESCE(name,'')='';
-- Add a description column to the version table, and remove unnamed versions
CREATE TEMP TABLE version_old AS SELECT * FROM version;
DROP TABLE version;
CREATE TABLE version (
... | <commit_before>import os.path
import shutil
sql = """
-- Remove empty values from the milestone list
DELETE FROM milestone WHERE COALESCE(name,'')='';
-- Add a description column to the version table, and remove unnamed versions
CREATE TEMP TABLE version_old AS SELECT * FROM version;
DROP TABLE version;
CREATE TABLE ... | import os.path
import shutil
sql = """
-- Remove empty values from the milestone list
DELETE FROM milestone WHERE COALESCE(name,'')='';
-- Add a description column to the version table, and remove unnamed versions
CREATE TEMP TABLE version_old AS SELECT * FROM version;
DROP TABLE version;
CREATE TABLE version (
... | import os.path
import shutil
sql = """
-- Remove empty values from the milestone list
DELETE FROM milestone WHERE COALESCE(name,'')='';
-- Add a description column to the version table, and remove unnamed versions
CREATE TEMP TABLE version_old AS SELECT * FROM version;
DROP TABLE version;
CREATE TABLE version (
... | <commit_before>import os.path
import shutil
sql = """
-- Remove empty values from the milestone list
DELETE FROM milestone WHERE COALESCE(name,'')='';
-- Add a description column to the version table, and remove unnamed versions
CREATE TEMP TABLE version_old AS SELECT * FROM version;
DROP TABLE version;
CREATE TABLE ... |
e521b16844efc2853c0db9014098cb3e37f6eb04 | numpy/_array_api/_sorting_functions.py | numpy/_array_api/_sorting_functions.py | def argsort(x, /, *, axis=-1, descending=False, stable=True):
from .. import argsort
from .. import flip
# Note: this keyword argument is different, and the default is different.
kind = 'stable' if stable else 'quicksort'
res = argsort(x, axis=axis, kind=kind)
if descending:
res = flip(r... | def argsort(x, /, *, axis=-1, descending=False, stable=True):
from .. import argsort
from .. import flip
# Note: this keyword argument is different, and the default is different.
kind = 'stable' if stable else 'quicksort'
res = argsort(x, axis=axis, kind=kind)
if descending:
res = flip(r... | Add missing returns to the array API sorting functions | Add missing returns to the array API sorting functions
| Python | bsd-3-clause | jakirkham/numpy,numpy/numpy,mhvk/numpy,seberg/numpy,pdebuyl/numpy,numpy/numpy,numpy/numpy,jakirkham/numpy,anntzer/numpy,charris/numpy,simongibbons/numpy,endolith/numpy,simongibbons/numpy,mhvk/numpy,seberg/numpy,mattip/numpy,mattip/numpy,jakirkham/numpy,mhvk/numpy,charris/numpy,seberg/numpy,simongibbons/numpy,pdebuyl/nu... | def argsort(x, /, *, axis=-1, descending=False, stable=True):
from .. import argsort
from .. import flip
# Note: this keyword argument is different, and the default is different.
kind = 'stable' if stable else 'quicksort'
res = argsort(x, axis=axis, kind=kind)
if descending:
res = flip(r... | def argsort(x, /, *, axis=-1, descending=False, stable=True):
from .. import argsort
from .. import flip
# Note: this keyword argument is different, and the default is different.
kind = 'stable' if stable else 'quicksort'
res = argsort(x, axis=axis, kind=kind)
if descending:
res = flip(r... | <commit_before>def argsort(x, /, *, axis=-1, descending=False, stable=True):
from .. import argsort
from .. import flip
# Note: this keyword argument is different, and the default is different.
kind = 'stable' if stable else 'quicksort'
res = argsort(x, axis=axis, kind=kind)
if descending:
... | def argsort(x, /, *, axis=-1, descending=False, stable=True):
from .. import argsort
from .. import flip
# Note: this keyword argument is different, and the default is different.
kind = 'stable' if stable else 'quicksort'
res = argsort(x, axis=axis, kind=kind)
if descending:
res = flip(r... | def argsort(x, /, *, axis=-1, descending=False, stable=True):
from .. import argsort
from .. import flip
# Note: this keyword argument is different, and the default is different.
kind = 'stable' if stable else 'quicksort'
res = argsort(x, axis=axis, kind=kind)
if descending:
res = flip(r... | <commit_before>def argsort(x, /, *, axis=-1, descending=False, stable=True):
from .. import argsort
from .. import flip
# Note: this keyword argument is different, and the default is different.
kind = 'stable' if stable else 'quicksort'
res = argsort(x, axis=axis, kind=kind)
if descending:
... |
f57511df7de901f3694fa4225af458e192975299 | pdf_parser/pdf_types/compound_types.py | pdf_parser/pdf_types/compound_types.py | from .common import PdfType
class PdfArray(PdfType, list):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
list.__init__(self, *args, **kwargs)
class PdfDict(PdfType, dict):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
dict.__init__(self, *args, **kwa... | from .common import PdfType
class PdfArray(PdfType, list):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
list.__init__(self, *args, **kwargs)
class PdfDict(PdfType, dict):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
dict.__init__(self, *args, **kwa... | Fix PdfDict: __getattr__, not __getattribute__ | Fix PdfDict: __getattr__, not __getattribute__
| Python | mit | ajmarks/gymnast,ajmarks/gymnast | from .common import PdfType
class PdfArray(PdfType, list):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
list.__init__(self, *args, **kwargs)
class PdfDict(PdfType, dict):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
dict.__init__(self, *args, **kwa... | from .common import PdfType
class PdfArray(PdfType, list):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
list.__init__(self, *args, **kwargs)
class PdfDict(PdfType, dict):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
dict.__init__(self, *args, **kwa... | <commit_before>from .common import PdfType
class PdfArray(PdfType, list):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
list.__init__(self, *args, **kwargs)
class PdfDict(PdfType, dict):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
dict.__init__(sel... | from .common import PdfType
class PdfArray(PdfType, list):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
list.__init__(self, *args, **kwargs)
class PdfDict(PdfType, dict):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
dict.__init__(self, *args, **kwa... | from .common import PdfType
class PdfArray(PdfType, list):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
list.__init__(self, *args, **kwargs)
class PdfDict(PdfType, dict):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
dict.__init__(self, *args, **kwa... | <commit_before>from .common import PdfType
class PdfArray(PdfType, list):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
list.__init__(self, *args, **kwargs)
class PdfDict(PdfType, dict):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
dict.__init__(sel... |
ec15cfe29eb4f99725315d54c97d99d81e3b3ccc | elevator/config.py | elevator/config.py | # -*- coding: utf-8 -*-
# Copyright (c) 2012 theo crevon
#
# See the file LICENSE for copying permission.
from ConfigParser import ConfigParser
from utils.snippets import items_to_dict
class Config(dict):
"""
Unix shells like environment class. Implements add,
get, load, flush methods. Handles lists of... | # -*- coding: utf-8 -*-
# Copyright (c) 2012 theo crevon
#
# See the file LICENSE for copying permission.
from ConfigParser import ConfigParser
from utils.snippets import items_to_dict
class Config(dict):
"""
Unix shells like environment class. Implements add,
get, load, flush methods. Handles lists of... | Enable Config instantiation from kwargs only | Fix: Enable Config instantiation from kwargs only
| Python | mit | oleiade/Elevator | # -*- coding: utf-8 -*-
# Copyright (c) 2012 theo crevon
#
# See the file LICENSE for copying permission.
from ConfigParser import ConfigParser
from utils.snippets import items_to_dict
class Config(dict):
"""
Unix shells like environment class. Implements add,
get, load, flush methods. Handles lists of... | # -*- coding: utf-8 -*-
# Copyright (c) 2012 theo crevon
#
# See the file LICENSE for copying permission.
from ConfigParser import ConfigParser
from utils.snippets import items_to_dict
class Config(dict):
"""
Unix shells like environment class. Implements add,
get, load, flush methods. Handles lists of... | <commit_before># -*- coding: utf-8 -*-
# Copyright (c) 2012 theo crevon
#
# See the file LICENSE for copying permission.
from ConfigParser import ConfigParser
from utils.snippets import items_to_dict
class Config(dict):
"""
Unix shells like environment class. Implements add,
get, load, flush methods. H... | # -*- coding: utf-8 -*-
# Copyright (c) 2012 theo crevon
#
# See the file LICENSE for copying permission.
from ConfigParser import ConfigParser
from utils.snippets import items_to_dict
class Config(dict):
"""
Unix shells like environment class. Implements add,
get, load, flush methods. Handles lists of... | # -*- coding: utf-8 -*-
# Copyright (c) 2012 theo crevon
#
# See the file LICENSE for copying permission.
from ConfigParser import ConfigParser
from utils.snippets import items_to_dict
class Config(dict):
"""
Unix shells like environment class. Implements add,
get, load, flush methods. Handles lists of... | <commit_before># -*- coding: utf-8 -*-
# Copyright (c) 2012 theo crevon
#
# See the file LICENSE for copying permission.
from ConfigParser import ConfigParser
from utils.snippets import items_to_dict
class Config(dict):
"""
Unix shells like environment class. Implements add,
get, load, flush methods. H... |
f3cc2de83c88f01f7ec554ae6223132c284b4ad4 | kotti_site_gallery/__init__.py | kotti_site_gallery/__init__.py | from fanstatic import Library
from fanstatic import Resource
from kotti.resources import Image
import kotti.static as ks
lib_kotti_site_gallery = Library('kotti_site_gallery', 'static')
view_css = Resource(lib_kotti_site_gallery,
"kotti_site_gallery.css",
minified="kotti_site_g... | from __future__ import absolute_import
from fanstatic import Library
from fanstatic import Resource
from kotti.resources import Image
from kotti.fanstatic import view_css
from kotti.fanstatic import view_needed
lib_kotti_site_gallery = Library('kotti_site_gallery', 'static')
ksg_view_css = Resource(lib_kotti_site_ga... | Fix import for Kotti > 0.8x. | Fix import for Kotti > 0.8x.
| Python | bsd-2-clause | Kotti/kotti_site_gallery,Kotti/kotti_site_gallery | from fanstatic import Library
from fanstatic import Resource
from kotti.resources import Image
import kotti.static as ks
lib_kotti_site_gallery = Library('kotti_site_gallery', 'static')
view_css = Resource(lib_kotti_site_gallery,
"kotti_site_gallery.css",
minified="kotti_site_g... | from __future__ import absolute_import
from fanstatic import Library
from fanstatic import Resource
from kotti.resources import Image
from kotti.fanstatic import view_css
from kotti.fanstatic import view_needed
lib_kotti_site_gallery = Library('kotti_site_gallery', 'static')
ksg_view_css = Resource(lib_kotti_site_ga... | <commit_before>from fanstatic import Library
from fanstatic import Resource
from kotti.resources import Image
import kotti.static as ks
lib_kotti_site_gallery = Library('kotti_site_gallery', 'static')
view_css = Resource(lib_kotti_site_gallery,
"kotti_site_gallery.css",
minifie... | from __future__ import absolute_import
from fanstatic import Library
from fanstatic import Resource
from kotti.resources import Image
from kotti.fanstatic import view_css
from kotti.fanstatic import view_needed
lib_kotti_site_gallery = Library('kotti_site_gallery', 'static')
ksg_view_css = Resource(lib_kotti_site_ga... | from fanstatic import Library
from fanstatic import Resource
from kotti.resources import Image
import kotti.static as ks
lib_kotti_site_gallery = Library('kotti_site_gallery', 'static')
view_css = Resource(lib_kotti_site_gallery,
"kotti_site_gallery.css",
minified="kotti_site_g... | <commit_before>from fanstatic import Library
from fanstatic import Resource
from kotti.resources import Image
import kotti.static as ks
lib_kotti_site_gallery = Library('kotti_site_gallery', 'static')
view_css = Resource(lib_kotti_site_gallery,
"kotti_site_gallery.css",
minifie... |
a4c5782158e7d3fa696fc4532836355457f48cc0 | versebot/webparser.py | versebot/webparser.py | """
VerseBot for reddit
By Matthieu Grieger
parser.py
Copyright (c) 2015 Matthieu Grieger (MIT License)
"""
from bs4 import BeautifulSoup
from urllib.request import urlopen
class Parser:
""" Parser class for BibleGateway parsing methods. """
def __init__(self):
""" Initializes translations attrib... | """
VerseBot for reddit
By Matthieu Grieger
webparser.py
Copyright (c) 2015 Matthieu Grieger (MIT License)
"""
from bs4 import BeautifulSoup
from urllib.request import urlopen
class Parser:
""" Parser class for BibleGateway parsing methods. """
def __init__(self):
""" Initializes translations att... | Add note about BibleGateway layout | Add note about BibleGateway layout
| Python | mit | Matthew-Arnold/slack-versebot,Matthew-Arnold/slack-versebot | """
VerseBot for reddit
By Matthieu Grieger
parser.py
Copyright (c) 2015 Matthieu Grieger (MIT License)
"""
from bs4 import BeautifulSoup
from urllib.request import urlopen
class Parser:
""" Parser class for BibleGateway parsing methods. """
def __init__(self):
""" Initializes translations attrib... | """
VerseBot for reddit
By Matthieu Grieger
webparser.py
Copyright (c) 2015 Matthieu Grieger (MIT License)
"""
from bs4 import BeautifulSoup
from urllib.request import urlopen
class Parser:
""" Parser class for BibleGateway parsing methods. """
def __init__(self):
""" Initializes translations att... | <commit_before>"""
VerseBot for reddit
By Matthieu Grieger
parser.py
Copyright (c) 2015 Matthieu Grieger (MIT License)
"""
from bs4 import BeautifulSoup
from urllib.request import urlopen
class Parser:
""" Parser class for BibleGateway parsing methods. """
def __init__(self):
""" Initializes tran... | """
VerseBot for reddit
By Matthieu Grieger
webparser.py
Copyright (c) 2015 Matthieu Grieger (MIT License)
"""
from bs4 import BeautifulSoup
from urllib.request import urlopen
class Parser:
""" Parser class for BibleGateway parsing methods. """
def __init__(self):
""" Initializes translations att... | """
VerseBot for reddit
By Matthieu Grieger
parser.py
Copyright (c) 2015 Matthieu Grieger (MIT License)
"""
from bs4 import BeautifulSoup
from urllib.request import urlopen
class Parser:
""" Parser class for BibleGateway parsing methods. """
def __init__(self):
""" Initializes translations attrib... | <commit_before>"""
VerseBot for reddit
By Matthieu Grieger
parser.py
Copyright (c) 2015 Matthieu Grieger (MIT License)
"""
from bs4 import BeautifulSoup
from urllib.request import urlopen
class Parser:
""" Parser class for BibleGateway parsing methods. """
def __init__(self):
""" Initializes tran... |
41b5a95a5c396c131d1426dd926e0a1a4beccc86 | mrp_workorder_sequence/models/mrp_production.py | mrp_workorder_sequence/models/mrp_production.py | # Copyright 2019-20 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from odoo import models
class MrpProduction(models.Model):
_inherit = "mrp.production"
def _reset_work_order_sequence(self):
for rec in self:
current_seque... | # Copyright 2019-20 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from odoo import models
class MrpProduction(models.Model):
_inherit = "mrp.production"
def _reset_work_order_sequence(self):
for rec in self:
current_seque... | Call method changed on v14 | [FIX] mrp_workorder_sequence: Call method changed on v14
| Python | agpl-3.0 | OCA/manufacture,OCA/manufacture | # Copyright 2019-20 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from odoo import models
class MrpProduction(models.Model):
_inherit = "mrp.production"
def _reset_work_order_sequence(self):
for rec in self:
current_seque... | # Copyright 2019-20 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from odoo import models
class MrpProduction(models.Model):
_inherit = "mrp.production"
def _reset_work_order_sequence(self):
for rec in self:
current_seque... | <commit_before># Copyright 2019-20 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from odoo import models
class MrpProduction(models.Model):
_inherit = "mrp.production"
def _reset_work_order_sequence(self):
for rec in self:
... | # Copyright 2019-20 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from odoo import models
class MrpProduction(models.Model):
_inherit = "mrp.production"
def _reset_work_order_sequence(self):
for rec in self:
current_seque... | # Copyright 2019-20 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from odoo import models
class MrpProduction(models.Model):
_inherit = "mrp.production"
def _reset_work_order_sequence(self):
for rec in self:
current_seque... | <commit_before># Copyright 2019-20 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from odoo import models
class MrpProduction(models.Model):
_inherit = "mrp.production"
def _reset_work_order_sequence(self):
for rec in self:
... |
54b147e59d1dfd4b65643a3f8a56098eb5a99451 | tests/kafka_cluster_manager/decommission_test.py | tests/kafka_cluster_manager/decommission_test.py | from __future__ import unicode_literals
from argparse import Namespace
import mock
import pytest
from kafka_utils.kafka_cluster_manager.cluster_info \
.partition_count_balancer import PartitionCountBalancer
from kafka_utils.kafka_cluster_manager.cmds import decommission
from tests.kafka_cluster_manager.helper im... | from __future__ import unicode_literals
from argparse import Namespace
import mock
import pytest
from kafka_utils.kafka_cluster_manager.cluster_info \
.partition_count_balancer import PartitionCountBalancer
from kafka_utils.kafka_cluster_manager.cmds import decommission
from tests.kafka_cluster_manager.helper im... | Add more default args so tests pass in py3+ | Add more default args so tests pass in py3+
| Python | apache-2.0 | Yelp/kafka-utils,Yelp/kafka-utils | from __future__ import unicode_literals
from argparse import Namespace
import mock
import pytest
from kafka_utils.kafka_cluster_manager.cluster_info \
.partition_count_balancer import PartitionCountBalancer
from kafka_utils.kafka_cluster_manager.cmds import decommission
from tests.kafka_cluster_manager.helper im... | from __future__ import unicode_literals
from argparse import Namespace
import mock
import pytest
from kafka_utils.kafka_cluster_manager.cluster_info \
.partition_count_balancer import PartitionCountBalancer
from kafka_utils.kafka_cluster_manager.cmds import decommission
from tests.kafka_cluster_manager.helper im... | <commit_before>from __future__ import unicode_literals
from argparse import Namespace
import mock
import pytest
from kafka_utils.kafka_cluster_manager.cluster_info \
.partition_count_balancer import PartitionCountBalancer
from kafka_utils.kafka_cluster_manager.cmds import decommission
from tests.kafka_cluster_ma... | from __future__ import unicode_literals
from argparse import Namespace
import mock
import pytest
from kafka_utils.kafka_cluster_manager.cluster_info \
.partition_count_balancer import PartitionCountBalancer
from kafka_utils.kafka_cluster_manager.cmds import decommission
from tests.kafka_cluster_manager.helper im... | from __future__ import unicode_literals
from argparse import Namespace
import mock
import pytest
from kafka_utils.kafka_cluster_manager.cluster_info \
.partition_count_balancer import PartitionCountBalancer
from kafka_utils.kafka_cluster_manager.cmds import decommission
from tests.kafka_cluster_manager.helper im... | <commit_before>from __future__ import unicode_literals
from argparse import Namespace
import mock
import pytest
from kafka_utils.kafka_cluster_manager.cluster_info \
.partition_count_balancer import PartitionCountBalancer
from kafka_utils.kafka_cluster_manager.cmds import decommission
from tests.kafka_cluster_ma... |
a805d414557a14a8588b6e34a9fbb93cc87651df | lib/scheduler.py | lib/scheduler.py | import time
import logging
log = logging.getLogger(__name__)
class TaskSchedule():
def __init__(self):
self.tasks = []
log.debug("TaskSchedule created")
def add(self, task, ttl_skew=0.8):
offset = ((ttl_skew * task.ttl) - task.skew())
log.info("Scheduling '%s' for %ss from now" % (task.name, offset))
i... | import time
import logging
log = logging.getLogger(__name__)
class TaskSchedule():
def __init__(self):
self.tasks = []
log.debug("TaskSchedule created")
def add(self, task, ttl_skew=0.5):
offset = ((ttl_skew * task.ttl) - task.skew())
log.info("Scheduling '%s' for %ss from now" % (task.name, offset))
i... | Change ttl_skew to 50%, to allow a task to run twice before riemann notices that it never checked in. | Change ttl_skew to 50%, to allow a task to run twice before riemann notices that it never checked in.
| Python | mit | crashlytics/riemann-sumd | import time
import logging
log = logging.getLogger(__name__)
class TaskSchedule():
def __init__(self):
self.tasks = []
log.debug("TaskSchedule created")
def add(self, task, ttl_skew=0.8):
offset = ((ttl_skew * task.ttl) - task.skew())
log.info("Scheduling '%s' for %ss from now" % (task.name, offset))
i... | import time
import logging
log = logging.getLogger(__name__)
class TaskSchedule():
def __init__(self):
self.tasks = []
log.debug("TaskSchedule created")
def add(self, task, ttl_skew=0.5):
offset = ((ttl_skew * task.ttl) - task.skew())
log.info("Scheduling '%s' for %ss from now" % (task.name, offset))
i... | <commit_before>import time
import logging
log = logging.getLogger(__name__)
class TaskSchedule():
def __init__(self):
self.tasks = []
log.debug("TaskSchedule created")
def add(self, task, ttl_skew=0.8):
offset = ((ttl_skew * task.ttl) - task.skew())
log.info("Scheduling '%s' for %ss from now" % (task.name... | import time
import logging
log = logging.getLogger(__name__)
class TaskSchedule():
def __init__(self):
self.tasks = []
log.debug("TaskSchedule created")
def add(self, task, ttl_skew=0.5):
offset = ((ttl_skew * task.ttl) - task.skew())
log.info("Scheduling '%s' for %ss from now" % (task.name, offset))
i... | import time
import logging
log = logging.getLogger(__name__)
class TaskSchedule():
def __init__(self):
self.tasks = []
log.debug("TaskSchedule created")
def add(self, task, ttl_skew=0.8):
offset = ((ttl_skew * task.ttl) - task.skew())
log.info("Scheduling '%s' for %ss from now" % (task.name, offset))
i... | <commit_before>import time
import logging
log = logging.getLogger(__name__)
class TaskSchedule():
def __init__(self):
self.tasks = []
log.debug("TaskSchedule created")
def add(self, task, ttl_skew=0.8):
offset = ((ttl_skew * task.ttl) - task.skew())
log.info("Scheduling '%s' for %ss from now" % (task.name... |
159aea1c97b8e8de45802cace031e7206c3c8fec | thecure/sprites/tile.py | thecure/sprites/tile.py | from thecure.resources import load_spritesheet_frame
from thecure.sprites import Sprite
class Tile(Sprite):
NAME = 'tile'
WIDTH = 64
HEIGHT = 64
NEED_TICKS = False
def __init__(self, filename, tile_offset):
super(Tile, self).__init__()
self.filename = filename
self.tile_... | from thecure.resources import load_spritesheet_frame
from thecure.sprites import Sprite
class Tile(Sprite):
NAME = 'tile'
WIDTH = 64
HEIGHT = 64
NEED_TICKS = False
def __init__(self, filename, tile_offset):
super(Tile, self).__init__()
self.filename = filename
self.tile_... | Add a __str__ for Tile. | Add a __str__ for Tile.
| Python | mit | chipx86/the-cure | from thecure.resources import load_spritesheet_frame
from thecure.sprites import Sprite
class Tile(Sprite):
NAME = 'tile'
WIDTH = 64
HEIGHT = 64
NEED_TICKS = False
def __init__(self, filename, tile_offset):
super(Tile, self).__init__()
self.filename = filename
self.tile_... | from thecure.resources import load_spritesheet_frame
from thecure.sprites import Sprite
class Tile(Sprite):
NAME = 'tile'
WIDTH = 64
HEIGHT = 64
NEED_TICKS = False
def __init__(self, filename, tile_offset):
super(Tile, self).__init__()
self.filename = filename
self.tile_... | <commit_before>from thecure.resources import load_spritesheet_frame
from thecure.sprites import Sprite
class Tile(Sprite):
NAME = 'tile'
WIDTH = 64
HEIGHT = 64
NEED_TICKS = False
def __init__(self, filename, tile_offset):
super(Tile, self).__init__()
self.filename = filename
... | from thecure.resources import load_spritesheet_frame
from thecure.sprites import Sprite
class Tile(Sprite):
NAME = 'tile'
WIDTH = 64
HEIGHT = 64
NEED_TICKS = False
def __init__(self, filename, tile_offset):
super(Tile, self).__init__()
self.filename = filename
self.tile_... | from thecure.resources import load_spritesheet_frame
from thecure.sprites import Sprite
class Tile(Sprite):
NAME = 'tile'
WIDTH = 64
HEIGHT = 64
NEED_TICKS = False
def __init__(self, filename, tile_offset):
super(Tile, self).__init__()
self.filename = filename
self.tile_... | <commit_before>from thecure.resources import load_spritesheet_frame
from thecure.sprites import Sprite
class Tile(Sprite):
NAME = 'tile'
WIDTH = 64
HEIGHT = 64
NEED_TICKS = False
def __init__(self, filename, tile_offset):
super(Tile, self).__init__()
self.filename = filename
... |
def66bc381f03970640a61d64b49ad5de9ef3879 | ocaml/build-in.py | ocaml/build-in.py | # Needed because ocamlbuild 3.12.1 doesn't support absolute pathnames (4.00.1 does)
import sys
import os
from os.path import relpath
ocaml_build_dir = relpath(sys.argv[1], '.')
os.execvp("make", ["make", 'OCAML_BUILDDIR=' + ocaml_build_dir, "ocaml"])
| # Needed because ocamlbuild 3.12.1 doesn't support absolute pathnames (4.00.1 does)
import sys
import os
from os.path import relpath
ocaml_build_dir = relpath(sys.argv[1], '.')
# Hack: when we can depend on a full OCaml feed with the build tools, we can remove this.
# Until then, we need to avoid trying to compile aga... | Remove OCAMLLIB from build environment | Remove OCAMLLIB from build environment
This is a temporary hack: when we can depend on a full OCaml feed with
the build tools, we can remove this. Until then, we need to avoid trying
to compile against the limited runtime environment.
| Python | lgpl-2.1 | 0install/0install,afb/0install,afb/0install,afb/0install,gasche/0install,bastianeicher/0install,bhilton/0install,fdopen/0install,gasche/0install,0install/0install,jaychoo/0install,dbenamy/0install,gfxmonk/0install,jaychoo/0install,dbenamy/0install,DarkGreising/0install,bastianeicher/0install,fdopen/0install,bhilton/0in... | # Needed because ocamlbuild 3.12.1 doesn't support absolute pathnames (4.00.1 does)
import sys
import os
from os.path import relpath
ocaml_build_dir = relpath(sys.argv[1], '.')
os.execvp("make", ["make", 'OCAML_BUILDDIR=' + ocaml_build_dir, "ocaml"])
Remove OCAMLLIB from build environment
This is a temporary hack: whe... | # Needed because ocamlbuild 3.12.1 doesn't support absolute pathnames (4.00.1 does)
import sys
import os
from os.path import relpath
ocaml_build_dir = relpath(sys.argv[1], '.')
# Hack: when we can depend on a full OCaml feed with the build tools, we can remove this.
# Until then, we need to avoid trying to compile aga... | <commit_before># Needed because ocamlbuild 3.12.1 doesn't support absolute pathnames (4.00.1 does)
import sys
import os
from os.path import relpath
ocaml_build_dir = relpath(sys.argv[1], '.')
os.execvp("make", ["make", 'OCAML_BUILDDIR=' + ocaml_build_dir, "ocaml"])
<commit_msg>Remove OCAMLLIB from build environment
Th... | # Needed because ocamlbuild 3.12.1 doesn't support absolute pathnames (4.00.1 does)
import sys
import os
from os.path import relpath
ocaml_build_dir = relpath(sys.argv[1], '.')
# Hack: when we can depend on a full OCaml feed with the build tools, we can remove this.
# Until then, we need to avoid trying to compile aga... | # Needed because ocamlbuild 3.12.1 doesn't support absolute pathnames (4.00.1 does)
import sys
import os
from os.path import relpath
ocaml_build_dir = relpath(sys.argv[1], '.')
os.execvp("make", ["make", 'OCAML_BUILDDIR=' + ocaml_build_dir, "ocaml"])
Remove OCAMLLIB from build environment
This is a temporary hack: whe... | <commit_before># Needed because ocamlbuild 3.12.1 doesn't support absolute pathnames (4.00.1 does)
import sys
import os
from os.path import relpath
ocaml_build_dir = relpath(sys.argv[1], '.')
os.execvp("make", ["make", 'OCAML_BUILDDIR=' + ocaml_build_dir, "ocaml"])
<commit_msg>Remove OCAMLLIB from build environment
Th... |
b297ad6b4d52b688a1c50ffc2a5574d8061c5ce0 | csvdiff/records.py | csvdiff/records.py | # -*- coding: utf-8 -*-
#
# records.py
# csvdiff
#
import csv
class InvalidKeyError(Exception):
pass
def load(file_or_stream):
istream = (open(file_or_stream)
if not hasattr(file_or_stream, 'read')
else file_or_stream)
return csv.DictReader(istream)
def index(record_s... | # -*- coding: utf-8 -*-
#
# records.py
# csvdiff
#
import csv
from . import error
class InvalidKeyError(Exception):
pass
def load(file_or_stream):
istream = (open(file_or_stream)
if not hasattr(file_or_stream, 'read')
else file_or_stream)
return _safe_iterator(csv.Dict... | Check for errors parsing the CSV as we go. | Check for errors parsing the CSV as we go.
When rows bleed into each other, we can get keys that are None in the records.
Now we get a user error in this case.
| Python | bsd-3-clause | larsyencken/csvdiff | # -*- coding: utf-8 -*-
#
# records.py
# csvdiff
#
import csv
class InvalidKeyError(Exception):
pass
def load(file_or_stream):
istream = (open(file_or_stream)
if not hasattr(file_or_stream, 'read')
else file_or_stream)
return csv.DictReader(istream)
def index(record_s... | # -*- coding: utf-8 -*-
#
# records.py
# csvdiff
#
import csv
from . import error
class InvalidKeyError(Exception):
pass
def load(file_or_stream):
istream = (open(file_or_stream)
if not hasattr(file_or_stream, 'read')
else file_or_stream)
return _safe_iterator(csv.Dict... | <commit_before># -*- coding: utf-8 -*-
#
# records.py
# csvdiff
#
import csv
class InvalidKeyError(Exception):
pass
def load(file_or_stream):
istream = (open(file_or_stream)
if not hasattr(file_or_stream, 'read')
else file_or_stream)
return csv.DictReader(istream)
def... | # -*- coding: utf-8 -*-
#
# records.py
# csvdiff
#
import csv
from . import error
class InvalidKeyError(Exception):
pass
def load(file_or_stream):
istream = (open(file_or_stream)
if not hasattr(file_or_stream, 'read')
else file_or_stream)
return _safe_iterator(csv.Dict... | # -*- coding: utf-8 -*-
#
# records.py
# csvdiff
#
import csv
class InvalidKeyError(Exception):
pass
def load(file_or_stream):
istream = (open(file_or_stream)
if not hasattr(file_or_stream, 'read')
else file_or_stream)
return csv.DictReader(istream)
def index(record_s... | <commit_before># -*- coding: utf-8 -*-
#
# records.py
# csvdiff
#
import csv
class InvalidKeyError(Exception):
pass
def load(file_or_stream):
istream = (open(file_or_stream)
if not hasattr(file_or_stream, 'read')
else file_or_stream)
return csv.DictReader(istream)
def... |
75e65f6144820ba216166eee4417912394f8cdca | tools/bundle.py | tools/bundle.py | #!/usr/bin/env python
import os
import sys
import glob
import getopt
def file_list(path):
files = []
if os.path.isfile(path):
return [path]
for f in os.listdir(path):
new_dir = os.path.join(path, f)
if os.path.isdir(new_dir) and not os.path.islink(new_dir):
files.extend(file_list(new_dir))
... | #!/usr/bin/env python
import os
import sys
import glob
import getopt
def file_list(path):
files = []
if os.path.isfile(path):
return [path]
for f in os.listdir(path):
new_dir = path + '/' + f
if os.path.isdir(new_dir) and not os.path.islink(new_dir):
files.extend(file_list(new_dir))
else... | Stop using os.path.join, because Visual Studio can actually handle forward slash style paths, and the os.path method was creating mixed \\ and / style paths, b0rking everything. | Stop using os.path.join, because Visual Studio can actually handle forward
slash style paths, and the os.path method was creating mixed \\ and /
style paths, b0rking everything.
| Python | apache-2.0 | kans/birgo,kans/birgo,kans/birgo,kans/birgo,kans/birgo | #!/usr/bin/env python
import os
import sys
import glob
import getopt
def file_list(path):
files = []
if os.path.isfile(path):
return [path]
for f in os.listdir(path):
new_dir = os.path.join(path, f)
if os.path.isdir(new_dir) and not os.path.islink(new_dir):
files.extend(file_list(new_dir))
... | #!/usr/bin/env python
import os
import sys
import glob
import getopt
def file_list(path):
files = []
if os.path.isfile(path):
return [path]
for f in os.listdir(path):
new_dir = path + '/' + f
if os.path.isdir(new_dir) and not os.path.islink(new_dir):
files.extend(file_list(new_dir))
else... | <commit_before>#!/usr/bin/env python
import os
import sys
import glob
import getopt
def file_list(path):
files = []
if os.path.isfile(path):
return [path]
for f in os.listdir(path):
new_dir = os.path.join(path, f)
if os.path.isdir(new_dir) and not os.path.islink(new_dir):
files.extend(file_l... | #!/usr/bin/env python
import os
import sys
import glob
import getopt
def file_list(path):
files = []
if os.path.isfile(path):
return [path]
for f in os.listdir(path):
new_dir = path + '/' + f
if os.path.isdir(new_dir) and not os.path.islink(new_dir):
files.extend(file_list(new_dir))
else... | #!/usr/bin/env python
import os
import sys
import glob
import getopt
def file_list(path):
files = []
if os.path.isfile(path):
return [path]
for f in os.listdir(path):
new_dir = os.path.join(path, f)
if os.path.isdir(new_dir) and not os.path.islink(new_dir):
files.extend(file_list(new_dir))
... | <commit_before>#!/usr/bin/env python
import os
import sys
import glob
import getopt
def file_list(path):
files = []
if os.path.isfile(path):
return [path]
for f in os.listdir(path):
new_dir = os.path.join(path, f)
if os.path.isdir(new_dir) and not os.path.islink(new_dir):
files.extend(file_l... |
e7356e6ca1968d930f4fd348b48dcdd1cb9a02ab | taggit/admin.py | taggit/admin.py | from django.contrib import admin
from taggit.models import Tag, TaggedItem
class TaggedItemInline(admin.StackedInline):
model = TaggedItem
extra = 0
class TagAdmin(admin.ModelAdmin):
inlines = [
TaggedItemInline
]
ordering = ['name']
admin.site.register(Tag, TagAdmin)
| from django.contrib import admin
from taggit.models import Tag, TaggedItem
class TaggedItemInline(admin.StackedInline):
model = TaggedItem
extra = 0
class TagAdmin(admin.ModelAdmin):
inlines = [
TaggedItemInline
]
ordering = ['name']
search_fields = ['name']
admin.site.register(Tag,... | Add ability to search tags by name | Add ability to search tags by name | Python | bsd-3-clause | theatlantic/django-taggit2,decibyte/django-taggit,theatlantic/django-taggit,decibyte/django-taggit,theatlantic/django-taggit,theatlantic/django-taggit2 | from django.contrib import admin
from taggit.models import Tag, TaggedItem
class TaggedItemInline(admin.StackedInline):
model = TaggedItem
extra = 0
class TagAdmin(admin.ModelAdmin):
inlines = [
TaggedItemInline
]
ordering = ['name']
admin.site.register(Tag, TagAdmin)
Add ability to sea... | from django.contrib import admin
from taggit.models import Tag, TaggedItem
class TaggedItemInline(admin.StackedInline):
model = TaggedItem
extra = 0
class TagAdmin(admin.ModelAdmin):
inlines = [
TaggedItemInline
]
ordering = ['name']
search_fields = ['name']
admin.site.register(Tag,... | <commit_before>from django.contrib import admin
from taggit.models import Tag, TaggedItem
class TaggedItemInline(admin.StackedInline):
model = TaggedItem
extra = 0
class TagAdmin(admin.ModelAdmin):
inlines = [
TaggedItemInline
]
ordering = ['name']
admin.site.register(Tag, TagAdmin)
<co... | from django.contrib import admin
from taggit.models import Tag, TaggedItem
class TaggedItemInline(admin.StackedInline):
model = TaggedItem
extra = 0
class TagAdmin(admin.ModelAdmin):
inlines = [
TaggedItemInline
]
ordering = ['name']
search_fields = ['name']
admin.site.register(Tag,... | from django.contrib import admin
from taggit.models import Tag, TaggedItem
class TaggedItemInline(admin.StackedInline):
model = TaggedItem
extra = 0
class TagAdmin(admin.ModelAdmin):
inlines = [
TaggedItemInline
]
ordering = ['name']
admin.site.register(Tag, TagAdmin)
Add ability to sea... | <commit_before>from django.contrib import admin
from taggit.models import Tag, TaggedItem
class TaggedItemInline(admin.StackedInline):
model = TaggedItem
extra = 0
class TagAdmin(admin.ModelAdmin):
inlines = [
TaggedItemInline
]
ordering = ['name']
admin.site.register(Tag, TagAdmin)
<co... |
3aba7e7f654e492fb689b8030615658cae93c2d1 | txircd/modules/umode_o.py | txircd/modules/umode_o.py | from txircd.modbase import Mode
class OperMode(Mode):
def checkSet(self, target, param):
return False # Should only be set by the OPER command; hence, reject any normal setting of the mode
def checkWhoFilter(self, user, targetUser, filters, fields, channel, udata):
if "o" in filters and no... | from txircd.modbase import Mode
class OperMode(Mode):
def checkSet(self, user, target, param):
user.sendMessage(irc.ERR_NOPRIVILEGES, ":Permission denied - User mode o may not be set")
return False # Should only be set by the OPER command; hence, reject any normal setting of the mode
def c... | Fix crashing when a user attempts to set usermode +o without /oper | Fix crashing when a user attempts to set usermode +o without /oper
| Python | bsd-3-clause | Heufneutje/txircd,DesertBus/txircd,ElementalAlchemist/txircd | from txircd.modbase import Mode
class OperMode(Mode):
def checkSet(self, target, param):
return False # Should only be set by the OPER command; hence, reject any normal setting of the mode
def checkWhoFilter(self, user, targetUser, filters, fields, channel, udata):
if "o" in filters and no... | from txircd.modbase import Mode
class OperMode(Mode):
def checkSet(self, user, target, param):
user.sendMessage(irc.ERR_NOPRIVILEGES, ":Permission denied - User mode o may not be set")
return False # Should only be set by the OPER command; hence, reject any normal setting of the mode
def c... | <commit_before>from txircd.modbase import Mode
class OperMode(Mode):
def checkSet(self, target, param):
return False # Should only be set by the OPER command; hence, reject any normal setting of the mode
def checkWhoFilter(self, user, targetUser, filters, fields, channel, udata):
if "o" in... | from txircd.modbase import Mode
class OperMode(Mode):
def checkSet(self, user, target, param):
user.sendMessage(irc.ERR_NOPRIVILEGES, ":Permission denied - User mode o may not be set")
return False # Should only be set by the OPER command; hence, reject any normal setting of the mode
def c... | from txircd.modbase import Mode
class OperMode(Mode):
def checkSet(self, target, param):
return False # Should only be set by the OPER command; hence, reject any normal setting of the mode
def checkWhoFilter(self, user, targetUser, filters, fields, channel, udata):
if "o" in filters and no... | <commit_before>from txircd.modbase import Mode
class OperMode(Mode):
def checkSet(self, target, param):
return False # Should only be set by the OPER command; hence, reject any normal setting of the mode
def checkWhoFilter(self, user, targetUser, filters, fields, channel, udata):
if "o" in... |
c3b0cc681b06ab5b8d64612d5c35fb27da56beeb | spk/sabnzbd/src/app/sabnzbd.cgi.py | spk/sabnzbd/src/app/sabnzbd.cgi.py | #!/usr/local/sabnzbd/env/bin/python
import os
import configobj
config = configobj.ConfigObj('/usr/local/sabnzbd/var/config.ini')
protocol = 'https' if int(config['misc']['enable_https']) else 'http'
port = int(config['misc']['https_port']) if int(config['misc']['enable_https']) else int(config['misc']['port'])
print... | #!/usr/local/sabnzbd/env/bin/python
import os
import configobj
config = configobj.ConfigObj('/usr/local/sabnzbd/var/config.ini')
protocol = 'https' if int(config['misc']['enable_https']) else 'http'
https_port = int(config['misc']['port']) if len(config['misc']['https_port']) == 0 else int(config['misc']['https_port'... | Fix port number detection in sabnzbd | Fix port number detection in sabnzbd
Thanks DcR-NL
| Python | bsd-3-clause | Decipher/spksrc,astroganga/spksrc,mjoe/spksrc,markbastiaans/spksrc,Decipher/spksrc,mreppen/spksrc,saschpe/spksrc,schumi2004/spksrc,hadess/spksrc,mirweb/spksrc,mirweb/spksrc,jdierkse/spksrc,adrien-delhorme/spksrc,sea3pea0/spksrc,thunfischbrot/spksrc,mirweb/spksrc,Foncekar/spksrc,thunfischbrot/spksrc,lysin/spksrc,hmflash... | #!/usr/local/sabnzbd/env/bin/python
import os
import configobj
config = configobj.ConfigObj('/usr/local/sabnzbd/var/config.ini')
protocol = 'https' if int(config['misc']['enable_https']) else 'http'
port = int(config['misc']['https_port']) if int(config['misc']['enable_https']) else int(config['misc']['port'])
print... | #!/usr/local/sabnzbd/env/bin/python
import os
import configobj
config = configobj.ConfigObj('/usr/local/sabnzbd/var/config.ini')
protocol = 'https' if int(config['misc']['enable_https']) else 'http'
https_port = int(config['misc']['port']) if len(config['misc']['https_port']) == 0 else int(config['misc']['https_port'... | <commit_before>#!/usr/local/sabnzbd/env/bin/python
import os
import configobj
config = configobj.ConfigObj('/usr/local/sabnzbd/var/config.ini')
protocol = 'https' if int(config['misc']['enable_https']) else 'http'
port = int(config['misc']['https_port']) if int(config['misc']['enable_https']) else int(config['misc'][... | #!/usr/local/sabnzbd/env/bin/python
import os
import configobj
config = configobj.ConfigObj('/usr/local/sabnzbd/var/config.ini')
protocol = 'https' if int(config['misc']['enable_https']) else 'http'
https_port = int(config['misc']['port']) if len(config['misc']['https_port']) == 0 else int(config['misc']['https_port'... | #!/usr/local/sabnzbd/env/bin/python
import os
import configobj
config = configobj.ConfigObj('/usr/local/sabnzbd/var/config.ini')
protocol = 'https' if int(config['misc']['enable_https']) else 'http'
port = int(config['misc']['https_port']) if int(config['misc']['enable_https']) else int(config['misc']['port'])
print... | <commit_before>#!/usr/local/sabnzbd/env/bin/python
import os
import configobj
config = configobj.ConfigObj('/usr/local/sabnzbd/var/config.ini')
protocol = 'https' if int(config['misc']['enable_https']) else 'http'
port = int(config['misc']['https_port']) if int(config['misc']['enable_https']) else int(config['misc'][... |
550dee3e13a0ee80d0bd9338c281e51fefdcfdc8 | slack_log_handler/__init__.py | slack_log_handler/__init__.py | import traceback
from logging import Handler
from slacker import Chat
class SlackLogHandler(Handler):
def __init__(self, api_key, channel, stack_trace=False, username='Python logger', icon_url=None, icon_emoji=None):
Handler.__init__(self)
self.slack_chat = Chat(api_key)
self.channel = ch... | import json
import traceback
from logging import Handler
from slacker import Slacker
class SlackLogHandler(Handler):
def __init__(self, api_key, channel, stack_trace=False, username='Python logger', icon_url=None, icon_emoji=None):
Handler.__init__(self)
self.slack_chat = Slacker(api_key)
... | Add format with slack attachments. | Add format with slack attachments.
| Python | apache-2.0 | mathiasose/slacker_log_handler | import traceback
from logging import Handler
from slacker import Chat
class SlackLogHandler(Handler):
def __init__(self, api_key, channel, stack_trace=False, username='Python logger', icon_url=None, icon_emoji=None):
Handler.__init__(self)
self.slack_chat = Chat(api_key)
self.channel = ch... | import json
import traceback
from logging import Handler
from slacker import Slacker
class SlackLogHandler(Handler):
def __init__(self, api_key, channel, stack_trace=False, username='Python logger', icon_url=None, icon_emoji=None):
Handler.__init__(self)
self.slack_chat = Slacker(api_key)
... | <commit_before>import traceback
from logging import Handler
from slacker import Chat
class SlackLogHandler(Handler):
def __init__(self, api_key, channel, stack_trace=False, username='Python logger', icon_url=None, icon_emoji=None):
Handler.__init__(self)
self.slack_chat = Chat(api_key)
se... | import json
import traceback
from logging import Handler
from slacker import Slacker
class SlackLogHandler(Handler):
def __init__(self, api_key, channel, stack_trace=False, username='Python logger', icon_url=None, icon_emoji=None):
Handler.__init__(self)
self.slack_chat = Slacker(api_key)
... | import traceback
from logging import Handler
from slacker import Chat
class SlackLogHandler(Handler):
def __init__(self, api_key, channel, stack_trace=False, username='Python logger', icon_url=None, icon_emoji=None):
Handler.__init__(self)
self.slack_chat = Chat(api_key)
self.channel = ch... | <commit_before>import traceback
from logging import Handler
from slacker import Chat
class SlackLogHandler(Handler):
def __init__(self, api_key, channel, stack_trace=False, username='Python logger', icon_url=None, icon_emoji=None):
Handler.__init__(self)
self.slack_chat = Chat(api_key)
se... |
ed68bd18b88f349a7348006a2e14cdddbc993da7 | script/lib/config.py | script/lib/config.py | #!/usr/bin/env python
import platform
import sys
NODE_VERSION = 'v0.11.13'
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = 'afb4570ceee2ad10f3caf5a81335a2ee11ec68a5'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.architecture()[... | #!/usr/bin/env python
import platform
import sys
NODE_VERSION = 'v0.11.13'
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = 'ea1a7e85a3de1878e5656110c76f4d2d8af41c6e'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.architecture()[... | Upgrade libchromiumcontent to Chrome 37. | Upgrade libchromiumcontent to Chrome 37.
| Python | mit | beni55/electron,gbn972/electron,chrisswk/electron,mrwizard82d1/electron,Andrey-Pavlov/electron,yan-foto/electron,roadev/electron,abhishekgahlot/electron,MaxWhere/electron,nicholasess/electron,Jonekee/electron,synaptek/electron,edulan/electron,tincan24/electron,faizalpribadi/electron,davazp/electron,tylergibson/electron... | #!/usr/bin/env python
import platform
import sys
NODE_VERSION = 'v0.11.13'
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = 'afb4570ceee2ad10f3caf5a81335a2ee11ec68a5'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.architecture()[... | #!/usr/bin/env python
import platform
import sys
NODE_VERSION = 'v0.11.13'
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = 'ea1a7e85a3de1878e5656110c76f4d2d8af41c6e'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.architecture()[... | <commit_before>#!/usr/bin/env python
import platform
import sys
NODE_VERSION = 'v0.11.13'
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = 'afb4570ceee2ad10f3caf5a81335a2ee11ec68a5'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.... | #!/usr/bin/env python
import platform
import sys
NODE_VERSION = 'v0.11.13'
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = 'ea1a7e85a3de1878e5656110c76f4d2d8af41c6e'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.architecture()[... | #!/usr/bin/env python
import platform
import sys
NODE_VERSION = 'v0.11.13'
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = 'afb4570ceee2ad10f3caf5a81335a2ee11ec68a5'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.architecture()[... | <commit_before>#!/usr/bin/env python
import platform
import sys
NODE_VERSION = 'v0.11.13'
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = 'afb4570ceee2ad10f3caf5a81335a2ee11ec68a5'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.... |
f20156beb47f860646f31b46ff69879e190d220d | scripts/postbuild.py | scripts/postbuild.py | #!/usr/bin/python3
import sys
import jenkins
from firebase import firebase
JENKINS_URL = '' # Enter Jenkins URL like http://localhost:8080
JENKINS_USERNAME = '' # Enter available Jenkins username
JENKINS_APITOKEN = '' # Enter Jenkins API token (or password if Jenkins < 1.5)
FIREBASE_DSN = '' # Enter your firebase ... | #!/usr/bin/python3
import sys
import jenkins
from firebase import firebase
JENKINS_URL = '' # Enter Jenkins URL like http://localhost:8080
JENKINS_USERNAME = '' # Enter available Jenkins username
JENKINS_APITOKEN = '' # Enter Jenkins API token (or password if Jenkins < 1.5)
FIREBASE_DSN = '' # Enter your firebase ... | Add job console output to firebase | Add job console output to firebase
| Python | mpl-2.0 | MDTsai/webcompat-system-addon-autotest | #!/usr/bin/python3
import sys
import jenkins
from firebase import firebase
JENKINS_URL = '' # Enter Jenkins URL like http://localhost:8080
JENKINS_USERNAME = '' # Enter available Jenkins username
JENKINS_APITOKEN = '' # Enter Jenkins API token (or password if Jenkins < 1.5)
FIREBASE_DSN = '' # Enter your firebase ... | #!/usr/bin/python3
import sys
import jenkins
from firebase import firebase
JENKINS_URL = '' # Enter Jenkins URL like http://localhost:8080
JENKINS_USERNAME = '' # Enter available Jenkins username
JENKINS_APITOKEN = '' # Enter Jenkins API token (or password if Jenkins < 1.5)
FIREBASE_DSN = '' # Enter your firebase ... | <commit_before>#!/usr/bin/python3
import sys
import jenkins
from firebase import firebase
JENKINS_URL = '' # Enter Jenkins URL like http://localhost:8080
JENKINS_USERNAME = '' # Enter available Jenkins username
JENKINS_APITOKEN = '' # Enter Jenkins API token (or password if Jenkins < 1.5)
FIREBASE_DSN = '' # Enter... | #!/usr/bin/python3
import sys
import jenkins
from firebase import firebase
JENKINS_URL = '' # Enter Jenkins URL like http://localhost:8080
JENKINS_USERNAME = '' # Enter available Jenkins username
JENKINS_APITOKEN = '' # Enter Jenkins API token (or password if Jenkins < 1.5)
FIREBASE_DSN = '' # Enter your firebase ... | #!/usr/bin/python3
import sys
import jenkins
from firebase import firebase
JENKINS_URL = '' # Enter Jenkins URL like http://localhost:8080
JENKINS_USERNAME = '' # Enter available Jenkins username
JENKINS_APITOKEN = '' # Enter Jenkins API token (or password if Jenkins < 1.5)
FIREBASE_DSN = '' # Enter your firebase ... | <commit_before>#!/usr/bin/python3
import sys
import jenkins
from firebase import firebase
JENKINS_URL = '' # Enter Jenkins URL like http://localhost:8080
JENKINS_USERNAME = '' # Enter available Jenkins username
JENKINS_APITOKEN = '' # Enter Jenkins API token (or password if Jenkins < 1.5)
FIREBASE_DSN = '' # Enter... |
374bd4881e00c2605f28ea816fa94468a76f2621 | jps/utils.py | jps/utils.py | import json
from .publisher import Publisher
from .common import DEFAULT_PUB_PORT
from .common import DEFAULT_HOST
from .env import get_master_host
class JsonMultiplePublisher(object):
'''publish multiple topics by one json message
Example:
>>> p = JsonMultiplePublisher()
>>> p.publish('{"topic1":... | import json
from .publisher import Publisher
from .common import DEFAULT_PUB_PORT
from .common import DEFAULT_HOST
from .env import get_master_host
class JsonMultiplePublisher(object):
'''publish multiple topics by one json message
Example:
>>> p = JsonMultiplePublisher()
>>> p.publish('{"topic1":... | Add MultiplePublisher to handle topic name suffix | Add MultiplePublisher to handle topic name suffix
| Python | apache-2.0 | OTL/jps | import json
from .publisher import Publisher
from .common import DEFAULT_PUB_PORT
from .common import DEFAULT_HOST
from .env import get_master_host
class JsonMultiplePublisher(object):
'''publish multiple topics by one json message
Example:
>>> p = JsonMultiplePublisher()
>>> p.publish('{"topic1":... | import json
from .publisher import Publisher
from .common import DEFAULT_PUB_PORT
from .common import DEFAULT_HOST
from .env import get_master_host
class JsonMultiplePublisher(object):
'''publish multiple topics by one json message
Example:
>>> p = JsonMultiplePublisher()
>>> p.publish('{"topic1":... | <commit_before>import json
from .publisher import Publisher
from .common import DEFAULT_PUB_PORT
from .common import DEFAULT_HOST
from .env import get_master_host
class JsonMultiplePublisher(object):
'''publish multiple topics by one json message
Example:
>>> p = JsonMultiplePublisher()
>>> p.publ... | import json
from .publisher import Publisher
from .common import DEFAULT_PUB_PORT
from .common import DEFAULT_HOST
from .env import get_master_host
class JsonMultiplePublisher(object):
'''publish multiple topics by one json message
Example:
>>> p = JsonMultiplePublisher()
>>> p.publish('{"topic1":... | import json
from .publisher import Publisher
from .common import DEFAULT_PUB_PORT
from .common import DEFAULT_HOST
from .env import get_master_host
class JsonMultiplePublisher(object):
'''publish multiple topics by one json message
Example:
>>> p = JsonMultiplePublisher()
>>> p.publish('{"topic1":... | <commit_before>import json
from .publisher import Publisher
from .common import DEFAULT_PUB_PORT
from .common import DEFAULT_HOST
from .env import get_master_host
class JsonMultiplePublisher(object):
'''publish multiple topics by one json message
Example:
>>> p = JsonMultiplePublisher()
>>> p.publ... |
48dc53c5c92a49fca959a962434bee6c2810a0c8 | tensorboard_plugin_wit/pip_package/setup.py | tensorboard_plugin_wit/pip_package/setup.py | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Add missing license to pip package | Add missing license to pip package | Python | apache-2.0 | PAIR-code/what-if-tool,PAIR-code/what-if-tool,PAIR-code/what-if-tool,pair-code/what-if-tool,pair-code/what-if-tool,PAIR-code/what-if-tool,pair-code/what-if-tool,pair-code/what-if-tool,PAIR-code/what-if-tool,pair-code/what-if-tool | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | <commit_before># Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | <commit_before># Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
937a5e32c77ca57917d60a891616fbcf19ab19f9 | respite/utils.py | respite/utils.py | from django import forms
def generate_form(model):
"""
Generate a form from a model.
Arguments:
model -- A Django model.
"""
_model = model
class Form(forms.ModelForm):
class Meta:
model = _model
return Form
def parse_http_accept_header(header):
"""
Return ... | from django import forms
def generate_form(model):
"""
Generate a form from a model.
Arguments:
model -- A Django model.
"""
_model = model
class Form(forms.ModelForm):
class Meta:
model = _model
return Form
def parse_http_accept_header(header):
"""
Return ... | Fix a bug that caused HTTP Accept headers with whitespace to be parsed incorrectly | Fix a bug that caused HTTP Accept headers with whitespace to be parsed incorrectly
| Python | mit | jgorset/django-respite,jgorset/django-respite,jgorset/django-respite | from django import forms
def generate_form(model):
"""
Generate a form from a model.
Arguments:
model -- A Django model.
"""
_model = model
class Form(forms.ModelForm):
class Meta:
model = _model
return Form
def parse_http_accept_header(header):
"""
Return ... | from django import forms
def generate_form(model):
"""
Generate a form from a model.
Arguments:
model -- A Django model.
"""
_model = model
class Form(forms.ModelForm):
class Meta:
model = _model
return Form
def parse_http_accept_header(header):
"""
Return ... | <commit_before>from django import forms
def generate_form(model):
"""
Generate a form from a model.
Arguments:
model -- A Django model.
"""
_model = model
class Form(forms.ModelForm):
class Meta:
model = _model
return Form
def parse_http_accept_header(header):
... | from django import forms
def generate_form(model):
"""
Generate a form from a model.
Arguments:
model -- A Django model.
"""
_model = model
class Form(forms.ModelForm):
class Meta:
model = _model
return Form
def parse_http_accept_header(header):
"""
Return ... | from django import forms
def generate_form(model):
"""
Generate a form from a model.
Arguments:
model -- A Django model.
"""
_model = model
class Form(forms.ModelForm):
class Meta:
model = _model
return Form
def parse_http_accept_header(header):
"""
Return ... | <commit_before>from django import forms
def generate_form(model):
"""
Generate a form from a model.
Arguments:
model -- A Django model.
"""
_model = model
class Form(forms.ModelForm):
class Meta:
model = _model
return Form
def parse_http_accept_header(header):
... |
7c3ac5adc33d2048f28a96d8145e71a4c12518cc | udata/__init__.py | udata/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
uData
'''
from __future__ import unicode_literals
__version__ = '1.5.1.dev'
__description__ = 'Open data portal'
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
uData
'''
from __future__ import unicode_literals
__version__ = '1.6.0.dev'
__description__ = 'Open data portal'
| Set base version to 1.6 | Set base version to 1.6
| Python | agpl-3.0 | etalab/udata,opendatateam/udata,opendatateam/udata,opendatateam/udata,etalab/udata,etalab/udata | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
uData
'''
from __future__ import unicode_literals
__version__ = '1.5.1.dev'
__description__ = 'Open data portal'
Set base version to 1.6 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
uData
'''
from __future__ import unicode_literals
__version__ = '1.6.0.dev'
__description__ = 'Open data portal'
| <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
uData
'''
from __future__ import unicode_literals
__version__ = '1.5.1.dev'
__description__ = 'Open data portal'
<commit_msg>Set base version to 1.6<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
uData
'''
from __future__ import unicode_literals
__version__ = '1.6.0.dev'
__description__ = 'Open data portal'
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
uData
'''
from __future__ import unicode_literals
__version__ = '1.5.1.dev'
__description__ = 'Open data portal'
Set base version to 1.6#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
uData
'''
from __future__ import unicode_literals
__version__ = '1.6.0.dev'
__desc... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
uData
'''
from __future__ import unicode_literals
__version__ = '1.5.1.dev'
__description__ = 'Open data portal'
<commit_msg>Set base version to 1.6<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
uData
'''
from __future__ import unicode_l... |
a021f279341eb15c17597200d4bbe97a98034c54 | fate_flow/examples/test_inference.py | fate_flow/examples/test_inference.py | # -*-coding:utf8 -*-
import json
import requests
import time
import uuid
import datetime
import time
ids = ["18576635456", "13512345432"]
url1 = "http://172.16.153.71:8059/federation/1.0/inference"
for i in range(2):
request_data_tmp = {
"head": {
"serviceId": "test_model_service",
... | # -*-coding:utf8 -*-
import json
import requests
import time
import uuid
import datetime
import time
ids = ["18576635456", "13512345432"]
url1 = "http://127.0.0.1:8059/federation/1.0/inference"
for i in range(2):
request_data_tmp = {
"head": {
"serviceId": "test_model_service",
"... | Remove sensitive information from the example | Remove sensitive information from the example
| Python | apache-2.0 | FederatedAI/FATE,FederatedAI/FATE,FederatedAI/FATE | # -*-coding:utf8 -*-
import json
import requests
import time
import uuid
import datetime
import time
ids = ["18576635456", "13512345432"]
url1 = "http://172.16.153.71:8059/federation/1.0/inference"
for i in range(2):
request_data_tmp = {
"head": {
"serviceId": "test_model_service",
... | # -*-coding:utf8 -*-
import json
import requests
import time
import uuid
import datetime
import time
ids = ["18576635456", "13512345432"]
url1 = "http://127.0.0.1:8059/federation/1.0/inference"
for i in range(2):
request_data_tmp = {
"head": {
"serviceId": "test_model_service",
"... | <commit_before># -*-coding:utf8 -*-
import json
import requests
import time
import uuid
import datetime
import time
ids = ["18576635456", "13512345432"]
url1 = "http://172.16.153.71:8059/federation/1.0/inference"
for i in range(2):
request_data_tmp = {
"head": {
"serviceId": "test_model_serv... | # -*-coding:utf8 -*-
import json
import requests
import time
import uuid
import datetime
import time
ids = ["18576635456", "13512345432"]
url1 = "http://127.0.0.1:8059/federation/1.0/inference"
for i in range(2):
request_data_tmp = {
"head": {
"serviceId": "test_model_service",
"... | # -*-coding:utf8 -*-
import json
import requests
import time
import uuid
import datetime
import time
ids = ["18576635456", "13512345432"]
url1 = "http://172.16.153.71:8059/federation/1.0/inference"
for i in range(2):
request_data_tmp = {
"head": {
"serviceId": "test_model_service",
... | <commit_before># -*-coding:utf8 -*-
import json
import requests
import time
import uuid
import datetime
import time
ids = ["18576635456", "13512345432"]
url1 = "http://172.16.153.71:8059/federation/1.0/inference"
for i in range(2):
request_data_tmp = {
"head": {
"serviceId": "test_model_serv... |
c9392a6578b0894dff7a5407410e8892e9f3ae6d | win_unc/validators.py | win_unc/validators.py | from win_unc.sanitizors import sanitize_username, sanitize_unc_path
def is_valid_drive_letter(string):
"""
Drive letters are one character in length and between "A" and "Z". Case does not matter.
"""
return (len(string) == 1
and string[0].isalpha())
def is_valid_unc_path(string):
"""... | from win_unc.internal.utils import take_while
from win_unc.sanitizors import sanitize_username, sanitize_unc_path
def is_valid_drive_letter(string):
"""
Drive letters are one character in length and between "A" and "Z". Case does not matter.
"""
return (len(string) == 1
and string[0].isalp... | Fix bad refactor of is_valid_unc_path | Fix bad refactor of is_valid_unc_path
| Python | mit | nithinphilips/py_win_unc,CovenantEyes/py_win_unc | from win_unc.sanitizors import sanitize_username, sanitize_unc_path
def is_valid_drive_letter(string):
"""
Drive letters are one character in length and between "A" and "Z". Case does not matter.
"""
return (len(string) == 1
and string[0].isalpha())
def is_valid_unc_path(string):
"""... | from win_unc.internal.utils import take_while
from win_unc.sanitizors import sanitize_username, sanitize_unc_path
def is_valid_drive_letter(string):
"""
Drive letters are one character in length and between "A" and "Z". Case does not matter.
"""
return (len(string) == 1
and string[0].isalp... | <commit_before>from win_unc.sanitizors import sanitize_username, sanitize_unc_path
def is_valid_drive_letter(string):
"""
Drive letters are one character in length and between "A" and "Z". Case does not matter.
"""
return (len(string) == 1
and string[0].isalpha())
def is_valid_unc_path(s... | from win_unc.internal.utils import take_while
from win_unc.sanitizors import sanitize_username, sanitize_unc_path
def is_valid_drive_letter(string):
"""
Drive letters are one character in length and between "A" and "Z". Case does not matter.
"""
return (len(string) == 1
and string[0].isalp... | from win_unc.sanitizors import sanitize_username, sanitize_unc_path
def is_valid_drive_letter(string):
"""
Drive letters are one character in length and between "A" and "Z". Case does not matter.
"""
return (len(string) == 1
and string[0].isalpha())
def is_valid_unc_path(string):
"""... | <commit_before>from win_unc.sanitizors import sanitize_username, sanitize_unc_path
def is_valid_drive_letter(string):
"""
Drive letters are one character in length and between "A" and "Z". Case does not matter.
"""
return (len(string) == 1
and string[0].isalpha())
def is_valid_unc_path(s... |
1d13bd71ff105d540c3af166056cb0b8731a3417 | wooey/migrations/0037_populate-jsonfield.py | wooey/migrations/0037_populate-jsonfield.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-03-04 23:14
from __future__ import unicode_literals
import json
from django.db import migrations
def populate_default(apps, schema_editor):
ScriptParameter = apps.get_model('wooey', 'ScriptParameter')
for obj in ScriptParameter.objects.all():
... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-03-04 23:14
from __future__ import unicode_literals
import json
from django.db import migrations
def populate_default(apps, schema_editor):
ScriptParameter = apps.get_model('wooey', 'ScriptParameter')
for obj in ScriptParameter.objects.all():
... | Add reverse to data migration | Add reverse to data migration
| Python | bsd-3-clause | wooey/Wooey,wooey/Wooey,wooey/Wooey,wooey/Wooey | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-03-04 23:14
from __future__ import unicode_literals
import json
from django.db import migrations
def populate_default(apps, schema_editor):
ScriptParameter = apps.get_model('wooey', 'ScriptParameter')
for obj in ScriptParameter.objects.all():
... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-03-04 23:14
from __future__ import unicode_literals
import json
from django.db import migrations
def populate_default(apps, schema_editor):
ScriptParameter = apps.get_model('wooey', 'ScriptParameter')
for obj in ScriptParameter.objects.all():
... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-03-04 23:14
from __future__ import unicode_literals
import json
from django.db import migrations
def populate_default(apps, schema_editor):
ScriptParameter = apps.get_model('wooey', 'ScriptParameter')
for obj in ScriptParameter.objec... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-03-04 23:14
from __future__ import unicode_literals
import json
from django.db import migrations
def populate_default(apps, schema_editor):
ScriptParameter = apps.get_model('wooey', 'ScriptParameter')
for obj in ScriptParameter.objects.all():
... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-03-04 23:14
from __future__ import unicode_literals
import json
from django.db import migrations
def populate_default(apps, schema_editor):
ScriptParameter = apps.get_model('wooey', 'ScriptParameter')
for obj in ScriptParameter.objects.all():
... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-03-04 23:14
from __future__ import unicode_literals
import json
from django.db import migrations
def populate_default(apps, schema_editor):
ScriptParameter = apps.get_model('wooey', 'ScriptParameter')
for obj in ScriptParameter.objec... |
fea2c0bc02a8323ad6c759ca63663499a538186e | onnx/__init__.py | onnx/__init__.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from .onnx_ml_pb2 import * # noqa
from .version import version as __version__ # noqa
import sys
def load(obj):
'''
Loads a binary protobuf that stores onnx gr... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from .onnx_ml_pb2 import * # noqa
from .version import version as __version__ # noqa
# Import common subpackages so they're available when you 'import onnx'
import onn... | Undo BC-breaking change, restore 'import onnx' providing submodules. | Undo BC-breaking change, restore 'import onnx' providing submodules.
Signed-off-by: Edward Z. Yang <dbd597f5635f432486c5d365e9bb585b3eaa1853@fb.com>
| Python | apache-2.0 | onnx/onnx,onnx/onnx,onnx/onnx,onnx/onnx | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from .onnx_ml_pb2 import * # noqa
from .version import version as __version__ # noqa
import sys
def load(obj):
'''
Loads a binary protobuf that stores onnx gr... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from .onnx_ml_pb2 import * # noqa
from .version import version as __version__ # noqa
# Import common subpackages so they're available when you 'import onnx'
import onn... | <commit_before>from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from .onnx_ml_pb2 import * # noqa
from .version import version as __version__ # noqa
import sys
def load(obj):
'''
Loads a binary protobuf that... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from .onnx_ml_pb2 import * # noqa
from .version import version as __version__ # noqa
# Import common subpackages so they're available when you 'import onnx'
import onn... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from .onnx_ml_pb2 import * # noqa
from .version import version as __version__ # noqa
import sys
def load(obj):
'''
Loads a binary protobuf that stores onnx gr... | <commit_before>from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from .onnx_ml_pb2 import * # noqa
from .version import version as __version__ # noqa
import sys
def load(obj):
'''
Loads a binary protobuf that... |
81faa7704fb355dd16674d4ed089e0ced34c24c6 | rflo/start.py | rflo/start.py | import ioflo.app.run
import os
class Manager(object):
'''
Manage the main ioflo process
'''
def __init__(self):
self.behaviors = ['rflo.config', 'rflo.roads']
self.floscript = os.path.join(os.path.dirname(__file__), 'raft.flo')
def start(self):
ioflo.app.run.start(
... | import ioflo.app.run
import os
class Manager(object):
'''
Manage the main ioflo process
'''
def __init__(self):
self.behaviors = ['rflo.config', 'rflo.roads', 'rflo.router']
self.floscript = os.path.join(os.path.dirname(__file__), 'raft.flo')
def start(self):
ioflo.app.run... | Add router to the behaviors lookup | Add router to the behaviors lookup
| Python | apache-2.0 | thatch45/rflo | import ioflo.app.run
import os
class Manager(object):
'''
Manage the main ioflo process
'''
def __init__(self):
self.behaviors = ['rflo.config', 'rflo.roads']
self.floscript = os.path.join(os.path.dirname(__file__), 'raft.flo')
def start(self):
ioflo.app.run.start(
... | import ioflo.app.run
import os
class Manager(object):
'''
Manage the main ioflo process
'''
def __init__(self):
self.behaviors = ['rflo.config', 'rflo.roads', 'rflo.router']
self.floscript = os.path.join(os.path.dirname(__file__), 'raft.flo')
def start(self):
ioflo.app.run... | <commit_before>import ioflo.app.run
import os
class Manager(object):
'''
Manage the main ioflo process
'''
def __init__(self):
self.behaviors = ['rflo.config', 'rflo.roads']
self.floscript = os.path.join(os.path.dirname(__file__), 'raft.flo')
def start(self):
ioflo.app.run... | import ioflo.app.run
import os
class Manager(object):
'''
Manage the main ioflo process
'''
def __init__(self):
self.behaviors = ['rflo.config', 'rflo.roads', 'rflo.router']
self.floscript = os.path.join(os.path.dirname(__file__), 'raft.flo')
def start(self):
ioflo.app.run... | import ioflo.app.run
import os
class Manager(object):
'''
Manage the main ioflo process
'''
def __init__(self):
self.behaviors = ['rflo.config', 'rflo.roads']
self.floscript = os.path.join(os.path.dirname(__file__), 'raft.flo')
def start(self):
ioflo.app.run.start(
... | <commit_before>import ioflo.app.run
import os
class Manager(object):
'''
Manage the main ioflo process
'''
def __init__(self):
self.behaviors = ['rflo.config', 'rflo.roads']
self.floscript = os.path.join(os.path.dirname(__file__), 'raft.flo')
def start(self):
ioflo.app.run... |
28181d9bcf7aa597b88507871ffb31f4028eb67c | src/pretix/testutils/settings.py | src/pretix/testutils/settings.py | import atexit
import os
import tempfile
tmpdir = tempfile.TemporaryDirectory()
os.environ.setdefault('DATA_DIR', tmpdir.name)
from pretix.settings import * # NOQA
DATA_DIR = tmpdir.name
LOG_DIR = os.path.join(DATA_DIR, 'logs')
MEDIA_ROOT = os.path.join(DATA_DIR, 'media')
atexit.register(tmpdir.cleanup)
EMAIL_BACK... | import atexit
import os
import tempfile
tmpdir = tempfile.TemporaryDirectory()
os.environ.setdefault('DATA_DIR', tmpdir.name)
from pretix.settings import * # NOQA
DATA_DIR = tmpdir.name
LOG_DIR = os.path.join(DATA_DIR, 'logs')
MEDIA_ROOT = os.path.join(DATA_DIR, 'media')
atexit.register(tmpdir.cleanup)
EMAIL_BACK... | Enable DEBUG when running the test suite | Enable DEBUG when running the test suite
| Python | apache-2.0 | Flamacue/pretix,Flamacue/pretix,Flamacue/pretix,Flamacue/pretix | import atexit
import os
import tempfile
tmpdir = tempfile.TemporaryDirectory()
os.environ.setdefault('DATA_DIR', tmpdir.name)
from pretix.settings import * # NOQA
DATA_DIR = tmpdir.name
LOG_DIR = os.path.join(DATA_DIR, 'logs')
MEDIA_ROOT = os.path.join(DATA_DIR, 'media')
atexit.register(tmpdir.cleanup)
EMAIL_BACK... | import atexit
import os
import tempfile
tmpdir = tempfile.TemporaryDirectory()
os.environ.setdefault('DATA_DIR', tmpdir.name)
from pretix.settings import * # NOQA
DATA_DIR = tmpdir.name
LOG_DIR = os.path.join(DATA_DIR, 'logs')
MEDIA_ROOT = os.path.join(DATA_DIR, 'media')
atexit.register(tmpdir.cleanup)
EMAIL_BACK... | <commit_before>import atexit
import os
import tempfile
tmpdir = tempfile.TemporaryDirectory()
os.environ.setdefault('DATA_DIR', tmpdir.name)
from pretix.settings import * # NOQA
DATA_DIR = tmpdir.name
LOG_DIR = os.path.join(DATA_DIR, 'logs')
MEDIA_ROOT = os.path.join(DATA_DIR, 'media')
atexit.register(tmpdir.clean... | import atexit
import os
import tempfile
tmpdir = tempfile.TemporaryDirectory()
os.environ.setdefault('DATA_DIR', tmpdir.name)
from pretix.settings import * # NOQA
DATA_DIR = tmpdir.name
LOG_DIR = os.path.join(DATA_DIR, 'logs')
MEDIA_ROOT = os.path.join(DATA_DIR, 'media')
atexit.register(tmpdir.cleanup)
EMAIL_BACK... | import atexit
import os
import tempfile
tmpdir = tempfile.TemporaryDirectory()
os.environ.setdefault('DATA_DIR', tmpdir.name)
from pretix.settings import * # NOQA
DATA_DIR = tmpdir.name
LOG_DIR = os.path.join(DATA_DIR, 'logs')
MEDIA_ROOT = os.path.join(DATA_DIR, 'media')
atexit.register(tmpdir.cleanup)
EMAIL_BACK... | <commit_before>import atexit
import os
import tempfile
tmpdir = tempfile.TemporaryDirectory()
os.environ.setdefault('DATA_DIR', tmpdir.name)
from pretix.settings import * # NOQA
DATA_DIR = tmpdir.name
LOG_DIR = os.path.join(DATA_DIR, 'logs')
MEDIA_ROOT = os.path.join(DATA_DIR, 'media')
atexit.register(tmpdir.clean... |
c1efaefbe6a098e3f74bed20ff55a4307ec90ddd | dynamic_requirements.py | dynamic_requirements.py | install_requires = [
'Dockets>=0.3.4,<0.4.0',
'boto>=2.26.0',
]
test_requires = [
'nose>=1.3.0,<2.0.0',
'mock>=1.0.0,<2.0.0',
'redis>=2.10.0,<3.0.0',
'moto>=0.4.1',
]
| install_requires = [
'Dockets>=0.4.0,<0.5.0',
'boto>=2.26.0',
]
test_requires = [
'nose>=1.3.0,<2.0.0',
'mock>=1.0.0,<2.0.0',
'redis>=2.10.0,<3.0.0',
'moto>=0.4.1',
]
| Use new version of Dockets | Use new version of Dockets
| Python | mit | gamechanger/deferrable | install_requires = [
'Dockets>=0.3.4,<0.4.0',
'boto>=2.26.0',
]
test_requires = [
'nose>=1.3.0,<2.0.0',
'mock>=1.0.0,<2.0.0',
'redis>=2.10.0,<3.0.0',
'moto>=0.4.1',
]
Use new version of Dockets | install_requires = [
'Dockets>=0.4.0,<0.5.0',
'boto>=2.26.0',
]
test_requires = [
'nose>=1.3.0,<2.0.0',
'mock>=1.0.0,<2.0.0',
'redis>=2.10.0,<3.0.0',
'moto>=0.4.1',
]
| <commit_before>install_requires = [
'Dockets>=0.3.4,<0.4.0',
'boto>=2.26.0',
]
test_requires = [
'nose>=1.3.0,<2.0.0',
'mock>=1.0.0,<2.0.0',
'redis>=2.10.0,<3.0.0',
'moto>=0.4.1',
]
<commit_msg>Use new version of Dockets<commit_after> | install_requires = [
'Dockets>=0.4.0,<0.5.0',
'boto>=2.26.0',
]
test_requires = [
'nose>=1.3.0,<2.0.0',
'mock>=1.0.0,<2.0.0',
'redis>=2.10.0,<3.0.0',
'moto>=0.4.1',
]
| install_requires = [
'Dockets>=0.3.4,<0.4.0',
'boto>=2.26.0',
]
test_requires = [
'nose>=1.3.0,<2.0.0',
'mock>=1.0.0,<2.0.0',
'redis>=2.10.0,<3.0.0',
'moto>=0.4.1',
]
Use new version of Docketsinstall_requires = [
'Dockets>=0.4.0,<0.5.0',
'boto>=2.26.0',
]
test_requires = [
'nose>=... | <commit_before>install_requires = [
'Dockets>=0.3.4,<0.4.0',
'boto>=2.26.0',
]
test_requires = [
'nose>=1.3.0,<2.0.0',
'mock>=1.0.0,<2.0.0',
'redis>=2.10.0,<3.0.0',
'moto>=0.4.1',
]
<commit_msg>Use new version of Dockets<commit_after>install_requires = [
'Dockets>=0.4.0,<0.5.0',
'boto>=... |
da1a0f5e7ffcbe37cdee484b452b5376049dd1e5 | python/django.py | python/django.py | """
Django middleware that enables the MDK.
This is old-style (Django <1.10) middleware. Please see
https://docs.djangoproject.com/en/1.10/topics/http/middleware/#upgrading-middleware
if you're using Django 1.10.
"""
import atexit
from traceback import format_exception_only
from mdk import start
class MDKSessionMi... | """
Django middleware that enables the MDK.
"""
import atexit
from traceback import format_exception_only
from mdk import start
# Django 1.10 new-style middleware compatibility:
try:
from django.utils.deprecation import MiddlewareMixin
except ImportError:
MiddlewareMixin = object
class MDKSessionMiddleware... | Work with Django 1.10 as well. | Work with Django 1.10 as well.
| Python | apache-2.0 | datawire/mdk,datawire/mdk,datawire/mdk,datawire/mdk | """
Django middleware that enables the MDK.
This is old-style (Django <1.10) middleware. Please see
https://docs.djangoproject.com/en/1.10/topics/http/middleware/#upgrading-middleware
if you're using Django 1.10.
"""
import atexit
from traceback import format_exception_only
from mdk import start
class MDKSessionMi... | """
Django middleware that enables the MDK.
"""
import atexit
from traceback import format_exception_only
from mdk import start
# Django 1.10 new-style middleware compatibility:
try:
from django.utils.deprecation import MiddlewareMixin
except ImportError:
MiddlewareMixin = object
class MDKSessionMiddleware... | <commit_before>"""
Django middleware that enables the MDK.
This is old-style (Django <1.10) middleware. Please see
https://docs.djangoproject.com/en/1.10/topics/http/middleware/#upgrading-middleware
if you're using Django 1.10.
"""
import atexit
from traceback import format_exception_only
from mdk import start
cla... | """
Django middleware that enables the MDK.
"""
import atexit
from traceback import format_exception_only
from mdk import start
# Django 1.10 new-style middleware compatibility:
try:
from django.utils.deprecation import MiddlewareMixin
except ImportError:
MiddlewareMixin = object
class MDKSessionMiddleware... | """
Django middleware that enables the MDK.
This is old-style (Django <1.10) middleware. Please see
https://docs.djangoproject.com/en/1.10/topics/http/middleware/#upgrading-middleware
if you're using Django 1.10.
"""
import atexit
from traceback import format_exception_only
from mdk import start
class MDKSessionMi... | <commit_before>"""
Django middleware that enables the MDK.
This is old-style (Django <1.10) middleware. Please see
https://docs.djangoproject.com/en/1.10/topics/http/middleware/#upgrading-middleware
if you're using Django 1.10.
"""
import atexit
from traceback import format_exception_only
from mdk import start
cla... |
a3357cd4bb0859f480fa91f50604a2f129431096 | eduid_signup/vccs.py | eduid_signup/vccs.py | from pwgen import pwgen
from re import findall
import vccs_client
def generate_password(settings, credential_id, email):
"""
Generate a new password credential and add it to the VCCS authentication backend.
The salt returned needs to be saved for use in subsequent authentications using
this password... | from pwgen import pwgen
from re import findall
import vccs_client
def generate_password(settings, credential_id, email):
"""
Generate a new password credential and add it to the VCCS authentication backend.
The salt returned needs to be saved for use in subsequent authentications using
this password... | Exclude upper case letters from generated passwords. | Exclude upper case letters from generated passwords.
12 character passwords from the set a-z0-9 have more bits of
entropy (62) than 10 character passwords from the set
a-zA-Z0-9 (60), and are probably perceived as nicer by the
users too (less ambiguity, easier to type on smartphones and
the like).
| Python | bsd-3-clause | SUNET/eduid-signup,SUNET/eduid-signup,SUNET/eduid-signup | from pwgen import pwgen
from re import findall
import vccs_client
def generate_password(settings, credential_id, email):
"""
Generate a new password credential and add it to the VCCS authentication backend.
The salt returned needs to be saved for use in subsequent authentications using
this password... | from pwgen import pwgen
from re import findall
import vccs_client
def generate_password(settings, credential_id, email):
"""
Generate a new password credential and add it to the VCCS authentication backend.
The salt returned needs to be saved for use in subsequent authentications using
this password... | <commit_before>from pwgen import pwgen
from re import findall
import vccs_client
def generate_password(settings, credential_id, email):
"""
Generate a new password credential and add it to the VCCS authentication backend.
The salt returned needs to be saved for use in subsequent authentications using
... | from pwgen import pwgen
from re import findall
import vccs_client
def generate_password(settings, credential_id, email):
"""
Generate a new password credential and add it to the VCCS authentication backend.
The salt returned needs to be saved for use in subsequent authentications using
this password... | from pwgen import pwgen
from re import findall
import vccs_client
def generate_password(settings, credential_id, email):
"""
Generate a new password credential and add it to the VCCS authentication backend.
The salt returned needs to be saved for use in subsequent authentications using
this password... | <commit_before>from pwgen import pwgen
from re import findall
import vccs_client
def generate_password(settings, credential_id, email):
"""
Generate a new password credential and add it to the VCCS authentication backend.
The salt returned needs to be saved for use in subsequent authentications using
... |
b03ed6307bd1354b931cdd993361d0a40a1d6850 | api/init/graphqlapi/proxy.py | api/init/graphqlapi/proxy.py | import graphqlapi.utils as utils
from graphql.parser import GraphQLParser
from graphqlapi.interceptor import ExecuteBatch, TestDataSource
from graphqlapi.exceptions import RequestException
interceptors = [
ExecuteBatch(),
TestDataSource()
]
def proxy_request(payload: dict):
graphql_ast = parse_query(pay... | import graphqlapi.utils as utils
from graphqlapi.exceptions import RequestException
from graphqlapi.interceptor import ExecuteBatch, TestDataSource
from graphql.parser import GraphQLParser
interceptors = [
ExecuteBatch(),
TestDataSource()
]
def proxy_request(payload: dict):
graphql_ast = parse_query(pay... | Reorder imports in alphabetical order | Reorder imports in alphabetical order
| Python | apache-2.0 | alexisrolland/data-quality,alexisrolland/data-quality,alexisrolland/data-quality,alexisrolland/data-quality | import graphqlapi.utils as utils
from graphql.parser import GraphQLParser
from graphqlapi.interceptor import ExecuteBatch, TestDataSource
from graphqlapi.exceptions import RequestException
interceptors = [
ExecuteBatch(),
TestDataSource()
]
def proxy_request(payload: dict):
graphql_ast = parse_query(pay... | import graphqlapi.utils as utils
from graphqlapi.exceptions import RequestException
from graphqlapi.interceptor import ExecuteBatch, TestDataSource
from graphql.parser import GraphQLParser
interceptors = [
ExecuteBatch(),
TestDataSource()
]
def proxy_request(payload: dict):
graphql_ast = parse_query(pay... | <commit_before>import graphqlapi.utils as utils
from graphql.parser import GraphQLParser
from graphqlapi.interceptor import ExecuteBatch, TestDataSource
from graphqlapi.exceptions import RequestException
interceptors = [
ExecuteBatch(),
TestDataSource()
]
def proxy_request(payload: dict):
graphql_ast = ... | import graphqlapi.utils as utils
from graphqlapi.exceptions import RequestException
from graphqlapi.interceptor import ExecuteBatch, TestDataSource
from graphql.parser import GraphQLParser
interceptors = [
ExecuteBatch(),
TestDataSource()
]
def proxy_request(payload: dict):
graphql_ast = parse_query(pay... | import graphqlapi.utils as utils
from graphql.parser import GraphQLParser
from graphqlapi.interceptor import ExecuteBatch, TestDataSource
from graphqlapi.exceptions import RequestException
interceptors = [
ExecuteBatch(),
TestDataSource()
]
def proxy_request(payload: dict):
graphql_ast = parse_query(pay... | <commit_before>import graphqlapi.utils as utils
from graphql.parser import GraphQLParser
from graphqlapi.interceptor import ExecuteBatch, TestDataSource
from graphqlapi.exceptions import RequestException
interceptors = [
ExecuteBatch(),
TestDataSource()
]
def proxy_request(payload: dict):
graphql_ast = ... |
f95aa5b36a354fe3cfd94b43d8f0f6346ec400de | soapypower/threadpool.py | soapypower/threadpool.py | import os, queue, concurrent.futures
class ThreadPoolExecutor(concurrent.futures.ThreadPoolExecutor):
"""ThreadPoolExecutor which allows setting max. work queue size"""
def __init__(self, max_workers=0, thread_name_prefix='', max_queue_size=0):
super().__init__(max_workers or os.cpu_count() or 1, thre... | import os, queue, concurrent.futures
class ThreadPoolExecutor(concurrent.futures.ThreadPoolExecutor):
"""ThreadPoolExecutor which allows setting max. work queue size"""
def __init__(self, max_workers=0, thread_name_prefix='', max_queue_size=0):
#super().__init__(max_workers or os.cpu_count() or 1, thr... | Disable setting thread_name_prefix in ThreadPoolExecutor (only supported in Python >= 3.6) | Disable setting thread_name_prefix in ThreadPoolExecutor (only supported in Python >= 3.6)
| Python | mit | xmikos/soapy_power,xmikos/soapy_power | import os, queue, concurrent.futures
class ThreadPoolExecutor(concurrent.futures.ThreadPoolExecutor):
"""ThreadPoolExecutor which allows setting max. work queue size"""
def __init__(self, max_workers=0, thread_name_prefix='', max_queue_size=0):
super().__init__(max_workers or os.cpu_count() or 1, thre... | import os, queue, concurrent.futures
class ThreadPoolExecutor(concurrent.futures.ThreadPoolExecutor):
"""ThreadPoolExecutor which allows setting max. work queue size"""
def __init__(self, max_workers=0, thread_name_prefix='', max_queue_size=0):
#super().__init__(max_workers or os.cpu_count() or 1, thr... | <commit_before>import os, queue, concurrent.futures
class ThreadPoolExecutor(concurrent.futures.ThreadPoolExecutor):
"""ThreadPoolExecutor which allows setting max. work queue size"""
def __init__(self, max_workers=0, thread_name_prefix='', max_queue_size=0):
super().__init__(max_workers or os.cpu_cou... | import os, queue, concurrent.futures
class ThreadPoolExecutor(concurrent.futures.ThreadPoolExecutor):
"""ThreadPoolExecutor which allows setting max. work queue size"""
def __init__(self, max_workers=0, thread_name_prefix='', max_queue_size=0):
#super().__init__(max_workers or os.cpu_count() or 1, thr... | import os, queue, concurrent.futures
class ThreadPoolExecutor(concurrent.futures.ThreadPoolExecutor):
"""ThreadPoolExecutor which allows setting max. work queue size"""
def __init__(self, max_workers=0, thread_name_prefix='', max_queue_size=0):
super().__init__(max_workers or os.cpu_count() or 1, thre... | <commit_before>import os, queue, concurrent.futures
class ThreadPoolExecutor(concurrent.futures.ThreadPoolExecutor):
"""ThreadPoolExecutor which allows setting max. work queue size"""
def __init__(self, max_workers=0, thread_name_prefix='', max_queue_size=0):
super().__init__(max_workers or os.cpu_cou... |
aed8a831bca72268ad9fbcd2f777d91af29d61b6 | message_view.py | message_view.py | import sublime
import sublime_plugin
PANEL_NAME = "SublimeLinter Messages"
def plugin_unloaded():
for window in sublime.windows():
window.destroy_output_panel(PANEL_NAME)
class SublimeLinterDisplayPanelCommand(sublime_plugin.WindowCommand):
def run(self, msg=""):
panel_view = self.window.cr... | import sublime
import sublime_plugin
PANEL_NAME = "SublimeLinter Messages"
OUTPUT_PANEL = "output." + PANEL_NAME
def plugin_unloaded():
for window in sublime.windows():
window.destroy_output_panel(PANEL_NAME)
class SublimeLinterDisplayPanelCommand(sublime_plugin.WindowCommand):
def run(self, msg=""... | Define const `OUTPUT_PANEL` for the panel name | Define const `OUTPUT_PANEL` for the panel name
| Python | mit | SublimeLinter/SublimeLinter3,SublimeLinter/SublimeLinter3 | import sublime
import sublime_plugin
PANEL_NAME = "SublimeLinter Messages"
def plugin_unloaded():
for window in sublime.windows():
window.destroy_output_panel(PANEL_NAME)
class SublimeLinterDisplayPanelCommand(sublime_plugin.WindowCommand):
def run(self, msg=""):
panel_view = self.window.cr... | import sublime
import sublime_plugin
PANEL_NAME = "SublimeLinter Messages"
OUTPUT_PANEL = "output." + PANEL_NAME
def plugin_unloaded():
for window in sublime.windows():
window.destroy_output_panel(PANEL_NAME)
class SublimeLinterDisplayPanelCommand(sublime_plugin.WindowCommand):
def run(self, msg=""... | <commit_before>import sublime
import sublime_plugin
PANEL_NAME = "SublimeLinter Messages"
def plugin_unloaded():
for window in sublime.windows():
window.destroy_output_panel(PANEL_NAME)
class SublimeLinterDisplayPanelCommand(sublime_plugin.WindowCommand):
def run(self, msg=""):
panel_view =... | import sublime
import sublime_plugin
PANEL_NAME = "SublimeLinter Messages"
OUTPUT_PANEL = "output." + PANEL_NAME
def plugin_unloaded():
for window in sublime.windows():
window.destroy_output_panel(PANEL_NAME)
class SublimeLinterDisplayPanelCommand(sublime_plugin.WindowCommand):
def run(self, msg=""... | import sublime
import sublime_plugin
PANEL_NAME = "SublimeLinter Messages"
def plugin_unloaded():
for window in sublime.windows():
window.destroy_output_panel(PANEL_NAME)
class SublimeLinterDisplayPanelCommand(sublime_plugin.WindowCommand):
def run(self, msg=""):
panel_view = self.window.cr... | <commit_before>import sublime
import sublime_plugin
PANEL_NAME = "SublimeLinter Messages"
def plugin_unloaded():
for window in sublime.windows():
window.destroy_output_panel(PANEL_NAME)
class SublimeLinterDisplayPanelCommand(sublime_plugin.WindowCommand):
def run(self, msg=""):
panel_view =... |
958bb725cce490ecf5d9f2052e739d2b1fe84b3d | interface/backend/images/factories.py | interface/backend/images/factories.py | import factory
import factory.fuzzy
from backend.images import models
class ImageSeriesFactory(factory.django.DjangoModelFactory):
class Meta:
model = models.ImageSeries
patient_id = factory.Sequence(lambda n: "TEST-SERIES-%04d" % n)
series_instance_uid = factory.Sequence(lambda n: "1.3.6.1.4.1.... | import factory
import factory.fuzzy
from backend.images import models
class ImageSeriesFactory(factory.django.DjangoModelFactory):
class Meta:
model = models.ImageSeries
patient_id = factory.Sequence(lambda n: "TEST-SERIES-%04d" % n)
series_instance_uid = factory.Sequence(lambda n: "1.3.6.1.4.1.... | Make centroid factory locations a little more plausible | Make centroid factory locations a little more plausible
| Python | mit | vessemer/concept-to-clinic,vessemer/concept-to-clinic,vessemer/concept-to-clinic,vessemer/concept-to-clinic | import factory
import factory.fuzzy
from backend.images import models
class ImageSeriesFactory(factory.django.DjangoModelFactory):
class Meta:
model = models.ImageSeries
patient_id = factory.Sequence(lambda n: "TEST-SERIES-%04d" % n)
series_instance_uid = factory.Sequence(lambda n: "1.3.6.1.4.1.... | import factory
import factory.fuzzy
from backend.images import models
class ImageSeriesFactory(factory.django.DjangoModelFactory):
class Meta:
model = models.ImageSeries
patient_id = factory.Sequence(lambda n: "TEST-SERIES-%04d" % n)
series_instance_uid = factory.Sequence(lambda n: "1.3.6.1.4.1.... | <commit_before>import factory
import factory.fuzzy
from backend.images import models
class ImageSeriesFactory(factory.django.DjangoModelFactory):
class Meta:
model = models.ImageSeries
patient_id = factory.Sequence(lambda n: "TEST-SERIES-%04d" % n)
series_instance_uid = factory.Sequence(lambda n... | import factory
import factory.fuzzy
from backend.images import models
class ImageSeriesFactory(factory.django.DjangoModelFactory):
class Meta:
model = models.ImageSeries
patient_id = factory.Sequence(lambda n: "TEST-SERIES-%04d" % n)
series_instance_uid = factory.Sequence(lambda n: "1.3.6.1.4.1.... | import factory
import factory.fuzzy
from backend.images import models
class ImageSeriesFactory(factory.django.DjangoModelFactory):
class Meta:
model = models.ImageSeries
patient_id = factory.Sequence(lambda n: "TEST-SERIES-%04d" % n)
series_instance_uid = factory.Sequence(lambda n: "1.3.6.1.4.1.... | <commit_before>import factory
import factory.fuzzy
from backend.images import models
class ImageSeriesFactory(factory.django.DjangoModelFactory):
class Meta:
model = models.ImageSeries
patient_id = factory.Sequence(lambda n: "TEST-SERIES-%04d" % n)
series_instance_uid = factory.Sequence(lambda n... |
3fe0f73d9c9ca177cefd61636f10be77aa1261d0 | autoentrepreneur/forms.py | autoentrepreneur/forms.py | from django.forms import ModelForm
from django import forms
from django.utils.translation import ugettext_lazy as _
from autoentrepreneur.models import UserProfile, AUTOENTREPRENEUR_ACTIVITY, \
AUTOENTREPRENEUR_PAYMENT_OPTION
class UserProfileForm(ModelForm):
company_name = forms.CharField(required=False, max_... | from django.forms import ModelForm
from django import forms
from django.utils.translation import ugettext_lazy as _
from autoentrepreneur.models import UserProfile, AUTOENTREPRENEUR_ACTIVITY, \
AUTOENTREPRENEUR_PAYMENT_OPTION
class UserProfileForm(ModelForm):
company_name = forms.CharField(required=False, max_... | Remove bank information from form. | Remove bank information from form.
| Python | agpl-3.0 | fgaudin/aemanager,fgaudin/aemanager,fgaudin/aemanager | from django.forms import ModelForm
from django import forms
from django.utils.translation import ugettext_lazy as _
from autoentrepreneur.models import UserProfile, AUTOENTREPRENEUR_ACTIVITY, \
AUTOENTREPRENEUR_PAYMENT_OPTION
class UserProfileForm(ModelForm):
company_name = forms.CharField(required=False, max_... | from django.forms import ModelForm
from django import forms
from django.utils.translation import ugettext_lazy as _
from autoentrepreneur.models import UserProfile, AUTOENTREPRENEUR_ACTIVITY, \
AUTOENTREPRENEUR_PAYMENT_OPTION
class UserProfileForm(ModelForm):
company_name = forms.CharField(required=False, max_... | <commit_before>from django.forms import ModelForm
from django import forms
from django.utils.translation import ugettext_lazy as _
from autoentrepreneur.models import UserProfile, AUTOENTREPRENEUR_ACTIVITY, \
AUTOENTREPRENEUR_PAYMENT_OPTION
class UserProfileForm(ModelForm):
company_name = forms.CharField(requi... | from django.forms import ModelForm
from django import forms
from django.utils.translation import ugettext_lazy as _
from autoentrepreneur.models import UserProfile, AUTOENTREPRENEUR_ACTIVITY, \
AUTOENTREPRENEUR_PAYMENT_OPTION
class UserProfileForm(ModelForm):
company_name = forms.CharField(required=False, max_... | from django.forms import ModelForm
from django import forms
from django.utils.translation import ugettext_lazy as _
from autoentrepreneur.models import UserProfile, AUTOENTREPRENEUR_ACTIVITY, \
AUTOENTREPRENEUR_PAYMENT_OPTION
class UserProfileForm(ModelForm):
company_name = forms.CharField(required=False, max_... | <commit_before>from django.forms import ModelForm
from django import forms
from django.utils.translation import ugettext_lazy as _
from autoentrepreneur.models import UserProfile, AUTOENTREPRENEUR_ACTIVITY, \
AUTOENTREPRENEUR_PAYMENT_OPTION
class UserProfileForm(ModelForm):
company_name = forms.CharField(requi... |
382a3f673c4d74f6ba2b8c4ccff9332445b76093 | chmvh_website/resources/models.py | chmvh_website/resources/models.py | from django.db import models
class Category(models.Model):
"""A category of resources."""
important = models.BooleanField(
default=False,
help_text=('categories marked important will be shown at the top of ',
'the resource list'),
verbose_name='important')
title ... | from django.db import models
class Category(models.Model):
"""A category of resources."""
important = models.BooleanField(
default=False,
help_text=('Categories marked important will be shown at the top of '
'the resource list'),
verbose_name='important')
title =... | Fix resource category help text. | Fix resource category help text.
Fixes #15
| Python | mit | cdriehuys/chmvh-website,cdriehuys/chmvh-website,cdriehuys/chmvh-website | from django.db import models
class Category(models.Model):
"""A category of resources."""
important = models.BooleanField(
default=False,
help_text=('categories marked important will be shown at the top of ',
'the resource list'),
verbose_name='important')
title ... | from django.db import models
class Category(models.Model):
"""A category of resources."""
important = models.BooleanField(
default=False,
help_text=('Categories marked important will be shown at the top of '
'the resource list'),
verbose_name='important')
title =... | <commit_before>from django.db import models
class Category(models.Model):
"""A category of resources."""
important = models.BooleanField(
default=False,
help_text=('categories marked important will be shown at the top of ',
'the resource list'),
verbose_name='importa... | from django.db import models
class Category(models.Model):
"""A category of resources."""
important = models.BooleanField(
default=False,
help_text=('Categories marked important will be shown at the top of '
'the resource list'),
verbose_name='important')
title =... | from django.db import models
class Category(models.Model):
"""A category of resources."""
important = models.BooleanField(
default=False,
help_text=('categories marked important will be shown at the top of ',
'the resource list'),
verbose_name='important')
title ... | <commit_before>from django.db import models
class Category(models.Model):
"""A category of resources."""
important = models.BooleanField(
default=False,
help_text=('categories marked important will be shown at the top of ',
'the resource list'),
verbose_name='importa... |
969b2d322174392a85f6fa6fc92160cb18144594 | bulbs/content/serializers.py | bulbs/content/serializers.py | from django import forms
from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Content, Tag
class TagSerializer(serializers.ModelSerializer):
class Meta:
model = Tag
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
... | from django import forms
from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Content, Tag
class TagSerializer(serializers.ModelSerializer):
class Meta:
model = Tag
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
... | Allow for empty tags and authors on `ContentSerializer` | Allow for empty tags and authors on `ContentSerializer`
| Python | mit | theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs,pombredanne/django-bulbs,pombredanne/django-bulbs,theonion/django-bulbs | from django import forms
from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Content, Tag
class TagSerializer(serializers.ModelSerializer):
class Meta:
model = Tag
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
... | from django import forms
from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Content, Tag
class TagSerializer(serializers.ModelSerializer):
class Meta:
model = Tag
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
... | <commit_before>from django import forms
from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Content, Tag
class TagSerializer(serializers.ModelSerializer):
class Meta:
model = Tag
class UserSerializer(serializers.ModelSerializer):
class Meta:
... | from django import forms
from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Content, Tag
class TagSerializer(serializers.ModelSerializer):
class Meta:
model = Tag
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
... | from django import forms
from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Content, Tag
class TagSerializer(serializers.ModelSerializer):
class Meta:
model = Tag
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
... | <commit_before>from django import forms
from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Content, Tag
class TagSerializer(serializers.ModelSerializer):
class Meta:
model = Tag
class UserSerializer(serializers.ModelSerializer):
class Meta:
... |
a56c744af8c1a96631d990c2a398aedcd24a78de | rtsp2snapshot.py | rtsp2snapshot.py | #!/usr/bin/env python
import io
import platform
import shlex
import subprocess
from flask import Flask, request, send_file, send_from_directory
app = Flask(__name__)
tmp_dir = '/tmp/'
tmp_filename = 'snapshot.jpg'
@app.route('/<path:url>')
def snapshot(url):
freebsd_platform = platform.system() == 'FreeBSD'
... | #!/usr/bin/env python
import io
import platform
import shlex
import subprocess
from flask import Flask, request, send_file, send_from_directory
app = Flask(__name__)
tmp_dir = '/tmp/'
tmp_filename = 'snapshot.jpg'
@app.route('/<path:url>')
def snapshot(url):
freebsd_platform = platform.system() == 'FreeBSD'
... | Set the response's mimetype. Motion cannot process HTTP responses without an image mimetype. | Set the response's mimetype. Motion cannot process HTTP responses without an image mimetype.
| Python | bsd-3-clause | flebel/rtsp2snapshot | #!/usr/bin/env python
import io
import platform
import shlex
import subprocess
from flask import Flask, request, send_file, send_from_directory
app = Flask(__name__)
tmp_dir = '/tmp/'
tmp_filename = 'snapshot.jpg'
@app.route('/<path:url>')
def snapshot(url):
freebsd_platform = platform.system() == 'FreeBSD'
... | #!/usr/bin/env python
import io
import platform
import shlex
import subprocess
from flask import Flask, request, send_file, send_from_directory
app = Flask(__name__)
tmp_dir = '/tmp/'
tmp_filename = 'snapshot.jpg'
@app.route('/<path:url>')
def snapshot(url):
freebsd_platform = platform.system() == 'FreeBSD'
... | <commit_before>#!/usr/bin/env python
import io
import platform
import shlex
import subprocess
from flask import Flask, request, send_file, send_from_directory
app = Flask(__name__)
tmp_dir = '/tmp/'
tmp_filename = 'snapshot.jpg'
@app.route('/<path:url>')
def snapshot(url):
freebsd_platform = platform.system() ... | #!/usr/bin/env python
import io
import platform
import shlex
import subprocess
from flask import Flask, request, send_file, send_from_directory
app = Flask(__name__)
tmp_dir = '/tmp/'
tmp_filename = 'snapshot.jpg'
@app.route('/<path:url>')
def snapshot(url):
freebsd_platform = platform.system() == 'FreeBSD'
... | #!/usr/bin/env python
import io
import platform
import shlex
import subprocess
from flask import Flask, request, send_file, send_from_directory
app = Flask(__name__)
tmp_dir = '/tmp/'
tmp_filename = 'snapshot.jpg'
@app.route('/<path:url>')
def snapshot(url):
freebsd_platform = platform.system() == 'FreeBSD'
... | <commit_before>#!/usr/bin/env python
import io
import platform
import shlex
import subprocess
from flask import Flask, request, send_file, send_from_directory
app = Flask(__name__)
tmp_dir = '/tmp/'
tmp_filename = 'snapshot.jpg'
@app.route('/<path:url>')
def snapshot(url):
freebsd_platform = platform.system() ... |
e0ddd80ea2d23f9b5fc32dd8a5ea13f9cb30da49 | app/packages/__init__.py | app/packages/__init__.py | from flask import Blueprint
packages = Blueprint('packages', __name__)
from . import views, models
from utils import github_data
def post_get_single(result=None, **kw):
result.update(result.pop("get_json"))
result.update(github_data(result['name'], result['author'], result['url']))
# runs for search requ... | from flask import Blueprint
packages = Blueprint('packages', __name__)
from . import views, models
from utils import github_data
def post_get_single(result=None, **kw):
result.update(result.pop("get_json"))
result.update(github_data(result['name'], result['author'], result['url']))
# runs for search requ... | Add api for package search based on name and keywords | Add api for package search based on name and keywords
| Python | bsd-2-clause | NikhilKalige/atom-website,NikhilKalige/atom-website,NikhilKalige/atom-website | from flask import Blueprint
packages = Blueprint('packages', __name__)
from . import views, models
from utils import github_data
def post_get_single(result=None, **kw):
result.update(result.pop("get_json"))
result.update(github_data(result['name'], result['author'], result['url']))
# runs for search requ... | from flask import Blueprint
packages = Blueprint('packages', __name__)
from . import views, models
from utils import github_data
def post_get_single(result=None, **kw):
result.update(result.pop("get_json"))
result.update(github_data(result['name'], result['author'], result['url']))
# runs for search requ... | <commit_before>from flask import Blueprint
packages = Blueprint('packages', __name__)
from . import views, models
from utils import github_data
def post_get_single(result=None, **kw):
result.update(result.pop("get_json"))
result.update(github_data(result['name'], result['author'], result['url']))
# runs ... | from flask import Blueprint
packages = Blueprint('packages', __name__)
from . import views, models
from utils import github_data
def post_get_single(result=None, **kw):
result.update(result.pop("get_json"))
result.update(github_data(result['name'], result['author'], result['url']))
# runs for search requ... | from flask import Blueprint
packages = Blueprint('packages', __name__)
from . import views, models
from utils import github_data
def post_get_single(result=None, **kw):
result.update(result.pop("get_json"))
result.update(github_data(result['name'], result['author'], result['url']))
# runs for search requ... | <commit_before>from flask import Blueprint
packages = Blueprint('packages', __name__)
from . import views, models
from utils import github_data
def post_get_single(result=None, **kw):
result.update(result.pop("get_json"))
result.update(github_data(result['name'], result['author'], result['url']))
# runs ... |
9bfe2dbd37fa18ed7915e82dc8dc8515d7fe9a76 | alfred_collector/__main__.py | alfred_collector/__main__.py | import argparse
import yaml
from .process import CollectorProcess
def get_config(path):
with open(path) as file:
return yaml.load(file)
def main():
parser = argparse.ArgumentParser()
parser.add_argument('config')
args = parser.parse_args()
config = get_config(args.config)
processes... | import argparse
import signal
import yaml
from functools import partial
from .process import CollectorProcess
def get_config(path):
with open(path) as file:
return yaml.load(file)
def terminate_processes(processes, signum, frame):
for process in processes:
if process is not None and process.... | Terminate child processes on SIGTERM signal | Terminate child processes on SIGTERM signal
| Python | isc | alfredhq/alfred-collector | import argparse
import yaml
from .process import CollectorProcess
def get_config(path):
with open(path) as file:
return yaml.load(file)
def main():
parser = argparse.ArgumentParser()
parser.add_argument('config')
args = parser.parse_args()
config = get_config(args.config)
processes... | import argparse
import signal
import yaml
from functools import partial
from .process import CollectorProcess
def get_config(path):
with open(path) as file:
return yaml.load(file)
def terminate_processes(processes, signum, frame):
for process in processes:
if process is not None and process.... | <commit_before>import argparse
import yaml
from .process import CollectorProcess
def get_config(path):
with open(path) as file:
return yaml.load(file)
def main():
parser = argparse.ArgumentParser()
parser.add_argument('config')
args = parser.parse_args()
config = get_config(args.config)... | import argparse
import signal
import yaml
from functools import partial
from .process import CollectorProcess
def get_config(path):
with open(path) as file:
return yaml.load(file)
def terminate_processes(processes, signum, frame):
for process in processes:
if process is not None and process.... | import argparse
import yaml
from .process import CollectorProcess
def get_config(path):
with open(path) as file:
return yaml.load(file)
def main():
parser = argparse.ArgumentParser()
parser.add_argument('config')
args = parser.parse_args()
config = get_config(args.config)
processes... | <commit_before>import argparse
import yaml
from .process import CollectorProcess
def get_config(path):
with open(path) as file:
return yaml.load(file)
def main():
parser = argparse.ArgumentParser()
parser.add_argument('config')
args = parser.parse_args()
config = get_config(args.config)... |
692fe65ca9d24286d10e542c5028924a22036362 | tests/test_models.py | tests/test_models.py | import pytest
import turbasen
@pytest.fixture
def configure_dev():
turbasen.configure(ENDPOINT_URL='http://dev.nasjonalturbase.no/')
@pytest.mark.skipif(turbasen.settings.Settings.API_KEY is None, reason="API key not set")
def test_get(configure_dev):
sted = turbasen.Sted.get('52407fb375049e561500004e')
... | # encoding: utf-8
from __future__ import unicode_literals
import pytest
import turbasen
@pytest.fixture
def configure_dev():
turbasen.configure(ENDPOINT_URL='http://dev.nasjonalturbase.no/')
@pytest.mark.skipif(turbasen.settings.Settings.API_KEY is None, reason="API key not set")
def test_get(configure_dev):
... | Add encoding and unicode literals import | Add encoding and unicode literals import
| Python | mit | Turbasen/turbasen.py | import pytest
import turbasen
@pytest.fixture
def configure_dev():
turbasen.configure(ENDPOINT_URL='http://dev.nasjonalturbase.no/')
@pytest.mark.skipif(turbasen.settings.Settings.API_KEY is None, reason="API key not set")
def test_get(configure_dev):
sted = turbasen.Sted.get('52407fb375049e561500004e')
... | # encoding: utf-8
from __future__ import unicode_literals
import pytest
import turbasen
@pytest.fixture
def configure_dev():
turbasen.configure(ENDPOINT_URL='http://dev.nasjonalturbase.no/')
@pytest.mark.skipif(turbasen.settings.Settings.API_KEY is None, reason="API key not set")
def test_get(configure_dev):
... | <commit_before>import pytest
import turbasen
@pytest.fixture
def configure_dev():
turbasen.configure(ENDPOINT_URL='http://dev.nasjonalturbase.no/')
@pytest.mark.skipif(turbasen.settings.Settings.API_KEY is None, reason="API key not set")
def test_get(configure_dev):
sted = turbasen.Sted.get('52407fb375049e56... | # encoding: utf-8
from __future__ import unicode_literals
import pytest
import turbasen
@pytest.fixture
def configure_dev():
turbasen.configure(ENDPOINT_URL='http://dev.nasjonalturbase.no/')
@pytest.mark.skipif(turbasen.settings.Settings.API_KEY is None, reason="API key not set")
def test_get(configure_dev):
... | import pytest
import turbasen
@pytest.fixture
def configure_dev():
turbasen.configure(ENDPOINT_URL='http://dev.nasjonalturbase.no/')
@pytest.mark.skipif(turbasen.settings.Settings.API_KEY is None, reason="API key not set")
def test_get(configure_dev):
sted = turbasen.Sted.get('52407fb375049e561500004e')
... | <commit_before>import pytest
import turbasen
@pytest.fixture
def configure_dev():
turbasen.configure(ENDPOINT_URL='http://dev.nasjonalturbase.no/')
@pytest.mark.skipif(turbasen.settings.Settings.API_KEY is None, reason="API key not set")
def test_get(configure_dev):
sted = turbasen.Sted.get('52407fb375049e56... |
75080e6f0da4f699ef1eb89310847befeccfab40 | skimage/filter/tests/test_filter_import.py | skimage/filter/tests/test_filter_import.py | from skimage._shared.utils import all_warnings, skimage_deprecation
from numpy.testing import assert_warns
def import_filter():
from skimage import filter as F
assert('sobel' in dir(F))
def test_filter_import():
with all_warnings():
assert_warns(skimage_deprecation, import_filter)
| from numpy.testing import assert_warns
from warnings import catch_warnings, simplefilter
def test_import_filter():
with catch_warnings():
simplefilter('ignore')
from skimage import filter as F
assert('sobel' in dir(F))
| Check for deprecation on import is problematic. Rather just check that filter can be imported normally. | Check for deprecation on import is problematic. Rather just check that filter can be imported normally.
| Python | bsd-3-clause | michaelaye/scikit-image,warmspringwinds/scikit-image,juliusbierk/scikit-image,michaelpacer/scikit-image,ofgulban/scikit-image,vighneshbirodkar/scikit-image,oew1v07/scikit-image,chriscrosscutler/scikit-image,pratapvardhan/scikit-image,robintw/scikit-image,paalge/scikit-image,vighneshbirodkar/scikit-image,youprofit/sciki... | from skimage._shared.utils import all_warnings, skimage_deprecation
from numpy.testing import assert_warns
def import_filter():
from skimage import filter as F
assert('sobel' in dir(F))
def test_filter_import():
with all_warnings():
assert_warns(skimage_deprecation, import_filter)
Check for deprec... | from numpy.testing import assert_warns
from warnings import catch_warnings, simplefilter
def test_import_filter():
with catch_warnings():
simplefilter('ignore')
from skimage import filter as F
assert('sobel' in dir(F))
| <commit_before>from skimage._shared.utils import all_warnings, skimage_deprecation
from numpy.testing import assert_warns
def import_filter():
from skimage import filter as F
assert('sobel' in dir(F))
def test_filter_import():
with all_warnings():
assert_warns(skimage_deprecation, import_filter)
<... | from numpy.testing import assert_warns
from warnings import catch_warnings, simplefilter
def test_import_filter():
with catch_warnings():
simplefilter('ignore')
from skimage import filter as F
assert('sobel' in dir(F))
| from skimage._shared.utils import all_warnings, skimage_deprecation
from numpy.testing import assert_warns
def import_filter():
from skimage import filter as F
assert('sobel' in dir(F))
def test_filter_import():
with all_warnings():
assert_warns(skimage_deprecation, import_filter)
Check for deprec... | <commit_before>from skimage._shared.utils import all_warnings, skimage_deprecation
from numpy.testing import assert_warns
def import_filter():
from skimage import filter as F
assert('sobel' in dir(F))
def test_filter_import():
with all_warnings():
assert_warns(skimage_deprecation, import_filter)
<... |
b8ecb1e86fcbbda0f92314c90fb319c2c50fcf94 | uchicagohvz/production_settings.py | uchicagohvz/production_settings.py | from local_settings import *
settings.DEBUG = False
ALLOWED_HOSTS = ['uchicagohvz.org']
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'uchicagohvz', ... | from local_settings import *
DEBUG = False
ALLOWED_HOSTS = ['uchicagohvz.org']
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'uchicagohvz', # Or path... | Set DEBUG = False in production | Set DEBUG = False in production
| Python | mit | kz26/uchicago-hvz,kz26/uchicago-hvz,kz26/uchicago-hvz | from local_settings import *
settings.DEBUG = False
ALLOWED_HOSTS = ['uchicagohvz.org']
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'uchicagohvz', ... | from local_settings import *
DEBUG = False
ALLOWED_HOSTS = ['uchicagohvz.org']
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'uchicagohvz', # Or path... | <commit_before>from local_settings import *
settings.DEBUG = False
ALLOWED_HOSTS = ['uchicagohvz.org']
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'uchicagohvz', ... | from local_settings import *
DEBUG = False
ALLOWED_HOSTS = ['uchicagohvz.org']
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'uchicagohvz', # Or path... | from local_settings import *
settings.DEBUG = False
ALLOWED_HOSTS = ['uchicagohvz.org']
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'uchicagohvz', ... | <commit_before>from local_settings import *
settings.DEBUG = False
ALLOWED_HOSTS = ['uchicagohvz.org']
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'uchicagohvz', ... |
14a0738ec836bd3369984835797f5002813b270a | nilearn/_utils/__init__.py | nilearn/_utils/__init__.py |
from niimg_conversions import is_a_niimg, _get_shape, _repr_niimgs, \
copy_niimg, check_niimg, concat_niimgs, check_niimgs
from numpy_conversions import as_ndarray
from cache_mixin import CacheMixin
|
from .niimg_conversions import is_a_niimg, _get_shape, _repr_niimgs, \
copy_niimg, check_niimg, concat_niimgs, check_niimgs
from .numpy_conversions import as_ndarray
from .cache_mixin import CacheMixin
| Fix imports to local paths | Fix imports to local paths
| Python | bsd-3-clause | abenicho/isvr |
from niimg_conversions import is_a_niimg, _get_shape, _repr_niimgs, \
copy_niimg, check_niimg, concat_niimgs, check_niimgs
from numpy_conversions import as_ndarray
from cache_mixin import CacheMixin
Fix imports to local paths |
from .niimg_conversions import is_a_niimg, _get_shape, _repr_niimgs, \
copy_niimg, check_niimg, concat_niimgs, check_niimgs
from .numpy_conversions import as_ndarray
from .cache_mixin import CacheMixin
| <commit_before>
from niimg_conversions import is_a_niimg, _get_shape, _repr_niimgs, \
copy_niimg, check_niimg, concat_niimgs, check_niimgs
from numpy_conversions import as_ndarray
from cache_mixin import CacheMixin
<commit_msg>Fix imports to local paths<commit_after> |
from .niimg_conversions import is_a_niimg, _get_shape, _repr_niimgs, \
copy_niimg, check_niimg, concat_niimgs, check_niimgs
from .numpy_conversions import as_ndarray
from .cache_mixin import CacheMixin
|
from niimg_conversions import is_a_niimg, _get_shape, _repr_niimgs, \
copy_niimg, check_niimg, concat_niimgs, check_niimgs
from numpy_conversions import as_ndarray
from cache_mixin import CacheMixin
Fix imports to local paths
from .niimg_conversions import is_a_niimg, _get_shape, _repr_niimgs, \
cop... | <commit_before>
from niimg_conversions import is_a_niimg, _get_shape, _repr_niimgs, \
copy_niimg, check_niimg, concat_niimgs, check_niimgs
from numpy_conversions import as_ndarray
from cache_mixin import CacheMixin
<commit_msg>Fix imports to local paths<commit_after>
from .niimg_conversions import is_a_niimg... |
23a8df19e272bf4a48d59629976fc0cd4a1b83eb | Settings/German_Signal/ModelConfiguration.py | Settings/German_Signal/ModelConfiguration.py | """
Normally, this files contains all necessary code to execute successfully the solution of the problem
but in this case (because this version is not stable) all code is in "TFModel_backup.py" file.
"""
| """
Normally, this files contains all necessary code to execute successfully the solution of the problem
but in this case (because this version is not stable) all code is in "TFModel_backup.py" file.
"""
# TODO Define Code
"""
TFBooster Code to solve problem
"""
setting_object = SettingsObject.Settings(Dictionary.stri... | Add TFBooster Code to Solve "German signal" problem | Add TFBooster Code to Solve "German signal" problem
| Python | apache-2.0 | Gabvaztor/TFBoost | """
Normally, this files contains all necessary code to execute successfully the solution of the problem
but in this case (because this version is not stable) all code is in "TFModel_backup.py" file.
"""
Add TFBooster Code to Solve "German signal" problem | """
Normally, this files contains all necessary code to execute successfully the solution of the problem
but in this case (because this version is not stable) all code is in "TFModel_backup.py" file.
"""
# TODO Define Code
"""
TFBooster Code to solve problem
"""
setting_object = SettingsObject.Settings(Dictionary.stri... | <commit_before>"""
Normally, this files contains all necessary code to execute successfully the solution of the problem
but in this case (because this version is not stable) all code is in "TFModel_backup.py" file.
"""
<commit_msg>Add TFBooster Code to Solve "German signal" problem<commit_after> | """
Normally, this files contains all necessary code to execute successfully the solution of the problem
but in this case (because this version is not stable) all code is in "TFModel_backup.py" file.
"""
# TODO Define Code
"""
TFBooster Code to solve problem
"""
setting_object = SettingsObject.Settings(Dictionary.stri... | """
Normally, this files contains all necessary code to execute successfully the solution of the problem
but in this case (because this version is not stable) all code is in "TFModel_backup.py" file.
"""
Add TFBooster Code to Solve "German signal" problem"""
Normally, this files contains all necessary code to execute ... | <commit_before>"""
Normally, this files contains all necessary code to execute successfully the solution of the problem
but in this case (because this version is not stable) all code is in "TFModel_backup.py" file.
"""
<commit_msg>Add TFBooster Code to Solve "German signal" problem<commit_after>"""
Normally, this file... |
532c201053ae271544270035423f690b4774794a | swimlane/core/fields/usergroup.py | swimlane/core/fields/usergroup.py | from .base import MultiSelectField
from swimlane.core.resources.usergroup import UserGroup
class UserGroupField(MultiSelectField):
"""Manages getting/setting users from record User/Group fields"""
field_type = 'Core.Models.Fields.UserGroupField, Core'
supported_types = [UserGroup]
def cast_to_pytho... | from .base import MultiSelectField
from swimlane.core.resources.usergroup import UserGroup
class UserGroupField(MultiSelectField):
"""Manages getting/setting users from record User/Group fields"""
field_type = 'Core.Models.Fields.UserGroupField, Core'
supported_types = [UserGroup]
def set_swimlane(... | Fix multiselect user/group field when retrieving results from a report | Fix multiselect user/group field when retrieving results from a report
| Python | mit | Swimlane/sw-python-client | from .base import MultiSelectField
from swimlane.core.resources.usergroup import UserGroup
class UserGroupField(MultiSelectField):
"""Manages getting/setting users from record User/Group fields"""
field_type = 'Core.Models.Fields.UserGroupField, Core'
supported_types = [UserGroup]
def cast_to_pytho... | from .base import MultiSelectField
from swimlane.core.resources.usergroup import UserGroup
class UserGroupField(MultiSelectField):
"""Manages getting/setting users from record User/Group fields"""
field_type = 'Core.Models.Fields.UserGroupField, Core'
supported_types = [UserGroup]
def set_swimlane(... | <commit_before>from .base import MultiSelectField
from swimlane.core.resources.usergroup import UserGroup
class UserGroupField(MultiSelectField):
"""Manages getting/setting users from record User/Group fields"""
field_type = 'Core.Models.Fields.UserGroupField, Core'
supported_types = [UserGroup]
de... | from .base import MultiSelectField
from swimlane.core.resources.usergroup import UserGroup
class UserGroupField(MultiSelectField):
"""Manages getting/setting users from record User/Group fields"""
field_type = 'Core.Models.Fields.UserGroupField, Core'
supported_types = [UserGroup]
def set_swimlane(... | from .base import MultiSelectField
from swimlane.core.resources.usergroup import UserGroup
class UserGroupField(MultiSelectField):
"""Manages getting/setting users from record User/Group fields"""
field_type = 'Core.Models.Fields.UserGroupField, Core'
supported_types = [UserGroup]
def cast_to_pytho... | <commit_before>from .base import MultiSelectField
from swimlane.core.resources.usergroup import UserGroup
class UserGroupField(MultiSelectField):
"""Manages getting/setting users from record User/Group fields"""
field_type = 'Core.Models.Fields.UserGroupField, Core'
supported_types = [UserGroup]
de... |
53e8c14d774131503dbdefe6528cd1e26adbf30b | azure_nosetests.py | azure_nosetests.py | #!/usr/bin/env python
import os.path, nose, glob, sys
packages = [os.path.dirname(p) for p in glob.glob('azure*/setup.py')]
sys.path += packages
nose.main() | #!/usr/bin/env python
import os.path, nose, glob, sys, pkg_resources
packages = [os.path.dirname(p) for p in glob.glob('azure*/setup.py')]
sys.path += packages
# Declare it manually, because "azure-storage" is probably installed with pip
pkg_resources.declare_namespace('azure')
nose.main() | Allow Travis to load tests and use azure-storage installed from pip at the same time | Allow Travis to load tests and use azure-storage installed from pip at the same time
| Python | mit | Azure/azure-sdk-for-python,Azure/azure-sdk-for-python,v-iam/azure-sdk-for-python,Azure/azure-sdk-for-python,AutorestCI/azure-sdk-for-python,lmazuel/azure-sdk-for-python,Azure/azure-sdk-for-python,SUSE/azure-sdk-for-python | #!/usr/bin/env python
import os.path, nose, glob, sys
packages = [os.path.dirname(p) for p in glob.glob('azure*/setup.py')]
sys.path += packages
nose.main()Allow Travis to load tests and use azure-storage installed from pip at the same time | #!/usr/bin/env python
import os.path, nose, glob, sys, pkg_resources
packages = [os.path.dirname(p) for p in glob.glob('azure*/setup.py')]
sys.path += packages
# Declare it manually, because "azure-storage" is probably installed with pip
pkg_resources.declare_namespace('azure')
nose.main() | <commit_before>#!/usr/bin/env python
import os.path, nose, glob, sys
packages = [os.path.dirname(p) for p in glob.glob('azure*/setup.py')]
sys.path += packages
nose.main()<commit_msg>Allow Travis to load tests and use azure-storage installed from pip at the same time<commit_after> | #!/usr/bin/env python
import os.path, nose, glob, sys, pkg_resources
packages = [os.path.dirname(p) for p in glob.glob('azure*/setup.py')]
sys.path += packages
# Declare it manually, because "azure-storage" is probably installed with pip
pkg_resources.declare_namespace('azure')
nose.main() | #!/usr/bin/env python
import os.path, nose, glob, sys
packages = [os.path.dirname(p) for p in glob.glob('azure*/setup.py')]
sys.path += packages
nose.main()Allow Travis to load tests and use azure-storage installed from pip at the same time#!/usr/bin/env python
import os.path, nose, glob, sys, pkg_resources
packages... | <commit_before>#!/usr/bin/env python
import os.path, nose, glob, sys
packages = [os.path.dirname(p) for p in glob.glob('azure*/setup.py')]
sys.path += packages
nose.main()<commit_msg>Allow Travis to load tests and use azure-storage installed from pip at the same time<commit_after>#!/usr/bin/env python
import os.path... |
ed9294c7ab0abf574f076464274d83f1e39b53cd | paws/handler.py | paws/handler.py | from .request import Request
from .response import response
class Handler(object):
'''
Simple dispatcher class.
'''
def __init__(self, event, context):
self.request = Request(event, context)
def __call__(self, event, context):
func = getattr(self, self.event['httpMethod'], self.in... | from .request import Request
from .response import response, Response
import logging
log = logging.getLogger()
class Handler(object):
'''
Simple dispatcher class.
'''
def __init__(self, event, context):
self.request = Request(event, context)
def __call__(self, event, context):
fu... | Handle and log exceptions. Render Response objects. | Handle and log exceptions. Render Response objects.
| Python | bsd-3-clause | funkybob/paws | from .request import Request
from .response import response
class Handler(object):
'''
Simple dispatcher class.
'''
def __init__(self, event, context):
self.request = Request(event, context)
def __call__(self, event, context):
func = getattr(self, self.event['httpMethod'], self.in... | from .request import Request
from .response import response, Response
import logging
log = logging.getLogger()
class Handler(object):
'''
Simple dispatcher class.
'''
def __init__(self, event, context):
self.request = Request(event, context)
def __call__(self, event, context):
fu... | <commit_before>from .request import Request
from .response import response
class Handler(object):
'''
Simple dispatcher class.
'''
def __init__(self, event, context):
self.request = Request(event, context)
def __call__(self, event, context):
func = getattr(self, self.event['httpMe... | from .request import Request
from .response import response, Response
import logging
log = logging.getLogger()
class Handler(object):
'''
Simple dispatcher class.
'''
def __init__(self, event, context):
self.request = Request(event, context)
def __call__(self, event, context):
fu... | from .request import Request
from .response import response
class Handler(object):
'''
Simple dispatcher class.
'''
def __init__(self, event, context):
self.request = Request(event, context)
def __call__(self, event, context):
func = getattr(self, self.event['httpMethod'], self.in... | <commit_before>from .request import Request
from .response import response
class Handler(object):
'''
Simple dispatcher class.
'''
def __init__(self, event, context):
self.request = Request(event, context)
def __call__(self, event, context):
func = getattr(self, self.event['httpMe... |
b5afdd604831f985427880537d37eb7a35addaa1 | tests/functional/test_python_option.py | tests/functional/test_python_option.py | import json
import os
from pathlib import Path
from venv import EnvBuilder
from tests.lib import PipTestEnvironment, TestData
def test_python_interpreter(
script: PipTestEnvironment,
tmpdir: Path,
shared_data: TestData,
) -> None:
env_path = os.fsdecode(tmpdir / "venv")
env = EnvBuilder(with_pip=... | import json
import os
from pathlib import Path
from venv import EnvBuilder
from tests.lib import PipTestEnvironment, TestData
def test_python_interpreter(
script: PipTestEnvironment,
tmpdir: Path,
shared_data: TestData,
) -> None:
env_path = os.fspath(tmpdir / "venv")
env = EnvBuilder(with_pip=Fa... | Fix test to cater for packages leaked into venv | Fix test to cater for packages leaked into venv
| Python | mit | pfmoore/pip,pypa/pip,sbidoul/pip,pfmoore/pip,pradyunsg/pip,sbidoul/pip,pypa/pip,pradyunsg/pip | import json
import os
from pathlib import Path
from venv import EnvBuilder
from tests.lib import PipTestEnvironment, TestData
def test_python_interpreter(
script: PipTestEnvironment,
tmpdir: Path,
shared_data: TestData,
) -> None:
env_path = os.fsdecode(tmpdir / "venv")
env = EnvBuilder(with_pip=... | import json
import os
from pathlib import Path
from venv import EnvBuilder
from tests.lib import PipTestEnvironment, TestData
def test_python_interpreter(
script: PipTestEnvironment,
tmpdir: Path,
shared_data: TestData,
) -> None:
env_path = os.fspath(tmpdir / "venv")
env = EnvBuilder(with_pip=Fa... | <commit_before>import json
import os
from pathlib import Path
from venv import EnvBuilder
from tests.lib import PipTestEnvironment, TestData
def test_python_interpreter(
script: PipTestEnvironment,
tmpdir: Path,
shared_data: TestData,
) -> None:
env_path = os.fsdecode(tmpdir / "venv")
env = EnvBu... | import json
import os
from pathlib import Path
from venv import EnvBuilder
from tests.lib import PipTestEnvironment, TestData
def test_python_interpreter(
script: PipTestEnvironment,
tmpdir: Path,
shared_data: TestData,
) -> None:
env_path = os.fspath(tmpdir / "venv")
env = EnvBuilder(with_pip=Fa... | import json
import os
from pathlib import Path
from venv import EnvBuilder
from tests.lib import PipTestEnvironment, TestData
def test_python_interpreter(
script: PipTestEnvironment,
tmpdir: Path,
shared_data: TestData,
) -> None:
env_path = os.fsdecode(tmpdir / "venv")
env = EnvBuilder(with_pip=... | <commit_before>import json
import os
from pathlib import Path
from venv import EnvBuilder
from tests.lib import PipTestEnvironment, TestData
def test_python_interpreter(
script: PipTestEnvironment,
tmpdir: Path,
shared_data: TestData,
) -> None:
env_path = os.fsdecode(tmpdir / "venv")
env = EnvBu... |
4c986e7cedde18530745dca072e06659f1fb20a9 | numpy/compat/__init__.py | numpy/compat/__init__.py | """
Compatibility module.
This module contains duplicated code from Python itself or 3rd party
extensions, which may be included for the following reasons:
* compatibility
* we may only need a small subset of the copied library/module
"""
from . import _inspect
from . import _pep440
from . import py3k
from ._ins... | """
Compatibility module.
This module contains duplicated code from Python itself or 3rd party
extensions, which may be included for the following reasons:
* compatibility
* we may only need a small subset of the copied library/module
"""
from . import _inspect
from . import py3k
from ._inspect import getargspec... | Remove numpy.compat._pep440 from default imports | PERF: Remove numpy.compat._pep440 from default imports
The submoudle numpy.compat._pep440 is removed from the default import of
numpy to reduce the import time. See #22061
| Python | bsd-3-clause | endolith/numpy,numpy/numpy,numpy/numpy,mattip/numpy,endolith/numpy,mattip/numpy,mhvk/numpy,charris/numpy,charris/numpy,mattip/numpy,endolith/numpy,numpy/numpy,mhvk/numpy,mhvk/numpy,mhvk/numpy,charris/numpy,charris/numpy,endolith/numpy,mhvk/numpy,mattip/numpy,numpy/numpy | """
Compatibility module.
This module contains duplicated code from Python itself or 3rd party
extensions, which may be included for the following reasons:
* compatibility
* we may only need a small subset of the copied library/module
"""
from . import _inspect
from . import _pep440
from . import py3k
from ._ins... | """
Compatibility module.
This module contains duplicated code from Python itself or 3rd party
extensions, which may be included for the following reasons:
* compatibility
* we may only need a small subset of the copied library/module
"""
from . import _inspect
from . import py3k
from ._inspect import getargspec... | <commit_before>"""
Compatibility module.
This module contains duplicated code from Python itself or 3rd party
extensions, which may be included for the following reasons:
* compatibility
* we may only need a small subset of the copied library/module
"""
from . import _inspect
from . import _pep440
from . import ... | """
Compatibility module.
This module contains duplicated code from Python itself or 3rd party
extensions, which may be included for the following reasons:
* compatibility
* we may only need a small subset of the copied library/module
"""
from . import _inspect
from . import py3k
from ._inspect import getargspec... | """
Compatibility module.
This module contains duplicated code from Python itself or 3rd party
extensions, which may be included for the following reasons:
* compatibility
* we may only need a small subset of the copied library/module
"""
from . import _inspect
from . import _pep440
from . import py3k
from ._ins... | <commit_before>"""
Compatibility module.
This module contains duplicated code from Python itself or 3rd party
extensions, which may be included for the following reasons:
* compatibility
* we may only need a small subset of the copied library/module
"""
from . import _inspect
from . import _pep440
from . import ... |
0707d920f37edb82d16ccabe1e8413ec16c47c0b | backend/mcapi/mcdir.py | backend/mcapi/mcdir.py | import utils
from os import environ
import os.path
MCDIR = environ.get("MCDIR") or '/mcfs/data'
def for_uid(uidstr):
pieces = uidstr.split('-')
path = os.path.join(MCDIR, pieces[1][0:2], pieces[1][2:4])
utils.mkdirp(path)
return path
| import utils
from os import environ
import os.path
MCDIR = environ.get("MCDIR") or '/mcfs/data/materialscommons'
def for_uid(uidstr):
pieces = uidstr.split('-')
path = os.path.join(MCDIR, pieces[1][0:2], pieces[1][2:4])
utils.mkdirp(path)
return path
| Change directory where data is written to. | Change directory where data is written to.
| Python | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | import utils
from os import environ
import os.path
MCDIR = environ.get("MCDIR") or '/mcfs/data'
def for_uid(uidstr):
pieces = uidstr.split('-')
path = os.path.join(MCDIR, pieces[1][0:2], pieces[1][2:4])
utils.mkdirp(path)
return path
Change directory where data is written to. | import utils
from os import environ
import os.path
MCDIR = environ.get("MCDIR") or '/mcfs/data/materialscommons'
def for_uid(uidstr):
pieces = uidstr.split('-')
path = os.path.join(MCDIR, pieces[1][0:2], pieces[1][2:4])
utils.mkdirp(path)
return path
| <commit_before>import utils
from os import environ
import os.path
MCDIR = environ.get("MCDIR") or '/mcfs/data'
def for_uid(uidstr):
pieces = uidstr.split('-')
path = os.path.join(MCDIR, pieces[1][0:2], pieces[1][2:4])
utils.mkdirp(path)
return path
<commit_msg>Change directory where data is written ... | import utils
from os import environ
import os.path
MCDIR = environ.get("MCDIR") or '/mcfs/data/materialscommons'
def for_uid(uidstr):
pieces = uidstr.split('-')
path = os.path.join(MCDIR, pieces[1][0:2], pieces[1][2:4])
utils.mkdirp(path)
return path
| import utils
from os import environ
import os.path
MCDIR = environ.get("MCDIR") or '/mcfs/data'
def for_uid(uidstr):
pieces = uidstr.split('-')
path = os.path.join(MCDIR, pieces[1][0:2], pieces[1][2:4])
utils.mkdirp(path)
return path
Change directory where data is written to.import utils
from os imp... | <commit_before>import utils
from os import environ
import os.path
MCDIR = environ.get("MCDIR") or '/mcfs/data'
def for_uid(uidstr):
pieces = uidstr.split('-')
path = os.path.join(MCDIR, pieces[1][0:2], pieces[1][2:4])
utils.mkdirp(path)
return path
<commit_msg>Change directory where data is written ... |
f75a151b33635cad5604cb9d7f66fc043c4f972a | saleor/core/utils/json_serializer.py | saleor/core/utils/json_serializer.py | import json
from django.core.serializers.base import DeserializationError
from django.core.serializers.json import (
DjangoJSONEncoder, PythonDeserializer, Serializer as JsonSerializer)
from prices import Money
MONEY_TYPE = 'Money'
class Serializer(JsonSerializer):
def _init_options(self):
super()._... | import json
from django.core.serializers.base import DeserializationError
from django.core.serializers.json import (
DjangoJSONEncoder, PythonDeserializer, Serializer as JsonSerializer)
from prices import Money
MONEY_TYPE = 'Money'
class Serializer(JsonSerializer):
def _init_options(self):
super()._... | Fix except handler raises immediately | Fix except handler raises immediately
| Python | bsd-3-clause | UITools/saleor,mociepka/saleor,UITools/saleor,UITools/saleor,UITools/saleor,maferelo/saleor,maferelo/saleor,mociepka/saleor,maferelo/saleor,mociepka/saleor,UITools/saleor | import json
from django.core.serializers.base import DeserializationError
from django.core.serializers.json import (
DjangoJSONEncoder, PythonDeserializer, Serializer as JsonSerializer)
from prices import Money
MONEY_TYPE = 'Money'
class Serializer(JsonSerializer):
def _init_options(self):
super()._... | import json
from django.core.serializers.base import DeserializationError
from django.core.serializers.json import (
DjangoJSONEncoder, PythonDeserializer, Serializer as JsonSerializer)
from prices import Money
MONEY_TYPE = 'Money'
class Serializer(JsonSerializer):
def _init_options(self):
super()._... | <commit_before>import json
from django.core.serializers.base import DeserializationError
from django.core.serializers.json import (
DjangoJSONEncoder, PythonDeserializer, Serializer as JsonSerializer)
from prices import Money
MONEY_TYPE = 'Money'
class Serializer(JsonSerializer):
def _init_options(self):
... | import json
from django.core.serializers.base import DeserializationError
from django.core.serializers.json import (
DjangoJSONEncoder, PythonDeserializer, Serializer as JsonSerializer)
from prices import Money
MONEY_TYPE = 'Money'
class Serializer(JsonSerializer):
def _init_options(self):
super()._... | import json
from django.core.serializers.base import DeserializationError
from django.core.serializers.json import (
DjangoJSONEncoder, PythonDeserializer, Serializer as JsonSerializer)
from prices import Money
MONEY_TYPE = 'Money'
class Serializer(JsonSerializer):
def _init_options(self):
super()._... | <commit_before>import json
from django.core.serializers.base import DeserializationError
from django.core.serializers.json import (
DjangoJSONEncoder, PythonDeserializer, Serializer as JsonSerializer)
from prices import Money
MONEY_TYPE = 'Money'
class Serializer(JsonSerializer):
def _init_options(self):
... |
fb5c6d5288b6d69d16f917976ae068e9c52a6c7d | Lib/email/Iterators.py | Lib/email/Iterators.py | # Copyright (C) 2001,2002 Python Software Foundation
# Author: barry@zope.com (Barry Warsaw)
"""Various types of useful iterators and generators.
"""
import sys
try:
from email._compat22 import body_line_iterator, typed_subpart_iterator
except SyntaxError:
# Python 2.1 doesn't have generators
from email.... | # Copyright (C) 2001-2004 Python Software Foundation
# Author: Barry Warsaw <barry@python.org>
"""Various types of useful iterators and generators.
"""
import sys
from cStringIO import StringIO
# This function will become a method of the Message class
def walk(self):
"""Walk over the message tree, yielding ea... | Update to Python 2.3, getting rid of backward compatiblity crud. We don't need the _compat21 or _compat22 modules either. | Update to Python 2.3, getting rid of backward compatiblity crud. We don't
need the _compat21 or _compat22 modules either.
| Python | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | # Copyright (C) 2001,2002 Python Software Foundation
# Author: barry@zope.com (Barry Warsaw)
"""Various types of useful iterators and generators.
"""
import sys
try:
from email._compat22 import body_line_iterator, typed_subpart_iterator
except SyntaxError:
# Python 2.1 doesn't have generators
from email.... | # Copyright (C) 2001-2004 Python Software Foundation
# Author: Barry Warsaw <barry@python.org>
"""Various types of useful iterators and generators.
"""
import sys
from cStringIO import StringIO
# This function will become a method of the Message class
def walk(self):
"""Walk over the message tree, yielding ea... | <commit_before># Copyright (C) 2001,2002 Python Software Foundation
# Author: barry@zope.com (Barry Warsaw)
"""Various types of useful iterators and generators.
"""
import sys
try:
from email._compat22 import body_line_iterator, typed_subpart_iterator
except SyntaxError:
# Python 2.1 doesn't have generators
... | # Copyright (C) 2001-2004 Python Software Foundation
# Author: Barry Warsaw <barry@python.org>
"""Various types of useful iterators and generators.
"""
import sys
from cStringIO import StringIO
# This function will become a method of the Message class
def walk(self):
"""Walk over the message tree, yielding ea... | # Copyright (C) 2001,2002 Python Software Foundation
# Author: barry@zope.com (Barry Warsaw)
"""Various types of useful iterators and generators.
"""
import sys
try:
from email._compat22 import body_line_iterator, typed_subpart_iterator
except SyntaxError:
# Python 2.1 doesn't have generators
from email.... | <commit_before># Copyright (C) 2001,2002 Python Software Foundation
# Author: barry@zope.com (Barry Warsaw)
"""Various types of useful iterators and generators.
"""
import sys
try:
from email._compat22 import body_line_iterator, typed_subpart_iterator
except SyntaxError:
# Python 2.1 doesn't have generators
... |
f3fcddaf7aa4e081322db6779ce2ad6d7e0db10a | pytac/device.py | pytac/device.py | """The device class used to represent a particular function of an accelerator
element.
A physical element in an accelerator may have multiple devices: an example at
DLS is a sextupole magnet that contains also horizontal and vertical corrector
magnets and a skew quadrupole.
"""
class Device(object):
"""A represe... | """The device class used to represent a particular function of an accelerator
element.
A physical element in an accelerator may have multiple devices: an example at
DLS is a sextupole magnet that contains also horizontal and vertical corrector
magnets and a skew quadrupole.
"""
class Device(object):
"""A represe... | Add a code for a BasicDevice class. | Add a code for a BasicDevice class.
| Python | apache-2.0 | willrogers/pytac,willrogers/pytac | """The device class used to represent a particular function of an accelerator
element.
A physical element in an accelerator may have multiple devices: an example at
DLS is a sextupole magnet that contains also horizontal and vertical corrector
magnets and a skew quadrupole.
"""
class Device(object):
"""A represe... | """The device class used to represent a particular function of an accelerator
element.
A physical element in an accelerator may have multiple devices: an example at
DLS is a sextupole magnet that contains also horizontal and vertical corrector
magnets and a skew quadrupole.
"""
class Device(object):
"""A represe... | <commit_before>"""The device class used to represent a particular function of an accelerator
element.
A physical element in an accelerator may have multiple devices: an example at
DLS is a sextupole magnet that contains also horizontal and vertical corrector
magnets and a skew quadrupole.
"""
class Device(object):
... | """The device class used to represent a particular function of an accelerator
element.
A physical element in an accelerator may have multiple devices: an example at
DLS is a sextupole magnet that contains also horizontal and vertical corrector
magnets and a skew quadrupole.
"""
class Device(object):
"""A represe... | """The device class used to represent a particular function of an accelerator
element.
A physical element in an accelerator may have multiple devices: an example at
DLS is a sextupole magnet that contains also horizontal and vertical corrector
magnets and a skew quadrupole.
"""
class Device(object):
"""A represe... | <commit_before>"""The device class used to represent a particular function of an accelerator
element.
A physical element in an accelerator may have multiple devices: an example at
DLS is a sextupole magnet that contains also horizontal and vertical corrector
magnets and a skew quadrupole.
"""
class Device(object):
... |
c3a689a1c1825058ddf7560dcbf3e8785b87b003 | fdp/fdp.py | fdp/fdp.py | import connexion
from fdp import config
def create_app(host, port, graph_endpoint=None):
config.init_fairgraph(host, port, graph_endpoint)
app = connexion.FlaskApp(__name__, specification_dir='openapi/', debug=True)
options = {"swagger_ui": True}
app.add_api('openapi.yaml',
options=options... | import connexion
from fdp import config
def create_app(host, port, graph_endpoint=None):
config.init_fairgraph(host, port, graph_endpoint)
app = connexion.FlaskApp(__name__, specification_dir='openapi/', debug=True, options={"swagger_url": ""})
options = {"swagger_ui": True}
app.add_api('openapi.yaml'... | Update the swagger API deployment to use the base URL instead of /ui to access the Swagger UI (it is less confusing than needing to know you need to go to /ui) | Update the swagger API deployment to use the base URL instead of /ui to access the Swagger UI (it is less confusing than needing to know you need to go to /ui)
| Python | apache-2.0 | NLeSC/ODEX-FAIRDataPoint,NLeSC/ODEX-FAIRDataPoint,NLeSC/ODEX-FAIRDataPoint,NLeSC/ODEX-FAIRDataPoint | import connexion
from fdp import config
def create_app(host, port, graph_endpoint=None):
config.init_fairgraph(host, port, graph_endpoint)
app = connexion.FlaskApp(__name__, specification_dir='openapi/', debug=True)
options = {"swagger_ui": True}
app.add_api('openapi.yaml',
options=options... | import connexion
from fdp import config
def create_app(host, port, graph_endpoint=None):
config.init_fairgraph(host, port, graph_endpoint)
app = connexion.FlaskApp(__name__, specification_dir='openapi/', debug=True, options={"swagger_url": ""})
options = {"swagger_ui": True}
app.add_api('openapi.yaml'... | <commit_before>import connexion
from fdp import config
def create_app(host, port, graph_endpoint=None):
config.init_fairgraph(host, port, graph_endpoint)
app = connexion.FlaskApp(__name__, specification_dir='openapi/', debug=True)
options = {"swagger_ui": True}
app.add_api('openapi.yaml',
... | import connexion
from fdp import config
def create_app(host, port, graph_endpoint=None):
config.init_fairgraph(host, port, graph_endpoint)
app = connexion.FlaskApp(__name__, specification_dir='openapi/', debug=True, options={"swagger_url": ""})
options = {"swagger_ui": True}
app.add_api('openapi.yaml'... | import connexion
from fdp import config
def create_app(host, port, graph_endpoint=None):
config.init_fairgraph(host, port, graph_endpoint)
app = connexion.FlaskApp(__name__, specification_dir='openapi/', debug=True)
options = {"swagger_ui": True}
app.add_api('openapi.yaml',
options=options... | <commit_before>import connexion
from fdp import config
def create_app(host, port, graph_endpoint=None):
config.init_fairgraph(host, port, graph_endpoint)
app = connexion.FlaskApp(__name__, specification_dir='openapi/', debug=True)
options = {"swagger_ui": True}
app.add_api('openapi.yaml',
... |
8dbe3e9e418c120d59bb95aa6ff8fb3ab382aac2 | billjobs/tests/tests_export_account_email.py | billjobs/tests/tests_export_account_email.py | from django.test import TestCase
from django.contrib.admin.sites import AdminSite
from billjobs.admin import UserAdmin
class EmailExportTestCase(TestCase):
""" Tests for email account export """
def test_method_is_avaible(self):
""" Test admin can select the action in dropdown list """
self.as... | from django.test import TestCase
from django.contrib.admin.sites import AdminSite
from billjobs.admin import UserAdmin
class EmailExportTestCase(TestCase):
""" Tests for email account export """
def test_method_is_avaible(self):
""" Test admin can select the action in dropdown list """
self.as... | Test export_email has a short description | Test export_email has a short description
| Python | mit | ioO/billjobs | from django.test import TestCase
from django.contrib.admin.sites import AdminSite
from billjobs.admin import UserAdmin
class EmailExportTestCase(TestCase):
""" Tests for email account export """
def test_method_is_avaible(self):
""" Test admin can select the action in dropdown list """
self.as... | from django.test import TestCase
from django.contrib.admin.sites import AdminSite
from billjobs.admin import UserAdmin
class EmailExportTestCase(TestCase):
""" Tests for email account export """
def test_method_is_avaible(self):
""" Test admin can select the action in dropdown list """
self.as... | <commit_before>from django.test import TestCase
from django.contrib.admin.sites import AdminSite
from billjobs.admin import UserAdmin
class EmailExportTestCase(TestCase):
""" Tests for email account export """
def test_method_is_avaible(self):
""" Test admin can select the action in dropdown list """
... | from django.test import TestCase
from django.contrib.admin.sites import AdminSite
from billjobs.admin import UserAdmin
class EmailExportTestCase(TestCase):
""" Tests for email account export """
def test_method_is_avaible(self):
""" Test admin can select the action in dropdown list """
self.as... | from django.test import TestCase
from django.contrib.admin.sites import AdminSite
from billjobs.admin import UserAdmin
class EmailExportTestCase(TestCase):
""" Tests for email account export """
def test_method_is_avaible(self):
""" Test admin can select the action in dropdown list """
self.as... | <commit_before>from django.test import TestCase
from django.contrib.admin.sites import AdminSite
from billjobs.admin import UserAdmin
class EmailExportTestCase(TestCase):
""" Tests for email account export """
def test_method_is_avaible(self):
""" Test admin can select the action in dropdown list """
... |
3e71356de442e47bcb96ea311295bb447fd23341 | bin/ogcserver-local.py | bin/ogcserver-local.py | #!/usr/bin/env python
import os
import sys
import socket
from os import path
from pkg_resources import *
if not len(sys.argv) > 1:
sys.exit('Usage: %s <map.xml>' % os.path.basename(sys.argv[0]))
sys.path.insert(0,os.path.abspath('.'))
from ogcserver.wsgi import WSGIApp
import ogcserver
default_conf = resource_... | #!/usr/bin/env python
import os
import sys
import socket
from os import path
from pkg_resources import *
import argparse
parser = argparse.ArgumentParser(description='Runs the ogcserver as WMS server')
parser.add_argument('mapfile', type=str, help='''
A XML mapnik stylesheet
''')
args = parser.parse_args()
sys.pat... | Use ArgumentParser to read paramaters | Use ArgumentParser to read paramaters
| Python | bsd-3-clause | mapnik/OGCServer,pbabik/OGCServer,pbabik/OGCServer | #!/usr/bin/env python
import os
import sys
import socket
from os import path
from pkg_resources import *
if not len(sys.argv) > 1:
sys.exit('Usage: %s <map.xml>' % os.path.basename(sys.argv[0]))
sys.path.insert(0,os.path.abspath('.'))
from ogcserver.wsgi import WSGIApp
import ogcserver
default_conf = resource_... | #!/usr/bin/env python
import os
import sys
import socket
from os import path
from pkg_resources import *
import argparse
parser = argparse.ArgumentParser(description='Runs the ogcserver as WMS server')
parser.add_argument('mapfile', type=str, help='''
A XML mapnik stylesheet
''')
args = parser.parse_args()
sys.pat... | <commit_before>#!/usr/bin/env python
import os
import sys
import socket
from os import path
from pkg_resources import *
if not len(sys.argv) > 1:
sys.exit('Usage: %s <map.xml>' % os.path.basename(sys.argv[0]))
sys.path.insert(0,os.path.abspath('.'))
from ogcserver.wsgi import WSGIApp
import ogcserver
default_c... | #!/usr/bin/env python
import os
import sys
import socket
from os import path
from pkg_resources import *
import argparse
parser = argparse.ArgumentParser(description='Runs the ogcserver as WMS server')
parser.add_argument('mapfile', type=str, help='''
A XML mapnik stylesheet
''')
args = parser.parse_args()
sys.pat... | #!/usr/bin/env python
import os
import sys
import socket
from os import path
from pkg_resources import *
if not len(sys.argv) > 1:
sys.exit('Usage: %s <map.xml>' % os.path.basename(sys.argv[0]))
sys.path.insert(0,os.path.abspath('.'))
from ogcserver.wsgi import WSGIApp
import ogcserver
default_conf = resource_... | <commit_before>#!/usr/bin/env python
import os
import sys
import socket
from os import path
from pkg_resources import *
if not len(sys.argv) > 1:
sys.exit('Usage: %s <map.xml>' % os.path.basename(sys.argv[0]))
sys.path.insert(0,os.path.abspath('.'))
from ogcserver.wsgi import WSGIApp
import ogcserver
default_c... |
b855dbde90bfd5842ad292f5f424957df02c2fe0 | myflaskapp/myflaskapp/item/models.py | myflaskapp/myflaskapp/item/models.py | """User models."""
import datetime as dt
from flask_login import UserMixin
from myflaskapp.database import Column, Model, SurrogatePK, db, reference_col, relationship
from myflaskapp.extensions import bcrypt
class Item(SurrogatePK, Model):
__tablename__ = 'items'
pass
| """User models."""
import datetime as dt
from flask_login import UserMixin
from myflaskapp.database import Column, Model, SurrogatePK, db, reference_col, relationship
from myflaskapp.extensions import bcrypt
class Item(SurrogatePK, Model):
__tablename__ = 'items'
text = Column(db.String(80),nullable=True)
| Add text field to Item model | Add text field to Item model
| Python | mit | terryjbates/test-driven-development-with-python,terryjbates/test-driven-development-with-python,terryjbates/test-driven-development-with-python,terryjbates/test-driven-development-with-python,terryjbates/test-driven-development-with-python | """User models."""
import datetime as dt
from flask_login import UserMixin
from myflaskapp.database import Column, Model, SurrogatePK, db, reference_col, relationship
from myflaskapp.extensions import bcrypt
class Item(SurrogatePK, Model):
__tablename__ = 'items'
pass
Add text field to Item model | """User models."""
import datetime as dt
from flask_login import UserMixin
from myflaskapp.database import Column, Model, SurrogatePK, db, reference_col, relationship
from myflaskapp.extensions import bcrypt
class Item(SurrogatePK, Model):
__tablename__ = 'items'
text = Column(db.String(80),nullable=True)
| <commit_before>"""User models."""
import datetime as dt
from flask_login import UserMixin
from myflaskapp.database import Column, Model, SurrogatePK, db, reference_col, relationship
from myflaskapp.extensions import bcrypt
class Item(SurrogatePK, Model):
__tablename__ = 'items'
pass
<commit_msg>Add text fiel... | """User models."""
import datetime as dt
from flask_login import UserMixin
from myflaskapp.database import Column, Model, SurrogatePK, db, reference_col, relationship
from myflaskapp.extensions import bcrypt
class Item(SurrogatePK, Model):
__tablename__ = 'items'
text = Column(db.String(80),nullable=True)
| """User models."""
import datetime as dt
from flask_login import UserMixin
from myflaskapp.database import Column, Model, SurrogatePK, db, reference_col, relationship
from myflaskapp.extensions import bcrypt
class Item(SurrogatePK, Model):
__tablename__ = 'items'
pass
Add text field to Item model"""User mode... | <commit_before>"""User models."""
import datetime as dt
from flask_login import UserMixin
from myflaskapp.database import Column, Model, SurrogatePK, db, reference_col, relationship
from myflaskapp.extensions import bcrypt
class Item(SurrogatePK, Model):
__tablename__ = 'items'
pass
<commit_msg>Add text fiel... |
cb22f18186262bffbfa78b47f1d6e7c2a060d5ff | gearhorn/cmd.py | gearhorn/cmd.py | # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Add port specification to gearhorn CLI | Add port specification to gearhorn CLI
| Python | apache-2.0 | SpamapS/gearhorn | # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | <commit_before># Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | <commit_before># Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
3020817d9edaa8b95c52ecd03f2c10e06f4fc5e7 | hermes/feeds.py | hermes/feeds.py | from django.contrib.syndication.views import Feed
from .models import Post
from .settings import (
SYNDICATION_FEED_TITLE, SYNDICATION_FEED_LINK,
SYNDICATION_FEED_DESCRIPTION, SYNDICATION_FEED_TYPE
)
class LatestPostFeed(Feed):
title = SYNDICATION_FEED_TITLE
link = SYNDICATION_FEED_LINK
descripti... | from django.contrib.syndication.views import Feed
from .models import Post
from .settings import (
SYNDICATION_FEED_TITLE, SYNDICATION_FEED_LINK,
SYNDICATION_FEED_DESCRIPTION, SYNDICATION_FEED_TYPE
)
class LatestPostFeed(Feed):
title = SYNDICATION_FEED_TITLE
link = SYNDICATION_FEED_LINK
descripti... | Add full body text to RSS | Add full body text to RSS | Python | mit | DemocracyClub/django-hermes,DemocracyClub/django-hermes | from django.contrib.syndication.views import Feed
from .models import Post
from .settings import (
SYNDICATION_FEED_TITLE, SYNDICATION_FEED_LINK,
SYNDICATION_FEED_DESCRIPTION, SYNDICATION_FEED_TYPE
)
class LatestPostFeed(Feed):
title = SYNDICATION_FEED_TITLE
link = SYNDICATION_FEED_LINK
descripti... | from django.contrib.syndication.views import Feed
from .models import Post
from .settings import (
SYNDICATION_FEED_TITLE, SYNDICATION_FEED_LINK,
SYNDICATION_FEED_DESCRIPTION, SYNDICATION_FEED_TYPE
)
class LatestPostFeed(Feed):
title = SYNDICATION_FEED_TITLE
link = SYNDICATION_FEED_LINK
descripti... | <commit_before>from django.contrib.syndication.views import Feed
from .models import Post
from .settings import (
SYNDICATION_FEED_TITLE, SYNDICATION_FEED_LINK,
SYNDICATION_FEED_DESCRIPTION, SYNDICATION_FEED_TYPE
)
class LatestPostFeed(Feed):
title = SYNDICATION_FEED_TITLE
link = SYNDICATION_FEED_LIN... | from django.contrib.syndication.views import Feed
from .models import Post
from .settings import (
SYNDICATION_FEED_TITLE, SYNDICATION_FEED_LINK,
SYNDICATION_FEED_DESCRIPTION, SYNDICATION_FEED_TYPE
)
class LatestPostFeed(Feed):
title = SYNDICATION_FEED_TITLE
link = SYNDICATION_FEED_LINK
descripti... | from django.contrib.syndication.views import Feed
from .models import Post
from .settings import (
SYNDICATION_FEED_TITLE, SYNDICATION_FEED_LINK,
SYNDICATION_FEED_DESCRIPTION, SYNDICATION_FEED_TYPE
)
class LatestPostFeed(Feed):
title = SYNDICATION_FEED_TITLE
link = SYNDICATION_FEED_LINK
descripti... | <commit_before>from django.contrib.syndication.views import Feed
from .models import Post
from .settings import (
SYNDICATION_FEED_TITLE, SYNDICATION_FEED_LINK,
SYNDICATION_FEED_DESCRIPTION, SYNDICATION_FEED_TYPE
)
class LatestPostFeed(Feed):
title = SYNDICATION_FEED_TITLE
link = SYNDICATION_FEED_LIN... |
6a68ef52ab9e762860087f701eee15e11786ca71 | k3d/__init__.py | k3d/__init__.py | from ipywidgets import DOMWidget
from IPython.display import display
from traitlets import Unicode, Bytes, Dict
from .objects import Objects
from .factory import Factory
import base64, json, zlib
class K3D(DOMWidget, Factory):
_view_module = Unicode('nbextensions/k3d_widget/view', sync=True)
_view_name = Unic... | from ipywidgets import DOMWidget
from IPython.display import display
from traitlets import Unicode, Bytes, Dict
from .objects import Objects
from .factory import Factory
import base64, json, zlib
class K3D(DOMWidget, Factory):
_view_module = Unicode('nbextensions/k3d_widget/view', sync=True)
_view_name = Unic... | Fix calling "display" method multiple times | Fix calling "display" method multiple times
| Python | mit | K3D-tools/K3D-jupyter,K3D-tools/K3D-jupyter,K3D-tools/K3D-jupyter,K3D-tools/K3D-jupyter | from ipywidgets import DOMWidget
from IPython.display import display
from traitlets import Unicode, Bytes, Dict
from .objects import Objects
from .factory import Factory
import base64, json, zlib
class K3D(DOMWidget, Factory):
_view_module = Unicode('nbextensions/k3d_widget/view', sync=True)
_view_name = Unic... | from ipywidgets import DOMWidget
from IPython.display import display
from traitlets import Unicode, Bytes, Dict
from .objects import Objects
from .factory import Factory
import base64, json, zlib
class K3D(DOMWidget, Factory):
_view_module = Unicode('nbextensions/k3d_widget/view', sync=True)
_view_name = Unic... | <commit_before>from ipywidgets import DOMWidget
from IPython.display import display
from traitlets import Unicode, Bytes, Dict
from .objects import Objects
from .factory import Factory
import base64, json, zlib
class K3D(DOMWidget, Factory):
_view_module = Unicode('nbextensions/k3d_widget/view', sync=True)
_v... | from ipywidgets import DOMWidget
from IPython.display import display
from traitlets import Unicode, Bytes, Dict
from .objects import Objects
from .factory import Factory
import base64, json, zlib
class K3D(DOMWidget, Factory):
_view_module = Unicode('nbextensions/k3d_widget/view', sync=True)
_view_name = Unic... | from ipywidgets import DOMWidget
from IPython.display import display
from traitlets import Unicode, Bytes, Dict
from .objects import Objects
from .factory import Factory
import base64, json, zlib
class K3D(DOMWidget, Factory):
_view_module = Unicode('nbextensions/k3d_widget/view', sync=True)
_view_name = Unic... | <commit_before>from ipywidgets import DOMWidget
from IPython.display import display
from traitlets import Unicode, Bytes, Dict
from .objects import Objects
from .factory import Factory
import base64, json, zlib
class K3D(DOMWidget, Factory):
_view_module = Unicode('nbextensions/k3d_widget/view', sync=True)
_v... |
bc2d57bb36373eded3ae1cd82cd4b91bd5649b57 | kyokai/route.py | kyokai/route.py | """
Module for Kyokai routes.
"""
import re
class Route(object):
"""
A route is simply a wrapped coroutine object for a request.
It takes in a regular expression as a matcher, for the path, and a list of accepted methods.
"""
def __init__(self, matcher: str, methods: list):
"""
C... | """
Module for Kyokai routes.
"""
import re
from kyokai.exc import HTTPClientException, HTTPException
class Route(object):
"""
A route is simply a wrapped coroutine object for a request.
It takes in a regular expression as a matcher, for the path, and a list of accepted methods.
"""
def __init_... | Make invoke() actually invoke the coroutine. | Make invoke() actually invoke the coroutine.
| Python | mit | SunDwarf/Kyoukai | """
Module for Kyokai routes.
"""
import re
class Route(object):
"""
A route is simply a wrapped coroutine object for a request.
It takes in a regular expression as a matcher, for the path, and a list of accepted methods.
"""
def __init__(self, matcher: str, methods: list):
"""
C... | """
Module for Kyokai routes.
"""
import re
from kyokai.exc import HTTPClientException, HTTPException
class Route(object):
"""
A route is simply a wrapped coroutine object for a request.
It takes in a regular expression as a matcher, for the path, and a list of accepted methods.
"""
def __init_... | <commit_before>"""
Module for Kyokai routes.
"""
import re
class Route(object):
"""
A route is simply a wrapped coroutine object for a request.
It takes in a regular expression as a matcher, for the path, and a list of accepted methods.
"""
def __init__(self, matcher: str, methods: list):
... | """
Module for Kyokai routes.
"""
import re
from kyokai.exc import HTTPClientException, HTTPException
class Route(object):
"""
A route is simply a wrapped coroutine object for a request.
It takes in a regular expression as a matcher, for the path, and a list of accepted methods.
"""
def __init_... | """
Module for Kyokai routes.
"""
import re
class Route(object):
"""
A route is simply a wrapped coroutine object for a request.
It takes in a regular expression as a matcher, for the path, and a list of accepted methods.
"""
def __init__(self, matcher: str, methods: list):
"""
C... | <commit_before>"""
Module for Kyokai routes.
"""
import re
class Route(object):
"""
A route is simply a wrapped coroutine object for a request.
It takes in a regular expression as a matcher, for the path, and a list of accepted methods.
"""
def __init__(self, matcher: str, methods: list):
... |
40db9d64d616d99ec2464aff6fe5960943584ac3 | rnacentral/apiv1/urls.py | rnacentral/apiv1/urls.py | """
Copyright [2009-2014] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | """
Copyright [2009-2014] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | Add a stable url for the current API version | Add a stable url for the current API version
| Python | apache-2.0 | RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode | """
Copyright [2009-2014] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | """
Copyright [2009-2014] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | <commit_before>"""
Copyright [2009-2014] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by appl... | """
Copyright [2009-2014] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | """
Copyright [2009-2014] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | <commit_before>"""
Copyright [2009-2014] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by appl... |
a5898f8e5b2b25af472f1e2e5ce02626b86db5f2 | tunneler/tests/test_models.py | tunneler/tests/test_models.py | from unittest import TestCase
from ..models import Tunnel
| from unittest import TestCase
from ..models import Tunnel
class TestModels(TestCase):
def test_defaults(self):
tunnel = Tunnel()
self.assertEquals(tunnel.name, 'unnamed')
self.assertEquals(tunnel.process, None)
self.assertEqual(tunnel.local_port, 0)
self.assertEqual(tunnel... | Add a basic test for models. | Add a basic test for models.
| Python | isc | xoliver/tunneler,xoliver/tunneler | from unittest import TestCase
from ..models import Tunnel
Add a basic test for models. | from unittest import TestCase
from ..models import Tunnel
class TestModels(TestCase):
def test_defaults(self):
tunnel = Tunnel()
self.assertEquals(tunnel.name, 'unnamed')
self.assertEquals(tunnel.process, None)
self.assertEqual(tunnel.local_port, 0)
self.assertEqual(tunnel... | <commit_before>from unittest import TestCase
from ..models import Tunnel
<commit_msg>Add a basic test for models.<commit_after> | from unittest import TestCase
from ..models import Tunnel
class TestModels(TestCase):
def test_defaults(self):
tunnel = Tunnel()
self.assertEquals(tunnel.name, 'unnamed')
self.assertEquals(tunnel.process, None)
self.assertEqual(tunnel.local_port, 0)
self.assertEqual(tunnel... | from unittest import TestCase
from ..models import Tunnel
Add a basic test for models.from unittest import TestCase
from ..models import Tunnel
class TestModels(TestCase):
def test_defaults(self):
tunnel = Tunnel()
self.assertEquals(tunnel.name, 'unnamed')
self.assertEquals(tunnel.proces... | <commit_before>from unittest import TestCase
from ..models import Tunnel
<commit_msg>Add a basic test for models.<commit_after>from unittest import TestCase
from ..models import Tunnel
class TestModels(TestCase):
def test_defaults(self):
tunnel = Tunnel()
self.assertEquals(tunnel.name, 'unnamed'... |
48bd50609fffb18dbab821522810ec587751434c | arguments.py | arguments.py | import argparse
from settings import HONEYPORT
"""
Here we define command line arguments.
`port` stands for port, to listen on.
`-v` to increase verbose of the server
"""
def parse():
parser = argparse.ArgumentParser(
description='Serve some sweet honey to the ubiquitous bots!',
epilog='And that... | import argparse
from settings import HONEYPORT
"""
Here we define command line arguments.
`port` stands for port, to listen on.
`-v` to increase verbose of the server
"""
def parse():
parser = argparse.ArgumentParser(
description='Serve some sweet honey to the ubiquitous bots!',
epilog='And that... | Add option to enable self updating | Add option to enable self updating
This is a customization option for more flexibility.
If you want to autoupdate, then you can give a -u option.
If not - don't.
| Python | mit | Zloool/manyfaced-honeypot | import argparse
from settings import HONEYPORT
"""
Here we define command line arguments.
`port` stands for port, to listen on.
`-v` to increase verbose of the server
"""
def parse():
parser = argparse.ArgumentParser(
description='Serve some sweet honey to the ubiquitous bots!',
epilog='And that... | import argparse
from settings import HONEYPORT
"""
Here we define command line arguments.
`port` stands for port, to listen on.
`-v` to increase verbose of the server
"""
def parse():
parser = argparse.ArgumentParser(
description='Serve some sweet honey to the ubiquitous bots!',
epilog='And that... | <commit_before>import argparse
from settings import HONEYPORT
"""
Here we define command line arguments.
`port` stands for port, to listen on.
`-v` to increase verbose of the server
"""
def parse():
parser = argparse.ArgumentParser(
description='Serve some sweet honey to the ubiquitous bots!',
e... | import argparse
from settings import HONEYPORT
"""
Here we define command line arguments.
`port` stands for port, to listen on.
`-v` to increase verbose of the server
"""
def parse():
parser = argparse.ArgumentParser(
description='Serve some sweet honey to the ubiquitous bots!',
epilog='And that... | import argparse
from settings import HONEYPORT
"""
Here we define command line arguments.
`port` stands for port, to listen on.
`-v` to increase verbose of the server
"""
def parse():
parser = argparse.ArgumentParser(
description='Serve some sweet honey to the ubiquitous bots!',
epilog='And that... | <commit_before>import argparse
from settings import HONEYPORT
"""
Here we define command line arguments.
`port` stands for port, to listen on.
`-v` to increase verbose of the server
"""
def parse():
parser = argparse.ArgumentParser(
description='Serve some sweet honey to the ubiquitous bots!',
e... |
db8b5bb3b596609e06adf51ed7d72b97fc786ad5 | python/nagcat/__init__.py | python/nagcat/__init__.py | # Copyright 2008-2009 ITA Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | # Copyright 2008-2009 ITA Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | Fix my coil version check | Fix my coil version check
| Python | apache-2.0 | marineam/nagcat,marineam/nagcat,marineam/nagcat | # Copyright 2008-2009 ITA Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | # Copyright 2008-2009 ITA Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | <commit_before># Copyright 2008-2009 ITA Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | # Copyright 2008-2009 ITA Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | # Copyright 2008-2009 ITA Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | <commit_before># Copyright 2008-2009 ITA Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
9f8f929b8fdc0ebfdb609621f4613d31b73639b0 | sipa/utils/link_patch.py | sipa/utils/link_patch.py | import re
from flask import request
from markdown import Markdown
from markdown.extensions import Extension
from markdown.postprocessors import Postprocessor
def absolute_path_replacer(match):
"""Correct the url in a regex match prepending the absolute path"""
assert len(match.groups()) == 2
prefix = re... | import re
from flask import request
from markdown import Markdown
from markdown.extensions import Extension
from markdown.postprocessors import Postprocessor
def absolute_path_replacer(match):
"""Correct the url in a regex match prepending the absolute path"""
assert len(match.groups()) == 2
prefix = re... | Fix priority of link postprocessor | Fix priority of link postprocessor
Fixes #424
| Python | mit | agdsn/sipa,agdsn/sipa,agdsn/sipa,agdsn/sipa | import re
from flask import request
from markdown import Markdown
from markdown.extensions import Extension
from markdown.postprocessors import Postprocessor
def absolute_path_replacer(match):
"""Correct the url in a regex match prepending the absolute path"""
assert len(match.groups()) == 2
prefix = re... | import re
from flask import request
from markdown import Markdown
from markdown.extensions import Extension
from markdown.postprocessors import Postprocessor
def absolute_path_replacer(match):
"""Correct the url in a regex match prepending the absolute path"""
assert len(match.groups()) == 2
prefix = re... | <commit_before>import re
from flask import request
from markdown import Markdown
from markdown.extensions import Extension
from markdown.postprocessors import Postprocessor
def absolute_path_replacer(match):
"""Correct the url in a regex match prepending the absolute path"""
assert len(match.groups()) == 2
... | import re
from flask import request
from markdown import Markdown
from markdown.extensions import Extension
from markdown.postprocessors import Postprocessor
def absolute_path_replacer(match):
"""Correct the url in a regex match prepending the absolute path"""
assert len(match.groups()) == 2
prefix = re... | import re
from flask import request
from markdown import Markdown
from markdown.extensions import Extension
from markdown.postprocessors import Postprocessor
def absolute_path_replacer(match):
"""Correct the url in a regex match prepending the absolute path"""
assert len(match.groups()) == 2
prefix = re... | <commit_before>import re
from flask import request
from markdown import Markdown
from markdown.extensions import Extension
from markdown.postprocessors import Postprocessor
def absolute_path_replacer(match):
"""Correct the url in a regex match prepending the absolute path"""
assert len(match.groups()) == 2
... |
0a0d6b87aac75f298194b43cfcea67b0d1651a97 | knights/library.py | knights/library.py | from functools import partial
class Library:
'''
Container for registering tags and filters
'''
def __init__(self):
self.tags = {}
self.filters = {}
self.helpers = {}
def tag(self, func=None, name=None):
if func is None:
return partial(self.tag, name=na... | from functools import partial
class Library:
'''
Container for registering tags and helpers
'''
def __init__(self):
self.tags = {}
self.helpers = {}
def tag(self, func=None, name=None):
if func is None:
return partial(self.tag, name=name)
if name is No... | Remove another reference to filter | Remove another reference to filter
| Python | mit | funkybob/knights-templater,funkybob/knights-templater | from functools import partial
class Library:
'''
Container for registering tags and filters
'''
def __init__(self):
self.tags = {}
self.filters = {}
self.helpers = {}
def tag(self, func=None, name=None):
if func is None:
return partial(self.tag, name=na... | from functools import partial
class Library:
'''
Container for registering tags and helpers
'''
def __init__(self):
self.tags = {}
self.helpers = {}
def tag(self, func=None, name=None):
if func is None:
return partial(self.tag, name=name)
if name is No... | <commit_before>from functools import partial
class Library:
'''
Container for registering tags and filters
'''
def __init__(self):
self.tags = {}
self.filters = {}
self.helpers = {}
def tag(self, func=None, name=None):
if func is None:
return partial(se... | from functools import partial
class Library:
'''
Container for registering tags and helpers
'''
def __init__(self):
self.tags = {}
self.helpers = {}
def tag(self, func=None, name=None):
if func is None:
return partial(self.tag, name=name)
if name is No... | from functools import partial
class Library:
'''
Container for registering tags and filters
'''
def __init__(self):
self.tags = {}
self.filters = {}
self.helpers = {}
def tag(self, func=None, name=None):
if func is None:
return partial(self.tag, name=na... | <commit_before>from functools import partial
class Library:
'''
Container for registering tags and filters
'''
def __init__(self):
self.tags = {}
self.filters = {}
self.helpers = {}
def tag(self, func=None, name=None):
if func is None:
return partial(se... |
58caeb5953df611255f0b14b59694f60ba66345c | comics/comics/darklegacy.py | comics/comics/darklegacy.py | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Dark Legacy"
language = "en"
url = "http://www.darklegacycomics.com/"
start_date = "2006-01-01"
rights = "Arad Kedar"
class Crawler(CrawlerBase... | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Dark Legacy"
language = "en"
url = "http://www.darklegacycomics.com/"
start_date = "2006-01-01"
rights = "Arad Kedar"
class Crawler(CrawlerBase... | Adjust history capability for "Dark Legacy" | Adjust history capability for "Dark Legacy"
| Python | agpl-3.0 | jodal/comics,datagutten/comics,jodal/comics,datagutten/comics,jodal/comics,datagutten/comics,datagutten/comics,jodal/comics | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Dark Legacy"
language = "en"
url = "http://www.darklegacycomics.com/"
start_date = "2006-01-01"
rights = "Arad Kedar"
class Crawler(CrawlerBase... | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Dark Legacy"
language = "en"
url = "http://www.darklegacycomics.com/"
start_date = "2006-01-01"
rights = "Arad Kedar"
class Crawler(CrawlerBase... | <commit_before>from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Dark Legacy"
language = "en"
url = "http://www.darklegacycomics.com/"
start_date = "2006-01-01"
rights = "Arad Kedar"
class Craw... | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Dark Legacy"
language = "en"
url = "http://www.darklegacycomics.com/"
start_date = "2006-01-01"
rights = "Arad Kedar"
class Crawler(CrawlerBase... | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Dark Legacy"
language = "en"
url = "http://www.darklegacycomics.com/"
start_date = "2006-01-01"
rights = "Arad Kedar"
class Crawler(CrawlerBase... | <commit_before>from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Dark Legacy"
language = "en"
url = "http://www.darklegacycomics.com/"
start_date = "2006-01-01"
rights = "Arad Kedar"
class Craw... |
d1171066141418b5ca0dd6a8b996a00cb9e45d00 | st2common/st2common/transport/execution.py | st2common/st2common/transport/execution.py | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | Update name of rabbit queue | Update name of rabbit queue
| Python | apache-2.0 | alfasin/st2,pixelrebel/st2,pixelrebel/st2,Plexxi/st2,StackStorm/st2,Itxaka/st2,tonybaloney/st2,armab/st2,punalpatel/st2,peak6/st2,Plexxi/st2,nzlosh/st2,Itxaka/st2,grengojbo/st2,tonybaloney/st2,armab/st2,pinterb/st2,punalpatel/st2,StackStorm/st2,tonybaloney/st2,Itxaka/st2,Plexxi/st2,jtopjian/st2,nzlosh/st2,peak6/st2,Ple... | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | <commit_before># Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you... | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | <commit_before># Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you... |
111ea97340b600d24dd21316d55cf82fa3ece158 | util/csrf.py | util/csrf.py | # Oxypanel
# File: util/csrf.py
# Desc: csrf protection!
from uuid import uuid4
from flask import session, abort, request, Markup
import config
from app import app
# Check all POST/PUT/DELETE's
# 403 on failure
@app.before_request
def csrf_check():
# No check when debugging
if config.DEBUG:
return
... | # Oxypanel
# File: util/csrf.py
# Desc: csrf protection!
from uuid import uuid4
from flask import session, abort, request, Markup
from app import app
# Check all POST/PUT/DELETE's
# 403 on failure
@app.before_request
def csrf_check():
# TODO: Check referrer matches us
# Check a valid csrf_token was presen... | Use 401 for CSRF failure. Always CSRF even in DEBUG | Use 401 for CSRF failure. Always CSRF even in DEBUG
| Python | mit | oxyio/oxyio,oxyio/oxyio,oxyio/oxyio,oxyio/oxyio | # Oxypanel
# File: util/csrf.py
# Desc: csrf protection!
from uuid import uuid4
from flask import session, abort, request, Markup
import config
from app import app
# Check all POST/PUT/DELETE's
# 403 on failure
@app.before_request
def csrf_check():
# No check when debugging
if config.DEBUG:
return
... | # Oxypanel
# File: util/csrf.py
# Desc: csrf protection!
from uuid import uuid4
from flask import session, abort, request, Markup
from app import app
# Check all POST/PUT/DELETE's
# 403 on failure
@app.before_request
def csrf_check():
# TODO: Check referrer matches us
# Check a valid csrf_token was presen... | <commit_before># Oxypanel
# File: util/csrf.py
# Desc: csrf protection!
from uuid import uuid4
from flask import session, abort, request, Markup
import config
from app import app
# Check all POST/PUT/DELETE's
# 403 on failure
@app.before_request
def csrf_check():
# No check when debugging
if config.DEBUG:
... | # Oxypanel
# File: util/csrf.py
# Desc: csrf protection!
from uuid import uuid4
from flask import session, abort, request, Markup
from app import app
# Check all POST/PUT/DELETE's
# 403 on failure
@app.before_request
def csrf_check():
# TODO: Check referrer matches us
# Check a valid csrf_token was presen... | # Oxypanel
# File: util/csrf.py
# Desc: csrf protection!
from uuid import uuid4
from flask import session, abort, request, Markup
import config
from app import app
# Check all POST/PUT/DELETE's
# 403 on failure
@app.before_request
def csrf_check():
# No check when debugging
if config.DEBUG:
return
... | <commit_before># Oxypanel
# File: util/csrf.py
# Desc: csrf protection!
from uuid import uuid4
from flask import session, abort, request, Markup
import config
from app import app
# Check all POST/PUT/DELETE's
# 403 on failure
@app.before_request
def csrf_check():
# No check when debugging
if config.DEBUG:
... |
a962574f19673c17b033a50809040956a63970e5 | test/pywertest.py | test/pywertest.py | #!/usr/bin/env python3
import sys
import os
import unittest
import libaur.printer as printer
import libaur.aur as aur
class PrinterBadInput(unittest.TestCase):
def test_string_input_dlpkgs(self):
'''download_pkg should fail with string input as first arg'''
self.assertRaises(TypeError, printer.do... | #!/usr/bin/env python3
import sys
import os
import unittest
import libaur.printer as printer
import libaur.aur as aur
class PrinterBadInput(unittest.TestCase):
def test_string_input_dlpkgs(self):
'''download_pkg should fail with string input as first arg'''
self.assertRaises(TypeError, printer.do... | Change the info function name | test: Change the info function name
| Python | mit | KaiSforza/pywer | #!/usr/bin/env python3
import sys
import os
import unittest
import libaur.printer as printer
import libaur.aur as aur
class PrinterBadInput(unittest.TestCase):
def test_string_input_dlpkgs(self):
'''download_pkg should fail with string input as first arg'''
self.assertRaises(TypeError, printer.do... | #!/usr/bin/env python3
import sys
import os
import unittest
import libaur.printer as printer
import libaur.aur as aur
class PrinterBadInput(unittest.TestCase):
def test_string_input_dlpkgs(self):
'''download_pkg should fail with string input as first arg'''
self.assertRaises(TypeError, printer.do... | <commit_before>#!/usr/bin/env python3
import sys
import os
import unittest
import libaur.printer as printer
import libaur.aur as aur
class PrinterBadInput(unittest.TestCase):
def test_string_input_dlpkgs(self):
'''download_pkg should fail with string input as first arg'''
self.assertRaises(TypeEr... | #!/usr/bin/env python3
import sys
import os
import unittest
import libaur.printer as printer
import libaur.aur as aur
class PrinterBadInput(unittest.TestCase):
def test_string_input_dlpkgs(self):
'''download_pkg should fail with string input as first arg'''
self.assertRaises(TypeError, printer.do... | #!/usr/bin/env python3
import sys
import os
import unittest
import libaur.printer as printer
import libaur.aur as aur
class PrinterBadInput(unittest.TestCase):
def test_string_input_dlpkgs(self):
'''download_pkg should fail with string input as first arg'''
self.assertRaises(TypeError, printer.do... | <commit_before>#!/usr/bin/env python3
import sys
import os
import unittest
import libaur.printer as printer
import libaur.aur as aur
class PrinterBadInput(unittest.TestCase):
def test_string_input_dlpkgs(self):
'''download_pkg should fail with string input as first arg'''
self.assertRaises(TypeEr... |
c56d9cded7190d524d3d4dbcd960a0b0fe8bf10c | apps/local_apps/account/middleware.py | apps/local_apps/account/middleware.py | from django.utils.cache import patch_vary_headers
from django.utils import translation
from account.models import Account
class LocaleMiddleware(object):
"""
This is a very simple middleware that parses a request
and decides what translation object to install in the current
thread context depending on ... | from django.utils.cache import patch_vary_headers
from django.utils import translation
from account.models import Account
class LocaleMiddleware(object):
"""
This is a very simple middleware that parses a request
and decides what translation object to install in the current
thread context depending on ... | Throw 500 error on multiple account in LocaleMiddleware so we can fix them. | Throw 500 error on multiple account in LocaleMiddleware so we can fix them.
git-svn-id: 51ba99f60490c2ee9ba726ccda75a38950f5105d@1120 45601e1e-1555-4799-bd40-45c8c71eef50
| Python | mit | alex/pinax,amarandon/pinax,amarandon/pinax,alex/pinax,alex/pinax,amarandon/pinax,amarandon/pinax | from django.utils.cache import patch_vary_headers
from django.utils import translation
from account.models import Account
class LocaleMiddleware(object):
"""
This is a very simple middleware that parses a request
and decides what translation object to install in the current
thread context depending on ... | from django.utils.cache import patch_vary_headers
from django.utils import translation
from account.models import Account
class LocaleMiddleware(object):
"""
This is a very simple middleware that parses a request
and decides what translation object to install in the current
thread context depending on ... | <commit_before>from django.utils.cache import patch_vary_headers
from django.utils import translation
from account.models import Account
class LocaleMiddleware(object):
"""
This is a very simple middleware that parses a request
and decides what translation object to install in the current
thread contex... | from django.utils.cache import patch_vary_headers
from django.utils import translation
from account.models import Account
class LocaleMiddleware(object):
"""
This is a very simple middleware that parses a request
and decides what translation object to install in the current
thread context depending on ... | from django.utils.cache import patch_vary_headers
from django.utils import translation
from account.models import Account
class LocaleMiddleware(object):
"""
This is a very simple middleware that parses a request
and decides what translation object to install in the current
thread context depending on ... | <commit_before>from django.utils.cache import patch_vary_headers
from django.utils import translation
from account.models import Account
class LocaleMiddleware(object):
"""
This is a very simple middleware that parses a request
and decides what translation object to install in the current
thread contex... |
5da30efc6cbbc58db60ba29643c56448b5a79e77 | test/test_pipeline/components/test_base.py | test/test_pipeline/components/test_base.py | import unittest
from autosklearn.pipeline.components.base import find_components, \
AutoSklearnClassificationAlgorithm
class TestBase(unittest.TestCase):
def test_find_components(self):
c = find_components('dummy_components', 'dummy_components',
AutoSklearnClassificationA... | import os
import sys
import unittest
from autosklearn.pipeline.components.base import find_components, \
AutoSklearnClassificationAlgorithm
this_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(this_dir)
class TestBase(unittest.TestCase):
def test_find_components(self):
c = find_com... | FIX fix unit test by fixing import paths | FIX fix unit test by fixing import paths
| Python | bsd-3-clause | automl/auto-sklearn,automl/auto-sklearn | import unittest
from autosklearn.pipeline.components.base import find_components, \
AutoSklearnClassificationAlgorithm
class TestBase(unittest.TestCase):
def test_find_components(self):
c = find_components('dummy_components', 'dummy_components',
AutoSklearnClassificationA... | import os
import sys
import unittest
from autosklearn.pipeline.components.base import find_components, \
AutoSklearnClassificationAlgorithm
this_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(this_dir)
class TestBase(unittest.TestCase):
def test_find_components(self):
c = find_com... | <commit_before>import unittest
from autosklearn.pipeline.components.base import find_components, \
AutoSklearnClassificationAlgorithm
class TestBase(unittest.TestCase):
def test_find_components(self):
c = find_components('dummy_components', 'dummy_components',
AutoSklearn... | import os
import sys
import unittest
from autosklearn.pipeline.components.base import find_components, \
AutoSklearnClassificationAlgorithm
this_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(this_dir)
class TestBase(unittest.TestCase):
def test_find_components(self):
c = find_com... | import unittest
from autosklearn.pipeline.components.base import find_components, \
AutoSklearnClassificationAlgorithm
class TestBase(unittest.TestCase):
def test_find_components(self):
c = find_components('dummy_components', 'dummy_components',
AutoSklearnClassificationA... | <commit_before>import unittest
from autosklearn.pipeline.components.base import find_components, \
AutoSklearnClassificationAlgorithm
class TestBase(unittest.TestCase):
def test_find_components(self):
c = find_components('dummy_components', 'dummy_components',
AutoSklearn... |
4f31fb7962a241c13251994c8659595fa2e0693e | cinder/__init__.py | cinder/__init__.py | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | Set EVENTLET_NO_GREENDNS for IPv6 and dnspython compat | Set EVENTLET_NO_GREENDNS for IPv6 and dnspython compat
If dnspython is present it causes socket.getaddrinfo() to be
monkeypatched wiht code that does not work with IPv6. To get
around this, the EVENTLET_NO_GREENDNS environment variable
must be set before importing eventlet.
This is resolved in the eventlet upstream c... | Python | apache-2.0 | j-griffith/cinder,ge0rgi/cinder,openstack/cinder,j-griffith/cinder,eharney/cinder,Datera/cinder,Datera/cinder,phenoxim/cinder,mahak/cinder,openstack/cinder,phenoxim/cinder,mahak/cinder,eharney/cinder | Set EVENTLET_NO_GREENDNS for IPv6 and dnspython compat
If dnspython is present it causes socket.getaddrinfo() to be
monkeypatched wiht code that does not work with IPv6. To get
around this, the EVENTLET_NO_GREENDNS environment variable
must be set before importing eventlet.
This is resolved in the eventlet upstream c... | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | <commit_before><commit_msg>Set EVENTLET_NO_GREENDNS for IPv6 and dnspython compat
If dnspython is present it causes socket.getaddrinfo() to be
monkeypatched wiht code that does not work with IPv6. To get
around this, the EVENTLET_NO_GREENDNS environment variable
must be set before importing eventlet.
This is resolved... | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | Set EVENTLET_NO_GREENDNS for IPv6 and dnspython compat
If dnspython is present it causes socket.getaddrinfo() to be
monkeypatched wiht code that does not work with IPv6. To get
around this, the EVENTLET_NO_GREENDNS environment variable
must be set before importing eventlet.
This is resolved in the eventlet upstream c... | <commit_before><commit_msg>Set EVENTLET_NO_GREENDNS for IPv6 and dnspython compat
If dnspython is present it causes socket.getaddrinfo() to be
monkeypatched wiht code that does not work with IPv6. To get
around this, the EVENTLET_NO_GREENDNS environment variable
must be set before importing eventlet.
This is resolved... | |
22de9f9d45edbf5eddea2940549efc225c805f02 | tests/ext_i18n.py | tests/ext_i18n.py | from __future__ import unicode_literals
from unittest import TestCase
from wtforms import TextField, validators
from wtforms.ext.i18n.utils import get_translations
from wtforms.ext.i18n import form as i18n_form
class I18NTest(TestCase):
def test_failure(self):
self.assertRaises(IOError, get_translations,... | from __future__ import unicode_literals
from unittest import TestCase
from wtforms import TextField, validators
from wtforms.ext.i18n.utils import get_translations
from wtforms.ext.i18n import form as i18n_form
class I18NTest(TestCase):
def test_failure(self):
self.assertRaises(IOError, get_translations,... | Fix assert for python 2.6 compatibility | Fix assert for python 2.6 compatibility
| Python | bsd-3-clause | Xender/wtforms,Aaron1992/wtforms,jmagnusson/wtforms,pawl/wtforms,cklein/wtforms,pawl/wtforms,crast/wtforms,hsum/wtforms,Aaron1992/wtforms,skytreader/wtforms,wtforms/wtforms,subyraman/wtforms | from __future__ import unicode_literals
from unittest import TestCase
from wtforms import TextField, validators
from wtforms.ext.i18n.utils import get_translations
from wtforms.ext.i18n import form as i18n_form
class I18NTest(TestCase):
def test_failure(self):
self.assertRaises(IOError, get_translations,... | from __future__ import unicode_literals
from unittest import TestCase
from wtforms import TextField, validators
from wtforms.ext.i18n.utils import get_translations
from wtforms.ext.i18n import form as i18n_form
class I18NTest(TestCase):
def test_failure(self):
self.assertRaises(IOError, get_translations,... | <commit_before>from __future__ import unicode_literals
from unittest import TestCase
from wtforms import TextField, validators
from wtforms.ext.i18n.utils import get_translations
from wtforms.ext.i18n import form as i18n_form
class I18NTest(TestCase):
def test_failure(self):
self.assertRaises(IOError, ge... | from __future__ import unicode_literals
from unittest import TestCase
from wtforms import TextField, validators
from wtforms.ext.i18n.utils import get_translations
from wtforms.ext.i18n import form as i18n_form
class I18NTest(TestCase):
def test_failure(self):
self.assertRaises(IOError, get_translations,... | from __future__ import unicode_literals
from unittest import TestCase
from wtforms import TextField, validators
from wtforms.ext.i18n.utils import get_translations
from wtforms.ext.i18n import form as i18n_form
class I18NTest(TestCase):
def test_failure(self):
self.assertRaises(IOError, get_translations,... | <commit_before>from __future__ import unicode_literals
from unittest import TestCase
from wtforms import TextField, validators
from wtforms.ext.i18n.utils import get_translations
from wtforms.ext.i18n import form as i18n_form
class I18NTest(TestCase):
def test_failure(self):
self.assertRaises(IOError, ge... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.