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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
538f8e3382e274402f2f71ba79439fae0828b3cf | IPython/html.py | IPython/html.py | """
Shim to maintain backwards compatibility with old IPython.html imports.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import sys
from warnings import warn
warn("The `IPython.html` package has been deprecated. "
"You should import from jupyter_noteboo... | """
Shim to maintain backwards compatibility with old IPython.html imports.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import sys
from warnings import warn
warn("The `IPython.html` package has been deprecated. "
"You should import from `jupyter_notebo... | Add shim to new widgets repository. | Add shim to new widgets repository.
| Python | bsd-3-clause | ipython/ipython,ipython/ipython | """
Shim to maintain backwards compatibility with old IPython.html imports.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import sys
from warnings import warn
warn("The `IPython.html` package has been deprecated. "
"You should import from jupyter_noteboo... | """
Shim to maintain backwards compatibility with old IPython.html imports.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import sys
from warnings import warn
warn("The `IPython.html` package has been deprecated. "
"You should import from `jupyter_notebo... | <commit_before>"""
Shim to maintain backwards compatibility with old IPython.html imports.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import sys
from warnings import warn
warn("The `IPython.html` package has been deprecated. "
"You should import from ... | """
Shim to maintain backwards compatibility with old IPython.html imports.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import sys
from warnings import warn
warn("The `IPython.html` package has been deprecated. "
"You should import from `jupyter_notebo... | """
Shim to maintain backwards compatibility with old IPython.html imports.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import sys
from warnings import warn
warn("The `IPython.html` package has been deprecated. "
"You should import from jupyter_noteboo... | <commit_before>"""
Shim to maintain backwards compatibility with old IPython.html imports.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import sys
from warnings import warn
warn("The `IPython.html` package has been deprecated. "
"You should import from ... |
0b5a657339870c7669082c39f8290c88732aa92e | extractor.py | extractor.py | from extraction.core import ExtractionRunner
from extraction.runnables import Extractor, RunnableError, Filter, ExtractorResult
import os
import sys
import grobid
import pdfbox
import filters
if __name__ == '__main__':
runner = ExtractionRunner()
runner.add_runnable(pdfbox.PDFBoxPlainTextExtractor)
runner.ad... | from extraction.core import ExtractionRunner
from extraction.runnables import Extractor, RunnableError, Filter, ExtractorResult
import os
import sys
import grobid
import pdfbox
import filters
def get_extraction_runner():
runner = ExtractionRunner()
runner.add_runnable(grobid.GrobidPlainTextExtractor)
# OR
... | Make code a little cleaner | Make code a little cleaner
| Python | apache-2.0 | Tiger66639/new-csx-extractor,SeerLabs/new-csx-extractor,Tiger66639/new-csx-extractor,SeerLabs/new-csx-extractor,Tiger66639/new-csx-extractor,Tiger66639/new-csx-extractor,SeerLabs/new-csx-extractor,SeerLabs/new-csx-extractor | from extraction.core import ExtractionRunner
from extraction.runnables import Extractor, RunnableError, Filter, ExtractorResult
import os
import sys
import grobid
import pdfbox
import filters
if __name__ == '__main__':
runner = ExtractionRunner()
runner.add_runnable(pdfbox.PDFBoxPlainTextExtractor)
runner.ad... | from extraction.core import ExtractionRunner
from extraction.runnables import Extractor, RunnableError, Filter, ExtractorResult
import os
import sys
import grobid
import pdfbox
import filters
def get_extraction_runner():
runner = ExtractionRunner()
runner.add_runnable(grobid.GrobidPlainTextExtractor)
# OR
... | <commit_before>from extraction.core import ExtractionRunner
from extraction.runnables import Extractor, RunnableError, Filter, ExtractorResult
import os
import sys
import grobid
import pdfbox
import filters
if __name__ == '__main__':
runner = ExtractionRunner()
runner.add_runnable(pdfbox.PDFBoxPlainTextExtracto... | from extraction.core import ExtractionRunner
from extraction.runnables import Extractor, RunnableError, Filter, ExtractorResult
import os
import sys
import grobid
import pdfbox
import filters
def get_extraction_runner():
runner = ExtractionRunner()
runner.add_runnable(grobid.GrobidPlainTextExtractor)
# OR
... | from extraction.core import ExtractionRunner
from extraction.runnables import Extractor, RunnableError, Filter, ExtractorResult
import os
import sys
import grobid
import pdfbox
import filters
if __name__ == '__main__':
runner = ExtractionRunner()
runner.add_runnable(pdfbox.PDFBoxPlainTextExtractor)
runner.ad... | <commit_before>from extraction.core import ExtractionRunner
from extraction.runnables import Extractor, RunnableError, Filter, ExtractorResult
import os
import sys
import grobid
import pdfbox
import filters
if __name__ == '__main__':
runner = ExtractionRunner()
runner.add_runnable(pdfbox.PDFBoxPlainTextExtracto... |
af182857b4a70245b0b06bbf37e2d67e0ded493f | ez_gpg/ui.py | ez_gpg/ui.py | import gi
import gnupg # Requires python3-gnupg
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class MainWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="EZ GPG")
self.connect("delete-event", Gtk.main_quit)
self.set_border_width(30)
gpg_k... | import gi
import gnupg # Requires python3-gnupg
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class GpgKeyList(Gtk.ComboBox):
def __init__(self):
Gtk.ComboBox.__init__(self)
gpg_keys_list = Gtk.ListStore(str, str)
for key in self._get_gpg_keys():
key_id = ke... | Split out gpg key list into its own class | Split out gpg key list into its own class
This will make it easy to break out into a module when we need it. In
the process, window was also set to be in the center of the user's
screen.
| Python | lgpl-2.1 | sgnn7/ez_gpg,sgnn7/ez_gpg | import gi
import gnupg # Requires python3-gnupg
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class MainWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="EZ GPG")
self.connect("delete-event", Gtk.main_quit)
self.set_border_width(30)
gpg_k... | import gi
import gnupg # Requires python3-gnupg
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class GpgKeyList(Gtk.ComboBox):
def __init__(self):
Gtk.ComboBox.__init__(self)
gpg_keys_list = Gtk.ListStore(str, str)
for key in self._get_gpg_keys():
key_id = ke... | <commit_before>import gi
import gnupg # Requires python3-gnupg
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class MainWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="EZ GPG")
self.connect("delete-event", Gtk.main_quit)
self.set_border_width(30)... | import gi
import gnupg # Requires python3-gnupg
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class GpgKeyList(Gtk.ComboBox):
def __init__(self):
Gtk.ComboBox.__init__(self)
gpg_keys_list = Gtk.ListStore(str, str)
for key in self._get_gpg_keys():
key_id = ke... | import gi
import gnupg # Requires python3-gnupg
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class MainWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="EZ GPG")
self.connect("delete-event", Gtk.main_quit)
self.set_border_width(30)
gpg_k... | <commit_before>import gi
import gnupg # Requires python3-gnupg
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class MainWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="EZ GPG")
self.connect("delete-event", Gtk.main_quit)
self.set_border_width(30)... |
1dfbe495972a5f4d02ce374131f40d4474f24cc6 | website/ember_osf_web/views.py | website/ember_osf_web/views.py | # -*- coding: utf-8 -*-
import os
import json
import requests
from flask import send_from_directory, Response, stream_with_context
from framework.sessions import session
from website.settings import EXTERNAL_EMBER_APPS, PROXY_EMBER_APPS, EXTERNAL_EMBER_SERVER_TIMEOUT
ember_osf_web_dir = os.path.abspath(os.path.join(o... | # -*- coding: utf-8 -*-
import os
import json
import requests
from flask import send_from_directory, Response, stream_with_context
from framework.sessions import session
from website.settings import EXTERNAL_EMBER_APPS, PROXY_EMBER_APPS, EXTERNAL_EMBER_SERVER_TIMEOUT
ember_osf_web_dir = os.path.abspath(os.path.join(o... | Revert "Use namedtuple's getattr rather than indexing" | Revert "Use namedtuple's getattr rather than indexing"
This reverts commit 5c4f93207c1fbfe9b9a478082d5f039a9e5ba720.
| Python | apache-2.0 | Johnetordoff/osf.io,adlius/osf.io,aaxelb/osf.io,felliott/osf.io,mfraezz/osf.io,mfraezz/osf.io,HalcyonChimera/osf.io,icereval/osf.io,cslzchen/osf.io,Johnetordoff/osf.io,mattclark/osf.io,CenterForOpenScience/osf.io,saradbowman/osf.io,mattclark/osf.io,aaxelb/osf.io,pattisdr/osf.io,CenterForOpenScience/osf.io,caseyrollins/... | # -*- coding: utf-8 -*-
import os
import json
import requests
from flask import send_from_directory, Response, stream_with_context
from framework.sessions import session
from website.settings import EXTERNAL_EMBER_APPS, PROXY_EMBER_APPS, EXTERNAL_EMBER_SERVER_TIMEOUT
ember_osf_web_dir = os.path.abspath(os.path.join(o... | # -*- coding: utf-8 -*-
import os
import json
import requests
from flask import send_from_directory, Response, stream_with_context
from framework.sessions import session
from website.settings import EXTERNAL_EMBER_APPS, PROXY_EMBER_APPS, EXTERNAL_EMBER_SERVER_TIMEOUT
ember_osf_web_dir = os.path.abspath(os.path.join(o... | <commit_before># -*- coding: utf-8 -*-
import os
import json
import requests
from flask import send_from_directory, Response, stream_with_context
from framework.sessions import session
from website.settings import EXTERNAL_EMBER_APPS, PROXY_EMBER_APPS, EXTERNAL_EMBER_SERVER_TIMEOUT
ember_osf_web_dir = os.path.abspath... | # -*- coding: utf-8 -*-
import os
import json
import requests
from flask import send_from_directory, Response, stream_with_context
from framework.sessions import session
from website.settings import EXTERNAL_EMBER_APPS, PROXY_EMBER_APPS, EXTERNAL_EMBER_SERVER_TIMEOUT
ember_osf_web_dir = os.path.abspath(os.path.join(o... | # -*- coding: utf-8 -*-
import os
import json
import requests
from flask import send_from_directory, Response, stream_with_context
from framework.sessions import session
from website.settings import EXTERNAL_EMBER_APPS, PROXY_EMBER_APPS, EXTERNAL_EMBER_SERVER_TIMEOUT
ember_osf_web_dir = os.path.abspath(os.path.join(o... | <commit_before># -*- coding: utf-8 -*-
import os
import json
import requests
from flask import send_from_directory, Response, stream_with_context
from framework.sessions import session
from website.settings import EXTERNAL_EMBER_APPS, PROXY_EMBER_APPS, EXTERNAL_EMBER_SERVER_TIMEOUT
ember_osf_web_dir = os.path.abspath... |
6a8068942d985f0c125749d5f58ad7cb9cd189be | scanpointgenerator/linegenerator_step.py | scanpointgenerator/linegenerator_step.py | from linegenerator import LineGenerator
import math as m
class StepLineGenerator(LineGenerator):
def __init__(self, name, units, start, end, step):
num = int(m.floor((end - start)/step))
super(StepLineGenerator, self).__init__(name, units, start, step, num)
| from linegenerator import LineGenerator
class StepLineGenerator(LineGenerator):
def __init__(self, name, units, start, end, step):
num = int((end - start)/step) + 1
super(StepLineGenerator, self).__init__(name, units, start, step, num)
| Add extra point to include start | Add extra point to include start
| Python | apache-2.0 | dls-controls/scanpointgenerator | from linegenerator import LineGenerator
import math as m
class StepLineGenerator(LineGenerator):
def __init__(self, name, units, start, end, step):
num = int(m.floor((end - start)/step))
super(StepLineGenerator, self).__init__(name, units, start, step, num)
Add extra point to include start | from linegenerator import LineGenerator
class StepLineGenerator(LineGenerator):
def __init__(self, name, units, start, end, step):
num = int((end - start)/step) + 1
super(StepLineGenerator, self).__init__(name, units, start, step, num)
| <commit_before>from linegenerator import LineGenerator
import math as m
class StepLineGenerator(LineGenerator):
def __init__(self, name, units, start, end, step):
num = int(m.floor((end - start)/step))
super(StepLineGenerator, self).__init__(name, units, start, step, num)
<commit_msg>Add extra ... | from linegenerator import LineGenerator
class StepLineGenerator(LineGenerator):
def __init__(self, name, units, start, end, step):
num = int((end - start)/step) + 1
super(StepLineGenerator, self).__init__(name, units, start, step, num)
| from linegenerator import LineGenerator
import math as m
class StepLineGenerator(LineGenerator):
def __init__(self, name, units, start, end, step):
num = int(m.floor((end - start)/step))
super(StepLineGenerator, self).__init__(name, units, start, step, num)
Add extra point to include startfrom ... | <commit_before>from linegenerator import LineGenerator
import math as m
class StepLineGenerator(LineGenerator):
def __init__(self, name, units, start, end, step):
num = int(m.floor((end - start)/step))
super(StepLineGenerator, self).__init__(name, units, start, step, num)
<commit_msg>Add extra ... |
acd5a676b08e070c804bdae78abba266b47c67b5 | libvcs/__about__.py | libvcs/__about__.py | __title__ = 'libvcs'
__package_name__ = 'libvcs'
__description__ = 'vcs abstraction layer'
__version__ = '0.3.0'
__author__ = 'Tony Narlock'
__email__ = '[email protected]'
__license__ = 'MIT'
__copyright__ = 'Copyright 2016 Tony Narlock'
| __title__ = 'libvcs'
__package_name__ = 'libvcs'
__description__ = 'vcs abstraction layer'
__version__ = '0.3.0'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/vcs-python/libvcs'
__pypi__ = 'https://pypi.org/project/libvcs/'
__email__ = '[email protected]'
__license__ = 'MIT'
__copyright__ = 'Copyright 20... | Add pypi + github to metadata | Add pypi + github to metadata
| Python | mit | tony/libvcs | __title__ = 'libvcs'
__package_name__ = 'libvcs'
__description__ = 'vcs abstraction layer'
__version__ = '0.3.0'
__author__ = 'Tony Narlock'
__email__ = '[email protected]'
__license__ = 'MIT'
__copyright__ = 'Copyright 2016 Tony Narlock'
Add pypi + github to metadata | __title__ = 'libvcs'
__package_name__ = 'libvcs'
__description__ = 'vcs abstraction layer'
__version__ = '0.3.0'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/vcs-python/libvcs'
__pypi__ = 'https://pypi.org/project/libvcs/'
__email__ = '[email protected]'
__license__ = 'MIT'
__copyright__ = 'Copyright 20... | <commit_before>__title__ = 'libvcs'
__package_name__ = 'libvcs'
__description__ = 'vcs abstraction layer'
__version__ = '0.3.0'
__author__ = 'Tony Narlock'
__email__ = '[email protected]'
__license__ = 'MIT'
__copyright__ = 'Copyright 2016 Tony Narlock'
<commit_msg>Add pypi + github to metadata<commit_after> | __title__ = 'libvcs'
__package_name__ = 'libvcs'
__description__ = 'vcs abstraction layer'
__version__ = '0.3.0'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/vcs-python/libvcs'
__pypi__ = 'https://pypi.org/project/libvcs/'
__email__ = '[email protected]'
__license__ = 'MIT'
__copyright__ = 'Copyright 20... | __title__ = 'libvcs'
__package_name__ = 'libvcs'
__description__ = 'vcs abstraction layer'
__version__ = '0.3.0'
__author__ = 'Tony Narlock'
__email__ = '[email protected]'
__license__ = 'MIT'
__copyright__ = 'Copyright 2016 Tony Narlock'
Add pypi + github to metadata__title__ = 'libvcs'
__package_name__ = 'libvcs'
__d... | <commit_before>__title__ = 'libvcs'
__package_name__ = 'libvcs'
__description__ = 'vcs abstraction layer'
__version__ = '0.3.0'
__author__ = 'Tony Narlock'
__email__ = '[email protected]'
__license__ = 'MIT'
__copyright__ = 'Copyright 2016 Tony Narlock'
<commit_msg>Add pypi + github to metadata<commit_after>__title__ =... |
c3ea49a3b040dd1e5252ead1a2ae577e037b8b32 | wsme/release.py | wsme/release.py | name = "WSME"
version = "0.4"
description = """Web Services Made Easy makes it easy to \
implement multi-protocol webservices."""
author = "Christophe de Vienne"
email = "[email protected]"
url = "http://bitbucket.org/cdevienne/wsme"
license = "MIT"
| name = "WSME"
version = "0.4b1"
description = """Web Services Made Easy makes it easy to \
implement multi-protocol webservices."""
author = "Christophe de Vienne"
email = "[email protected]"
url = "http://bitbucket.org/cdevienne/wsme"
license = "MIT"
| Add a b1 version tag | Add a b1 version tag
--HG--
extra : rebase_source : 637fbf8294dbe0881c87b4bfeea547303dc8ec96
| Python | mit | stackforge/wsme | name = "WSME"
version = "0.4"
description = """Web Services Made Easy makes it easy to \
implement multi-protocol webservices."""
author = "Christophe de Vienne"
email = "[email protected]"
url = "http://bitbucket.org/cdevienne/wsme"
license = "MIT"
Add a b1 version tag
--HG--
extra : rebase_source : 63... | name = "WSME"
version = "0.4b1"
description = """Web Services Made Easy makes it easy to \
implement multi-protocol webservices."""
author = "Christophe de Vienne"
email = "[email protected]"
url = "http://bitbucket.org/cdevienne/wsme"
license = "MIT"
| <commit_before>name = "WSME"
version = "0.4"
description = """Web Services Made Easy makes it easy to \
implement multi-protocol webservices."""
author = "Christophe de Vienne"
email = "[email protected]"
url = "http://bitbucket.org/cdevienne/wsme"
license = "MIT"
<commit_msg>Add a b1 version tag
--HG--... | name = "WSME"
version = "0.4b1"
description = """Web Services Made Easy makes it easy to \
implement multi-protocol webservices."""
author = "Christophe de Vienne"
email = "[email protected]"
url = "http://bitbucket.org/cdevienne/wsme"
license = "MIT"
| name = "WSME"
version = "0.4"
description = """Web Services Made Easy makes it easy to \
implement multi-protocol webservices."""
author = "Christophe de Vienne"
email = "[email protected]"
url = "http://bitbucket.org/cdevienne/wsme"
license = "MIT"
Add a b1 version tag
--HG--
extra : rebase_source : 63... | <commit_before>name = "WSME"
version = "0.4"
description = """Web Services Made Easy makes it easy to \
implement multi-protocol webservices."""
author = "Christophe de Vienne"
email = "[email protected]"
url = "http://bitbucket.org/cdevienne/wsme"
license = "MIT"
<commit_msg>Add a b1 version tag
--HG--... |
7efcc9987f827eec56677d95bc7ad873208b392f | saw/parser/sentences.py | saw/parser/sentences.py | import base
from blocks import Blocks
import re
class Sentences(base.Base):
_type = 'sentences'
child_class = Blocks
@staticmethod
def parse(text):
#re.split('\!|\?|\. | \.',text)
result = []
prev = 0
# we allow .09 as not end of sentences
#for m in re.finditer... | import base
from blocks import Blocks
import re
class Sentences(base.Base):
_type = 'sentences'
child_class = Blocks
@staticmethod
def parse(text):
_len = len(text)
result = []
prev = 0
# we allow .09 as not end of sentences
for m in re.finditer('[\!\?\.]+', te... | Optimize from 5-6s to 2.9-3.0 | Optimize from 5-6s to 2.9-3.0
| Python | mit | diNard/Saw | import base
from blocks import Blocks
import re
class Sentences(base.Base):
_type = 'sentences'
child_class = Blocks
@staticmethod
def parse(text):
#re.split('\!|\?|\. | \.',text)
result = []
prev = 0
# we allow .09 as not end of sentences
#for m in re.finditer... | import base
from blocks import Blocks
import re
class Sentences(base.Base):
_type = 'sentences'
child_class = Blocks
@staticmethod
def parse(text):
_len = len(text)
result = []
prev = 0
# we allow .09 as not end of sentences
for m in re.finditer('[\!\?\.]+', te... | <commit_before>import base
from blocks import Blocks
import re
class Sentences(base.Base):
_type = 'sentences'
child_class = Blocks
@staticmethod
def parse(text):
#re.split('\!|\?|\. | \.',text)
result = []
prev = 0
# we allow .09 as not end of sentences
#for m... | import base
from blocks import Blocks
import re
class Sentences(base.Base):
_type = 'sentences'
child_class = Blocks
@staticmethod
def parse(text):
_len = len(text)
result = []
prev = 0
# we allow .09 as not end of sentences
for m in re.finditer('[\!\?\.]+', te... | import base
from blocks import Blocks
import re
class Sentences(base.Base):
_type = 'sentences'
child_class = Blocks
@staticmethod
def parse(text):
#re.split('\!|\?|\. | \.',text)
result = []
prev = 0
# we allow .09 as not end of sentences
#for m in re.finditer... | <commit_before>import base
from blocks import Blocks
import re
class Sentences(base.Base):
_type = 'sentences'
child_class = Blocks
@staticmethod
def parse(text):
#re.split('\!|\?|\. | \.',text)
result = []
prev = 0
# we allow .09 as not end of sentences
#for m... |
f67e47fd900de3953ee8abb45e5ea56851c10dee | yvs/set_pref.py | yvs/set_pref.py | # yvs.set_pref
# coding=utf-8
from __future__ import unicode_literals
import json
import sys
import yvs.shared as shared
# Parse pref set data from the given JSON string
def parse_pref_set_data_str(pref_set_data_str):
pref_set_data = json.loads(
pref_set_data_str)['alfredworkflow']['variables']
re... | # yvs.set_pref
# coding=utf-8
from __future__ import unicode_literals
import json
import sys
import yvs.shared as shared
# Parse pref set data from the given JSON string
def parse_pref_set_data_str(pref_set_data_str):
pref_set_data = json.loads(
pref_set_data_str)['alfredworkflow']['variables']
re... | Revert "Switch to tuple for pref set data key list" | Revert "Switch to tuple for pref set data key list"
This reverts commit 302d9797b7ccb46e7b9575513c0a2c5461e156a5.
| Python | mit | caleb531/youversion-suggest,caleb531/youversion-suggest | # yvs.set_pref
# coding=utf-8
from __future__ import unicode_literals
import json
import sys
import yvs.shared as shared
# Parse pref set data from the given JSON string
def parse_pref_set_data_str(pref_set_data_str):
pref_set_data = json.loads(
pref_set_data_str)['alfredworkflow']['variables']
re... | # yvs.set_pref
# coding=utf-8
from __future__ import unicode_literals
import json
import sys
import yvs.shared as shared
# Parse pref set data from the given JSON string
def parse_pref_set_data_str(pref_set_data_str):
pref_set_data = json.loads(
pref_set_data_str)['alfredworkflow']['variables']
re... | <commit_before># yvs.set_pref
# coding=utf-8
from __future__ import unicode_literals
import json
import sys
import yvs.shared as shared
# Parse pref set data from the given JSON string
def parse_pref_set_data_str(pref_set_data_str):
pref_set_data = json.loads(
pref_set_data_str)['alfredworkflow']['var... | # yvs.set_pref
# coding=utf-8
from __future__ import unicode_literals
import json
import sys
import yvs.shared as shared
# Parse pref set data from the given JSON string
def parse_pref_set_data_str(pref_set_data_str):
pref_set_data = json.loads(
pref_set_data_str)['alfredworkflow']['variables']
re... | # yvs.set_pref
# coding=utf-8
from __future__ import unicode_literals
import json
import sys
import yvs.shared as shared
# Parse pref set data from the given JSON string
def parse_pref_set_data_str(pref_set_data_str):
pref_set_data = json.loads(
pref_set_data_str)['alfredworkflow']['variables']
re... | <commit_before># yvs.set_pref
# coding=utf-8
from __future__ import unicode_literals
import json
import sys
import yvs.shared as shared
# Parse pref set data from the given JSON string
def parse_pref_set_data_str(pref_set_data_str):
pref_set_data = json.loads(
pref_set_data_str)['alfredworkflow']['var... |
f9d1bd9471196d5706c063a5ba3d3ca0531fbd1e | npactflask/npactflask/helpers.py | npactflask/npactflask/helpers.py | import os.path
from flask import url_for
from npactflask import app
# TODO: I think this is more simply a template_global:
# http://flask.pocoo.org/docs/0.10/api/#flask.Flask.template_global
@app.context_processor
def vSTATIC():
def STATICV(filename):
if app.config['DEBUG']:
vnum = os.path.... |
from flask import url_for
from npactflask import app
@app.template_global()
def vSTATIC(filename):
if app.config['DEBUG']:
return url_for('static', filename=filename)
else:
return url_for('static',
filename=filename, vnum=app.config['VERSION'])
| Disable vSTATIC version during DEBUG | Disable vSTATIC version during DEBUG
when DEBUG is set we serve static files with max-age of zero which is
hopefully good enough. Adding to the querystring is messing up chrome
development workflow (breakpoints are associated with full uri,
including querystring).
| Python | bsd-3-clause | NProfileAnalysisComputationalTool/npact,NProfileAnalysisComputationalTool/npact,NProfileAnalysisComputationalTool/npact,NProfileAnalysisComputationalTool/npact,NProfileAnalysisComputationalTool/npact | import os.path
from flask import url_for
from npactflask import app
# TODO: I think this is more simply a template_global:
# http://flask.pocoo.org/docs/0.10/api/#flask.Flask.template_global
@app.context_processor
def vSTATIC():
def STATICV(filename):
if app.config['DEBUG']:
vnum = os.path.... |
from flask import url_for
from npactflask import app
@app.template_global()
def vSTATIC(filename):
if app.config['DEBUG']:
return url_for('static', filename=filename)
else:
return url_for('static',
filename=filename, vnum=app.config['VERSION'])
| <commit_before>import os.path
from flask import url_for
from npactflask import app
# TODO: I think this is more simply a template_global:
# http://flask.pocoo.org/docs/0.10/api/#flask.Flask.template_global
@app.context_processor
def vSTATIC():
def STATICV(filename):
if app.config['DEBUG']:
... |
from flask import url_for
from npactflask import app
@app.template_global()
def vSTATIC(filename):
if app.config['DEBUG']:
return url_for('static', filename=filename)
else:
return url_for('static',
filename=filename, vnum=app.config['VERSION'])
| import os.path
from flask import url_for
from npactflask import app
# TODO: I think this is more simply a template_global:
# http://flask.pocoo.org/docs/0.10/api/#flask.Flask.template_global
@app.context_processor
def vSTATIC():
def STATICV(filename):
if app.config['DEBUG']:
vnum = os.path.... | <commit_before>import os.path
from flask import url_for
from npactflask import app
# TODO: I think this is more simply a template_global:
# http://flask.pocoo.org/docs/0.10/api/#flask.Flask.template_global
@app.context_processor
def vSTATIC():
def STATICV(filename):
if app.config['DEBUG']:
... |
026f4e4bcd23e716db508d370e7c84fbf60f4bd0 | scipy/io/arff/tests/test_header.py | scipy/io/arff/tests/test_header.py | #!/usr/bin/env python
"""Test for parsing arff headers only."""
import os
from scipy.testing import *
from scipy.io.arff.arffread import read_header, MetaData
data_path = os.path.join(os.path.dirname(__file__), 'data')
test1 = os.path.join(data_path, 'test1.arff')
class HeaderTest(TestCase):
def test_trivial1(... | #!/usr/bin/env python
"""Test for parsing arff headers only."""
import os
from scipy.testing import *
from scipy.io.arff.arffread import read_header, MetaData
data_path = os.path.join(os.path.dirname(__file__), 'data')
test1 = os.path.join(data_path, 'test1.arff')
class HeaderTest(TestCase):
def test_fullheade... | Change name for arff read test. | Change name for arff read test.
git-svn-id: 003f22d385e25de9cff933a5ea4efd77cb5e7b28@4095 d6536bca-fef9-0310-8506-e4c0a848fbcf
| Python | bsd-3-clause | lesserwhirls/scipy-cwt,scipy/scipy-svn,jasonmccampbell/scipy-refactor,jasonmccampbell/scipy-refactor,jasonmccampbell/scipy-refactor,scipy/scipy-svn,lesserwhirls/scipy-cwt,scipy/scipy-svn,lesserwhirls/scipy-cwt,jasonmccampbell/scipy-refactor,scipy/scipy-svn,lesserwhirls/scipy-cwt | #!/usr/bin/env python
"""Test for parsing arff headers only."""
import os
from scipy.testing import *
from scipy.io.arff.arffread import read_header, MetaData
data_path = os.path.join(os.path.dirname(__file__), 'data')
test1 = os.path.join(data_path, 'test1.arff')
class HeaderTest(TestCase):
def test_trivial1(... | #!/usr/bin/env python
"""Test for parsing arff headers only."""
import os
from scipy.testing import *
from scipy.io.arff.arffread import read_header, MetaData
data_path = os.path.join(os.path.dirname(__file__), 'data')
test1 = os.path.join(data_path, 'test1.arff')
class HeaderTest(TestCase):
def test_fullheade... | <commit_before>#!/usr/bin/env python
"""Test for parsing arff headers only."""
import os
from scipy.testing import *
from scipy.io.arff.arffread import read_header, MetaData
data_path = os.path.join(os.path.dirname(__file__), 'data')
test1 = os.path.join(data_path, 'test1.arff')
class HeaderTest(TestCase):
def... | #!/usr/bin/env python
"""Test for parsing arff headers only."""
import os
from scipy.testing import *
from scipy.io.arff.arffread import read_header, MetaData
data_path = os.path.join(os.path.dirname(__file__), 'data')
test1 = os.path.join(data_path, 'test1.arff')
class HeaderTest(TestCase):
def test_fullheade... | #!/usr/bin/env python
"""Test for parsing arff headers only."""
import os
from scipy.testing import *
from scipy.io.arff.arffread import read_header, MetaData
data_path = os.path.join(os.path.dirname(__file__), 'data')
test1 = os.path.join(data_path, 'test1.arff')
class HeaderTest(TestCase):
def test_trivial1(... | <commit_before>#!/usr/bin/env python
"""Test for parsing arff headers only."""
import os
from scipy.testing import *
from scipy.io.arff.arffread import read_header, MetaData
data_path = os.path.join(os.path.dirname(__file__), 'data')
test1 = os.path.join(data_path, 'test1.arff')
class HeaderTest(TestCase):
def... |
7c9fbdb62c6b045476064fd4193fd133ed0de7c3 | genderator/utils.py | genderator/utils.py | from unidecode import unidecode
class Normalizer:
def normalize(text):
text = Normalizer.remove_extra_whitespaces(text)
text = Normalizer.replace_hyphens(text)
# text = Normalizer.remove_accent_marks(text)
return text.lower()
@staticmethod
def replace_hyphens(text):
... | from unidecode import unidecode
class Normalizer:
def normalize(text):
"""
Normalize a given text applying all normalizations.
Params:
text: The text to be processed.
Returns:
The text normalized.
"""
text = Normalizer.remove_extra_whitesp... | Add accent marks normalization and missing docstrings | Add accent marks normalization and missing docstrings
| Python | mit | davidmogar/genderator | from unidecode import unidecode
class Normalizer:
def normalize(text):
text = Normalizer.remove_extra_whitespaces(text)
text = Normalizer.replace_hyphens(text)
# text = Normalizer.remove_accent_marks(text)
return text.lower()
@staticmethod
def replace_hyphens(text):
... | from unidecode import unidecode
class Normalizer:
def normalize(text):
"""
Normalize a given text applying all normalizations.
Params:
text: The text to be processed.
Returns:
The text normalized.
"""
text = Normalizer.remove_extra_whitesp... | <commit_before>from unidecode import unidecode
class Normalizer:
def normalize(text):
text = Normalizer.remove_extra_whitespaces(text)
text = Normalizer.replace_hyphens(text)
# text = Normalizer.remove_accent_marks(text)
return text.lower()
@staticmethod
def replace_hyph... | from unidecode import unidecode
class Normalizer:
def normalize(text):
"""
Normalize a given text applying all normalizations.
Params:
text: The text to be processed.
Returns:
The text normalized.
"""
text = Normalizer.remove_extra_whitesp... | from unidecode import unidecode
class Normalizer:
def normalize(text):
text = Normalizer.remove_extra_whitespaces(text)
text = Normalizer.replace_hyphens(text)
# text = Normalizer.remove_accent_marks(text)
return text.lower()
@staticmethod
def replace_hyphens(text):
... | <commit_before>from unidecode import unidecode
class Normalizer:
def normalize(text):
text = Normalizer.remove_extra_whitespaces(text)
text = Normalizer.replace_hyphens(text)
# text = Normalizer.remove_accent_marks(text)
return text.lower()
@staticmethod
def replace_hyph... |
0cab34e5f87b4484e0309aba8860d651afe06fb0 | app/__init__.py | app/__init__.py | from flask import Flask, request, redirect
from flask.ext.bootstrap import Bootstrap
from config import configs
from dmutils import apiclient, init_app, flask_featureflags
from dmutils.content_loader import ContentLoader
bootstrap = Bootstrap()
data_api_client = apiclient.DataAPIClient()
search_api_client = apiclient... | from flask import Flask, request, redirect
from flask.ext.bootstrap import Bootstrap
from config import configs
from dmutils import apiclient, init_app, flask_featureflags
from dmutils.content_loader import ContentLoader
bootstrap = Bootstrap()
data_api_client = apiclient.DataAPIClient()
search_api_client = apiclient... | Move QUESTIONS_BUILDER from blueprint to a global variable | Move QUESTIONS_BUILDER from blueprint to a global variable
| Python | mit | mtekel/digitalmarketplace-buyer-frontend,alphagov/digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend,mtekel/digitalmarketplace-buyer-frontend,alphagov/digitalmarketplace-buyer-frontend,mtekel/digitalmarketplace-buyer-frontend,mtekel/digitalmarketp... | from flask import Flask, request, redirect
from flask.ext.bootstrap import Bootstrap
from config import configs
from dmutils import apiclient, init_app, flask_featureflags
from dmutils.content_loader import ContentLoader
bootstrap = Bootstrap()
data_api_client = apiclient.DataAPIClient()
search_api_client = apiclient... | from flask import Flask, request, redirect
from flask.ext.bootstrap import Bootstrap
from config import configs
from dmutils import apiclient, init_app, flask_featureflags
from dmutils.content_loader import ContentLoader
bootstrap = Bootstrap()
data_api_client = apiclient.DataAPIClient()
search_api_client = apiclient... | <commit_before>from flask import Flask, request, redirect
from flask.ext.bootstrap import Bootstrap
from config import configs
from dmutils import apiclient, init_app, flask_featureflags
from dmutils.content_loader import ContentLoader
bootstrap = Bootstrap()
data_api_client = apiclient.DataAPIClient()
search_api_cli... | from flask import Flask, request, redirect
from flask.ext.bootstrap import Bootstrap
from config import configs
from dmutils import apiclient, init_app, flask_featureflags
from dmutils.content_loader import ContentLoader
bootstrap = Bootstrap()
data_api_client = apiclient.DataAPIClient()
search_api_client = apiclient... | from flask import Flask, request, redirect
from flask.ext.bootstrap import Bootstrap
from config import configs
from dmutils import apiclient, init_app, flask_featureflags
from dmutils.content_loader import ContentLoader
bootstrap = Bootstrap()
data_api_client = apiclient.DataAPIClient()
search_api_client = apiclient... | <commit_before>from flask import Flask, request, redirect
from flask.ext.bootstrap import Bootstrap
from config import configs
from dmutils import apiclient, init_app, flask_featureflags
from dmutils.content_loader import ContentLoader
bootstrap = Bootstrap()
data_api_client = apiclient.DataAPIClient()
search_api_cli... |
e65ed7382c691d8ee19a22659ddb6deaa064e85b | kmip/__init__.py | kmip/__init__.py | # Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | # Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | Update the kmip package to allow importing enums globally | Update the kmip package to allow importing enums globally
This change updates the root-level kmip package, allowing users
to now import enums directly from the kmip package:
from kmip import enums
Enumerations are used throughout the codebase and user applications
and this will simplify usage and help obfuscate inte... | Python | apache-2.0 | OpenKMIP/PyKMIP,OpenKMIP/PyKMIP | # Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | # Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | <commit_before># Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory
# 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... | # Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | # Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | <commit_before># Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory
# 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... |
3e0fbefa021c4c97024da30963845b201ff35089 | dmaws/commands/paasmanifest.py | dmaws/commands/paasmanifest.py | import click
import os
from ..cli import cli_command
from ..utils import load_file, template_string
@cli_command('paas-manifest', max_apps=1)
@click.option('--template', '-t', default='paas/manifest.j2',
type=click.Path(exists=True),
help="Manifest Jinja2 template file")
@click.option('--... | import click
import os
from ..cli import cli_command
from ..utils import load_file, template_string, merge_dicts
@cli_command('paas-manifest', max_apps=1)
@click.option('--out-file', '-o',
help="Output file, if empty the template content is printed to the stdout")
def paas_manifest(ctx, out_file):
... | Update paas-manifest command to load per-app manifests | Update paas-manifest command to load per-app manifests
Removes template file option in favour of the app-specific manifests.
Changes the way variables are set for the manifest template. Once
the relevant variable files are loaded and merged the command will
update the top-level namespace with the values from the appl... | Python | mit | alphagov/digitalmarketplace-aws,alphagov/digitalmarketplace-aws,alphagov/digitalmarketplace-aws | import click
import os
from ..cli import cli_command
from ..utils import load_file, template_string
@cli_command('paas-manifest', max_apps=1)
@click.option('--template', '-t', default='paas/manifest.j2',
type=click.Path(exists=True),
help="Manifest Jinja2 template file")
@click.option('--... | import click
import os
from ..cli import cli_command
from ..utils import load_file, template_string, merge_dicts
@cli_command('paas-manifest', max_apps=1)
@click.option('--out-file', '-o',
help="Output file, if empty the template content is printed to the stdout")
def paas_manifest(ctx, out_file):
... | <commit_before>import click
import os
from ..cli import cli_command
from ..utils import load_file, template_string
@cli_command('paas-manifest', max_apps=1)
@click.option('--template', '-t', default='paas/manifest.j2',
type=click.Path(exists=True),
help="Manifest Jinja2 template file")
@c... | import click
import os
from ..cli import cli_command
from ..utils import load_file, template_string, merge_dicts
@cli_command('paas-manifest', max_apps=1)
@click.option('--out-file', '-o',
help="Output file, if empty the template content is printed to the stdout")
def paas_manifest(ctx, out_file):
... | import click
import os
from ..cli import cli_command
from ..utils import load_file, template_string
@cli_command('paas-manifest', max_apps=1)
@click.option('--template', '-t', default='paas/manifest.j2',
type=click.Path(exists=True),
help="Manifest Jinja2 template file")
@click.option('--... | <commit_before>import click
import os
from ..cli import cli_command
from ..utils import load_file, template_string
@cli_command('paas-manifest', max_apps=1)
@click.option('--template', '-t', default='paas/manifest.j2',
type=click.Path(exists=True),
help="Manifest Jinja2 template file")
@c... |
89a7a834638a1384bd9f1a560902b4d3aab29423 | smoked/loader.py | smoked/loader.py | # coding: utf-8
from __future__ import unicode_literals
from importlib import import_module
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def load_test_module():
"""
Import test module and trigger registration of tests. Test module is
defined in `SMOKE_TESTS` se... | # coding: utf-8
from __future__ import unicode_literals
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
def load_test_module():
"""
Import test module and trigger registration of tests. Test module is
defined in `SM... | Fix import of import_module for Py2.6 | Fix import of import_module for Py2.6
| Python | mit | djentlemen/django-smoked | # coding: utf-8
from __future__ import unicode_literals
from importlib import import_module
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def load_test_module():
"""
Import test module and trigger registration of tests. Test module is
defined in `SMOKE_TESTS` se... | # coding: utf-8
from __future__ import unicode_literals
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
def load_test_module():
"""
Import test module and trigger registration of tests. Test module is
defined in `SM... | <commit_before># coding: utf-8
from __future__ import unicode_literals
from importlib import import_module
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def load_test_module():
"""
Import test module and trigger registration of tests. Test module is
defined in `... | # coding: utf-8
from __future__ import unicode_literals
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
def load_test_module():
"""
Import test module and trigger registration of tests. Test module is
defined in `SM... | # coding: utf-8
from __future__ import unicode_literals
from importlib import import_module
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def load_test_module():
"""
Import test module and trigger registration of tests. Test module is
defined in `SMOKE_TESTS` se... | <commit_before># coding: utf-8
from __future__ import unicode_literals
from importlib import import_module
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def load_test_module():
"""
Import test module and trigger registration of tests. Test module is
defined in `... |
d2339fa094062c0672aef0ce938572aa3f5aead3 | nintendo/sead/random.py | nintendo/sead/random.py |
class Random:
def __init__(self, seed):
multiplier = 0x6C078965
temp = seed
self.state = []
for i in range(1, 5):
temp ^= temp >> 30
temp = (temp * multiplier + i) & 0xFFFFFFFF
self.state.append(temp)
def u32(self):
temp = self.state[0]
temp = (temp ^ (temp << 11)) & 0xFFFFFFFF
temp ^= tem... |
class Random:
def __init__(self, *param):
if len(param) == 1: self.set_seed(param[0])
elif len(param) == 4: self.set_state(*param)
else:
raise TypeError("Random.__init__ takes either 1 or 4 arguments")
def set_seed(self, seed):
multiplier = 0x6C078965
temp = seed
self.state = []
for i in rang... | Allow sead.Random to be constructed by internal state | Allow sead.Random to be constructed by internal state
| Python | mit | Kinnay/NintendoClients |
class Random:
def __init__(self, seed):
multiplier = 0x6C078965
temp = seed
self.state = []
for i in range(1, 5):
temp ^= temp >> 30
temp = (temp * multiplier + i) & 0xFFFFFFFF
self.state.append(temp)
def u32(self):
temp = self.state[0]
temp = (temp ^ (temp << 11)) & 0xFFFFFFFF
temp ^= tem... |
class Random:
def __init__(self, *param):
if len(param) == 1: self.set_seed(param[0])
elif len(param) == 4: self.set_state(*param)
else:
raise TypeError("Random.__init__ takes either 1 or 4 arguments")
def set_seed(self, seed):
multiplier = 0x6C078965
temp = seed
self.state = []
for i in rang... | <commit_before>
class Random:
def __init__(self, seed):
multiplier = 0x6C078965
temp = seed
self.state = []
for i in range(1, 5):
temp ^= temp >> 30
temp = (temp * multiplier + i) & 0xFFFFFFFF
self.state.append(temp)
def u32(self):
temp = self.state[0]
temp = (temp ^ (temp << 11)) & 0xFFFFFFF... |
class Random:
def __init__(self, *param):
if len(param) == 1: self.set_seed(param[0])
elif len(param) == 4: self.set_state(*param)
else:
raise TypeError("Random.__init__ takes either 1 or 4 arguments")
def set_seed(self, seed):
multiplier = 0x6C078965
temp = seed
self.state = []
for i in rang... |
class Random:
def __init__(self, seed):
multiplier = 0x6C078965
temp = seed
self.state = []
for i in range(1, 5):
temp ^= temp >> 30
temp = (temp * multiplier + i) & 0xFFFFFFFF
self.state.append(temp)
def u32(self):
temp = self.state[0]
temp = (temp ^ (temp << 11)) & 0xFFFFFFFF
temp ^= tem... | <commit_before>
class Random:
def __init__(self, seed):
multiplier = 0x6C078965
temp = seed
self.state = []
for i in range(1, 5):
temp ^= temp >> 30
temp = (temp * multiplier + i) & 0xFFFFFFFF
self.state.append(temp)
def u32(self):
temp = self.state[0]
temp = (temp ^ (temp << 11)) & 0xFFFFFFF... |
3e913e4267fd7750516edcbed1aa687e0cbd17fe | edx_repo_tools/oep2/__init__.py | edx_repo_tools/oep2/__init__.py | """
Top-level definition of the ``oep2`` commandline tool.
"""
import click
from . import explode_repos_yaml
from .report import cli
def _cli():
cli(auto_envvar_prefix="OEP2")
@click.group()
def cli():
"""
Tools for implementing and enforcing OEP-2.
"""
pass
cli.add_command(explode_repos_yaml... | """
Top-level definition of the ``oep2`` commandline tool.
"""
import click
from . import explode_repos_yaml
from .report.cli import cli as report_cli
def _cli():
cli(auto_envvar_prefix="OEP2")
@click.group()
def cli():
"""
Tools for implementing and enforcing OEP-2.
"""
pass
cli.add_command(... | Make oep-2 checker run again | Make oep-2 checker run again
| Python | apache-2.0 | edx/repo-tools,edx/repo-tools | """
Top-level definition of the ``oep2`` commandline tool.
"""
import click
from . import explode_repos_yaml
from .report import cli
def _cli():
cli(auto_envvar_prefix="OEP2")
@click.group()
def cli():
"""
Tools for implementing and enforcing OEP-2.
"""
pass
cli.add_command(explode_repos_yaml... | """
Top-level definition of the ``oep2`` commandline tool.
"""
import click
from . import explode_repos_yaml
from .report.cli import cli as report_cli
def _cli():
cli(auto_envvar_prefix="OEP2")
@click.group()
def cli():
"""
Tools for implementing and enforcing OEP-2.
"""
pass
cli.add_command(... | <commit_before>"""
Top-level definition of the ``oep2`` commandline tool.
"""
import click
from . import explode_repos_yaml
from .report import cli
def _cli():
cli(auto_envvar_prefix="OEP2")
@click.group()
def cli():
"""
Tools for implementing and enforcing OEP-2.
"""
pass
cli.add_command(exp... | """
Top-level definition of the ``oep2`` commandline tool.
"""
import click
from . import explode_repos_yaml
from .report.cli import cli as report_cli
def _cli():
cli(auto_envvar_prefix="OEP2")
@click.group()
def cli():
"""
Tools for implementing and enforcing OEP-2.
"""
pass
cli.add_command(... | """
Top-level definition of the ``oep2`` commandline tool.
"""
import click
from . import explode_repos_yaml
from .report import cli
def _cli():
cli(auto_envvar_prefix="OEP2")
@click.group()
def cli():
"""
Tools for implementing and enforcing OEP-2.
"""
pass
cli.add_command(explode_repos_yaml... | <commit_before>"""
Top-level definition of the ``oep2`` commandline tool.
"""
import click
from . import explode_repos_yaml
from .report import cli
def _cli():
cli(auto_envvar_prefix="OEP2")
@click.group()
def cli():
"""
Tools for implementing and enforcing OEP-2.
"""
pass
cli.add_command(exp... |
d85947ee083b0a5d7156b4e49fd5677ebeea33c7 | brew/monitor.py | brew/monitor.py | import time
import threading
from . import app, mongo, controller
from bson.objectid import ObjectId
class Monitor(object):
def __init__(self, timeout=10):
self.thread = None
self.exit_event = None
self.timeout = timeout
def temperature(self, brew_id):
if self.thread:
... | import time
import threading
from . import app, mongo, controller
from bson.objectid import ObjectId
class Monitor(object):
def __init__(self, timeout=10):
self.thread = None
self.exit_event = None
self.timeout = timeout
def temperature(self, brew_id):
if self.thread:
... | Fix problem after stopping process | Fix problem after stopping process
| Python | mit | brewpeople/brewmeister,brewpeople/brewmeister,brewpeople/brewmeister | import time
import threading
from . import app, mongo, controller
from bson.objectid import ObjectId
class Monitor(object):
def __init__(self, timeout=10):
self.thread = None
self.exit_event = None
self.timeout = timeout
def temperature(self, brew_id):
if self.thread:
... | import time
import threading
from . import app, mongo, controller
from bson.objectid import ObjectId
class Monitor(object):
def __init__(self, timeout=10):
self.thread = None
self.exit_event = None
self.timeout = timeout
def temperature(self, brew_id):
if self.thread:
... | <commit_before>import time
import threading
from . import app, mongo, controller
from bson.objectid import ObjectId
class Monitor(object):
def __init__(self, timeout=10):
self.thread = None
self.exit_event = None
self.timeout = timeout
def temperature(self, brew_id):
if self.t... | import time
import threading
from . import app, mongo, controller
from bson.objectid import ObjectId
class Monitor(object):
def __init__(self, timeout=10):
self.thread = None
self.exit_event = None
self.timeout = timeout
def temperature(self, brew_id):
if self.thread:
... | import time
import threading
from . import app, mongo, controller
from bson.objectid import ObjectId
class Monitor(object):
def __init__(self, timeout=10):
self.thread = None
self.exit_event = None
self.timeout = timeout
def temperature(self, brew_id):
if self.thread:
... | <commit_before>import time
import threading
from . import app, mongo, controller
from bson.objectid import ObjectId
class Monitor(object):
def __init__(self, timeout=10):
self.thread = None
self.exit_event = None
self.timeout = timeout
def temperature(self, brew_id):
if self.t... |
ccafafbd51422979ed93ed197135bf03b7d0be81 | opps/images/__init__.py | opps/images/__init__.py | # -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
trans_app_label = _('Image')
settings.INSTALLED_APPS += ('thumbor',)
| # -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
trans_app_label = _('Image')
| Remove thumbor use on init image, thumbor not django application | Remove thumbor use on init image, thumbor not django application
| Python | mit | YACOWS/opps,opps/opps,jeanmask/opps,jeanmask/opps,jeanmask/opps,opps/opps,opps/opps,YACOWS/opps,YACOWS/opps,YACOWS/opps,williamroot/opps,williamroot/opps,williamroot/opps,williamroot/opps,jeanmask/opps,opps/opps | # -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
trans_app_label = _('Image')
settings.INSTALLED_APPS += ('thumbor',)
Remove thumbor use on init image, thumbor not django application | # -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
trans_app_label = _('Image')
| <commit_before># -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
trans_app_label = _('Image')
settings.INSTALLED_APPS += ('thumbor',)
<commit_msg>Remove thumbor use on init image, thumbor not django application<commit_after> | # -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
trans_app_label = _('Image')
| # -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
trans_app_label = _('Image')
settings.INSTALLED_APPS += ('thumbor',)
Remove thumbor use on init image, thumbor not django application# -*- coding: utf-8 -*-
from django.utils.translation import ugettext_l... | <commit_before># -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
trans_app_label = _('Image')
settings.INSTALLED_APPS += ('thumbor',)
<commit_msg>Remove thumbor use on init image, thumbor not django application<commit_after># -*- coding: utf-8 -*-
from d... |
1bfb33a7332cefdacb9b57137cf407ede0d8a919 | examples/evaluate_similarity.py | examples/evaluate_similarity.py | # -*- coding: utf-8 -*-
"""
Simple example showing evaluating embedding on similarity datasets
"""
import logging
from six import iteritems
from web.datasets.similarity import fetch_MEN, fetch_WS353, fetch_SimLex999
from web.embeddings import fetch_GloVe
from web.evaluate import evaluate_similarity
# Configure loggi... | # -*- coding: utf-8 -*-
"""
Simple example showing evaluating embedding on similarity datasets
"""
import logging
from six import iteritems
from web.datasets.similarity import fetch_MEN, fetch_WS353, fetch_SimLex999
from web.embeddings import fetch_GloVe
from web.evaluate import evaluate_similarity
# Configure loggi... | Fix print format for python3 | Fix print format for python3 | Python | mit | kudkudak/word-embeddings-benchmarks | # -*- coding: utf-8 -*-
"""
Simple example showing evaluating embedding on similarity datasets
"""
import logging
from six import iteritems
from web.datasets.similarity import fetch_MEN, fetch_WS353, fetch_SimLex999
from web.embeddings import fetch_GloVe
from web.evaluate import evaluate_similarity
# Configure loggi... | # -*- coding: utf-8 -*-
"""
Simple example showing evaluating embedding on similarity datasets
"""
import logging
from six import iteritems
from web.datasets.similarity import fetch_MEN, fetch_WS353, fetch_SimLex999
from web.embeddings import fetch_GloVe
from web.evaluate import evaluate_similarity
# Configure loggi... | <commit_before># -*- coding: utf-8 -*-
"""
Simple example showing evaluating embedding on similarity datasets
"""
import logging
from six import iteritems
from web.datasets.similarity import fetch_MEN, fetch_WS353, fetch_SimLex999
from web.embeddings import fetch_GloVe
from web.evaluate import evaluate_similarity
# ... | # -*- coding: utf-8 -*-
"""
Simple example showing evaluating embedding on similarity datasets
"""
import logging
from six import iteritems
from web.datasets.similarity import fetch_MEN, fetch_WS353, fetch_SimLex999
from web.embeddings import fetch_GloVe
from web.evaluate import evaluate_similarity
# Configure loggi... | # -*- coding: utf-8 -*-
"""
Simple example showing evaluating embedding on similarity datasets
"""
import logging
from six import iteritems
from web.datasets.similarity import fetch_MEN, fetch_WS353, fetch_SimLex999
from web.embeddings import fetch_GloVe
from web.evaluate import evaluate_similarity
# Configure loggi... | <commit_before># -*- coding: utf-8 -*-
"""
Simple example showing evaluating embedding on similarity datasets
"""
import logging
from six import iteritems
from web.datasets.similarity import fetch_MEN, fetch_WS353, fetch_SimLex999
from web.embeddings import fetch_GloVe
from web.evaluate import evaluate_similarity
# ... |
715a3c7005130b4fea8ac46132e2d2505f1901cf | pdf_generator/styles.py | pdf_generator/styles.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from reportlab.platypus import (
Paragraph as BaseParagraph,
Spacer,
)
from reportlab.lib.styles import ParagraphStyle, getSampleStyleSheet
styles = getSampleStyleSheet()
snormal = ParagraphStyle('normal')
def Paragraph(t... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from reportlab.platypus import (
Paragraph as BaseParagraph,
Image as BaseImage,
Spacer,
)
from reportlab.lib.styles import ParagraphStyle, getSampleStyleSheet
styles = getSampleStyleSheet()
snormal = ParagraphStyle('no... | Add a image shortcut to compute height and width with a ratio | Add a image shortcut to compute height and width with a ratio
| Python | mit | cecedille1/PDF_generator | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from reportlab.platypus import (
Paragraph as BaseParagraph,
Spacer,
)
from reportlab.lib.styles import ParagraphStyle, getSampleStyleSheet
styles = getSampleStyleSheet()
snormal = ParagraphStyle('normal')
def Paragraph(t... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from reportlab.platypus import (
Paragraph as BaseParagraph,
Image as BaseImage,
Spacer,
)
from reportlab.lib.styles import ParagraphStyle, getSampleStyleSheet
styles = getSampleStyleSheet()
snormal = ParagraphStyle('no... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from reportlab.platypus import (
Paragraph as BaseParagraph,
Spacer,
)
from reportlab.lib.styles import ParagraphStyle, getSampleStyleSheet
styles = getSampleStyleSheet()
snormal = ParagraphStyle('normal')
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from reportlab.platypus import (
Paragraph as BaseParagraph,
Image as BaseImage,
Spacer,
)
from reportlab.lib.styles import ParagraphStyle, getSampleStyleSheet
styles = getSampleStyleSheet()
snormal = ParagraphStyle('no... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from reportlab.platypus import (
Paragraph as BaseParagraph,
Spacer,
)
from reportlab.lib.styles import ParagraphStyle, getSampleStyleSheet
styles = getSampleStyleSheet()
snormal = ParagraphStyle('normal')
def Paragraph(t... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from reportlab.platypus import (
Paragraph as BaseParagraph,
Spacer,
)
from reportlab.lib.styles import ParagraphStyle, getSampleStyleSheet
styles = getSampleStyleSheet()
snormal = ParagraphStyle('normal')
... |
46de02b77c25c633b254dc81ed35da2443b287a9 | lighty/wsgi/__init__.py | lighty/wsgi/__init__.py | import functools
from .handler import handler
from .urls import load_urls, resolve
def WSGIApplication(app_settings):
'''Create main application handler
'''
class Application(object):
settings = app_settings
urls = load_urls(settings.urls)
resolve_url = functools.partial(resolve,... | import functools
import os
from ..templates.loaders import FSLoader
from .handler import handler
from .urls import load_urls, resolve
class BaseApplication(object):
'''Base application class contains obly settings, urls and resolve_url
method
'''
def __init__(self, settings):
self.settings ... | Add ComplexApplication class for WSGI apps that uses not only urls resolving. | Add ComplexApplication class for WSGI apps that uses not only urls resolving.
| Python | bsd-3-clause | GrAndSE/lighty | import functools
from .handler import handler
from .urls import load_urls, resolve
def WSGIApplication(app_settings):
'''Create main application handler
'''
class Application(object):
settings = app_settings
urls = load_urls(settings.urls)
resolve_url = functools.partial(resolve,... | import functools
import os
from ..templates.loaders import FSLoader
from .handler import handler
from .urls import load_urls, resolve
class BaseApplication(object):
'''Base application class contains obly settings, urls and resolve_url
method
'''
def __init__(self, settings):
self.settings ... | <commit_before>import functools
from .handler import handler
from .urls import load_urls, resolve
def WSGIApplication(app_settings):
'''Create main application handler
'''
class Application(object):
settings = app_settings
urls = load_urls(settings.urls)
resolve_url = functools.p... | import functools
import os
from ..templates.loaders import FSLoader
from .handler import handler
from .urls import load_urls, resolve
class BaseApplication(object):
'''Base application class contains obly settings, urls and resolve_url
method
'''
def __init__(self, settings):
self.settings ... | import functools
from .handler import handler
from .urls import load_urls, resolve
def WSGIApplication(app_settings):
'''Create main application handler
'''
class Application(object):
settings = app_settings
urls = load_urls(settings.urls)
resolve_url = functools.partial(resolve,... | <commit_before>import functools
from .handler import handler
from .urls import load_urls, resolve
def WSGIApplication(app_settings):
'''Create main application handler
'''
class Application(object):
settings = app_settings
urls = load_urls(settings.urls)
resolve_url = functools.p... |
a1b4526f48fbd9e7f48c8bb6bc1a4763cc710448 | fabric_bolt/web_hooks/tables.py | fabric_bolt/web_hooks/tables.py | import django_tables2 as tables
from fabric_bolt.core.mixins.tables import ActionsColumn, PaginateTable
from fabric_bolt.web_hooks import models
class HookTable(PaginateTable):
"""Table used to show the configurations
Also provides actions to edit and delete"""
actions = ActionsColumn([
{'titl... | import django_tables2 as tables
from fabric_bolt.core.mixins.tables import ActionsColumn, PaginateTable
from fabric_bolt.web_hooks import models
class HookTable(PaginateTable):
"""Table used to show the configurations
Also provides actions to edit and delete"""
actions = ActionsColumn([
{'titl... | Add project to hook table so it's a little more clear what it's a global one. | Add project to hook table so it's a little more clear what it's a global one.
| Python | mit | worthwhile/fabric-bolt,jproffitt/fabric-bolt,gvangool/fabric-bolt,qdqmedia/fabric-bolt,damoguyan8844/fabric-bolt,qdqmedia/fabric-bolt,npardington/fabric-bolt,fabric-bolt/fabric-bolt,maximon93/fabric-bolt,leominov/fabric-bolt,lethe3000/fabric-bolt,worthwhile/fabric-bolt,maximon93/fabric-bolt,damoguyan8844/fabric-bolt,le... | import django_tables2 as tables
from fabric_bolt.core.mixins.tables import ActionsColumn, PaginateTable
from fabric_bolt.web_hooks import models
class HookTable(PaginateTable):
"""Table used to show the configurations
Also provides actions to edit and delete"""
actions = ActionsColumn([
{'titl... | import django_tables2 as tables
from fabric_bolt.core.mixins.tables import ActionsColumn, PaginateTable
from fabric_bolt.web_hooks import models
class HookTable(PaginateTable):
"""Table used to show the configurations
Also provides actions to edit and delete"""
actions = ActionsColumn([
{'titl... | <commit_before>import django_tables2 as tables
from fabric_bolt.core.mixins.tables import ActionsColumn, PaginateTable
from fabric_bolt.web_hooks import models
class HookTable(PaginateTable):
"""Table used to show the configurations
Also provides actions to edit and delete"""
actions = ActionsColumn([... | import django_tables2 as tables
from fabric_bolt.core.mixins.tables import ActionsColumn, PaginateTable
from fabric_bolt.web_hooks import models
class HookTable(PaginateTable):
"""Table used to show the configurations
Also provides actions to edit and delete"""
actions = ActionsColumn([
{'titl... | import django_tables2 as tables
from fabric_bolt.core.mixins.tables import ActionsColumn, PaginateTable
from fabric_bolt.web_hooks import models
class HookTable(PaginateTable):
"""Table used to show the configurations
Also provides actions to edit and delete"""
actions = ActionsColumn([
{'titl... | <commit_before>import django_tables2 as tables
from fabric_bolt.core.mixins.tables import ActionsColumn, PaginateTable
from fabric_bolt.web_hooks import models
class HookTable(PaginateTable):
"""Table used to show the configurations
Also provides actions to edit and delete"""
actions = ActionsColumn([... |
377fa94c2963a9c2522164ff374431dbe836217e | indra/sources/rlimsp/api.py | indra/sources/rlimsp/api.py | __all__ = ['process_pmc']
import logging
import requests
from .processor import RlimspProcessor
logger = logging.getLogger(__name__)
RLIMSP_URL = 'https://research.bioinformatics.udel.edu/itextmine/api/data/rlims/pmc'
class RLIMSP_Error(Exception):
pass
def process_pmc(pmcid, with_grounding=True):
"""... | __all__ = ['process_from_webservice']
import logging
import requests
from .processor import RlimspProcessor
logger = logging.getLogger(__name__)
RLIMSP_URL = 'https://research.bioinformatics.udel.edu/itextmine/api/data/rlims/'
class RLIMSP_Error(Exception):
pass
def process_from_webservice(id_val, id_type... | Add capability to read pmids and get medline. | Add capability to read pmids and get medline.
| Python | bsd-2-clause | sorgerlab/belpy,bgyori/indra,johnbachman/belpy,johnbachman/indra,johnbachman/belpy,pvtodorov/indra,sorgerlab/belpy,sorgerlab/belpy,pvtodorov/indra,pvtodorov/indra,pvtodorov/indra,johnbachman/indra,johnbachman/belpy,sorgerlab/indra,sorgerlab/indra,sorgerlab/indra,bgyori/indra,bgyori/indra,johnbachman/indra | __all__ = ['process_pmc']
import logging
import requests
from .processor import RlimspProcessor
logger = logging.getLogger(__name__)
RLIMSP_URL = 'https://research.bioinformatics.udel.edu/itextmine/api/data/rlims/pmc'
class RLIMSP_Error(Exception):
pass
def process_pmc(pmcid, with_grounding=True):
"""... | __all__ = ['process_from_webservice']
import logging
import requests
from .processor import RlimspProcessor
logger = logging.getLogger(__name__)
RLIMSP_URL = 'https://research.bioinformatics.udel.edu/itextmine/api/data/rlims/'
class RLIMSP_Error(Exception):
pass
def process_from_webservice(id_val, id_type... | <commit_before>__all__ = ['process_pmc']
import logging
import requests
from .processor import RlimspProcessor
logger = logging.getLogger(__name__)
RLIMSP_URL = 'https://research.bioinformatics.udel.edu/itextmine/api/data/rlims/pmc'
class RLIMSP_Error(Exception):
pass
def process_pmc(pmcid, with_grounding... | __all__ = ['process_from_webservice']
import logging
import requests
from .processor import RlimspProcessor
logger = logging.getLogger(__name__)
RLIMSP_URL = 'https://research.bioinformatics.udel.edu/itextmine/api/data/rlims/'
class RLIMSP_Error(Exception):
pass
def process_from_webservice(id_val, id_type... | __all__ = ['process_pmc']
import logging
import requests
from .processor import RlimspProcessor
logger = logging.getLogger(__name__)
RLIMSP_URL = 'https://research.bioinformatics.udel.edu/itextmine/api/data/rlims/pmc'
class RLIMSP_Error(Exception):
pass
def process_pmc(pmcid, with_grounding=True):
"""... | <commit_before>__all__ = ['process_pmc']
import logging
import requests
from .processor import RlimspProcessor
logger = logging.getLogger(__name__)
RLIMSP_URL = 'https://research.bioinformatics.udel.edu/itextmine/api/data/rlims/pmc'
class RLIMSP_Error(Exception):
pass
def process_pmc(pmcid, with_grounding... |
c4a827f7ddfd6d43120253bd660e426840dc5cba | src/pdsm/utils.py | src/pdsm/utils.py | import re
def ensure_trailing_slash(mystr):
if not mystr.endswith('/'):
mystr = mystr + '/'
return mystr
def remove_trailing_slash(mystr):
if mystr.endswith('/'):
mystr = mystr[:-1]
return mystr
def split_s3_bucket_key(s3_path):
if s3_path.startswith('s3://'):
s3_path =... | import re
def ensure_trailing_slash(mystr):
if not mystr.endswith('/'):
mystr = mystr + '/'
return mystr
def remove_trailing_slash(mystr):
if mystr.endswith('/'):
mystr = mystr[:-1]
return mystr
def split_s3_bucket_key(s3_path):
if s3_path.startswith('s3://'):
s3_path =... | Use range so code works with python 3 | Use range so code works with python 3
| Python | mit | robotblake/pdsm | import re
def ensure_trailing_slash(mystr):
if not mystr.endswith('/'):
mystr = mystr + '/'
return mystr
def remove_trailing_slash(mystr):
if mystr.endswith('/'):
mystr = mystr[:-1]
return mystr
def split_s3_bucket_key(s3_path):
if s3_path.startswith('s3://'):
s3_path =... | import re
def ensure_trailing_slash(mystr):
if not mystr.endswith('/'):
mystr = mystr + '/'
return mystr
def remove_trailing_slash(mystr):
if mystr.endswith('/'):
mystr = mystr[:-1]
return mystr
def split_s3_bucket_key(s3_path):
if s3_path.startswith('s3://'):
s3_path =... | <commit_before>import re
def ensure_trailing_slash(mystr):
if not mystr.endswith('/'):
mystr = mystr + '/'
return mystr
def remove_trailing_slash(mystr):
if mystr.endswith('/'):
mystr = mystr[:-1]
return mystr
def split_s3_bucket_key(s3_path):
if s3_path.startswith('s3://'):
... | import re
def ensure_trailing_slash(mystr):
if not mystr.endswith('/'):
mystr = mystr + '/'
return mystr
def remove_trailing_slash(mystr):
if mystr.endswith('/'):
mystr = mystr[:-1]
return mystr
def split_s3_bucket_key(s3_path):
if s3_path.startswith('s3://'):
s3_path =... | import re
def ensure_trailing_slash(mystr):
if not mystr.endswith('/'):
mystr = mystr + '/'
return mystr
def remove_trailing_slash(mystr):
if mystr.endswith('/'):
mystr = mystr[:-1]
return mystr
def split_s3_bucket_key(s3_path):
if s3_path.startswith('s3://'):
s3_path =... | <commit_before>import re
def ensure_trailing_slash(mystr):
if not mystr.endswith('/'):
mystr = mystr + '/'
return mystr
def remove_trailing_slash(mystr):
if mystr.endswith('/'):
mystr = mystr[:-1]
return mystr
def split_s3_bucket_key(s3_path):
if s3_path.startswith('s3://'):
... |
c17aed93f3dd5a1a46dfb871268ebda4e56b1bee | lib/excel.py | lib/excel.py | """EcoData Retriever Excel Functions
This module contains optional functions for importing data from Excel.
"""
class Excel:
@staticmethod
def empty_cell(cell):
"""Tests whether an excel cell is empty or contains only
whitespace"""
if cell.ctype == 0:
return Tr... | """EcoData Retriever Excel Functions
This module contains optional functions for importing data from Excel.
"""
class Excel:
@staticmethod
def empty_cell(cell):
"""Tests whether an excel cell is empty or contains only
whitespace"""
if cell.ctype == 0:
return Tr... | Handle special characters in xls cell values | Handle special characters in xls cell values
| Python | mit | davharris/retriever,goelakash/retriever,embaldridge/retriever,henrykironde/deletedret,davharris/retriever,goelakash/retriever,embaldridge/retriever,davharris/retriever,henrykironde/deletedret,embaldridge/retriever | """EcoData Retriever Excel Functions
This module contains optional functions for importing data from Excel.
"""
class Excel:
@staticmethod
def empty_cell(cell):
"""Tests whether an excel cell is empty or contains only
whitespace"""
if cell.ctype == 0:
return Tr... | """EcoData Retriever Excel Functions
This module contains optional functions for importing data from Excel.
"""
class Excel:
@staticmethod
def empty_cell(cell):
"""Tests whether an excel cell is empty or contains only
whitespace"""
if cell.ctype == 0:
return Tr... | <commit_before>"""EcoData Retriever Excel Functions
This module contains optional functions for importing data from Excel.
"""
class Excel:
@staticmethod
def empty_cell(cell):
"""Tests whether an excel cell is empty or contains only
whitespace"""
if cell.ctype == 0:
... | """EcoData Retriever Excel Functions
This module contains optional functions for importing data from Excel.
"""
class Excel:
@staticmethod
def empty_cell(cell):
"""Tests whether an excel cell is empty or contains only
whitespace"""
if cell.ctype == 0:
return Tr... | """EcoData Retriever Excel Functions
This module contains optional functions for importing data from Excel.
"""
class Excel:
@staticmethod
def empty_cell(cell):
"""Tests whether an excel cell is empty or contains only
whitespace"""
if cell.ctype == 0:
return Tr... | <commit_before>"""EcoData Retriever Excel Functions
This module contains optional functions for importing data from Excel.
"""
class Excel:
@staticmethod
def empty_cell(cell):
"""Tests whether an excel cell is empty or contains only
whitespace"""
if cell.ctype == 0:
... |
b6d29826932d92662a7cd14b6f54327c9e8d4c0f | model/reporting_year.py | model/reporting_year.py | #! /usr/bin/env python2.7
import model
class ReportingYear(model.Model):
pass
ReportingYear.init_model("reporting_years", "reporting_year")
| #! /usr/bin/env python2.7
import model
class ReportingYear(model.Model):
pass
ReportingYear.init_model("reporting_years", "reporting_year_id")
| Fix a bug in the ReportingYear initialization | Fix a bug in the ReportingYear initialization
| Python | bsd-3-clause | UngaForskareStockholm/medlem2 | #! /usr/bin/env python2.7
import model
class ReportingYear(model.Model):
pass
ReportingYear.init_model("reporting_years", "reporting_year")
Fix a bug in the ReportingYear initialization | #! /usr/bin/env python2.7
import model
class ReportingYear(model.Model):
pass
ReportingYear.init_model("reporting_years", "reporting_year_id")
| <commit_before>#! /usr/bin/env python2.7
import model
class ReportingYear(model.Model):
pass
ReportingYear.init_model("reporting_years", "reporting_year")
<commit_msg>Fix a bug in the ReportingYear initialization<commit_after> | #! /usr/bin/env python2.7
import model
class ReportingYear(model.Model):
pass
ReportingYear.init_model("reporting_years", "reporting_year_id")
| #! /usr/bin/env python2.7
import model
class ReportingYear(model.Model):
pass
ReportingYear.init_model("reporting_years", "reporting_year")
Fix a bug in the ReportingYear initialization#! /usr/bin/env python2.7
import model
class ReportingYear(model.Model):
pass
ReportingYear.init_model("reporting_years", "report... | <commit_before>#! /usr/bin/env python2.7
import model
class ReportingYear(model.Model):
pass
ReportingYear.init_model("reporting_years", "reporting_year")
<commit_msg>Fix a bug in the ReportingYear initialization<commit_after>#! /usr/bin/env python2.7
import model
class ReportingYear(model.Model):
pass
ReportingY... |
f2b2927216c6392625d22fac4bcc6f9005ec51fb | landing/tests/test_views.py | landing/tests/test_views.py | from django.core.urlresolvers import resolve
from django.test import TestCase, RequestFactory
import unittest
from landing.views import LandingView
class LandingPageTests(TestCase):
def test_root_url_resolves_to_landing_page_view(self):
found = resolve('/')
self.assertEqual(found.func.__name__, La... | from django.core.urlresolvers import resolve
from django.test import TestCase, RequestFactory
import unittest
from landing.views import LandingView
class LandingPageTests(TestCase):
def test_root_url_resolves_to_landing_page_view(self):
found = resolve('/en/')
self.assertEqual(found.func.__name__,... | Make the landing page tests work again with i18n url | Make the landing page tests work again with i18n url
| Python | mit | XeryusTC/projman,XeryusTC/projman,XeryusTC/projman | from django.core.urlresolvers import resolve
from django.test import TestCase, RequestFactory
import unittest
from landing.views import LandingView
class LandingPageTests(TestCase):
def test_root_url_resolves_to_landing_page_view(self):
found = resolve('/')
self.assertEqual(found.func.__name__, La... | from django.core.urlresolvers import resolve
from django.test import TestCase, RequestFactory
import unittest
from landing.views import LandingView
class LandingPageTests(TestCase):
def test_root_url_resolves_to_landing_page_view(self):
found = resolve('/en/')
self.assertEqual(found.func.__name__,... | <commit_before>from django.core.urlresolvers import resolve
from django.test import TestCase, RequestFactory
import unittest
from landing.views import LandingView
class LandingPageTests(TestCase):
def test_root_url_resolves_to_landing_page_view(self):
found = resolve('/')
self.assertEqual(found.fu... | from django.core.urlresolvers import resolve
from django.test import TestCase, RequestFactory
import unittest
from landing.views import LandingView
class LandingPageTests(TestCase):
def test_root_url_resolves_to_landing_page_view(self):
found = resolve('/en/')
self.assertEqual(found.func.__name__,... | from django.core.urlresolvers import resolve
from django.test import TestCase, RequestFactory
import unittest
from landing.views import LandingView
class LandingPageTests(TestCase):
def test_root_url_resolves_to_landing_page_view(self):
found = resolve('/')
self.assertEqual(found.func.__name__, La... | <commit_before>from django.core.urlresolvers import resolve
from django.test import TestCase, RequestFactory
import unittest
from landing.views import LandingView
class LandingPageTests(TestCase):
def test_root_url_resolves_to_landing_page_view(self):
found = resolve('/')
self.assertEqual(found.fu... |
8eb740cf678d15b2c1c299580c1f60d37528f3be | lbrynet/__init__.py | lbrynet/__init__.py | import logging
__version__ = "0.21.0rc5"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
| import logging
__version__ = "0.21.0rc6"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
| Bump version 0.21.0rc5 --> 0.21.0rc6 | Bump version 0.21.0rc5 --> 0.21.0rc6
Signed-off-by: Jack Robison <[email protected]>
| Python | mit | lbryio/lbry,lbryio/lbry,lbryio/lbry | import logging
__version__ = "0.21.0rc5"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
Bump version 0.21.0rc5 --> 0.21.0rc6
Signed-off-by: Jack Robison <[email protected]> | import logging
__version__ = "0.21.0rc6"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
| <commit_before>import logging
__version__ = "0.21.0rc5"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
<commit_msg>Bump version 0.21.0rc5 --> 0.21.0rc6
Signed-off-by: Jack Robison <[email protected]><commit_after> | import logging
__version__ = "0.21.0rc6"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
| import logging
__version__ = "0.21.0rc5"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
Bump version 0.21.0rc5 --> 0.21.0rc6
Signed-off-by: Jack Robison <[email protected]>import logging
__version__ = "0.21.0rc6"
version = tuple(_... | <commit_before>import logging
__version__ = "0.21.0rc5"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
<commit_msg>Bump version 0.21.0rc5 --> 0.21.0rc6
Signed-off-by: Jack Robison <[email protected]><commit_after>import logging
__... |
e406def7737c3b4528ccb7345ba68ece61edcc84 | easyfuse/utils.py | easyfuse/utils.py | """
This module implements the some simple utilitiy functions.
.. :copyright: (c) 2016 by Jelte Fennema.
:license: MIT, see License for more details.
"""
from llfuse import FUSEError
from contextlib import contextmanager
import errno
import logging
@contextmanager
def _convert_error_to_fuse_error(action, thin... | """
This module implements the some simple utilitiy functions.
.. :copyright: (c) 2016 by Jelte Fennema.
:license: MIT, see License for more details.
"""
from llfuse import FUSEError
from contextlib import contextmanager
import errno
import logging
import traceback
@contextmanager
def _convert_error_to_fuse_e... | Print traceback on captured errors when loglevel is DEBUG | Print traceback on captured errors when loglevel is DEBUG
| Python | mit | JelteF/easyfuse,JelteF/easyfuse | """
This module implements the some simple utilitiy functions.
.. :copyright: (c) 2016 by Jelte Fennema.
:license: MIT, see License for more details.
"""
from llfuse import FUSEError
from contextlib import contextmanager
import errno
import logging
@contextmanager
def _convert_error_to_fuse_error(action, thin... | """
This module implements the some simple utilitiy functions.
.. :copyright: (c) 2016 by Jelte Fennema.
:license: MIT, see License for more details.
"""
from llfuse import FUSEError
from contextlib import contextmanager
import errno
import logging
import traceback
@contextmanager
def _convert_error_to_fuse_e... | <commit_before>"""
This module implements the some simple utilitiy functions.
.. :copyright: (c) 2016 by Jelte Fennema.
:license: MIT, see License for more details.
"""
from llfuse import FUSEError
from contextlib import contextmanager
import errno
import logging
@contextmanager
def _convert_error_to_fuse_err... | """
This module implements the some simple utilitiy functions.
.. :copyright: (c) 2016 by Jelte Fennema.
:license: MIT, see License for more details.
"""
from llfuse import FUSEError
from contextlib import contextmanager
import errno
import logging
import traceback
@contextmanager
def _convert_error_to_fuse_e... | """
This module implements the some simple utilitiy functions.
.. :copyright: (c) 2016 by Jelte Fennema.
:license: MIT, see License for more details.
"""
from llfuse import FUSEError
from contextlib import contextmanager
import errno
import logging
@contextmanager
def _convert_error_to_fuse_error(action, thin... | <commit_before>"""
This module implements the some simple utilitiy functions.
.. :copyright: (c) 2016 by Jelte Fennema.
:license: MIT, see License for more details.
"""
from llfuse import FUSEError
from contextlib import contextmanager
import errno
import logging
@contextmanager
def _convert_error_to_fuse_err... |
15a8d73d38a1fb254bf38bdfc0c9ebd15b1af05e | elmo/elmo/urls.py | elmo/elmo/urls.py | """elmo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based... | """elmo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based... | Repair the regex for the homepage. | Repair the regex for the homepage.
| Python | mit | StephenSwat/eve_lunar_mining_organiser,StephenSwat/eve_lunar_mining_organiser | """elmo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based... | """elmo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based... | <commit_before>"""elmo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='hom... | """elmo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based... | """elmo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based... | <commit_before>"""elmo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='hom... |
72ee9b82e9f91436aeeba144ad687435d349b85a | systempay/app.py | systempay/app.py | from django.conf.urls import patterns, url
from oscar.core.application import Application
from systempay import views
class SystemPayApplication(Application):
name = 'systempay'
secure_redirect_view = views.SecureRedirectView
place_order_view = views.PlaceOrderView
return_response_view = views.Retu... | from django.conf.urls import patterns, url
from oscar.core.application import Application
from systempay import views
class SystemPayApplication(Application):
name = 'systempay'
secure_redirect_view = views.SecureRedirectView
place_order_view = views.PlaceOrderView
return_response_view = views.Retu... | Remove ending slashes from urls | Remove ending slashes from urls
| Python | mit | bastien34/django-oscar-systempay,dulaccc/django-oscar-systempay,bastien34/django-oscar-systempay | from django.conf.urls import patterns, url
from oscar.core.application import Application
from systempay import views
class SystemPayApplication(Application):
name = 'systempay'
secure_redirect_view = views.SecureRedirectView
place_order_view = views.PlaceOrderView
return_response_view = views.Retu... | from django.conf.urls import patterns, url
from oscar.core.application import Application
from systempay import views
class SystemPayApplication(Application):
name = 'systempay'
secure_redirect_view = views.SecureRedirectView
place_order_view = views.PlaceOrderView
return_response_view = views.Retu... | <commit_before>from django.conf.urls import patterns, url
from oscar.core.application import Application
from systempay import views
class SystemPayApplication(Application):
name = 'systempay'
secure_redirect_view = views.SecureRedirectView
place_order_view = views.PlaceOrderView
return_response_vi... | from django.conf.urls import patterns, url
from oscar.core.application import Application
from systempay import views
class SystemPayApplication(Application):
name = 'systempay'
secure_redirect_view = views.SecureRedirectView
place_order_view = views.PlaceOrderView
return_response_view = views.Retu... | from django.conf.urls import patterns, url
from oscar.core.application import Application
from systempay import views
class SystemPayApplication(Application):
name = 'systempay'
secure_redirect_view = views.SecureRedirectView
place_order_view = views.PlaceOrderView
return_response_view = views.Retu... | <commit_before>from django.conf.urls import patterns, url
from oscar.core.application import Application
from systempay import views
class SystemPayApplication(Application):
name = 'systempay'
secure_redirect_view = views.SecureRedirectView
place_order_view = views.PlaceOrderView
return_response_vi... |
f992c901748787acb4f3235b46e27488967b9a60 | taptaptap/exc.py | taptaptap/exc.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
exc.py
~~~~~~
Exceptions for TAP file handling.
(c) BSD 3-clause.
"""
from __future__ import division, absolute_import
from __future__ import print_function, unicode_literals
import os
import sys
__all__ = ['TapParseError', 'TapMissingPlan',
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
exc.py
~~~~~~
Exceptions for TAP file handling.
(c) BSD 3-clause.
"""
from __future__ import division, absolute_import
from __future__ import print_function, unicode_literals
import os
import sys
__all__ = ['TapParseError', 'TapMissingPlan',
... | Use memo parameter in TapBailout.copy | [Bugfix] Use memo parameter in TapBailout.copy
| Python | bsd-3-clause | meisterluk/taptaptap,meisterluk/taptaptap | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
exc.py
~~~~~~
Exceptions for TAP file handling.
(c) BSD 3-clause.
"""
from __future__ import division, absolute_import
from __future__ import print_function, unicode_literals
import os
import sys
__all__ = ['TapParseError', 'TapMissingPlan',
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
exc.py
~~~~~~
Exceptions for TAP file handling.
(c) BSD 3-clause.
"""
from __future__ import division, absolute_import
from __future__ import print_function, unicode_literals
import os
import sys
__all__ = ['TapParseError', 'TapMissingPlan',
... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
exc.py
~~~~~~
Exceptions for TAP file handling.
(c) BSD 3-clause.
"""
from __future__ import division, absolute_import
from __future__ import print_function, unicode_literals
import os
import sys
__all__ = ['TapParseError', 'TapMissi... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
exc.py
~~~~~~
Exceptions for TAP file handling.
(c) BSD 3-clause.
"""
from __future__ import division, absolute_import
from __future__ import print_function, unicode_literals
import os
import sys
__all__ = ['TapParseError', 'TapMissingPlan',
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
exc.py
~~~~~~
Exceptions for TAP file handling.
(c) BSD 3-clause.
"""
from __future__ import division, absolute_import
from __future__ import print_function, unicode_literals
import os
import sys
__all__ = ['TapParseError', 'TapMissingPlan',
... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
exc.py
~~~~~~
Exceptions for TAP file handling.
(c) BSD 3-clause.
"""
from __future__ import division, absolute_import
from __future__ import print_function, unicode_literals
import os
import sys
__all__ = ['TapParseError', 'TapMissi... |
b874a5d3f54ef7ba71af18474a96e835d97bb846 | chat/views.py | chat/views.py | from datetime import datetime, timedelta
import jwt
import os
from django.shortcuts import render
from django.conf import settings
from django.views.generic.base import TemplateView
key = os.path.join(
os.path.dirname(__file__),
'ecc',
'key.pem',
)
with open(key, 'r') as fh:
ecc_private = fh.read()
... | from datetime import datetime, timedelta
import jwt
import os
from django.shortcuts import render
from django.conf import settings
from django.views.generic.base import TemplateView
key = os.path.join(
os.path.dirname(__file__),
'ecc',
'key.pem',
)
with open(key, 'r') as fh:
ecc_private = fh.read()
... | Use Nabu settings in token generation | Use Nabu settings in token generation
| Python | mit | Kromey/fbxnano,Kromey/fbxnano,Kromey/fbxnano,Kromey/akwriters,Kromey/akwriters,Kromey/akwriters,Kromey/fbxnano,Kromey/akwriters | from datetime import datetime, timedelta
import jwt
import os
from django.shortcuts import render
from django.conf import settings
from django.views.generic.base import TemplateView
key = os.path.join(
os.path.dirname(__file__),
'ecc',
'key.pem',
)
with open(key, 'r') as fh:
ecc_private = fh.read()
... | from datetime import datetime, timedelta
import jwt
import os
from django.shortcuts import render
from django.conf import settings
from django.views.generic.base import TemplateView
key = os.path.join(
os.path.dirname(__file__),
'ecc',
'key.pem',
)
with open(key, 'r') as fh:
ecc_private = fh.read()
... | <commit_before>from datetime import datetime, timedelta
import jwt
import os
from django.shortcuts import render
from django.conf import settings
from django.views.generic.base import TemplateView
key = os.path.join(
os.path.dirname(__file__),
'ecc',
'key.pem',
)
with open(key, 'r') as fh:
ecc_priva... | from datetime import datetime, timedelta
import jwt
import os
from django.shortcuts import render
from django.conf import settings
from django.views.generic.base import TemplateView
key = os.path.join(
os.path.dirname(__file__),
'ecc',
'key.pem',
)
with open(key, 'r') as fh:
ecc_private = fh.read()
... | from datetime import datetime, timedelta
import jwt
import os
from django.shortcuts import render
from django.conf import settings
from django.views.generic.base import TemplateView
key = os.path.join(
os.path.dirname(__file__),
'ecc',
'key.pem',
)
with open(key, 'r') as fh:
ecc_private = fh.read()
... | <commit_before>from datetime import datetime, timedelta
import jwt
import os
from django.shortcuts import render
from django.conf import settings
from django.views.generic.base import TemplateView
key = os.path.join(
os.path.dirname(__file__),
'ecc',
'key.pem',
)
with open(key, 'r') as fh:
ecc_priva... |
d8702486851c59d8b030a63aefee2b5ca152772e | test_projects/django14/pizzagigi/urls.py | test_projects/django14/pizzagigi/urls.py | from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from .views import (
PizzaCreateView, PizzaDeleteView, PizzaDetailView, PizzaListView,
PizzaUpdateView,
ChickenWingsListView
)
urlpatterns = patterns('', # NOQA
url(r'^$', PizzaListView.as_view(), name='list'),
... | from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from .views import (
PizzaCreateView, PizzaDeleteView, PizzaDetailView, PizzaListView,
PizzaUpdateView
)
urlpatterns = patterns('', # NOQA
url(r'^$', PizzaListView.as_view(), name='list'),
url(r'^create/$', Pizz... | Move chickens to other app | Move chickens to other app
| Python | bsd-3-clause | kelvinwong-ca/django-select-multiple-field,kelvinwong-ca/django-select-multiple-field,kelvinwong-ca/django-select-multiple-field | from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from .views import (
PizzaCreateView, PizzaDeleteView, PizzaDetailView, PizzaListView,
PizzaUpdateView,
ChickenWingsListView
)
urlpatterns = patterns('', # NOQA
url(r'^$', PizzaListView.as_view(), name='list'),
... | from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from .views import (
PizzaCreateView, PizzaDeleteView, PizzaDetailView, PizzaListView,
PizzaUpdateView
)
urlpatterns = patterns('', # NOQA
url(r'^$', PizzaListView.as_view(), name='list'),
url(r'^create/$', Pizz... | <commit_before>from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from .views import (
PizzaCreateView, PizzaDeleteView, PizzaDetailView, PizzaListView,
PizzaUpdateView,
ChickenWingsListView
)
urlpatterns = patterns('', # NOQA
url(r'^$', PizzaListView.as_view(),... | from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from .views import (
PizzaCreateView, PizzaDeleteView, PizzaDetailView, PizzaListView,
PizzaUpdateView
)
urlpatterns = patterns('', # NOQA
url(r'^$', PizzaListView.as_view(), name='list'),
url(r'^create/$', Pizz... | from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from .views import (
PizzaCreateView, PizzaDeleteView, PizzaDetailView, PizzaListView,
PizzaUpdateView,
ChickenWingsListView
)
urlpatterns = patterns('', # NOQA
url(r'^$', PizzaListView.as_view(), name='list'),
... | <commit_before>from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from .views import (
PizzaCreateView, PizzaDeleteView, PizzaDetailView, PizzaListView,
PizzaUpdateView,
ChickenWingsListView
)
urlpatterns = patterns('', # NOQA
url(r'^$', PizzaListView.as_view(),... |
4bd930b8bc6410a9966327c8e73e0b1849c71157 | sympy/conftest.py | sympy/conftest.py | import sys
sys._running_pytest = True
from sympy.core.cache import clear_cache
def pytest_terminal_summary(terminalreporter):
if (terminalreporter.stats.get('error', None) or
terminalreporter.stats.get('failed', None)):
terminalreporter.write_sep(' ', 'DO *NOT* COMMIT!', red=True, bold=True)
... | import sys
sys._running_pytest = True
from sympy.core.cache import clear_cache
def pytest_report_header(config):
from sympy.utilities.misc import ARCH
s = "architecture: %s\n" % ARCH
from sympy.core.cache import USE_CACHE
s += "cache: %s\n" % USE_CACHE
from sympy.polys.domains import GROUND... | Add more info to pytest header | Add more info to pytest header
| Python | bsd-3-clause | moble/sympy,ahhda/sympy,chaffra/sympy,saurabhjn76/sympy,saurabhjn76/sympy,ga7g08/sympy,AkademieOlympia/sympy,sampadsaha5/sympy,hrashk/sympy,jbbskinny/sympy,chaffra/sympy,yukoba/sympy,Designist/sympy,abhiii5459/sympy,atsao72/sympy,pandeyadarsh/sympy,kevalds51/sympy,postvakje/sympy,sahmed95/sympy,beni55/sympy,Vishluck/sy... | import sys
sys._running_pytest = True
from sympy.core.cache import clear_cache
def pytest_terminal_summary(terminalreporter):
if (terminalreporter.stats.get('error', None) or
terminalreporter.stats.get('failed', None)):
terminalreporter.write_sep(' ', 'DO *NOT* COMMIT!', red=True, bold=True)
... | import sys
sys._running_pytest = True
from sympy.core.cache import clear_cache
def pytest_report_header(config):
from sympy.utilities.misc import ARCH
s = "architecture: %s\n" % ARCH
from sympy.core.cache import USE_CACHE
s += "cache: %s\n" % USE_CACHE
from sympy.polys.domains import GROUND... | <commit_before>import sys
sys._running_pytest = True
from sympy.core.cache import clear_cache
def pytest_terminal_summary(terminalreporter):
if (terminalreporter.stats.get('error', None) or
terminalreporter.stats.get('failed', None)):
terminalreporter.write_sep(' ', 'DO *NOT* COMMIT!', red=Tru... | import sys
sys._running_pytest = True
from sympy.core.cache import clear_cache
def pytest_report_header(config):
from sympy.utilities.misc import ARCH
s = "architecture: %s\n" % ARCH
from sympy.core.cache import USE_CACHE
s += "cache: %s\n" % USE_CACHE
from sympy.polys.domains import GROUND... | import sys
sys._running_pytest = True
from sympy.core.cache import clear_cache
def pytest_terminal_summary(terminalreporter):
if (terminalreporter.stats.get('error', None) or
terminalreporter.stats.get('failed', None)):
terminalreporter.write_sep(' ', 'DO *NOT* COMMIT!', red=True, bold=True)
... | <commit_before>import sys
sys._running_pytest = True
from sympy.core.cache import clear_cache
def pytest_terminal_summary(terminalreporter):
if (terminalreporter.stats.get('error', None) or
terminalreporter.stats.get('failed', None)):
terminalreporter.write_sep(' ', 'DO *NOT* COMMIT!', red=Tru... |
f5fb36875b09926effdae46a92497d01fa04e777 | src/models/lm.py | src/models/lm.py | from keras.layers import LSTM, Input, Reshape
from keras.models import Model
from ..layers import LMMask, Projection
class LanguageModel(Model):
def __init__(self, n_batch, d_W, d_L, trainable=True):
"""
n_batch :: batch size for model application
d_L :: language model state dimension (and ou... | from keras.layers import LSTM, Input, Reshape
from keras.models import Model
from ..layers import LMMask, Projection
class LanguageModel(Model):
def __init__(self, n_batch, d_W, d_L, trainable=True):
"""
n_batch :: batch size for model application
d_L :: language model state dimension (and ou... | Use two LSTM LM’s instead of single huge one | Use two LSTM LM’s instead of single huge one | Python | mit | milankinen/c2w2c,milankinen/c2w2c | from keras.layers import LSTM, Input, Reshape
from keras.models import Model
from ..layers import LMMask, Projection
class LanguageModel(Model):
def __init__(self, n_batch, d_W, d_L, trainable=True):
"""
n_batch :: batch size for model application
d_L :: language model state dimension (and ou... | from keras.layers import LSTM, Input, Reshape
from keras.models import Model
from ..layers import LMMask, Projection
class LanguageModel(Model):
def __init__(self, n_batch, d_W, d_L, trainable=True):
"""
n_batch :: batch size for model application
d_L :: language model state dimension (and ou... | <commit_before>from keras.layers import LSTM, Input, Reshape
from keras.models import Model
from ..layers import LMMask, Projection
class LanguageModel(Model):
def __init__(self, n_batch, d_W, d_L, trainable=True):
"""
n_batch :: batch size for model application
d_L :: language model state di... | from keras.layers import LSTM, Input, Reshape
from keras.models import Model
from ..layers import LMMask, Projection
class LanguageModel(Model):
def __init__(self, n_batch, d_W, d_L, trainable=True):
"""
n_batch :: batch size for model application
d_L :: language model state dimension (and ou... | from keras.layers import LSTM, Input, Reshape
from keras.models import Model
from ..layers import LMMask, Projection
class LanguageModel(Model):
def __init__(self, n_batch, d_W, d_L, trainable=True):
"""
n_batch :: batch size for model application
d_L :: language model state dimension (and ou... | <commit_before>from keras.layers import LSTM, Input, Reshape
from keras.models import Model
from ..layers import LMMask, Projection
class LanguageModel(Model):
def __init__(self, n_batch, d_W, d_L, trainable=True):
"""
n_batch :: batch size for model application
d_L :: language model state di... |
f16ce4235e124fa9ea5d335665221514a2fcdcce | examples/cpp/clion.py | examples/cpp/clion.py | #!/usr/bin/env python3
"""This is a **proof-of-concept** CLion project generator."""
import functools
import json
import subprocess
subprocess.check_call(['cook', '--results'])
with open('results.json') as file:
content = json.load(file)
with open('CMakeLists.txt', 'w') as file:
w = functools.partial(print... | #!/usr/bin/env python3
"""This is a **proof-of-concept** CLion project generator."""
import functools
import json
import subprocess
import sys
subprocess.check_call(['cook', '--results'])
with open('results.json') as file:
content = json.load(file)
with open('CMakeLists.txt', 'w') as file:
w = functools.pa... | Add automatic regeneration for CLion | Add automatic regeneration for CLion
| Python | mit | jachris/cook | #!/usr/bin/env python3
"""This is a **proof-of-concept** CLion project generator."""
import functools
import json
import subprocess
subprocess.check_call(['cook', '--results'])
with open('results.json') as file:
content = json.load(file)
with open('CMakeLists.txt', 'w') as file:
w = functools.partial(print... | #!/usr/bin/env python3
"""This is a **proof-of-concept** CLion project generator."""
import functools
import json
import subprocess
import sys
subprocess.check_call(['cook', '--results'])
with open('results.json') as file:
content = json.load(file)
with open('CMakeLists.txt', 'w') as file:
w = functools.pa... | <commit_before>#!/usr/bin/env python3
"""This is a **proof-of-concept** CLion project generator."""
import functools
import json
import subprocess
subprocess.check_call(['cook', '--results'])
with open('results.json') as file:
content = json.load(file)
with open('CMakeLists.txt', 'w') as file:
w = functool... | #!/usr/bin/env python3
"""This is a **proof-of-concept** CLion project generator."""
import functools
import json
import subprocess
import sys
subprocess.check_call(['cook', '--results'])
with open('results.json') as file:
content = json.load(file)
with open('CMakeLists.txt', 'w') as file:
w = functools.pa... | #!/usr/bin/env python3
"""This is a **proof-of-concept** CLion project generator."""
import functools
import json
import subprocess
subprocess.check_call(['cook', '--results'])
with open('results.json') as file:
content = json.load(file)
with open('CMakeLists.txt', 'w') as file:
w = functools.partial(print... | <commit_before>#!/usr/bin/env python3
"""This is a **proof-of-concept** CLion project generator."""
import functools
import json
import subprocess
subprocess.check_call(['cook', '--results'])
with open('results.json') as file:
content = json.load(file)
with open('CMakeLists.txt', 'w') as file:
w = functool... |
c0df1342b6625cdc2a205f2ba13ee201e8d0b02a | tests/conftest.py | tests/conftest.py | from __future__ import absolute_import
import pytest
import os
import mock
import json
import app.mapping
with open(os.path.join(os.path.dirname(__file__), 'fixtures/mappings/services.json')) as f:
_services_mapping_definition = json.load(f)
@pytest.fixture(scope="function")
def services_mapping():
"""Pro... | from __future__ import absolute_import
import pytest
import os
import mock
import json
import app.mapping
with open(os.path.join(os.path.dirname(__file__), 'fixtures/mappings/services.json')) as f:
_services_mapping_definition = json.load(f)
@pytest.fixture(scope="function")
def services_mapping():
"""Pro... | Use with block to start/stop the patch context manager. | Use with block to start/stop the patch context manager.
- this is less code, hopefully is just as clear why we need to 'yield'
rather than just 'return'.
https://trello.com/c/OpWI068M/380-after-g9-go-live-removal-of-old-filters-from-search-api-mapping
| Python | mit | alphagov/digitalmarketplace-search-api,alphagov/digitalmarketplace-search-api | from __future__ import absolute_import
import pytest
import os
import mock
import json
import app.mapping
with open(os.path.join(os.path.dirname(__file__), 'fixtures/mappings/services.json')) as f:
_services_mapping_definition = json.load(f)
@pytest.fixture(scope="function")
def services_mapping():
"""Pro... | from __future__ import absolute_import
import pytest
import os
import mock
import json
import app.mapping
with open(os.path.join(os.path.dirname(__file__), 'fixtures/mappings/services.json')) as f:
_services_mapping_definition = json.load(f)
@pytest.fixture(scope="function")
def services_mapping():
"""Pro... | <commit_before>from __future__ import absolute_import
import pytest
import os
import mock
import json
import app.mapping
with open(os.path.join(os.path.dirname(__file__), 'fixtures/mappings/services.json')) as f:
_services_mapping_definition = json.load(f)
@pytest.fixture(scope="function")
def services_mappin... | from __future__ import absolute_import
import pytest
import os
import mock
import json
import app.mapping
with open(os.path.join(os.path.dirname(__file__), 'fixtures/mappings/services.json')) as f:
_services_mapping_definition = json.load(f)
@pytest.fixture(scope="function")
def services_mapping():
"""Pro... | from __future__ import absolute_import
import pytest
import os
import mock
import json
import app.mapping
with open(os.path.join(os.path.dirname(__file__), 'fixtures/mappings/services.json')) as f:
_services_mapping_definition = json.load(f)
@pytest.fixture(scope="function")
def services_mapping():
"""Pro... | <commit_before>from __future__ import absolute_import
import pytest
import os
import mock
import json
import app.mapping
with open(os.path.join(os.path.dirname(__file__), 'fixtures/mappings/services.json')) as f:
_services_mapping_definition = json.load(f)
@pytest.fixture(scope="function")
def services_mappin... |
4d3ec7b3844d770925601342b0bc4a4cd6d2c852 | flicks/videos/urls.py | flicks/videos/urls.py | from django.conf.urls.defaults import patterns, url
from flicks.videos import views
urlpatterns = patterns('',
url(r'^video/(?P<video_id>[\w]+)$', views.details,
name='flicks.videos.details'),
url(r'^add_view/?$', views.ajax_add_view,
name='flicks.videos.add_view'),
url(r'^recent/?', views... | from django.conf.urls.defaults import patterns, url
from flicks.videos import views
urlpatterns = patterns('',
url(r'^video/(?P<video_id>\d+)$', views.details,
name='flicks.videos.details'),
url(r'^add_view/?$', views.ajax_add_view,
name='flicks.videos.add_view'),
url(r'^recent/?', views.r... | Fix video id regex to use digits only. | Fix video id regex to use digits only. | Python | bsd-3-clause | mozilla/firefox-flicks,mozilla/firefox-flicks,mozilla/firefox-flicks,mozilla/firefox-flicks | from django.conf.urls.defaults import patterns, url
from flicks.videos import views
urlpatterns = patterns('',
url(r'^video/(?P<video_id>[\w]+)$', views.details,
name='flicks.videos.details'),
url(r'^add_view/?$', views.ajax_add_view,
name='flicks.videos.add_view'),
url(r'^recent/?', views... | from django.conf.urls.defaults import patterns, url
from flicks.videos import views
urlpatterns = patterns('',
url(r'^video/(?P<video_id>\d+)$', views.details,
name='flicks.videos.details'),
url(r'^add_view/?$', views.ajax_add_view,
name='flicks.videos.add_view'),
url(r'^recent/?', views.r... | <commit_before>from django.conf.urls.defaults import patterns, url
from flicks.videos import views
urlpatterns = patterns('',
url(r'^video/(?P<video_id>[\w]+)$', views.details,
name='flicks.videos.details'),
url(r'^add_view/?$', views.ajax_add_view,
name='flicks.videos.add_view'),
url(r'^r... | from django.conf.urls.defaults import patterns, url
from flicks.videos import views
urlpatterns = patterns('',
url(r'^video/(?P<video_id>\d+)$', views.details,
name='flicks.videos.details'),
url(r'^add_view/?$', views.ajax_add_view,
name='flicks.videos.add_view'),
url(r'^recent/?', views.r... | from django.conf.urls.defaults import patterns, url
from flicks.videos import views
urlpatterns = patterns('',
url(r'^video/(?P<video_id>[\w]+)$', views.details,
name='flicks.videos.details'),
url(r'^add_view/?$', views.ajax_add_view,
name='flicks.videos.add_view'),
url(r'^recent/?', views... | <commit_before>from django.conf.urls.defaults import patterns, url
from flicks.videos import views
urlpatterns = patterns('',
url(r'^video/(?P<video_id>[\w]+)$', views.details,
name='flicks.videos.details'),
url(r'^add_view/?$', views.ajax_add_view,
name='flicks.videos.add_view'),
url(r'^r... |
d613ca02bef0572d7581c843eb5466443410decf | test_settings.py | test_settings.py | import os
from django.urls import (
include,
path,
)
BASE_DIR = os.path.dirname(__file__)
STATIC_URL = "/static/"
INSTALLED_APPS = (
'gcloudc',
'djangae',
'djangae.commands', # Takes care of emulator setup
'djangae.tasks',
)
DATABASES = {
'default': {
'ENGINE': 'gcloudc.db.backe... | import os
from django.urls import (
include,
path,
)
BASE_DIR = os.path.dirname(__file__)
STATIC_URL = "/static/"
# Default Django middleware
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMid... | Set default Django middleware in test settings | Set default Django middleware in test settings
| Python | bsd-3-clause | potatolondon/djangae,potatolondon/djangae | import os
from django.urls import (
include,
path,
)
BASE_DIR = os.path.dirname(__file__)
STATIC_URL = "/static/"
INSTALLED_APPS = (
'gcloudc',
'djangae',
'djangae.commands', # Takes care of emulator setup
'djangae.tasks',
)
DATABASES = {
'default': {
'ENGINE': 'gcloudc.db.backe... | import os
from django.urls import (
include,
path,
)
BASE_DIR = os.path.dirname(__file__)
STATIC_URL = "/static/"
# Default Django middleware
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMid... | <commit_before>import os
from django.urls import (
include,
path,
)
BASE_DIR = os.path.dirname(__file__)
STATIC_URL = "/static/"
INSTALLED_APPS = (
'gcloudc',
'djangae',
'djangae.commands', # Takes care of emulator setup
'djangae.tasks',
)
DATABASES = {
'default': {
'ENGINE': 'g... | import os
from django.urls import (
include,
path,
)
BASE_DIR = os.path.dirname(__file__)
STATIC_URL = "/static/"
# Default Django middleware
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMid... | import os
from django.urls import (
include,
path,
)
BASE_DIR = os.path.dirname(__file__)
STATIC_URL = "/static/"
INSTALLED_APPS = (
'gcloudc',
'djangae',
'djangae.commands', # Takes care of emulator setup
'djangae.tasks',
)
DATABASES = {
'default': {
'ENGINE': 'gcloudc.db.backe... | <commit_before>import os
from django.urls import (
include,
path,
)
BASE_DIR = os.path.dirname(__file__)
STATIC_URL = "/static/"
INSTALLED_APPS = (
'gcloudc',
'djangae',
'djangae.commands', # Takes care of emulator setup
'djangae.tasks',
)
DATABASES = {
'default': {
'ENGINE': 'g... |
2bef67ad0a4fb0db4bdf11d24b3c63e37558e7b9 | poker/_common.py | poker/_common.py | import random
from enum import Enum
from enum34_custom import _MultiValueMeta, OrderableMixin, CaseInsensitiveMultiValueEnum
from types import DynamicClassAttribute
class _MultiMeta(_MultiValueMeta):
def make_random(cls):
return random.choice(list(cls))
class _MultiValueEnum(OrderableMixin, Enum, metacl... | import random
from enum import Enum
from enum34_custom import (
_MultiValueMeta, OrderableMixin, CaseInsensitiveMultiValueEnum, MultiValueEnum
)
from types import DynamicClassAttribute
class _RandomMultiValueMeta(_MultiValueMeta):
def make_random(cls):
return random.choice(list(cls))
class _MultiVal... | Clarify what _MultiVAlueEnum does and where it comes from. | Clarify what _MultiVAlueEnum does and where it comes from.
| Python | mit | pokerregion/poker,Seanmcn/poker,marchon/poker | import random
from enum import Enum
from enum34_custom import _MultiValueMeta, OrderableMixin, CaseInsensitiveMultiValueEnum
from types import DynamicClassAttribute
class _MultiMeta(_MultiValueMeta):
def make_random(cls):
return random.choice(list(cls))
class _MultiValueEnum(OrderableMixin, Enum, metacl... | import random
from enum import Enum
from enum34_custom import (
_MultiValueMeta, OrderableMixin, CaseInsensitiveMultiValueEnum, MultiValueEnum
)
from types import DynamicClassAttribute
class _RandomMultiValueMeta(_MultiValueMeta):
def make_random(cls):
return random.choice(list(cls))
class _MultiVal... | <commit_before>import random
from enum import Enum
from enum34_custom import _MultiValueMeta, OrderableMixin, CaseInsensitiveMultiValueEnum
from types import DynamicClassAttribute
class _MultiMeta(_MultiValueMeta):
def make_random(cls):
return random.choice(list(cls))
class _MultiValueEnum(OrderableMixi... | import random
from enum import Enum
from enum34_custom import (
_MultiValueMeta, OrderableMixin, CaseInsensitiveMultiValueEnum, MultiValueEnum
)
from types import DynamicClassAttribute
class _RandomMultiValueMeta(_MultiValueMeta):
def make_random(cls):
return random.choice(list(cls))
class _MultiVal... | import random
from enum import Enum
from enum34_custom import _MultiValueMeta, OrderableMixin, CaseInsensitiveMultiValueEnum
from types import DynamicClassAttribute
class _MultiMeta(_MultiValueMeta):
def make_random(cls):
return random.choice(list(cls))
class _MultiValueEnum(OrderableMixin, Enum, metacl... | <commit_before>import random
from enum import Enum
from enum34_custom import _MultiValueMeta, OrderableMixin, CaseInsensitiveMultiValueEnum
from types import DynamicClassAttribute
class _MultiMeta(_MultiValueMeta):
def make_random(cls):
return random.choice(list(cls))
class _MultiValueEnum(OrderableMixi... |
62a55c9e4c46aac647e0c7bc3d8143f1a6bd41ca | groups/admin.py | groups/admin.py | from django.contrib import admin
from .models import Discussion, Group
admin.site.register(Discussion)
admin.site.register(Group)
| from django.contrib import admin
from .models import Discussion, Group
class GroupAdmin(admin.ModelAdmin):
filter_horizontal = ('moderators', 'watchers', 'members_if_private')
class Meta:
model = Group
class DiscussionAdmin(admin.ModelAdmin):
filter_horizontal = ('subscribers', 'ignorers')
... | Use filter_horizontal for many-to-many fields. | Use filter_horizontal for many-to-many fields.
| Python | bsd-2-clause | incuna/incuna-groups,incuna/incuna-groups | from django.contrib import admin
from .models import Discussion, Group
admin.site.register(Discussion)
admin.site.register(Group)
Use filter_horizontal for many-to-many fields. | from django.contrib import admin
from .models import Discussion, Group
class GroupAdmin(admin.ModelAdmin):
filter_horizontal = ('moderators', 'watchers', 'members_if_private')
class Meta:
model = Group
class DiscussionAdmin(admin.ModelAdmin):
filter_horizontal = ('subscribers', 'ignorers')
... | <commit_before>from django.contrib import admin
from .models import Discussion, Group
admin.site.register(Discussion)
admin.site.register(Group)
<commit_msg>Use filter_horizontal for many-to-many fields.<commit_after> | from django.contrib import admin
from .models import Discussion, Group
class GroupAdmin(admin.ModelAdmin):
filter_horizontal = ('moderators', 'watchers', 'members_if_private')
class Meta:
model = Group
class DiscussionAdmin(admin.ModelAdmin):
filter_horizontal = ('subscribers', 'ignorers')
... | from django.contrib import admin
from .models import Discussion, Group
admin.site.register(Discussion)
admin.site.register(Group)
Use filter_horizontal for many-to-many fields.from django.contrib import admin
from .models import Discussion, Group
class GroupAdmin(admin.ModelAdmin):
filter_horizontal = ('moder... | <commit_before>from django.contrib import admin
from .models import Discussion, Group
admin.site.register(Discussion)
admin.site.register(Group)
<commit_msg>Use filter_horizontal for many-to-many fields.<commit_after>from django.contrib import admin
from .models import Discussion, Group
class GroupAdmin(admin.Mod... |
992e39a6e669fd448034fe4d844b1bcc87d75721 | comics/comics/oots.py | comics/comics/oots.py | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "The Order of the Stick"
language = "en"
url = "http://www.giantitp.com/"
start_date = "2003-09-30"
rights = "Rich Burlew"
class Crawler(Crawler... | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "The Order of the Stick"
language = "en"
url = "http://www.giantitp.com/"
start_date = "2003-09-30"
rights = "Rich Burlew"
class Crawler(Crawler... | Update "The Order of the Stick" after site change | Update "The Order of the Stick" after site change
| Python | agpl-3.0 | datagutten/comics,jodal/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 = "The Order of the Stick"
language = "en"
url = "http://www.giantitp.com/"
start_date = "2003-09-30"
rights = "Rich Burlew"
class Crawler(Crawler... | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "The Order of the Stick"
language = "en"
url = "http://www.giantitp.com/"
start_date = "2003-09-30"
rights = "Rich Burlew"
class Crawler(Crawler... | <commit_before>from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "The Order of the Stick"
language = "en"
url = "http://www.giantitp.com/"
start_date = "2003-09-30"
rights = "Rich Burlew"
class ... | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "The Order of the Stick"
language = "en"
url = "http://www.giantitp.com/"
start_date = "2003-09-30"
rights = "Rich Burlew"
class Crawler(Crawler... | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "The Order of the Stick"
language = "en"
url = "http://www.giantitp.com/"
start_date = "2003-09-30"
rights = "Rich Burlew"
class Crawler(Crawler... | <commit_before>from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "The Order of the Stick"
language = "en"
url = "http://www.giantitp.com/"
start_date = "2003-09-30"
rights = "Rich Burlew"
class ... |
030e129fd60b5ab2255b10e8115ab4e3e973ae05 | utils/gyb_syntax_support/protocolsMap.py | utils/gyb_syntax_support/protocolsMap.py | SYNTAX_BUILDABLE_EXPRESSIBLE_AS_CONFORMANCES = {
'DeclBuildable': [
'CodeBlockItem',
'MemberDeclListItem',
'SyntaxBuildable'
],
'ExprList': [
'ConditionElement',
'SyntaxBuildable'
],
'IdentifierPattern': [
'PatternBuildable'
],
'MemberDeclList'... | SYNTAX_BUILDABLE_EXPRESSIBLE_AS_CONFORMANCES = {
'AccessorList': [
'AccessorBlock'
],
'CodeBlockItemList': [
'CodeBlock'
],
'DeclBuildable': [
'CodeBlockItem',
'MemberDeclListItem',
'SyntaxBuildable'
],
'ExprList': [
'ConditionElement',
... | Add more types in protocol map | Add more types in protocol map
| Python | apache-2.0 | JGiola/swift,apple/swift,JGiola/swift,glessard/swift,apple/swift,ahoppen/swift,JGiola/swift,ahoppen/swift,ahoppen/swift,roambotics/swift,apple/swift,benlangmuir/swift,atrick/swift,atrick/swift,rudkx/swift,gregomni/swift,JGiola/swift,rudkx/swift,benlangmuir/swift,roambotics/swift,rudkx/swift,benlangmuir/swift,gregomni/s... | SYNTAX_BUILDABLE_EXPRESSIBLE_AS_CONFORMANCES = {
'DeclBuildable': [
'CodeBlockItem',
'MemberDeclListItem',
'SyntaxBuildable'
],
'ExprList': [
'ConditionElement',
'SyntaxBuildable'
],
'IdentifierPattern': [
'PatternBuildable'
],
'MemberDeclList'... | SYNTAX_BUILDABLE_EXPRESSIBLE_AS_CONFORMANCES = {
'AccessorList': [
'AccessorBlock'
],
'CodeBlockItemList': [
'CodeBlock'
],
'DeclBuildable': [
'CodeBlockItem',
'MemberDeclListItem',
'SyntaxBuildable'
],
'ExprList': [
'ConditionElement',
... | <commit_before>SYNTAX_BUILDABLE_EXPRESSIBLE_AS_CONFORMANCES = {
'DeclBuildable': [
'CodeBlockItem',
'MemberDeclListItem',
'SyntaxBuildable'
],
'ExprList': [
'ConditionElement',
'SyntaxBuildable'
],
'IdentifierPattern': [
'PatternBuildable'
],
'... | SYNTAX_BUILDABLE_EXPRESSIBLE_AS_CONFORMANCES = {
'AccessorList': [
'AccessorBlock'
],
'CodeBlockItemList': [
'CodeBlock'
],
'DeclBuildable': [
'CodeBlockItem',
'MemberDeclListItem',
'SyntaxBuildable'
],
'ExprList': [
'ConditionElement',
... | SYNTAX_BUILDABLE_EXPRESSIBLE_AS_CONFORMANCES = {
'DeclBuildable': [
'CodeBlockItem',
'MemberDeclListItem',
'SyntaxBuildable'
],
'ExprList': [
'ConditionElement',
'SyntaxBuildable'
],
'IdentifierPattern': [
'PatternBuildable'
],
'MemberDeclList'... | <commit_before>SYNTAX_BUILDABLE_EXPRESSIBLE_AS_CONFORMANCES = {
'DeclBuildable': [
'CodeBlockItem',
'MemberDeclListItem',
'SyntaxBuildable'
],
'ExprList': [
'ConditionElement',
'SyntaxBuildable'
],
'IdentifierPattern': [
'PatternBuildable'
],
'... |
0cf4aff4702ad580f9709b33c96cd115f34b028d | spacy/tests/conftest.py | spacy/tests/conftest.py | import pytest
import os
from ..en import English
from ..de import German
@pytest.fixture(scope="session")
def EN():
return English(path=False)
@pytest.fixture(scope="session")
def DE():
return German(path=False)
def pytest_addoption(parser):
parser.addoption("--models", action="store_true",
he... | import pytest
import os
from ..en import English
from ..de import German
@pytest.fixture(scope="session")
def EN():
return English()
@pytest.fixture(scope="session")
def DE():
return German()
def pytest_addoption(parser):
parser.addoption("--models", action="store_true",
help="include tests th... | Set default path in EN/DE tests. | Set default path in EN/DE tests.
| Python | mit | Gregory-Howard/spaCy,explosion/spaCy,raphael0202/spaCy,recognai/spaCy,raphael0202/spaCy,oroszgy/spaCy.hu,banglakit/spaCy,recognai/spaCy,honnibal/spaCy,recognai/spaCy,banglakit/spaCy,explosion/spaCy,aikramer2/spaCy,explosion/spaCy,explosion/spaCy,recognai/spaCy,Gregory-Howard/spaCy,banglakit/spaCy,spacy-io/spaCy,banglak... | import pytest
import os
from ..en import English
from ..de import German
@pytest.fixture(scope="session")
def EN():
return English(path=False)
@pytest.fixture(scope="session")
def DE():
return German(path=False)
def pytest_addoption(parser):
parser.addoption("--models", action="store_true",
he... | import pytest
import os
from ..en import English
from ..de import German
@pytest.fixture(scope="session")
def EN():
return English()
@pytest.fixture(scope="session")
def DE():
return German()
def pytest_addoption(parser):
parser.addoption("--models", action="store_true",
help="include tests th... | <commit_before>import pytest
import os
from ..en import English
from ..de import German
@pytest.fixture(scope="session")
def EN():
return English(path=False)
@pytest.fixture(scope="session")
def DE():
return German(path=False)
def pytest_addoption(parser):
parser.addoption("--models", action="store_tr... | import pytest
import os
from ..en import English
from ..de import German
@pytest.fixture(scope="session")
def EN():
return English()
@pytest.fixture(scope="session")
def DE():
return German()
def pytest_addoption(parser):
parser.addoption("--models", action="store_true",
help="include tests th... | import pytest
import os
from ..en import English
from ..de import German
@pytest.fixture(scope="session")
def EN():
return English(path=False)
@pytest.fixture(scope="session")
def DE():
return German(path=False)
def pytest_addoption(parser):
parser.addoption("--models", action="store_true",
he... | <commit_before>import pytest
import os
from ..en import English
from ..de import German
@pytest.fixture(scope="session")
def EN():
return English(path=False)
@pytest.fixture(scope="session")
def DE():
return German(path=False)
def pytest_addoption(parser):
parser.addoption("--models", action="store_tr... |
edbbf93222fc4061a18f81718a6a7233c6b840ec | tests/test_callbacks.py | tests/test_callbacks.py | import pytest
from aiotg import TgBot
from aiotg import MESSAGE_TYPES
API_TOKEN = "test_token"
def text_msg(text):
return {
"message_id": 0,
"from": {},
"chat": { "id": 0, "type": "private" },
"text": text
}
def test_command():
bot = TgBot(API_TOKEN)
called_with = None... | import pytest
import random
from aiotg import TgBot
from aiotg import MESSAGE_TYPES
API_TOKEN = "test_token"
bot = TgBot(API_TOKEN)
def custom_msg(msg):
template = {
"message_id": 0,
"from": {},
"chat": { "id": 0, "type": "private" }
}
template.update(msg)
return template
de... | Add test for media handlers | Add test for media handlers
| Python | mit | SijmenSchoon/aiotg,szastupov/aiotg,derfenix/aiotg | import pytest
from aiotg import TgBot
from aiotg import MESSAGE_TYPES
API_TOKEN = "test_token"
def text_msg(text):
return {
"message_id": 0,
"from": {},
"chat": { "id": 0, "type": "private" },
"text": text
}
def test_command():
bot = TgBot(API_TOKEN)
called_with = None... | import pytest
import random
from aiotg import TgBot
from aiotg import MESSAGE_TYPES
API_TOKEN = "test_token"
bot = TgBot(API_TOKEN)
def custom_msg(msg):
template = {
"message_id": 0,
"from": {},
"chat": { "id": 0, "type": "private" }
}
template.update(msg)
return template
de... | <commit_before>import pytest
from aiotg import TgBot
from aiotg import MESSAGE_TYPES
API_TOKEN = "test_token"
def text_msg(text):
return {
"message_id": 0,
"from": {},
"chat": { "id": 0, "type": "private" },
"text": text
}
def test_command():
bot = TgBot(API_TOKEN)
cal... | import pytest
import random
from aiotg import TgBot
from aiotg import MESSAGE_TYPES
API_TOKEN = "test_token"
bot = TgBot(API_TOKEN)
def custom_msg(msg):
template = {
"message_id": 0,
"from": {},
"chat": { "id": 0, "type": "private" }
}
template.update(msg)
return template
de... | import pytest
from aiotg import TgBot
from aiotg import MESSAGE_TYPES
API_TOKEN = "test_token"
def text_msg(text):
return {
"message_id": 0,
"from": {},
"chat": { "id": 0, "type": "private" },
"text": text
}
def test_command():
bot = TgBot(API_TOKEN)
called_with = None... | <commit_before>import pytest
from aiotg import TgBot
from aiotg import MESSAGE_TYPES
API_TOKEN = "test_token"
def text_msg(text):
return {
"message_id": 0,
"from": {},
"chat": { "id": 0, "type": "private" },
"text": text
}
def test_command():
bot = TgBot(API_TOKEN)
cal... |
e4c33d57ddc9743cec1c43bf0bb8d6fae185aff7 | ticketus/urls.py | ticketus/urls.py | from django.conf import settings
from django.conf.urls import patterns, include
from django.contrib import admin
urlpatterns = patterns('',
(r'^ticket/', include('ticketus.ui.urls')),
(r'^grappelli/', include('grappelli.urls')),
(r'^admin/', include(admin.site.urls)),
)
if settings.DEBUG:
import debug... | from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.views.generic.base import RedirectView
urlpatterns = patterns('',
url(r'^$', RedirectView.as_view(pattern_name='ticket_list', permanent=False)),
(r'^ticket/', include('ticketus.ui.u... | Add CBV for redirecting / to /ticket | Add CBV for redirecting / to /ticket
| Python | bsd-2-clause | sjkingo/ticketus,sjkingo/ticketus,sjkingo/ticketus,sjkingo/ticketus | from django.conf import settings
from django.conf.urls import patterns, include
from django.contrib import admin
urlpatterns = patterns('',
(r'^ticket/', include('ticketus.ui.urls')),
(r'^grappelli/', include('grappelli.urls')),
(r'^admin/', include(admin.site.urls)),
)
if settings.DEBUG:
import debug... | from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.views.generic.base import RedirectView
urlpatterns = patterns('',
url(r'^$', RedirectView.as_view(pattern_name='ticket_list', permanent=False)),
(r'^ticket/', include('ticketus.ui.u... | <commit_before>from django.conf import settings
from django.conf.urls import patterns, include
from django.contrib import admin
urlpatterns = patterns('',
(r'^ticket/', include('ticketus.ui.urls')),
(r'^grappelli/', include('grappelli.urls')),
(r'^admin/', include(admin.site.urls)),
)
if settings.DEBUG:
... | from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.views.generic.base import RedirectView
urlpatterns = patterns('',
url(r'^$', RedirectView.as_view(pattern_name='ticket_list', permanent=False)),
(r'^ticket/', include('ticketus.ui.u... | from django.conf import settings
from django.conf.urls import patterns, include
from django.contrib import admin
urlpatterns = patterns('',
(r'^ticket/', include('ticketus.ui.urls')),
(r'^grappelli/', include('grappelli.urls')),
(r'^admin/', include(admin.site.urls)),
)
if settings.DEBUG:
import debug... | <commit_before>from django.conf import settings
from django.conf.urls import patterns, include
from django.contrib import admin
urlpatterns = patterns('',
(r'^ticket/', include('ticketus.ui.urls')),
(r'^grappelli/', include('grappelli.urls')),
(r'^admin/', include(admin.site.urls)),
)
if settings.DEBUG:
... |
d13363dd2fa23abcbd23d62929a00c07eb175eb7 | tmaps/config/default.py | tmaps/config/default.py | import datetime
# Override this key with a secret one
SECRET_KEY = 'default_secret_key'
HASHIDS_SALT = 'default_secret_salt'
# This should be set to true in the production config when using NGINX
USE_X_SENDFILE = False
DEBUG = True
JWT_EXPIRATION_DELTA = datetime.timedelta(days=2)
JWT_NOT_BEFORE_DELTA = datetime.tim... | import datetime
# Override this key with a secret one
SECRET_KEY = 'default_secret_key'
HASHIDS_SALT = 'default_secret_salt'
# This should be set to true in the production config when using NGINX
USE_X_SENDFILE = False
DEBUG = True
JWT_EXPIRATION_DELTA = datetime.timedelta(days=2)
JWT_NOT_BEFORE_DELTA = datetime.tim... | Make URI the only db config entry | Make URI the only db config entry
| Python | agpl-3.0 | TissueMAPS/TmServer | import datetime
# Override this key with a secret one
SECRET_KEY = 'default_secret_key'
HASHIDS_SALT = 'default_secret_salt'
# This should be set to true in the production config when using NGINX
USE_X_SENDFILE = False
DEBUG = True
JWT_EXPIRATION_DELTA = datetime.timedelta(days=2)
JWT_NOT_BEFORE_DELTA = datetime.tim... | import datetime
# Override this key with a secret one
SECRET_KEY = 'default_secret_key'
HASHIDS_SALT = 'default_secret_salt'
# This should be set to true in the production config when using NGINX
USE_X_SENDFILE = False
DEBUG = True
JWT_EXPIRATION_DELTA = datetime.timedelta(days=2)
JWT_NOT_BEFORE_DELTA = datetime.tim... | <commit_before>import datetime
# Override this key with a secret one
SECRET_KEY = 'default_secret_key'
HASHIDS_SALT = 'default_secret_salt'
# This should be set to true in the production config when using NGINX
USE_X_SENDFILE = False
DEBUG = True
JWT_EXPIRATION_DELTA = datetime.timedelta(days=2)
JWT_NOT_BEFORE_DELTA... | import datetime
# Override this key with a secret one
SECRET_KEY = 'default_secret_key'
HASHIDS_SALT = 'default_secret_salt'
# This should be set to true in the production config when using NGINX
USE_X_SENDFILE = False
DEBUG = True
JWT_EXPIRATION_DELTA = datetime.timedelta(days=2)
JWT_NOT_BEFORE_DELTA = datetime.tim... | import datetime
# Override this key with a secret one
SECRET_KEY = 'default_secret_key'
HASHIDS_SALT = 'default_secret_salt'
# This should be set to true in the production config when using NGINX
USE_X_SENDFILE = False
DEBUG = True
JWT_EXPIRATION_DELTA = datetime.timedelta(days=2)
JWT_NOT_BEFORE_DELTA = datetime.tim... | <commit_before>import datetime
# Override this key with a secret one
SECRET_KEY = 'default_secret_key'
HASHIDS_SALT = 'default_secret_salt'
# This should be set to true in the production config when using NGINX
USE_X_SENDFILE = False
DEBUG = True
JWT_EXPIRATION_DELTA = datetime.timedelta(days=2)
JWT_NOT_BEFORE_DELTA... |
29f6a260e49a6955dd12d354400d9ee6cfd6ddc7 | tests/qtcore/qstatemachine_test.py | tests/qtcore/qstatemachine_test.py | #!/usr/bin/python
import unittest
from PySide.QtCore import QObject, QState, QFinalState, SIGNAL, QCoreApplication, QTimer, QStateMachine, QSignalTransition, QVariant, QParallelAnimationGroup, QPropertyAnimation
class QStateMachineTest(unittest.TestCase):
def cb(self, *args):
self.assertEqual(self.machine... | #!/usr/bin/python
import unittest
from PySide.QtCore import QObject, QState, QFinalState, SIGNAL, QCoreApplication, QTimer, QStateMachine, QSignalTransition, QVariant, QParallelAnimationGroup, QPropertyAnimation
from helper import UsesQCoreApplication
class QStateMachineTest(UsesQCoreApplication):
def cb(self, *... | Add UsesQCoreApplication in state machine test | Add UsesQCoreApplication in state machine test
| Python | lgpl-2.1 | M4rtinK/pyside-bb10,enthought/pyside,M4rtinK/pyside-android,PySide/PySide,IronManMark20/pyside2,PySide/PySide,M4rtinK/pyside-bb10,RobinD42/pyside,BadSingleton/pyside2,PySide/PySide,qtproject/pyside-pyside,enthought/pyside,pankajp/pyside,pankajp/pyside,M4rtinK/pyside-android,PySide/PySide,BadSingleton/pyside2,gbaty/pysi... | #!/usr/bin/python
import unittest
from PySide.QtCore import QObject, QState, QFinalState, SIGNAL, QCoreApplication, QTimer, QStateMachine, QSignalTransition, QVariant, QParallelAnimationGroup, QPropertyAnimation
class QStateMachineTest(unittest.TestCase):
def cb(self, *args):
self.assertEqual(self.machine... | #!/usr/bin/python
import unittest
from PySide.QtCore import QObject, QState, QFinalState, SIGNAL, QCoreApplication, QTimer, QStateMachine, QSignalTransition, QVariant, QParallelAnimationGroup, QPropertyAnimation
from helper import UsesQCoreApplication
class QStateMachineTest(UsesQCoreApplication):
def cb(self, *... | <commit_before>#!/usr/bin/python
import unittest
from PySide.QtCore import QObject, QState, QFinalState, SIGNAL, QCoreApplication, QTimer, QStateMachine, QSignalTransition, QVariant, QParallelAnimationGroup, QPropertyAnimation
class QStateMachineTest(unittest.TestCase):
def cb(self, *args):
self.assertEqu... | #!/usr/bin/python
import unittest
from PySide.QtCore import QObject, QState, QFinalState, SIGNAL, QCoreApplication, QTimer, QStateMachine, QSignalTransition, QVariant, QParallelAnimationGroup, QPropertyAnimation
from helper import UsesQCoreApplication
class QStateMachineTest(UsesQCoreApplication):
def cb(self, *... | #!/usr/bin/python
import unittest
from PySide.QtCore import QObject, QState, QFinalState, SIGNAL, QCoreApplication, QTimer, QStateMachine, QSignalTransition, QVariant, QParallelAnimationGroup, QPropertyAnimation
class QStateMachineTest(unittest.TestCase):
def cb(self, *args):
self.assertEqual(self.machine... | <commit_before>#!/usr/bin/python
import unittest
from PySide.QtCore import QObject, QState, QFinalState, SIGNAL, QCoreApplication, QTimer, QStateMachine, QSignalTransition, QVariant, QParallelAnimationGroup, QPropertyAnimation
class QStateMachineTest(unittest.TestCase):
def cb(self, *args):
self.assertEqu... |
5eefa21699f2dc7b75a919b5899a25ec7ef5c5b7 | tests/unit/test_adapter_session.py | tests/unit/test_adapter_session.py | import pytest
from wagtail_personalisation import adapters
from tests.factories.segment import SegmentFactory
@pytest.mark.django_db
def test_get_segments(rf, monkeypatch):
request = rf.get('/')
adapter = adapters.SessionSegmentsAdapter(request)
segment_1 = SegmentFactory(name='segment-1', persistent=T... | import pytest
from wagtail_personalisation import adapters
from tests.factories.segment import SegmentFactory
@pytest.mark.django_db
def test_get_segments(rf, monkeypatch):
request = rf.get('/')
adapter = adapters.SessionSegmentsAdapter(request)
segment_1 = SegmentFactory(name='segment-1', persistent=T... | Add test for sessionadapter.refresh when segment is disable | Add test for sessionadapter.refresh when segment is disable
| Python | mit | LabD/wagtail-personalisation,LabD/wagtail-personalisation,LabD/wagtail-personalisation | import pytest
from wagtail_personalisation import adapters
from tests.factories.segment import SegmentFactory
@pytest.mark.django_db
def test_get_segments(rf, monkeypatch):
request = rf.get('/')
adapter = adapters.SessionSegmentsAdapter(request)
segment_1 = SegmentFactory(name='segment-1', persistent=T... | import pytest
from wagtail_personalisation import adapters
from tests.factories.segment import SegmentFactory
@pytest.mark.django_db
def test_get_segments(rf, monkeypatch):
request = rf.get('/')
adapter = adapters.SessionSegmentsAdapter(request)
segment_1 = SegmentFactory(name='segment-1', persistent=T... | <commit_before>import pytest
from wagtail_personalisation import adapters
from tests.factories.segment import SegmentFactory
@pytest.mark.django_db
def test_get_segments(rf, monkeypatch):
request = rf.get('/')
adapter = adapters.SessionSegmentsAdapter(request)
segment_1 = SegmentFactory(name='segment-1... | import pytest
from wagtail_personalisation import adapters
from tests.factories.segment import SegmentFactory
@pytest.mark.django_db
def test_get_segments(rf, monkeypatch):
request = rf.get('/')
adapter = adapters.SessionSegmentsAdapter(request)
segment_1 = SegmentFactory(name='segment-1', persistent=T... | import pytest
from wagtail_personalisation import adapters
from tests.factories.segment import SegmentFactory
@pytest.mark.django_db
def test_get_segments(rf, monkeypatch):
request = rf.get('/')
adapter = adapters.SessionSegmentsAdapter(request)
segment_1 = SegmentFactory(name='segment-1', persistent=T... | <commit_before>import pytest
from wagtail_personalisation import adapters
from tests.factories.segment import SegmentFactory
@pytest.mark.django_db
def test_get_segments(rf, monkeypatch):
request = rf.get('/')
adapter = adapters.SessionSegmentsAdapter(request)
segment_1 = SegmentFactory(name='segment-1... |
5fb365333711f7e999f71d53061ae14c386e575c | src/waldur_core/core/api_groups_mapping.py | src/waldur_core/core/api_groups_mapping.py | API_GROUPS = {
'authentication': ['/api-auth/', '/api/auth-valimo/',],
'user': ['/api/users/', '/api/user-invitations/', '/api/user-counters/',],
'organization': [
'/api/customers/',
'/api/customer-permissions-log/',
'/api/customer-permissions-reviews/',
'/api/customer-permis... | API_GROUPS = {
'authentication': ['/api-auth/', '/api/auth-valimo/',],
'user': ['/api/users/', '/api/user-invitations/', '/api/user-counters/',],
'organization': [
'/api/customers/',
'/api/customer-permissions-log/',
'/api/customer-permissions-reviews/',
'/api/customer-permis... | Add accounting group to apidocs | Add accounting group to apidocs | Python | mit | opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind | API_GROUPS = {
'authentication': ['/api-auth/', '/api/auth-valimo/',],
'user': ['/api/users/', '/api/user-invitations/', '/api/user-counters/',],
'organization': [
'/api/customers/',
'/api/customer-permissions-log/',
'/api/customer-permissions-reviews/',
'/api/customer-permis... | API_GROUPS = {
'authentication': ['/api-auth/', '/api/auth-valimo/',],
'user': ['/api/users/', '/api/user-invitations/', '/api/user-counters/',],
'organization': [
'/api/customers/',
'/api/customer-permissions-log/',
'/api/customer-permissions-reviews/',
'/api/customer-permis... | <commit_before>API_GROUPS = {
'authentication': ['/api-auth/', '/api/auth-valimo/',],
'user': ['/api/users/', '/api/user-invitations/', '/api/user-counters/',],
'organization': [
'/api/customers/',
'/api/customer-permissions-log/',
'/api/customer-permissions-reviews/',
'/api/... | API_GROUPS = {
'authentication': ['/api-auth/', '/api/auth-valimo/',],
'user': ['/api/users/', '/api/user-invitations/', '/api/user-counters/',],
'organization': [
'/api/customers/',
'/api/customer-permissions-log/',
'/api/customer-permissions-reviews/',
'/api/customer-permis... | API_GROUPS = {
'authentication': ['/api-auth/', '/api/auth-valimo/',],
'user': ['/api/users/', '/api/user-invitations/', '/api/user-counters/',],
'organization': [
'/api/customers/',
'/api/customer-permissions-log/',
'/api/customer-permissions-reviews/',
'/api/customer-permis... | <commit_before>API_GROUPS = {
'authentication': ['/api-auth/', '/api/auth-valimo/',],
'user': ['/api/users/', '/api/user-invitations/', '/api/user-counters/',],
'organization': [
'/api/customers/',
'/api/customer-permissions-log/',
'/api/customer-permissions-reviews/',
'/api/... |
563645019adaf20ee66af0b4cc13e8b08bcc9d32 | lino_noi/lib/tickets/__init__.py | lino_noi/lib/tickets/__init__.py | # -*- coding: UTF-8 -*-
# Copyright 2016 Luc Saffre
# License: BSD (see file COPYING for details)
"""Fixtures specific for the Team variant of Lino Noi.
.. autosummary::
:toctree:
models
"""
from lino_xl.lib.tickets import *
class Plugin(Plugin):
"""Adds the :mod:`lino_xl.lib.votes` plugin.
"""
... | # -*- coding: UTF-8 -*-
# Copyright 2016 Luc Saffre
# License: BSD (see file COPYING for details)
"""Fixtures specific for the Team variant of Lino Noi.
.. autosummary::
:toctree:
models
"""
from lino_xl.lib.tickets import *
class Plugin(Plugin):
"""Adds the :mod:`lino_xl.lib.votes` plugin.
"""
... | Fix menu items for noi/tickets | Fix menu items for noi/tickets
| Python | bsd-2-clause | khchine5/noi,lsaffre/noi,lsaffre/noi,lino-framework/noi,lino-framework/noi,khchine5/noi,lsaffre/noi | # -*- coding: UTF-8 -*-
# Copyright 2016 Luc Saffre
# License: BSD (see file COPYING for details)
"""Fixtures specific for the Team variant of Lino Noi.
.. autosummary::
:toctree:
models
"""
from lino_xl.lib.tickets import *
class Plugin(Plugin):
"""Adds the :mod:`lino_xl.lib.votes` plugin.
"""
... | # -*- coding: UTF-8 -*-
# Copyright 2016 Luc Saffre
# License: BSD (see file COPYING for details)
"""Fixtures specific for the Team variant of Lino Noi.
.. autosummary::
:toctree:
models
"""
from lino_xl.lib.tickets import *
class Plugin(Plugin):
"""Adds the :mod:`lino_xl.lib.votes` plugin.
"""
... | <commit_before># -*- coding: UTF-8 -*-
# Copyright 2016 Luc Saffre
# License: BSD (see file COPYING for details)
"""Fixtures specific for the Team variant of Lino Noi.
.. autosummary::
:toctree:
models
"""
from lino_xl.lib.tickets import *
class Plugin(Plugin):
"""Adds the :mod:`lino_xl.lib.votes` plugi... | # -*- coding: UTF-8 -*-
# Copyright 2016 Luc Saffre
# License: BSD (see file COPYING for details)
"""Fixtures specific for the Team variant of Lino Noi.
.. autosummary::
:toctree:
models
"""
from lino_xl.lib.tickets import *
class Plugin(Plugin):
"""Adds the :mod:`lino_xl.lib.votes` plugin.
"""
... | # -*- coding: UTF-8 -*-
# Copyright 2016 Luc Saffre
# License: BSD (see file COPYING for details)
"""Fixtures specific for the Team variant of Lino Noi.
.. autosummary::
:toctree:
models
"""
from lino_xl.lib.tickets import *
class Plugin(Plugin):
"""Adds the :mod:`lino_xl.lib.votes` plugin.
"""
... | <commit_before># -*- coding: UTF-8 -*-
# Copyright 2016 Luc Saffre
# License: BSD (see file COPYING for details)
"""Fixtures specific for the Team variant of Lino Noi.
.. autosummary::
:toctree:
models
"""
from lino_xl.lib.tickets import *
class Plugin(Plugin):
"""Adds the :mod:`lino_xl.lib.votes` plugi... |
a5cd2110283ba699f36548c42b83aa86e6b50aab | configuration.py | configuration.py | # -*- coding: utf-8 -*-
"""
configuration.py
"""
from trytond.model import fields, ModelSingleton, ModelSQL, ModelView
__all__ = ['EndiciaConfiguration']
class EndiciaConfiguration(ModelSingleton, ModelSQL, ModelView):
"""
Configuration settings for Endicia.
"""
__name__ = 'endicia.configuration... | # -*- coding: utf-8 -*-
"""
configuration.py
"""
from trytond import backend
from trytond.model import fields, ModelSingleton, ModelSQL, ModelView
from trytond.transaction import Transaction
__all__ = ['EndiciaConfiguration']
class EndiciaConfiguration(ModelSingleton, ModelSQL, ModelView):
"""
Configura... | Migrate account_id from integer field to char field | Migrate account_id from integer field to char field
| Python | bsd-3-clause | priyankarani/trytond-shipping-endicia,fulfilio/trytond-shipping-endicia,prakashpp/trytond-shipping-endicia | # -*- coding: utf-8 -*-
"""
configuration.py
"""
from trytond.model import fields, ModelSingleton, ModelSQL, ModelView
__all__ = ['EndiciaConfiguration']
class EndiciaConfiguration(ModelSingleton, ModelSQL, ModelView):
"""
Configuration settings for Endicia.
"""
__name__ = 'endicia.configuration... | # -*- coding: utf-8 -*-
"""
configuration.py
"""
from trytond import backend
from trytond.model import fields, ModelSingleton, ModelSQL, ModelView
from trytond.transaction import Transaction
__all__ = ['EndiciaConfiguration']
class EndiciaConfiguration(ModelSingleton, ModelSQL, ModelView):
"""
Configura... | <commit_before># -*- coding: utf-8 -*-
"""
configuration.py
"""
from trytond.model import fields, ModelSingleton, ModelSQL, ModelView
__all__ = ['EndiciaConfiguration']
class EndiciaConfiguration(ModelSingleton, ModelSQL, ModelView):
"""
Configuration settings for Endicia.
"""
__name__ = 'endici... | # -*- coding: utf-8 -*-
"""
configuration.py
"""
from trytond import backend
from trytond.model import fields, ModelSingleton, ModelSQL, ModelView
from trytond.transaction import Transaction
__all__ = ['EndiciaConfiguration']
class EndiciaConfiguration(ModelSingleton, ModelSQL, ModelView):
"""
Configura... | # -*- coding: utf-8 -*-
"""
configuration.py
"""
from trytond.model import fields, ModelSingleton, ModelSQL, ModelView
__all__ = ['EndiciaConfiguration']
class EndiciaConfiguration(ModelSingleton, ModelSQL, ModelView):
"""
Configuration settings for Endicia.
"""
__name__ = 'endicia.configuration... | <commit_before># -*- coding: utf-8 -*-
"""
configuration.py
"""
from trytond.model import fields, ModelSingleton, ModelSQL, ModelView
__all__ = ['EndiciaConfiguration']
class EndiciaConfiguration(ModelSingleton, ModelSQL, ModelView):
"""
Configuration settings for Endicia.
"""
__name__ = 'endici... |
9d26f1d7a23e69bf7beae78674eb3ba6511e3f28 | my_app/views.py | my_app/views.py | from django.http import HttpResponse
from django.shortcuts import render
def func(request):
return HttpResponse("This is my first django project!")
def add(request):
a = request.GET['a']
b = request.GET['b']
c = int(a) + int(b)
return HttpResponse(str(c))
def index(request):
return render(... | from django.http import HttpResponse
from django.shortcuts import render
def func(request):
return HttpResponse("This is my first django project!")
def add(request):
a = request.GET['a']
b = request.GET['b']
c = int(a) + int(b)
return HttpResponse(str(c))
def index(request):
return render(... | Test Pycharm version control plugin. | Test Pycharm version control plugin.
| Python | apache-2.0 | wmh-demos/django-first-demo,wmh-demos/django-first-demo | from django.http import HttpResponse
from django.shortcuts import render
def func(request):
return HttpResponse("This is my first django project!")
def add(request):
a = request.GET['a']
b = request.GET['b']
c = int(a) + int(b)
return HttpResponse(str(c))
def index(request):
return render(... | from django.http import HttpResponse
from django.shortcuts import render
def func(request):
return HttpResponse("This is my first django project!")
def add(request):
a = request.GET['a']
b = request.GET['b']
c = int(a) + int(b)
return HttpResponse(str(c))
def index(request):
return render(... | <commit_before>from django.http import HttpResponse
from django.shortcuts import render
def func(request):
return HttpResponse("This is my first django project!")
def add(request):
a = request.GET['a']
b = request.GET['b']
c = int(a) + int(b)
return HttpResponse(str(c))
def index(request):
... | from django.http import HttpResponse
from django.shortcuts import render
def func(request):
return HttpResponse("This is my first django project!")
def add(request):
a = request.GET['a']
b = request.GET['b']
c = int(a) + int(b)
return HttpResponse(str(c))
def index(request):
return render(... | from django.http import HttpResponse
from django.shortcuts import render
def func(request):
return HttpResponse("This is my first django project!")
def add(request):
a = request.GET['a']
b = request.GET['b']
c = int(a) + int(b)
return HttpResponse(str(c))
def index(request):
return render(... | <commit_before>from django.http import HttpResponse
from django.shortcuts import render
def func(request):
return HttpResponse("This is my first django project!")
def add(request):
a = request.GET['a']
b = request.GET['b']
c = int(a) + int(b)
return HttpResponse(str(c))
def index(request):
... |
819f36493e1e0112c3bbe4f92f87f1771cc4af3f | moa/base.py | moa/base.py | '''
* when dispatching events, returning True stops it.
'''
from weakref import ref
from kivy.event import EventDispatcher
from kivy.properties import StringProperty, OptionProperty, ObjectProperty
import logging
class MoaException(Exception):
pass
class MoaBase(EventDispatcher):
named_moas = {}
''' ... | '''
* when dispatching events, returning True stops it.
'''
__all__ = ('MoaBase', )
from weakref import ref
from kivy.event import EventDispatcher
from kivy.properties import StringProperty, OptionProperty, ObjectProperty
import logging
class MoaBase(EventDispatcher):
named_moas = {}
''' A weakref.ref to ... | Remove unused moa exception class. | Remove unused moa exception class.
| Python | mit | matham/moa | '''
* when dispatching events, returning True stops it.
'''
from weakref import ref
from kivy.event import EventDispatcher
from kivy.properties import StringProperty, OptionProperty, ObjectProperty
import logging
class MoaException(Exception):
pass
class MoaBase(EventDispatcher):
named_moas = {}
''' ... | '''
* when dispatching events, returning True stops it.
'''
__all__ = ('MoaBase', )
from weakref import ref
from kivy.event import EventDispatcher
from kivy.properties import StringProperty, OptionProperty, ObjectProperty
import logging
class MoaBase(EventDispatcher):
named_moas = {}
''' A weakref.ref to ... | <commit_before>'''
* when dispatching events, returning True stops it.
'''
from weakref import ref
from kivy.event import EventDispatcher
from kivy.properties import StringProperty, OptionProperty, ObjectProperty
import logging
class MoaException(Exception):
pass
class MoaBase(EventDispatcher):
named_moa... | '''
* when dispatching events, returning True stops it.
'''
__all__ = ('MoaBase', )
from weakref import ref
from kivy.event import EventDispatcher
from kivy.properties import StringProperty, OptionProperty, ObjectProperty
import logging
class MoaBase(EventDispatcher):
named_moas = {}
''' A weakref.ref to ... | '''
* when dispatching events, returning True stops it.
'''
from weakref import ref
from kivy.event import EventDispatcher
from kivy.properties import StringProperty, OptionProperty, ObjectProperty
import logging
class MoaException(Exception):
pass
class MoaBase(EventDispatcher):
named_moas = {}
''' ... | <commit_before>'''
* when dispatching events, returning True stops it.
'''
from weakref import ref
from kivy.event import EventDispatcher
from kivy.properties import StringProperty, OptionProperty, ObjectProperty
import logging
class MoaException(Exception):
pass
class MoaBase(EventDispatcher):
named_moa... |
30bfdd3a6e31db6849f650406bc8014f836dda62 | yolk/__init__.py | yolk/__init__.py | """yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.6.2'
| """yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.7'
| Increment minor version to 0.7 | Increment minor version to 0.7
| Python | bsd-3-clause | myint/yolk,myint/yolk | """yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.6.2'
Increment minor version to 0.7 | """yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.7'
| <commit_before>"""yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.6.2'
<commit_msg>Increment minor version to 0.7<commit_after> | """yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.7'
| """yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.6.2'
Increment minor version to 0.7"""yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.7'
| <commit_before>"""yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.6.2'
<commit_msg>Increment minor version to 0.7<commit_after>"""yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.7'
|
166c002f9129c9c244532f8d490b55a884c6708b | mla_game/apps/transcript/management/commands/fake_game_one_gameplay.py | mla_game/apps/transcript/management/commands/fake_game_one_gameplay.py | import random
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from ...models import (
Transcript, TranscriptPhraseVote
)
from ...tasks import update_transcript_stats
class Command(BaseCommand):
help = 'Creates random votes for 5 phrases in a random transcript'... | import random
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from ...models import (
Transcript, TranscriptPhraseVote
)
from ...tasks import update_transcript_stats
class Command(BaseCommand):
help = 'Creates random votes for 5 phrases in a random transcript'... | Use a smaller set of users in fake game one gameplay | Use a smaller set of users in fake game one gameplay
| Python | mit | WGBH/FixIt,WGBH/FixIt,WGBH/FixIt | import random
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from ...models import (
Transcript, TranscriptPhraseVote
)
from ...tasks import update_transcript_stats
class Command(BaseCommand):
help = 'Creates random votes for 5 phrases in a random transcript'... | import random
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from ...models import (
Transcript, TranscriptPhraseVote
)
from ...tasks import update_transcript_stats
class Command(BaseCommand):
help = 'Creates random votes for 5 phrases in a random transcript'... | <commit_before>import random
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from ...models import (
Transcript, TranscriptPhraseVote
)
from ...tasks import update_transcript_stats
class Command(BaseCommand):
help = 'Creates random votes for 5 phrases in a ran... | import random
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from ...models import (
Transcript, TranscriptPhraseVote
)
from ...tasks import update_transcript_stats
class Command(BaseCommand):
help = 'Creates random votes for 5 phrases in a random transcript'... | import random
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from ...models import (
Transcript, TranscriptPhraseVote
)
from ...tasks import update_transcript_stats
class Command(BaseCommand):
help = 'Creates random votes for 5 phrases in a random transcript'... | <commit_before>import random
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from ...models import (
Transcript, TranscriptPhraseVote
)
from ...tasks import update_transcript_stats
class Command(BaseCommand):
help = 'Creates random votes for 5 phrases in a ran... |
5fb609b13cf65ef3c29502b9b406b73f03873ab0 | pathfinder/tests/BugTracker/Tests/stream-document.SF-2804823.XQUERY.py | pathfinder/tests/BugTracker/Tests/stream-document.SF-2804823.XQUERY.py | import os, sys
try:
import sybprocess
except ImportError:
# user private copy for old Python versions
import MonetDBtesting.subprocess26 as subprocess
def client(cmd, input = None):
clt = subprocess.Popen(cmd,
shell = True,
stdin = subprocess.PIPE,
... | import os, sys
try:
import sybprocess
except ImportError:
# user private copy for old Python versions
import MonetDBtesting.subprocess26 as subprocess
def client(cmd, input = None):
clt = subprocess.Popen(cmd,
stdin = subprocess.PIPE,
stdout = subpr... | Make test independent of whatever else is in the database. Also, use a different way of calling subprocess.Popen so that we can use quotes and dollars without having to do difficult cross-architectural escaping. | Make test independent of whatever else is in the database.
Also, use a different way of calling subprocess.Popen so that we can
use quotes and dollars without having to do difficult
cross-architectural escaping.
| Python | mpl-2.0 | zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb | import os, sys
try:
import sybprocess
except ImportError:
# user private copy for old Python versions
import MonetDBtesting.subprocess26 as subprocess
def client(cmd, input = None):
clt = subprocess.Popen(cmd,
shell = True,
stdin = subprocess.PIPE,
... | import os, sys
try:
import sybprocess
except ImportError:
# user private copy for old Python versions
import MonetDBtesting.subprocess26 as subprocess
def client(cmd, input = None):
clt = subprocess.Popen(cmd,
stdin = subprocess.PIPE,
stdout = subpr... | <commit_before>import os, sys
try:
import sybprocess
except ImportError:
# user private copy for old Python versions
import MonetDBtesting.subprocess26 as subprocess
def client(cmd, input = None):
clt = subprocess.Popen(cmd,
shell = True,
stdin = su... | import os, sys
try:
import sybprocess
except ImportError:
# user private copy for old Python versions
import MonetDBtesting.subprocess26 as subprocess
def client(cmd, input = None):
clt = subprocess.Popen(cmd,
stdin = subprocess.PIPE,
stdout = subpr... | import os, sys
try:
import sybprocess
except ImportError:
# user private copy for old Python versions
import MonetDBtesting.subprocess26 as subprocess
def client(cmd, input = None):
clt = subprocess.Popen(cmd,
shell = True,
stdin = subprocess.PIPE,
... | <commit_before>import os, sys
try:
import sybprocess
except ImportError:
# user private copy for old Python versions
import MonetDBtesting.subprocess26 as subprocess
def client(cmd, input = None):
clt = subprocess.Popen(cmd,
shell = True,
stdin = su... |
65ecd11b4d4689108eabd464377afdb20ff95240 | rest_framework_simplejwt/utils.py | rest_framework_simplejwt/utils.py | from __future__ import unicode_literals
from calendar import timegm
from datetime import datetime
from django.conf import settings
from django.utils import six
from django.utils.functional import lazy
from django.utils.timezone import is_aware, make_aware, utc
def make_utc(dt):
if settings.USE_TZ and not is_awa... | from __future__ import unicode_literals
from calendar import timegm
from datetime import datetime
from django.conf import settings
from django.utils import six
from django.utils.functional import lazy
from django.utils.timezone import is_naive, make_aware, utc
def make_utc(dt):
if settings.USE_TZ and is_naive(d... | Use is_naive here for clarity | Use is_naive here for clarity
| Python | mit | davesque/django-rest-framework-simplejwt,davesque/django-rest-framework-simplejwt | from __future__ import unicode_literals
from calendar import timegm
from datetime import datetime
from django.conf import settings
from django.utils import six
from django.utils.functional import lazy
from django.utils.timezone import is_aware, make_aware, utc
def make_utc(dt):
if settings.USE_TZ and not is_awa... | from __future__ import unicode_literals
from calendar import timegm
from datetime import datetime
from django.conf import settings
from django.utils import six
from django.utils.functional import lazy
from django.utils.timezone import is_naive, make_aware, utc
def make_utc(dt):
if settings.USE_TZ and is_naive(d... | <commit_before>from __future__ import unicode_literals
from calendar import timegm
from datetime import datetime
from django.conf import settings
from django.utils import six
from django.utils.functional import lazy
from django.utils.timezone import is_aware, make_aware, utc
def make_utc(dt):
if settings.USE_TZ... | from __future__ import unicode_literals
from calendar import timegm
from datetime import datetime
from django.conf import settings
from django.utils import six
from django.utils.functional import lazy
from django.utils.timezone import is_naive, make_aware, utc
def make_utc(dt):
if settings.USE_TZ and is_naive(d... | from __future__ import unicode_literals
from calendar import timegm
from datetime import datetime
from django.conf import settings
from django.utils import six
from django.utils.functional import lazy
from django.utils.timezone import is_aware, make_aware, utc
def make_utc(dt):
if settings.USE_TZ and not is_awa... | <commit_before>from __future__ import unicode_literals
from calendar import timegm
from datetime import datetime
from django.conf import settings
from django.utils import six
from django.utils.functional import lazy
from django.utils.timezone import is_aware, make_aware, utc
def make_utc(dt):
if settings.USE_TZ... |
eb33d70bfda4857fbd76616cf3bf7fb7d7feec71 | spoj/00005/palin.py | spoj/00005/palin.py | #!/usr/bin/env python3
def next_palindrome(k):
palin = list(k)
n = len(k)
mid = n // 2
# case 1: forward right
just_copy = False
for i in range(mid, n):
mirrored = n - 1 - i
if k[i] < k[mirrored]:
just_copy = True
if just_copy:
palin[i] = palin[mirrored]
# case 2: backward left
if not just_copy:... | #!/usr/bin/env python3
def next_palindrome(k):
palin = list(k)
n = len(k)
mid = n // 2
# case 1: forward right
just_copy = False
for i in range(mid, n):
mirrored = n - 1 - i
if k[i] < k[mirrored]:
just_copy = True
if just_copy:
palin[i] = palin[mirrored]
# case 2: backward left
if not just_copy:... | Fix bug in ranges (to middle) | Fix bug in ranges (to middle)
- in SPOJ palin
Signed-off-by: Karel Ha <[email protected]>
| Python | mit | mathemage/CompetitiveProgramming,mathemage/CompetitiveProgramming,mathemage/CompetitiveProgramming,mathemage/CompetitiveProgramming,mathemage/CompetitiveProgramming,mathemage/CompetitiveProgramming | #!/usr/bin/env python3
def next_palindrome(k):
palin = list(k)
n = len(k)
mid = n // 2
# case 1: forward right
just_copy = False
for i in range(mid, n):
mirrored = n - 1 - i
if k[i] < k[mirrored]:
just_copy = True
if just_copy:
palin[i] = palin[mirrored]
# case 2: backward left
if not just_copy:... | #!/usr/bin/env python3
def next_palindrome(k):
palin = list(k)
n = len(k)
mid = n // 2
# case 1: forward right
just_copy = False
for i in range(mid, n):
mirrored = n - 1 - i
if k[i] < k[mirrored]:
just_copy = True
if just_copy:
palin[i] = palin[mirrored]
# case 2: backward left
if not just_copy:... | <commit_before>#!/usr/bin/env python3
def next_palindrome(k):
palin = list(k)
n = len(k)
mid = n // 2
# case 1: forward right
just_copy = False
for i in range(mid, n):
mirrored = n - 1 - i
if k[i] < k[mirrored]:
just_copy = True
if just_copy:
palin[i] = palin[mirrored]
# case 2: backward left
if... | #!/usr/bin/env python3
def next_palindrome(k):
palin = list(k)
n = len(k)
mid = n // 2
# case 1: forward right
just_copy = False
for i in range(mid, n):
mirrored = n - 1 - i
if k[i] < k[mirrored]:
just_copy = True
if just_copy:
palin[i] = palin[mirrored]
# case 2: backward left
if not just_copy:... | #!/usr/bin/env python3
def next_palindrome(k):
palin = list(k)
n = len(k)
mid = n // 2
# case 1: forward right
just_copy = False
for i in range(mid, n):
mirrored = n - 1 - i
if k[i] < k[mirrored]:
just_copy = True
if just_copy:
palin[i] = palin[mirrored]
# case 2: backward left
if not just_copy:... | <commit_before>#!/usr/bin/env python3
def next_palindrome(k):
palin = list(k)
n = len(k)
mid = n // 2
# case 1: forward right
just_copy = False
for i in range(mid, n):
mirrored = n - 1 - i
if k[i] < k[mirrored]:
just_copy = True
if just_copy:
palin[i] = palin[mirrored]
# case 2: backward left
if... |
b87ebdd208e365d135ba2e9d9c96d9e94b8caf8e | py/g1/http/servers/setup.py | py/g1/http/servers/setup.py | from setuptools import setup
setup(
name = 'g1.http.servers',
packages = [
'g1.http.servers',
],
install_requires = [
'g1.bases',
'g1.asyncs.kernels',
'g1.asyncs.servers',
'g1.networks.servers',
],
extras_require = {
'parts': [
'g1.app... | from setuptools import setup
setup(
name = 'g1.http.servers',
packages = [
'g1.http.servers',
],
install_requires = [
'g1.asyncs.kernels',
'g1.asyncs.servers',
'g1.bases',
'g1.networks.servers',
],
extras_require = {
'parts': [
'g1.app... | Fix import not ordered alphabetically | Fix import not ordered alphabetically
| Python | mit | clchiou/garage,clchiou/garage,clchiou/garage,clchiou/garage | from setuptools import setup
setup(
name = 'g1.http.servers',
packages = [
'g1.http.servers',
],
install_requires = [
'g1.bases',
'g1.asyncs.kernels',
'g1.asyncs.servers',
'g1.networks.servers',
],
extras_require = {
'parts': [
'g1.app... | from setuptools import setup
setup(
name = 'g1.http.servers',
packages = [
'g1.http.servers',
],
install_requires = [
'g1.asyncs.kernels',
'g1.asyncs.servers',
'g1.bases',
'g1.networks.servers',
],
extras_require = {
'parts': [
'g1.app... | <commit_before>from setuptools import setup
setup(
name = 'g1.http.servers',
packages = [
'g1.http.servers',
],
install_requires = [
'g1.bases',
'g1.asyncs.kernels',
'g1.asyncs.servers',
'g1.networks.servers',
],
extras_require = {
'parts': [
... | from setuptools import setup
setup(
name = 'g1.http.servers',
packages = [
'g1.http.servers',
],
install_requires = [
'g1.asyncs.kernels',
'g1.asyncs.servers',
'g1.bases',
'g1.networks.servers',
],
extras_require = {
'parts': [
'g1.app... | from setuptools import setup
setup(
name = 'g1.http.servers',
packages = [
'g1.http.servers',
],
install_requires = [
'g1.bases',
'g1.asyncs.kernels',
'g1.asyncs.servers',
'g1.networks.servers',
],
extras_require = {
'parts': [
'g1.app... | <commit_before>from setuptools import setup
setup(
name = 'g1.http.servers',
packages = [
'g1.http.servers',
],
install_requires = [
'g1.bases',
'g1.asyncs.kernels',
'g1.asyncs.servers',
'g1.networks.servers',
],
extras_require = {
'parts': [
... |
e43596395507c4606909087c0e77e84c1a232811 | damn/__init__.py | damn/__init__.py | """
**damn** (aka *digital audio for music nerds*) is an easy-to-use python package
for digital audio signal processing, analysis and synthesis.
"""
__version__ = '0.0.0'
| """
**damn** (aka *digital audio for music nerds*) is an easy-to-use python package
for digital audio signal processing, analysis and synthesis.
"""
__author__ = 'Romain Clement'
__copyright__ = 'Copyright 2014, Romain Clement'
__credits__ = []
__license__ = 'MIT'
__version__ = "0.0.0"
__maintainer__ = 'Romain Clement... | Add meta information for damn package | [DEV] Add meta information for damn package
| Python | mit | rclement/yodel,rclement/yodel | """
**damn** (aka *digital audio for music nerds*) is an easy-to-use python package
for digital audio signal processing, analysis and synthesis.
"""
__version__ = '0.0.0'
[DEV] Add meta information for damn package | """
**damn** (aka *digital audio for music nerds*) is an easy-to-use python package
for digital audio signal processing, analysis and synthesis.
"""
__author__ = 'Romain Clement'
__copyright__ = 'Copyright 2014, Romain Clement'
__credits__ = []
__license__ = 'MIT'
__version__ = "0.0.0"
__maintainer__ = 'Romain Clement... | <commit_before>"""
**damn** (aka *digital audio for music nerds*) is an easy-to-use python package
for digital audio signal processing, analysis and synthesis.
"""
__version__ = '0.0.0'
<commit_msg>[DEV] Add meta information for damn package<commit_after> | """
**damn** (aka *digital audio for music nerds*) is an easy-to-use python package
for digital audio signal processing, analysis and synthesis.
"""
__author__ = 'Romain Clement'
__copyright__ = 'Copyright 2014, Romain Clement'
__credits__ = []
__license__ = 'MIT'
__version__ = "0.0.0"
__maintainer__ = 'Romain Clement... | """
**damn** (aka *digital audio for music nerds*) is an easy-to-use python package
for digital audio signal processing, analysis and synthesis.
"""
__version__ = '0.0.0'
[DEV] Add meta information for damn package"""
**damn** (aka *digital audio for music nerds*) is an easy-to-use python package
for digital audio sig... | <commit_before>"""
**damn** (aka *digital audio for music nerds*) is an easy-to-use python package
for digital audio signal processing, analysis and synthesis.
"""
__version__ = '0.0.0'
<commit_msg>[DEV] Add meta information for damn package<commit_after>"""
**damn** (aka *digital audio for music nerds*) is an easy-to... |
7c4a8d1249becb11727002c4eb2cd2f58c712244 | zou/app/utils/emails.py | zou/app/utils/emails.py | from flask_mail import Message
from zou.app import mail, app
def send_email(subject, body, recipient_email, html=None):
"""
Send an email with given subject and body to given recipient.
"""
if html is None:
html = body
with app.app_context():
message = Message(
sender=... | from flask_mail import Message
from zou.app import mail, app
def send_email(subject, body, recipient_email, html=None):
"""
Send an email with given subject and body to given recipient.
"""
if html is None:
html = body
with app.app_context():
mail_default_sender = app.config["MAIL... | Fix configuration of email default sender | Fix configuration of email default sender
| Python | agpl-3.0 | cgwire/zou | from flask_mail import Message
from zou.app import mail, app
def send_email(subject, body, recipient_email, html=None):
"""
Send an email with given subject and body to given recipient.
"""
if html is None:
html = body
with app.app_context():
message = Message(
sender=... | from flask_mail import Message
from zou.app import mail, app
def send_email(subject, body, recipient_email, html=None):
"""
Send an email with given subject and body to given recipient.
"""
if html is None:
html = body
with app.app_context():
mail_default_sender = app.config["MAIL... | <commit_before>from flask_mail import Message
from zou.app import mail, app
def send_email(subject, body, recipient_email, html=None):
"""
Send an email with given subject and body to given recipient.
"""
if html is None:
html = body
with app.app_context():
message = Message(
... | from flask_mail import Message
from zou.app import mail, app
def send_email(subject, body, recipient_email, html=None):
"""
Send an email with given subject and body to given recipient.
"""
if html is None:
html = body
with app.app_context():
mail_default_sender = app.config["MAIL... | from flask_mail import Message
from zou.app import mail, app
def send_email(subject, body, recipient_email, html=None):
"""
Send an email with given subject and body to given recipient.
"""
if html is None:
html = body
with app.app_context():
message = Message(
sender=... | <commit_before>from flask_mail import Message
from zou.app import mail, app
def send_email(subject, body, recipient_email, html=None):
"""
Send an email with given subject and body to given recipient.
"""
if html is None:
html = body
with app.app_context():
message = Message(
... |
bcc0fbf9d8dd75b776c6a2137975912bcd0831d5 | third_party/__init__.py | third_party/__init__.py | import os.path
import sys
# This bit of evil should inject third_party into the path for relative imports.
sys.path.append(os.path.dirname(__file__))
| import os.path
import sys
# This bit of evil should inject third_party into the path for relative imports.
sys.path.insert(1, os.path.dirname(__file__))
| Insert third_party into the second slot of sys.path rather than the last slot | Insert third_party into the second slot of sys.path rather than the last slot | Python | apache-2.0 | nishad/namebench,jimb0616/namebench,cah0211/namebench,iamang/namebench,tcffisher/namebench,HerlonNascimento/namebench,RomanHargrave/namebench,tectronics/namebench,llaera/namebench,renatogames2/namebench,bluemask2001/namebench,Bandito43/namebench,ran0101/namebench,cloudcache/namebench,deepak5/namebench,thanhuwng/nameben... | import os.path
import sys
# This bit of evil should inject third_party into the path for relative imports.
sys.path.append(os.path.dirname(__file__))
Insert third_party into the second slot of sys.path rather than the last slot | import os.path
import sys
# This bit of evil should inject third_party into the path for relative imports.
sys.path.insert(1, os.path.dirname(__file__))
| <commit_before>import os.path
import sys
# This bit of evil should inject third_party into the path for relative imports.
sys.path.append(os.path.dirname(__file__))
<commit_msg>Insert third_party into the second slot of sys.path rather than the last slot<commit_after> | import os.path
import sys
# This bit of evil should inject third_party into the path for relative imports.
sys.path.insert(1, os.path.dirname(__file__))
| import os.path
import sys
# This bit of evil should inject third_party into the path for relative imports.
sys.path.append(os.path.dirname(__file__))
Insert third_party into the second slot of sys.path rather than the last slotimport os.path
import sys
# This bit of evil should inject third_party into the path for re... | <commit_before>import os.path
import sys
# This bit of evil should inject third_party into the path for relative imports.
sys.path.append(os.path.dirname(__file__))
<commit_msg>Insert third_party into the second slot of sys.path rather than the last slot<commit_after>import os.path
import sys
# This bit of evil shoul... |
a5cc18bab108f83ab45073272fa467fc62a2649b | run_python_tests.py | run_python_tests.py | #!/usr/bin/python
import os
import optparse
import sys
import unittest
USAGE = """%prog SDK_PATH TEST_PATH
Run unit tests for App Engine apps.
SDK_PATH Path to the SDK installation.
TEST_PATH Path to package containing test modules.
WEBTEST_PATH Path to the webtest library."""
def main(sdk_path, test_path, ... | #!/usr/bin/python
import os
import optparse
import sys
import unittest
USAGE = """%prog SDK_PATH TEST_PATH
Run unit tests for App Engine apps.
SDK_PATH Path to the SDK installation.
TEST_PATH Path to package containing test modules.
WEBTEST_PATH Path to the webtest library."""
def main(sdk_path, test_path, ... | Revert "Python tests now return an error code on fail." | Revert "Python tests now return an error code on fail."
| Python | bsd-3-clause | pquochoang/samples,jiayliu/apprtc,todotobe1/apprtc,jan-ivar/adapter,82488059/apprtc,shelsonjava/apprtc,procandi/apprtc,4lejandrito/adapter,overtakermtg/samples,mvenkatesh431/samples,JiYou/apprtc,martin7890/samples,Zauberstuhl/adapter,TribeMedia/samples,jiayliu/apprtc,bpyoung92/apprtc,aadebuger/docker-apprtc,xdumaine/ad... | #!/usr/bin/python
import os
import optparse
import sys
import unittest
USAGE = """%prog SDK_PATH TEST_PATH
Run unit tests for App Engine apps.
SDK_PATH Path to the SDK installation.
TEST_PATH Path to package containing test modules.
WEBTEST_PATH Path to the webtest library."""
def main(sdk_path, test_path, ... | #!/usr/bin/python
import os
import optparse
import sys
import unittest
USAGE = """%prog SDK_PATH TEST_PATH
Run unit tests for App Engine apps.
SDK_PATH Path to the SDK installation.
TEST_PATH Path to package containing test modules.
WEBTEST_PATH Path to the webtest library."""
def main(sdk_path, test_path, ... | <commit_before>#!/usr/bin/python
import os
import optparse
import sys
import unittest
USAGE = """%prog SDK_PATH TEST_PATH
Run unit tests for App Engine apps.
SDK_PATH Path to the SDK installation.
TEST_PATH Path to package containing test modules.
WEBTEST_PATH Path to the webtest library."""
def main(sdk_pa... | #!/usr/bin/python
import os
import optparse
import sys
import unittest
USAGE = """%prog SDK_PATH TEST_PATH
Run unit tests for App Engine apps.
SDK_PATH Path to the SDK installation.
TEST_PATH Path to package containing test modules.
WEBTEST_PATH Path to the webtest library."""
def main(sdk_path, test_path, ... | #!/usr/bin/python
import os
import optparse
import sys
import unittest
USAGE = """%prog SDK_PATH TEST_PATH
Run unit tests for App Engine apps.
SDK_PATH Path to the SDK installation.
TEST_PATH Path to package containing test modules.
WEBTEST_PATH Path to the webtest library."""
def main(sdk_path, test_path, ... | <commit_before>#!/usr/bin/python
import os
import optparse
import sys
import unittest
USAGE = """%prog SDK_PATH TEST_PATH
Run unit tests for App Engine apps.
SDK_PATH Path to the SDK installation.
TEST_PATH Path to package containing test modules.
WEBTEST_PATH Path to the webtest library."""
def main(sdk_pa... |
4e882ef7025581014520311734e0b6d626f3fd8d | impactstoryanalytics/highcharts.py | impactstoryanalytics/highcharts.py | boilerplate = {
'chart': {
'renderTo': 'container',
'plotBackgroundColor': 'none',
'backgroundColor'': 'none',
},
'title': {'text': 'null'}
'subtitle': {'text': 'null'}
'credits': {
'enabled': False
},
'plotOptions': {
'series': {
'marker':... | boilerplate = {
'chart': {
'renderTo': 'container',
'plotBackgroundColor': 'none',
'backgroundColor': 'none',
},
'title': {'text': 'null'},
'subtitle': {'text': 'null'},
'credits': {
'enabled': False
},
'plotOptions': {
'series': {
'marker'... | Fix bugs in new Highcharts options | Fix bugs in new Highcharts options
| Python | mit | total-impact/impactstory-analytics,Impactstory/impactstory-analytics,Impactstory/impactstory-analytics,Impactstory/impactstory-analytics,Impactstory/impactstory-analytics,total-impact/impactstory-analytics,total-impact/impactstory-analytics,total-impact/impactstory-analytics | boilerplate = {
'chart': {
'renderTo': 'container',
'plotBackgroundColor': 'none',
'backgroundColor'': 'none',
},
'title': {'text': 'null'}
'subtitle': {'text': 'null'}
'credits': {
'enabled': False
},
'plotOptions': {
'series': {
'marker':... | boilerplate = {
'chart': {
'renderTo': 'container',
'plotBackgroundColor': 'none',
'backgroundColor': 'none',
},
'title': {'text': 'null'},
'subtitle': {'text': 'null'},
'credits': {
'enabled': False
},
'plotOptions': {
'series': {
'marker'... | <commit_before>boilerplate = {
'chart': {
'renderTo': 'container',
'plotBackgroundColor': 'none',
'backgroundColor'': 'none',
},
'title': {'text': 'null'}
'subtitle': {'text': 'null'}
'credits': {
'enabled': False
},
'plotOptions': {
'series': {
... | boilerplate = {
'chart': {
'renderTo': 'container',
'plotBackgroundColor': 'none',
'backgroundColor': 'none',
},
'title': {'text': 'null'},
'subtitle': {'text': 'null'},
'credits': {
'enabled': False
},
'plotOptions': {
'series': {
'marker'... | boilerplate = {
'chart': {
'renderTo': 'container',
'plotBackgroundColor': 'none',
'backgroundColor'': 'none',
},
'title': {'text': 'null'}
'subtitle': {'text': 'null'}
'credits': {
'enabled': False
},
'plotOptions': {
'series': {
'marker':... | <commit_before>boilerplate = {
'chart': {
'renderTo': 'container',
'plotBackgroundColor': 'none',
'backgroundColor'': 'none',
},
'title': {'text': 'null'}
'subtitle': {'text': 'null'}
'credits': {
'enabled': False
},
'plotOptions': {
'series': {
... |
6cacf9c97e485308b95ad9a075aa5caf67f2b574 | pi_lapse.py | pi_lapse.py | import subprocess
from datetime import datetime, timedelta
frame_counter = 1
# Time in seconds
# 1 Hour = 3600
# 1 Day = 86400
# Time between each photo (seconds)
time_between_frames = 3
# Duration of Time Lapse (seconds)
duration = 86400
# Image Dimensions (pixels)
image_height = 972
image_width = 1296
total_fra... | import subprocess
from datetime import datetime, timedelta
frame_counter = 1
# Time in seconds
# 1 Hour = 3600
# 1 Day = 86400
# Time between each photo (seconds)
time_between_frames = 60
# Duration of Time Lapse (seconds)
duration = 86400
# Image Dimensions (pixels)
image_height = 972
image_width = 1296
total_fr... | Change default time between images | Change default time between images
| Python | mit | tiimgreen/pi_lapse | import subprocess
from datetime import datetime, timedelta
frame_counter = 1
# Time in seconds
# 1 Hour = 3600
# 1 Day = 86400
# Time between each photo (seconds)
time_between_frames = 3
# Duration of Time Lapse (seconds)
duration = 86400
# Image Dimensions (pixels)
image_height = 972
image_width = 1296
total_fra... | import subprocess
from datetime import datetime, timedelta
frame_counter = 1
# Time in seconds
# 1 Hour = 3600
# 1 Day = 86400
# Time between each photo (seconds)
time_between_frames = 60
# Duration of Time Lapse (seconds)
duration = 86400
# Image Dimensions (pixels)
image_height = 972
image_width = 1296
total_fr... | <commit_before>import subprocess
from datetime import datetime, timedelta
frame_counter = 1
# Time in seconds
# 1 Hour = 3600
# 1 Day = 86400
# Time between each photo (seconds)
time_between_frames = 3
# Duration of Time Lapse (seconds)
duration = 86400
# Image Dimensions (pixels)
image_height = 972
image_width = ... | import subprocess
from datetime import datetime, timedelta
frame_counter = 1
# Time in seconds
# 1 Hour = 3600
# 1 Day = 86400
# Time between each photo (seconds)
time_between_frames = 60
# Duration of Time Lapse (seconds)
duration = 86400
# Image Dimensions (pixels)
image_height = 972
image_width = 1296
total_fr... | import subprocess
from datetime import datetime, timedelta
frame_counter = 1
# Time in seconds
# 1 Hour = 3600
# 1 Day = 86400
# Time between each photo (seconds)
time_between_frames = 3
# Duration of Time Lapse (seconds)
duration = 86400
# Image Dimensions (pixels)
image_height = 972
image_width = 1296
total_fra... | <commit_before>import subprocess
from datetime import datetime, timedelta
frame_counter = 1
# Time in seconds
# 1 Hour = 3600
# 1 Day = 86400
# Time between each photo (seconds)
time_between_frames = 3
# Duration of Time Lapse (seconds)
duration = 86400
# Image Dimensions (pixels)
image_height = 972
image_width = ... |
49e95022577eb40bcf9e1d1c9f95be7269fd0e3b | scripts/update_acq_stats.py | scripts/update_acq_stats.py | #!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from mica.stats import update_acq_stats
update_acq_stats.main()
import os
table_file = mica.stats.acq_stats.table_file
file_stat = os.stat(table_file)
if file_stat.st_size > 50e6:
print("""
Warning: {tfile} is larger than 50MB a... | #!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
from mica.stats import update_acq_stats
import mica.stats.acq_stats
update_acq_stats.main()
table_file = mica.stats.acq_stats.TABLE_FILE
file_stat = os.stat(table_file)
if file_stat.st_size > 50e6:
print("""
Warning: {... | Fix reference to acq table file in script | Fix reference to acq table file in script
| Python | bsd-3-clause | sot/mica,sot/mica | #!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from mica.stats import update_acq_stats
update_acq_stats.main()
import os
table_file = mica.stats.acq_stats.table_file
file_stat = os.stat(table_file)
if file_stat.st_size > 50e6:
print("""
Warning: {tfile} is larger than 50MB a... | #!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
from mica.stats import update_acq_stats
import mica.stats.acq_stats
update_acq_stats.main()
table_file = mica.stats.acq_stats.TABLE_FILE
file_stat = os.stat(table_file)
if file_stat.st_size > 50e6:
print("""
Warning: {... | <commit_before>#!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from mica.stats import update_acq_stats
update_acq_stats.main()
import os
table_file = mica.stats.acq_stats.table_file
file_stat = os.stat(table_file)
if file_stat.st_size > 50e6:
print("""
Warning: {tfile} is lar... | #!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
from mica.stats import update_acq_stats
import mica.stats.acq_stats
update_acq_stats.main()
table_file = mica.stats.acq_stats.TABLE_FILE
file_stat = os.stat(table_file)
if file_stat.st_size > 50e6:
print("""
Warning: {... | #!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from mica.stats import update_acq_stats
update_acq_stats.main()
import os
table_file = mica.stats.acq_stats.table_file
file_stat = os.stat(table_file)
if file_stat.st_size > 50e6:
print("""
Warning: {tfile} is larger than 50MB a... | <commit_before>#!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from mica.stats import update_acq_stats
update_acq_stats.main()
import os
table_file = mica.stats.acq_stats.table_file
file_stat = os.stat(table_file)
if file_stat.st_size > 50e6:
print("""
Warning: {tfile} is lar... |
8a6144fc3918856cb2259f65f9ee5cc9cfaf1fdc | locustfile.py | locustfile.py | from locust import HttpLocust, TaskSet, task
class UserBehavior(TaskSet):
tasks = []
def on_start(self):
pass
@task
def index(self):
self.client.get("/")
@task
def move_map(self):
self.client.get("")
@task
def select_scene(self):
# Get url
... | from locust import HttpLocust, TaskSet, task
from bs4 import BeautifulSoup
from requests import Session
import random
class UserBehavior(TaskSet):
def on_start(self):
pass
@task
def index(self):
self.client.get("/")
@task
def move_map(self):
lat = random.uniform(-1, 1)
... | Add random functionality to map move. | Add random functionality to map move.
| Python | mit | recombinators/snapsat,recombinators/snapsat,recombinators/snapsat | from locust import HttpLocust, TaskSet, task
class UserBehavior(TaskSet):
tasks = []
def on_start(self):
pass
@task
def index(self):
self.client.get("/")
@task
def move_map(self):
self.client.get("")
@task
def select_scene(self):
# Get url
... | from locust import HttpLocust, TaskSet, task
from bs4 import BeautifulSoup
from requests import Session
import random
class UserBehavior(TaskSet):
def on_start(self):
pass
@task
def index(self):
self.client.get("/")
@task
def move_map(self):
lat = random.uniform(-1, 1)
... | <commit_before>from locust import HttpLocust, TaskSet, task
class UserBehavior(TaskSet):
tasks = []
def on_start(self):
pass
@task
def index(self):
self.client.get("/")
@task
def move_map(self):
self.client.get("")
@task
def select_scene(self):
# Get... | from locust import HttpLocust, TaskSet, task
from bs4 import BeautifulSoup
from requests import Session
import random
class UserBehavior(TaskSet):
def on_start(self):
pass
@task
def index(self):
self.client.get("/")
@task
def move_map(self):
lat = random.uniform(-1, 1)
... | from locust import HttpLocust, TaskSet, task
class UserBehavior(TaskSet):
tasks = []
def on_start(self):
pass
@task
def index(self):
self.client.get("/")
@task
def move_map(self):
self.client.get("")
@task
def select_scene(self):
# Get url
... | <commit_before>from locust import HttpLocust, TaskSet, task
class UserBehavior(TaskSet):
tasks = []
def on_start(self):
pass
@task
def index(self):
self.client.get("/")
@task
def move_map(self):
self.client.get("")
@task
def select_scene(self):
# Get... |
3b41e2166adde50f36f8f7ea389c80b76b83acaf | test/test_wavedrom.py | test/test_wavedrom.py | import subprocess
from utils import *
@all_files_in_dir('wavedrom_0')
def test_wavedrom_0(datafiles):
with datafiles.as_cwd():
subprocess.check_call(['python3', 'wavedrom-test.py'])
@all_files_in_dir('wavedrom_1')
def test_wavedrom_1(datafiles):
with datafiles.as_cwd():
for s in get_simulato... | import subprocess
from utils import *
@all_files_in_dir('wavedrom_0')
def test_wavedrom_0(datafiles):
with datafiles.as_cwd():
subprocess.check_call(['python3', 'wavedrom-test.py'])
@all_files_in_dir('wavedrom_1')
@all_available_simulators()
def test_wavedrom_1(datafiles, simulator):
with datafiles.... | Update wavedrom tests to get simulators via fixture | Update wavedrom tests to get simulators via fixture | Python | apache-2.0 | nosnhojn/svunit-code,svunit/svunit,nosnhojn/svunit-code,svunit/svunit,svunit/svunit,nosnhojn/svunit-code | import subprocess
from utils import *
@all_files_in_dir('wavedrom_0')
def test_wavedrom_0(datafiles):
with datafiles.as_cwd():
subprocess.check_call(['python3', 'wavedrom-test.py'])
@all_files_in_dir('wavedrom_1')
def test_wavedrom_1(datafiles):
with datafiles.as_cwd():
for s in get_simulato... | import subprocess
from utils import *
@all_files_in_dir('wavedrom_0')
def test_wavedrom_0(datafiles):
with datafiles.as_cwd():
subprocess.check_call(['python3', 'wavedrom-test.py'])
@all_files_in_dir('wavedrom_1')
@all_available_simulators()
def test_wavedrom_1(datafiles, simulator):
with datafiles.... | <commit_before>import subprocess
from utils import *
@all_files_in_dir('wavedrom_0')
def test_wavedrom_0(datafiles):
with datafiles.as_cwd():
subprocess.check_call(['python3', 'wavedrom-test.py'])
@all_files_in_dir('wavedrom_1')
def test_wavedrom_1(datafiles):
with datafiles.as_cwd():
for s ... | import subprocess
from utils import *
@all_files_in_dir('wavedrom_0')
def test_wavedrom_0(datafiles):
with datafiles.as_cwd():
subprocess.check_call(['python3', 'wavedrom-test.py'])
@all_files_in_dir('wavedrom_1')
@all_available_simulators()
def test_wavedrom_1(datafiles, simulator):
with datafiles.... | import subprocess
from utils import *
@all_files_in_dir('wavedrom_0')
def test_wavedrom_0(datafiles):
with datafiles.as_cwd():
subprocess.check_call(['python3', 'wavedrom-test.py'])
@all_files_in_dir('wavedrom_1')
def test_wavedrom_1(datafiles):
with datafiles.as_cwd():
for s in get_simulato... | <commit_before>import subprocess
from utils import *
@all_files_in_dir('wavedrom_0')
def test_wavedrom_0(datafiles):
with datafiles.as_cwd():
subprocess.check_call(['python3', 'wavedrom-test.py'])
@all_files_in_dir('wavedrom_1')
def test_wavedrom_1(datafiles):
with datafiles.as_cwd():
for s ... |
9d041287e5e0d1950d5dcda23f6f68522d287282 | tests/test_machine.py | tests/test_machine.py | import rml.machines
def test_machine_load_elements():
lattice = rml.machines.get_elements(machine='SRI21', elemType='BPM')
assert len(lattice) == 173
for element in lattice.get_elements():
assert element.get_pv_name('readback')
| import rml.machines
def test_machine_load_elements():
lattice = rml.machines.get_elements(machine='SRI21', elem_type='BPM')
assert len(lattice) == 173
for element in lattice.get_elements():
assert isinstance(element.get_pv_name('readback', 'x'), str)
assert isinstance(element.get_pv_name('... | Test if pvs are loaded correctly from the database | Test if pvs are loaded correctly from the database
| Python | apache-2.0 | willrogers/pml,willrogers/pml,razvanvasile/RML | import rml.machines
def test_machine_load_elements():
lattice = rml.machines.get_elements(machine='SRI21', elemType='BPM')
assert len(lattice) == 173
for element in lattice.get_elements():
assert element.get_pv_name('readback')
Test if pvs are loaded correctly from the database | import rml.machines
def test_machine_load_elements():
lattice = rml.machines.get_elements(machine='SRI21', elem_type='BPM')
assert len(lattice) == 173
for element in lattice.get_elements():
assert isinstance(element.get_pv_name('readback', 'x'), str)
assert isinstance(element.get_pv_name('... | <commit_before>import rml.machines
def test_machine_load_elements():
lattice = rml.machines.get_elements(machine='SRI21', elemType='BPM')
assert len(lattice) == 173
for element in lattice.get_elements():
assert element.get_pv_name('readback')
<commit_msg>Test if pvs are loaded correctly from the d... | import rml.machines
def test_machine_load_elements():
lattice = rml.machines.get_elements(machine='SRI21', elem_type='BPM')
assert len(lattice) == 173
for element in lattice.get_elements():
assert isinstance(element.get_pv_name('readback', 'x'), str)
assert isinstance(element.get_pv_name('... | import rml.machines
def test_machine_load_elements():
lattice = rml.machines.get_elements(machine='SRI21', elemType='BPM')
assert len(lattice) == 173
for element in lattice.get_elements():
assert element.get_pv_name('readback')
Test if pvs are loaded correctly from the databaseimport rml.machines
... | <commit_before>import rml.machines
def test_machine_load_elements():
lattice = rml.machines.get_elements(machine='SRI21', elemType='BPM')
assert len(lattice) == 173
for element in lattice.get_elements():
assert element.get_pv_name('readback')
<commit_msg>Test if pvs are loaded correctly from the d... |
4a3df7842ab8f305ece134aa223801007d55c4f9 | timm/utils/metrics.py | timm/utils/metrics.py | """ Eval metrics and related
Hacked together by / Copyright 2020 Ross Wightman
"""
class AverageMeter:
"""Computes and stores the average and current value"""
def __init__(self):
self.reset()
def reset(self):
self.val = 0
self.avg = 0
self.sum = 0
self.count = 0
... | """ Eval metrics and related
Hacked together by / Copyright 2020 Ross Wightman
"""
class AverageMeter:
"""Computes and stores the average and current value"""
def __init__(self):
self.reset()
def reset(self):
self.val = 0
self.avg = 0
self.sum = 0
self.count = 0
... | Fix topn metric view regression on PyTorch 1.7 | Fix topn metric view regression on PyTorch 1.7
| Python | apache-2.0 | rwightman/pytorch-image-models,rwightman/pytorch-image-models | """ Eval metrics and related
Hacked together by / Copyright 2020 Ross Wightman
"""
class AverageMeter:
"""Computes and stores the average and current value"""
def __init__(self):
self.reset()
def reset(self):
self.val = 0
self.avg = 0
self.sum = 0
self.count = 0
... | """ Eval metrics and related
Hacked together by / Copyright 2020 Ross Wightman
"""
class AverageMeter:
"""Computes and stores the average and current value"""
def __init__(self):
self.reset()
def reset(self):
self.val = 0
self.avg = 0
self.sum = 0
self.count = 0
... | <commit_before>""" Eval metrics and related
Hacked together by / Copyright 2020 Ross Wightman
"""
class AverageMeter:
"""Computes and stores the average and current value"""
def __init__(self):
self.reset()
def reset(self):
self.val = 0
self.avg = 0
self.sum = 0
s... | """ Eval metrics and related
Hacked together by / Copyright 2020 Ross Wightman
"""
class AverageMeter:
"""Computes and stores the average and current value"""
def __init__(self):
self.reset()
def reset(self):
self.val = 0
self.avg = 0
self.sum = 0
self.count = 0
... | """ Eval metrics and related
Hacked together by / Copyright 2020 Ross Wightman
"""
class AverageMeter:
"""Computes and stores the average and current value"""
def __init__(self):
self.reset()
def reset(self):
self.val = 0
self.avg = 0
self.sum = 0
self.count = 0
... | <commit_before>""" Eval metrics and related
Hacked together by / Copyright 2020 Ross Wightman
"""
class AverageMeter:
"""Computes and stores the average and current value"""
def __init__(self):
self.reset()
def reset(self):
self.val = 0
self.avg = 0
self.sum = 0
s... |
362c8dacda35bac24aa83e4fcaa2f6bac37150fd | tests/test_mw_util.py | tests/test_mw_util.py | """Unit tests for cat2cohort."""
import unittest
from mw_util import str2cat
class TestMWutil(unittest.TestCase):
"""Test methods from mw_util."""
pass
| """Unit tests for cat2cohort."""
import unittest
from mw_util import str2cat
class TestMWutil(unittest.TestCase):
"""Test methods from mw_util."""
def test_str2cat(self):
"""Test str2cat."""
values = [
('A', 'Category:A'),
('Category:B', 'Category:B'),
]
... | Add unit test for str2cat method. | Add unit test for str2cat method.
| Python | mit | Commonists/wm_metrics,danmichaelo/wm_metrics,Commonists/wm_metrics,Commonists/wm_metrics,danmichaelo/wm_metrics,danmichaelo/wm_metrics,danmichaelo/wm_metrics,Commonists/wm_metrics | """Unit tests for cat2cohort."""
import unittest
from mw_util import str2cat
class TestMWutil(unittest.TestCase):
"""Test methods from mw_util."""
pass
Add unit test for str2cat method. | """Unit tests for cat2cohort."""
import unittest
from mw_util import str2cat
class TestMWutil(unittest.TestCase):
"""Test methods from mw_util."""
def test_str2cat(self):
"""Test str2cat."""
values = [
('A', 'Category:A'),
('Category:B', 'Category:B'),
]
... | <commit_before>"""Unit tests for cat2cohort."""
import unittest
from mw_util import str2cat
class TestMWutil(unittest.TestCase):
"""Test methods from mw_util."""
pass
<commit_msg>Add unit test for str2cat method.<commit_after> | """Unit tests for cat2cohort."""
import unittest
from mw_util import str2cat
class TestMWutil(unittest.TestCase):
"""Test methods from mw_util."""
def test_str2cat(self):
"""Test str2cat."""
values = [
('A', 'Category:A'),
('Category:B', 'Category:B'),
]
... | """Unit tests for cat2cohort."""
import unittest
from mw_util import str2cat
class TestMWutil(unittest.TestCase):
"""Test methods from mw_util."""
pass
Add unit test for str2cat method."""Unit tests for cat2cohort."""
import unittest
from mw_util import str2cat
class TestMWutil(unittest.TestCase):
... | <commit_before>"""Unit tests for cat2cohort."""
import unittest
from mw_util import str2cat
class TestMWutil(unittest.TestCase):
"""Test methods from mw_util."""
pass
<commit_msg>Add unit test for str2cat method.<commit_after>"""Unit tests for cat2cohort."""
import unittest
from mw_util import str2cat
c... |
ebf52caf6ee09ef1f15cb88815a1fb8008899c79 | tests/test_reactjs.py | tests/test_reactjs.py | # -*- coding: utf-8 -*-
import dukpy
class TestReactJS(object):
def test_hello_world(self):
jsx = dukpy.jsx_compile('var react_hello = <h1>Hello, world!</h1>;')
jsi = dukpy.JSInterpreter()
result = jsi.evaljs([
'''
var React = require('react/react'),
Re... | # -*- coding: utf-8 -*-
import dukpy
class TestReactJS(object):
def test_hello_world(self):
jsx = dukpy.jsx_compile('var react_hello = <h1>Hello, world!</h1>;')
jsi = dukpy.JSInterpreter()
result = jsi.evaljs([
'''
var React = require('react/react'),
Re... | Add tests for a React Component | Add tests for a React Component
| Python | mit | amol-/dukpy,amol-/dukpy,amol-/dukpy | # -*- coding: utf-8 -*-
import dukpy
class TestReactJS(object):
def test_hello_world(self):
jsx = dukpy.jsx_compile('var react_hello = <h1>Hello, world!</h1>;')
jsi = dukpy.JSInterpreter()
result = jsi.evaljs([
'''
var React = require('react/react'),
Re... | # -*- coding: utf-8 -*-
import dukpy
class TestReactJS(object):
def test_hello_world(self):
jsx = dukpy.jsx_compile('var react_hello = <h1>Hello, world!</h1>;')
jsi = dukpy.JSInterpreter()
result = jsi.evaljs([
'''
var React = require('react/react'),
Re... | <commit_before># -*- coding: utf-8 -*-
import dukpy
class TestReactJS(object):
def test_hello_world(self):
jsx = dukpy.jsx_compile('var react_hello = <h1>Hello, world!</h1>;')
jsi = dukpy.JSInterpreter()
result = jsi.evaljs([
'''
var React = require('react/react'),
... | # -*- coding: utf-8 -*-
import dukpy
class TestReactJS(object):
def test_hello_world(self):
jsx = dukpy.jsx_compile('var react_hello = <h1>Hello, world!</h1>;')
jsi = dukpy.JSInterpreter()
result = jsi.evaljs([
'''
var React = require('react/react'),
Re... | # -*- coding: utf-8 -*-
import dukpy
class TestReactJS(object):
def test_hello_world(self):
jsx = dukpy.jsx_compile('var react_hello = <h1>Hello, world!</h1>;')
jsi = dukpy.JSInterpreter()
result = jsi.evaljs([
'''
var React = require('react/react'),
Re... | <commit_before># -*- coding: utf-8 -*-
import dukpy
class TestReactJS(object):
def test_hello_world(self):
jsx = dukpy.jsx_compile('var react_hello = <h1>Hello, world!</h1>;')
jsi = dukpy.JSInterpreter()
result = jsi.evaljs([
'''
var React = require('react/react'),
... |
15240d40ad027dd9fa058d07b289f681e7d3e487 | src/webassets/filter/clevercss.py | src/webassets/filter/clevercss.py | from __future__ import absolute_import
from webassets.filter import Filter
__all__ = ('CleverCSS',)
class CleverCSS(Filter):
"""Converts `CleverCSS <http://sandbox.pocoo.org/clevercss/>`_ markup
to real CSS.
If you want to combine it with other CSS filters, make sure this one
runs first.
"""
... | from __future__ import absolute_import
from webassets.filter import Filter
__all__ = ('CleverCSS',)
class CleverCSS(Filter):
"""Converts `CleverCSS <http://sandbox.pocoo.org/clevercss/>`_ markup
to real CSS.
If you want to combine it with other CSS filters, make sure this one
runs first.
"""
... | Clean a weird unicode char in beginning of file | Clean a weird unicode char in beginning of file
The first char in clevercss.py filter is <U+FEFF>, which doesn't show up in vim or other editors.
Can view it in less and can edit it using nano.
This was throwing up UnicodeDecodeErrors when running nosetests with html output for coverage.
| Python | bsd-2-clause | 0x1997/webassets,john2x/webassets,wijerasa/webassets,0x1997/webassets,aconrad/webassets,heynemann/webassets,florianjacob/webassets,florianjacob/webassets,heynemann/webassets,JDeuce/webassets,aconrad/webassets,glorpen/webassets,JDeuce/webassets,glorpen/webassets,john2x/webassets,aconrad/webassets,scorphus/webassets,wije... | from __future__ import absolute_import
from webassets.filter import Filter
__all__ = ('CleverCSS',)
class CleverCSS(Filter):
"""Converts `CleverCSS <http://sandbox.pocoo.org/clevercss/>`_ markup
to real CSS.
If you want to combine it with other CSS filters, make sure this one
runs first.
"""
... | from __future__ import absolute_import
from webassets.filter import Filter
__all__ = ('CleverCSS',)
class CleverCSS(Filter):
"""Converts `CleverCSS <http://sandbox.pocoo.org/clevercss/>`_ markup
to real CSS.
If you want to combine it with other CSS filters, make sure this one
runs first.
"""
... | <commit_before>from __future__ import absolute_import
from webassets.filter import Filter
__all__ = ('CleverCSS',)
class CleverCSS(Filter):
"""Converts `CleverCSS <http://sandbox.pocoo.org/clevercss/>`_ markup
to real CSS.
If you want to combine it with other CSS filters, make sure this one
runs f... | from __future__ import absolute_import
from webassets.filter import Filter
__all__ = ('CleverCSS',)
class CleverCSS(Filter):
"""Converts `CleverCSS <http://sandbox.pocoo.org/clevercss/>`_ markup
to real CSS.
If you want to combine it with other CSS filters, make sure this one
runs first.
"""
... | from __future__ import absolute_import
from webassets.filter import Filter
__all__ = ('CleverCSS',)
class CleverCSS(Filter):
"""Converts `CleverCSS <http://sandbox.pocoo.org/clevercss/>`_ markup
to real CSS.
If you want to combine it with other CSS filters, make sure this one
runs first.
"""
... | <commit_before>from __future__ import absolute_import
from webassets.filter import Filter
__all__ = ('CleverCSS',)
class CleverCSS(Filter):
"""Converts `CleverCSS <http://sandbox.pocoo.org/clevercss/>`_ markup
to real CSS.
If you want to combine it with other CSS filters, make sure this one
runs f... |
484e5693b2f3e0bc8c238cd64afeaad17bfa6673 | skimage/viewer/qt/QtCore.py | skimage/viewer/qt/QtCore.py | from . import qt_api
if qt_api == 'pyside':
from PySide.QtCore import *
elif qt_api == 'pyqt':
from PyQt4.QtCore import *
else:
# Mock objects
Qt = None
def pyqtSignal(*args, **kwargs):
pass
| from . import qt_api
if qt_api == 'pyside':
from PySide.QtCore import *
elif qt_api == 'pyqt':
from PyQt4.QtCore import *
else:
# Mock objects for buildbot (which doesn't have Qt, but imports viewer).
class Qt(object):
TopDockWidgetArea = None
BottomDockWidgetArea = None
LeftDoc... | Add attributes to Mock object to fix Travis build | Add attributes to Mock object to fix Travis build
| Python | bsd-3-clause | ajaybhat/scikit-image,chintak/scikit-image,warmspringwinds/scikit-image,vighneshbirodkar/scikit-image,SamHames/scikit-image,SamHames/scikit-image,SamHames/scikit-image,michaelpacer/scikit-image,jwiggins/scikit-image,rjeli/scikit-image,blink1073/scikit-image,almarklein/scikit-image,bsipocz/scikit-image,almarklein/scikit... | from . import qt_api
if qt_api == 'pyside':
from PySide.QtCore import *
elif qt_api == 'pyqt':
from PyQt4.QtCore import *
else:
# Mock objects
Qt = None
def pyqtSignal(*args, **kwargs):
pass
Add attributes to Mock object to fix Travis build | from . import qt_api
if qt_api == 'pyside':
from PySide.QtCore import *
elif qt_api == 'pyqt':
from PyQt4.QtCore import *
else:
# Mock objects for buildbot (which doesn't have Qt, but imports viewer).
class Qt(object):
TopDockWidgetArea = None
BottomDockWidgetArea = None
LeftDoc... | <commit_before>from . import qt_api
if qt_api == 'pyside':
from PySide.QtCore import *
elif qt_api == 'pyqt':
from PyQt4.QtCore import *
else:
# Mock objects
Qt = None
def pyqtSignal(*args, **kwargs):
pass
<commit_msg>Add attributes to Mock object to fix Travis build<commit_after> | from . import qt_api
if qt_api == 'pyside':
from PySide.QtCore import *
elif qt_api == 'pyqt':
from PyQt4.QtCore import *
else:
# Mock objects for buildbot (which doesn't have Qt, but imports viewer).
class Qt(object):
TopDockWidgetArea = None
BottomDockWidgetArea = None
LeftDoc... | from . import qt_api
if qt_api == 'pyside':
from PySide.QtCore import *
elif qt_api == 'pyqt':
from PyQt4.QtCore import *
else:
# Mock objects
Qt = None
def pyqtSignal(*args, **kwargs):
pass
Add attributes to Mock object to fix Travis buildfrom . import qt_api
if qt_api == 'pyside':
fr... | <commit_before>from . import qt_api
if qt_api == 'pyside':
from PySide.QtCore import *
elif qt_api == 'pyqt':
from PyQt4.QtCore import *
else:
# Mock objects
Qt = None
def pyqtSignal(*args, **kwargs):
pass
<commit_msg>Add attributes to Mock object to fix Travis build<commit_after>from . imp... |
2a32fc912a5839f627a216918e4671e6547ee53b | tests/utils/driver.py | tests/utils/driver.py | import os
from importlib import import_module
from .testdriver import TestDriver
class Driver(TestDriver):
drivers = {}
def __new__(cls, type, *args, **kwargs):
if type not in cls.drivers:
try:
mod = import_module('onitu.drivers.{}.tests.driver'.
... | import os
import pkg_resources
from .testdriver import TestDriver
class Driver(TestDriver):
drivers = {}
def __new__(cls, name, *args, **kwargs):
entry_points = pkg_resources.iter_entry_points('onitu.tests')
tests_modules = {e.name: e for e in entry_points}
if name not in tests_modu... | Load tests helpers using entry_points | Load tests helpers using entry_points
| Python | mit | onitu/onitu,onitu/onitu,onitu/onitu | import os
from importlib import import_module
from .testdriver import TestDriver
class Driver(TestDriver):
drivers = {}
def __new__(cls, type, *args, **kwargs):
if type not in cls.drivers:
try:
mod = import_module('onitu.drivers.{}.tests.driver'.
... | import os
import pkg_resources
from .testdriver import TestDriver
class Driver(TestDriver):
drivers = {}
def __new__(cls, name, *args, **kwargs):
entry_points = pkg_resources.iter_entry_points('onitu.tests')
tests_modules = {e.name: e for e in entry_points}
if name not in tests_modu... | <commit_before>import os
from importlib import import_module
from .testdriver import TestDriver
class Driver(TestDriver):
drivers = {}
def __new__(cls, type, *args, **kwargs):
if type not in cls.drivers:
try:
mod = import_module('onitu.drivers.{}.tests.driver'.
... | import os
import pkg_resources
from .testdriver import TestDriver
class Driver(TestDriver):
drivers = {}
def __new__(cls, name, *args, **kwargs):
entry_points = pkg_resources.iter_entry_points('onitu.tests')
tests_modules = {e.name: e for e in entry_points}
if name not in tests_modu... | import os
from importlib import import_module
from .testdriver import TestDriver
class Driver(TestDriver):
drivers = {}
def __new__(cls, type, *args, **kwargs):
if type not in cls.drivers:
try:
mod = import_module('onitu.drivers.{}.tests.driver'.
... | <commit_before>import os
from importlib import import_module
from .testdriver import TestDriver
class Driver(TestDriver):
drivers = {}
def __new__(cls, type, *args, **kwargs):
if type not in cls.drivers:
try:
mod = import_module('onitu.drivers.{}.tests.driver'.
... |
86f6191867141d7a7a165b227255d7b4406eb4f4 | accounts/utils.py | accounts/utils.py | """
Utility functions for the accounts app.
"""
from django.core.exceptions import ObjectDoesNotExist
def get_user_city(user):
"""Return the user's city. If unavailable, return an empty string."""
# If the profile is absent (i.e. superuser), return None.
try:
city = user.common_profile.city
e... | """
Utility functions for the accounts app.
"""
from django.core.exceptions import ObjectDoesNotExist
def get_user_city(user):
"""Return the user's city. If unavailable, return an empty string."""
# If the profile is absent (i.e. superuser), return None.
try:
city = user.common_profile.city
e... | Fix crash on non-logged in users. | Fix crash on non-logged in users.
| Python | agpl-3.0 | osamak/student-portal,osamak/student-portal,osamak/student-portal,osamak/student-portal,enjaz/enjaz,enjaz/enjaz,enjaz/enjaz,enjaz/enjaz,osamak/student-portal,enjaz/enjaz | """
Utility functions for the accounts app.
"""
from django.core.exceptions import ObjectDoesNotExist
def get_user_city(user):
"""Return the user's city. If unavailable, return an empty string."""
# If the profile is absent (i.e. superuser), return None.
try:
city = user.common_profile.city
e... | """
Utility functions for the accounts app.
"""
from django.core.exceptions import ObjectDoesNotExist
def get_user_city(user):
"""Return the user's city. If unavailable, return an empty string."""
# If the profile is absent (i.e. superuser), return None.
try:
city = user.common_profile.city
e... | <commit_before>"""
Utility functions for the accounts app.
"""
from django.core.exceptions import ObjectDoesNotExist
def get_user_city(user):
"""Return the user's city. If unavailable, return an empty string."""
# If the profile is absent (i.e. superuser), return None.
try:
city = user.common_pro... | """
Utility functions for the accounts app.
"""
from django.core.exceptions import ObjectDoesNotExist
def get_user_city(user):
"""Return the user's city. If unavailable, return an empty string."""
# If the profile is absent (i.e. superuser), return None.
try:
city = user.common_profile.city
e... | """
Utility functions for the accounts app.
"""
from django.core.exceptions import ObjectDoesNotExist
def get_user_city(user):
"""Return the user's city. If unavailable, return an empty string."""
# If the profile is absent (i.e. superuser), return None.
try:
city = user.common_profile.city
e... | <commit_before>"""
Utility functions for the accounts app.
"""
from django.core.exceptions import ObjectDoesNotExist
def get_user_city(user):
"""Return the user's city. If unavailable, return an empty string."""
# If the profile is absent (i.e. superuser), return None.
try:
city = user.common_pro... |
1f55fe2e67df7826c6f99ca2874a56ccbe2bfc02 | dsub/_dsub_version.py | dsub/_dsub_version.py | # Copyright 2017 Google Inc. 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 applicable law or a... | # Copyright 2017 Google Inc. 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 applicable law or a... | Update dsub version to 0.2.3. | Update dsub version to 0.2.3.
PiperOrigin-RevId: 222307052
| Python | apache-2.0 | DataBiosphere/dsub,DataBiosphere/dsub | # Copyright 2017 Google Inc. 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 applicable law or a... | # Copyright 2017 Google Inc. 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 applicable law or a... | <commit_before># Copyright 2017 Google Inc. 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 appl... | # Copyright 2017 Google Inc. 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 applicable law or a... | # Copyright 2017 Google Inc. 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 applicable law or a... | <commit_before># Copyright 2017 Google Inc. 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 appl... |
6795e112e4f7037449850a361ab6b2f85fc2a66e | service/settings/staging.py | service/settings/staging.py | from service.settings.production import *
ALLOWED_HOSTS = [
'fantastic-doodle--staging.herokuapp.com',
]
| from service.settings.production import *
ALLOWED_HOSTS = [
'fantastic-doodle--staging.herokuapp.com',
'.herokuapp.com',
]
| Add .herokuapp.com to ALLOWED_HOSTS to support review apps | Add .herokuapp.com to ALLOWED_HOSTS to support review apps | Python | unlicense | Mystopia/fantastic-doodle | from service.settings.production import *
ALLOWED_HOSTS = [
'fantastic-doodle--staging.herokuapp.com',
]
Add .herokuapp.com to ALLOWED_HOSTS to support review apps | from service.settings.production import *
ALLOWED_HOSTS = [
'fantastic-doodle--staging.herokuapp.com',
'.herokuapp.com',
]
| <commit_before>from service.settings.production import *
ALLOWED_HOSTS = [
'fantastic-doodle--staging.herokuapp.com',
]
<commit_msg>Add .herokuapp.com to ALLOWED_HOSTS to support review apps<commit_after> | from service.settings.production import *
ALLOWED_HOSTS = [
'fantastic-doodle--staging.herokuapp.com',
'.herokuapp.com',
]
| from service.settings.production import *
ALLOWED_HOSTS = [
'fantastic-doodle--staging.herokuapp.com',
]
Add .herokuapp.com to ALLOWED_HOSTS to support review appsfrom service.settings.production import *
ALLOWED_HOSTS = [
'fantastic-doodle--staging.herokuapp.com',
'.herokuapp.com',
]
| <commit_before>from service.settings.production import *
ALLOWED_HOSTS = [
'fantastic-doodle--staging.herokuapp.com',
]
<commit_msg>Add .herokuapp.com to ALLOWED_HOSTS to support review apps<commit_after>from service.settings.production import *
ALLOWED_HOSTS = [
'fantastic-doodle--staging.herokuapp.com',
... |
3800c095f58e9bc2ca8c580537ea576049bbfe2d | sell/urls.py | sell/urls.py | from django.conf.urls import url
from sell import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^personal/$', views.personal_data),
url(r'^books/$', views.books),
url(r'^summary/$', views.summary),
] | from django.conf.urls import url
from sell import views
urlpatterns = [
url(r'^$', views.index),
url(r'^personal/$', views.personal_data),
url(r'^books/$', views.books),
url(r'^summary/$', views.summary),
] | Remove unnecessary URL name in Sell app | Remove unnecessary URL name in Sell app
| Python | agpl-3.0 | m4tx/egielda,m4tx/egielda,m4tx/egielda | from django.conf.urls import url
from sell import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^personal/$', views.personal_data),
url(r'^books/$', views.books),
url(r'^summary/$', views.summary),
]Remove unnecessary URL name in Sell app | from django.conf.urls import url
from sell import views
urlpatterns = [
url(r'^$', views.index),
url(r'^personal/$', views.personal_data),
url(r'^books/$', views.books),
url(r'^summary/$', views.summary),
] | <commit_before>from django.conf.urls import url
from sell import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^personal/$', views.personal_data),
url(r'^books/$', views.books),
url(r'^summary/$', views.summary),
]<commit_msg>Remove unnecessary URL name in Sell app<commit_after> | from django.conf.urls import url
from sell import views
urlpatterns = [
url(r'^$', views.index),
url(r'^personal/$', views.personal_data),
url(r'^books/$', views.books),
url(r'^summary/$', views.summary),
] | from django.conf.urls import url
from sell import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^personal/$', views.personal_data),
url(r'^books/$', views.books),
url(r'^summary/$', views.summary),
]Remove unnecessary URL name in Sell appfrom django.conf.urls import url
from sel... | <commit_before>from django.conf.urls import url
from sell import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^personal/$', views.personal_data),
url(r'^books/$', views.books),
url(r'^summary/$', views.summary),
]<commit_msg>Remove unnecessary URL name in Sell app<commit_after>f... |
c47c043e76ac037456b8e966a5f9d60a151e3120 | elodie/geolocation.py | elodie/geolocation.py | from os import path
from ConfigParser import ConfigParser
import requests
import sys
def reverse_lookup(lat, lon):
if(lat is None or lon is None):
return None
if not path.exists('./config.ini'):
return None
config = ConfigParser()
config.read('./config.ini')
if('MapQuest' ... | from os import path
from ConfigParser import ConfigParser
import requests
import sys
def reverse_lookup(lat, lon):
if(lat is None or lon is None):
return None
config_file = '%s/config.ini' % path.dirname(path.dirname(path.abspath(__file__)))
if not path.exists(config_file):
return None
... | Use absolute path for config file so it works with apps like Hazel | Use absolute path for config file so it works with apps like Hazel
| Python | apache-2.0 | zserg/elodie,zingo/elodie,jmathai/elodie,jmathai/elodie,zingo/elodie,zserg/elodie,zserg/elodie,jmathai/elodie,zserg/elodie,jmathai/elodie,zingo/elodie | from os import path
from ConfigParser import ConfigParser
import requests
import sys
def reverse_lookup(lat, lon):
if(lat is None or lon is None):
return None
if not path.exists('./config.ini'):
return None
config = ConfigParser()
config.read('./config.ini')
if('MapQuest' ... | from os import path
from ConfigParser import ConfigParser
import requests
import sys
def reverse_lookup(lat, lon):
if(lat is None or lon is None):
return None
config_file = '%s/config.ini' % path.dirname(path.dirname(path.abspath(__file__)))
if not path.exists(config_file):
return None
... | <commit_before>from os import path
from ConfigParser import ConfigParser
import requests
import sys
def reverse_lookup(lat, lon):
if(lat is None or lon is None):
return None
if not path.exists('./config.ini'):
return None
config = ConfigParser()
config.read('./config.ini')
... | from os import path
from ConfigParser import ConfigParser
import requests
import sys
def reverse_lookup(lat, lon):
if(lat is None or lon is None):
return None
config_file = '%s/config.ini' % path.dirname(path.dirname(path.abspath(__file__)))
if not path.exists(config_file):
return None
... | from os import path
from ConfigParser import ConfigParser
import requests
import sys
def reverse_lookup(lat, lon):
if(lat is None or lon is None):
return None
if not path.exists('./config.ini'):
return None
config = ConfigParser()
config.read('./config.ini')
if('MapQuest' ... | <commit_before>from os import path
from ConfigParser import ConfigParser
import requests
import sys
def reverse_lookup(lat, lon):
if(lat is None or lon is None):
return None
if not path.exists('./config.ini'):
return None
config = ConfigParser()
config.read('./config.ini')
... |
678a6ed9e24b8f91933584ab211ee9f3b2643aad | nipy/modalities/fmri/__init__.py | nipy/modalities/fmri/__init__.py | """
TODO
"""
__docformat__ = 'restructuredtext'
import fmri, hrf, utils
import fmristat
from nipy.testing import Tester
test = Tester().test
bench = Tester().bench
| """
TODO
"""
__docformat__ = 'restructuredtext'
import fmri, hrf, utils, formula
import fmristat
from nipy.testing import Tester
test = Tester().test
bench = Tester().bench
| Fix missing import of formula in fmri. | Fix missing import of formula in fmri. | Python | bsd-3-clause | alexis-roche/nipy,alexis-roche/nireg,arokem/nipy,arokem/nipy,bthirion/nipy,arokem/nipy,alexis-roche/nipy,nipy/nireg,alexis-roche/register,nipy/nipy-labs,alexis-roche/nipy,alexis-roche/niseg,alexis-roche/nireg,bthirion/nipy,arokem/nipy,bthirion/nipy,alexis-roche/nipy,alexis-roche/register,bthirion/nipy,alexis-roche/nise... | """
TODO
"""
__docformat__ = 'restructuredtext'
import fmri, hrf, utils
import fmristat
from nipy.testing import Tester
test = Tester().test
bench = Tester().bench
Fix missing import of formula in fmri. | """
TODO
"""
__docformat__ = 'restructuredtext'
import fmri, hrf, utils, formula
import fmristat
from nipy.testing import Tester
test = Tester().test
bench = Tester().bench
| <commit_before>"""
TODO
"""
__docformat__ = 'restructuredtext'
import fmri, hrf, utils
import fmristat
from nipy.testing import Tester
test = Tester().test
bench = Tester().bench
<commit_msg>Fix missing import of formula in fmri.<commit_after> | """
TODO
"""
__docformat__ = 'restructuredtext'
import fmri, hrf, utils, formula
import fmristat
from nipy.testing import Tester
test = Tester().test
bench = Tester().bench
| """
TODO
"""
__docformat__ = 'restructuredtext'
import fmri, hrf, utils
import fmristat
from nipy.testing import Tester
test = Tester().test
bench = Tester().bench
Fix missing import of formula in fmri."""
TODO
"""
__docformat__ = 'restructuredtext'
import fmri, hrf, utils, formula
import fmristat
from nipy.testi... | <commit_before>"""
TODO
"""
__docformat__ = 'restructuredtext'
import fmri, hrf, utils
import fmristat
from nipy.testing import Tester
test = Tester().test
bench = Tester().bench
<commit_msg>Fix missing import of formula in fmri.<commit_after>"""
TODO
"""
__docformat__ = 'restructuredtext'
import fmri, hrf, utils,... |
4fd47cf73d59cb9e9d83cea12026878f65df858a | numscons/core/allow_undefined.py | numscons/core/allow_undefined.py | import os
from subprocess import Popen, PIPE
def get_darwin_version():
p = Popen(["sw_vers", "-productVersion"], stdout = PIPE, stderr = PIPE)
st = p.wait()
if st:
raise RuntimeError(
"Could not execute sw_vers -productVersion to get version")
verstring = p.stdout.next()
a... | """This module handle platform specific link options to allow undefined symbols
in shared libraries and dynamically loaded libraries."""
import os
from subprocess import Popen, PIPE
def get_darwin_version():
p = Popen(["sw_vers", "-productVersion"], stdout = PIPE, stderr = PIPE)
st = p.wait()
if st:
... | Add docstring + fix missing import in allow_udnefined module. | Add docstring + fix missing import in allow_udnefined module. | Python | bsd-3-clause | cournape/numscons,cournape/numscons,cournape/numscons | import os
from subprocess import Popen, PIPE
def get_darwin_version():
p = Popen(["sw_vers", "-productVersion"], stdout = PIPE, stderr = PIPE)
st = p.wait()
if st:
raise RuntimeError(
"Could not execute sw_vers -productVersion to get version")
verstring = p.stdout.next()
a... | """This module handle platform specific link options to allow undefined symbols
in shared libraries and dynamically loaded libraries."""
import os
from subprocess import Popen, PIPE
def get_darwin_version():
p = Popen(["sw_vers", "-productVersion"], stdout = PIPE, stderr = PIPE)
st = p.wait()
if st:
... | <commit_before>import os
from subprocess import Popen, PIPE
def get_darwin_version():
p = Popen(["sw_vers", "-productVersion"], stdout = PIPE, stderr = PIPE)
st = p.wait()
if st:
raise RuntimeError(
"Could not execute sw_vers -productVersion to get version")
verstring = p.stdo... | """This module handle platform specific link options to allow undefined symbols
in shared libraries and dynamically loaded libraries."""
import os
from subprocess import Popen, PIPE
def get_darwin_version():
p = Popen(["sw_vers", "-productVersion"], stdout = PIPE, stderr = PIPE)
st = p.wait()
if st:
... | import os
from subprocess import Popen, PIPE
def get_darwin_version():
p = Popen(["sw_vers", "-productVersion"], stdout = PIPE, stderr = PIPE)
st = p.wait()
if st:
raise RuntimeError(
"Could not execute sw_vers -productVersion to get version")
verstring = p.stdout.next()
a... | <commit_before>import os
from subprocess import Popen, PIPE
def get_darwin_version():
p = Popen(["sw_vers", "-productVersion"], stdout = PIPE, stderr = PIPE)
st = p.wait()
if st:
raise RuntimeError(
"Could not execute sw_vers -productVersion to get version")
verstring = p.stdo... |
4e0ec0fdf791fc9af1e83171b54054bd53d5536b | django_evolution/compat/apps.py | django_evolution/compat/apps.py | try:
from django.apps.registry import apps
get_apps = apps.get_apps
cache = None
except ImportError:
from django.db.models.loading import cache
get_apps = cache.get_apps
apps = None
def get_app(app_label, emptyOK=False):
"""Return the app with the given label.
This returns the app f... | try:
from django.apps.registry import apps
# Django >= 1.7
get_apps = apps.get_apps
cache = None
except ImportError:
from django.db.models.loading import cache
# Django < 1.7
get_apps = cache.get_apps
apps = None
def get_app(app_label, emptyOK=False):
"""Return the app with the g... | Fix the new get_app compatibility function. | Fix the new get_app compatibility function.
The get_app compatibility function was trying to call get_apps() on
the apps variable, instead of calling the extracted version that was
pre-computed. Now it uses the correct versions.
| Python | bsd-3-clause | beanbaginc/django-evolution | try:
from django.apps.registry import apps
get_apps = apps.get_apps
cache = None
except ImportError:
from django.db.models.loading import cache
get_apps = cache.get_apps
apps = None
def get_app(app_label, emptyOK=False):
"""Return the app with the given label.
This returns the app f... | try:
from django.apps.registry import apps
# Django >= 1.7
get_apps = apps.get_apps
cache = None
except ImportError:
from django.db.models.loading import cache
# Django < 1.7
get_apps = cache.get_apps
apps = None
def get_app(app_label, emptyOK=False):
"""Return the app with the g... | <commit_before>try:
from django.apps.registry import apps
get_apps = apps.get_apps
cache = None
except ImportError:
from django.db.models.loading import cache
get_apps = cache.get_apps
apps = None
def get_app(app_label, emptyOK=False):
"""Return the app with the given label.
This re... | try:
from django.apps.registry import apps
# Django >= 1.7
get_apps = apps.get_apps
cache = None
except ImportError:
from django.db.models.loading import cache
# Django < 1.7
get_apps = cache.get_apps
apps = None
def get_app(app_label, emptyOK=False):
"""Return the app with the g... | try:
from django.apps.registry import apps
get_apps = apps.get_apps
cache = None
except ImportError:
from django.db.models.loading import cache
get_apps = cache.get_apps
apps = None
def get_app(app_label, emptyOK=False):
"""Return the app with the given label.
This returns the app f... | <commit_before>try:
from django.apps.registry import apps
get_apps = apps.get_apps
cache = None
except ImportError:
from django.db.models.loading import cache
get_apps = cache.get_apps
apps = None
def get_app(app_label, emptyOK=False):
"""Return the app with the given label.
This re... |
7e9db30ee426993b881357b0158d243d0a4c15c9 | djlint/analyzers/db_backends.py | djlint/analyzers/db_backends.py | import ast
from .base import BaseAnalyzer, Result
class DB_BackendsVisitor(ast.NodeVisitor):
def __init__(self):
self.found = []
removed_items = {
'django.db.backends.postgresql':
'django.db.backends.postgresql_psycopg2',
}
def visit_Str(self, node):
if node.s ... | import ast
from .base import BaseAnalyzer, Result
class DB_BackendsVisitor(ast.NodeVisitor):
def __init__(self):
self.found = []
removed_items = {
'django.db.backends.postgresql':
'django.db.backends.postgresql_psycopg2',
}
def visit_Str(self, node):
if node.s ... | Fix database backends analyzer: 'postgresql' backend has been deprecated in 1.2 | Fix database backends analyzer: 'postgresql' backend has been deprecated in 1.2
| Python | isc | alfredhq/djlint | import ast
from .base import BaseAnalyzer, Result
class DB_BackendsVisitor(ast.NodeVisitor):
def __init__(self):
self.found = []
removed_items = {
'django.db.backends.postgresql':
'django.db.backends.postgresql_psycopg2',
}
def visit_Str(self, node):
if node.s ... | import ast
from .base import BaseAnalyzer, Result
class DB_BackendsVisitor(ast.NodeVisitor):
def __init__(self):
self.found = []
removed_items = {
'django.db.backends.postgresql':
'django.db.backends.postgresql_psycopg2',
}
def visit_Str(self, node):
if node.s ... | <commit_before>import ast
from .base import BaseAnalyzer, Result
class DB_BackendsVisitor(ast.NodeVisitor):
def __init__(self):
self.found = []
removed_items = {
'django.db.backends.postgresql':
'django.db.backends.postgresql_psycopg2',
}
def visit_Str(self, node):
... | import ast
from .base import BaseAnalyzer, Result
class DB_BackendsVisitor(ast.NodeVisitor):
def __init__(self):
self.found = []
removed_items = {
'django.db.backends.postgresql':
'django.db.backends.postgresql_psycopg2',
}
def visit_Str(self, node):
if node.s ... | import ast
from .base import BaseAnalyzer, Result
class DB_BackendsVisitor(ast.NodeVisitor):
def __init__(self):
self.found = []
removed_items = {
'django.db.backends.postgresql':
'django.db.backends.postgresql_psycopg2',
}
def visit_Str(self, node):
if node.s ... | <commit_before>import ast
from .base import BaseAnalyzer, Result
class DB_BackendsVisitor(ast.NodeVisitor):
def __init__(self):
self.found = []
removed_items = {
'django.db.backends.postgresql':
'django.db.backends.postgresql_psycopg2',
}
def visit_Str(self, node):
... |
82ae5e5cf3da57af771aa688ec7d951879423578 | big_o/test/test_complexities.py | big_o/test/test_complexities.py | import unittest
import numpy as np
from numpy.testing import assert_array_almost_equal
from big_o import complexities
class TestComplexities(unittest.TestCase):
def test_compute(self):
x = np.linspace(10, 100, 100)
y = 3.0 * x + 2.0
linear = complexities.Linear()
linear.fit(x, y)... | import unittest
import numpy as np
from numpy.testing import assert_array_almost_equal
from big_o import complexities
class TestComplexities(unittest.TestCase):
def test_compute(self):
desired = [
(lambda x: 2.+x*0., complexities.Constant),
(lambda x: 5.*x+3., complexities.Linear... | Add compute test cases for all complexity classes | Add compute test cases for all complexity classes
| Python | bsd-3-clause | pberkes/big_O | import unittest
import numpy as np
from numpy.testing import assert_array_almost_equal
from big_o import complexities
class TestComplexities(unittest.TestCase):
def test_compute(self):
x = np.linspace(10, 100, 100)
y = 3.0 * x + 2.0
linear = complexities.Linear()
linear.fit(x, y)... | import unittest
import numpy as np
from numpy.testing import assert_array_almost_equal
from big_o import complexities
class TestComplexities(unittest.TestCase):
def test_compute(self):
desired = [
(lambda x: 2.+x*0., complexities.Constant),
(lambda x: 5.*x+3., complexities.Linear... | <commit_before>import unittest
import numpy as np
from numpy.testing import assert_array_almost_equal
from big_o import complexities
class TestComplexities(unittest.TestCase):
def test_compute(self):
x = np.linspace(10, 100, 100)
y = 3.0 * x + 2.0
linear = complexities.Linear()
l... | import unittest
import numpy as np
from numpy.testing import assert_array_almost_equal
from big_o import complexities
class TestComplexities(unittest.TestCase):
def test_compute(self):
desired = [
(lambda x: 2.+x*0., complexities.Constant),
(lambda x: 5.*x+3., complexities.Linear... | import unittest
import numpy as np
from numpy.testing import assert_array_almost_equal
from big_o import complexities
class TestComplexities(unittest.TestCase):
def test_compute(self):
x = np.linspace(10, 100, 100)
y = 3.0 * x + 2.0
linear = complexities.Linear()
linear.fit(x, y)... | <commit_before>import unittest
import numpy as np
from numpy.testing import assert_array_almost_equal
from big_o import complexities
class TestComplexities(unittest.TestCase):
def test_compute(self):
x = np.linspace(10, 100, 100)
y = 3.0 * x + 2.0
linear = complexities.Linear()
l... |
15551db6af7e32ec4cc13fee4b73cb95b5a3a774 | runtests.py | runtests.py | import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
},
ROOT_URLCONF="holonet.urls",
INSTALLED_APPS=[
... | import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
},
ROOT_URLCONF="holonet.urls",
INSTALLED_APPS=[
... | Add MIDDLEWARE_CLASSES to settings, remove warnings | Add MIDDLEWARE_CLASSES to settings, remove warnings
| Python | mit | webkom/django-holonet | import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
},
ROOT_URLCONF="holonet.urls",
INSTALLED_APPS=[
... | import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
},
ROOT_URLCONF="holonet.urls",
INSTALLED_APPS=[
... | <commit_before>import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
},
ROOT_URLCONF="holonet.urls",
INSTALLED_APPS... | import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
},
ROOT_URLCONF="holonet.urls",
INSTALLED_APPS=[
... | import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
},
ROOT_URLCONF="holonet.urls",
INSTALLED_APPS=[
... | <commit_before>import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
},
ROOT_URLCONF="holonet.urls",
INSTALLED_APPS... |
219c474860ca7674070ef19fa95f0282b7c92399 | mpages/admin.py | mpages/admin.py | from django.contrib import admin
from .models import Page, PageRead, Tag
class PageAdmin(admin.ModelAdmin):
search_fields = ["title"]
list_display = ["title", "parent", "updated"]
prepopulated_fields = {"slug": ("title",)}
readonly_fields = ["updated"]
ordering = ["parent", "title"]
filter_ho... | from django.contrib import admin
from .models import Page, PageRead, Tag
class PageAdmin(admin.ModelAdmin):
search_fields = ["title"]
list_display = ["title", "parent", "updated"]
prepopulated_fields = {"slug": ("title",)}
readonly_fields = ["updated"]
ordering = ["parent", "title"]
filter_ho... | Order parents in Admin select field | Order parents in Admin select field
| Python | bsd-3-clause | ahernp/DMCM,ahernp/DMCM,ahernp/DMCM | from django.contrib import admin
from .models import Page, PageRead, Tag
class PageAdmin(admin.ModelAdmin):
search_fields = ["title"]
list_display = ["title", "parent", "updated"]
prepopulated_fields = {"slug": ("title",)}
readonly_fields = ["updated"]
ordering = ["parent", "title"]
filter_ho... | from django.contrib import admin
from .models import Page, PageRead, Tag
class PageAdmin(admin.ModelAdmin):
search_fields = ["title"]
list_display = ["title", "parent", "updated"]
prepopulated_fields = {"slug": ("title",)}
readonly_fields = ["updated"]
ordering = ["parent", "title"]
filter_ho... | <commit_before>from django.contrib import admin
from .models import Page, PageRead, Tag
class PageAdmin(admin.ModelAdmin):
search_fields = ["title"]
list_display = ["title", "parent", "updated"]
prepopulated_fields = {"slug": ("title",)}
readonly_fields = ["updated"]
ordering = ["parent", "title"... | from django.contrib import admin
from .models import Page, PageRead, Tag
class PageAdmin(admin.ModelAdmin):
search_fields = ["title"]
list_display = ["title", "parent", "updated"]
prepopulated_fields = {"slug": ("title",)}
readonly_fields = ["updated"]
ordering = ["parent", "title"]
filter_ho... | from django.contrib import admin
from .models import Page, PageRead, Tag
class PageAdmin(admin.ModelAdmin):
search_fields = ["title"]
list_display = ["title", "parent", "updated"]
prepopulated_fields = {"slug": ("title",)}
readonly_fields = ["updated"]
ordering = ["parent", "title"]
filter_ho... | <commit_before>from django.contrib import admin
from .models import Page, PageRead, Tag
class PageAdmin(admin.ModelAdmin):
search_fields = ["title"]
list_display = ["title", "parent", "updated"]
prepopulated_fields = {"slug": ("title",)}
readonly_fields = ["updated"]
ordering = ["parent", "title"... |
f76783ddb616c74e22feb003cb12952375cad658 | corehq/apps/hqwebapp/encoders.py | corehq/apps/hqwebapp/encoders.py | import json
import datetime
from django.utils.encoding import force_unicode
from django.utils.functional import Promise
class LazyEncoder(json.JSONEncoder):
"""Taken from https://github.com/tomchristie/django-rest-framework/issues/87
This makes sure that ugettext_lazy refrences in a dict are properly evaluate... | import json
import datetime
from decimal import Decimal
from django.utils.encoding import force_unicode
from django.utils.functional import Promise
class DecimalEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, Decimal):
return str(obj)
return super(DecimalEncoder, ... | Fix for json encoding Decimal values | Fix for json encoding Decimal values
| Python | bsd-3-clause | SEL-Columbia/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,SEL-Columbia/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,SEL-Columbia/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare... | import json
import datetime
from django.utils.encoding import force_unicode
from django.utils.functional import Promise
class LazyEncoder(json.JSONEncoder):
"""Taken from https://github.com/tomchristie/django-rest-framework/issues/87
This makes sure that ugettext_lazy refrences in a dict are properly evaluate... | import json
import datetime
from decimal import Decimal
from django.utils.encoding import force_unicode
from django.utils.functional import Promise
class DecimalEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, Decimal):
return str(obj)
return super(DecimalEncoder, ... | <commit_before>import json
import datetime
from django.utils.encoding import force_unicode
from django.utils.functional import Promise
class LazyEncoder(json.JSONEncoder):
"""Taken from https://github.com/tomchristie/django-rest-framework/issues/87
This makes sure that ugettext_lazy refrences in a dict are pr... | import json
import datetime
from decimal import Decimal
from django.utils.encoding import force_unicode
from django.utils.functional import Promise
class DecimalEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, Decimal):
return str(obj)
return super(DecimalEncoder, ... | import json
import datetime
from django.utils.encoding import force_unicode
from django.utils.functional import Promise
class LazyEncoder(json.JSONEncoder):
"""Taken from https://github.com/tomchristie/django-rest-framework/issues/87
This makes sure that ugettext_lazy refrences in a dict are properly evaluate... | <commit_before>import json
import datetime
from django.utils.encoding import force_unicode
from django.utils.functional import Promise
class LazyEncoder(json.JSONEncoder):
"""Taken from https://github.com/tomchristie/django-rest-framework/issues/87
This makes sure that ugettext_lazy refrences in a dict are pr... |
991973e554758e7a9881453d7668925902e610b9 | tests.py | tests.py | #!/usr/bin/env python
import unittest
import git_mnemonic as gm
class GitMnemonicTests(unittest.TestCase):
def test_encode(self):
self.assertTrue(gm.encode("master"))
def test_decode(self):
self.assertTrue(gm.decode("bis alo ama aha"))
def test_invertible(self):
once = gm.encode... | #!/usr/bin/env python
import unittest
import git_mnemonic as gm
class GitMnemonicTests(unittest.TestCase):
def test_encode(self):
self.assertTrue(gm.encode("master"))
def test_decode(self):
self.assertTrue(gm.decode("bis alo ama aha"))
def test_invertible(self):
once = gm.encode... | Make unittest test runner work in older pythons | Make unittest test runner work in older pythons
| Python | mit | glenjamin/git-mnemonic | #!/usr/bin/env python
import unittest
import git_mnemonic as gm
class GitMnemonicTests(unittest.TestCase):
def test_encode(self):
self.assertTrue(gm.encode("master"))
def test_decode(self):
self.assertTrue(gm.decode("bis alo ama aha"))
def test_invertible(self):
once = gm.encode... | #!/usr/bin/env python
import unittest
import git_mnemonic as gm
class GitMnemonicTests(unittest.TestCase):
def test_encode(self):
self.assertTrue(gm.encode("master"))
def test_decode(self):
self.assertTrue(gm.decode("bis alo ama aha"))
def test_invertible(self):
once = gm.encode... | <commit_before>#!/usr/bin/env python
import unittest
import git_mnemonic as gm
class GitMnemonicTests(unittest.TestCase):
def test_encode(self):
self.assertTrue(gm.encode("master"))
def test_decode(self):
self.assertTrue(gm.decode("bis alo ama aha"))
def test_invertible(self):
o... | #!/usr/bin/env python
import unittest
import git_mnemonic as gm
class GitMnemonicTests(unittest.TestCase):
def test_encode(self):
self.assertTrue(gm.encode("master"))
def test_decode(self):
self.assertTrue(gm.decode("bis alo ama aha"))
def test_invertible(self):
once = gm.encode... | #!/usr/bin/env python
import unittest
import git_mnemonic as gm
class GitMnemonicTests(unittest.TestCase):
def test_encode(self):
self.assertTrue(gm.encode("master"))
def test_decode(self):
self.assertTrue(gm.decode("bis alo ama aha"))
def test_invertible(self):
once = gm.encode... | <commit_before>#!/usr/bin/env python
import unittest
import git_mnemonic as gm
class GitMnemonicTests(unittest.TestCase):
def test_encode(self):
self.assertTrue(gm.encode("master"))
def test_decode(self):
self.assertTrue(gm.decode("bis alo ama aha"))
def test_invertible(self):
o... |
cb08d25f49b8b4c5177c8afdd9a69330992ee854 | tests/replay/test_replay.py | tests/replay/test_replay.py | # -*- coding: utf-8 -*-
"""
test_replay
-----------
"""
import pytest
from cookiecutter import replay, main, exceptions
def test_get_replay_file_name():
"""Make sure that replay.get_file_name generates a valid json file path."""
assert replay.get_file_name('foo', 'bar') == 'foo/bar.json'
@pytest.fixture(... | # -*- coding: utf-8 -*-
"""
test_replay
-----------
"""
import pytest
from cookiecutter import replay, main, exceptions
def test_get_replay_file_name():
"""Make sure that replay.get_file_name generates a valid json file path."""
assert replay.get_file_name('foo', 'bar') == 'foo/bar.json'
@pytest.fixture(... | Add tests for a correct behaviour in cookiecutter.main for replay | Add tests for a correct behaviour in cookiecutter.main for replay
| Python | bsd-3-clause | christabor/cookiecutter,luzfcb/cookiecutter,hackebrot/cookiecutter,cguardia/cookiecutter,pjbull/cookiecutter,dajose/cookiecutter,michaeljoseph/cookiecutter,moi65/cookiecutter,terryjbates/cookiecutter,takeflight/cookiecutter,terryjbates/cookiecutter,luzfcb/cookiecutter,agconti/cookiecutter,cguardia/cookiecutter,christab... | # -*- coding: utf-8 -*-
"""
test_replay
-----------
"""
import pytest
from cookiecutter import replay, main, exceptions
def test_get_replay_file_name():
"""Make sure that replay.get_file_name generates a valid json file path."""
assert replay.get_file_name('foo', 'bar') == 'foo/bar.json'
@pytest.fixture(... | # -*- coding: utf-8 -*-
"""
test_replay
-----------
"""
import pytest
from cookiecutter import replay, main, exceptions
def test_get_replay_file_name():
"""Make sure that replay.get_file_name generates a valid json file path."""
assert replay.get_file_name('foo', 'bar') == 'foo/bar.json'
@pytest.fixture(... | <commit_before># -*- coding: utf-8 -*-
"""
test_replay
-----------
"""
import pytest
from cookiecutter import replay, main, exceptions
def test_get_replay_file_name():
"""Make sure that replay.get_file_name generates a valid json file path."""
assert replay.get_file_name('foo', 'bar') == 'foo/bar.json'
@... | # -*- coding: utf-8 -*-
"""
test_replay
-----------
"""
import pytest
from cookiecutter import replay, main, exceptions
def test_get_replay_file_name():
"""Make sure that replay.get_file_name generates a valid json file path."""
assert replay.get_file_name('foo', 'bar') == 'foo/bar.json'
@pytest.fixture(... | # -*- coding: utf-8 -*-
"""
test_replay
-----------
"""
import pytest
from cookiecutter import replay, main, exceptions
def test_get_replay_file_name():
"""Make sure that replay.get_file_name generates a valid json file path."""
assert replay.get_file_name('foo', 'bar') == 'foo/bar.json'
@pytest.fixture(... | <commit_before># -*- coding: utf-8 -*-
"""
test_replay
-----------
"""
import pytest
from cookiecutter import replay, main, exceptions
def test_get_replay_file_name():
"""Make sure that replay.get_file_name generates a valid json file path."""
assert replay.get_file_name('foo', 'bar') == 'foo/bar.json'
@... |
9547988a1a9ef8faf22d9bfa881f4e542637fd46 | utils.py | utils.py | import xmlrpclib
import cPickle
import subprocess
from time import sleep
p = None
s = None
def start_plot_server():
global p
if p is None:
p = subprocess.Popen(["python", "plot_server.py"])
def stop_plot_server():
if p is not None:
p.terminate()
sleep(0.01)
p.kill()
def p... | import xmlrpclib
import cPickle
import subprocess
from time import sleep
p = None
s = None
def start_plot_server():
global p
if p is None:
p = subprocess.Popen(["python", "plot_server.py"])
def stop_plot_server():
if p is not None:
p.terminate()
sleep(0.01)
p.kill()
def p... | Establish connection only when needed | Establish connection only when needed
| Python | bsd-3-clause | certik/mhd-hermes,certik/mhd-hermes | import xmlrpclib
import cPickle
import subprocess
from time import sleep
p = None
s = None
def start_plot_server():
global p
if p is None:
p = subprocess.Popen(["python", "plot_server.py"])
def stop_plot_server():
if p is not None:
p.terminate()
sleep(0.01)
p.kill()
def p... | import xmlrpclib
import cPickle
import subprocess
from time import sleep
p = None
s = None
def start_plot_server():
global p
if p is None:
p = subprocess.Popen(["python", "plot_server.py"])
def stop_plot_server():
if p is not None:
p.terminate()
sleep(0.01)
p.kill()
def p... | <commit_before>import xmlrpclib
import cPickle
import subprocess
from time import sleep
p = None
s = None
def start_plot_server():
global p
if p is None:
p = subprocess.Popen(["python", "plot_server.py"])
def stop_plot_server():
if p is not None:
p.terminate()
sleep(0.01)
... | import xmlrpclib
import cPickle
import subprocess
from time import sleep
p = None
s = None
def start_plot_server():
global p
if p is None:
p = subprocess.Popen(["python", "plot_server.py"])
def stop_plot_server():
if p is not None:
p.terminate()
sleep(0.01)
p.kill()
def p... | import xmlrpclib
import cPickle
import subprocess
from time import sleep
p = None
s = None
def start_plot_server():
global p
if p is None:
p = subprocess.Popen(["python", "plot_server.py"])
def stop_plot_server():
if p is not None:
p.terminate()
sleep(0.01)
p.kill()
def p... | <commit_before>import xmlrpclib
import cPickle
import subprocess
from time import sleep
p = None
s = None
def start_plot_server():
global p
if p is None:
p = subprocess.Popen(["python", "plot_server.py"])
def stop_plot_server():
if p is not None:
p.terminate()
sleep(0.01)
... |
f3b9cc6392e4c271ae11417357ecdc196f1c3ae7 | python_scripts/extractor_python_readability_server.py | python_scripts/extractor_python_readability_server.py | #!/usr/bin/python
import sys
import os
import glob
#sys.path.append(os.path.join(os.path.dirname(__file__), "gen-py"))
sys.path.append(os.path.join(os.path.dirname(__file__),"gen-py/thrift_solr/"))
sys.path.append(os.path.dirname(__file__) )
from thrift.transport import TSocket
from thrift.server import TServer
#im... | #!/usr/bin/python
import sys
import os
import glob
#sys.path.append(os.path.join(os.path.dirname(__file__), "gen-py"))
sys.path.append(os.path.join(os.path.dirname(__file__),"gen-py/thrift_solr/"))
sys.path.append(os.path.dirname(__file__) )
from thrift.transport import TSocket
from thrift.transport import TTranspor... | Use the TBinaryProtocolAccelerated protocol instead of TBinaryProtocol to improve performance. | Use the TBinaryProtocolAccelerated protocol instead of TBinaryProtocol to improve performance.
| Python | agpl-3.0 | AchyuthIIIT/mediacloud,berkmancenter/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,berkmancenter/mediacloud,AchyuthIIIT/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,berkmancenter/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT... | #!/usr/bin/python
import sys
import os
import glob
#sys.path.append(os.path.join(os.path.dirname(__file__), "gen-py"))
sys.path.append(os.path.join(os.path.dirname(__file__),"gen-py/thrift_solr/"))
sys.path.append(os.path.dirname(__file__) )
from thrift.transport import TSocket
from thrift.server import TServer
#im... | #!/usr/bin/python
import sys
import os
import glob
#sys.path.append(os.path.join(os.path.dirname(__file__), "gen-py"))
sys.path.append(os.path.join(os.path.dirname(__file__),"gen-py/thrift_solr/"))
sys.path.append(os.path.dirname(__file__) )
from thrift.transport import TSocket
from thrift.transport import TTranspor... | <commit_before>#!/usr/bin/python
import sys
import os
import glob
#sys.path.append(os.path.join(os.path.dirname(__file__), "gen-py"))
sys.path.append(os.path.join(os.path.dirname(__file__),"gen-py/thrift_solr/"))
sys.path.append(os.path.dirname(__file__) )
from thrift.transport import TSocket
from thrift.server impo... | #!/usr/bin/python
import sys
import os
import glob
#sys.path.append(os.path.join(os.path.dirname(__file__), "gen-py"))
sys.path.append(os.path.join(os.path.dirname(__file__),"gen-py/thrift_solr/"))
sys.path.append(os.path.dirname(__file__) )
from thrift.transport import TSocket
from thrift.transport import TTranspor... | #!/usr/bin/python
import sys
import os
import glob
#sys.path.append(os.path.join(os.path.dirname(__file__), "gen-py"))
sys.path.append(os.path.join(os.path.dirname(__file__),"gen-py/thrift_solr/"))
sys.path.append(os.path.dirname(__file__) )
from thrift.transport import TSocket
from thrift.server import TServer
#im... | <commit_before>#!/usr/bin/python
import sys
import os
import glob
#sys.path.append(os.path.join(os.path.dirname(__file__), "gen-py"))
sys.path.append(os.path.join(os.path.dirname(__file__),"gen-py/thrift_solr/"))
sys.path.append(os.path.dirname(__file__) )
from thrift.transport import TSocket
from thrift.server impo... |
a6034ffa4d81bb57c5d86876ee72e0436426e6d2 | imhotep_foodcritic/plugin.py | imhotep_foodcritic/plugin.py | from imhotep.tools import Tool
from collections import defaultdict
import json
import os
import logging
log = logging.getLogger(__name__)
class FoodCritic(Tool):
def invoke(self,
dirname,
filenames=set(),
config_file=None,
file_list=None):
retv... | from imhotep.tools import Tool
from collections import defaultdict
import json
import os
import logging
log = logging.getLogger(__name__)
class FoodCritic(Tool):
def invoke(self,
dirname,
filenames=set(),
config_file=None):
retval = defaultdict(lambda: defaul... | Update support for passing in filenames. | Update support for passing in filenames.
This shit is gross
| Python | mit | scottjab/imhotep_foodcritic | from imhotep.tools import Tool
from collections import defaultdict
import json
import os
import logging
log = logging.getLogger(__name__)
class FoodCritic(Tool):
def invoke(self,
dirname,
filenames=set(),
config_file=None,
file_list=None):
retv... | from imhotep.tools import Tool
from collections import defaultdict
import json
import os
import logging
log = logging.getLogger(__name__)
class FoodCritic(Tool):
def invoke(self,
dirname,
filenames=set(),
config_file=None):
retval = defaultdict(lambda: defaul... | <commit_before>from imhotep.tools import Tool
from collections import defaultdict
import json
import os
import logging
log = logging.getLogger(__name__)
class FoodCritic(Tool):
def invoke(self,
dirname,
filenames=set(),
config_file=None,
file_list=None... | from imhotep.tools import Tool
from collections import defaultdict
import json
import os
import logging
log = logging.getLogger(__name__)
class FoodCritic(Tool):
def invoke(self,
dirname,
filenames=set(),
config_file=None):
retval = defaultdict(lambda: defaul... | from imhotep.tools import Tool
from collections import defaultdict
import json
import os
import logging
log = logging.getLogger(__name__)
class FoodCritic(Tool):
def invoke(self,
dirname,
filenames=set(),
config_file=None,
file_list=None):
retv... | <commit_before>from imhotep.tools import Tool
from collections import defaultdict
import json
import os
import logging
log = logging.getLogger(__name__)
class FoodCritic(Tool):
def invoke(self,
dirname,
filenames=set(),
config_file=None,
file_list=None... |
3ce1b928f36c314ab07c334843b2db96626f469e | kyokai/asphalt.py | kyokai/asphalt.py | """
Asphalt framework mixin for Kyokai.
"""
import logging
import asyncio
from functools import partial
from typing import Union
from asphalt.core import Component, resolve_reference, Context
from typeguard import check_argument_types
from kyokai.app import Kyokai
from kyokai.protocol import KyokaiProtocol
from kyok... | """
Asphalt framework mixin for Kyokai.
"""
import logging
import asyncio
from functools import partial
from typing import Union
from asphalt.core import Component, resolve_reference, Context
from typeguard import check_argument_types
from kyokai.app import Kyokai
from kyokai.protocol import KyokaiProtocol
from kyok... | Make this into a partial to get the protocol correctly. | Make this into a partial to get the protocol correctly.
| Python | mit | SunDwarf/Kyoukai | """
Asphalt framework mixin for Kyokai.
"""
import logging
import asyncio
from functools import partial
from typing import Union
from asphalt.core import Component, resolve_reference, Context
from typeguard import check_argument_types
from kyokai.app import Kyokai
from kyokai.protocol import KyokaiProtocol
from kyok... | """
Asphalt framework mixin for Kyokai.
"""
import logging
import asyncio
from functools import partial
from typing import Union
from asphalt.core import Component, resolve_reference, Context
from typeguard import check_argument_types
from kyokai.app import Kyokai
from kyokai.protocol import KyokaiProtocol
from kyok... | <commit_before>"""
Asphalt framework mixin for Kyokai.
"""
import logging
import asyncio
from functools import partial
from typing import Union
from asphalt.core import Component, resolve_reference, Context
from typeguard import check_argument_types
from kyokai.app import Kyokai
from kyokai.protocol import KyokaiPro... | """
Asphalt framework mixin for Kyokai.
"""
import logging
import asyncio
from functools import partial
from typing import Union
from asphalt.core import Component, resolve_reference, Context
from typeguard import check_argument_types
from kyokai.app import Kyokai
from kyokai.protocol import KyokaiProtocol
from kyok... | """
Asphalt framework mixin for Kyokai.
"""
import logging
import asyncio
from functools import partial
from typing import Union
from asphalt.core import Component, resolve_reference, Context
from typeguard import check_argument_types
from kyokai.app import Kyokai
from kyokai.protocol import KyokaiProtocol
from kyok... | <commit_before>"""
Asphalt framework mixin for Kyokai.
"""
import logging
import asyncio
from functools import partial
from typing import Union
from asphalt.core import Component, resolve_reference, Context
from typeguard import check_argument_types
from kyokai.app import Kyokai
from kyokai.protocol import KyokaiPro... |
b352c3e1f5e8812d29f2e8a1bca807bea5da8cc4 | test/test_hx_launcher.py | test/test_hx_launcher.py | import pytest_twisted
from hendrix.ux import main
from hendrix.options import HendrixOptionParser
def test_no_arguments_gives_help_text(mocker):
class MockFile(object):
@classmethod
def write(cls, whatever):
cls.things_written = whatever
class MockStdOut(object):
@class... | from hendrix.options import HendrixOptionParser
from hendrix.ux import main
def test_no_arguments_gives_help_text(mocker):
class MockFile(object):
@classmethod
def write(cls, whatever):
cls.things_written = whatever
class MockStdOut(object):
@classmethod
def write... | Test for the hx launcher. | Test for the hx launcher.
| Python | mit | hangarunderground/hendrix,hendrix/hendrix,hangarunderground/hendrix,hendrix/hendrix,jMyles/hendrix,hendrix/hendrix,jMyles/hendrix,hangarunderground/hendrix,hangarunderground/hendrix,jMyles/hendrix | import pytest_twisted
from hendrix.ux import main
from hendrix.options import HendrixOptionParser
def test_no_arguments_gives_help_text(mocker):
class MockFile(object):
@classmethod
def write(cls, whatever):
cls.things_written = whatever
class MockStdOut(object):
@class... | from hendrix.options import HendrixOptionParser
from hendrix.ux import main
def test_no_arguments_gives_help_text(mocker):
class MockFile(object):
@classmethod
def write(cls, whatever):
cls.things_written = whatever
class MockStdOut(object):
@classmethod
def write... | <commit_before>import pytest_twisted
from hendrix.ux import main
from hendrix.options import HendrixOptionParser
def test_no_arguments_gives_help_text(mocker):
class MockFile(object):
@classmethod
def write(cls, whatever):
cls.things_written = whatever
class MockStdOut(object):
... | from hendrix.options import HendrixOptionParser
from hendrix.ux import main
def test_no_arguments_gives_help_text(mocker):
class MockFile(object):
@classmethod
def write(cls, whatever):
cls.things_written = whatever
class MockStdOut(object):
@classmethod
def write... | import pytest_twisted
from hendrix.ux import main
from hendrix.options import HendrixOptionParser
def test_no_arguments_gives_help_text(mocker):
class MockFile(object):
@classmethod
def write(cls, whatever):
cls.things_written = whatever
class MockStdOut(object):
@class... | <commit_before>import pytest_twisted
from hendrix.ux import main
from hendrix.options import HendrixOptionParser
def test_no_arguments_gives_help_text(mocker):
class MockFile(object):
@classmethod
def write(cls, whatever):
cls.things_written = whatever
class MockStdOut(object):
... |
ad21c9255f6246944cd032ad50082c0aca46fcb3 | neurokernel/tools/mpi.py | neurokernel/tools/mpi.py | #!/usr/bin/env python
"""
MPI utilities.
"""
from mpi4py import MPI
import twiggy
class MPIOutput(twiggy.outputs.Output):
"""
Output messages to a file via MPI I/O.
"""
def __init__(self, name, format, comm,
mode=MPI.MODE_CREATE | MPI.MODE_WRONLY,
close_atexit=True)... | #!/usr/bin/env python
"""
MPI utilities.
"""
from mpi4py import MPI
import twiggy
class MPIOutput(twiggy.outputs.Output):
"""
Output messages to a file via MPI I/O.
"""
def __init__(self, name, format, comm,
mode=MPI.MODE_CREATE | MPI.MODE_WRONLY,
close_atexit=True)... | Call MPIOutput.file.Sync() in MPIOutput.file._write() to prevent log lines from intermittently being lost. | Call MPIOutput.file.Sync() in MPIOutput.file._write() to prevent log lines from intermittently being lost.
| Python | bsd-3-clause | cerrno/neurokernel | #!/usr/bin/env python
"""
MPI utilities.
"""
from mpi4py import MPI
import twiggy
class MPIOutput(twiggy.outputs.Output):
"""
Output messages to a file via MPI I/O.
"""
def __init__(self, name, format, comm,
mode=MPI.MODE_CREATE | MPI.MODE_WRONLY,
close_atexit=True)... | #!/usr/bin/env python
"""
MPI utilities.
"""
from mpi4py import MPI
import twiggy
class MPIOutput(twiggy.outputs.Output):
"""
Output messages to a file via MPI I/O.
"""
def __init__(self, name, format, comm,
mode=MPI.MODE_CREATE | MPI.MODE_WRONLY,
close_atexit=True)... | <commit_before>#!/usr/bin/env python
"""
MPI utilities.
"""
from mpi4py import MPI
import twiggy
class MPIOutput(twiggy.outputs.Output):
"""
Output messages to a file via MPI I/O.
"""
def __init__(self, name, format, comm,
mode=MPI.MODE_CREATE | MPI.MODE_WRONLY,
clo... | #!/usr/bin/env python
"""
MPI utilities.
"""
from mpi4py import MPI
import twiggy
class MPIOutput(twiggy.outputs.Output):
"""
Output messages to a file via MPI I/O.
"""
def __init__(self, name, format, comm,
mode=MPI.MODE_CREATE | MPI.MODE_WRONLY,
close_atexit=True)... | #!/usr/bin/env python
"""
MPI utilities.
"""
from mpi4py import MPI
import twiggy
class MPIOutput(twiggy.outputs.Output):
"""
Output messages to a file via MPI I/O.
"""
def __init__(self, name, format, comm,
mode=MPI.MODE_CREATE | MPI.MODE_WRONLY,
close_atexit=True)... | <commit_before>#!/usr/bin/env python
"""
MPI utilities.
"""
from mpi4py import MPI
import twiggy
class MPIOutput(twiggy.outputs.Output):
"""
Output messages to a file via MPI I/O.
"""
def __init__(self, name, format, comm,
mode=MPI.MODE_CREATE | MPI.MODE_WRONLY,
clo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.