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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aacfb96c55c5179e768745f06b1586b3c0f70969 | pygp/utils/abc.py | pygp/utils/abc.py | """
Modifications to ABC to allow for additional metaclass actions.
"""
# future imports
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
# global imports
from abc import ABCMeta as ABCMeta_
from abc import abstractmethod
# exported symbols
__all__ = ['ABCM... | """
Modifications to ABC to allow for additional metaclass actions.
"""
# future imports
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
# global imports
from abc import ABCMeta as ABCMeta_
from abc import abstractmethod
# exported symbols
__all__ = ['ABCM... | Update the modified ABCMeta to copy docstrings to abstractmethods. | Update the modified ABCMeta to copy docstrings to abstractmethods.
| Python | bsd-2-clause | mwhoffman/pygp | """
Modifications to ABC to allow for additional metaclass actions.
"""
# future imports
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
# global imports
from abc import ABCMeta as ABCMeta_
from abc import abstractmethod
# exported symbols
__all__ = ['ABCM... | """
Modifications to ABC to allow for additional metaclass actions.
"""
# future imports
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
# global imports
from abc import ABCMeta as ABCMeta_
from abc import abstractmethod
# exported symbols
__all__ = ['ABCM... | <commit_before>"""
Modifications to ABC to allow for additional metaclass actions.
"""
# future imports
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
# global imports
from abc import ABCMeta as ABCMeta_
from abc import abstractmethod
# exported symbols
_... | """
Modifications to ABC to allow for additional metaclass actions.
"""
# future imports
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
# global imports
from abc import ABCMeta as ABCMeta_
from abc import abstractmethod
# exported symbols
__all__ = ['ABCM... | """
Modifications to ABC to allow for additional metaclass actions.
"""
# future imports
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
# global imports
from abc import ABCMeta as ABCMeta_
from abc import abstractmethod
# exported symbols
__all__ = ['ABCM... | <commit_before>"""
Modifications to ABC to allow for additional metaclass actions.
"""
# future imports
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
# global imports
from abc import ABCMeta as ABCMeta_
from abc import abstractmethod
# exported symbols
_... |
738e4ddd0043c204095767f1f7458db9e6948262 | tensorflow/tools/docker/jupyter_notebook_config.py | tensorflow/tools/docker/jupyter_notebook_config.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Allow disabling password and token auth on jupyter notebooks | Allow disabling password and token auth on jupyter notebooks | Python | apache-2.0 | Intel-tensorflow/tensorflow,renyi533/tensorflow,hsaputra/tensorflow,zasdfgbnm/tensorflow,dendisuhubdy/tensorflow,ageron/tensorflow,pavelchristof/gomoku-ai,av8ramit/tensorflow,hfp/tensorflow-xsmm,alivecor/tensorflow,Xeralux/tensorflow,seanli9jan/tensorflow,DavidNorman/tensorflow,ghchinoy/tensorflow,seanli9jan/tensorflow... | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | <commit_before># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | <commit_before># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
99a31b3396d88629a5f866ebad0122f111d75778 | Lib/test/leakers/test_gestalt.py | Lib/test/leakers/test_gestalt.py |
import sys
if sys.platform != 'darwin':
raise ValueError, "This test only leaks on Mac OS X'
def leak():
# taken from platform._mac_ver_lookup()
from gestalt import gestalt
import MacOS
try:
gestalt('sysu')
except MacOS.Error:
pass
| import sys
if sys.platform != 'darwin':
raise ValueError, "This test only leaks on Mac OS X"
def leak():
# taken from platform._mac_ver_lookup()
from gestalt import gestalt
import MacOS
try:
gestalt('sysu')
except MacOS.Error:
pass
| Fix mismatch opening and closing quotes on a string. | Fix mismatch opening and closing quotes on a string.
| Python | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator |
import sys
if sys.platform != 'darwin':
raise ValueError, "This test only leaks on Mac OS X'
def leak():
# taken from platform._mac_ver_lookup()
from gestalt import gestalt
import MacOS
try:
gestalt('sysu')
except MacOS.Error:
pass
Fix mismatch opening and closing quotes on a... | import sys
if sys.platform != 'darwin':
raise ValueError, "This test only leaks on Mac OS X"
def leak():
# taken from platform._mac_ver_lookup()
from gestalt import gestalt
import MacOS
try:
gestalt('sysu')
except MacOS.Error:
pass
| <commit_before>
import sys
if sys.platform != 'darwin':
raise ValueError, "This test only leaks on Mac OS X'
def leak():
# taken from platform._mac_ver_lookup()
from gestalt import gestalt
import MacOS
try:
gestalt('sysu')
except MacOS.Error:
pass
<commit_msg>Fix mismatch open... | import sys
if sys.platform != 'darwin':
raise ValueError, "This test only leaks on Mac OS X"
def leak():
# taken from platform._mac_ver_lookup()
from gestalt import gestalt
import MacOS
try:
gestalt('sysu')
except MacOS.Error:
pass
|
import sys
if sys.platform != 'darwin':
raise ValueError, "This test only leaks on Mac OS X'
def leak():
# taken from platform._mac_ver_lookup()
from gestalt import gestalt
import MacOS
try:
gestalt('sysu')
except MacOS.Error:
pass
Fix mismatch opening and closing quotes on a... | <commit_before>
import sys
if sys.platform != 'darwin':
raise ValueError, "This test only leaks on Mac OS X'
def leak():
# taken from platform._mac_ver_lookup()
from gestalt import gestalt
import MacOS
try:
gestalt('sysu')
except MacOS.Error:
pass
<commit_msg>Fix mismatch open... |
ee85d2fffc0e42022be66bf667005eb44391cb9e | django/similarities/utils.py | django/similarities/utils.py | import echonest
from artists.models import Artist
from echonest.models import SimilarResponse
from users.models import User
from .models import (GeneralArtist, UserSimilarity, Similarity,
update_similarities)
def add_new_similarities(artist, force_update=False):
similarities = []
response... | from django.db.models import Q
import echonest
from artists.models import Artist
from echonest.models import SimilarResponse
from users.models import User
from .models import (GeneralArtist, UserSimilarity, Similarity,
update_similarities)
def add_new_similarities(artist, force_update=False):
... | Order similar artist results properly | Order similar artist results properly
| Python | bsd-3-clause | FreeMusicNinja/freemusic.ninja,FreeMusicNinja/freemusic.ninja | import echonest
from artists.models import Artist
from echonest.models import SimilarResponse
from users.models import User
from .models import (GeneralArtist, UserSimilarity, Similarity,
update_similarities)
def add_new_similarities(artist, force_update=False):
similarities = []
response... | from django.db.models import Q
import echonest
from artists.models import Artist
from echonest.models import SimilarResponse
from users.models import User
from .models import (GeneralArtist, UserSimilarity, Similarity,
update_similarities)
def add_new_similarities(artist, force_update=False):
... | <commit_before>import echonest
from artists.models import Artist
from echonest.models import SimilarResponse
from users.models import User
from .models import (GeneralArtist, UserSimilarity, Similarity,
update_similarities)
def add_new_similarities(artist, force_update=False):
similarities = ... | from django.db.models import Q
import echonest
from artists.models import Artist
from echonest.models import SimilarResponse
from users.models import User
from .models import (GeneralArtist, UserSimilarity, Similarity,
update_similarities)
def add_new_similarities(artist, force_update=False):
... | import echonest
from artists.models import Artist
from echonest.models import SimilarResponse
from users.models import User
from .models import (GeneralArtist, UserSimilarity, Similarity,
update_similarities)
def add_new_similarities(artist, force_update=False):
similarities = []
response... | <commit_before>import echonest
from artists.models import Artist
from echonest.models import SimilarResponse
from users.models import User
from .models import (GeneralArtist, UserSimilarity, Similarity,
update_similarities)
def add_new_similarities(artist, force_update=False):
similarities = ... |
d72f5bb03e2fcab85fae164df8d0eb76bb2d1ad7 | api/views.py | api/views.py | from django.shortcuts import render
from django.views.generic import View
from .utils import apimethod
# Create your views here.
class StatusView(View):
@apimethod
def get(self, request):
return {
'web': 'UP', #Tautological: If we're responding, we're up
'xmpp': 'UNK'... | from django.shortcuts import render
from django.views.generic import View
from .utils import apimethod
# Create your views here.
class StatusView(View):
@apimethod
def get(self, request):
return {
'web': 'UP', #Tautological: If we're responding, we're up
'xmpp': 'UNK'... | Add coffee status to API | Add coffee status to API
| Python | mit | Kromey/fbxnano,Kromey/fbxnano,Kromey/akwriters,Kromey/fbxnano,Kromey/akwriters,Kromey/akwriters,Kromey/akwriters,Kromey/fbxnano | from django.shortcuts import render
from django.views.generic import View
from .utils import apimethod
# Create your views here.
class StatusView(View):
@apimethod
def get(self, request):
return {
'web': 'UP', #Tautological: If we're responding, we're up
'xmpp': 'UNK'... | from django.shortcuts import render
from django.views.generic import View
from .utils import apimethod
# Create your views here.
class StatusView(View):
@apimethod
def get(self, request):
return {
'web': 'UP', #Tautological: If we're responding, we're up
'xmpp': 'UNK'... | <commit_before>from django.shortcuts import render
from django.views.generic import View
from .utils import apimethod
# Create your views here.
class StatusView(View):
@apimethod
def get(self, request):
return {
'web': 'UP', #Tautological: If we're responding, we're up
... | from django.shortcuts import render
from django.views.generic import View
from .utils import apimethod
# Create your views here.
class StatusView(View):
@apimethod
def get(self, request):
return {
'web': 'UP', #Tautological: If we're responding, we're up
'xmpp': 'UNK'... | from django.shortcuts import render
from django.views.generic import View
from .utils import apimethod
# Create your views here.
class StatusView(View):
@apimethod
def get(self, request):
return {
'web': 'UP', #Tautological: If we're responding, we're up
'xmpp': 'UNK'... | <commit_before>from django.shortcuts import render
from django.views.generic import View
from .utils import apimethod
# Create your views here.
class StatusView(View):
@apimethod
def get(self, request):
return {
'web': 'UP', #Tautological: If we're responding, we're up
... |
9f967406e634fcb340fb8af0b8f5981661936038 | profile_bs_xf03id/startup/01-bluesky.py | profile_bs_xf03id/startup/01-bluesky.py | from ophyd.commands import setup_ophyd
setup_ophyd()
from ophyd.commands import *
from bluesky.callbacks import *
from bluesky.plans import *
# from bluesky.spec_api import *
from bluesky.utils import install_qt_kicker
from bluesky.global_state import (get_gs, abort, stop, resume)
from databroker import (DataBroker a... | from ophyd.commands import setup_ophyd
setup_ophyd()
from ophyd.commands import *
from bluesky.callbacks import *
from bluesky.plans import *
# from bluesky.spec_api import *
from bluesky.utils import (install_qt_kicker, register_transform)
from bluesky.global_state import (get_gs, abort, stop, resume)
from databroke... | Add magic for RE(...) calls | Add magic for RE(...) calls
| Python | bsd-2-clause | NSLS-II-HXN/ipython_ophyd,NSLS-II-HXN/ipython_ophyd | from ophyd.commands import setup_ophyd
setup_ophyd()
from ophyd.commands import *
from bluesky.callbacks import *
from bluesky.plans import *
# from bluesky.spec_api import *
from bluesky.utils import install_qt_kicker
from bluesky.global_state import (get_gs, abort, stop, resume)
from databroker import (DataBroker a... | from ophyd.commands import setup_ophyd
setup_ophyd()
from ophyd.commands import *
from bluesky.callbacks import *
from bluesky.plans import *
# from bluesky.spec_api import *
from bluesky.utils import (install_qt_kicker, register_transform)
from bluesky.global_state import (get_gs, abort, stop, resume)
from databroke... | <commit_before>from ophyd.commands import setup_ophyd
setup_ophyd()
from ophyd.commands import *
from bluesky.callbacks import *
from bluesky.plans import *
# from bluesky.spec_api import *
from bluesky.utils import install_qt_kicker
from bluesky.global_state import (get_gs, abort, stop, resume)
from databroker impor... | from ophyd.commands import setup_ophyd
setup_ophyd()
from ophyd.commands import *
from bluesky.callbacks import *
from bluesky.plans import *
# from bluesky.spec_api import *
from bluesky.utils import (install_qt_kicker, register_transform)
from bluesky.global_state import (get_gs, abort, stop, resume)
from databroke... | from ophyd.commands import setup_ophyd
setup_ophyd()
from ophyd.commands import *
from bluesky.callbacks import *
from bluesky.plans import *
# from bluesky.spec_api import *
from bluesky.utils import install_qt_kicker
from bluesky.global_state import (get_gs, abort, stop, resume)
from databroker import (DataBroker a... | <commit_before>from ophyd.commands import setup_ophyd
setup_ophyd()
from ophyd.commands import *
from bluesky.callbacks import *
from bluesky.plans import *
# from bluesky.spec_api import *
from bluesky.utils import install_qt_kicker
from bluesky.global_state import (get_gs, abort, stop, resume)
from databroker impor... |
64feb2ed638e43f15b7008507907f7d607ebccf3 | nbgrader/apps/assignapp.py | nbgrader/apps/assignapp.py | from IPython.config.loader import Config
from IPython.config.application import catch_config_error
from IPython.utils.traitlets import Unicode
from nbgrader.apps.customnbconvertapp import CustomNbConvertApp
class AssignApp(CustomNbConvertApp):
name = Unicode(u'nbgrader-assign')
description = Unicode(u'Pre... | from IPython.config.loader import Config
from IPython.utils.traitlets import Unicode
from nbgrader.apps.customnbconvertapp import CustomNbConvertApp
from nbgrader.apps.customnbconvertapp import aliases as base_aliases
from nbgrader.apps.customnbconvertapp import flags as base_flags
aliases = {}
aliases.update(base_al... | Add some flags to nbgrader assign | Add some flags to nbgrader assign
| Python | bsd-3-clause | ellisonbg/nbgrader,modulexcite/nbgrader,jupyter/nbgrader,jupyter/nbgrader,ellisonbg/nbgrader,jdfreder/nbgrader,EdwardJKim/nbgrader,jhamrick/nbgrader,jhamrick/nbgrader,dementrock/nbgrader,EdwardJKim/nbgrader,ellisonbg/nbgrader,dementrock/nbgrader,alope107/nbgrader,MatKallada/nbgrader,jhamrick/nbgrader,ellisonbg/nbgrader... | from IPython.config.loader import Config
from IPython.config.application import catch_config_error
from IPython.utils.traitlets import Unicode
from nbgrader.apps.customnbconvertapp import CustomNbConvertApp
class AssignApp(CustomNbConvertApp):
name = Unicode(u'nbgrader-assign')
description = Unicode(u'Pre... | from IPython.config.loader import Config
from IPython.utils.traitlets import Unicode
from nbgrader.apps.customnbconvertapp import CustomNbConvertApp
from nbgrader.apps.customnbconvertapp import aliases as base_aliases
from nbgrader.apps.customnbconvertapp import flags as base_flags
aliases = {}
aliases.update(base_al... | <commit_before>from IPython.config.loader import Config
from IPython.config.application import catch_config_error
from IPython.utils.traitlets import Unicode
from nbgrader.apps.customnbconvertapp import CustomNbConvertApp
class AssignApp(CustomNbConvertApp):
name = Unicode(u'nbgrader-assign')
description ... | from IPython.config.loader import Config
from IPython.utils.traitlets import Unicode
from nbgrader.apps.customnbconvertapp import CustomNbConvertApp
from nbgrader.apps.customnbconvertapp import aliases as base_aliases
from nbgrader.apps.customnbconvertapp import flags as base_flags
aliases = {}
aliases.update(base_al... | from IPython.config.loader import Config
from IPython.config.application import catch_config_error
from IPython.utils.traitlets import Unicode
from nbgrader.apps.customnbconvertapp import CustomNbConvertApp
class AssignApp(CustomNbConvertApp):
name = Unicode(u'nbgrader-assign')
description = Unicode(u'Pre... | <commit_before>from IPython.config.loader import Config
from IPython.config.application import catch_config_error
from IPython.utils.traitlets import Unicode
from nbgrader.apps.customnbconvertapp import CustomNbConvertApp
class AssignApp(CustomNbConvertApp):
name = Unicode(u'nbgrader-assign')
description ... |
ea902f4002344c1cbf56dbd989c27aa1ad41a363 | task_run_system.py | task_run_system.py | import sys
import bson.objectid
import config.global_configuration as global_conf
import database.client
import batch_analysis.trial_runner as trial_runner
def main(*args):
"""
Run a given system with a given image source.
This represents a basic task.
Scripts to run this will be autogenerated by the ... | import sys
import bson.objectid
import config.global_configuration as global_conf
import database.client
import core.image_collection
import core.image_entity
import systems.deep_learning.keras_frcnn
import batch_analysis.trial_runner as trial_runner
def main(*args):
"""
Run a given system with a given image ... | Make the run system task more error friendly | Make the run system task more error friendly
| Python | bsd-2-clause | jskinn/robot-vision-experiment-framework,jskinn/robot-vision-experiment-framework | import sys
import bson.objectid
import config.global_configuration as global_conf
import database.client
import batch_analysis.trial_runner as trial_runner
def main(*args):
"""
Run a given system with a given image source.
This represents a basic task.
Scripts to run this will be autogenerated by the ... | import sys
import bson.objectid
import config.global_configuration as global_conf
import database.client
import core.image_collection
import core.image_entity
import systems.deep_learning.keras_frcnn
import batch_analysis.trial_runner as trial_runner
def main(*args):
"""
Run a given system with a given image ... | <commit_before>import sys
import bson.objectid
import config.global_configuration as global_conf
import database.client
import batch_analysis.trial_runner as trial_runner
def main(*args):
"""
Run a given system with a given image source.
This represents a basic task.
Scripts to run this will be autoge... | import sys
import bson.objectid
import config.global_configuration as global_conf
import database.client
import core.image_collection
import core.image_entity
import systems.deep_learning.keras_frcnn
import batch_analysis.trial_runner as trial_runner
def main(*args):
"""
Run a given system with a given image ... | import sys
import bson.objectid
import config.global_configuration as global_conf
import database.client
import batch_analysis.trial_runner as trial_runner
def main(*args):
"""
Run a given system with a given image source.
This represents a basic task.
Scripts to run this will be autogenerated by the ... | <commit_before>import sys
import bson.objectid
import config.global_configuration as global_conf
import database.client
import batch_analysis.trial_runner as trial_runner
def main(*args):
"""
Run a given system with a given image source.
This represents a basic task.
Scripts to run this will be autoge... |
9e10bbb48f6d19ce7e2363dc843279a5ffb4957e | pywikibot/families/wikivoyage_family.py | pywikibot/families/wikivoyage_family.py | # -*- coding: utf-8 -*-
"""Family module for Wikivoyage."""
#
# (C) Pywikibot team, 2012-2018
#
# Distributed under the terms of the MIT license.
#
# The new wikivoyage family that is hosted at wikimedia
from __future__ import absolute_import, unicode_literals
from pywikibot import family
class Family(family.Subdoma... | # -*- coding: utf-8 -*-
"""Family module for Wikivoyage."""
#
# (C) Pywikibot team, 2012-2018
#
# Distributed under the terms of the MIT license.
#
# The new wikivoyage family that is hosted at wikimedia
from __future__ import absolute_import, unicode_literals
from pywikibot import family
class Family(family.Subdoma... | Add hiwikivoyage to the list of global bot wikis | [IMPR] Add hiwikivoyage to the list of global bot wikis
https://meta.wikimedia.org/wiki/Bot_policy/Implementation
Change-Id: I25246991c177ce499bb63e4dfff46cb03d8e9f59
| Python | mit | PersianWikipedia/pywikibot-core,wikimedia/pywikibot-core,wikimedia/pywikibot-core | # -*- coding: utf-8 -*-
"""Family module for Wikivoyage."""
#
# (C) Pywikibot team, 2012-2018
#
# Distributed under the terms of the MIT license.
#
# The new wikivoyage family that is hosted at wikimedia
from __future__ import absolute_import, unicode_literals
from pywikibot import family
class Family(family.Subdoma... | # -*- coding: utf-8 -*-
"""Family module for Wikivoyage."""
#
# (C) Pywikibot team, 2012-2018
#
# Distributed under the terms of the MIT license.
#
# The new wikivoyage family that is hosted at wikimedia
from __future__ import absolute_import, unicode_literals
from pywikibot import family
class Family(family.Subdoma... | <commit_before># -*- coding: utf-8 -*-
"""Family module for Wikivoyage."""
#
# (C) Pywikibot team, 2012-2018
#
# Distributed under the terms of the MIT license.
#
# The new wikivoyage family that is hosted at wikimedia
from __future__ import absolute_import, unicode_literals
from pywikibot import family
class Family... | # -*- coding: utf-8 -*-
"""Family module for Wikivoyage."""
#
# (C) Pywikibot team, 2012-2018
#
# Distributed under the terms of the MIT license.
#
# The new wikivoyage family that is hosted at wikimedia
from __future__ import absolute_import, unicode_literals
from pywikibot import family
class Family(family.Subdoma... | # -*- coding: utf-8 -*-
"""Family module for Wikivoyage."""
#
# (C) Pywikibot team, 2012-2018
#
# Distributed under the terms of the MIT license.
#
# The new wikivoyage family that is hosted at wikimedia
from __future__ import absolute_import, unicode_literals
from pywikibot import family
class Family(family.Subdoma... | <commit_before># -*- coding: utf-8 -*-
"""Family module for Wikivoyage."""
#
# (C) Pywikibot team, 2012-2018
#
# Distributed under the terms of the MIT license.
#
# The new wikivoyage family that is hosted at wikimedia
from __future__ import absolute_import, unicode_literals
from pywikibot import family
class Family... |
2a494efd72d34ac638763d162559d43fe3705698 | test/test_datac.py | test/test_datac.py | # -*- coding: utf-8 -*-
import datac
import numpy as np
import os
params = {"temp_sun": 6000.}
bandgaps = np.linspace(0, 3.25, 100)
abscissae = datac.generate_abscissae(bandgaps, "bandgap", params)
pwd = os.getcwd()
testdir = "test"
filename = "data.dat"
fqpn = os.path.join(pwd, testdir, filename)
datac.write_json(f... | # -*- coding: utf-8 -*-
import datac
import numpy as np
import os
import unittest
class dummyclass(object):
"""
Simple class for testing `generate_ordinates`
"""
def __init__(self, params):
pass
def fun(self):
"""
Return value of `True`
"""
return True
par... | Add dummy class to test generate_ordinates | Add dummy class to test generate_ordinates
| Python | mit | jrsmith3/datac,jrsmith3/datac | # -*- coding: utf-8 -*-
import datac
import numpy as np
import os
params = {"temp_sun": 6000.}
bandgaps = np.linspace(0, 3.25, 100)
abscissae = datac.generate_abscissae(bandgaps, "bandgap", params)
pwd = os.getcwd()
testdir = "test"
filename = "data.dat"
fqpn = os.path.join(pwd, testdir, filename)
datac.write_json(f... | # -*- coding: utf-8 -*-
import datac
import numpy as np
import os
import unittest
class dummyclass(object):
"""
Simple class for testing `generate_ordinates`
"""
def __init__(self, params):
pass
def fun(self):
"""
Return value of `True`
"""
return True
par... | <commit_before># -*- coding: utf-8 -*-
import datac
import numpy as np
import os
params = {"temp_sun": 6000.}
bandgaps = np.linspace(0, 3.25, 100)
abscissae = datac.generate_abscissae(bandgaps, "bandgap", params)
pwd = os.getcwd()
testdir = "test"
filename = "data.dat"
fqpn = os.path.join(pwd, testdir, filename)
dat... | # -*- coding: utf-8 -*-
import datac
import numpy as np
import os
import unittest
class dummyclass(object):
"""
Simple class for testing `generate_ordinates`
"""
def __init__(self, params):
pass
def fun(self):
"""
Return value of `True`
"""
return True
par... | # -*- coding: utf-8 -*-
import datac
import numpy as np
import os
params = {"temp_sun": 6000.}
bandgaps = np.linspace(0, 3.25, 100)
abscissae = datac.generate_abscissae(bandgaps, "bandgap", params)
pwd = os.getcwd()
testdir = "test"
filename = "data.dat"
fqpn = os.path.join(pwd, testdir, filename)
datac.write_json(f... | <commit_before># -*- coding: utf-8 -*-
import datac
import numpy as np
import os
params = {"temp_sun": 6000.}
bandgaps = np.linspace(0, 3.25, 100)
abscissae = datac.generate_abscissae(bandgaps, "bandgap", params)
pwd = os.getcwd()
testdir = "test"
filename = "data.dat"
fqpn = os.path.join(pwd, testdir, filename)
dat... |
ff735f207b44d1bf009fbcfa5df26da0da5aed4d | test/test_rooms.py | test/test_rooms.py | import pytest
import chatexchange
from chatexchange.events import MessageEdited
import live_testing
if live_testing:
@pytest.mark.xfail("not implemented yet")
def test_room_iterators():
client = chatexchange.Client(
'stackexchange.com', live_testing.email, live_testing.password)
... | import pytest
import chatexchange
from chatexchange.events import MessageEdited
import live_testing
if live_testing:
@pytest.mark.xfail(reason="not implemented yet")
def test_room_iterators():
client = chatexchange.Client(
'stackexchange.com', live_testing.email, live_testing.password)
... | Fix expected failure decorator in test. | Fix expected failure decorator in test.
| Python | apache-2.0 | hichris1234/ChatExchange,ByteCommander/ChatExchange6,Charcoal-SE/ChatExchange,Charcoal-SE/ChatExchange,ByteCommander/ChatExchange6,hichris1234/ChatExchange | import pytest
import chatexchange
from chatexchange.events import MessageEdited
import live_testing
if live_testing:
@pytest.mark.xfail("not implemented yet")
def test_room_iterators():
client = chatexchange.Client(
'stackexchange.com', live_testing.email, live_testing.password)
... | import pytest
import chatexchange
from chatexchange.events import MessageEdited
import live_testing
if live_testing:
@pytest.mark.xfail(reason="not implemented yet")
def test_room_iterators():
client = chatexchange.Client(
'stackexchange.com', live_testing.email, live_testing.password)
... | <commit_before>import pytest
import chatexchange
from chatexchange.events import MessageEdited
import live_testing
if live_testing:
@pytest.mark.xfail("not implemented yet")
def test_room_iterators():
client = chatexchange.Client(
'stackexchange.com', live_testing.email, live_testing.pas... | import pytest
import chatexchange
from chatexchange.events import MessageEdited
import live_testing
if live_testing:
@pytest.mark.xfail(reason="not implemented yet")
def test_room_iterators():
client = chatexchange.Client(
'stackexchange.com', live_testing.email, live_testing.password)
... | import pytest
import chatexchange
from chatexchange.events import MessageEdited
import live_testing
if live_testing:
@pytest.mark.xfail("not implemented yet")
def test_room_iterators():
client = chatexchange.Client(
'stackexchange.com', live_testing.email, live_testing.password)
... | <commit_before>import pytest
import chatexchange
from chatexchange.events import MessageEdited
import live_testing
if live_testing:
@pytest.mark.xfail("not implemented yet")
def test_room_iterators():
client = chatexchange.Client(
'stackexchange.com', live_testing.email, live_testing.pas... |
f07a114ed23109c9b834b2cbc37ba54c728d73cb | fmn/lib/__init__.py | fmn/lib/__init__.py | """ fedmsg-notifications internal API """
import fmn.lib.models
import logging
log = logging.getLogger(__name__)
def recipients(session, config, message):
""" The main API function.
Accepts a fedmsg message as an argument.
Returns a dict mapping context names to lists of recipients.
"""
res =... | """ fedmsg-notifications internal API """
import fmn.lib.models
import logging
log = logging.getLogger(__name__)
def recipients(session, config, message):
""" The main API function.
Accepts a fedmsg message as an argument.
Returns a dict mapping context names to lists of recipients.
"""
res =... | Restructure the valid_paths list into a dict. | Restructure the valid_paths list into a dict.
| Python | lgpl-2.1 | jeremycline/fmn,jeremycline/fmn,jeremycline/fmn | """ fedmsg-notifications internal API """
import fmn.lib.models
import logging
log = logging.getLogger(__name__)
def recipients(session, config, message):
""" The main API function.
Accepts a fedmsg message as an argument.
Returns a dict mapping context names to lists of recipients.
"""
res =... | """ fedmsg-notifications internal API """
import fmn.lib.models
import logging
log = logging.getLogger(__name__)
def recipients(session, config, message):
""" The main API function.
Accepts a fedmsg message as an argument.
Returns a dict mapping context names to lists of recipients.
"""
res =... | <commit_before>""" fedmsg-notifications internal API """
import fmn.lib.models
import logging
log = logging.getLogger(__name__)
def recipients(session, config, message):
""" The main API function.
Accepts a fedmsg message as an argument.
Returns a dict mapping context names to lists of recipients.
... | """ fedmsg-notifications internal API """
import fmn.lib.models
import logging
log = logging.getLogger(__name__)
def recipients(session, config, message):
""" The main API function.
Accepts a fedmsg message as an argument.
Returns a dict mapping context names to lists of recipients.
"""
res =... | """ fedmsg-notifications internal API """
import fmn.lib.models
import logging
log = logging.getLogger(__name__)
def recipients(session, config, message):
""" The main API function.
Accepts a fedmsg message as an argument.
Returns a dict mapping context names to lists of recipients.
"""
res =... | <commit_before>""" fedmsg-notifications internal API """
import fmn.lib.models
import logging
log = logging.getLogger(__name__)
def recipients(session, config, message):
""" The main API function.
Accepts a fedmsg message as an argument.
Returns a dict mapping context names to lists of recipients.
... |
cf6f8ad122c8b113027585be1a8dd93affffc496 | pigeon_flask.py | pigeon_flask.py | #!/usr/bin/env python
from flask import Flask, abort, make_response, request
from pigeon import PigeonStore
from socket import inet_aton, error as socket_error
app = Flask(__name__)
@app.before_first_request
def open_store():
global p
p = PigeonStore()
@app.route('/lookup')
def lookup():
ip = request.... | #!/usr/bin/env python
from flask import Flask, abort, make_response, request
from pigeon import PigeonStore
from socket import inet_aton, error as socket_error
app = Flask(__name__)
@app.before_first_request
def open_store():
global p
p = PigeonStore()
@app.route('/lookup')
def lookup():
ip = request.... | Return 404 NOT FOUND if no match could be found | Return 404 NOT FOUND if no match could be found
| Python | bsd-3-clause | wbolster/whip | #!/usr/bin/env python
from flask import Flask, abort, make_response, request
from pigeon import PigeonStore
from socket import inet_aton, error as socket_error
app = Flask(__name__)
@app.before_first_request
def open_store():
global p
p = PigeonStore()
@app.route('/lookup')
def lookup():
ip = request.... | #!/usr/bin/env python
from flask import Flask, abort, make_response, request
from pigeon import PigeonStore
from socket import inet_aton, error as socket_error
app = Flask(__name__)
@app.before_first_request
def open_store():
global p
p = PigeonStore()
@app.route('/lookup')
def lookup():
ip = request.... | <commit_before>#!/usr/bin/env python
from flask import Flask, abort, make_response, request
from pigeon import PigeonStore
from socket import inet_aton, error as socket_error
app = Flask(__name__)
@app.before_first_request
def open_store():
global p
p = PigeonStore()
@app.route('/lookup')
def lookup():
... | #!/usr/bin/env python
from flask import Flask, abort, make_response, request
from pigeon import PigeonStore
from socket import inet_aton, error as socket_error
app = Flask(__name__)
@app.before_first_request
def open_store():
global p
p = PigeonStore()
@app.route('/lookup')
def lookup():
ip = request.... | #!/usr/bin/env python
from flask import Flask, abort, make_response, request
from pigeon import PigeonStore
from socket import inet_aton, error as socket_error
app = Flask(__name__)
@app.before_first_request
def open_store():
global p
p = PigeonStore()
@app.route('/lookup')
def lookup():
ip = request.... | <commit_before>#!/usr/bin/env python
from flask import Flask, abort, make_response, request
from pigeon import PigeonStore
from socket import inet_aton, error as socket_error
app = Flask(__name__)
@app.before_first_request
def open_store():
global p
p = PigeonStore()
@app.route('/lookup')
def lookup():
... |
f264a06db669df1017df60d932b301dac7208233 | sqk/datasets/models.py | sqk/datasets/models.py | from django.db import models
from django.utils import timezone
class Dataset(models.Model):
name = models.CharField(max_length=100, default='')
description = models.CharField(max_length=500, default='')
source = models.FileField(upload_to='data_sources')
created_at = models.DateTimeField('created at', ... | from django.db import models
from django.utils import timezone
class Dataset(models.Model):
name = models.CharField(max_length=100, default='')
description = models.CharField(max_length=500, default='')
source = models.FileField(upload_to='data_sources')
created_at = models.DateTimeField('created at', ... | Add is_label_name field to Feature model | Add is_label_name field to Feature model
| Python | bsd-3-clause | sloria/sepal,sloria/sepal,sloria/sepal,sloria/sepal,sloria/sepal | from django.db import models
from django.utils import timezone
class Dataset(models.Model):
name = models.CharField(max_length=100, default='')
description = models.CharField(max_length=500, default='')
source = models.FileField(upload_to='data_sources')
created_at = models.DateTimeField('created at', ... | from django.db import models
from django.utils import timezone
class Dataset(models.Model):
name = models.CharField(max_length=100, default='')
description = models.CharField(max_length=500, default='')
source = models.FileField(upload_to='data_sources')
created_at = models.DateTimeField('created at', ... | <commit_before>from django.db import models
from django.utils import timezone
class Dataset(models.Model):
name = models.CharField(max_length=100, default='')
description = models.CharField(max_length=500, default='')
source = models.FileField(upload_to='data_sources')
created_at = models.DateTimeField... | from django.db import models
from django.utils import timezone
class Dataset(models.Model):
name = models.CharField(max_length=100, default='')
description = models.CharField(max_length=500, default='')
source = models.FileField(upload_to='data_sources')
created_at = models.DateTimeField('created at', ... | from django.db import models
from django.utils import timezone
class Dataset(models.Model):
name = models.CharField(max_length=100, default='')
description = models.CharField(max_length=500, default='')
source = models.FileField(upload_to='data_sources')
created_at = models.DateTimeField('created at', ... | <commit_before>from django.db import models
from django.utils import timezone
class Dataset(models.Model):
name = models.CharField(max_length=100, default='')
description = models.CharField(max_length=500, default='')
source = models.FileField(upload_to='data_sources')
created_at = models.DateTimeField... |
26833c5d41bb3611aa61655c28da4d40b173712e | Orange/tests/test_preprocess.py | Orange/tests/test_preprocess.py | import unittest
from mock import Mock, MagicMock, patch
import Orange
class TestPreprocess(unittest.TestCase):
def test_read_data_calls_reader(self):
class MockPreprocessor(Orange.preprocess.preprocess.Preprocess):
__init__ = Mock()
__call__ = Mock()
@classmethod
... | import unittest
from mock import Mock, MagicMock, patch
import Orange
class TestPreprocess(unittest.TestCase):
def test_read_data_calls_reader(self):
class MockPreprocessor(Orange.preprocess.preprocess.Preprocess):
__init__ = Mock(return_value=None)
__call__ = Mock()
@... | Fix tests for Preprocess constructors | Fix tests for Preprocess constructors
| Python | bsd-2-clause | qusp/orange3,qusp/orange3,qPCR4vir/orange3,qusp/orange3,qPCR4vir/orange3,kwikadi/orange3,qPCR4vir/orange3,qPCR4vir/orange3,marinkaz/orange3,marinkaz/orange3,cheral/orange3,qPCR4vir/orange3,qPCR4vir/orange3,kwikadi/orange3,cheral/orange3,kwikadi/orange3,marinkaz/orange3,qusp/orange3,kwikadi/orange3,cheral/orange3,marink... | import unittest
from mock import Mock, MagicMock, patch
import Orange
class TestPreprocess(unittest.TestCase):
def test_read_data_calls_reader(self):
class MockPreprocessor(Orange.preprocess.preprocess.Preprocess):
__init__ = Mock()
__call__ = Mock()
@classmethod
... | import unittest
from mock import Mock, MagicMock, patch
import Orange
class TestPreprocess(unittest.TestCase):
def test_read_data_calls_reader(self):
class MockPreprocessor(Orange.preprocess.preprocess.Preprocess):
__init__ = Mock(return_value=None)
__call__ = Mock()
@... | <commit_before>import unittest
from mock import Mock, MagicMock, patch
import Orange
class TestPreprocess(unittest.TestCase):
def test_read_data_calls_reader(self):
class MockPreprocessor(Orange.preprocess.preprocess.Preprocess):
__init__ = Mock()
__call__ = Mock()
@cl... | import unittest
from mock import Mock, MagicMock, patch
import Orange
class TestPreprocess(unittest.TestCase):
def test_read_data_calls_reader(self):
class MockPreprocessor(Orange.preprocess.preprocess.Preprocess):
__init__ = Mock(return_value=None)
__call__ = Mock()
@... | import unittest
from mock import Mock, MagicMock, patch
import Orange
class TestPreprocess(unittest.TestCase):
def test_read_data_calls_reader(self):
class MockPreprocessor(Orange.preprocess.preprocess.Preprocess):
__init__ = Mock()
__call__ = Mock()
@classmethod
... | <commit_before>import unittest
from mock import Mock, MagicMock, patch
import Orange
class TestPreprocess(unittest.TestCase):
def test_read_data_calls_reader(self):
class MockPreprocessor(Orange.preprocess.preprocess.Preprocess):
__init__ = Mock()
__call__ = Mock()
@cl... |
23a8943d2e3688753371b08c490aaae2052eb356 | ckanext/mapactionevent/logic/action/create.py | ckanext/mapactionevent/logic/action/create.py | import ckan.logic as logic
import ckan.plugins.toolkit as toolkit
def event_create(context, data_dict):
""" Creates a 'event' type group with a custom unique identifier for the
event """
if data_dict.get('name'):
name = data_dict.get('name')
else:
# Generate a new operation ID
... | import ckan.logic as logic
import ckan.plugins.toolkit as toolkit
def event_create(context, data_dict):
""" Creates a 'event' type group with a custom unique identifier for the
event """
if data_dict.get('name'):
name = data_dict.get('name')
else:
# Generate a new operation ID
... | Make auto-incrementing event names work with a mixture of numeric and non-numeric event names | Make auto-incrementing event names work with a mixture of numeric and non-numeric event names
| Python | agpl-3.0 | aptivate/ckanext-mapactionevent,aptivate/ckanext-mapactionevent,aptivate/ckanext-mapactionevent | import ckan.logic as logic
import ckan.plugins.toolkit as toolkit
def event_create(context, data_dict):
""" Creates a 'event' type group with a custom unique identifier for the
event """
if data_dict.get('name'):
name = data_dict.get('name')
else:
# Generate a new operation ID
... | import ckan.logic as logic
import ckan.plugins.toolkit as toolkit
def event_create(context, data_dict):
""" Creates a 'event' type group with a custom unique identifier for the
event """
if data_dict.get('name'):
name = data_dict.get('name')
else:
# Generate a new operation ID
... | <commit_before>import ckan.logic as logic
import ckan.plugins.toolkit as toolkit
def event_create(context, data_dict):
""" Creates a 'event' type group with a custom unique identifier for the
event """
if data_dict.get('name'):
name = data_dict.get('name')
else:
# Generate a new opera... | import ckan.logic as logic
import ckan.plugins.toolkit as toolkit
def event_create(context, data_dict):
""" Creates a 'event' type group with a custom unique identifier for the
event """
if data_dict.get('name'):
name = data_dict.get('name')
else:
# Generate a new operation ID
... | import ckan.logic as logic
import ckan.plugins.toolkit as toolkit
def event_create(context, data_dict):
""" Creates a 'event' type group with a custom unique identifier for the
event """
if data_dict.get('name'):
name = data_dict.get('name')
else:
# Generate a new operation ID
... | <commit_before>import ckan.logic as logic
import ckan.plugins.toolkit as toolkit
def event_create(context, data_dict):
""" Creates a 'event' type group with a custom unique identifier for the
event """
if data_dict.get('name'):
name = data_dict.get('name')
else:
# Generate a new opera... |
f306f78304d657a163b2a03284c83afc09271e2b | populous/cli.py | populous/cli.py | import click
@click.group()
@click.version_option()
def cli():
pass
| import click
from .loader import load_yaml
from .blueprint import Blueprint
@click.group()
@click.version_option()
def cli():
pass
@cli.command()
@click.argument('files', nargs=-1)
def predict(files):
"""
Predict how many objects will be created if the given files are used.
"""
blueprint = Blue... | Add a naive implementation of the predict command | Add a naive implementation of the predict command
| Python | mit | novafloss/populous | import click
@click.group()
@click.version_option()
def cli():
pass
Add a naive implementation of the predict command | import click
from .loader import load_yaml
from .blueprint import Blueprint
@click.group()
@click.version_option()
def cli():
pass
@cli.command()
@click.argument('files', nargs=-1)
def predict(files):
"""
Predict how many objects will be created if the given files are used.
"""
blueprint = Blue... | <commit_before>import click
@click.group()
@click.version_option()
def cli():
pass
<commit_msg>Add a naive implementation of the predict command<commit_after> | import click
from .loader import load_yaml
from .blueprint import Blueprint
@click.group()
@click.version_option()
def cli():
pass
@cli.command()
@click.argument('files', nargs=-1)
def predict(files):
"""
Predict how many objects will be created if the given files are used.
"""
blueprint = Blue... | import click
@click.group()
@click.version_option()
def cli():
pass
Add a naive implementation of the predict commandimport click
from .loader import load_yaml
from .blueprint import Blueprint
@click.group()
@click.version_option()
def cli():
pass
@cli.command()
@click.argument('files', nargs=-1)
def pre... | <commit_before>import click
@click.group()
@click.version_option()
def cli():
pass
<commit_msg>Add a naive implementation of the predict command<commit_after>import click
from .loader import load_yaml
from .blueprint import Blueprint
@click.group()
@click.version_option()
def cli():
pass
@cli.command()
@... |
0ac8062ea2c16edcc5d81c14976413a3ddde43b6 | clowder_test/clowder_test/clowder_test_app.py | clowder_test/clowder_test/clowder_test_app.py | # -*- coding: utf-8 -*-
"""Clowder test command line app
.. codeauthor:: Joe Decapo <[email protected]>
"""
from __future__ import print_function
import os
import colorama
from cement.core.foundation import CementApp
from clowder_test import ROOT_DIR
from clowder_test.cli.base_controller import BaseController
from cl... | # -*- coding: utf-8 -*-
"""Clowder test command line app
.. codeauthor:: Joe Decapo <[email protected]>
"""
from __future__ import print_function
import os
import colorama
from cement.core.foundation import CementApp
from clowder_test import ROOT_DIR
from clowder_test.cli.base_controller import BaseController
from cl... | Move clowder_test directory setup to post arg parse hook | Move clowder_test directory setup to post arg parse hook
| Python | mit | JrGoodle/clowder,JrGoodle/clowder,JrGoodle/clowder | # -*- coding: utf-8 -*-
"""Clowder test command line app
.. codeauthor:: Joe Decapo <[email protected]>
"""
from __future__ import print_function
import os
import colorama
from cement.core.foundation import CementApp
from clowder_test import ROOT_DIR
from clowder_test.cli.base_controller import BaseController
from cl... | # -*- coding: utf-8 -*-
"""Clowder test command line app
.. codeauthor:: Joe Decapo <[email protected]>
"""
from __future__ import print_function
import os
import colorama
from cement.core.foundation import CementApp
from clowder_test import ROOT_DIR
from clowder_test.cli.base_controller import BaseController
from cl... | <commit_before># -*- coding: utf-8 -*-
"""Clowder test command line app
.. codeauthor:: Joe Decapo <[email protected]>
"""
from __future__ import print_function
import os
import colorama
from cement.core.foundation import CementApp
from clowder_test import ROOT_DIR
from clowder_test.cli.base_controller import BaseCon... | # -*- coding: utf-8 -*-
"""Clowder test command line app
.. codeauthor:: Joe Decapo <[email protected]>
"""
from __future__ import print_function
import os
import colorama
from cement.core.foundation import CementApp
from clowder_test import ROOT_DIR
from clowder_test.cli.base_controller import BaseController
from cl... | # -*- coding: utf-8 -*-
"""Clowder test command line app
.. codeauthor:: Joe Decapo <[email protected]>
"""
from __future__ import print_function
import os
import colorama
from cement.core.foundation import CementApp
from clowder_test import ROOT_DIR
from clowder_test.cli.base_controller import BaseController
from cl... | <commit_before># -*- coding: utf-8 -*-
"""Clowder test command line app
.. codeauthor:: Joe Decapo <[email protected]>
"""
from __future__ import print_function
import os
import colorama
from cement.core.foundation import CementApp
from clowder_test import ROOT_DIR
from clowder_test.cli.base_controller import BaseCon... |
550c0445e5763354df6fbcac611dc5469014e13c | moocng/teacheradmin/forms.py | moocng/teacheradmin/forms.py | # Copyright 2012 Rooter Analysis S.L.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | # Copyright 2012 Rooter Analysis S.L.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | Fix problem related to the teacheradmin form, exclude owner | Fix problem related to the teacheradmin form, exclude owner
| Python | apache-2.0 | GeographicaGS/moocng,OpenMOOC/moocng,OpenMOOC/moocng,GeographicaGS/moocng,GeographicaGS/moocng,GeographicaGS/moocng | # Copyright 2012 Rooter Analysis S.L.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | # Copyright 2012 Rooter Analysis S.L.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | <commit_before># Copyright 2012 Rooter Analysis S.L.
#
# 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... | # Copyright 2012 Rooter Analysis S.L.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | # Copyright 2012 Rooter Analysis S.L.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | <commit_before># Copyright 2012 Rooter Analysis S.L.
#
# 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... |
8740092c5c6d1fababdd44a7e9e4dbc180403e09 | mrp_auto_prod/__openerp__.py | mrp_auto_prod/__openerp__.py | # -*- coding: utf-8 -*-
{
'name': 'MRP auto production',
'version': '0.1',
'author': 'ADHOC',
'category': 'Localization/Argentina',
'website': 'www.adhoc.com.ar',
'license': 'AGPL-3',
'description':
"""
Para probar instalar tambien "sale" y "procurement_jit_stock"
""",
'depends'... | # -*- coding: utf-8 -*-
{
'name': 'MRP auto production',
'version': '0.1',
'author': 'ADHOC',
'category': 'Localization/Argentina',
'website': 'www.adhoc.com.ar',
'license': 'AGPL-3',
'description': """
Para probar instalar tambien "sale" y "procurement_jit_stock"
""",
'depends'... | FIX disable mrp auto prod demo data | FIX disable mrp auto prod demo data
| Python | agpl-3.0 | dvitme/odoo-addons,ClearCorp/account-financial-tools,maljac/odoo-addons,adhoc-dev/odoo-addons,ingadhoc/product,bmya/odoo-addons,jorsea/odoo-addons,ingadhoc/odoo-addons,syci/ingadhoc-odoo-addons,sysadminmatmoz/ingadhoc,ingadhoc/account-financial-tools,bmya/odoo-addons,sysadminmatmoz/ingadhoc,ingadhoc/account-payment,adh... | # -*- coding: utf-8 -*-
{
'name': 'MRP auto production',
'version': '0.1',
'author': 'ADHOC',
'category': 'Localization/Argentina',
'website': 'www.adhoc.com.ar',
'license': 'AGPL-3',
'description':
"""
Para probar instalar tambien "sale" y "procurement_jit_stock"
""",
'depends'... | # -*- coding: utf-8 -*-
{
'name': 'MRP auto production',
'version': '0.1',
'author': 'ADHOC',
'category': 'Localization/Argentina',
'website': 'www.adhoc.com.ar',
'license': 'AGPL-3',
'description': """
Para probar instalar tambien "sale" y "procurement_jit_stock"
""",
'depends'... | <commit_before># -*- coding: utf-8 -*-
{
'name': 'MRP auto production',
'version': '0.1',
'author': 'ADHOC',
'category': 'Localization/Argentina',
'website': 'www.adhoc.com.ar',
'license': 'AGPL-3',
'description':
"""
Para probar instalar tambien "sale" y "procurement_jit_stock"
"""... | # -*- coding: utf-8 -*-
{
'name': 'MRP auto production',
'version': '0.1',
'author': 'ADHOC',
'category': 'Localization/Argentina',
'website': 'www.adhoc.com.ar',
'license': 'AGPL-3',
'description': """
Para probar instalar tambien "sale" y "procurement_jit_stock"
""",
'depends'... | # -*- coding: utf-8 -*-
{
'name': 'MRP auto production',
'version': '0.1',
'author': 'ADHOC',
'category': 'Localization/Argentina',
'website': 'www.adhoc.com.ar',
'license': 'AGPL-3',
'description':
"""
Para probar instalar tambien "sale" y "procurement_jit_stock"
""",
'depends'... | <commit_before># -*- coding: utf-8 -*-
{
'name': 'MRP auto production',
'version': '0.1',
'author': 'ADHOC',
'category': 'Localization/Argentina',
'website': 'www.adhoc.com.ar',
'license': 'AGPL-3',
'description':
"""
Para probar instalar tambien "sale" y "procurement_jit_stock"
"""... |
d2692296788e49ecf98f122d907f8ea2ba632975 | docs/conf.py | docs/conf.py | import sys
from os.path import dirname, abspath
sys.path.insert(0, dirname(dirname(abspath(__file__))))
from django.conf import settings
settings.configure()
project = 'django-slack'
version = ''
release = ''
copyright = '2014, 2015 Chris Lamb'
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx']
html_ti... | import sys
from os.path import dirname, abspath
sys.path.insert(0, dirname(dirname(abspath(__file__))))
from django.conf import settings
settings.configure()
project = 'django-slack'
version = ''
release = ''
copyright = '2014, 2015 Chris Lamb'
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx']
html_ti... | Add toctree_only to latex_documents to fix sphinx build | Add toctree_only to latex_documents to fix sphinx build
| Python | bsd-3-clause | lamby/django-slack | import sys
from os.path import dirname, abspath
sys.path.insert(0, dirname(dirname(abspath(__file__))))
from django.conf import settings
settings.configure()
project = 'django-slack'
version = ''
release = ''
copyright = '2014, 2015 Chris Lamb'
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx']
html_ti... | import sys
from os.path import dirname, abspath
sys.path.insert(0, dirname(dirname(abspath(__file__))))
from django.conf import settings
settings.configure()
project = 'django-slack'
version = ''
release = ''
copyright = '2014, 2015 Chris Lamb'
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx']
html_ti... | <commit_before>import sys
from os.path import dirname, abspath
sys.path.insert(0, dirname(dirname(abspath(__file__))))
from django.conf import settings
settings.configure()
project = 'django-slack'
version = ''
release = ''
copyright = '2014, 2015 Chris Lamb'
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.inters... | import sys
from os.path import dirname, abspath
sys.path.insert(0, dirname(dirname(abspath(__file__))))
from django.conf import settings
settings.configure()
project = 'django-slack'
version = ''
release = ''
copyright = '2014, 2015 Chris Lamb'
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx']
html_ti... | import sys
from os.path import dirname, abspath
sys.path.insert(0, dirname(dirname(abspath(__file__))))
from django.conf import settings
settings.configure()
project = 'django-slack'
version = ''
release = ''
copyright = '2014, 2015 Chris Lamb'
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx']
html_ti... | <commit_before>import sys
from os.path import dirname, abspath
sys.path.insert(0, dirname(dirname(abspath(__file__))))
from django.conf import settings
settings.configure()
project = 'django-slack'
version = ''
release = ''
copyright = '2014, 2015 Chris Lamb'
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.inters... |
bc97d63893858ba8cbcd44f83f4123fdd826ac71 | addons/bestja_api_user/models.py | addons/bestja_api_user/models.py | # -*- coding: utf-8 -*-
from openerp import models, fields, api
class User(models.Model):
_inherit = 'res.users'
def __init__(self, pool, cr):
super(User, self).__init__(pool, cr)
self._add_permitted_fields(level='privileged', fields={'email'})
self._add_permitted_fields(level='owner'... | # -*- coding: utf-8 -*-
from openerp import models, fields, api
class User(models.Model):
_inherit = 'res.users'
def __init__(self, pool, cr):
super(User, self).__init__(pool, cr)
self._add_permitted_fields(level='privileged', fields={'email'})
self._add_permitted_fields(level='owner'... | Fix for Partner's email not being accessible to administrator | Fix for Partner's email not being accessible to administrator
| Python | agpl-3.0 | EE/bestja,EE/bestja,ludwiktrammer/bestja,ludwiktrammer/bestja,ludwiktrammer/bestja,EE/bestja | # -*- coding: utf-8 -*-
from openerp import models, fields, api
class User(models.Model):
_inherit = 'res.users'
def __init__(self, pool, cr):
super(User, self).__init__(pool, cr)
self._add_permitted_fields(level='privileged', fields={'email'})
self._add_permitted_fields(level='owner'... | # -*- coding: utf-8 -*-
from openerp import models, fields, api
class User(models.Model):
_inherit = 'res.users'
def __init__(self, pool, cr):
super(User, self).__init__(pool, cr)
self._add_permitted_fields(level='privileged', fields={'email'})
self._add_permitted_fields(level='owner'... | <commit_before># -*- coding: utf-8 -*-
from openerp import models, fields, api
class User(models.Model):
_inherit = 'res.users'
def __init__(self, pool, cr):
super(User, self).__init__(pool, cr)
self._add_permitted_fields(level='privileged', fields={'email'})
self._add_permitted_field... | # -*- coding: utf-8 -*-
from openerp import models, fields, api
class User(models.Model):
_inherit = 'res.users'
def __init__(self, pool, cr):
super(User, self).__init__(pool, cr)
self._add_permitted_fields(level='privileged', fields={'email'})
self._add_permitted_fields(level='owner'... | # -*- coding: utf-8 -*-
from openerp import models, fields, api
class User(models.Model):
_inherit = 'res.users'
def __init__(self, pool, cr):
super(User, self).__init__(pool, cr)
self._add_permitted_fields(level='privileged', fields={'email'})
self._add_permitted_fields(level='owner'... | <commit_before># -*- coding: utf-8 -*-
from openerp import models, fields, api
class User(models.Model):
_inherit = 'res.users'
def __init__(self, pool, cr):
super(User, self).__init__(pool, cr)
self._add_permitted_fields(level='privileged', fields={'email'})
self._add_permitted_field... |
2f168fa2886a4e3c00f15b5407bb860f0f9b38f4 | main.py | main.py | """
Classify images using random decision forests
"""
import sys
from mlearner import train_model
from utils import get_feature_vector
def classify_image(image_path, clf):
""" Classify given image
"""
fvecs = [get_feature_vector(image_path)]
print(clf.predict(fvecs))
def main():
if len(sys.argv... | """
Classify images using random decision forests
"""
import sys, os
from mlearner import train_model
from utils import get_feature_vector
def classify_image(image_path, clf):
""" Classify given image
"""
fvecs = [get_feature_vector(image_path)]
print(clf.predict(fvecs), clf.predict_proba(fvecs))
d... | Add ability to test model on all images in some directory | Add ability to test model on all images in some directory
| Python | mit | kpj/PyClass | """
Classify images using random decision forests
"""
import sys
from mlearner import train_model
from utils import get_feature_vector
def classify_image(image_path, clf):
""" Classify given image
"""
fvecs = [get_feature_vector(image_path)]
print(clf.predict(fvecs))
def main():
if len(sys.argv... | """
Classify images using random decision forests
"""
import sys, os
from mlearner import train_model
from utils import get_feature_vector
def classify_image(image_path, clf):
""" Classify given image
"""
fvecs = [get_feature_vector(image_path)]
print(clf.predict(fvecs), clf.predict_proba(fvecs))
d... | <commit_before>"""
Classify images using random decision forests
"""
import sys
from mlearner import train_model
from utils import get_feature_vector
def classify_image(image_path, clf):
""" Classify given image
"""
fvecs = [get_feature_vector(image_path)]
print(clf.predict(fvecs))
def main():
... | """
Classify images using random decision forests
"""
import sys, os
from mlearner import train_model
from utils import get_feature_vector
def classify_image(image_path, clf):
""" Classify given image
"""
fvecs = [get_feature_vector(image_path)]
print(clf.predict(fvecs), clf.predict_proba(fvecs))
d... | """
Classify images using random decision forests
"""
import sys
from mlearner import train_model
from utils import get_feature_vector
def classify_image(image_path, clf):
""" Classify given image
"""
fvecs = [get_feature_vector(image_path)]
print(clf.predict(fvecs))
def main():
if len(sys.argv... | <commit_before>"""
Classify images using random decision forests
"""
import sys
from mlearner import train_model
from utils import get_feature_vector
def classify_image(image_path, clf):
""" Classify given image
"""
fvecs = [get_feature_vector(image_path)]
print(clf.predict(fvecs))
def main():
... |
06a71d22df5b6f1196cbdff737ab071ba92fad0b | spacy/tests/regression/test_issue834.py | spacy/tests/regression/test_issue834.py | # coding: utf-8
from io import StringIO
word2vec_str = """, -0.046107 -0.035951 -0.560418
de -0.648927 -0.400976 -0.527124
. 0.113685 0.439990 -0.634510
-1.499184 -0.184280 -0.598371"""
def test_issue834(en_vocab):
f = StringIO(word2vec_str)
vector_length = en_vocab.load_vectors(f)
assert vector_lengt... | # coding: utf-8
from __future__ import unicode_literals
from io import StringIO
word2vec_str = """, -0.046107 -0.035951 -0.560418
de -0.648927 -0.400976 -0.527124
. 0.113685 0.439990 -0.634510
-1.499184 -0.184280 -0.598371"""
def test_issue834(en_vocab):
f = StringIO(word2vec_str)
vector_length = en_vocab... | Fix test failure by using unicode literals | Fix test failure by using unicode literals
| Python | mit | explosion/spaCy,banglakit/spaCy,aikramer2/spaCy,spacy-io/spaCy,raphael0202/spaCy,recognai/spaCy,Gregory-Howard/spaCy,honnibal/spaCy,spacy-io/spaCy,aikramer2/spaCy,spacy-io/spaCy,aikramer2/spaCy,recognai/spaCy,aikramer2/spaCy,raphael0202/spaCy,raphael0202/spaCy,recognai/spaCy,honnibal/spaCy,raphael0202/spaCy,explosion/s... | # coding: utf-8
from io import StringIO
word2vec_str = """, -0.046107 -0.035951 -0.560418
de -0.648927 -0.400976 -0.527124
. 0.113685 0.439990 -0.634510
-1.499184 -0.184280 -0.598371"""
def test_issue834(en_vocab):
f = StringIO(word2vec_str)
vector_length = en_vocab.load_vectors(f)
assert vector_lengt... | # coding: utf-8
from __future__ import unicode_literals
from io import StringIO
word2vec_str = """, -0.046107 -0.035951 -0.560418
de -0.648927 -0.400976 -0.527124
. 0.113685 0.439990 -0.634510
-1.499184 -0.184280 -0.598371"""
def test_issue834(en_vocab):
f = StringIO(word2vec_str)
vector_length = en_vocab... | <commit_before># coding: utf-8
from io import StringIO
word2vec_str = """, -0.046107 -0.035951 -0.560418
de -0.648927 -0.400976 -0.527124
. 0.113685 0.439990 -0.634510
-1.499184 -0.184280 -0.598371"""
def test_issue834(en_vocab):
f = StringIO(word2vec_str)
vector_length = en_vocab.load_vectors(f)
asse... | # coding: utf-8
from __future__ import unicode_literals
from io import StringIO
word2vec_str = """, -0.046107 -0.035951 -0.560418
de -0.648927 -0.400976 -0.527124
. 0.113685 0.439990 -0.634510
-1.499184 -0.184280 -0.598371"""
def test_issue834(en_vocab):
f = StringIO(word2vec_str)
vector_length = en_vocab... | # coding: utf-8
from io import StringIO
word2vec_str = """, -0.046107 -0.035951 -0.560418
de -0.648927 -0.400976 -0.527124
. 0.113685 0.439990 -0.634510
-1.499184 -0.184280 -0.598371"""
def test_issue834(en_vocab):
f = StringIO(word2vec_str)
vector_length = en_vocab.load_vectors(f)
assert vector_lengt... | <commit_before># coding: utf-8
from io import StringIO
word2vec_str = """, -0.046107 -0.035951 -0.560418
de -0.648927 -0.400976 -0.527124
. 0.113685 0.439990 -0.634510
-1.499184 -0.184280 -0.598371"""
def test_issue834(en_vocab):
f = StringIO(word2vec_str)
vector_length = en_vocab.load_vectors(f)
asse... |
b674f76c93b5208ad302fcba2d43b8c30bbaf14c | main.py | main.py | from altitude import run
run.run("27279", "C://Program Files (x86)/Altitude/servers/command.txt", "C://Program Files (x86)/Altitude/servers/log.txt",
"C://Program Files (x86)/Altitude/servers/log_old.txt", "C://Program Files (x86)/Altitude/servers/logs_archive.txt")
| from altitude import run
run.run("27279", "/home/user/altitude-files/servers/command.txt", "/home/user/altitude-files/servers/log.txt",
"/home/user/altitude-files/servers/log_old.txt", "/home/user/altitude-files/servers/logs_archive.txt")
| Put the directories back as they were for the server | Put the directories back as they were for the server
| Python | mit | StamKaly/altitude-mod,StamKaly/altitude-mod | from altitude import run
run.run("27279", "C://Program Files (x86)/Altitude/servers/command.txt", "C://Program Files (x86)/Altitude/servers/log.txt",
"C://Program Files (x86)/Altitude/servers/log_old.txt", "C://Program Files (x86)/Altitude/servers/logs_archive.txt")
Put the directories back as they were ... | from altitude import run
run.run("27279", "/home/user/altitude-files/servers/command.txt", "/home/user/altitude-files/servers/log.txt",
"/home/user/altitude-files/servers/log_old.txt", "/home/user/altitude-files/servers/logs_archive.txt")
| <commit_before>from altitude import run
run.run("27279", "C://Program Files (x86)/Altitude/servers/command.txt", "C://Program Files (x86)/Altitude/servers/log.txt",
"C://Program Files (x86)/Altitude/servers/log_old.txt", "C://Program Files (x86)/Altitude/servers/logs_archive.txt")
<commit_msg>Put the dir... | from altitude import run
run.run("27279", "/home/user/altitude-files/servers/command.txt", "/home/user/altitude-files/servers/log.txt",
"/home/user/altitude-files/servers/log_old.txt", "/home/user/altitude-files/servers/logs_archive.txt")
| from altitude import run
run.run("27279", "C://Program Files (x86)/Altitude/servers/command.txt", "C://Program Files (x86)/Altitude/servers/log.txt",
"C://Program Files (x86)/Altitude/servers/log_old.txt", "C://Program Files (x86)/Altitude/servers/logs_archive.txt")
Put the directories back as they were ... | <commit_before>from altitude import run
run.run("27279", "C://Program Files (x86)/Altitude/servers/command.txt", "C://Program Files (x86)/Altitude/servers/log.txt",
"C://Program Files (x86)/Altitude/servers/log_old.txt", "C://Program Files (x86)/Altitude/servers/logs_archive.txt")
<commit_msg>Put the dir... |
ca6b04768a76299187d2c4efaeb612017812bcc7 | bluebottle/redirects/views.py | bluebottle/redirects/views.py | from rest_framework import generics
from bluebottle.bluebottle_drf2.pagination import BluebottlePagination
from .models import Redirect
from .serializers import RedirectSerializer
class RedirectPagination(BluebottlePagination):
page_size = 100
class RedirectListView(generics.ListAPIView):
queryset = Redire... | from rest_framework import generics
from bluebottle.bluebottle_drf2.pagination import BluebottlePagination
from .models import Redirect
from .serializers import RedirectSerializer
class RedirectPagination(BluebottlePagination):
page_size = 200
class RedirectListView(generics.ListAPIView):
queryset = Redire... | Fix redirect page size voor vjb | Fix redirect page size voor vjb
| Python | bsd-3-clause | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | from rest_framework import generics
from bluebottle.bluebottle_drf2.pagination import BluebottlePagination
from .models import Redirect
from .serializers import RedirectSerializer
class RedirectPagination(BluebottlePagination):
page_size = 100
class RedirectListView(generics.ListAPIView):
queryset = Redire... | from rest_framework import generics
from bluebottle.bluebottle_drf2.pagination import BluebottlePagination
from .models import Redirect
from .serializers import RedirectSerializer
class RedirectPagination(BluebottlePagination):
page_size = 200
class RedirectListView(generics.ListAPIView):
queryset = Redire... | <commit_before>from rest_framework import generics
from bluebottle.bluebottle_drf2.pagination import BluebottlePagination
from .models import Redirect
from .serializers import RedirectSerializer
class RedirectPagination(BluebottlePagination):
page_size = 100
class RedirectListView(generics.ListAPIView):
qu... | from rest_framework import generics
from bluebottle.bluebottle_drf2.pagination import BluebottlePagination
from .models import Redirect
from .serializers import RedirectSerializer
class RedirectPagination(BluebottlePagination):
page_size = 200
class RedirectListView(generics.ListAPIView):
queryset = Redire... | from rest_framework import generics
from bluebottle.bluebottle_drf2.pagination import BluebottlePagination
from .models import Redirect
from .serializers import RedirectSerializer
class RedirectPagination(BluebottlePagination):
page_size = 100
class RedirectListView(generics.ListAPIView):
queryset = Redire... | <commit_before>from rest_framework import generics
from bluebottle.bluebottle_drf2.pagination import BluebottlePagination
from .models import Redirect
from .serializers import RedirectSerializer
class RedirectPagination(BluebottlePagination):
page_size = 100
class RedirectListView(generics.ListAPIView):
qu... |
cfaeb584ed74b10de76247a6984c0c6950a1eb25 | Ispyra/checks.py | Ispyra/checks.py | from discord.ext import commands
from bot_globals import bot_masters, blacklist
#Check if a user is allowed to use a command
#Perm 0 is simply blacklist checking
#Perm 1 also checks if the user is a botmaster
def allowed(perm, pref):
def permission(ctx):
uid = ctx.message.author.id
if perm == 0:
... | from discord.ext import commands
from bot_globals import bot_masters, blacklist
#Check if a user is allowed to use a command
#Perm 0 is simply blacklist checking
#Perm 1 also checks if the user is a botmaster
def allowed(perm, pref):
def permission(ctx):
uid = ctx.message.author.id
if perm == 0:
... | Fix prefix checking only working for botmaster commands | Fix prefix checking only working for botmaster commands
| Python | mit | Ispira/Ispyra | from discord.ext import commands
from bot_globals import bot_masters, blacklist
#Check if a user is allowed to use a command
#Perm 0 is simply blacklist checking
#Perm 1 also checks if the user is a botmaster
def allowed(perm, pref):
def permission(ctx):
uid = ctx.message.author.id
if perm == 0:
... | from discord.ext import commands
from bot_globals import bot_masters, blacklist
#Check if a user is allowed to use a command
#Perm 0 is simply blacklist checking
#Perm 1 also checks if the user is a botmaster
def allowed(perm, pref):
def permission(ctx):
uid = ctx.message.author.id
if perm == 0:
... | <commit_before>from discord.ext import commands
from bot_globals import bot_masters, blacklist
#Check if a user is allowed to use a command
#Perm 0 is simply blacklist checking
#Perm 1 also checks if the user is a botmaster
def allowed(perm, pref):
def permission(ctx):
uid = ctx.message.author.id
... | from discord.ext import commands
from bot_globals import bot_masters, blacklist
#Check if a user is allowed to use a command
#Perm 0 is simply blacklist checking
#Perm 1 also checks if the user is a botmaster
def allowed(perm, pref):
def permission(ctx):
uid = ctx.message.author.id
if perm == 0:
... | from discord.ext import commands
from bot_globals import bot_masters, blacklist
#Check if a user is allowed to use a command
#Perm 0 is simply blacklist checking
#Perm 1 also checks if the user is a botmaster
def allowed(perm, pref):
def permission(ctx):
uid = ctx.message.author.id
if perm == 0:
... | <commit_before>from discord.ext import commands
from bot_globals import bot_masters, blacklist
#Check if a user is allowed to use a command
#Perm 0 is simply blacklist checking
#Perm 1 also checks if the user is a botmaster
def allowed(perm, pref):
def permission(ctx):
uid = ctx.message.author.id
... |
c85f423960050fea76452818ce25f9dc287c922a | vumidash/dummy_client.py | vumidash/dummy_client.py | """MetricSource that serves dummy data."""
import random
from vumidash.base import MetricSource, UnknownMetricError
class DummyClient(MetricSource):
"""Serve dummy data."""
def __init__(self):
self.latest = None
self.metric_prefix = "test"
self.prev_values = {} # map of metrics to p... | """MetricSource that serves dummy data."""
import random
from vumidash.base import MetricSource, UnknownMetricError
class DummyClient(MetricSource):
"""Serve dummy data."""
def __init__(self):
self.latest = None
self.metric_prefix = "test"
self.prev_values = {} # map of metrics to p... | Fix steps calculation in dummy client -- how did this work before? | Fix steps calculation in dummy client -- how did this work before?
| Python | bsd-3-clause | praekelt/vumi-dashboard,praekelt/vumi-dashboard | """MetricSource that serves dummy data."""
import random
from vumidash.base import MetricSource, UnknownMetricError
class DummyClient(MetricSource):
"""Serve dummy data."""
def __init__(self):
self.latest = None
self.metric_prefix = "test"
self.prev_values = {} # map of metrics to p... | """MetricSource that serves dummy data."""
import random
from vumidash.base import MetricSource, UnknownMetricError
class DummyClient(MetricSource):
"""Serve dummy data."""
def __init__(self):
self.latest = None
self.metric_prefix = "test"
self.prev_values = {} # map of metrics to p... | <commit_before>"""MetricSource that serves dummy data."""
import random
from vumidash.base import MetricSource, UnknownMetricError
class DummyClient(MetricSource):
"""Serve dummy data."""
def __init__(self):
self.latest = None
self.metric_prefix = "test"
self.prev_values = {} # map ... | """MetricSource that serves dummy data."""
import random
from vumidash.base import MetricSource, UnknownMetricError
class DummyClient(MetricSource):
"""Serve dummy data."""
def __init__(self):
self.latest = None
self.metric_prefix = "test"
self.prev_values = {} # map of metrics to p... | """MetricSource that serves dummy data."""
import random
from vumidash.base import MetricSource, UnknownMetricError
class DummyClient(MetricSource):
"""Serve dummy data."""
def __init__(self):
self.latest = None
self.metric_prefix = "test"
self.prev_values = {} # map of metrics to p... | <commit_before>"""MetricSource that serves dummy data."""
import random
from vumidash.base import MetricSource, UnknownMetricError
class DummyClient(MetricSource):
"""Serve dummy data."""
def __init__(self):
self.latest = None
self.metric_prefix = "test"
self.prev_values = {} # map ... |
791f64250d5e7c2ac2c5e01aa1e890dbefbc0417 | falcon_hateoas/middleware.py | falcon_hateoas/middleware.py | import json
import decimal
import datetime
import sqlalchemy
class AlchemyJSONEncoder(json.JSONEncoder):
def _is_alchemy_object(self, obj):
try:
sqlalchemy.orm.base.object_mapper(obj)
return True
except sqlalchemy.orm.exc.UnmappedInstanceError:
return False
... | import json
import decimal
import datetime
class AlchemyJSONEncoder(json.JSONEncoder):
def default(self, o):
d = {}
for col in o.__table__.columns.keys():
value = getattr(o, col)
if hasattr(value, 'isoformat'):
d[col] = value.isoformat()
elif isi... | Remove dead code from AlchemyJSONEncoder | Remove dead code from AlchemyJSONEncoder
Signed-off-by: Michal Juranyi <[email protected]>
| Python | mit | Vnet-as/falcon-hateoas | import json
import decimal
import datetime
import sqlalchemy
class AlchemyJSONEncoder(json.JSONEncoder):
def _is_alchemy_object(self, obj):
try:
sqlalchemy.orm.base.object_mapper(obj)
return True
except sqlalchemy.orm.exc.UnmappedInstanceError:
return False
... | import json
import decimal
import datetime
class AlchemyJSONEncoder(json.JSONEncoder):
def default(self, o):
d = {}
for col in o.__table__.columns.keys():
value = getattr(o, col)
if hasattr(value, 'isoformat'):
d[col] = value.isoformat()
elif isi... | <commit_before>import json
import decimal
import datetime
import sqlalchemy
class AlchemyJSONEncoder(json.JSONEncoder):
def _is_alchemy_object(self, obj):
try:
sqlalchemy.orm.base.object_mapper(obj)
return True
except sqlalchemy.orm.exc.UnmappedInstanceError:
re... | import json
import decimal
import datetime
class AlchemyJSONEncoder(json.JSONEncoder):
def default(self, o):
d = {}
for col in o.__table__.columns.keys():
value = getattr(o, col)
if hasattr(value, 'isoformat'):
d[col] = value.isoformat()
elif isi... | import json
import decimal
import datetime
import sqlalchemy
class AlchemyJSONEncoder(json.JSONEncoder):
def _is_alchemy_object(self, obj):
try:
sqlalchemy.orm.base.object_mapper(obj)
return True
except sqlalchemy.orm.exc.UnmappedInstanceError:
return False
... | <commit_before>import json
import decimal
import datetime
import sqlalchemy
class AlchemyJSONEncoder(json.JSONEncoder):
def _is_alchemy_object(self, obj):
try:
sqlalchemy.orm.base.object_mapper(obj)
return True
except sqlalchemy.orm.exc.UnmappedInstanceError:
re... |
df251bfe9a3f68e30efeac2692df996e1494615b | tests/common.py | tests/common.py | import os
from wikipediabase.fetcher import CachingSiteFetcher
ALL_TEST_PAGES = [
]
def data(fname):
return os.path.abspath('/'.join([__package__, 'data', fname]))
def read_data(fname):
return open(data(fname)).read()
def download_all(pages=ALL_TEST_PAGES):
f = CachingSiteFetcher(offline=False, fname... | import os
from wikipediabase.fetcher import CachingSiteFetcher
ALL_TEST_PAGES = [
]
def data(fname):
return os.path.abspath('/'.join([__package__, 'data', fname]))
def read_data(fname):
return open(data(fname)).read()
def download_all(pages=ALL_TEST_PAGES):
f = CachingSiteFetcher(offline=False, fname... | Enable online lookups for test. | Enable online lookups for test.
| Python | apache-2.0 | fakedrake/WikipediaBase | import os
from wikipediabase.fetcher import CachingSiteFetcher
ALL_TEST_PAGES = [
]
def data(fname):
return os.path.abspath('/'.join([__package__, 'data', fname]))
def read_data(fname):
return open(data(fname)).read()
def download_all(pages=ALL_TEST_PAGES):
f = CachingSiteFetcher(offline=False, fname... | import os
from wikipediabase.fetcher import CachingSiteFetcher
ALL_TEST_PAGES = [
]
def data(fname):
return os.path.abspath('/'.join([__package__, 'data', fname]))
def read_data(fname):
return open(data(fname)).read()
def download_all(pages=ALL_TEST_PAGES):
f = CachingSiteFetcher(offline=False, fname... | <commit_before>import os
from wikipediabase.fetcher import CachingSiteFetcher
ALL_TEST_PAGES = [
]
def data(fname):
return os.path.abspath('/'.join([__package__, 'data', fname]))
def read_data(fname):
return open(data(fname)).read()
def download_all(pages=ALL_TEST_PAGES):
f = CachingSiteFetcher(offli... | import os
from wikipediabase.fetcher import CachingSiteFetcher
ALL_TEST_PAGES = [
]
def data(fname):
return os.path.abspath('/'.join([__package__, 'data', fname]))
def read_data(fname):
return open(data(fname)).read()
def download_all(pages=ALL_TEST_PAGES):
f = CachingSiteFetcher(offline=False, fname... | import os
from wikipediabase.fetcher import CachingSiteFetcher
ALL_TEST_PAGES = [
]
def data(fname):
return os.path.abspath('/'.join([__package__, 'data', fname]))
def read_data(fname):
return open(data(fname)).read()
def download_all(pages=ALL_TEST_PAGES):
f = CachingSiteFetcher(offline=False, fname... | <commit_before>import os
from wikipediabase.fetcher import CachingSiteFetcher
ALL_TEST_PAGES = [
]
def data(fname):
return os.path.abspath('/'.join([__package__, 'data', fname]))
def read_data(fname):
return open(data(fname)).read()
def download_all(pages=ALL_TEST_PAGES):
f = CachingSiteFetcher(offli... |
6259df76129327a42c08fdd4b999ea7c617c6c9d | project/ndaparser/models.py | project/ndaparser/models.py | # -*- coding: utf-8 -*-
import datetime
import slugify as unicodeslugify
from django.db import models, transaction
from django.conf import settings
from django.contrib.auth import get_user_model
from django.utils.translation import ugettext_lazy as _
from asylum.models import AsylumModel
def get_sentinel_user():
... | # -*- coding: utf-8 -*-
import datetime
import slugify as unicodeslugify
from django.db import models, transaction
from django.conf import settings
from django.contrib.auth import get_user_model
from django.utils.translation import ugettext_lazy as _
from asylum.models import AsylumModel
def get_sentinel_user():
... | Fix the filename normalizing to keep extension | Fix the filename normalizing to keep extension
| Python | mit | rambo/asylum,jautero/asylum,HelsinkiHacklab/asylum,rambo/asylum,HelsinkiHacklab/asylum,hacklab-fi/asylum,rambo/asylum,jautero/asylum,hacklab-fi/asylum,HelsinkiHacklab/asylum,rambo/asylum,HelsinkiHacklab/asylum,hacklab-fi/asylum,jautero/asylum,hacklab-fi/asylum,jautero/asylum | # -*- coding: utf-8 -*-
import datetime
import slugify as unicodeslugify
from django.db import models, transaction
from django.conf import settings
from django.contrib.auth import get_user_model
from django.utils.translation import ugettext_lazy as _
from asylum.models import AsylumModel
def get_sentinel_user():
... | # -*- coding: utf-8 -*-
import datetime
import slugify as unicodeslugify
from django.db import models, transaction
from django.conf import settings
from django.contrib.auth import get_user_model
from django.utils.translation import ugettext_lazy as _
from asylum.models import AsylumModel
def get_sentinel_user():
... | <commit_before># -*- coding: utf-8 -*-
import datetime
import slugify as unicodeslugify
from django.db import models, transaction
from django.conf import settings
from django.contrib.auth import get_user_model
from django.utils.translation import ugettext_lazy as _
from asylum.models import AsylumModel
def get_se... | # -*- coding: utf-8 -*-
import datetime
import slugify as unicodeslugify
from django.db import models, transaction
from django.conf import settings
from django.contrib.auth import get_user_model
from django.utils.translation import ugettext_lazy as _
from asylum.models import AsylumModel
def get_sentinel_user():
... | # -*- coding: utf-8 -*-
import datetime
import slugify as unicodeslugify
from django.db import models, transaction
from django.conf import settings
from django.contrib.auth import get_user_model
from django.utils.translation import ugettext_lazy as _
from asylum.models import AsylumModel
def get_sentinel_user():
... | <commit_before># -*- coding: utf-8 -*-
import datetime
import slugify as unicodeslugify
from django.db import models, transaction
from django.conf import settings
from django.contrib.auth import get_user_model
from django.utils.translation import ugettext_lazy as _
from asylum.models import AsylumModel
def get_se... |
a6a88fac6300b92c82e797f72477df1df6b87dbe | faq/views.py | faq/views.py | from django.http import Http404
from django.views.generic import ListView, DetailView
from faq.models import Question, Category
class FAQQuestionListView(ListView):
context_object_name = "question_list"
template_name = "faq/question_list.html"
def get_queryset(self):
return Question.objects.all()
class FAQQ... | from django.http import Http404
from django.views.generic import ListView, DetailView
from faq.models import Question, Category
class FAQQuestionListView(ListView):
context_object_name = "question_list"
template_name = "faq/question_list.html"
def get_queryset(self):
return Question.objects.filter(categories... | Index should be ones without a category. | Index should be ones without a category.
| Python | bsd-3-clause | myles-archive/django-faq,asgardproject/django-faq | from django.http import Http404
from django.views.generic import ListView, DetailView
from faq.models import Question, Category
class FAQQuestionListView(ListView):
context_object_name = "question_list"
template_name = "faq/question_list.html"
def get_queryset(self):
return Question.objects.all()
class FAQQ... | from django.http import Http404
from django.views.generic import ListView, DetailView
from faq.models import Question, Category
class FAQQuestionListView(ListView):
context_object_name = "question_list"
template_name = "faq/question_list.html"
def get_queryset(self):
return Question.objects.filter(categories... | <commit_before>from django.http import Http404
from django.views.generic import ListView, DetailView
from faq.models import Question, Category
class FAQQuestionListView(ListView):
context_object_name = "question_list"
template_name = "faq/question_list.html"
def get_queryset(self):
return Question.objects.al... | from django.http import Http404
from django.views.generic import ListView, DetailView
from faq.models import Question, Category
class FAQQuestionListView(ListView):
context_object_name = "question_list"
template_name = "faq/question_list.html"
def get_queryset(self):
return Question.objects.filter(categories... | from django.http import Http404
from django.views.generic import ListView, DetailView
from faq.models import Question, Category
class FAQQuestionListView(ListView):
context_object_name = "question_list"
template_name = "faq/question_list.html"
def get_queryset(self):
return Question.objects.all()
class FAQQ... | <commit_before>from django.http import Http404
from django.views.generic import ListView, DetailView
from faq.models import Question, Category
class FAQQuestionListView(ListView):
context_object_name = "question_list"
template_name = "faq/question_list.html"
def get_queryset(self):
return Question.objects.al... |
0ecea9e68755bb7f03702b68d3f8565dde4fd16b | src/squibs/memsquib.py | src/squibs/memsquib.py | #!/usr/bin/python2
# vim:set ts=4 sw=4 et nowrap syntax=python ff=unix:
##############################################################################
import sys, time
def memory ():
f = open('/proc/meminfo', 'r')
lines = f.readlines()
f.close()
mem = []
for x in range(4):
mem.append(int(... | #!/usr/bin/python2
# vim:set ts=4 sw=4 et nowrap syntax=python ff=unix:
##############################################################################
import sys, time
def memory ():
f = open('/proc/meminfo', 'r')
lines = f.readlines()
f.close()
mem = []
for x in range(4):
mem.append(int(... | Add a memory used metric | Add a memory used metric
| Python | apache-2.0 | mcrewson/squib | #!/usr/bin/python2
# vim:set ts=4 sw=4 et nowrap syntax=python ff=unix:
##############################################################################
import sys, time
def memory ():
f = open('/proc/meminfo', 'r')
lines = f.readlines()
f.close()
mem = []
for x in range(4):
mem.append(int(... | #!/usr/bin/python2
# vim:set ts=4 sw=4 et nowrap syntax=python ff=unix:
##############################################################################
import sys, time
def memory ():
f = open('/proc/meminfo', 'r')
lines = f.readlines()
f.close()
mem = []
for x in range(4):
mem.append(int(... | <commit_before>#!/usr/bin/python2
# vim:set ts=4 sw=4 et nowrap syntax=python ff=unix:
##############################################################################
import sys, time
def memory ():
f = open('/proc/meminfo', 'r')
lines = f.readlines()
f.close()
mem = []
for x in range(4):
... | #!/usr/bin/python2
# vim:set ts=4 sw=4 et nowrap syntax=python ff=unix:
##############################################################################
import sys, time
def memory ():
f = open('/proc/meminfo', 'r')
lines = f.readlines()
f.close()
mem = []
for x in range(4):
mem.append(int(... | #!/usr/bin/python2
# vim:set ts=4 sw=4 et nowrap syntax=python ff=unix:
##############################################################################
import sys, time
def memory ():
f = open('/proc/meminfo', 'r')
lines = f.readlines()
f.close()
mem = []
for x in range(4):
mem.append(int(... | <commit_before>#!/usr/bin/python2
# vim:set ts=4 sw=4 et nowrap syntax=python ff=unix:
##############################################################################
import sys, time
def memory ():
f = open('/proc/meminfo', 'r')
lines = f.readlines()
f.close()
mem = []
for x in range(4):
... |
f4d87b49f100121896ab147e08f634ebcf68ae40 | generator.py | generator.py | import graph
def generate():
count = graph.getTotalCount()
zahajeni = graph.getSkupinaZahajeni(count)
probihajici = graph.getSkupinaProbihajici(count)
printHeader()
printBody(count, zahajeni, probihajici)
printFooter()
def printHeader():
print("<!DOCTYPE html>\n<html>\n<head>\n" +
... | import graph
import datetime
def generate():
count = graph.getTotalCount()
zahajeni = graph.getSkupinaZahajeni(count)
probihajici = graph.getSkupinaProbihajici(count)
printHeader()
printBody(count, zahajeni, probihajici)
printFooter()
def printHeader():
print("<!DOCTYPE html>\n<html>\n<... | Print generated date & time | Print generated date & time
| Python | mit | eghuro/pirgroups | import graph
def generate():
count = graph.getTotalCount()
zahajeni = graph.getSkupinaZahajeni(count)
probihajici = graph.getSkupinaProbihajici(count)
printHeader()
printBody(count, zahajeni, probihajici)
printFooter()
def printHeader():
print("<!DOCTYPE html>\n<html>\n<head>\n" +
... | import graph
import datetime
def generate():
count = graph.getTotalCount()
zahajeni = graph.getSkupinaZahajeni(count)
probihajici = graph.getSkupinaProbihajici(count)
printHeader()
printBody(count, zahajeni, probihajici)
printFooter()
def printHeader():
print("<!DOCTYPE html>\n<html>\n<... | <commit_before>import graph
def generate():
count = graph.getTotalCount()
zahajeni = graph.getSkupinaZahajeni(count)
probihajici = graph.getSkupinaProbihajici(count)
printHeader()
printBody(count, zahajeni, probihajici)
printFooter()
def printHeader():
print("<!DOCTYPE html>\n<html>\n<h... | import graph
import datetime
def generate():
count = graph.getTotalCount()
zahajeni = graph.getSkupinaZahajeni(count)
probihajici = graph.getSkupinaProbihajici(count)
printHeader()
printBody(count, zahajeni, probihajici)
printFooter()
def printHeader():
print("<!DOCTYPE html>\n<html>\n<... | import graph
def generate():
count = graph.getTotalCount()
zahajeni = graph.getSkupinaZahajeni(count)
probihajici = graph.getSkupinaProbihajici(count)
printHeader()
printBody(count, zahajeni, probihajici)
printFooter()
def printHeader():
print("<!DOCTYPE html>\n<html>\n<head>\n" +
... | <commit_before>import graph
def generate():
count = graph.getTotalCount()
zahajeni = graph.getSkupinaZahajeni(count)
probihajici = graph.getSkupinaProbihajici(count)
printHeader()
printBody(count, zahajeni, probihajici)
printFooter()
def printHeader():
print("<!DOCTYPE html>\n<html>\n<h... |
29cd6935a35872774e30804918c861af94230a8a | src/utils/cxiwriter.py | src/utils/cxiwriter.py | try:
import h5writer
except ImportError:
print 100*"*"
print "ERROR: For using the utils.cxiwriter.CXIWriter class please install the package \'h5writer\'."
print "\t $ pip install h5writer"
print "\t (Github repository: https://github.com/mhantke/h5writer)"
print 100*"*"
exit(1)
import... | try:
import h5writer
except ImportError:
print 100*"*"
print "ERROR: For using the utils.cxiwriter.CXIWriter class please install the package \'h5writer\'."
print "\t $ pip install h5writer"
print "\t (Github repository: https://github.com/mhantke/h5writer)"
print 100*"*"
exit(1)
import... | Use a separate communicator for each cxi writer | Use a separate communicator for each cxi writer
| Python | bsd-2-clause | SPIhub/hummingbird,FXIhub/hummingbird,FXIhub/hummingbird | try:
import h5writer
except ImportError:
print 100*"*"
print "ERROR: For using the utils.cxiwriter.CXIWriter class please install the package \'h5writer\'."
print "\t $ pip install h5writer"
print "\t (Github repository: https://github.com/mhantke/h5writer)"
print 100*"*"
exit(1)
import... | try:
import h5writer
except ImportError:
print 100*"*"
print "ERROR: For using the utils.cxiwriter.CXIWriter class please install the package \'h5writer\'."
print "\t $ pip install h5writer"
print "\t (Github repository: https://github.com/mhantke/h5writer)"
print 100*"*"
exit(1)
import... | <commit_before>try:
import h5writer
except ImportError:
print 100*"*"
print "ERROR: For using the utils.cxiwriter.CXIWriter class please install the package \'h5writer\'."
print "\t $ pip install h5writer"
print "\t (Github repository: https://github.com/mhantke/h5writer)"
print 100*"*"
exit... | try:
import h5writer
except ImportError:
print 100*"*"
print "ERROR: For using the utils.cxiwriter.CXIWriter class please install the package \'h5writer\'."
print "\t $ pip install h5writer"
print "\t (Github repository: https://github.com/mhantke/h5writer)"
print 100*"*"
exit(1)
import... | try:
import h5writer
except ImportError:
print 100*"*"
print "ERROR: For using the utils.cxiwriter.CXIWriter class please install the package \'h5writer\'."
print "\t $ pip install h5writer"
print "\t (Github repository: https://github.com/mhantke/h5writer)"
print 100*"*"
exit(1)
import... | <commit_before>try:
import h5writer
except ImportError:
print 100*"*"
print "ERROR: For using the utils.cxiwriter.CXIWriter class please install the package \'h5writer\'."
print "\t $ pip install h5writer"
print "\t (Github repository: https://github.com/mhantke/h5writer)"
print 100*"*"
exit... |
4a12eb87e660b3fdf1ae4a6c0b2628f45541695a | app/birdfeeder/handlers/main.py | app/birdfeeder/handlers/main.py | import urllib
from base.constants import CONSTANTS
import session
class IndexHandler(session.SessionApiHandler):
def _get_signed_in(self):
twitter_user = self._api.GetUser(self._session.twitter_id)
timeline_feed_url = self._get_path(
'feed/timeline/%s' % self._session.feed_id)
... | import urllib
from base.constants import CONSTANTS
import session
class IndexHandler(session.SessionApiHandler):
def _get_signed_in(self):
twitter_user = self._api.GetUser(self._session.twitter_id)
timeline_feed_url = self._get_path(
'feed/timeline/%s' % self._session.feed_id)
... | Fix Bird Feeder Reader URL. | Fix Bird Feeder Reader URL.
| Python | apache-2.0 | mihaip/streamspigot,mihaip/streamspigot,mihaip/streamspigot,mihaip/streamspigot | import urllib
from base.constants import CONSTANTS
import session
class IndexHandler(session.SessionApiHandler):
def _get_signed_in(self):
twitter_user = self._api.GetUser(self._session.twitter_id)
timeline_feed_url = self._get_path(
'feed/timeline/%s' % self._session.feed_id)
... | import urllib
from base.constants import CONSTANTS
import session
class IndexHandler(session.SessionApiHandler):
def _get_signed_in(self):
twitter_user = self._api.GetUser(self._session.twitter_id)
timeline_feed_url = self._get_path(
'feed/timeline/%s' % self._session.feed_id)
... | <commit_before>import urllib
from base.constants import CONSTANTS
import session
class IndexHandler(session.SessionApiHandler):
def _get_signed_in(self):
twitter_user = self._api.GetUser(self._session.twitter_id)
timeline_feed_url = self._get_path(
'feed/timeline/%s' % self._session.f... | import urllib
from base.constants import CONSTANTS
import session
class IndexHandler(session.SessionApiHandler):
def _get_signed_in(self):
twitter_user = self._api.GetUser(self._session.twitter_id)
timeline_feed_url = self._get_path(
'feed/timeline/%s' % self._session.feed_id)
... | import urllib
from base.constants import CONSTANTS
import session
class IndexHandler(session.SessionApiHandler):
def _get_signed_in(self):
twitter_user = self._api.GetUser(self._session.twitter_id)
timeline_feed_url = self._get_path(
'feed/timeline/%s' % self._session.feed_id)
... | <commit_before>import urllib
from base.constants import CONSTANTS
import session
class IndexHandler(session.SessionApiHandler):
def _get_signed_in(self):
twitter_user = self._api.GetUser(self._session.twitter_id)
timeline_feed_url = self._get_path(
'feed/timeline/%s' % self._session.f... |
199b3b2d95c7ada67a0b3c49abe9b6347266c0eb | codefett/users/serializers.py | codefett/users/serializers.py | from rest_framework import serializers
from .models import CFUser
class CFUserSerializer(serializers.ModelSerializer):
"""
Serializes a CFUser Model
"""
user__password = serializers.CharField(write_only=True, required=False)
class Meta:
model = CFUser
fields = ('id', 'user__email'... | from django.contrib.auth import update_session_auth_hash
from rest_framework import serializers
from .models import CFUser
class CFUserSerializer(serializers.ModelSerializer):
"""
Serializes a CFUser Model
"""
password = serializers.CharField(write_only=True, required=False)
confirm_password = ser... | Complete update method of User Serializer | Complete update method of User Serializer
| Python | agpl-3.0 | Rulox/codefett,Rulox/codefett,Rulox/codefett | from rest_framework import serializers
from .models import CFUser
class CFUserSerializer(serializers.ModelSerializer):
"""
Serializes a CFUser Model
"""
user__password = serializers.CharField(write_only=True, required=False)
class Meta:
model = CFUser
fields = ('id', 'user__email'... | from django.contrib.auth import update_session_auth_hash
from rest_framework import serializers
from .models import CFUser
class CFUserSerializer(serializers.ModelSerializer):
"""
Serializes a CFUser Model
"""
password = serializers.CharField(write_only=True, required=False)
confirm_password = ser... | <commit_before>from rest_framework import serializers
from .models import CFUser
class CFUserSerializer(serializers.ModelSerializer):
"""
Serializes a CFUser Model
"""
user__password = serializers.CharField(write_only=True, required=False)
class Meta:
model = CFUser
fields = ('id'... | from django.contrib.auth import update_session_auth_hash
from rest_framework import serializers
from .models import CFUser
class CFUserSerializer(serializers.ModelSerializer):
"""
Serializes a CFUser Model
"""
password = serializers.CharField(write_only=True, required=False)
confirm_password = ser... | from rest_framework import serializers
from .models import CFUser
class CFUserSerializer(serializers.ModelSerializer):
"""
Serializes a CFUser Model
"""
user__password = serializers.CharField(write_only=True, required=False)
class Meta:
model = CFUser
fields = ('id', 'user__email'... | <commit_before>from rest_framework import serializers
from .models import CFUser
class CFUserSerializer(serializers.ModelSerializer):
"""
Serializes a CFUser Model
"""
user__password = serializers.CharField(write_only=True, required=False)
class Meta:
model = CFUser
fields = ('id'... |
4e5674d938e40d86a140ec591d6a7429b9c29902 | test/conftest.py | test/conftest.py |
def pytest_addoption(parser):
parser.addoption("--webdriver", action="store", default="None",
help=("Selenium WebDriver interface to use for running the test. "
"Choices: None, PhantomJS, Chrome, Firefox, ChromeHeadless, "
"FirefoxHeadless.... | import os
def pytest_addoption(parser):
parser.addoption("--webdriver", action="store", default="None",
help=("Selenium WebDriver interface to use for running the test. "
"Choices: None, PhantomJS, Chrome, Firefox, ChromeHeadless, "
"Firef... | Add --offline flag for testing without downloads | Add --offline flag for testing without downloads
| Python | bsd-3-clause | spacetelescope/asv,qwhelan/asv,spacetelescope/asv,airspeed-velocity/asv,spacetelescope/asv,spacetelescope/asv,airspeed-velocity/asv,airspeed-velocity/asv,pv/asv,pv/asv,qwhelan/asv,pv/asv,qwhelan/asv,qwhelan/asv,airspeed-velocity/asv,pv/asv |
def pytest_addoption(parser):
parser.addoption("--webdriver", action="store", default="None",
help=("Selenium WebDriver interface to use for running the test. "
"Choices: None, PhantomJS, Chrome, Firefox, ChromeHeadless, "
"FirefoxHeadless.... | import os
def pytest_addoption(parser):
parser.addoption("--webdriver", action="store", default="None",
help=("Selenium WebDriver interface to use for running the test. "
"Choices: None, PhantomJS, Chrome, Firefox, ChromeHeadless, "
"Firef... | <commit_before>
def pytest_addoption(parser):
parser.addoption("--webdriver", action="store", default="None",
help=("Selenium WebDriver interface to use for running the test. "
"Choices: None, PhantomJS, Chrome, Firefox, ChromeHeadless, "
"F... | import os
def pytest_addoption(parser):
parser.addoption("--webdriver", action="store", default="None",
help=("Selenium WebDriver interface to use for running the test. "
"Choices: None, PhantomJS, Chrome, Firefox, ChromeHeadless, "
"Firef... |
def pytest_addoption(parser):
parser.addoption("--webdriver", action="store", default="None",
help=("Selenium WebDriver interface to use for running the test. "
"Choices: None, PhantomJS, Chrome, Firefox, ChromeHeadless, "
"FirefoxHeadless.... | <commit_before>
def pytest_addoption(parser):
parser.addoption("--webdriver", action="store", default="None",
help=("Selenium WebDriver interface to use for running the test. "
"Choices: None, PhantomJS, Chrome, Firefox, ChromeHeadless, "
"F... |
d47e3b7216effab8aa067d0a214b071ca77393fd | stories/serializers.py | stories/serializers.py | from rest_framework import serializers
from users.serializers import AuthorSerializer
from .models import Story, StoryLine
class StoryLineSerializer(serializers.ModelSerializer):
class Meta:
model = StoryLine
fields = ('id', 'content', 'posted_on')
class StorySerializer(serializers.ModelSeriali... | from rest_framework import serializers
from users.serializers import AuthorSerializer
from .models import Story, StoryLine
class StoryLineSerializer(serializers.ModelSerializer):
class Meta:
model = StoryLine
fields = ('id', 'content', 'posted_on')
class StorySerializer(serializers.ModelSeriali... | Set stories_set to read only field | Set stories_set to read only field
| Python | mit | pu6ki/tarina,pu6ki/tarina,pu6ki/tarina | from rest_framework import serializers
from users.serializers import AuthorSerializer
from .models import Story, StoryLine
class StoryLineSerializer(serializers.ModelSerializer):
class Meta:
model = StoryLine
fields = ('id', 'content', 'posted_on')
class StorySerializer(serializers.ModelSeriali... | from rest_framework import serializers
from users.serializers import AuthorSerializer
from .models import Story, StoryLine
class StoryLineSerializer(serializers.ModelSerializer):
class Meta:
model = StoryLine
fields = ('id', 'content', 'posted_on')
class StorySerializer(serializers.ModelSeriali... | <commit_before>from rest_framework import serializers
from users.serializers import AuthorSerializer
from .models import Story, StoryLine
class StoryLineSerializer(serializers.ModelSerializer):
class Meta:
model = StoryLine
fields = ('id', 'content', 'posted_on')
class StorySerializer(serialize... | from rest_framework import serializers
from users.serializers import AuthorSerializer
from .models import Story, StoryLine
class StoryLineSerializer(serializers.ModelSerializer):
class Meta:
model = StoryLine
fields = ('id', 'content', 'posted_on')
class StorySerializer(serializers.ModelSeriali... | from rest_framework import serializers
from users.serializers import AuthorSerializer
from .models import Story, StoryLine
class StoryLineSerializer(serializers.ModelSerializer):
class Meta:
model = StoryLine
fields = ('id', 'content', 'posted_on')
class StorySerializer(serializers.ModelSeriali... | <commit_before>from rest_framework import serializers
from users.serializers import AuthorSerializer
from .models import Story, StoryLine
class StoryLineSerializer(serializers.ModelSerializer):
class Meta:
model = StoryLine
fields = ('id', 'content', 'posted_on')
class StorySerializer(serialize... |
ca8fa466638c0ef405a82dfc3cfecfdb400faaa7 | sublime_jedi/helper.py | sublime_jedi/helper.py | # -*- coding: utf-8 -*-
import sublime
import sublime_plugin
from .utils import ask_daemon
class HelpMessageCommand(sublime_plugin.TextCommand):
def run(self, edit, docstring):
self.view.close()
self.view.insert(edit, self.view.size(), docstring)
class SublimeJediDocstring(sublime_plugin.TextC... | # -*- coding: utf-8 -*-
import sublime
import sublime_plugin
from .utils import ask_daemon, PythonCommandMixin
class HelpMessageCommand(sublime_plugin.TextCommand):
def run(self, edit, docstring):
self.view.close()
self.view.insert(edit, self.view.size(), docstring)
class SublimeJediDocstring(... | Hide documentation commands in non-python scope | Hide documentation commands in non-python scope
| Python | mit | srusskih/SublimeJEDI,edelvalle/SublimeJEDI | # -*- coding: utf-8 -*-
import sublime
import sublime_plugin
from .utils import ask_daemon
class HelpMessageCommand(sublime_plugin.TextCommand):
def run(self, edit, docstring):
self.view.close()
self.view.insert(edit, self.view.size(), docstring)
class SublimeJediDocstring(sublime_plugin.TextC... | # -*- coding: utf-8 -*-
import sublime
import sublime_plugin
from .utils import ask_daemon, PythonCommandMixin
class HelpMessageCommand(sublime_plugin.TextCommand):
def run(self, edit, docstring):
self.view.close()
self.view.insert(edit, self.view.size(), docstring)
class SublimeJediDocstring(... | <commit_before># -*- coding: utf-8 -*-
import sublime
import sublime_plugin
from .utils import ask_daemon
class HelpMessageCommand(sublime_plugin.TextCommand):
def run(self, edit, docstring):
self.view.close()
self.view.insert(edit, self.view.size(), docstring)
class SublimeJediDocstring(subli... | # -*- coding: utf-8 -*-
import sublime
import sublime_plugin
from .utils import ask_daemon, PythonCommandMixin
class HelpMessageCommand(sublime_plugin.TextCommand):
def run(self, edit, docstring):
self.view.close()
self.view.insert(edit, self.view.size(), docstring)
class SublimeJediDocstring(... | # -*- coding: utf-8 -*-
import sublime
import sublime_plugin
from .utils import ask_daemon
class HelpMessageCommand(sublime_plugin.TextCommand):
def run(self, edit, docstring):
self.view.close()
self.view.insert(edit, self.view.size(), docstring)
class SublimeJediDocstring(sublime_plugin.TextC... | <commit_before># -*- coding: utf-8 -*-
import sublime
import sublime_plugin
from .utils import ask_daemon
class HelpMessageCommand(sublime_plugin.TextCommand):
def run(self, edit, docstring):
self.view.close()
self.view.insert(edit, self.view.size(), docstring)
class SublimeJediDocstring(subli... |
f56d4814cade66fe8f8b58578048962179e18b15 | infohandball/settings/dev.py | infohandball/settings/dev.py | from base import *
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
INSTALLED_APPS += [
'debug_toolbar',
]
| from base import *
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
INSTALLED_APPS += [
'debug_toolbar',
]
JQUERY_URL = ''
| Use existing jquery for debug toolbar. | Use existing jquery for debug toolbar.
| Python | mit | lhuriguen/tophandball,lhuriguen/tophandball,lhuriguen/tophandball | from base import *
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
INSTALLED_APPS += [
'debug_toolbar',
]
Use existing jquery for debug toolbar. | from base import *
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
INSTALLED_APPS += [
'debug_toolbar',
]
JQUERY_URL = ''
| <commit_before>from base import *
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
INSTALLED_APPS += [
'debug_toolbar',
]
<commit_msg>Use existing jquery for debug toolbar.<commit_after> | from base import *
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
INSTALLED_APPS += [
'debug_toolbar',
]
JQUERY_URL = ''
| from base import *
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
INSTALLED_APPS += [
'debug_toolbar',
]
Use existing jquery for debug toolbar.from base import *
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
INSTALLED_APPS += [
'debug_toolbar',
]
JQUERY_URL = ''
| <commit_before>from base import *
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
INSTALLED_APPS += [
'debug_toolbar',
]
<commit_msg>Use existing jquery for debug toolbar.<commit_after>from base import *
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
INSTALLED_APPS += [
'd... |
ea43efc9d820833090670305a73543b43cf4286b | test/test_pyc.py | test/test_pyc.py | """
Test completions from *.pyc files:
- generated a dummy python module
- compile the dummy module to generate a *.pyc
- delete the pure python dummy module
- try jedi on the generated *.pyc
"""
import os
import compileall
import jedi
SRC = """class Foo:
pass
class Bar:
pass
"""
def generate_pyc():
... | """
Test completions from *.pyc files:
- generate a dummy python module
- compile the dummy module to generate a *.pyc
- delete the pure python dummy module
- try jedi on the generated *.pyc
"""
import compileall
import os
import shutil
import sys
import jedi
SRC = """class Foo:
pass
class Bar:
pass
""... | Fix pyc test for python3 | Fix pyc test for python3
To import pyc modules, we must move them out of the __pycache__
directory and rename them to remove ".cpython-%s%d".
This should still faild with python3 (UnicodeDecodeError)
| Python | mit | flurischt/jedi,flurischt/jedi,dwillmer/jedi,jonashaag/jedi,WoLpH/jedi,jonashaag/jedi,mfussenegger/jedi,tjwei/jedi,dwillmer/jedi,tjwei/jedi,mfussenegger/jedi,WoLpH/jedi | """
Test completions from *.pyc files:
- generated a dummy python module
- compile the dummy module to generate a *.pyc
- delete the pure python dummy module
- try jedi on the generated *.pyc
"""
import os
import compileall
import jedi
SRC = """class Foo:
pass
class Bar:
pass
"""
def generate_pyc():
... | """
Test completions from *.pyc files:
- generate a dummy python module
- compile the dummy module to generate a *.pyc
- delete the pure python dummy module
- try jedi on the generated *.pyc
"""
import compileall
import os
import shutil
import sys
import jedi
SRC = """class Foo:
pass
class Bar:
pass
""... | <commit_before>"""
Test completions from *.pyc files:
- generated a dummy python module
- compile the dummy module to generate a *.pyc
- delete the pure python dummy module
- try jedi on the generated *.pyc
"""
import os
import compileall
import jedi
SRC = """class Foo:
pass
class Bar:
pass
"""
def gen... | """
Test completions from *.pyc files:
- generate a dummy python module
- compile the dummy module to generate a *.pyc
- delete the pure python dummy module
- try jedi on the generated *.pyc
"""
import compileall
import os
import shutil
import sys
import jedi
SRC = """class Foo:
pass
class Bar:
pass
""... | """
Test completions from *.pyc files:
- generated a dummy python module
- compile the dummy module to generate a *.pyc
- delete the pure python dummy module
- try jedi on the generated *.pyc
"""
import os
import compileall
import jedi
SRC = """class Foo:
pass
class Bar:
pass
"""
def generate_pyc():
... | <commit_before>"""
Test completions from *.pyc files:
- generated a dummy python module
- compile the dummy module to generate a *.pyc
- delete the pure python dummy module
- try jedi on the generated *.pyc
"""
import os
import compileall
import jedi
SRC = """class Foo:
pass
class Bar:
pass
"""
def gen... |
997b8fc0658a5c581d65211285bf11df771889a4 | app/single_resource/forms.py | app/single_resource/forms.py | from flask.ext.wtf import Form
from wtforms.fields import FloatField, StringField, SubmitField
from wtforms.validators import InputRequired, Length
class SingleResourceForm(Form):
name = StringField('Name', validators=[
InputRequired(),
Length(1, 500)
])
address = StringField('Address', va... | from flask.ext.wtf import Form
from wtforms.fields import FloatField, StringField, SubmitField
from wtforms.validators import InputRequired, Length, Optional
class SingleResourceForm(Form):
name = StringField('Name', validators=[
InputRequired(),
Length(1, 500)
])
address = StringField('Ad... | Add validator if latitude/longitude is empty | Add validator if latitude/longitude is empty
| Python | mit | hack4impact/maps4all,hack4impact/maps4all,hack4impact/maps4all,hack4impact/maps4all | from flask.ext.wtf import Form
from wtforms.fields import FloatField, StringField, SubmitField
from wtforms.validators import InputRequired, Length
class SingleResourceForm(Form):
name = StringField('Name', validators=[
InputRequired(),
Length(1, 500)
])
address = StringField('Address', va... | from flask.ext.wtf import Form
from wtforms.fields import FloatField, StringField, SubmitField
from wtforms.validators import InputRequired, Length, Optional
class SingleResourceForm(Form):
name = StringField('Name', validators=[
InputRequired(),
Length(1, 500)
])
address = StringField('Ad... | <commit_before>from flask.ext.wtf import Form
from wtforms.fields import FloatField, StringField, SubmitField
from wtforms.validators import InputRequired, Length
class SingleResourceForm(Form):
name = StringField('Name', validators=[
InputRequired(),
Length(1, 500)
])
address = StringFiel... | from flask.ext.wtf import Form
from wtforms.fields import FloatField, StringField, SubmitField
from wtforms.validators import InputRequired, Length, Optional
class SingleResourceForm(Form):
name = StringField('Name', validators=[
InputRequired(),
Length(1, 500)
])
address = StringField('Ad... | from flask.ext.wtf import Form
from wtforms.fields import FloatField, StringField, SubmitField
from wtforms.validators import InputRequired, Length
class SingleResourceForm(Form):
name = StringField('Name', validators=[
InputRequired(),
Length(1, 500)
])
address = StringField('Address', va... | <commit_before>from flask.ext.wtf import Form
from wtforms.fields import FloatField, StringField, SubmitField
from wtforms.validators import InputRequired, Length
class SingleResourceForm(Form):
name = StringField('Name', validators=[
InputRequired(),
Length(1, 500)
])
address = StringFiel... |
906505d85914287af3a031bf77f74dd79a4aaa32 | pygraphc/preprocess/CreateGraphModel.py | pygraphc/preprocess/CreateGraphModel.py | from pygraphc.preprocess.ParallelPreprocess import ParallelPreprocess
from pygraphc.similarity.JaroWinkler import JaroWinkler
from pygraphc.pruning.TrianglePruning import TrianglePruning
import networkx as nx
class CreateGraphModel(object):
def __init__(self, log_file):
self.log_file = log_file
se... | from pygraphc.preprocess.ParallelPreprocess import ParallelPreprocess
from pygraphc.similarity.CosineSimilarity import ParallelCosineSimilarity
from pygraphc.pruning.TrianglePruning import TrianglePruning
import networkx as nx
class CreateGraphModel(object):
def __init__(self, log_file):
self.log_file = l... | Change jaro-winkler to cosine similarity | Change jaro-winkler to cosine similarity
| Python | mit | studiawan/pygraphc | from pygraphc.preprocess.ParallelPreprocess import ParallelPreprocess
from pygraphc.similarity.JaroWinkler import JaroWinkler
from pygraphc.pruning.TrianglePruning import TrianglePruning
import networkx as nx
class CreateGraphModel(object):
def __init__(self, log_file):
self.log_file = log_file
se... | from pygraphc.preprocess.ParallelPreprocess import ParallelPreprocess
from pygraphc.similarity.CosineSimilarity import ParallelCosineSimilarity
from pygraphc.pruning.TrianglePruning import TrianglePruning
import networkx as nx
class CreateGraphModel(object):
def __init__(self, log_file):
self.log_file = l... | <commit_before>from pygraphc.preprocess.ParallelPreprocess import ParallelPreprocess
from pygraphc.similarity.JaroWinkler import JaroWinkler
from pygraphc.pruning.TrianglePruning import TrianglePruning
import networkx as nx
class CreateGraphModel(object):
def __init__(self, log_file):
self.log_file = log_... | from pygraphc.preprocess.ParallelPreprocess import ParallelPreprocess
from pygraphc.similarity.CosineSimilarity import ParallelCosineSimilarity
from pygraphc.pruning.TrianglePruning import TrianglePruning
import networkx as nx
class CreateGraphModel(object):
def __init__(self, log_file):
self.log_file = l... | from pygraphc.preprocess.ParallelPreprocess import ParallelPreprocess
from pygraphc.similarity.JaroWinkler import JaroWinkler
from pygraphc.pruning.TrianglePruning import TrianglePruning
import networkx as nx
class CreateGraphModel(object):
def __init__(self, log_file):
self.log_file = log_file
se... | <commit_before>from pygraphc.preprocess.ParallelPreprocess import ParallelPreprocess
from pygraphc.similarity.JaroWinkler import JaroWinkler
from pygraphc.pruning.TrianglePruning import TrianglePruning
import networkx as nx
class CreateGraphModel(object):
def __init__(self, log_file):
self.log_file = log_... |
10047e427d38e2fef09b1f4b4d8ece567c811315 | reqon/deprecated/__init__.py | reqon/deprecated/__init__.py | import rethinkdb as r
from . import coerce, geo, operators, terms
from .coerce import COERSIONS
from .operators import BOOLEAN, EXPRESSIONS, MODIFIERS
from .terms import TERMS
from .exceptions import ReqonError, InvalidTypeError, InvalidFilterError
def query(query):
try:
reql = r.db(query['$db']).table(q... | import rethinkdb as r
from . import coerce, geo, operators, terms
from .coerce import COERSIONS
from .operators import BOOLEAN, EXPRESSIONS, MODIFIERS
from .terms import TERMS
from .exceptions import ReqonError, InvalidTypeError, InvalidFilterError
def query(query):
try:
reql = r.db(query['$db']).table(q... | Fix arguments order of reqon.deprecated.build_terms(). | Fix arguments order of reqon.deprecated.build_terms().
| Python | mit | dmpayton/reqon | import rethinkdb as r
from . import coerce, geo, operators, terms
from .coerce import COERSIONS
from .operators import BOOLEAN, EXPRESSIONS, MODIFIERS
from .terms import TERMS
from .exceptions import ReqonError, InvalidTypeError, InvalidFilterError
def query(query):
try:
reql = r.db(query['$db']).table(q... | import rethinkdb as r
from . import coerce, geo, operators, terms
from .coerce import COERSIONS
from .operators import BOOLEAN, EXPRESSIONS, MODIFIERS
from .terms import TERMS
from .exceptions import ReqonError, InvalidTypeError, InvalidFilterError
def query(query):
try:
reql = r.db(query['$db']).table(q... | <commit_before>import rethinkdb as r
from . import coerce, geo, operators, terms
from .coerce import COERSIONS
from .operators import BOOLEAN, EXPRESSIONS, MODIFIERS
from .terms import TERMS
from .exceptions import ReqonError, InvalidTypeError, InvalidFilterError
def query(query):
try:
reql = r.db(query[... | import rethinkdb as r
from . import coerce, geo, operators, terms
from .coerce import COERSIONS
from .operators import BOOLEAN, EXPRESSIONS, MODIFIERS
from .terms import TERMS
from .exceptions import ReqonError, InvalidTypeError, InvalidFilterError
def query(query):
try:
reql = r.db(query['$db']).table(q... | import rethinkdb as r
from . import coerce, geo, operators, terms
from .coerce import COERSIONS
from .operators import BOOLEAN, EXPRESSIONS, MODIFIERS
from .terms import TERMS
from .exceptions import ReqonError, InvalidTypeError, InvalidFilterError
def query(query):
try:
reql = r.db(query['$db']).table(q... | <commit_before>import rethinkdb as r
from . import coerce, geo, operators, terms
from .coerce import COERSIONS
from .operators import BOOLEAN, EXPRESSIONS, MODIFIERS
from .terms import TERMS
from .exceptions import ReqonError, InvalidTypeError, InvalidFilterError
def query(query):
try:
reql = r.db(query[... |
249638f69c82ed26a240b892bac85e7abe038151 | run_tests.py | run_tests.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import unittest2 as unittest
current_path = os.path.abspath(os.path.dirname(__file__))
tests_path = os.path.join(current_path, 'tests')
sys.path[0:0] = [
current_path,
tests_path,
]
all_tests = [f[:-3] for f in os.listdir(tests_path)
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import unittest2 as unittest
current_path = os.path.abspath(os.path.dirname(__file__))
tests_path = os.path.join(current_path, 'tests')
sys.path[0:0] = [
current_path,
tests_path,
]
all_tests = [f[:-3] for f in os.listdir(tests_path)
... | Reduce the verbosity of the tests. | Reduce the verbosity of the tests.
Signed-off-by: Gora Khargosh <[email protected]>
| Python | apache-2.0 | gorakhargosh/pyoauth,gorakhargosh/pyoauth | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import unittest2 as unittest
current_path = os.path.abspath(os.path.dirname(__file__))
tests_path = os.path.join(current_path, 'tests')
sys.path[0:0] = [
current_path,
tests_path,
]
all_tests = [f[:-3] for f in os.listdir(tests_path)
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import unittest2 as unittest
current_path = os.path.abspath(os.path.dirname(__file__))
tests_path = os.path.join(current_path, 'tests')
sys.path[0:0] = [
current_path,
tests_path,
]
all_tests = [f[:-3] for f in os.listdir(tests_path)
... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import unittest2 as unittest
current_path = os.path.abspath(os.path.dirname(__file__))
tests_path = os.path.join(current_path, 'tests')
sys.path[0:0] = [
current_path,
tests_path,
]
all_tests = [f[:-3] for f in os.listdir(tests... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import unittest2 as unittest
current_path = os.path.abspath(os.path.dirname(__file__))
tests_path = os.path.join(current_path, 'tests')
sys.path[0:0] = [
current_path,
tests_path,
]
all_tests = [f[:-3] for f in os.listdir(tests_path)
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import unittest2 as unittest
current_path = os.path.abspath(os.path.dirname(__file__))
tests_path = os.path.join(current_path, 'tests')
sys.path[0:0] = [
current_path,
tests_path,
]
all_tests = [f[:-3] for f in os.listdir(tests_path)
... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import unittest2 as unittest
current_path = os.path.abspath(os.path.dirname(__file__))
tests_path = os.path.join(current_path, 'tests')
sys.path[0:0] = [
current_path,
tests_path,
]
all_tests = [f[:-3] for f in os.listdir(tests... |
687bb4e81e7223e9d380e75b36c46d36c142deea | sentiment.py | sentiment.py | from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient
from azure.common.credentials import UserPassCredentials
import cfg
c = cfg.read_cfg()
subscription_id = c['txtkey']
| Add config file for subsciber ID. | Add config file for subsciber ID.
| Python | mit | gnfrazier/textsentiment | Add config file for subsciber ID. | from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient
from azure.common.credentials import UserPassCredentials
import cfg
c = cfg.read_cfg()
subscription_id = c['txtkey']
| <commit_before><commit_msg>Add config file for subsciber ID.<commit_after> | from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient
from azure.common.credentials import UserPassCredentials
import cfg
c = cfg.read_cfg()
subscription_id = c['txtkey']
| Add config file for subsciber ID.from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient
from azure.common.credentials import UserPassCredentials
import cfg
c = cfg.read_cfg()
subscription_id = c['txtkey']
| <commit_before><commit_msg>Add config file for subsciber ID.<commit_after>from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient
from azure.common.credentials import UserPassCredentials
import cfg
c = cfg.read_cfg()
subscription_id = c['txtkey']
| |
19a58255f247199d0e60408cab8220a8c2a1ff3b | qxlc/minifier.py | qxlc/minifier.py | import htmlmin
from markupsafe import Markup
from qxlc import app
@app.template_filter("minify")
def minify_filter(text):
return Markup(htmlmin.minify(text.unescape(), remove_comments=True, remove_empty_space=True))
| import htmlmin
from markupsafe import Markup
from qxlc import app
@app.template_filter("minify")
def minify_filter(s):
return Markup(htmlmin.minify(str(s), remove_comments=True, remove_empty_space=True))
| Use str(s) instead of s.unescape() to add support for escaping things inside. (took me a while to find that str() worked) | Use str(s) instead of s.unescape() to add support for escaping things inside. (took me a while to find that str() worked)
| Python | apache-2.0 | daboross/qxlc,daboross/qxlc | import htmlmin
from markupsafe import Markup
from qxlc import app
@app.template_filter("minify")
def minify_filter(text):
return Markup(htmlmin.minify(text.unescape(), remove_comments=True, remove_empty_space=True))
Use str(s) instead of s.unescape() to add support for escaping things inside. (took me a while to... | import htmlmin
from markupsafe import Markup
from qxlc import app
@app.template_filter("minify")
def minify_filter(s):
return Markup(htmlmin.minify(str(s), remove_comments=True, remove_empty_space=True))
| <commit_before>import htmlmin
from markupsafe import Markup
from qxlc import app
@app.template_filter("minify")
def minify_filter(text):
return Markup(htmlmin.minify(text.unescape(), remove_comments=True, remove_empty_space=True))
<commit_msg>Use str(s) instead of s.unescape() to add support for escaping things ... | import htmlmin
from markupsafe import Markup
from qxlc import app
@app.template_filter("minify")
def minify_filter(s):
return Markup(htmlmin.minify(str(s), remove_comments=True, remove_empty_space=True))
| import htmlmin
from markupsafe import Markup
from qxlc import app
@app.template_filter("minify")
def minify_filter(text):
return Markup(htmlmin.minify(text.unescape(), remove_comments=True, remove_empty_space=True))
Use str(s) instead of s.unescape() to add support for escaping things inside. (took me a while to... | <commit_before>import htmlmin
from markupsafe import Markup
from qxlc import app
@app.template_filter("minify")
def minify_filter(text):
return Markup(htmlmin.minify(text.unescape(), remove_comments=True, remove_empty_space=True))
<commit_msg>Use str(s) instead of s.unescape() to add support for escaping things ... |
fbae436ae2d9ee29b64f81331ee3b316b153f750 | locksmith/common.py | locksmith/common.py | import hashlib
import hmac
import urllib, urllib2
KEY_STATUSES = (
('U', 'Unactivated'),
('A', 'Active'),
('S', 'Suspended')
)
UNPUBLISHED, PUBLISHED, NEEDS_UPDATE = range(3)
PUB_STATUSES = (
(UNPUBLISHED, 'Unpublished'),
(PUBLISHED, 'Published'),
(NEEDS_UPDATE, 'Needs Update'),
)
def get_si... | import hashlib
import hmac
import urllib, urllib2
KEY_STATUSES = (
('U', 'Unactivated'),
('A', 'Active'),
('S', 'Suspended')
)
UNPUBLISHED, PUBLISHED, NEEDS_UPDATE = range(3)
PUB_STATUSES = (
(UNPUBLISHED, 'Unpublished'),
(PUBLISHED, 'Published'),
(NEEDS_UPDATE, 'Needs Update'),
)
def get_sig... | Make get_signature support unicode characters by encoding to utf-8 instead of ascii. | Make get_signature support unicode characters by encoding to utf-8 instead of ascii.
| Python | bsd-3-clause | sunlightlabs/django-locksmith,sunlightlabs/django-locksmith,sunlightlabs/django-locksmith | import hashlib
import hmac
import urllib, urllib2
KEY_STATUSES = (
('U', 'Unactivated'),
('A', 'Active'),
('S', 'Suspended')
)
UNPUBLISHED, PUBLISHED, NEEDS_UPDATE = range(3)
PUB_STATUSES = (
(UNPUBLISHED, 'Unpublished'),
(PUBLISHED, 'Published'),
(NEEDS_UPDATE, 'Needs Update'),
)
def get_si... | import hashlib
import hmac
import urllib, urllib2
KEY_STATUSES = (
('U', 'Unactivated'),
('A', 'Active'),
('S', 'Suspended')
)
UNPUBLISHED, PUBLISHED, NEEDS_UPDATE = range(3)
PUB_STATUSES = (
(UNPUBLISHED, 'Unpublished'),
(PUBLISHED, 'Published'),
(NEEDS_UPDATE, 'Needs Update'),
)
def get_sig... | <commit_before>import hashlib
import hmac
import urllib, urllib2
KEY_STATUSES = (
('U', 'Unactivated'),
('A', 'Active'),
('S', 'Suspended')
)
UNPUBLISHED, PUBLISHED, NEEDS_UPDATE = range(3)
PUB_STATUSES = (
(UNPUBLISHED, 'Unpublished'),
(PUBLISHED, 'Published'),
(NEEDS_UPDATE, 'Needs Update'),... | import hashlib
import hmac
import urllib, urllib2
KEY_STATUSES = (
('U', 'Unactivated'),
('A', 'Active'),
('S', 'Suspended')
)
UNPUBLISHED, PUBLISHED, NEEDS_UPDATE = range(3)
PUB_STATUSES = (
(UNPUBLISHED, 'Unpublished'),
(PUBLISHED, 'Published'),
(NEEDS_UPDATE, 'Needs Update'),
)
def get_sig... | import hashlib
import hmac
import urllib, urllib2
KEY_STATUSES = (
('U', 'Unactivated'),
('A', 'Active'),
('S', 'Suspended')
)
UNPUBLISHED, PUBLISHED, NEEDS_UPDATE = range(3)
PUB_STATUSES = (
(UNPUBLISHED, 'Unpublished'),
(PUBLISHED, 'Published'),
(NEEDS_UPDATE, 'Needs Update'),
)
def get_si... | <commit_before>import hashlib
import hmac
import urllib, urllib2
KEY_STATUSES = (
('U', 'Unactivated'),
('A', 'Active'),
('S', 'Suspended')
)
UNPUBLISHED, PUBLISHED, NEEDS_UPDATE = range(3)
PUB_STATUSES = (
(UNPUBLISHED, 'Unpublished'),
(PUBLISHED, 'Published'),
(NEEDS_UPDATE, 'Needs Update'),... |
f4ea4ac658a5120bacf80e3c6ca86cf4afa794e0 | src/encoded/commands/es_index_data.py | src/encoded/commands/es_index_data.py | from pyramid.paster import get_app
import logging
from webtest import TestApp
index = 'encoded'
EPILOG = __doc__
def run(app, collections=None, record=False):
environ = {
'HTTP_ACCEPT': 'application/json',
'REMOTE_USER': 'INDEXER',
}
testapp = TestApp(app, environ)
testapp.post_json(... | from pyramid.paster import get_app
import logging
from webtest import TestApp
index = 'encoded'
EPILOG = __doc__
def run(app, collections=None, record=False):
environ = {
'HTTP_ACCEPT': 'application/json',
'REMOTE_USER': 'INDEXER',
}
testapp = TestApp(app, environ)
testapp.post_json(... | Make es-index-data command use multiprocess indexing. | Make es-index-data command use multiprocess indexing.
| Python | mit | ENCODE-DCC/snovault,ENCODE-DCC/snovault,hms-dbmi/fourfront,T2DREAM/t2dream-portal,T2DREAM/t2dream-portal,4dn-dcic/fourfront,ENCODE-DCC/snovault,ENCODE-DCC/snovault,T2DREAM/t2dream-portal,hms-dbmi/fourfront,4dn-dcic/fourfront,ENCODE-DCC/snovault,hms-dbmi/fourfront,ENCODE-DCC/encoded,ENCODE-DCC/encoded,4dn-dcic/fourfront... | from pyramid.paster import get_app
import logging
from webtest import TestApp
index = 'encoded'
EPILOG = __doc__
def run(app, collections=None, record=False):
environ = {
'HTTP_ACCEPT': 'application/json',
'REMOTE_USER': 'INDEXER',
}
testapp = TestApp(app, environ)
testapp.post_json(... | from pyramid.paster import get_app
import logging
from webtest import TestApp
index = 'encoded'
EPILOG = __doc__
def run(app, collections=None, record=False):
environ = {
'HTTP_ACCEPT': 'application/json',
'REMOTE_USER': 'INDEXER',
}
testapp = TestApp(app, environ)
testapp.post_json(... | <commit_before>from pyramid.paster import get_app
import logging
from webtest import TestApp
index = 'encoded'
EPILOG = __doc__
def run(app, collections=None, record=False):
environ = {
'HTTP_ACCEPT': 'application/json',
'REMOTE_USER': 'INDEXER',
}
testapp = TestApp(app, environ)
tes... | from pyramid.paster import get_app
import logging
from webtest import TestApp
index = 'encoded'
EPILOG = __doc__
def run(app, collections=None, record=False):
environ = {
'HTTP_ACCEPT': 'application/json',
'REMOTE_USER': 'INDEXER',
}
testapp = TestApp(app, environ)
testapp.post_json(... | from pyramid.paster import get_app
import logging
from webtest import TestApp
index = 'encoded'
EPILOG = __doc__
def run(app, collections=None, record=False):
environ = {
'HTTP_ACCEPT': 'application/json',
'REMOTE_USER': 'INDEXER',
}
testapp = TestApp(app, environ)
testapp.post_json(... | <commit_before>from pyramid.paster import get_app
import logging
from webtest import TestApp
index = 'encoded'
EPILOG = __doc__
def run(app, collections=None, record=False):
environ = {
'HTTP_ACCEPT': 'application/json',
'REMOTE_USER': 'INDEXER',
}
testapp = TestApp(app, environ)
tes... |
f180f75d97439b10e2325c1e85b88c0ecfb03e73 | bmi_tester/tests/__init__.py | bmi_tester/tests/__init__.py | # Both of these variables should be overriden to test a particular
# BMI class
Bmi = None
INPUT_FILE = None
| # Both of these variables should be overriden to test a particular
# BMI class
Bmi = None
INPUT_FILE = None
BMI_VERSION_STRING = '1.1'
| Set default for BMI_VERSION_STRING to 1.1. | Set default for BMI_VERSION_STRING to 1.1.
| Python | mit | csdms/bmi-tester | # Both of these variables should be overriden to test a particular
# BMI class
Bmi = None
INPUT_FILE = None
Set default for BMI_VERSION_STRING to 1.1. | # Both of these variables should be overriden to test a particular
# BMI class
Bmi = None
INPUT_FILE = None
BMI_VERSION_STRING = '1.1'
| <commit_before># Both of these variables should be overriden to test a particular
# BMI class
Bmi = None
INPUT_FILE = None
<commit_msg>Set default for BMI_VERSION_STRING to 1.1.<commit_after> | # Both of these variables should be overriden to test a particular
# BMI class
Bmi = None
INPUT_FILE = None
BMI_VERSION_STRING = '1.1'
| # Both of these variables should be overriden to test a particular
# BMI class
Bmi = None
INPUT_FILE = None
Set default for BMI_VERSION_STRING to 1.1.# Both of these variables should be overriden to test a particular
# BMI class
Bmi = None
INPUT_FILE = None
BMI_VERSION_STRING = '1.1'
| <commit_before># Both of these variables should be overriden to test a particular
# BMI class
Bmi = None
INPUT_FILE = None
<commit_msg>Set default for BMI_VERSION_STRING to 1.1.<commit_after># Both of these variables should be overriden to test a particular
# BMI class
Bmi = None
INPUT_FILE = None
BMI_VERSION_STRING = ... |
f81e409ab1666a8a3bb1ff1806d256644712382f | structures/__init__.py | structures/__init__.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from .base import DBStructure, _Generated
from .files.main import *
from .files.custom import *
from ..locales import L
class StructureError(Exception):
pass
class StructureLoader():
wowfiles = None
@classmethod
def setup(cls):
if cls.wowfiles is None:
cls.wowfile... | #!/usr/bin/python
# -*- coding: utf-8 -*-
from .base import DBStructure, _Generated
from .files.main import *
from .files.custom import *
from ..locales import L
class UnknownStructure(Exception):
pass
class StructureLoader():
wowfiles = None
@classmethod
def setup(cls):
if cls.wowfiles is None:
cls.wowfi... | Raise more appropriate UnknownStructure exception rather than StructureError if a structure is not found. | structures: Raise more appropriate UnknownStructure exception rather than StructureError if a structure is not found.
| Python | cc0-1.0 | jleclanche/pywow,jleclanche/pywow,jleclanche/pywow,jleclanche/pywow,jleclanche/pywow,jleclanche/pywow | #!/usr/bin/python
# -*- coding: utf-8 -*-
from .base import DBStructure, _Generated
from .files.main import *
from .files.custom import *
from ..locales import L
class StructureError(Exception):
pass
class StructureLoader():
wowfiles = None
@classmethod
def setup(cls):
if cls.wowfiles is None:
cls.wowfile... | #!/usr/bin/python
# -*- coding: utf-8 -*-
from .base import DBStructure, _Generated
from .files.main import *
from .files.custom import *
from ..locales import L
class UnknownStructure(Exception):
pass
class StructureLoader():
wowfiles = None
@classmethod
def setup(cls):
if cls.wowfiles is None:
cls.wowfi... | <commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-
from .base import DBStructure, _Generated
from .files.main import *
from .files.custom import *
from ..locales import L
class StructureError(Exception):
pass
class StructureLoader():
wowfiles = None
@classmethod
def setup(cls):
if cls.wowfiles is None:... | #!/usr/bin/python
# -*- coding: utf-8 -*-
from .base import DBStructure, _Generated
from .files.main import *
from .files.custom import *
from ..locales import L
class UnknownStructure(Exception):
pass
class StructureLoader():
wowfiles = None
@classmethod
def setup(cls):
if cls.wowfiles is None:
cls.wowfi... | #!/usr/bin/python
# -*- coding: utf-8 -*-
from .base import DBStructure, _Generated
from .files.main import *
from .files.custom import *
from ..locales import L
class StructureError(Exception):
pass
class StructureLoader():
wowfiles = None
@classmethod
def setup(cls):
if cls.wowfiles is None:
cls.wowfile... | <commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-
from .base import DBStructure, _Generated
from .files.main import *
from .files.custom import *
from ..locales import L
class StructureError(Exception):
pass
class StructureLoader():
wowfiles = None
@classmethod
def setup(cls):
if cls.wowfiles is None:... |
f8d551627781ea9568b97a426135bce74adf3adf | utils/helpers.py | utils/helpers.py | import boto3
class Helpers(object):
"""A container class for convenience functions."""
_aws_account_id = None
@classmethod
def aws_account_id(cls):
"""Query for the current account ID by inspecting the default security group."""
if cls._aws_account_id is None:
cls._aws_ac... | import boto3
class Helpers(object):
"""A container class for convenience functions."""
_aws_account_id = None
@classmethod
def aws_account_id(cls):
"""Query for the current account ID by inspecting the caller identity."""
if cls._aws_account_id is None:
caller_data = boto... | Use get_caller_identity instead of default SG to determine account id | Use get_caller_identity instead of default SG to determine account id
| Python | mit | dliggat/local-lambda-toolkit | import boto3
class Helpers(object):
"""A container class for convenience functions."""
_aws_account_id = None
@classmethod
def aws_account_id(cls):
"""Query for the current account ID by inspecting the default security group."""
if cls._aws_account_id is None:
cls._aws_ac... | import boto3
class Helpers(object):
"""A container class for convenience functions."""
_aws_account_id = None
@classmethod
def aws_account_id(cls):
"""Query for the current account ID by inspecting the caller identity."""
if cls._aws_account_id is None:
caller_data = boto... | <commit_before>import boto3
class Helpers(object):
"""A container class for convenience functions."""
_aws_account_id = None
@classmethod
def aws_account_id(cls):
"""Query for the current account ID by inspecting the default security group."""
if cls._aws_account_id is None:
... | import boto3
class Helpers(object):
"""A container class for convenience functions."""
_aws_account_id = None
@classmethod
def aws_account_id(cls):
"""Query for the current account ID by inspecting the caller identity."""
if cls._aws_account_id is None:
caller_data = boto... | import boto3
class Helpers(object):
"""A container class for convenience functions."""
_aws_account_id = None
@classmethod
def aws_account_id(cls):
"""Query for the current account ID by inspecting the default security group."""
if cls._aws_account_id is None:
cls._aws_ac... | <commit_before>import boto3
class Helpers(object):
"""A container class for convenience functions."""
_aws_account_id = None
@classmethod
def aws_account_id(cls):
"""Query for the current account ID by inspecting the default security group."""
if cls._aws_account_id is None:
... |
b5ee460f06fbbf12fcdf38a873a317854533c7ca | tools/vardict/split.py | tools/vardict/split.py | import sys
fai = sys.argv[1]
chunk_size = int(sys.argv[2])
overlap = 150 # Base pairs
with open(fai, 'r') as infile:
for line in infile:
name = line.split('\t')[0]
stop = int(line.split('\t')[1])
start = 1
while start < stop:
start = max(1, start - overlap)... | import sys
fai = sys.argv[1]
chunk_size = int(sys.argv[2])
overlap = 150 # Base pairs
with open(fai, 'r') as infile:
for line in infile:
name = line.split('\t')[0]
stop = int(line.split('\t')[1])
start = 1
while start < stop:
start = max(1, start - overlap)... | Fix syntax error, missing ')' | Fix syntax error, missing ')' | Python | mit | blankenberg/tools-iuc,nsoranzo/tools-iuc,mvdbeek/tools-iuc,jj-umn/tools-iuc,gregvonkuster/tools-iuc,nekrut/tools-iuc,natefoo/tools-iuc,loraine-gueguen/tools-iuc,gregvonkuster/tools-iuc,natefoo/tools-iuc,Delphine-L/tools-iuc,galaxyproject/tools-iuc,mvdbeek/tools-iuc,loraine-gueguen/tools-iuc,jj-umn/tools-iuc,nekrut/tool... | import sys
fai = sys.argv[1]
chunk_size = int(sys.argv[2])
overlap = 150 # Base pairs
with open(fai, 'r') as infile:
for line in infile:
name = line.split('\t')[0]
stop = int(line.split('\t')[1])
start = 1
while start < stop:
start = max(1, start - overlap)... | import sys
fai = sys.argv[1]
chunk_size = int(sys.argv[2])
overlap = 150 # Base pairs
with open(fai, 'r') as infile:
for line in infile:
name = line.split('\t')[0]
stop = int(line.split('\t')[1])
start = 1
while start < stop:
start = max(1, start - overlap)... | <commit_before>import sys
fai = sys.argv[1]
chunk_size = int(sys.argv[2])
overlap = 150 # Base pairs
with open(fai, 'r') as infile:
for line in infile:
name = line.split('\t')[0]
stop = int(line.split('\t')[1])
start = 1
while start < stop:
start = max(1, s... | import sys
fai = sys.argv[1]
chunk_size = int(sys.argv[2])
overlap = 150 # Base pairs
with open(fai, 'r') as infile:
for line in infile:
name = line.split('\t')[0]
stop = int(line.split('\t')[1])
start = 1
while start < stop:
start = max(1, start - overlap)... | import sys
fai = sys.argv[1]
chunk_size = int(sys.argv[2])
overlap = 150 # Base pairs
with open(fai, 'r') as infile:
for line in infile:
name = line.split('\t')[0]
stop = int(line.split('\t')[1])
start = 1
while start < stop:
start = max(1, start - overlap)... | <commit_before>import sys
fai = sys.argv[1]
chunk_size = int(sys.argv[2])
overlap = 150 # Base pairs
with open(fai, 'r') as infile:
for line in infile:
name = line.split('\t')[0]
stop = int(line.split('\t')[1])
start = 1
while start < stop:
start = max(1, s... |
db2375425f9c125349f7ed5434175adb80c0ce95 | students/utils.py | students/utils.py | from datetime import datetime
from .exceptions import ClientError
from .models import Booking, RobotTerminal
def get_robot_terminal_or_error(robot_id, user):
# Check if the user is logged in
if not user.is_authenticated():
raise ClientError("USER_HAS_TO_LOGIN")
# get the robot_terminal with the ... | from datetime import datetime
from .exceptions import ClientError
from .models import Booking, RobotTerminal
def get_robot_terminal_or_error(robot_id, user):
# Check if the user is logged in
if not user.is_authenticated():
raise ClientError("USER_HAS_TO_LOGIN")
# get the robot_terminal with the ... | Add utility function to get the robot that a given user currently has booked out (or None). | Add utility function to get the robot that a given user currently has booked out (or None).
| Python | mit | muhummadPatel/raspied,muhummadPatel/raspied,muhummadPatel/raspied | from datetime import datetime
from .exceptions import ClientError
from .models import Booking, RobotTerminal
def get_robot_terminal_or_error(robot_id, user):
# Check if the user is logged in
if not user.is_authenticated():
raise ClientError("USER_HAS_TO_LOGIN")
# get the robot_terminal with the ... | from datetime import datetime
from .exceptions import ClientError
from .models import Booking, RobotTerminal
def get_robot_terminal_or_error(robot_id, user):
# Check if the user is logged in
if not user.is_authenticated():
raise ClientError("USER_HAS_TO_LOGIN")
# get the robot_terminal with the ... | <commit_before>from datetime import datetime
from .exceptions import ClientError
from .models import Booking, RobotTerminal
def get_robot_terminal_or_error(robot_id, user):
# Check if the user is logged in
if not user.is_authenticated():
raise ClientError("USER_HAS_TO_LOGIN")
# get the robot_ter... | from datetime import datetime
from .exceptions import ClientError
from .models import Booking, RobotTerminal
def get_robot_terminal_or_error(robot_id, user):
# Check if the user is logged in
if not user.is_authenticated():
raise ClientError("USER_HAS_TO_LOGIN")
# get the robot_terminal with the ... | from datetime import datetime
from .exceptions import ClientError
from .models import Booking, RobotTerminal
def get_robot_terminal_or_error(robot_id, user):
# Check if the user is logged in
if not user.is_authenticated():
raise ClientError("USER_HAS_TO_LOGIN")
# get the robot_terminal with the ... | <commit_before>from datetime import datetime
from .exceptions import ClientError
from .models import Booking, RobotTerminal
def get_robot_terminal_or_error(robot_id, user):
# Check if the user is logged in
if not user.is_authenticated():
raise ClientError("USER_HAS_TO_LOGIN")
# get the robot_ter... |
55e316a45256d054d19425015ef13868a84c5ff1 | src/pip/_internal/resolution/resolvelib/reporter.py | src/pip/_internal/resolution/resolvelib/reporter.py | from collections import defaultdict
from logging import getLogger
from pip._vendor.resolvelib.reporters import BaseReporter
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import DefaultDict
from .base import Candidate
logger = getLogger(__name__)
class PipRe... | from collections import defaultdict
from logging import getLogger
from pip._vendor.resolvelib.reporters import BaseReporter
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import DefaultDict
from .base import Candidate
logger = getLogger(__name__)
class PipRe... | Add the last line to the info message | Add the last line to the info message
| Python | mit | sbidoul/pip,pradyunsg/pip,pypa/pip,pypa/pip,sbidoul/pip,pfmoore/pip,pfmoore/pip,pradyunsg/pip | from collections import defaultdict
from logging import getLogger
from pip._vendor.resolvelib.reporters import BaseReporter
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import DefaultDict
from .base import Candidate
logger = getLogger(__name__)
class PipRe... | from collections import defaultdict
from logging import getLogger
from pip._vendor.resolvelib.reporters import BaseReporter
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import DefaultDict
from .base import Candidate
logger = getLogger(__name__)
class PipRe... | <commit_before>from collections import defaultdict
from logging import getLogger
from pip._vendor.resolvelib.reporters import BaseReporter
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import DefaultDict
from .base import Candidate
logger = getLogger(__name__... | from collections import defaultdict
from logging import getLogger
from pip._vendor.resolvelib.reporters import BaseReporter
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import DefaultDict
from .base import Candidate
logger = getLogger(__name__)
class PipRe... | from collections import defaultdict
from logging import getLogger
from pip._vendor.resolvelib.reporters import BaseReporter
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import DefaultDict
from .base import Candidate
logger = getLogger(__name__)
class PipRe... | <commit_before>from collections import defaultdict
from logging import getLogger
from pip._vendor.resolvelib.reporters import BaseReporter
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import DefaultDict
from .base import Candidate
logger = getLogger(__name__... |
fb65fedbf60481d37e097ea9db290f53b84cae26 | giveaminute/migrations/versions/001_Initial_models.py | giveaminute/migrations/versions/001_Initial_models.py | from sqlalchemy import *
from migrate import *
def upgrade(migrate_engine):
# Upgrade operations go here. Don't create your own engine; bind migrate_engine
# to your metadata
import os
with open(os.path.join(os.path.dirname(__file__), '000_Initial_models.sql')) as initial_file:
sql = initi... | from sqlalchemy import *
from migrate import *
def upgrade(migrate_engine):
# Upgrade operations go here. Don't create your own engine; bind migrate_engine
# to your metadata
import os
# Uncomment the following lines if you do not yet have a database to set up.
# If you run this migration, it will... | Comment out the initial migration step by default (so that we're not inadvertently blowing peoples databases away | Comment out the initial migration step by default (so that we're not inadvertently blowing peoples databases away
| Python | agpl-3.0 | codeforamerica/Change-By-Us,localprojects/Change-By-Us,watchcat/cbu-rotterdam,watchcat/cbu-rotterdam,localprojects/Change-By-Us,codeforeurope/Change-By-Us,codeforeurope/Change-By-Us,codeforamerica/Change-By-Us,watchcat/cbu-rotterdam,watchcat/cbu-rotterdam,localprojects/Change-By-Us,localprojects/Change-By-Us,watchcat/c... | from sqlalchemy import *
from migrate import *
def upgrade(migrate_engine):
# Upgrade operations go here. Don't create your own engine; bind migrate_engine
# to your metadata
import os
with open(os.path.join(os.path.dirname(__file__), '000_Initial_models.sql')) as initial_file:
sql = initi... | from sqlalchemy import *
from migrate import *
def upgrade(migrate_engine):
# Upgrade operations go here. Don't create your own engine; bind migrate_engine
# to your metadata
import os
# Uncomment the following lines if you do not yet have a database to set up.
# If you run this migration, it will... | <commit_before>from sqlalchemy import *
from migrate import *
def upgrade(migrate_engine):
# Upgrade operations go here. Don't create your own engine; bind migrate_engine
# to your metadata
import os
with open(os.path.join(os.path.dirname(__file__), '000_Initial_models.sql')) as initial_file:
... | from sqlalchemy import *
from migrate import *
def upgrade(migrate_engine):
# Upgrade operations go here. Don't create your own engine; bind migrate_engine
# to your metadata
import os
# Uncomment the following lines if you do not yet have a database to set up.
# If you run this migration, it will... | from sqlalchemy import *
from migrate import *
def upgrade(migrate_engine):
# Upgrade operations go here. Don't create your own engine; bind migrate_engine
# to your metadata
import os
with open(os.path.join(os.path.dirname(__file__), '000_Initial_models.sql')) as initial_file:
sql = initi... | <commit_before>from sqlalchemy import *
from migrate import *
def upgrade(migrate_engine):
# Upgrade operations go here. Don't create your own engine; bind migrate_engine
# to your metadata
import os
with open(os.path.join(os.path.dirname(__file__), '000_Initial_models.sql')) as initial_file:
... |
a0c9e2d6d5115aba04a650281b10d47e31873671 | tensorflow/contrib/distributions/python/__init__.py | tensorflow/contrib/distributions/python/__init__.py | # Copyright 2016 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 2016 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... | Fix futures test Change: 115766190 | Fix futures test
Change: 115766190
| Python | apache-2.0 | mortada/tensorflow,maciekcc/tensorflow,yaroslavvb/tensorflow,AnishShah/tensorflow,pcm17/tensorflow,eaplatanios/tensorflow,arborh/tensorflow,tornadozou/tensorflow,horance-liu/tensorflow,Intel-Corporation/tensorflow,tntnatbry/tensorflow,gojira/tensorflow,brchiu/tensorflow,nburn42/tensorflow,tillahoffmann/tensorflow,horan... | # Copyright 2016 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 2016 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 2016 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 2016 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 2016 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 2016 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... |
9846559d9164216924e5f8bb1544148b3e6965b6 | tensorflow_time_two/python/ops/time_two_ops_test.py | tensorflow_time_two/python/ops/time_two_ops_test.py | # Copyright 2018 The Sonnet Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | # Copyright 2018 The Sonnet Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | Make test works with make and bazel | Make test works with make and bazel
| Python | apache-2.0 | tensorflow/custom-op,tensorflow/custom-op,tensorflow/custom-op | # Copyright 2018 The Sonnet Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | # Copyright 2018 The Sonnet Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | <commit_before># Copyright 2018 The Sonnet Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | # Copyright 2018 The Sonnet Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | # Copyright 2018 The Sonnet Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | <commit_before># Copyright 2018 The Sonnet Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... |
00110b05bba01f087fed37c5bb3ad5fede04d492 | app/core/user.py | app/core/user.py | import hashlib
import datetime
from flask_login import UserMixin, AnonymousUserMixin
import mediacloud as mcapi
from app.core import db, mc
# User class
class User(UserMixin):
def __init__(self, name, userid, active=True):
self.name = name
self.id = userid
self.active = active
sel... | import hashlib
import datetime
from flask_login import UserMixin, AnonymousUserMixin
import mediacloud as mcapi
from app.core import db, mc
# User class
class User(UserMixin):
def __init__(self, name, userid, active=True):
self.name = name
self.id = userid
self.active = active
sel... | Fix authentication from cookied token. | Fix authentication from cookied token.
| Python | apache-2.0 | c4fcm/MediaMeter-Dashboard,c4fcm/MediaMeter-Skeleton,c4fcm/MediaMeter-Dashboard,c4fcm/MediaMeter-Dashboard,c4fcm/MediaMeter-Skeleton,c4fcm/MediaMeter-Skeleton | import hashlib
import datetime
from flask_login import UserMixin, AnonymousUserMixin
import mediacloud as mcapi
from app.core import db, mc
# User class
class User(UserMixin):
def __init__(self, name, userid, active=True):
self.name = name
self.id = userid
self.active = active
sel... | import hashlib
import datetime
from flask_login import UserMixin, AnonymousUserMixin
import mediacloud as mcapi
from app.core import db, mc
# User class
class User(UserMixin):
def __init__(self, name, userid, active=True):
self.name = name
self.id = userid
self.active = active
sel... | <commit_before>import hashlib
import datetime
from flask_login import UserMixin, AnonymousUserMixin
import mediacloud as mcapi
from app.core import db, mc
# User class
class User(UserMixin):
def __init__(self, name, userid, active=True):
self.name = name
self.id = userid
self.active = act... | import hashlib
import datetime
from flask_login import UserMixin, AnonymousUserMixin
import mediacloud as mcapi
from app.core import db, mc
# User class
class User(UserMixin):
def __init__(self, name, userid, active=True):
self.name = name
self.id = userid
self.active = active
sel... | import hashlib
import datetime
from flask_login import UserMixin, AnonymousUserMixin
import mediacloud as mcapi
from app.core import db, mc
# User class
class User(UserMixin):
def __init__(self, name, userid, active=True):
self.name = name
self.id = userid
self.active = active
sel... | <commit_before>import hashlib
import datetime
from flask_login import UserMixin, AnonymousUserMixin
import mediacloud as mcapi
from app.core import db, mc
# User class
class User(UserMixin):
def __init__(self, name, userid, active=True):
self.name = name
self.id = userid
self.active = act... |
49d638fc4252f5fb5de079bce77cbf75362d13ad | guv/green/builtin.py | guv/green/builtin.py | """
In order to detect a filehandle that's been closed, our only clue may be the operating system
returning the same filehandle in response to some other operation.
The builtins 'file' and 'open' are patched to collaborate with the notify_opened protocol.
"""
builtins_orig = __builtins__
from .. import hubs
from ..... | """
In order to detect a filehandle that's been closed, our only clue may be the operating system
returning the same filehandle in response to some other operation.
The builtins 'file' and 'open' are patched to collaborate with the notify_opened protocol.
"""
builtins_orig = __builtins__
from .. import hubs
from ..... | Add TODO to check later if this should be here | Add TODO to check later if this should be here
It doesn't look like it serves any purpose.
| Python | mit | veegee/guv,veegee/guv | """
In order to detect a filehandle that's been closed, our only clue may be the operating system
returning the same filehandle in response to some other operation.
The builtins 'file' and 'open' are patched to collaborate with the notify_opened protocol.
"""
builtins_orig = __builtins__
from .. import hubs
from ..... | """
In order to detect a filehandle that's been closed, our only clue may be the operating system
returning the same filehandle in response to some other operation.
The builtins 'file' and 'open' are patched to collaborate with the notify_opened protocol.
"""
builtins_orig = __builtins__
from .. import hubs
from ..... | <commit_before>"""
In order to detect a filehandle that's been closed, our only clue may be the operating system
returning the same filehandle in response to some other operation.
The builtins 'file' and 'open' are patched to collaborate with the notify_opened protocol.
"""
builtins_orig = __builtins__
from .. impo... | """
In order to detect a filehandle that's been closed, our only clue may be the operating system
returning the same filehandle in response to some other operation.
The builtins 'file' and 'open' are patched to collaborate with the notify_opened protocol.
"""
builtins_orig = __builtins__
from .. import hubs
from ..... | """
In order to detect a filehandle that's been closed, our only clue may be the operating system
returning the same filehandle in response to some other operation.
The builtins 'file' and 'open' are patched to collaborate with the notify_opened protocol.
"""
builtins_orig = __builtins__
from .. import hubs
from ..... | <commit_before>"""
In order to detect a filehandle that's been closed, our only clue may be the operating system
returning the same filehandle in response to some other operation.
The builtins 'file' and 'open' are patched to collaborate with the notify_opened protocol.
"""
builtins_orig = __builtins__
from .. impo... |
ac46a0fa28901bfd508c75ec71e9e13a02ac40aa | ard-mediathek.py | ard-mediathek.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import contextlib
import sys
from ard_media_downloader import ArdMediathekDownloader
VERSION = "1.1"
def main(argv):
parser = argparse.ArgumentParser(description='Commandline python script tool to download videos from the online ARD mediathek. Ver... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import contextlib
import sys
from ard_media_downloader import ArdMediathekDownloader
VERSION = "1.1"
def main(argv):
parser = argparse.ArgumentParser(description='Commandline python script tool to download videos from the online ARD mediathek. Ver... | Add better error message if URL doe not contain documentId | Add better error message if URL doe not contain documentId
Improves error messages like the one reported with #24
| Python | mit | Bouni/ard-mediathek | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import contextlib
import sys
from ard_media_downloader import ArdMediathekDownloader
VERSION = "1.1"
def main(argv):
parser = argparse.ArgumentParser(description='Commandline python script tool to download videos from the online ARD mediathek. Ver... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import contextlib
import sys
from ard_media_downloader import ArdMediathekDownloader
VERSION = "1.1"
def main(argv):
parser = argparse.ArgumentParser(description='Commandline python script tool to download videos from the online ARD mediathek. Ver... | <commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import contextlib
import sys
from ard_media_downloader import ArdMediathekDownloader
VERSION = "1.1"
def main(argv):
parser = argparse.ArgumentParser(description='Commandline python script tool to download videos from the online ARD... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import contextlib
import sys
from ard_media_downloader import ArdMediathekDownloader
VERSION = "1.1"
def main(argv):
parser = argparse.ArgumentParser(description='Commandline python script tool to download videos from the online ARD mediathek. Ver... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import contextlib
import sys
from ard_media_downloader import ArdMediathekDownloader
VERSION = "1.1"
def main(argv):
parser = argparse.ArgumentParser(description='Commandline python script tool to download videos from the online ARD mediathek. Ver... | <commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import contextlib
import sys
from ard_media_downloader import ArdMediathekDownloader
VERSION = "1.1"
def main(argv):
parser = argparse.ArgumentParser(description='Commandline python script tool to download videos from the online ARD... |
7ee2ea4f3034a6bfc4bcfb78b7c2cc1e3887fb55 | test/_common.py | test/_common.py | # encoding: utf-8
'''
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
'''
from __future__ import absolute_import, print_function, unicode_literals
def print_test_result(expected, actual):
print("[expected]\n{}\n".format(expected))
print("[actual]\n{}\n".format(actual))
| # encoding: utf-8
'''
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
'''
from __future__ import absolute_import, print_function, unicode_literals
import sys
def print_test_result(expected, actual, error=None):
print("[expected]\n{}\n".format(expected))
print("[actual]\n{}\n".format(actual)... | Add an argument to print stderr of test results | Add an argument to print stderr of test results
| Python | mit | thombashi/pytablewriter | # encoding: utf-8
'''
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
'''
from __future__ import absolute_import, print_function, unicode_literals
def print_test_result(expected, actual):
print("[expected]\n{}\n".format(expected))
print("[actual]\n{}\n".format(actual))
Add an argument to pri... | # encoding: utf-8
'''
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
'''
from __future__ import absolute_import, print_function, unicode_literals
import sys
def print_test_result(expected, actual, error=None):
print("[expected]\n{}\n".format(expected))
print("[actual]\n{}\n".format(actual)... | <commit_before># encoding: utf-8
'''
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
'''
from __future__ import absolute_import, print_function, unicode_literals
def print_test_result(expected, actual):
print("[expected]\n{}\n".format(expected))
print("[actual]\n{}\n".format(actual))
<commit... | # encoding: utf-8
'''
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
'''
from __future__ import absolute_import, print_function, unicode_literals
import sys
def print_test_result(expected, actual, error=None):
print("[expected]\n{}\n".format(expected))
print("[actual]\n{}\n".format(actual)... | # encoding: utf-8
'''
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
'''
from __future__ import absolute_import, print_function, unicode_literals
def print_test_result(expected, actual):
print("[expected]\n{}\n".format(expected))
print("[actual]\n{}\n".format(actual))
Add an argument to pri... | <commit_before># encoding: utf-8
'''
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
'''
from __future__ import absolute_import, print_function, unicode_literals
def print_test_result(expected, actual):
print("[expected]\n{}\n".format(expected))
print("[actual]\n{}\n".format(actual))
<commit... |
8902c7612d84a2d14e90c4aac6db78ad95dd213c | trading_as/__init__.py | trading_as/__init__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Trading As Brands
# Copyright (C) 2015 OpusVL (<http://opusvl.com/>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | # -*- coding: utf-8 -*-
##############################################################################
#
# Trading As Brands
# Copyright (C) 2015 OpusVL (<http://opusvl.com/>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | Change order of imports to fix install into blank db or as dependency of company config. | Change order of imports to fix install into blank db or as dependency of
company config.
| Python | agpl-3.0 | OpusVL/odoo-trading-as | # -*- coding: utf-8 -*-
##############################################################################
#
# Trading As Brands
# Copyright (C) 2015 OpusVL (<http://opusvl.com/>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | # -*- coding: utf-8 -*-
##############################################################################
#
# Trading As Brands
# Copyright (C) 2015 OpusVL (<http://opusvl.com/>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | <commit_before># -*- coding: utf-8 -*-
##############################################################################
#
# Trading As Brands
# Copyright (C) 2015 OpusVL (<http://opusvl.com/>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | # -*- coding: utf-8 -*-
##############################################################################
#
# Trading As Brands
# Copyright (C) 2015 OpusVL (<http://opusvl.com/>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | # -*- coding: utf-8 -*-
##############################################################################
#
# Trading As Brands
# Copyright (C) 2015 OpusVL (<http://opusvl.com/>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | <commit_before># -*- coding: utf-8 -*-
##############################################################################
#
# Trading As Brands
# Copyright (C) 2015 OpusVL (<http://opusvl.com/>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... |
5a075e27617f7305dded058b71cb1a3385d3025c | docs/conf.py | docs/conf.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
extensions = [
'sphinx.ext.autodoc',
]
source_suffix = '.rst'
master_doc = 'index'
project = 'Javelin'
copyright = '2016, Ross Whitfield'
author = 'Ross Whitfield'
version = '0.1.0'
release = '0.1.0'
... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
extensions = [
'sphinx.ext.autodoc',
]
source_suffix = '.rst'
master_doc = 'index'
project = 'Javelin'
copyright = '2016, Ross Whitfield'
author = 'Ross Whitfield'
version = '0.1.0'
release = '0.1.0'
... | Change sphinx theme to rtd | Change sphinx theme to rtd
| Python | mit | rosswhitfield/javelin | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
extensions = [
'sphinx.ext.autodoc',
]
source_suffix = '.rst'
master_doc = 'index'
project = 'Javelin'
copyright = '2016, Ross Whitfield'
author = 'Ross Whitfield'
version = '0.1.0'
release = '0.1.0'
... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
extensions = [
'sphinx.ext.autodoc',
]
source_suffix = '.rst'
master_doc = 'index'
project = 'Javelin'
copyright = '2016, Ross Whitfield'
author = 'Ross Whitfield'
version = '0.1.0'
release = '0.1.0'
... | <commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
extensions = [
'sphinx.ext.autodoc',
]
source_suffix = '.rst'
master_doc = 'index'
project = 'Javelin'
copyright = '2016, Ross Whitfield'
author = 'Ross Whitfield'
version = '0.1.0'
rel... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
extensions = [
'sphinx.ext.autodoc',
]
source_suffix = '.rst'
master_doc = 'index'
project = 'Javelin'
copyright = '2016, Ross Whitfield'
author = 'Ross Whitfield'
version = '0.1.0'
release = '0.1.0'
... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
extensions = [
'sphinx.ext.autodoc',
]
source_suffix = '.rst'
master_doc = 'index'
project = 'Javelin'
copyright = '2016, Ross Whitfield'
author = 'Ross Whitfield'
version = '0.1.0'
release = '0.1.0'
... | <commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
extensions = [
'sphinx.ext.autodoc',
]
source_suffix = '.rst'
master_doc = 'index'
project = 'Javelin'
copyright = '2016, Ross Whitfield'
author = 'Ross Whitfield'
version = '0.1.0'
rel... |
bbb5fa95cd4b9d7fac6ac45546eedcd8a5d14162 | s4v1.py | s4v1.py | from s3v3 import *
| from s3v3 import *
import csv
def write_to_file(filename, data_sample):
example = csv.write(open(filename, 'w', encoding='utf-8'), dialect='excel') # example is the variable of the new file that is open and which we can write to (using utf-8 encoding and an excel dialect).
example.writerows(data_sample) # write row... | Create write to file function | Create write to file function
| Python | mit | alexmilesyounger/ds_basics | from s3v3 import *
Create write to file function | from s3v3 import *
import csv
def write_to_file(filename, data_sample):
example = csv.write(open(filename, 'w', encoding='utf-8'), dialect='excel') # example is the variable of the new file that is open and which we can write to (using utf-8 encoding and an excel dialect).
example.writerows(data_sample) # write row... | <commit_before>from s3v3 import *
<commit_msg>Create write to file function<commit_after> | from s3v3 import *
import csv
def write_to_file(filename, data_sample):
example = csv.write(open(filename, 'w', encoding='utf-8'), dialect='excel') # example is the variable of the new file that is open and which we can write to (using utf-8 encoding and an excel dialect).
example.writerows(data_sample) # write row... | from s3v3 import *
Create write to file functionfrom s3v3 import *
import csv
def write_to_file(filename, data_sample):
example = csv.write(open(filename, 'w', encoding='utf-8'), dialect='excel') # example is the variable of the new file that is open and which we can write to (using utf-8 encoding and an excel diale... | <commit_before>from s3v3 import *
<commit_msg>Create write to file function<commit_after>from s3v3 import *
import csv
def write_to_file(filename, data_sample):
example = csv.write(open(filename, 'w', encoding='utf-8'), dialect='excel') # example is the variable of the new file that is open and which we can write to... |
978b9450346f4de687ed3c23bc11c970538e948b | mosecom_air/api/parser.py | mosecom_air/api/parser.py | #coding: utf-8
from collections import namedtuple
Substance = namedtuple('Substance', 'name alias')
Measurement = namedtuple('Measurement', 'substance unit performed value')
Result = namedtuple('Result', 'measurements substances units station_alias')
| #coding: utf-8
from collections import namedtuple
Substance = namedtuple('Substance', ('name', 'alias'))
Measurement = namedtuple('Measurement', ('substance', 'unit', 'performed',
'value'))
Result = namedtuple('Result', ('measurements', 'substances', 'units',
... | Use tuple in namedtuples initization | Use tuple in namedtuples initization
| Python | mit | elsid/mosecom-air,elsid/mosecom-air,elsid/mosecom-air | #coding: utf-8
from collections import namedtuple
Substance = namedtuple('Substance', 'name alias')
Measurement = namedtuple('Measurement', 'substance unit performed value')
Result = namedtuple('Result', 'measurements substances units station_alias')
Use tuple in namedtuples initization | #coding: utf-8
from collections import namedtuple
Substance = namedtuple('Substance', ('name', 'alias'))
Measurement = namedtuple('Measurement', ('substance', 'unit', 'performed',
'value'))
Result = namedtuple('Result', ('measurements', 'substances', 'units',
... | <commit_before>#coding: utf-8
from collections import namedtuple
Substance = namedtuple('Substance', 'name alias')
Measurement = namedtuple('Measurement', 'substance unit performed value')
Result = namedtuple('Result', 'measurements substances units station_alias')
<commit_msg>Use tuple in namedtuples initization<com... | #coding: utf-8
from collections import namedtuple
Substance = namedtuple('Substance', ('name', 'alias'))
Measurement = namedtuple('Measurement', ('substance', 'unit', 'performed',
'value'))
Result = namedtuple('Result', ('measurements', 'substances', 'units',
... | #coding: utf-8
from collections import namedtuple
Substance = namedtuple('Substance', 'name alias')
Measurement = namedtuple('Measurement', 'substance unit performed value')
Result = namedtuple('Result', 'measurements substances units station_alias')
Use tuple in namedtuples initization#coding: utf-8
from collection... | <commit_before>#coding: utf-8
from collections import namedtuple
Substance = namedtuple('Substance', 'name alias')
Measurement = namedtuple('Measurement', 'substance unit performed value')
Result = namedtuple('Result', 'measurements substances units station_alias')
<commit_msg>Use tuple in namedtuples initization<com... |
e8e2ebb156ce75afa87d26a632ed7aa5c74ba2c6 | eggsclaim.py | eggsclaim.py | import signal
import sys
import serial
import sms
from xbee import XBee
MOBILE_NUM = '0400000000'
NOTIFICATION_MSG = 'Cock-a-doodle-doo! An egg is waiting for you!'
egg_was_present = False
def signal_handler(signal, frame):
xbee.halt()
serial_port.close()
sys.exit(0)
def packet_received(packet):
sam... | import signal
import sys
import serial
import sms
from xbee import XBee
SERIAL_PORT = '/dev/usbserial-143'
MOBILE_NUM = '0400000000'
NOTIFICATION_MSG = 'Cock-a-doodle-doo! An egg is waiting for you!'
egg_was_present = False
def signal_handler(signal, frame):
xbee.halt()
serial_port.close()
sys.exit(0)
d... | Use correct IO pins and serial port | Use correct IO pins and serial port
| Python | mit | jamespettigrew/eggsclaim | import signal
import sys
import serial
import sms
from xbee import XBee
MOBILE_NUM = '0400000000'
NOTIFICATION_MSG = 'Cock-a-doodle-doo! An egg is waiting for you!'
egg_was_present = False
def signal_handler(signal, frame):
xbee.halt()
serial_port.close()
sys.exit(0)
def packet_received(packet):
sam... | import signal
import sys
import serial
import sms
from xbee import XBee
SERIAL_PORT = '/dev/usbserial-143'
MOBILE_NUM = '0400000000'
NOTIFICATION_MSG = 'Cock-a-doodle-doo! An egg is waiting for you!'
egg_was_present = False
def signal_handler(signal, frame):
xbee.halt()
serial_port.close()
sys.exit(0)
d... | <commit_before>import signal
import sys
import serial
import sms
from xbee import XBee
MOBILE_NUM = '0400000000'
NOTIFICATION_MSG = 'Cock-a-doodle-doo! An egg is waiting for you!'
egg_was_present = False
def signal_handler(signal, frame):
xbee.halt()
serial_port.close()
sys.exit(0)
def packet_received(p... | import signal
import sys
import serial
import sms
from xbee import XBee
SERIAL_PORT = '/dev/usbserial-143'
MOBILE_NUM = '0400000000'
NOTIFICATION_MSG = 'Cock-a-doodle-doo! An egg is waiting for you!'
egg_was_present = False
def signal_handler(signal, frame):
xbee.halt()
serial_port.close()
sys.exit(0)
d... | import signal
import sys
import serial
import sms
from xbee import XBee
MOBILE_NUM = '0400000000'
NOTIFICATION_MSG = 'Cock-a-doodle-doo! An egg is waiting for you!'
egg_was_present = False
def signal_handler(signal, frame):
xbee.halt()
serial_port.close()
sys.exit(0)
def packet_received(packet):
sam... | <commit_before>import signal
import sys
import serial
import sms
from xbee import XBee
MOBILE_NUM = '0400000000'
NOTIFICATION_MSG = 'Cock-a-doodle-doo! An egg is waiting for you!'
egg_was_present = False
def signal_handler(signal, frame):
xbee.halt()
serial_port.close()
sys.exit(0)
def packet_received(p... |
d2686372462f7af3949c08e1904d678107e68bdf | docs/conf.py | docs/conf.py | import pkg_resources
import sphinx_rtd_theme
project = 'Spaceland'
copyright = '2017 Já hf'
version = release = pkg_resources.require('spaceland')[0].version
master_doc = 'index'
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
default_role = 'py:obj'
extensions = (
'sphinx.ext.autodoc',
'sphinx.ext.... | import pkg_resources
import sphinx_rtd_theme
project = 'Spaceland'
copyright = '2017 Já hf'
version = release = pkg_resources.require('spaceland')[0].version
master_doc = 'index'
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
default_role = 'py:obj'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.... | Use tuple for Sphinx extensions, not list | Use tuple for Sphinx extensions, not list
Read the Docs is trying to append to the tuple during the docs build.
| Python | mit | JaGallup/spaceland | import pkg_resources
import sphinx_rtd_theme
project = 'Spaceland'
copyright = '2017 Já hf'
version = release = pkg_resources.require('spaceland')[0].version
master_doc = 'index'
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
default_role = 'py:obj'
extensions = (
'sphinx.ext.autodoc',
'sphinx.ext.... | import pkg_resources
import sphinx_rtd_theme
project = 'Spaceland'
copyright = '2017 Já hf'
version = release = pkg_resources.require('spaceland')[0].version
master_doc = 'index'
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
default_role = 'py:obj'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.... | <commit_before>import pkg_resources
import sphinx_rtd_theme
project = 'Spaceland'
copyright = '2017 Já hf'
version = release = pkg_resources.require('spaceland')[0].version
master_doc = 'index'
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
default_role = 'py:obj'
extensions = (
'sphinx.ext.autodoc',
... | import pkg_resources
import sphinx_rtd_theme
project = 'Spaceland'
copyright = '2017 Já hf'
version = release = pkg_resources.require('spaceland')[0].version
master_doc = 'index'
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
default_role = 'py:obj'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.... | import pkg_resources
import sphinx_rtd_theme
project = 'Spaceland'
copyright = '2017 Já hf'
version = release = pkg_resources.require('spaceland')[0].version
master_doc = 'index'
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
default_role = 'py:obj'
extensions = (
'sphinx.ext.autodoc',
'sphinx.ext.... | <commit_before>import pkg_resources
import sphinx_rtd_theme
project = 'Spaceland'
copyright = '2017 Já hf'
version = release = pkg_resources.require('spaceland')[0].version
master_doc = 'index'
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
default_role = 'py:obj'
extensions = (
'sphinx.ext.autodoc',
... |
e45f82ad8f11385ba7776beeb7fee497b9f4761a | observatory/dashboard/templatetags/javascript.py | observatory/dashboard/templatetags/javascript.py | # Copyright (c) 2010, Nate Stedman <[email protected]>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUT... | # Copyright (c) 2010, Nate Stedman <[email protected]>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUT... | Remove old lightbox starting stuff that never got done | Remove old lightbox starting stuff that never got done | Python | isc | natestedman/Observatory,rcos/Observatory,rcos/Observatory,natestedman/Observatory,rcos/Observatory,natestedman/Observatory,rcos/Observatory,rcos/Observatory,rcos/Observatory | # Copyright (c) 2010, Nate Stedman <[email protected]>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUT... | # Copyright (c) 2010, Nate Stedman <[email protected]>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUT... | <commit_before># Copyright (c) 2010, Nate Stedman <[email protected]>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS ... | # Copyright (c) 2010, Nate Stedman <[email protected]>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUT... | # Copyright (c) 2010, Nate Stedman <[email protected]>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUT... | <commit_before># Copyright (c) 2010, Nate Stedman <[email protected]>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS ... |
1ca76f55adaa4ffe305f732df47f1a070449d549 | rpmvenv/extensions/loader.py | rpmvenv/extensions/loader.py | """Tools for loading and validating extensions."""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import pkg_resources
import semver
class MissingDependency(Exception):
"""No dependency found."""
class Inval... | """Tools for loading and validating extensions."""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import pkg_resources
import semver
class MissingDependency(Exception):
"""No dependency found."""
class Inval... | Fix indeterminate ordering issue for extensions | Fix indeterminate ordering issue for extensions
The original code used set() to dedupe enabled extensions. This resulted
in an arbitrary ordering of the values. The expected result was a
deterministic ordering of loaded extensions that matches the order given
by the whitelist. This removes the set() usage to preserve ... | Python | mit | kevinconway/rpmvenv | """Tools for loading and validating extensions."""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import pkg_resources
import semver
class MissingDependency(Exception):
"""No dependency found."""
class Inval... | """Tools for loading and validating extensions."""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import pkg_resources
import semver
class MissingDependency(Exception):
"""No dependency found."""
class Inval... | <commit_before>"""Tools for loading and validating extensions."""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import pkg_resources
import semver
class MissingDependency(Exception):
"""No dependency found.""... | """Tools for loading and validating extensions."""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import pkg_resources
import semver
class MissingDependency(Exception):
"""No dependency found."""
class Inval... | """Tools for loading and validating extensions."""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import pkg_resources
import semver
class MissingDependency(Exception):
"""No dependency found."""
class Inval... | <commit_before>"""Tools for loading and validating extensions."""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import pkg_resources
import semver
class MissingDependency(Exception):
"""No dependency found.""... |
2917c8d380bfee3c7589f806ea12f2e3f83e8b93 | npc/character/__init__.py | npc/character/__init__.py | from .character import *
| """
Module for all character objects.
"""
from .character import Character
from .changeling import Changeling
from .werewolf import Werewolf
def build(attributes: dict = None, other_char: Character = None):
"""
Build a new character object with the appropriate class
This derives the correct character cla... | Add helpers to find the right character class | Add helpers to find the right character class
| Python | mit | aurule/npc,aurule/npc | from .character import *
Add helpers to find the right character class | """
Module for all character objects.
"""
from .character import Character
from .changeling import Changeling
from .werewolf import Werewolf
def build(attributes: dict = None, other_char: Character = None):
"""
Build a new character object with the appropriate class
This derives the correct character cla... | <commit_before>from .character import *
<commit_msg>Add helpers to find the right character class<commit_after> | """
Module for all character objects.
"""
from .character import Character
from .changeling import Changeling
from .werewolf import Werewolf
def build(attributes: dict = None, other_char: Character = None):
"""
Build a new character object with the appropriate class
This derives the correct character cla... | from .character import *
Add helpers to find the right character class"""
Module for all character objects.
"""
from .character import Character
from .changeling import Changeling
from .werewolf import Werewolf
def build(attributes: dict = None, other_char: Character = None):
"""
Build a new character object ... | <commit_before>from .character import *
<commit_msg>Add helpers to find the right character class<commit_after>"""
Module for all character objects.
"""
from .character import Character
from .changeling import Changeling
from .werewolf import Werewolf
def build(attributes: dict = None, other_char: Character = None):
... |
3dd8a56af19301fdedd1fa95c25743ea1e9d7a1c | tkp/__init__.py | tkp/__init__.py | """
This package contains the Python modules used by the LOFAR Transients Pipeline
(TraP). This includes:
- Pipeline configuration management;
- Task distribution;
- Image loading and quality control;
- Source detection and measurement;
- Storing and associating sources in the database.
For details, see http://docs.t... | """
This package contains the Python modules used by the LOFAR Transients Pipeline
(TraP). This includes:
- Pipeline configuration management;
- Task distribution;
- Image loading and quality control;
- Source detection and measurement;
- Storing and associating sources in the database.
For details, see http://docs.t... | Test of Travis->autodeploy to PyPI for 3.0 RC2. | Test of Travis->autodeploy to PyPI for 3.0 RC2.
| Python | bsd-2-clause | transientskp/tkp,transientskp/tkp | """
This package contains the Python modules used by the LOFAR Transients Pipeline
(TraP). This includes:
- Pipeline configuration management;
- Task distribution;
- Image loading and quality control;
- Source detection and measurement;
- Storing and associating sources in the database.
For details, see http://docs.t... | """
This package contains the Python modules used by the LOFAR Transients Pipeline
(TraP). This includes:
- Pipeline configuration management;
- Task distribution;
- Image loading and quality control;
- Source detection and measurement;
- Storing and associating sources in the database.
For details, see http://docs.t... | <commit_before>"""
This package contains the Python modules used by the LOFAR Transients Pipeline
(TraP). This includes:
- Pipeline configuration management;
- Task distribution;
- Image loading and quality control;
- Source detection and measurement;
- Storing and associating sources in the database.
For details, se... | """
This package contains the Python modules used by the LOFAR Transients Pipeline
(TraP). This includes:
- Pipeline configuration management;
- Task distribution;
- Image loading and quality control;
- Source detection and measurement;
- Storing and associating sources in the database.
For details, see http://docs.t... | """
This package contains the Python modules used by the LOFAR Transients Pipeline
(TraP). This includes:
- Pipeline configuration management;
- Task distribution;
- Image loading and quality control;
- Source detection and measurement;
- Storing and associating sources in the database.
For details, see http://docs.t... | <commit_before>"""
This package contains the Python modules used by the LOFAR Transients Pipeline
(TraP). This includes:
- Pipeline configuration management;
- Task distribution;
- Image loading and quality control;
- Source detection and measurement;
- Storing and associating sources in the database.
For details, se... |
6d5ce6164c4406be66b787c84de64f6919a6246d | changes/jobs/sync_build.py | changes/jobs/sync_build.py | from flask import current_app
from changes.config import queue
from changes.backends.jenkins.builder import JenkinsBuilder
from changes.constants import Status
from changes.models.build import Build
@queue.job
def sync_build(build_id):
try:
build = Build.query.get(build_id)
if build.status == Sta... | from flask import current_app
from changes.config import queue, db
from changes.backends.jenkins.builder import JenkinsBuilder
from changes.constants import Status
from changes.models.build import Build
@queue.job
def sync_build(build_id):
try:
build = Build.query.get(build_id)
if build.status ==... | Correct base_url usage, and force commit | Correct base_url usage, and force commit
| Python | apache-2.0 | dropbox/changes,dropbox/changes,wfxiang08/changes,wfxiang08/changes,bowlofstew/changes,dropbox/changes,dropbox/changes,bowlofstew/changes,bowlofstew/changes,wfxiang08/changes,bowlofstew/changes,wfxiang08/changes | from flask import current_app
from changes.config import queue
from changes.backends.jenkins.builder import JenkinsBuilder
from changes.constants import Status
from changes.models.build import Build
@queue.job
def sync_build(build_id):
try:
build = Build.query.get(build_id)
if build.status == Sta... | from flask import current_app
from changes.config import queue, db
from changes.backends.jenkins.builder import JenkinsBuilder
from changes.constants import Status
from changes.models.build import Build
@queue.job
def sync_build(build_id):
try:
build = Build.query.get(build_id)
if build.status ==... | <commit_before>from flask import current_app
from changes.config import queue
from changes.backends.jenkins.builder import JenkinsBuilder
from changes.constants import Status
from changes.models.build import Build
@queue.job
def sync_build(build_id):
try:
build = Build.query.get(build_id)
if buil... | from flask import current_app
from changes.config import queue, db
from changes.backends.jenkins.builder import JenkinsBuilder
from changes.constants import Status
from changes.models.build import Build
@queue.job
def sync_build(build_id):
try:
build = Build.query.get(build_id)
if build.status ==... | from flask import current_app
from changes.config import queue
from changes.backends.jenkins.builder import JenkinsBuilder
from changes.constants import Status
from changes.models.build import Build
@queue.job
def sync_build(build_id):
try:
build = Build.query.get(build_id)
if build.status == Sta... | <commit_before>from flask import current_app
from changes.config import queue
from changes.backends.jenkins.builder import JenkinsBuilder
from changes.constants import Status
from changes.models.build import Build
@queue.job
def sync_build(build_id):
try:
build = Build.query.get(build_id)
if buil... |
be9daefbdd80380a7fdb8369bf32208ef61a6615 | spacy/tests/test_download.py | spacy/tests/test_download.py | # coding: utf-8
from __future__ import unicode_literals
from ..cli.download import download, get_compatibility, get_version, check_error_depr
import pytest
def test_download_fetch_compatibility():
compatibility = get_compatibility()
assert type(compatibility) == dict
@pytest.mark.slow
@pytest.mark.parametr... | # coding: utf-8
from __future__ import unicode_literals
from ..cli.download import download, get_compatibility, get_version, check_error_depr
import pytest
def test_download_fetch_compatibility():
compatibility = get_compatibility()
assert type(compatibility) == dict
@pytest.mark.parametrize('model', ['en_... | Remove actual model downloading from tests | Remove actual model downloading from tests
| Python | mit | oroszgy/spaCy.hu,raphael0202/spaCy,raphael0202/spaCy,oroszgy/spaCy.hu,aikramer2/spaCy,honnibal/spaCy,aikramer2/spaCy,explosion/spaCy,oroszgy/spaCy.hu,oroszgy/spaCy.hu,spacy-io/spaCy,raphael0202/spaCy,Gregory-Howard/spaCy,explosion/spaCy,explosion/spaCy,oroszgy/spaCy.hu,recognai/spaCy,Gregory-Howard/spaCy,spacy-io/spaCy... | # coding: utf-8
from __future__ import unicode_literals
from ..cli.download import download, get_compatibility, get_version, check_error_depr
import pytest
def test_download_fetch_compatibility():
compatibility = get_compatibility()
assert type(compatibility) == dict
@pytest.mark.slow
@pytest.mark.parametr... | # coding: utf-8
from __future__ import unicode_literals
from ..cli.download import download, get_compatibility, get_version, check_error_depr
import pytest
def test_download_fetch_compatibility():
compatibility = get_compatibility()
assert type(compatibility) == dict
@pytest.mark.parametrize('model', ['en_... | <commit_before># coding: utf-8
from __future__ import unicode_literals
from ..cli.download import download, get_compatibility, get_version, check_error_depr
import pytest
def test_download_fetch_compatibility():
compatibility = get_compatibility()
assert type(compatibility) == dict
@pytest.mark.slow
@pytes... | # coding: utf-8
from __future__ import unicode_literals
from ..cli.download import download, get_compatibility, get_version, check_error_depr
import pytest
def test_download_fetch_compatibility():
compatibility = get_compatibility()
assert type(compatibility) == dict
@pytest.mark.parametrize('model', ['en_... | # coding: utf-8
from __future__ import unicode_literals
from ..cli.download import download, get_compatibility, get_version, check_error_depr
import pytest
def test_download_fetch_compatibility():
compatibility = get_compatibility()
assert type(compatibility) == dict
@pytest.mark.slow
@pytest.mark.parametr... | <commit_before># coding: utf-8
from __future__ import unicode_literals
from ..cli.download import download, get_compatibility, get_version, check_error_depr
import pytest
def test_download_fetch_compatibility():
compatibility = get_compatibility()
assert type(compatibility) == dict
@pytest.mark.slow
@pytes... |
08f4c3a2360f6c5fe0048f6d1a6f0eab536f8aa9 | joku/cogs/_common.py | joku/cogs/_common.py | from collections import OrderedDict
import threading
import aiohttp
from joku.bot import Jokusoramame
class _CogMeta(type):
def __prepare__(*args, **kwargs):
# Use an OrderedDict for the class body.
return OrderedDict()
class Cog(metaclass=_CogMeta):
def __init__(self, bot: Jokusoramame):... | from collections import OrderedDict
import threading
import aiohttp
import random
from joku.bot import Jokusoramame
class _CogMeta(type):
def __prepare__(*args, **kwargs):
# Use an OrderedDict for the class body.
return OrderedDict()
class Cog(metaclass=_CogMeta):
def __init__(self, bot: ... | Add an RNG to each cog. | Add an RNG to each cog.
| Python | mit | MJB47/Jokusoramame,MJB47/Jokusoramame,MJB47/Jokusoramame | from collections import OrderedDict
import threading
import aiohttp
from joku.bot import Jokusoramame
class _CogMeta(type):
def __prepare__(*args, **kwargs):
# Use an OrderedDict for the class body.
return OrderedDict()
class Cog(metaclass=_CogMeta):
def __init__(self, bot: Jokusoramame):... | from collections import OrderedDict
import threading
import aiohttp
import random
from joku.bot import Jokusoramame
class _CogMeta(type):
def __prepare__(*args, **kwargs):
# Use an OrderedDict for the class body.
return OrderedDict()
class Cog(metaclass=_CogMeta):
def __init__(self, bot: ... | <commit_before>from collections import OrderedDict
import threading
import aiohttp
from joku.bot import Jokusoramame
class _CogMeta(type):
def __prepare__(*args, **kwargs):
# Use an OrderedDict for the class body.
return OrderedDict()
class Cog(metaclass=_CogMeta):
def __init__(self, bot:... | from collections import OrderedDict
import threading
import aiohttp
import random
from joku.bot import Jokusoramame
class _CogMeta(type):
def __prepare__(*args, **kwargs):
# Use an OrderedDict for the class body.
return OrderedDict()
class Cog(metaclass=_CogMeta):
def __init__(self, bot: ... | from collections import OrderedDict
import threading
import aiohttp
from joku.bot import Jokusoramame
class _CogMeta(type):
def __prepare__(*args, **kwargs):
# Use an OrderedDict for the class body.
return OrderedDict()
class Cog(metaclass=_CogMeta):
def __init__(self, bot: Jokusoramame):... | <commit_before>from collections import OrderedDict
import threading
import aiohttp
from joku.bot import Jokusoramame
class _CogMeta(type):
def __prepare__(*args, **kwargs):
# Use an OrderedDict for the class body.
return OrderedDict()
class Cog(metaclass=_CogMeta):
def __init__(self, bot:... |
96fe288cbd4c4399c83b4c3d56da6e427aaad0f9 | spicedham/digitdestroyer.py | spicedham/digitdestroyer.py | from spicedham.basewrapper import BaseWrapper
class DigitDestroyer(BaseWrapper):
def train(*args):
pass
def classify(self, response):
if all(map(unicode.isdigit, response)):
return 1
else:
return 0.5
| from spicedham.basewrapper import BaseWrapper
class DigitDestroyer(object):
def train(*args):
pass
def classify(self, response):
if all(map(unicode.isdigit, response)):
return 1
else:
return None
| Fix inheritence error and return value | Fix inheritence error and return value
It shouldn't inherit from BaseWrapper, but merely object.
It should return None instead of 0.5 so it will have no effect on the average.
| Python | mpl-2.0 | mozilla/spicedham,mozilla/spicedham | from spicedham.basewrapper import BaseWrapper
class DigitDestroyer(BaseWrapper):
def train(*args):
pass
def classify(self, response):
if all(map(unicode.isdigit, response)):
return 1
else:
return 0.5
Fix inheritence error and return value
It shouldn't inherit fr... | from spicedham.basewrapper import BaseWrapper
class DigitDestroyer(object):
def train(*args):
pass
def classify(self, response):
if all(map(unicode.isdigit, response)):
return 1
else:
return None
| <commit_before>from spicedham.basewrapper import BaseWrapper
class DigitDestroyer(BaseWrapper):
def train(*args):
pass
def classify(self, response):
if all(map(unicode.isdigit, response)):
return 1
else:
return 0.5
<commit_msg>Fix inheritence error and return val... | from spicedham.basewrapper import BaseWrapper
class DigitDestroyer(object):
def train(*args):
pass
def classify(self, response):
if all(map(unicode.isdigit, response)):
return 1
else:
return None
| from spicedham.basewrapper import BaseWrapper
class DigitDestroyer(BaseWrapper):
def train(*args):
pass
def classify(self, response):
if all(map(unicode.isdigit, response)):
return 1
else:
return 0.5
Fix inheritence error and return value
It shouldn't inherit fr... | <commit_before>from spicedham.basewrapper import BaseWrapper
class DigitDestroyer(BaseWrapper):
def train(*args):
pass
def classify(self, response):
if all(map(unicode.isdigit, response)):
return 1
else:
return 0.5
<commit_msg>Fix inheritence error and return val... |
cc0c43c3131161902de3a8a68688766cacd637b9 | lowercasing_test/src/tests/lowercasing/fetchletters.py | lowercasing_test/src/tests/lowercasing/fetchletters.py | #! /usr/bin/env python
# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
# This program reads a Unicode database and emits all letters in lower
# and upper case.
# Refer to http://www.unicode.org/ucd/ to download new files.
import sys
def add_chara... | #!/usr/bin/env python3
# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
# This program reads a Unicode database and emits all letters in lower
# and upper case.
# Refer to http://www.unicode.org/ucd/ to download new files.
import sys
def add_chara... | Migrate script ot Python 3 | Migrate script ot Python 3
| Python | apache-2.0 | vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa | #! /usr/bin/env python
# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
# This program reads a Unicode database and emits all letters in lower
# and upper case.
# Refer to http://www.unicode.org/ucd/ to download new files.
import sys
def add_chara... | #!/usr/bin/env python3
# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
# This program reads a Unicode database and emits all letters in lower
# and upper case.
# Refer to http://www.unicode.org/ucd/ to download new files.
import sys
def add_chara... | <commit_before>#! /usr/bin/env python
# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
# This program reads a Unicode database and emits all letters in lower
# and upper case.
# Refer to http://www.unicode.org/ucd/ to download new files.
import sys... | #!/usr/bin/env python3
# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
# This program reads a Unicode database and emits all letters in lower
# and upper case.
# Refer to http://www.unicode.org/ucd/ to download new files.
import sys
def add_chara... | #! /usr/bin/env python
# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
# This program reads a Unicode database and emits all letters in lower
# and upper case.
# Refer to http://www.unicode.org/ucd/ to download new files.
import sys
def add_chara... | <commit_before>#! /usr/bin/env python
# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
# This program reads a Unicode database and emits all letters in lower
# and upper case.
# Refer to http://www.unicode.org/ucd/ to download new files.
import sys... |
cc12a902b772e057141da72c5bffeb678bc37df6 | tvrenamr/tests/base.py | tvrenamr/tests/base.py | from os import mkdir
from os.path import abspath, dirname, exists, join
from shutil import rmtree
from tvrenamr.config import Config
from tvrenamr.main import TvRenamr
from tvrenamr.tests import mock_requests
# make pyflakes STFU
assert mock_requests
class BaseTest(object):
def setup(self):
# absolute pa... | from os import mkdir
from os.path import abspath, dirname, exists, join
from shutil import rmtree
from tvrenamr.config import Config
from tvrenamr.main import TvRenamr
from tvrenamr.tests import mock_requests
# make pyflakes STFU
assert mock_requests
class BaseTest(object):
def setup(self):
# absolute pa... | Set the rename directory to the test files directory | Set the rename directory to the test files directory
| Python | mit | ghickman/tvrenamr,wintersandroid/tvrenamr | from os import mkdir
from os.path import abspath, dirname, exists, join
from shutil import rmtree
from tvrenamr.config import Config
from tvrenamr.main import TvRenamr
from tvrenamr.tests import mock_requests
# make pyflakes STFU
assert mock_requests
class BaseTest(object):
def setup(self):
# absolute pa... | from os import mkdir
from os.path import abspath, dirname, exists, join
from shutil import rmtree
from tvrenamr.config import Config
from tvrenamr.main import TvRenamr
from tvrenamr.tests import mock_requests
# make pyflakes STFU
assert mock_requests
class BaseTest(object):
def setup(self):
# absolute pa... | <commit_before>from os import mkdir
from os.path import abspath, dirname, exists, join
from shutil import rmtree
from tvrenamr.config import Config
from tvrenamr.main import TvRenamr
from tvrenamr.tests import mock_requests
# make pyflakes STFU
assert mock_requests
class BaseTest(object):
def setup(self):
... | from os import mkdir
from os.path import abspath, dirname, exists, join
from shutil import rmtree
from tvrenamr.config import Config
from tvrenamr.main import TvRenamr
from tvrenamr.tests import mock_requests
# make pyflakes STFU
assert mock_requests
class BaseTest(object):
def setup(self):
# absolute pa... | from os import mkdir
from os.path import abspath, dirname, exists, join
from shutil import rmtree
from tvrenamr.config import Config
from tvrenamr.main import TvRenamr
from tvrenamr.tests import mock_requests
# make pyflakes STFU
assert mock_requests
class BaseTest(object):
def setup(self):
# absolute pa... | <commit_before>from os import mkdir
from os.path import abspath, dirname, exists, join
from shutil import rmtree
from tvrenamr.config import Config
from tvrenamr.main import TvRenamr
from tvrenamr.tests import mock_requests
# make pyflakes STFU
assert mock_requests
class BaseTest(object):
def setup(self):
... |
77d72fe0502c64294dbacdbf8defbb44ee21c088 | schools/admin.py | schools/admin.py | from django.contrib import admin
from .models import *
class SchoolBuildingPhotoInline(admin.TabularInline):
model = SchoolBuildingPhoto
@admin.register(SchoolBuilding)
class SchoolBuildingAdmin(admin.ModelAdmin):
fields = ('school', 'building', 'begin_year', 'end_year')
readonly_fields = fields
lis... | from django.contrib import admin
from .models import *
class SchoolBuildingPhotoInline(admin.TabularInline):
model = SchoolBuildingPhoto
@admin.register(SchoolBuilding)
class SchoolBuildingAdmin(admin.ModelAdmin):
fields = ('school', 'building', 'begin_year', 'end_year')
readonly_fields = fields
sea... | Add search based on school name | Add search based on school name
| Python | agpl-3.0 | City-of-Helsinki/kore,City-of-Helsinki/kore,Rikuoja/kore,Rikuoja/kore | from django.contrib import admin
from .models import *
class SchoolBuildingPhotoInline(admin.TabularInline):
model = SchoolBuildingPhoto
@admin.register(SchoolBuilding)
class SchoolBuildingAdmin(admin.ModelAdmin):
fields = ('school', 'building', 'begin_year', 'end_year')
readonly_fields = fields
lis... | from django.contrib import admin
from .models import *
class SchoolBuildingPhotoInline(admin.TabularInline):
model = SchoolBuildingPhoto
@admin.register(SchoolBuilding)
class SchoolBuildingAdmin(admin.ModelAdmin):
fields = ('school', 'building', 'begin_year', 'end_year')
readonly_fields = fields
sea... | <commit_before>from django.contrib import admin
from .models import *
class SchoolBuildingPhotoInline(admin.TabularInline):
model = SchoolBuildingPhoto
@admin.register(SchoolBuilding)
class SchoolBuildingAdmin(admin.ModelAdmin):
fields = ('school', 'building', 'begin_year', 'end_year')
readonly_fields =... | from django.contrib import admin
from .models import *
class SchoolBuildingPhotoInline(admin.TabularInline):
model = SchoolBuildingPhoto
@admin.register(SchoolBuilding)
class SchoolBuildingAdmin(admin.ModelAdmin):
fields = ('school', 'building', 'begin_year', 'end_year')
readonly_fields = fields
sea... | from django.contrib import admin
from .models import *
class SchoolBuildingPhotoInline(admin.TabularInline):
model = SchoolBuildingPhoto
@admin.register(SchoolBuilding)
class SchoolBuildingAdmin(admin.ModelAdmin):
fields = ('school', 'building', 'begin_year', 'end_year')
readonly_fields = fields
lis... | <commit_before>from django.contrib import admin
from .models import *
class SchoolBuildingPhotoInline(admin.TabularInline):
model = SchoolBuildingPhoto
@admin.register(SchoolBuilding)
class SchoolBuildingAdmin(admin.ModelAdmin):
fields = ('school', 'building', 'begin_year', 'end_year')
readonly_fields =... |
8b628ce91040736e1cb33a544871925608c70479 | penchy/jobs/dependency.py | penchy/jobs/dependency.py | """
This module provides the parts to model and resolve dependencies in the flow of
execution.
"""
class Edge(object):
"""
This class represents edges in the dependency graph.
"""
def __init__(self, source, sink=None, map=None):
"""
:param source: source of data
:param sink: s... | """
This module provides the parts to model and resolve dependencies in the flow of
execution.
"""
from penchy.util import topological_sort
class Edge(object):
"""
This class represents edges in the dependency graph.
"""
def __init__(self, source, sink=None, map=None):
"""
:param sou... | Add edgesort as a frontend to topological_sort. | Add edgesort as a frontend to topological_sort.
Signed-off-by: Michael Markert <[email protected]>
| Python | mit | fhirschmann/penchy,fhirschmann/penchy | """
This module provides the parts to model and resolve dependencies in the flow of
execution.
"""
class Edge(object):
"""
This class represents edges in the dependency graph.
"""
def __init__(self, source, sink=None, map=None):
"""
:param source: source of data
:param sink: s... | """
This module provides the parts to model and resolve dependencies in the flow of
execution.
"""
from penchy.util import topological_sort
class Edge(object):
"""
This class represents edges in the dependency graph.
"""
def __init__(self, source, sink=None, map=None):
"""
:param sou... | <commit_before>"""
This module provides the parts to model and resolve dependencies in the flow of
execution.
"""
class Edge(object):
"""
This class represents edges in the dependency graph.
"""
def __init__(self, source, sink=None, map=None):
"""
:param source: source of data
... | """
This module provides the parts to model and resolve dependencies in the flow of
execution.
"""
from penchy.util import topological_sort
class Edge(object):
"""
This class represents edges in the dependency graph.
"""
def __init__(self, source, sink=None, map=None):
"""
:param sou... | """
This module provides the parts to model and resolve dependencies in the flow of
execution.
"""
class Edge(object):
"""
This class represents edges in the dependency graph.
"""
def __init__(self, source, sink=None, map=None):
"""
:param source: source of data
:param sink: s... | <commit_before>"""
This module provides the parts to model and resolve dependencies in the flow of
execution.
"""
class Edge(object):
"""
This class represents edges in the dependency graph.
"""
def __init__(self, source, sink=None, map=None):
"""
:param source: source of data
... |
c07b6d2abae4ccd1eacb846a947945ecd6e963af | photutils/utils/_round.py | photutils/utils/_round.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides tools to round numpy arrays.
"""
import numpy as np
def _py2intround(a):
"""
Round the input to the nearest integer.
If two integers are equally close, rounding is done away from 0.
"""
data = np.asanyarray(... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides tools to round numpy arrays.
"""
import numpy as np
def _py2intround(a):
"""
Round the input to the nearest integer.
If two integers are equally close, rounding is done away from 0.
"""
data = np.asanyarray(... | Replace deprecated np.asscalar(a) with a.item() | Replace deprecated np.asscalar(a) with a.item()
| Python | bsd-3-clause | larrybradley/photutils,astropy/photutils | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides tools to round numpy arrays.
"""
import numpy as np
def _py2intround(a):
"""
Round the input to the nearest integer.
If two integers are equally close, rounding is done away from 0.
"""
data = np.asanyarray(... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides tools to round numpy arrays.
"""
import numpy as np
def _py2intround(a):
"""
Round the input to the nearest integer.
If two integers are equally close, rounding is done away from 0.
"""
data = np.asanyarray(... | <commit_before># Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides tools to round numpy arrays.
"""
import numpy as np
def _py2intround(a):
"""
Round the input to the nearest integer.
If two integers are equally close, rounding is done away from 0.
"""
data =... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides tools to round numpy arrays.
"""
import numpy as np
def _py2intround(a):
"""
Round the input to the nearest integer.
If two integers are equally close, rounding is done away from 0.
"""
data = np.asanyarray(... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides tools to round numpy arrays.
"""
import numpy as np
def _py2intround(a):
"""
Round the input to the nearest integer.
If two integers are equally close, rounding is done away from 0.
"""
data = np.asanyarray(... | <commit_before># Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides tools to round numpy arrays.
"""
import numpy as np
def _py2intround(a):
"""
Round the input to the nearest integer.
If two integers are equally close, rounding is done away from 0.
"""
data =... |
445bd6d2b5f68da6d51d9acb84b1e15e6b4af2d8 | k8s/models/common.py | k8s/models/common.py | #!/usr/bin/env python
# -*- coding: utf-8
from __future__ import absolute_import
import six
from ..base import Model
from ..fields import Field, ReadOnlyField, RequiredField
class ObjectMeta(Model):
name = RequiredField(six.text_type)
namespace = Field(six.text_type, "default")
resourceVersion = ReadOnl... | #!/usr/bin/env python
# -*- coding: utf-8
from __future__ import absolute_import
import six
from ..base import Model
from ..fields import Field, ReadOnlyField, RequiredField
class ObjectMeta(Model):
name = Field(six.text_type)
namespace = Field(six.text_type, "default")
resourceVersion = ReadOnlyField(s... | Add support for auto-generated names in metadata | Add support for auto-generated names in metadata
| Python | apache-2.0 | fiaas/k8s | #!/usr/bin/env python
# -*- coding: utf-8
from __future__ import absolute_import
import six
from ..base import Model
from ..fields import Field, ReadOnlyField, RequiredField
class ObjectMeta(Model):
name = RequiredField(six.text_type)
namespace = Field(six.text_type, "default")
resourceVersion = ReadOnl... | #!/usr/bin/env python
# -*- coding: utf-8
from __future__ import absolute_import
import six
from ..base import Model
from ..fields import Field, ReadOnlyField, RequiredField
class ObjectMeta(Model):
name = Field(six.text_type)
namespace = Field(six.text_type, "default")
resourceVersion = ReadOnlyField(s... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8
from __future__ import absolute_import
import six
from ..base import Model
from ..fields import Field, ReadOnlyField, RequiredField
class ObjectMeta(Model):
name = RequiredField(six.text_type)
namespace = Field(six.text_type, "default")
resourceVe... | #!/usr/bin/env python
# -*- coding: utf-8
from __future__ import absolute_import
import six
from ..base import Model
from ..fields import Field, ReadOnlyField, RequiredField
class ObjectMeta(Model):
name = Field(six.text_type)
namespace = Field(six.text_type, "default")
resourceVersion = ReadOnlyField(s... | #!/usr/bin/env python
# -*- coding: utf-8
from __future__ import absolute_import
import six
from ..base import Model
from ..fields import Field, ReadOnlyField, RequiredField
class ObjectMeta(Model):
name = RequiredField(six.text_type)
namespace = Field(six.text_type, "default")
resourceVersion = ReadOnl... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8
from __future__ import absolute_import
import six
from ..base import Model
from ..fields import Field, ReadOnlyField, RequiredField
class ObjectMeta(Model):
name = RequiredField(six.text_type)
namespace = Field(six.text_type, "default")
resourceVe... |
9bd2d607e52b50ae79ff51199118395e57cedfdc | custom/icds/tests/test_views.py | custom/icds/tests/test_views.py | from __future__ import absolute_import
from __future__ import unicode_literals
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import reverse
class TestViews(TestCase):
@override_settings(CUSTOM_LANDING_TEMPLATE='icds/login.html')
def test_custom_login(self):
... | from __future__ import absolute_import
from __future__ import unicode_literals
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import reverse
class TestViews(TestCase):
@override_settings(CUSTOM_LANDING_TEMPLATE='icds/login.html')
def test_custom_login_old_fo... | Add test for new custom landing format | Add test for new custom landing format
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | from __future__ import absolute_import
from __future__ import unicode_literals
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import reverse
class TestViews(TestCase):
@override_settings(CUSTOM_LANDING_TEMPLATE='icds/login.html')
def test_custom_login(self):
... | from __future__ import absolute_import
from __future__ import unicode_literals
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import reverse
class TestViews(TestCase):
@override_settings(CUSTOM_LANDING_TEMPLATE='icds/login.html')
def test_custom_login_old_fo... | <commit_before>from __future__ import absolute_import
from __future__ import unicode_literals
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import reverse
class TestViews(TestCase):
@override_settings(CUSTOM_LANDING_TEMPLATE='icds/login.html')
def test_custo... | from __future__ import absolute_import
from __future__ import unicode_literals
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import reverse
class TestViews(TestCase):
@override_settings(CUSTOM_LANDING_TEMPLATE='icds/login.html')
def test_custom_login_old_fo... | from __future__ import absolute_import
from __future__ import unicode_literals
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import reverse
class TestViews(TestCase):
@override_settings(CUSTOM_LANDING_TEMPLATE='icds/login.html')
def test_custom_login(self):
... | <commit_before>from __future__ import absolute_import
from __future__ import unicode_literals
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import reverse
class TestViews(TestCase):
@override_settings(CUSTOM_LANDING_TEMPLATE='icds/login.html')
def test_custo... |
03a54ea1920a3716e9c8d326f5c4c408f45b7d08 | apps/api/urls.py | apps/api/urls.py | from django.conf.urls import url, include
from rest_framework.routers import DefaultRouter
from rest_framework_jwt import views as jwt_views
from . import views
router = DefaultRouter()
router.register(r'quotes', views.QuoteViewSet)
router.register(r'authors', views.AuthorViewSet)
router.register(r'categories', views... | from django.conf.urls import url, include
from rest_framework.routers import DefaultRouter
from rest_framework_jwt import views as jwt_views
from . import views
router = DefaultRouter()
router.register(r'quotes', views.QuoteViewSet)
router.register(r'authors', views.AuthorViewSet)
router.register(r'categories', views... | Add option to verify jwt token | Add option to verify jwt token
| Python | bsd-3-clause | lucifurtun/myquotes,lucifurtun/myquotes,lucifurtun/myquotes,lucifurtun/myquotes | from django.conf.urls import url, include
from rest_framework.routers import DefaultRouter
from rest_framework_jwt import views as jwt_views
from . import views
router = DefaultRouter()
router.register(r'quotes', views.QuoteViewSet)
router.register(r'authors', views.AuthorViewSet)
router.register(r'categories', views... | from django.conf.urls import url, include
from rest_framework.routers import DefaultRouter
from rest_framework_jwt import views as jwt_views
from . import views
router = DefaultRouter()
router.register(r'quotes', views.QuoteViewSet)
router.register(r'authors', views.AuthorViewSet)
router.register(r'categories', views... | <commit_before>from django.conf.urls import url, include
from rest_framework.routers import DefaultRouter
from rest_framework_jwt import views as jwt_views
from . import views
router = DefaultRouter()
router.register(r'quotes', views.QuoteViewSet)
router.register(r'authors', views.AuthorViewSet)
router.register(r'cat... | from django.conf.urls import url, include
from rest_framework.routers import DefaultRouter
from rest_framework_jwt import views as jwt_views
from . import views
router = DefaultRouter()
router.register(r'quotes', views.QuoteViewSet)
router.register(r'authors', views.AuthorViewSet)
router.register(r'categories', views... | from django.conf.urls import url, include
from rest_framework.routers import DefaultRouter
from rest_framework_jwt import views as jwt_views
from . import views
router = DefaultRouter()
router.register(r'quotes', views.QuoteViewSet)
router.register(r'authors', views.AuthorViewSet)
router.register(r'categories', views... | <commit_before>from django.conf.urls import url, include
from rest_framework.routers import DefaultRouter
from rest_framework_jwt import views as jwt_views
from . import views
router = DefaultRouter()
router.register(r'quotes', views.QuoteViewSet)
router.register(r'authors', views.AuthorViewSet)
router.register(r'cat... |
7626f955a799cf93bb66aaa9b79a33395e9871e6 | api/api_resource.py | api/api_resource.py | from falcon.util.uri import parse_query_string
import json
from api.actions import pos_tagging
class ApiResource(object):
def parse_request_data(self, raw_post_data):
encoded_raw_post_data = ""
try:
encoded_raw_post_data = str(raw_post_data, 'utf-8')
except UnicodeDecodeError:
... | from falcon.util.uri import parse_query_string
import json
from api.actions import pos_tagging
class ApiResource(object):
def parse_request_data(self, raw_post_data):
encoded_raw_post_data = ""
try:
encoded_raw_post_data = str(raw_post_data, 'utf-8')
except UnicodeDecodeError:
... | Revert "Return utf-8, not ascii." | Revert "Return utf-8, not ascii."
This reverts commit 86cbefc74471e4c991c96e0385b931a2a20f5d50.
Former-commit-id: 3246e0bfefb806bd2b4d3dda0cb77e91f3481971 | Python | mit | EmilStenstrom/json-tagger,EmilStenstrom/json-tagger,EmilStenstrom/json-tagger,EmilStenstrom/json-tagger,EmilStenstrom/json-tagger | from falcon.util.uri import parse_query_string
import json
from api.actions import pos_tagging
class ApiResource(object):
def parse_request_data(self, raw_post_data):
encoded_raw_post_data = ""
try:
encoded_raw_post_data = str(raw_post_data, 'utf-8')
except UnicodeDecodeError:
... | from falcon.util.uri import parse_query_string
import json
from api.actions import pos_tagging
class ApiResource(object):
def parse_request_data(self, raw_post_data):
encoded_raw_post_data = ""
try:
encoded_raw_post_data = str(raw_post_data, 'utf-8')
except UnicodeDecodeError:
... | <commit_before>from falcon.util.uri import parse_query_string
import json
from api.actions import pos_tagging
class ApiResource(object):
def parse_request_data(self, raw_post_data):
encoded_raw_post_data = ""
try:
encoded_raw_post_data = str(raw_post_data, 'utf-8')
except Unicod... | from falcon.util.uri import parse_query_string
import json
from api.actions import pos_tagging
class ApiResource(object):
def parse_request_data(self, raw_post_data):
encoded_raw_post_data = ""
try:
encoded_raw_post_data = str(raw_post_data, 'utf-8')
except UnicodeDecodeError:
... | from falcon.util.uri import parse_query_string
import json
from api.actions import pos_tagging
class ApiResource(object):
def parse_request_data(self, raw_post_data):
encoded_raw_post_data = ""
try:
encoded_raw_post_data = str(raw_post_data, 'utf-8')
except UnicodeDecodeError:
... | <commit_before>from falcon.util.uri import parse_query_string
import json
from api.actions import pos_tagging
class ApiResource(object):
def parse_request_data(self, raw_post_data):
encoded_raw_post_data = ""
try:
encoded_raw_post_data = str(raw_post_data, 'utf-8')
except Unicod... |
ed0b33dc0866100c2bede3579711af761d5cb159 | plumeria/util/__init__.py | plumeria/util/__init__.py | MIME_TYPES = {
'.png': 'image/png',
'.jpg': 'image/jpeg',
'.jpeg': 'image/jpeg',
'.gif': 'image/gif',
}
def to_mimetype(ext):
if ext.lower() in MIME_TYPES:
return MIME_TYPES[ext.lower()]
| MIME_TYPES = {
'.png': 'image/png',
'.jpg': 'image/jpeg',
'.jpeg': 'image/jpeg',
'.gif': 'image/gif',
'.txt': 'text/plain',
}
def to_mimetype(ext):
if ext.lower() in MIME_TYPES:
return MIME_TYPES[ext.lower()]
else:
return "application/octet-stream"
| Fix mimetype detection to handle more types. | Fix mimetype detection to handle more types.
| Python | mit | sk89q/Plumeria,sk89q/Plumeria,sk89q/Plumeria | MIME_TYPES = {
'.png': 'image/png',
'.jpg': 'image/jpeg',
'.jpeg': 'image/jpeg',
'.gif': 'image/gif',
}
def to_mimetype(ext):
if ext.lower() in MIME_TYPES:
return MIME_TYPES[ext.lower()]
Fix mimetype detection to handle more types. | MIME_TYPES = {
'.png': 'image/png',
'.jpg': 'image/jpeg',
'.jpeg': 'image/jpeg',
'.gif': 'image/gif',
'.txt': 'text/plain',
}
def to_mimetype(ext):
if ext.lower() in MIME_TYPES:
return MIME_TYPES[ext.lower()]
else:
return "application/octet-stream"
| <commit_before>MIME_TYPES = {
'.png': 'image/png',
'.jpg': 'image/jpeg',
'.jpeg': 'image/jpeg',
'.gif': 'image/gif',
}
def to_mimetype(ext):
if ext.lower() in MIME_TYPES:
return MIME_TYPES[ext.lower()]
<commit_msg>Fix mimetype detection to handle more types.<commit_after> | MIME_TYPES = {
'.png': 'image/png',
'.jpg': 'image/jpeg',
'.jpeg': 'image/jpeg',
'.gif': 'image/gif',
'.txt': 'text/plain',
}
def to_mimetype(ext):
if ext.lower() in MIME_TYPES:
return MIME_TYPES[ext.lower()]
else:
return "application/octet-stream"
| MIME_TYPES = {
'.png': 'image/png',
'.jpg': 'image/jpeg',
'.jpeg': 'image/jpeg',
'.gif': 'image/gif',
}
def to_mimetype(ext):
if ext.lower() in MIME_TYPES:
return MIME_TYPES[ext.lower()]
Fix mimetype detection to handle more types.MIME_TYPES = {
'.png': 'image/png',
'.jpg': 'image/... | <commit_before>MIME_TYPES = {
'.png': 'image/png',
'.jpg': 'image/jpeg',
'.jpeg': 'image/jpeg',
'.gif': 'image/gif',
}
def to_mimetype(ext):
if ext.lower() in MIME_TYPES:
return MIME_TYPES[ext.lower()]
<commit_msg>Fix mimetype detection to handle more types.<commit_after>MIME_TYPES = {
... |
2b29ad50beb04f2212ccd5c4dd3c769ac157ce02 | urls.py | urls.py | from django.conf.urls.defaults import url, patterns
urlpatterns = patterns('',
url(r'^$', 'invite.views.index', name='index'),
url(r'^invite/$', 'invite.views.invite', name='invite'),
url(r'^resend/(?P<code>.*)/$', 'invite.views.resend', name='resend'),
url(r'^revoke/(?P<code>.*)/$', 'invite.views.revo... | from django.conf.urls import url, patterns
urlpatterns = patterns('',
url(r'^$', 'invite.views.index', name='index'),
url(r'^invite/$', 'invite.views.invite', name='invite'),
url(r'^resend/(?P<code>.*)/$', 'invite.views.resend', name='resend'),
url(r'^revoke/(?P<code>.*)/$', 'invite.views.revoke', name... | Fix import path for url utilities. | Fix import path for url utilities.
| Python | bsd-3-clause | unt-libraries/django-invite,unt-libraries/django-invite | from django.conf.urls.defaults import url, patterns
urlpatterns = patterns('',
url(r'^$', 'invite.views.index', name='index'),
url(r'^invite/$', 'invite.views.invite', name='invite'),
url(r'^resend/(?P<code>.*)/$', 'invite.views.resend', name='resend'),
url(r'^revoke/(?P<code>.*)/$', 'invite.views.revo... | from django.conf.urls import url, patterns
urlpatterns = patterns('',
url(r'^$', 'invite.views.index', name='index'),
url(r'^invite/$', 'invite.views.invite', name='invite'),
url(r'^resend/(?P<code>.*)/$', 'invite.views.resend', name='resend'),
url(r'^revoke/(?P<code>.*)/$', 'invite.views.revoke', name... | <commit_before>from django.conf.urls.defaults import url, patterns
urlpatterns = patterns('',
url(r'^$', 'invite.views.index', name='index'),
url(r'^invite/$', 'invite.views.invite', name='invite'),
url(r'^resend/(?P<code>.*)/$', 'invite.views.resend', name='resend'),
url(r'^revoke/(?P<code>.*)/$', 'in... | from django.conf.urls import url, patterns
urlpatterns = patterns('',
url(r'^$', 'invite.views.index', name='index'),
url(r'^invite/$', 'invite.views.invite', name='invite'),
url(r'^resend/(?P<code>.*)/$', 'invite.views.resend', name='resend'),
url(r'^revoke/(?P<code>.*)/$', 'invite.views.revoke', name... | from django.conf.urls.defaults import url, patterns
urlpatterns = patterns('',
url(r'^$', 'invite.views.index', name='index'),
url(r'^invite/$', 'invite.views.invite', name='invite'),
url(r'^resend/(?P<code>.*)/$', 'invite.views.resend', name='resend'),
url(r'^revoke/(?P<code>.*)/$', 'invite.views.revo... | <commit_before>from django.conf.urls.defaults import url, patterns
urlpatterns = patterns('',
url(r'^$', 'invite.views.index', name='index'),
url(r'^invite/$', 'invite.views.invite', name='invite'),
url(r'^resend/(?P<code>.*)/$', 'invite.views.resend', name='resend'),
url(r'^revoke/(?P<code>.*)/$', 'in... |
0b1c174808ddebee4c41bb423e05d75118830c1d | src/analyses/report_urls.py | src/analyses/report_urls.py | from django.conf.urls import url
from .views import serve_report
urlpatterns = [
url(
r'^view/(?P<auth_key>[\w:]+)/(?P<file_path>.*)',
serve_report,
name='serve_report'
),
]
| from django.conf.urls import url
from .views import serve_report
urlpatterns = [
url(
r'^view/(?P<auth_key>[\w:-]+)/(?P<file_path>.*)',
serve_report,
name='serve_report'
),
]
| Fix some base64 auth keys are not captured by url | Fix some base64 auth keys are not captured by url
| Python | mit | ccwang002/biocloud-server-kai,ccwang002/biocloud-server-kai,ccwang002/biocloud-server-kai | from django.conf.urls import url
from .views import serve_report
urlpatterns = [
url(
r'^view/(?P<auth_key>[\w:]+)/(?P<file_path>.*)',
serve_report,
name='serve_report'
),
]
Fix some base64 auth keys are not captured by url | from django.conf.urls import url
from .views import serve_report
urlpatterns = [
url(
r'^view/(?P<auth_key>[\w:-]+)/(?P<file_path>.*)',
serve_report,
name='serve_report'
),
]
| <commit_before>from django.conf.urls import url
from .views import serve_report
urlpatterns = [
url(
r'^view/(?P<auth_key>[\w:]+)/(?P<file_path>.*)',
serve_report,
name='serve_report'
),
]
<commit_msg>Fix some base64 auth keys are not captured by url<commit_after> | from django.conf.urls import url
from .views import serve_report
urlpatterns = [
url(
r'^view/(?P<auth_key>[\w:-]+)/(?P<file_path>.*)',
serve_report,
name='serve_report'
),
]
| from django.conf.urls import url
from .views import serve_report
urlpatterns = [
url(
r'^view/(?P<auth_key>[\w:]+)/(?P<file_path>.*)',
serve_report,
name='serve_report'
),
]
Fix some base64 auth keys are not captured by urlfrom django.conf.urls import url
from .views import serve_report... | <commit_before>from django.conf.urls import url
from .views import serve_report
urlpatterns = [
url(
r'^view/(?P<auth_key>[\w:]+)/(?P<file_path>.*)',
serve_report,
name='serve_report'
),
]
<commit_msg>Fix some base64 auth keys are not captured by url<commit_after>from django.conf.urls i... |
ce8c79346d3c7978739ce2c0a05f89a48150fa2f | ratechecker/migrations/0002_remove_fee_loader.py | ratechecker/migrations/0002_remove_fee_loader.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-10-31 16:33
from __future__ import unicode_literals
from django.db import migrations, OperationalError, ProgrammingError
def fix_fee_product_index(apps, schema_editor):
try:
schema_editor.execute(
'DROP INDEX IF EXISTS idx_16977_pro... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-10-31 16:33
from __future__ import unicode_literals
from django.db import migrations, OperationalError, ProgrammingError
def fix_fee_product_index(apps, schema_editor):
table_name = 'cfpb.ratechecker_fee'
index_name = 'idx_16977_product_id'
try... | Remove IF EXISTS from fix_fee_product_index | Remove IF EXISTS from fix_fee_product_index
| Python | cc0-1.0 | cfpb/owning-a-home-api | # -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-10-31 16:33
from __future__ import unicode_literals
from django.db import migrations, OperationalError, ProgrammingError
def fix_fee_product_index(apps, schema_editor):
try:
schema_editor.execute(
'DROP INDEX IF EXISTS idx_16977_pro... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-10-31 16:33
from __future__ import unicode_literals
from django.db import migrations, OperationalError, ProgrammingError
def fix_fee_product_index(apps, schema_editor):
table_name = 'cfpb.ratechecker_fee'
index_name = 'idx_16977_product_id'
try... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-10-31 16:33
from __future__ import unicode_literals
from django.db import migrations, OperationalError, ProgrammingError
def fix_fee_product_index(apps, schema_editor):
try:
schema_editor.execute(
'DROP INDEX IF EXIST... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-10-31 16:33
from __future__ import unicode_literals
from django.db import migrations, OperationalError, ProgrammingError
def fix_fee_product_index(apps, schema_editor):
table_name = 'cfpb.ratechecker_fee'
index_name = 'idx_16977_product_id'
try... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-10-31 16:33
from __future__ import unicode_literals
from django.db import migrations, OperationalError, ProgrammingError
def fix_fee_product_index(apps, schema_editor):
try:
schema_editor.execute(
'DROP INDEX IF EXISTS idx_16977_pro... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-10-31 16:33
from __future__ import unicode_literals
from django.db import migrations, OperationalError, ProgrammingError
def fix_fee_product_index(apps, schema_editor):
try:
schema_editor.execute(
'DROP INDEX IF EXIST... |
70daf4157cc8b039d726fd6482fa9bae1b3fee1e | modules/urlparser/__init__.py | modules/urlparser/__init__.py | from modules import *
import re
import urllib2
import traceback
try:
import simplejson as json
except ImportError:
import json
from unidecode import unidecode
from twitter import Twitter
from bitly import Bitly
from youtube import Youtube
class Urlparser(Module):
"""Checks incoming messages for possible... | from modules import *
import re
import urllib2
import traceback
try:
import simplejson as json
except ImportError:
import json
from unidecode import unidecode
from twitter import Twitter
from bitly import Bitly
from youtube import Youtube
class Urlparser(Module):
"""Checks incoming messages for possible... | Change encoding of URL parser | Change encoding of URL parser
| Python | mit | billyvg/piebot | from modules import *
import re
import urllib2
import traceback
try:
import simplejson as json
except ImportError:
import json
from unidecode import unidecode
from twitter import Twitter
from bitly import Bitly
from youtube import Youtube
class Urlparser(Module):
"""Checks incoming messages for possible... | from modules import *
import re
import urllib2
import traceback
try:
import simplejson as json
except ImportError:
import json
from unidecode import unidecode
from twitter import Twitter
from bitly import Bitly
from youtube import Youtube
class Urlparser(Module):
"""Checks incoming messages for possible... | <commit_before>from modules import *
import re
import urllib2
import traceback
try:
import simplejson as json
except ImportError:
import json
from unidecode import unidecode
from twitter import Twitter
from bitly import Bitly
from youtube import Youtube
class Urlparser(Module):
"""Checks incoming messag... | from modules import *
import re
import urllib2
import traceback
try:
import simplejson as json
except ImportError:
import json
from unidecode import unidecode
from twitter import Twitter
from bitly import Bitly
from youtube import Youtube
class Urlparser(Module):
"""Checks incoming messages for possible... | from modules import *
import re
import urllib2
import traceback
try:
import simplejson as json
except ImportError:
import json
from unidecode import unidecode
from twitter import Twitter
from bitly import Bitly
from youtube import Youtube
class Urlparser(Module):
"""Checks incoming messages for possible... | <commit_before>from modules import *
import re
import urllib2
import traceback
try:
import simplejson as json
except ImportError:
import json
from unidecode import unidecode
from twitter import Twitter
from bitly import Bitly
from youtube import Youtube
class Urlparser(Module):
"""Checks incoming messag... |
f59106c4c804b0d0bc04dec9ff28b1b9c4ff08e4 | GeneratePassword/generate_password_v3.py | GeneratePassword/generate_password_v3.py | import os, sys
import random
import re
try:
# Make Python2 work like Python3
input = raw_input
except NameError:
# On Python3; already using input
pass
def get_words_from_file(filepath):
"""Return the set of all words at least three letters
long from within a named file.
"""
with open(... | import os, sys
import random
import re
try:
# Make Python2 work like Python3
input = raw_input
except NameError:
# On Python3; already using input
pass
def get_words_from_file(filepath):
"""Return the set of all words at least three letters
long from within a named file.
"""
with open(... | Use a correct algorithm to determine the length of word to use | Use a correct algorithm to determine the length of word to use
| Python | apache-2.0 | OneScreenfulOfPython/screenfuls,OneScreenfulOfPython/screenfuls | import os, sys
import random
import re
try:
# Make Python2 work like Python3
input = raw_input
except NameError:
# On Python3; already using input
pass
def get_words_from_file(filepath):
"""Return the set of all words at least three letters
long from within a named file.
"""
with open(... | import os, sys
import random
import re
try:
# Make Python2 work like Python3
input = raw_input
except NameError:
# On Python3; already using input
pass
def get_words_from_file(filepath):
"""Return the set of all words at least three letters
long from within a named file.
"""
with open(... | <commit_before>import os, sys
import random
import re
try:
# Make Python2 work like Python3
input = raw_input
except NameError:
# On Python3; already using input
pass
def get_words_from_file(filepath):
"""Return the set of all words at least three letters
long from within a named file.
"""... | import os, sys
import random
import re
try:
# Make Python2 work like Python3
input = raw_input
except NameError:
# On Python3; already using input
pass
def get_words_from_file(filepath):
"""Return the set of all words at least three letters
long from within a named file.
"""
with open(... | import os, sys
import random
import re
try:
# Make Python2 work like Python3
input = raw_input
except NameError:
# On Python3; already using input
pass
def get_words_from_file(filepath):
"""Return the set of all words at least three letters
long from within a named file.
"""
with open(... | <commit_before>import os, sys
import random
import re
try:
# Make Python2 work like Python3
input = raw_input
except NameError:
# On Python3; already using input
pass
def get_words_from_file(filepath):
"""Return the set of all words at least three letters
long from within a named file.
"""... |
7264db6b160d27f5b9eeb5571acad254f427ab7e | skan/__init__.py | skan/__init__.py | from .csr import skeleton_to_csgraph, branch_statistics, summarise
__version__ = '0.8.0-dev'
__all__ = ['skeleton_to_csgraph',
'branch_statistics',
'summarise']
| from .csr import skeleton_to_csgraph, branch_statistics, summarise, Skeleton
__version__ = '0.8.0-dev'
__all__ = ['skeleton_to_csgraph',
'branch_statistics',
'summarise']
| Add Skeleton class to package namespace | Add Skeleton class to package namespace
| Python | bsd-3-clause | jni/skan | from .csr import skeleton_to_csgraph, branch_statistics, summarise
__version__ = '0.8.0-dev'
__all__ = ['skeleton_to_csgraph',
'branch_statistics',
'summarise']
Add Skeleton class to package namespace | from .csr import skeleton_to_csgraph, branch_statistics, summarise, Skeleton
__version__ = '0.8.0-dev'
__all__ = ['skeleton_to_csgraph',
'branch_statistics',
'summarise']
| <commit_before>from .csr import skeleton_to_csgraph, branch_statistics, summarise
__version__ = '0.8.0-dev'
__all__ = ['skeleton_to_csgraph',
'branch_statistics',
'summarise']
<commit_msg>Add Skeleton class to package namespace<commit_after> | from .csr import skeleton_to_csgraph, branch_statistics, summarise, Skeleton
__version__ = '0.8.0-dev'
__all__ = ['skeleton_to_csgraph',
'branch_statistics',
'summarise']
| from .csr import skeleton_to_csgraph, branch_statistics, summarise
__version__ = '0.8.0-dev'
__all__ = ['skeleton_to_csgraph',
'branch_statistics',
'summarise']
Add Skeleton class to package namespacefrom .csr import skeleton_to_csgraph, branch_statistics, summarise, Skeleton
__version__ = '0.8... | <commit_before>from .csr import skeleton_to_csgraph, branch_statistics, summarise
__version__ = '0.8.0-dev'
__all__ = ['skeleton_to_csgraph',
'branch_statistics',
'summarise']
<commit_msg>Add Skeleton class to package namespace<commit_after>from .csr import skeleton_to_csgraph, branch_statistics... |
4185a93dcb3e53b87280bfe0579d551c338c440f | datatableview/tests/testcase.py | datatableview/tests/testcase.py | # -*- encoding: utf-8 -*-
from django import get_version
from django.test import TestCase
from django.core.management import call_command
if get_version().split('.') >= ['1', '7']:
from django.test import override_settings
from django.apps import apps
initial_data_fixture = 'initial_data_modern'
clear... | # -*- encoding: utf-8 -*-
import django
from django.test import TestCase
from django.core.management import call_command
if django.VERSION >= (1, 7):
from django.test import override_settings
from django.apps import apps
initial_data_fixture = 'initial_data_modern'
clear_app_cache = apps.clear_cache
e... | Fix Django version check for 1.10 | Fix Django version check for 1.10
| Python | apache-2.0 | pivotal-energy-solutions/django-datatable-view,pivotal-energy-solutions/django-datatable-view,jangeador/django-datatable-view,jangeador/django-datatable-view,doganmeh/django-datatable-view,jangeador/django-datatable-view,doganmeh/django-datatable-view,doganmeh/django-datatable-view,pivotal-energy-solutions/django-datat... | # -*- encoding: utf-8 -*-
from django import get_version
from django.test import TestCase
from django.core.management import call_command
if get_version().split('.') >= ['1', '7']:
from django.test import override_settings
from django.apps import apps
initial_data_fixture = 'initial_data_modern'
clear... | # -*- encoding: utf-8 -*-
import django
from django.test import TestCase
from django.core.management import call_command
if django.VERSION >= (1, 7):
from django.test import override_settings
from django.apps import apps
initial_data_fixture = 'initial_data_modern'
clear_app_cache = apps.clear_cache
e... | <commit_before># -*- encoding: utf-8 -*-
from django import get_version
from django.test import TestCase
from django.core.management import call_command
if get_version().split('.') >= ['1', '7']:
from django.test import override_settings
from django.apps import apps
initial_data_fixture = 'initial_data_mo... | # -*- encoding: utf-8 -*-
import django
from django.test import TestCase
from django.core.management import call_command
if django.VERSION >= (1, 7):
from django.test import override_settings
from django.apps import apps
initial_data_fixture = 'initial_data_modern'
clear_app_cache = apps.clear_cache
e... | # -*- encoding: utf-8 -*-
from django import get_version
from django.test import TestCase
from django.core.management import call_command
if get_version().split('.') >= ['1', '7']:
from django.test import override_settings
from django.apps import apps
initial_data_fixture = 'initial_data_modern'
clear... | <commit_before># -*- encoding: utf-8 -*-
from django import get_version
from django.test import TestCase
from django.core.management import call_command
if get_version().split('.') >= ['1', '7']:
from django.test import override_settings
from django.apps import apps
initial_data_fixture = 'initial_data_mo... |
b5be0a7d48d51ef504f47711f53eb0d2f6238b70 | SessionManager.py | SessionManager.py | import sublime
import sublime_plugin
from datetime import datetime
from .modules import messages
from .modules import serialize
from .modules import settings
from .modules.session import Session
class SaveSession(sublime_plugin.ApplicationCommand):
def run(self):
settings.load()
... | import sublime
import sublime_plugin
from datetime import datetime
from .modules import messages
from .modules import serialize
from .modules import settings
from .modules.session import Session
def plugin_loaded():
settings.load()
class SaveSession(sublime_plugin.ApplicationCommand):
def ... | Load settings only on "plugin_loaded" | Load settings only on "plugin_loaded"
Since sublime caches settings internally and subsequent "load_settings"
calls don't refer to the disk, it doesn't make sense to load the settings
each time a command gets executed.
| Python | mit | Zeeker/sublime-SessionManager | import sublime
import sublime_plugin
from datetime import datetime
from .modules import messages
from .modules import serialize
from .modules import settings
from .modules.session import Session
class SaveSession(sublime_plugin.ApplicationCommand):
def run(self):
settings.load()
... | import sublime
import sublime_plugin
from datetime import datetime
from .modules import messages
from .modules import serialize
from .modules import settings
from .modules.session import Session
def plugin_loaded():
settings.load()
class SaveSession(sublime_plugin.ApplicationCommand):
def ... | <commit_before>import sublime
import sublime_plugin
from datetime import datetime
from .modules import messages
from .modules import serialize
from .modules import settings
from .modules.session import Session
class SaveSession(sublime_plugin.ApplicationCommand):
def run(self):
settings.loa... | import sublime
import sublime_plugin
from datetime import datetime
from .modules import messages
from .modules import serialize
from .modules import settings
from .modules.session import Session
def plugin_loaded():
settings.load()
class SaveSession(sublime_plugin.ApplicationCommand):
def ... | import sublime
import sublime_plugin
from datetime import datetime
from .modules import messages
from .modules import serialize
from .modules import settings
from .modules.session import Session
class SaveSession(sublime_plugin.ApplicationCommand):
def run(self):
settings.load()
... | <commit_before>import sublime
import sublime_plugin
from datetime import datetime
from .modules import messages
from .modules import serialize
from .modules import settings
from .modules.session import Session
class SaveSession(sublime_plugin.ApplicationCommand):
def run(self):
settings.loa... |
670827e34872b40635d567ff1f5a34f132719fa8 | app/flask_config.py | app/flask_config.py | """
Config parameters for the Flask app itself.
Nothing here is user-configurable; all config variables you can set yourself are in config.py.
Generally speaking, don't touch this file unless you know what you're doing.
"""
import config
import constants
# Flask-SQLAlchemy
SQLALCHEMY_DATABASE_URI = 'mysql://{databas... | """
Config parameters for the Flask app itself.
Nothing here is user-configurable; all config variables you can set yourself are in config.py.
Generally speaking, don't touch this file unless you know what you're doing.
"""
import config
import constants
# Flask-SQLAlchemy
SQLALCHEMY_DATABASE_URI = 'mysql://{databas... | Use more specific session cookie name | Use more specific session cookie name
| Python | mit | LINKIWI/modern-paste,LINKIWI/modern-paste,LINKIWI/modern-paste | """
Config parameters for the Flask app itself.
Nothing here is user-configurable; all config variables you can set yourself are in config.py.
Generally speaking, don't touch this file unless you know what you're doing.
"""
import config
import constants
# Flask-SQLAlchemy
SQLALCHEMY_DATABASE_URI = 'mysql://{databas... | """
Config parameters for the Flask app itself.
Nothing here is user-configurable; all config variables you can set yourself are in config.py.
Generally speaking, don't touch this file unless you know what you're doing.
"""
import config
import constants
# Flask-SQLAlchemy
SQLALCHEMY_DATABASE_URI = 'mysql://{databas... | <commit_before>"""
Config parameters for the Flask app itself.
Nothing here is user-configurable; all config variables you can set yourself are in config.py.
Generally speaking, don't touch this file unless you know what you're doing.
"""
import config
import constants
# Flask-SQLAlchemy
SQLALCHEMY_DATABASE_URI = 'm... | """
Config parameters for the Flask app itself.
Nothing here is user-configurable; all config variables you can set yourself are in config.py.
Generally speaking, don't touch this file unless you know what you're doing.
"""
import config
import constants
# Flask-SQLAlchemy
SQLALCHEMY_DATABASE_URI = 'mysql://{databas... | """
Config parameters for the Flask app itself.
Nothing here is user-configurable; all config variables you can set yourself are in config.py.
Generally speaking, don't touch this file unless you know what you're doing.
"""
import config
import constants
# Flask-SQLAlchemy
SQLALCHEMY_DATABASE_URI = 'mysql://{databas... | <commit_before>"""
Config parameters for the Flask app itself.
Nothing here is user-configurable; all config variables you can set yourself are in config.py.
Generally speaking, don't touch this file unless you know what you're doing.
"""
import config
import constants
# Flask-SQLAlchemy
SQLALCHEMY_DATABASE_URI = 'm... |
118523251af8861d20b92ce754b48e9911f100c7 | odsimport.py | odsimport.py | from odf.opendocument import load
from odf.table import Table, TableRow, TableCell
from odf.text import P
def import_ods(path):
doc = load(path)
db = {}
tables = doc.spreadsheet.getElementsByType(Table)
for table in tables:
db_table = []
db[table.getAttribute('name')] = db_table
... | from odf.opendocument import load
from odf.table import Table, TableRow, TableCell
from odf.namespaces import TABLENS
from odf.text import P
def import_ods(path):
doc = load(path)
db = {}
tables = doc.spreadsheet.getElementsByType(Table)
for table in tables:
db_table = []
db[table.ge... | Fix ods-import for column repeat | Fix ods-import for column repeat
| Python | bsd-2-clause | aholkner/PoliticalRPG,aholkner/PoliticalRPG | from odf.opendocument import load
from odf.table import Table, TableRow, TableCell
from odf.text import P
def import_ods(path):
doc = load(path)
db = {}
tables = doc.spreadsheet.getElementsByType(Table)
for table in tables:
db_table = []
db[table.getAttribute('name')] = db_table
... | from odf.opendocument import load
from odf.table import Table, TableRow, TableCell
from odf.namespaces import TABLENS
from odf.text import P
def import_ods(path):
doc = load(path)
db = {}
tables = doc.spreadsheet.getElementsByType(Table)
for table in tables:
db_table = []
db[table.ge... | <commit_before>from odf.opendocument import load
from odf.table import Table, TableRow, TableCell
from odf.text import P
def import_ods(path):
doc = load(path)
db = {}
tables = doc.spreadsheet.getElementsByType(Table)
for table in tables:
db_table = []
db[table.getAttribute('name')] =... | from odf.opendocument import load
from odf.table import Table, TableRow, TableCell
from odf.namespaces import TABLENS
from odf.text import P
def import_ods(path):
doc = load(path)
db = {}
tables = doc.spreadsheet.getElementsByType(Table)
for table in tables:
db_table = []
db[table.ge... | from odf.opendocument import load
from odf.table import Table, TableRow, TableCell
from odf.text import P
def import_ods(path):
doc = load(path)
db = {}
tables = doc.spreadsheet.getElementsByType(Table)
for table in tables:
db_table = []
db[table.getAttribute('name')] = db_table
... | <commit_before>from odf.opendocument import load
from odf.table import Table, TableRow, TableCell
from odf.text import P
def import_ods(path):
doc = load(path)
db = {}
tables = doc.spreadsheet.getElementsByType(Table)
for table in tables:
db_table = []
db[table.getAttribute('name')] =... |
52e5c8ebb74622d2cb2a378f98563cb615115a21 | uptick/tools.py | uptick/tools.py | # -*- coding: utf-8 -*-
import click
from .decorators import online
from .main import main, config
from .ui import print_table, print_tx
@main.group()
def tools():
""" Further tools
"""
pass
@tools.command()
@click.pass_context
@online
@click.argument("account")
def getcloudloginkey(ctx, account):
"... | # -*- coding: utf-8 -*-
import click
from .decorators import online
from .main import main, config
from .ui import print_table, print_tx
@main.group()
def tools():
""" Further tools
"""
pass
@tools.command()
@click.pass_context
@online
@click.argument("account")
def getcloudloginkey(ctx, account):
"... | Allow to manually generate brainkeys | Allow to manually generate brainkeys
| Python | mit | xeroc/uptick | # -*- coding: utf-8 -*-
import click
from .decorators import online
from .main import main, config
from .ui import print_table, print_tx
@main.group()
def tools():
""" Further tools
"""
pass
@tools.command()
@click.pass_context
@online
@click.argument("account")
def getcloudloginkey(ctx, account):
"... | # -*- coding: utf-8 -*-
import click
from .decorators import online
from .main import main, config
from .ui import print_table, print_tx
@main.group()
def tools():
""" Further tools
"""
pass
@tools.command()
@click.pass_context
@online
@click.argument("account")
def getcloudloginkey(ctx, account):
"... | <commit_before># -*- coding: utf-8 -*-
import click
from .decorators import online
from .main import main, config
from .ui import print_table, print_tx
@main.group()
def tools():
""" Further tools
"""
pass
@tools.command()
@click.pass_context
@online
@click.argument("account")
def getcloudloginkey(ctx, ... | # -*- coding: utf-8 -*-
import click
from .decorators import online
from .main import main, config
from .ui import print_table, print_tx
@main.group()
def tools():
""" Further tools
"""
pass
@tools.command()
@click.pass_context
@online
@click.argument("account")
def getcloudloginkey(ctx, account):
"... | # -*- coding: utf-8 -*-
import click
from .decorators import online
from .main import main, config
from .ui import print_table, print_tx
@main.group()
def tools():
""" Further tools
"""
pass
@tools.command()
@click.pass_context
@online
@click.argument("account")
def getcloudloginkey(ctx, account):
"... | <commit_before># -*- coding: utf-8 -*-
import click
from .decorators import online
from .main import main, config
from .ui import print_table, print_tx
@main.group()
def tools():
""" Further tools
"""
pass
@tools.command()
@click.pass_context
@online
@click.argument("account")
def getcloudloginkey(ctx, ... |
d335fce6cea07df872d8cd7d70c6c3fea348e521 | tests/__init__.py | tests/__init__.py | import os.path
import unittest
def get_tests():
start_dir = os.path.dirname(__file__)
return unittest.TestLoader().discover(start_dir, pattern="*.py")
| import os.path
import unittest
def get_tests():
return full_suite()
def full_suite():
from .resource import ResourceTestCase
from .serializer import ResourceTestCase as SerializerTestCase
from .utils import UtilsTestCase
resourcesuite = unittest.TestLoader().loadTestsFromTestCase(ResourceTestCas... | Update get_tests to be backwards compatible with Python 2.6, since the library is compatible it seems worth this extra effort to test against it. | Update get_tests to be backwards compatible with Python 2.6, since the library is compatible it seems worth this extra effort to test against it.
| Python | bsd-2-clause | jannon/slumber,IAlwaysBeCoding/More,zongxiao/slumber,infoxchange/slumber,futurice/slumber,IAlwaysBeCoding/slumber,samgiles/slumber,s-block/slumber,ministryofjustice/slumber | import os.path
import unittest
def get_tests():
start_dir = os.path.dirname(__file__)
return unittest.TestLoader().discover(start_dir, pattern="*.py")
Update get_tests to be backwards compatible with Python 2.6, since the library is compatible it seems worth this extra effort to test against it. | import os.path
import unittest
def get_tests():
return full_suite()
def full_suite():
from .resource import ResourceTestCase
from .serializer import ResourceTestCase as SerializerTestCase
from .utils import UtilsTestCase
resourcesuite = unittest.TestLoader().loadTestsFromTestCase(ResourceTestCas... | <commit_before>import os.path
import unittest
def get_tests():
start_dir = os.path.dirname(__file__)
return unittest.TestLoader().discover(start_dir, pattern="*.py")
<commit_msg>Update get_tests to be backwards compatible with Python 2.6, since the library is compatible it seems worth this extra effort to tes... | import os.path
import unittest
def get_tests():
return full_suite()
def full_suite():
from .resource import ResourceTestCase
from .serializer import ResourceTestCase as SerializerTestCase
from .utils import UtilsTestCase
resourcesuite = unittest.TestLoader().loadTestsFromTestCase(ResourceTestCas... | import os.path
import unittest
def get_tests():
start_dir = os.path.dirname(__file__)
return unittest.TestLoader().discover(start_dir, pattern="*.py")
Update get_tests to be backwards compatible with Python 2.6, since the library is compatible it seems worth this extra effort to test against it.import os.path... | <commit_before>import os.path
import unittest
def get_tests():
start_dir = os.path.dirname(__file__)
return unittest.TestLoader().discover(start_dir, pattern="*.py")
<commit_msg>Update get_tests to be backwards compatible with Python 2.6, since the library is compatible it seems worth this extra effort to tes... |
365206a49adf81b8618206912001ff744b54f405 | tests/conftest.py | tests/conftest.py | # coding: utf-8
import os
import pytest
from dynaconf import LazySettings
@pytest.fixture(scope='module')
def settings():
"""Settings fixture with some defaults"""
mode = 'TRAVIS' if os.environ.get('TRAVIS') else 'TEST'
os.environ['DYNA%s_HOSTNAME' % mode] = 'host.com'
os.environ['DYNA%s_PORT' % mode... | # coding: utf-8
import os
import pytest
from dynaconf.base import LazySettings
@pytest.fixture(scope='module')
def settings():
"""Settings fixture with some defaults"""
mode = 'TRAVIS' if os.environ.get('TRAVIS') else 'TEST'
os.environ['DYNA%s_HOSTNAME' % mode] = 'host.com'
os.environ['DYNA%s_PORT' %... | Make it clear where we are getting LazySettings from | Make it clear where we are getting LazySettings from
| Python | mit | rochacbruno/dynaconf,rochacbruno/dynaconf,rochacbruno/dynaconf | # coding: utf-8
import os
import pytest
from dynaconf import LazySettings
@pytest.fixture(scope='module')
def settings():
"""Settings fixture with some defaults"""
mode = 'TRAVIS' if os.environ.get('TRAVIS') else 'TEST'
os.environ['DYNA%s_HOSTNAME' % mode] = 'host.com'
os.environ['DYNA%s_PORT' % mode... | # coding: utf-8
import os
import pytest
from dynaconf.base import LazySettings
@pytest.fixture(scope='module')
def settings():
"""Settings fixture with some defaults"""
mode = 'TRAVIS' if os.environ.get('TRAVIS') else 'TEST'
os.environ['DYNA%s_HOSTNAME' % mode] = 'host.com'
os.environ['DYNA%s_PORT' %... | <commit_before># coding: utf-8
import os
import pytest
from dynaconf import LazySettings
@pytest.fixture(scope='module')
def settings():
"""Settings fixture with some defaults"""
mode = 'TRAVIS' if os.environ.get('TRAVIS') else 'TEST'
os.environ['DYNA%s_HOSTNAME' % mode] = 'host.com'
os.environ['DYNA... | # coding: utf-8
import os
import pytest
from dynaconf.base import LazySettings
@pytest.fixture(scope='module')
def settings():
"""Settings fixture with some defaults"""
mode = 'TRAVIS' if os.environ.get('TRAVIS') else 'TEST'
os.environ['DYNA%s_HOSTNAME' % mode] = 'host.com'
os.environ['DYNA%s_PORT' %... | # coding: utf-8
import os
import pytest
from dynaconf import LazySettings
@pytest.fixture(scope='module')
def settings():
"""Settings fixture with some defaults"""
mode = 'TRAVIS' if os.environ.get('TRAVIS') else 'TEST'
os.environ['DYNA%s_HOSTNAME' % mode] = 'host.com'
os.environ['DYNA%s_PORT' % mode... | <commit_before># coding: utf-8
import os
import pytest
from dynaconf import LazySettings
@pytest.fixture(scope='module')
def settings():
"""Settings fixture with some defaults"""
mode = 'TRAVIS' if os.environ.get('TRAVIS') else 'TEST'
os.environ['DYNA%s_HOSTNAME' % mode] = 'host.com'
os.environ['DYNA... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.