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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e6fb5ba043c2db08cbacb119664297b3f3668517 | fluent_comments/forms/_captcha.py | fluent_comments/forms/_captcha.py | from django.core.exceptions import ImproperlyConfigured
try:
from captcha.fields import ReCaptchaField as CaptchaField
except ImportError:
try:
from captcha.fields import CaptchaField
except ImportError:
raise ImportError(
"To use the captcha contact form, you need to have "
... | from django.core.exceptions import ImproperlyConfigured
class CaptchaFormMixin(object):
def _reorder_fields(self, ordering):
"""
Test that the 'captcha' field is really present.
This could be broken by a bad FLUENT_COMMENTS_FIELD_ORDER configuration.
"""
if 'captcha' not in... | Fix duplicate captcha import check | Fix duplicate captcha import check
| Python | apache-2.0 | django-fluent/django-fluent-comments,django-fluent/django-fluent-comments,edoburu/django-fluent-comments,django-fluent/django-fluent-comments,django-fluent/django-fluent-comments,edoburu/django-fluent-comments,edoburu/django-fluent-comments | from django.core.exceptions import ImproperlyConfigured
try:
from captcha.fields import ReCaptchaField as CaptchaField
except ImportError:
try:
from captcha.fields import CaptchaField
except ImportError:
raise ImportError(
"To use the captcha contact form, you need to have "
... | from django.core.exceptions import ImproperlyConfigured
class CaptchaFormMixin(object):
def _reorder_fields(self, ordering):
"""
Test that the 'captcha' field is really present.
This could be broken by a bad FLUENT_COMMENTS_FIELD_ORDER configuration.
"""
if 'captcha' not in... | <commit_before>from django.core.exceptions import ImproperlyConfigured
try:
from captcha.fields import ReCaptchaField as CaptchaField
except ImportError:
try:
from captcha.fields import CaptchaField
except ImportError:
raise ImportError(
"To use the captcha contact form, you nee... | from django.core.exceptions import ImproperlyConfigured
class CaptchaFormMixin(object):
def _reorder_fields(self, ordering):
"""
Test that the 'captcha' field is really present.
This could be broken by a bad FLUENT_COMMENTS_FIELD_ORDER configuration.
"""
if 'captcha' not in... | from django.core.exceptions import ImproperlyConfigured
try:
from captcha.fields import ReCaptchaField as CaptchaField
except ImportError:
try:
from captcha.fields import CaptchaField
except ImportError:
raise ImportError(
"To use the captcha contact form, you need to have "
... | <commit_before>from django.core.exceptions import ImproperlyConfigured
try:
from captcha.fields import ReCaptchaField as CaptchaField
except ImportError:
try:
from captcha.fields import CaptchaField
except ImportError:
raise ImportError(
"To use the captcha contact form, you nee... |
7f1ddec9e170941e3a5159236ede817c2d569f38 | graphical_tests/test_partition.py | graphical_tests/test_partition.py | """
Draw a solid circle off center in a blank image.
Use the same array as both the image and the mask.
The tiles should subdivide along the curved edge to trace out a smooth circle.
"""
from skimage import draw
import matplotlib.pyplot as plt
import numpy as np
import photomosaic as pm
img = np.zeros((1000, 1000))
rr... | """
Draw a solid circle off center in a blank image.
Use the same array as both the image and the mask.
The tiles should subdivide along the curved edge to trace out a smooth circle.
"""
from skimage import draw
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import photomosai... | Update test to match API. | TST: Update test to match API.
| Python | bsd-3-clause | danielballan/photomosaic | """
Draw a solid circle off center in a blank image.
Use the same array as both the image and the mask.
The tiles should subdivide along the curved edge to trace out a smooth circle.
"""
from skimage import draw
import matplotlib.pyplot as plt
import numpy as np
import photomosaic as pm
img = np.zeros((1000, 1000))
rr... | """
Draw a solid circle off center in a blank image.
Use the same array as both the image and the mask.
The tiles should subdivide along the curved edge to trace out a smooth circle.
"""
from skimage import draw
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import photomosai... | <commit_before>"""
Draw a solid circle off center in a blank image.
Use the same array as both the image and the mask.
The tiles should subdivide along the curved edge to trace out a smooth circle.
"""
from skimage import draw
import matplotlib.pyplot as plt
import numpy as np
import photomosaic as pm
img = np.zeros((... | """
Draw a solid circle off center in a blank image.
Use the same array as both the image and the mask.
The tiles should subdivide along the curved edge to trace out a smooth circle.
"""
from skimage import draw
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import photomosai... | """
Draw a solid circle off center in a blank image.
Use the same array as both the image and the mask.
The tiles should subdivide along the curved edge to trace out a smooth circle.
"""
from skimage import draw
import matplotlib.pyplot as plt
import numpy as np
import photomosaic as pm
img = np.zeros((1000, 1000))
rr... | <commit_before>"""
Draw a solid circle off center in a blank image.
Use the same array as both the image and the mask.
The tiles should subdivide along the curved edge to trace out a smooth circle.
"""
from skimage import draw
import matplotlib.pyplot as plt
import numpy as np
import photomosaic as pm
img = np.zeros((... |
8e1e6624fb9120b3f26ac373dc48e877240cccac | bootcamp/lesson5.py | bootcamp/lesson5.py | import datetime
import csv
# Question 1
# ----------
# Using the csv data file users.csv aggregate app users as well as registration date by month. The count of app
# users should be one dictionary while the count of registration month should be another dictionary. There will be
# no checking or test harness so simpl... | import datetime
import csv
# Question 1
# ----------
# Using the csv data file users.csv aggregate app users as well as registration date by month. The count of app
# users should be one dictionary while the count of registration month should be another dictionary. There will be
# no checking or test harness so simpl... | Add print function to demonstrate func calling | Add print function to demonstrate func calling
| Python | mit | infoscout/python-bootcamp-pv | import datetime
import csv
# Question 1
# ----------
# Using the csv data file users.csv aggregate app users as well as registration date by month. The count of app
# users should be one dictionary while the count of registration month should be another dictionary. There will be
# no checking or test harness so simpl... | import datetime
import csv
# Question 1
# ----------
# Using the csv data file users.csv aggregate app users as well as registration date by month. The count of app
# users should be one dictionary while the count of registration month should be another dictionary. There will be
# no checking or test harness so simpl... | <commit_before>import datetime
import csv
# Question 1
# ----------
# Using the csv data file users.csv aggregate app users as well as registration date by month. The count of app
# users should be one dictionary while the count of registration month should be another dictionary. There will be
# no checking or test h... | import datetime
import csv
# Question 1
# ----------
# Using the csv data file users.csv aggregate app users as well as registration date by month. The count of app
# users should be one dictionary while the count of registration month should be another dictionary. There will be
# no checking or test harness so simpl... | import datetime
import csv
# Question 1
# ----------
# Using the csv data file users.csv aggregate app users as well as registration date by month. The count of app
# users should be one dictionary while the count of registration month should be another dictionary. There will be
# no checking or test harness so simpl... | <commit_before>import datetime
import csv
# Question 1
# ----------
# Using the csv data file users.csv aggregate app users as well as registration date by month. The count of app
# users should be one dictionary while the count of registration month should be another dictionary. There will be
# no checking or test h... |
51c97b17220e8fc6334d2dce1fd945ee1861385e | healthcheck/utils.py | healthcheck/utils.py | import errno
import os
def file_exists(path):
"""Return True if a file exists at `path` (even if it can't be read),
otherwise False.
This is different from os.path.isfile and os.path.exists which return
False if a file exists but the user doesn't have permission to read it.
"""
try:
o... | import errno
import os
def file_exists(path):
"""Return True if a file exists at `path` (even if it can't be read),
otherwise False.
This is different from os.path.isfile and os.path.exists which return
False if a file exists but the user doesn't have permission to read it.
"""
try:
o... | Add period to end of long comment | Add period to end of long comment
| Python | mit | yola/healthcheck | import errno
import os
def file_exists(path):
"""Return True if a file exists at `path` (even if it can't be read),
otherwise False.
This is different from os.path.isfile and os.path.exists which return
False if a file exists but the user doesn't have permission to read it.
"""
try:
o... | import errno
import os
def file_exists(path):
"""Return True if a file exists at `path` (even if it can't be read),
otherwise False.
This is different from os.path.isfile and os.path.exists which return
False if a file exists but the user doesn't have permission to read it.
"""
try:
o... | <commit_before>import errno
import os
def file_exists(path):
"""Return True if a file exists at `path` (even if it can't be read),
otherwise False.
This is different from os.path.isfile and os.path.exists which return
False if a file exists but the user doesn't have permission to read it.
"""
... | import errno
import os
def file_exists(path):
"""Return True if a file exists at `path` (even if it can't be read),
otherwise False.
This is different from os.path.isfile and os.path.exists which return
False if a file exists but the user doesn't have permission to read it.
"""
try:
o... | import errno
import os
def file_exists(path):
"""Return True if a file exists at `path` (even if it can't be read),
otherwise False.
This is different from os.path.isfile and os.path.exists which return
False if a file exists but the user doesn't have permission to read it.
"""
try:
o... | <commit_before>import errno
import os
def file_exists(path):
"""Return True if a file exists at `path` (even if it can't be read),
otherwise False.
This is different from os.path.isfile and os.path.exists which return
False if a file exists but the user doesn't have permission to read it.
"""
... |
17ffc13ba4a5eab56b66b8fe144cc53e8d02d961 | easyedit/TextArea.py | easyedit/TextArea.py | from PyQt5.Qsci import QsciScintilla, QsciLexerPython
class TextArea(QsciScintilla):
def __init__(self):
super().__init__()
self.filePath = "Untitled"
self.pythonLexer = QsciLexerPython(self)
self.setLexer(self.pythonLexer)
self.setMargins(1)
self.setMarginType(0,... | from PyQt5.Qsci import QsciScintilla, QsciLexerPython
class TextArea(QsciScintilla):
def __init__(self):
super().__init__()
self.filePath = "Untitled"
self.pythonLexer = QsciLexerPython(self)
self.setLexer(self.pythonLexer)
self.setMargins(1)
self.setMarginType(0,... | Remove debugging print statement from changeMarginWidth | Remove debugging print statement from changeMarginWidth
| Python | mit | msklosak/EasyEdit | from PyQt5.Qsci import QsciScintilla, QsciLexerPython
class TextArea(QsciScintilla):
def __init__(self):
super().__init__()
self.filePath = "Untitled"
self.pythonLexer = QsciLexerPython(self)
self.setLexer(self.pythonLexer)
self.setMargins(1)
self.setMarginType(0,... | from PyQt5.Qsci import QsciScintilla, QsciLexerPython
class TextArea(QsciScintilla):
def __init__(self):
super().__init__()
self.filePath = "Untitled"
self.pythonLexer = QsciLexerPython(self)
self.setLexer(self.pythonLexer)
self.setMargins(1)
self.setMarginType(0,... | <commit_before>from PyQt5.Qsci import QsciScintilla, QsciLexerPython
class TextArea(QsciScintilla):
def __init__(self):
super().__init__()
self.filePath = "Untitled"
self.pythonLexer = QsciLexerPython(self)
self.setLexer(self.pythonLexer)
self.setMargins(1)
self.s... | from PyQt5.Qsci import QsciScintilla, QsciLexerPython
class TextArea(QsciScintilla):
def __init__(self):
super().__init__()
self.filePath = "Untitled"
self.pythonLexer = QsciLexerPython(self)
self.setLexer(self.pythonLexer)
self.setMargins(1)
self.setMarginType(0,... | from PyQt5.Qsci import QsciScintilla, QsciLexerPython
class TextArea(QsciScintilla):
def __init__(self):
super().__init__()
self.filePath = "Untitled"
self.pythonLexer = QsciLexerPython(self)
self.setLexer(self.pythonLexer)
self.setMargins(1)
self.setMarginType(0,... | <commit_before>from PyQt5.Qsci import QsciScintilla, QsciLexerPython
class TextArea(QsciScintilla):
def __init__(self):
super().__init__()
self.filePath = "Untitled"
self.pythonLexer = QsciLexerPython(self)
self.setLexer(self.pythonLexer)
self.setMargins(1)
self.s... |
3f5b1e830eff73cdff013a423b647c795e21bef2 | captcha/fields.py | captcha/fields.py | from django.conf import settings
from django import forms
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
from recaptcha.client import captcha
from captcha.widgets import ReCaptcha
class ReCaptchaField(forms.CharField):
default_error_messages = {
... | from django.conf import settings
from django import forms
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
from recaptcha.client import captcha
from captcha.widgets import ReCaptcha
class ReCaptchaField(forms.CharField):
default_error_messages = {
... | Revert "Enforce valid captcha only if required, so tests can relax captcha requirement" | Revert "Enforce valid captcha only if required, so tests can relax captcha requirement"
This reverts commit c3c450b1a7070a1dd1b808e55371e838dd297857. It wasn't
such a great idea.
| Python | bsd-3-clause | mozilla/django-recaptcha | from django.conf import settings
from django import forms
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
from recaptcha.client import captcha
from captcha.widgets import ReCaptcha
class ReCaptchaField(forms.CharField):
default_error_messages = {
... | from django.conf import settings
from django import forms
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
from recaptcha.client import captcha
from captcha.widgets import ReCaptcha
class ReCaptchaField(forms.CharField):
default_error_messages = {
... | <commit_before>from django.conf import settings
from django import forms
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
from recaptcha.client import captcha
from captcha.widgets import ReCaptcha
class ReCaptchaField(forms.CharField):
default_error_messag... | from django.conf import settings
from django import forms
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
from recaptcha.client import captcha
from captcha.widgets import ReCaptcha
class ReCaptchaField(forms.CharField):
default_error_messages = {
... | from django.conf import settings
from django import forms
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
from recaptcha.client import captcha
from captcha.widgets import ReCaptcha
class ReCaptchaField(forms.CharField):
default_error_messages = {
... | <commit_before>from django.conf import settings
from django import forms
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
from recaptcha.client import captcha
from captcha.widgets import ReCaptcha
class ReCaptchaField(forms.CharField):
default_error_messag... |
b48984747d0f33f8ad9a8721bf7489d8ff97c157 | matador/commands/deploy_ticket.py | matador/commands/deploy_ticket.py | #!/usr/bin/env python
from .command import Command
from matador import utils
class DeployTicket(Command):
def _add_arguments(self, parser):
parser.prog = 'matador deploy-ticket'
parser.add_argument(
'-e', '--environment',
type=str,
required=True,
he... | #!/usr/bin/env python
from .command import Command
from matador import utils
class DeployTicket(Command):
def _add_arguments(self, parser):
parser.prog = 'matador deploy-ticket'
parser.add_argument(
'-e', '--environment',
type=str,
required=True,
he... | Add package argument to deploy-ticket | Add package argument to deploy-ticket
| Python | mit | Empiria/matador | #!/usr/bin/env python
from .command import Command
from matador import utils
class DeployTicket(Command):
def _add_arguments(self, parser):
parser.prog = 'matador deploy-ticket'
parser.add_argument(
'-e', '--environment',
type=str,
required=True,
he... | #!/usr/bin/env python
from .command import Command
from matador import utils
class DeployTicket(Command):
def _add_arguments(self, parser):
parser.prog = 'matador deploy-ticket'
parser.add_argument(
'-e', '--environment',
type=str,
required=True,
he... | <commit_before>#!/usr/bin/env python
from .command import Command
from matador import utils
class DeployTicket(Command):
def _add_arguments(self, parser):
parser.prog = 'matador deploy-ticket'
parser.add_argument(
'-e', '--environment',
type=str,
required=True,... | #!/usr/bin/env python
from .command import Command
from matador import utils
class DeployTicket(Command):
def _add_arguments(self, parser):
parser.prog = 'matador deploy-ticket'
parser.add_argument(
'-e', '--environment',
type=str,
required=True,
he... | #!/usr/bin/env python
from .command import Command
from matador import utils
class DeployTicket(Command):
def _add_arguments(self, parser):
parser.prog = 'matador deploy-ticket'
parser.add_argument(
'-e', '--environment',
type=str,
required=True,
he... | <commit_before>#!/usr/bin/env python
from .command import Command
from matador import utils
class DeployTicket(Command):
def _add_arguments(self, parser):
parser.prog = 'matador deploy-ticket'
parser.add_argument(
'-e', '--environment',
type=str,
required=True,... |
f6ce19f558bd298a6f0651ead865b65da3a2c479 | spiff/sensors/tests.py | spiff/sensors/tests.py | from django.test import TestCase
from spiff.api.tests import APITestMixin, withPermission
import models
class SensorTest(APITestMixin):
def setUp(self):
self.setupAPI()
self.sensor = models.Sensor.objects.create(
name = 'sensor',
description = 'Test sensor',
type = 0,
ttl = 255
)
... | from django.test import TestCase
from spiff.api.tests import APITestMixin, withPermission
import models
class SensorTest(APITestMixin):
def setUp(self):
self.setupAPI()
self.sensor = models.Sensor.objects.create(
name = 'sensor',
description = 'Test sensor',
type = models.SENSOR_TYPE_BOOLEA... | Use a bool sensor for testing, and query the API instead of models | Use a bool sensor for testing, and query the API instead of models
| Python | agpl-3.0 | SYNHAK/spiff,SYNHAK/spiff,SYNHAK/spiff | from django.test import TestCase
from spiff.api.tests import APITestMixin, withPermission
import models
class SensorTest(APITestMixin):
def setUp(self):
self.setupAPI()
self.sensor = models.Sensor.objects.create(
name = 'sensor',
description = 'Test sensor',
type = 0,
ttl = 255
)
... | from django.test import TestCase
from spiff.api.tests import APITestMixin, withPermission
import models
class SensorTest(APITestMixin):
def setUp(self):
self.setupAPI()
self.sensor = models.Sensor.objects.create(
name = 'sensor',
description = 'Test sensor',
type = models.SENSOR_TYPE_BOOLEA... | <commit_before>from django.test import TestCase
from spiff.api.tests import APITestMixin, withPermission
import models
class SensorTest(APITestMixin):
def setUp(self):
self.setupAPI()
self.sensor = models.Sensor.objects.create(
name = 'sensor',
description = 'Test sensor',
type = 0,
t... | from django.test import TestCase
from spiff.api.tests import APITestMixin, withPermission
import models
class SensorTest(APITestMixin):
def setUp(self):
self.setupAPI()
self.sensor = models.Sensor.objects.create(
name = 'sensor',
description = 'Test sensor',
type = models.SENSOR_TYPE_BOOLEA... | from django.test import TestCase
from spiff.api.tests import APITestMixin, withPermission
import models
class SensorTest(APITestMixin):
def setUp(self):
self.setupAPI()
self.sensor = models.Sensor.objects.create(
name = 'sensor',
description = 'Test sensor',
type = 0,
ttl = 255
)
... | <commit_before>from django.test import TestCase
from spiff.api.tests import APITestMixin, withPermission
import models
class SensorTest(APITestMixin):
def setUp(self):
self.setupAPI()
self.sensor = models.Sensor.objects.create(
name = 'sensor',
description = 'Test sensor',
type = 0,
t... |
600fe835ddce18a6aec5702766350003f2f90745 | gen-android-icons.py | gen-android-icons.py | __author__ = 'Maksim Dmitriev'
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--foo', help='foo help', required=True)
args = parser.parse_args()
| __author__ = 'Maksim Dmitriev'
import argparse
import os
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('-s', '--source', help='the icon to be resized', required=True)
parser.add_argument('-d', '--dest', help='the directory where resized icons are saved')
parser.add_... | Create an output directory unless it exists | Create an output directory unless it exists
| Python | bsd-3-clause | MaksimDmitriev/Python-Scripts | __author__ = 'Maksim Dmitriev'
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--foo', help='foo help', required=True)
args = parser.parse_args()
Create an output directory unless it exists | __author__ = 'Maksim Dmitriev'
import argparse
import os
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('-s', '--source', help='the icon to be resized', required=True)
parser.add_argument('-d', '--dest', help='the directory where resized icons are saved')
parser.add_... | <commit_before>__author__ = 'Maksim Dmitriev'
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--foo', help='foo help', required=True)
args = parser.parse_args()
<commit_msg>Create an output directory unless it exists<commit_after> | __author__ = 'Maksim Dmitriev'
import argparse
import os
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('-s', '--source', help='the icon to be resized', required=True)
parser.add_argument('-d', '--dest', help='the directory where resized icons are saved')
parser.add_... | __author__ = 'Maksim Dmitriev'
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--foo', help='foo help', required=True)
args = parser.parse_args()
Create an output directory unless it exists__author__ = 'Maksim Dmitriev'
import argparse
import os
if __na... | <commit_before>__author__ = 'Maksim Dmitriev'
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--foo', help='foo help', required=True)
args = parser.parse_args()
<commit_msg>Create an output directory unless it exists<commit_after>__author__ = 'Maksim Dmit... |
195bcf4b834794642a502ce876f023025c91a690 | savate/buffer_event.py | savate/buffer_event.py | # -*- coding: utf-8 -*-
import errno
import collections
from savate import writev
# FIXME: should this be a method of BufferEvent below ?
# FIXME: handle Python2.x/Python3k compat here
def buffer_slice(buff, offset, size):
return buffer(buff, offset, size)
class BufferOutputHandler(object):
def __init__(sel... | # -*- coding: utf-8 -*-
import errno
import collections
from savate import writev
# FIXME: should this be a method of BufferEvent below ?
# FIXME: handle Python2.x/Python3k compat here
def buffer_slice(buff, offset, size):
return buffer(buff, offset, size)
class BufferOutputHandler(object):
def __init__(sel... | Use buffer() to try and avoid memory copies | Use buffer() to try and avoid memory copies
| Python | agpl-3.0 | noirbee/savate,noirbee/savate | # -*- coding: utf-8 -*-
import errno
import collections
from savate import writev
# FIXME: should this be a method of BufferEvent below ?
# FIXME: handle Python2.x/Python3k compat here
def buffer_slice(buff, offset, size):
return buffer(buff, offset, size)
class BufferOutputHandler(object):
def __init__(sel... | # -*- coding: utf-8 -*-
import errno
import collections
from savate import writev
# FIXME: should this be a method of BufferEvent below ?
# FIXME: handle Python2.x/Python3k compat here
def buffer_slice(buff, offset, size):
return buffer(buff, offset, size)
class BufferOutputHandler(object):
def __init__(sel... | <commit_before># -*- coding: utf-8 -*-
import errno
import collections
from savate import writev
# FIXME: should this be a method of BufferEvent below ?
# FIXME: handle Python2.x/Python3k compat here
def buffer_slice(buff, offset, size):
return buffer(buff, offset, size)
class BufferOutputHandler(object):
d... | # -*- coding: utf-8 -*-
import errno
import collections
from savate import writev
# FIXME: should this be a method of BufferEvent below ?
# FIXME: handle Python2.x/Python3k compat here
def buffer_slice(buff, offset, size):
return buffer(buff, offset, size)
class BufferOutputHandler(object):
def __init__(sel... | # -*- coding: utf-8 -*-
import errno
import collections
from savate import writev
# FIXME: should this be a method of BufferEvent below ?
# FIXME: handle Python2.x/Python3k compat here
def buffer_slice(buff, offset, size):
return buffer(buff, offset, size)
class BufferOutputHandler(object):
def __init__(sel... | <commit_before># -*- coding: utf-8 -*-
import errno
import collections
from savate import writev
# FIXME: should this be a method of BufferEvent below ?
# FIXME: handle Python2.x/Python3k compat here
def buffer_slice(buff, offset, size):
return buffer(buff, offset, size)
class BufferOutputHandler(object):
d... |
90fb352f313b26964adcc587beb8f21deb3395a4 | tor.py | tor.py | import socks
import socket
from stem.control import Controller
from stem import Signal
class Tor(object):
"""Tor class for socks proxy and controller"""
def __init__(self, socks_port=9050, control_port=9051, control_password=""):
self.socks_port = socks_port
self.control_port = control_port
... | import socks
import socket
import json
from stem.control import Controller
from stem import Signal
from urllib2 import urlopen
class Tor(object):
"""Tor class for socks proxy and controller"""
def __init__(self, socks_port=9050, control_port=9051, control_password=""):
self.socks_port = socks_port
... | Add print_ip method for debugging | Add print_ip method for debugging
| Python | mit | MA3STR0/simpletor | import socks
import socket
from stem.control import Controller
from stem import Signal
class Tor(object):
"""Tor class for socks proxy and controller"""
def __init__(self, socks_port=9050, control_port=9051, control_password=""):
self.socks_port = socks_port
self.control_port = control_port
... | import socks
import socket
import json
from stem.control import Controller
from stem import Signal
from urllib2 import urlopen
class Tor(object):
"""Tor class for socks proxy and controller"""
def __init__(self, socks_port=9050, control_port=9051, control_password=""):
self.socks_port = socks_port
... | <commit_before>import socks
import socket
from stem.control import Controller
from stem import Signal
class Tor(object):
"""Tor class for socks proxy and controller"""
def __init__(self, socks_port=9050, control_port=9051, control_password=""):
self.socks_port = socks_port
self.control_port = ... | import socks
import socket
import json
from stem.control import Controller
from stem import Signal
from urllib2 import urlopen
class Tor(object):
"""Tor class for socks proxy and controller"""
def __init__(self, socks_port=9050, control_port=9051, control_password=""):
self.socks_port = socks_port
... | import socks
import socket
from stem.control import Controller
from stem import Signal
class Tor(object):
"""Tor class for socks proxy and controller"""
def __init__(self, socks_port=9050, control_port=9051, control_password=""):
self.socks_port = socks_port
self.control_port = control_port
... | <commit_before>import socks
import socket
from stem.control import Controller
from stem import Signal
class Tor(object):
"""Tor class for socks proxy and controller"""
def __init__(self, socks_port=9050, control_port=9051, control_password=""):
self.socks_port = socks_port
self.control_port = ... |
a52039c139e0d5b1c5fedb1dfb160e2c9b9387b3 | teuthology/task/tests/test_locking.py | teuthology/task/tests/test_locking.py | import pytest
class TestLocking(object):
def test_correct_os_type(self, ctx, config):
os_type = ctx.config.get("os_type")
if os_type is None:
pytest.skip('os_type was not defined')
for remote in ctx.cluster.remotes.iterkeys():
assert remote.os.name == os_type
... | import pytest
class TestLocking(object):
def test_correct_os_type(self, ctx, config):
os_type = ctx.config.get("os_type")
if os_type is None:
pytest.skip('os_type was not defined')
for remote in ctx.cluster.remotes.iterkeys():
assert remote.os.name == os_type
... | Make an exception for debian in tests.test_correct_os_version | Make an exception for debian in tests.test_correct_os_version
This is because of a known issue where downburst gives us 7.1 when we
ask for 7.0. We're ok with this behavior for now. See: issue #10878
Signed-off-by: Andrew Schoen <1bb641dc23c3a93cce4eee683bcf4b2bea7903a3@redhat.com>
| Python | mit | SUSE/teuthology,yghannam/teuthology,dmick/teuthology,caibo2014/teuthology,dreamhost/teuthology,caibo2014/teuthology,t-miyamae/teuthology,ivotron/teuthology,SUSE/teuthology,ceph/teuthology,ivotron/teuthology,ktdreyer/teuthology,SUSE/teuthology,dmick/teuthology,t-miyamae/teuthology,robbat2/teuthology,zhouyuan/teuthology,... | import pytest
class TestLocking(object):
def test_correct_os_type(self, ctx, config):
os_type = ctx.config.get("os_type")
if os_type is None:
pytest.skip('os_type was not defined')
for remote in ctx.cluster.remotes.iterkeys():
assert remote.os.name == os_type
... | import pytest
class TestLocking(object):
def test_correct_os_type(self, ctx, config):
os_type = ctx.config.get("os_type")
if os_type is None:
pytest.skip('os_type was not defined')
for remote in ctx.cluster.remotes.iterkeys():
assert remote.os.name == os_type
... | <commit_before>import pytest
class TestLocking(object):
def test_correct_os_type(self, ctx, config):
os_type = ctx.config.get("os_type")
if os_type is None:
pytest.skip('os_type was not defined')
for remote in ctx.cluster.remotes.iterkeys():
assert remote.os.name =... | import pytest
class TestLocking(object):
def test_correct_os_type(self, ctx, config):
os_type = ctx.config.get("os_type")
if os_type is None:
pytest.skip('os_type was not defined')
for remote in ctx.cluster.remotes.iterkeys():
assert remote.os.name == os_type
... | import pytest
class TestLocking(object):
def test_correct_os_type(self, ctx, config):
os_type = ctx.config.get("os_type")
if os_type is None:
pytest.skip('os_type was not defined')
for remote in ctx.cluster.remotes.iterkeys():
assert remote.os.name == os_type
... | <commit_before>import pytest
class TestLocking(object):
def test_correct_os_type(self, ctx, config):
os_type = ctx.config.get("os_type")
if os_type is None:
pytest.skip('os_type was not defined')
for remote in ctx.cluster.remotes.iterkeys():
assert remote.os.name =... |
6fb605a46a9dd33a2f31128955ca79e44379ad4d | main.py | main.py | # Copyright 2015, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable
# law or agreed to in writing, software d... | # Copyright 2015, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable
# law or agreed to in writing, software d... | Fix api key call to be renmamed key | Fix api key call to be renmamed key
| Python | apache-2.0 | googlearchive/appengine-python-vm-hello,bshaffer/appengine-python-vm-hello,bshaffer/appengine-python-vm-hello,googlearchive/appengine-python-vm-hello | # Copyright 2015, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable
# law or agreed to in writing, software d... | # Copyright 2015, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable
# law or agreed to in writing, software d... | <commit_before># Copyright 2015, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable
# law or agreed to in writ... | # Copyright 2015, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable
# law or agreed to in writing, software d... | # Copyright 2015, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable
# law or agreed to in writing, software d... | <commit_before># Copyright 2015, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable
# law or agreed to in writ... |
424162d2dc8a7c815c48946f4963561be20df62d | config_context.py | config_context.py | # A context carrying the loaded configuration.
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
import config
class ConfigContext(object):
def __init__(self, config):
self._config = config
self._cloud_workstations = {}
self._volumes_by_cws = {... | # A context carrying the loaded configuration.
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
import config
class ConfigContext(object):
def __init__(self, config):
self._config = config
self._cloud_workstations = {}
self._volumes = {}
... | Revert unintend change. Fixes bug. | Revert unintend change. Fixes bug.
| Python | mit | fhltang/chews,fhltang/chews | # A context carrying the loaded configuration.
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
import config
class ConfigContext(object):
def __init__(self, config):
self._config = config
self._cloud_workstations = {}
self._volumes_by_cws = {... | # A context carrying the loaded configuration.
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
import config
class ConfigContext(object):
def __init__(self, config):
self._config = config
self._cloud_workstations = {}
self._volumes = {}
... | <commit_before># A context carrying the loaded configuration.
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
import config
class ConfigContext(object):
def __init__(self, config):
self._config = config
self._cloud_workstations = {}
self._vol... | # A context carrying the loaded configuration.
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
import config
class ConfigContext(object):
def __init__(self, config):
self._config = config
self._cloud_workstations = {}
self._volumes = {}
... | # A context carrying the loaded configuration.
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
import config
class ConfigContext(object):
def __init__(self, config):
self._config = config
self._cloud_workstations = {}
self._volumes_by_cws = {... | <commit_before># A context carrying the loaded configuration.
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
import config
class ConfigContext(object):
def __init__(self, config):
self._config = config
self._cloud_workstations = {}
self._vol... |
ab1e27b3b28e0463f6dd182037a265c9f69fb94f | src/azure/cli/commands/resourcegroup.py | src/azure/cli/commands/resourcegroup.py | from msrest import Serializer
from ..commands import command, description
from .._profile import Profile
@command('resource group list')
@description('List resource groups')
# TODO: waiting on Python Azure SDK bug fixes
# @option('--tag-name -g <tagName>', L('the resource group's tag name'))
# @option('--tag-value -g ... | from msrest import Serializer
from ..commands import command, description
from ._command_creation import get_service_client
from .._profile import Profile
@command('resource group list')
@description('List resource groups')
# TODO: waiting on Python Azure SDK bug fixes
# @option('--tag-name -g <tagName>', L('the resou... | Use service client factory method for resource group command | Use service client factory method for resource group command
| Python | mit | samedder/azure-cli,samedder/azure-cli,yugangw-msft/azure-cli,QingChenmsft/azure-cli,QingChenmsft/azure-cli,QingChenmsft/azure-cli,QingChenmsft/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure-cli,BurtBiel/azure-cli,samedder/azure-cli,yugangw-msft/azure-cli,BurtBiel/azure... | from msrest import Serializer
from ..commands import command, description
from .._profile import Profile
@command('resource group list')
@description('List resource groups')
# TODO: waiting on Python Azure SDK bug fixes
# @option('--tag-name -g <tagName>', L('the resource group's tag name'))
# @option('--tag-value -g ... | from msrest import Serializer
from ..commands import command, description
from ._command_creation import get_service_client
from .._profile import Profile
@command('resource group list')
@description('List resource groups')
# TODO: waiting on Python Azure SDK bug fixes
# @option('--tag-name -g <tagName>', L('the resou... | <commit_before>from msrest import Serializer
from ..commands import command, description
from .._profile import Profile
@command('resource group list')
@description('List resource groups')
# TODO: waiting on Python Azure SDK bug fixes
# @option('--tag-name -g <tagName>', L('the resource group's tag name'))
# @option('... | from msrest import Serializer
from ..commands import command, description
from ._command_creation import get_service_client
from .._profile import Profile
@command('resource group list')
@description('List resource groups')
# TODO: waiting on Python Azure SDK bug fixes
# @option('--tag-name -g <tagName>', L('the resou... | from msrest import Serializer
from ..commands import command, description
from .._profile import Profile
@command('resource group list')
@description('List resource groups')
# TODO: waiting on Python Azure SDK bug fixes
# @option('--tag-name -g <tagName>', L('the resource group's tag name'))
# @option('--tag-value -g ... | <commit_before>from msrest import Serializer
from ..commands import command, description
from .._profile import Profile
@command('resource group list')
@description('List resource groups')
# TODO: waiting on Python Azure SDK bug fixes
# @option('--tag-name -g <tagName>', L('the resource group's tag name'))
# @option('... |
65d2a5f08ee96e80752362f7545167888599819e | website/addons/figshare/exceptions.py | website/addons/figshare/exceptions.py | from website.util.sanitize import escape_html
from website.addons.base.exceptions import AddonEnrichmentError
class FigshareIsDraftError(AddonEnrichmentError):
def __init__(self, file_guid):
self.file_guid = file_guid
@property
def renderable_error(self):
return '''
<div class="a... | from website.util.sanitize import escape_html
from website.addons.base.exceptions import AddonEnrichmentError
class FigshareIsDraftError(AddonEnrichmentError):
def __init__(self, file_guid):
self.file_guid = file_guid
@property
def can_delete(self):
return True
@property
def ren... | Allow deletion of figshare drafts | Allow deletion of figshare drafts
| Python | apache-2.0 | zachjanicki/osf.io,DanielSBrown/osf.io,njantrania/osf.io,kushG/osf.io,erinspace/osf.io,GaryKriebel/osf.io,wearpants/osf.io,chrisseto/osf.io,samchrisinger/osf.io,caneruguz/osf.io,petermalcolm/osf.io,doublebits/osf.io,arpitar/osf.io,cldershem/osf.io,Nesiehr/osf.io,amyshi188/osf.io,brandonPurvis/osf.io,mluo613/osf.io,patt... | from website.util.sanitize import escape_html
from website.addons.base.exceptions import AddonEnrichmentError
class FigshareIsDraftError(AddonEnrichmentError):
def __init__(self, file_guid):
self.file_guid = file_guid
@property
def renderable_error(self):
return '''
<div class="a... | from website.util.sanitize import escape_html
from website.addons.base.exceptions import AddonEnrichmentError
class FigshareIsDraftError(AddonEnrichmentError):
def __init__(self, file_guid):
self.file_guid = file_guid
@property
def can_delete(self):
return True
@property
def ren... | <commit_before>from website.util.sanitize import escape_html
from website.addons.base.exceptions import AddonEnrichmentError
class FigshareIsDraftError(AddonEnrichmentError):
def __init__(self, file_guid):
self.file_guid = file_guid
@property
def renderable_error(self):
return '''
... | from website.util.sanitize import escape_html
from website.addons.base.exceptions import AddonEnrichmentError
class FigshareIsDraftError(AddonEnrichmentError):
def __init__(self, file_guid):
self.file_guid = file_guid
@property
def can_delete(self):
return True
@property
def ren... | from website.util.sanitize import escape_html
from website.addons.base.exceptions import AddonEnrichmentError
class FigshareIsDraftError(AddonEnrichmentError):
def __init__(self, file_guid):
self.file_guid = file_guid
@property
def renderable_error(self):
return '''
<div class="a... | <commit_before>from website.util.sanitize import escape_html
from website.addons.base.exceptions import AddonEnrichmentError
class FigshareIsDraftError(AddonEnrichmentError):
def __init__(self, file_guid):
self.file_guid = file_guid
@property
def renderable_error(self):
return '''
... |
e492ffe0e8d57917db6b937523abaabe0ee4ff8e | simplehist/__init__.py | simplehist/__init__.py |
#__all__ = ["hists", "binning"]
from .hists import *
#from .converter import ashist |
#__all__ = ["hists", "binning"]
from .hists import *
from .converter import ashist | Include ashist in the general namespace by default | Include ashist in the general namespace by default
| Python | mit | ndevenish/simplehistogram |
#__all__ = ["hists", "binning"]
from .hists import *
#from .converter import ashistInclude ashist in the general namespace by default |
#__all__ = ["hists", "binning"]
from .hists import *
from .converter import ashist | <commit_before>
#__all__ = ["hists", "binning"]
from .hists import *
#from .converter import ashist<commit_msg>Include ashist in the general namespace by default<commit_after> |
#__all__ = ["hists", "binning"]
from .hists import *
from .converter import ashist |
#__all__ = ["hists", "binning"]
from .hists import *
#from .converter import ashistInclude ashist in the general namespace by default
#__all__ = ["hists", "binning"]
from .hists import *
from .converter import ashist | <commit_before>
#__all__ = ["hists", "binning"]
from .hists import *
#from .converter import ashist<commit_msg>Include ashist in the general namespace by default<commit_after>
#__all__ = ["hists", "binning"]
from .hists import *
from .converter import ashist |
96726f66fb4ac69328e84877ead5adb6c2037e5e | site/cgi/csv-upload.py | site/cgi/csv-upload.py | #!/usr/bin/python
# Based on examples from
# http://www.tutorialspoint.com/python/python_cgi_programming.htm
import sys
import cgi
import os
import cgitb
cgitb.enable()
CSV_DIR = '../csv/' # CSV upload directory
form = cgi.FieldStorage()
fileitem = form['filename'] # Get filename
# Check if the file was uploaded
... | #!/usr/bin/python
# Based on examples from
# http://www.tutorialspoint.com/python/python_cgi_programming.htm
import cgi
import os
import cgitb
cgitb.enable()
CSV_DIR = '../csv/' # CSV upload directory
form = cgi.FieldStorage()
fileitem = form['filename'] # Get filename
# Check if the file was uploaded
if fileitem... | Remove unused modules, fix HTML response | Remove unused modules, fix HTML response
| Python | agpl-3.0 | alejosanchez/CSVBenford,alejosanchez/CSVBenford | #!/usr/bin/python
# Based on examples from
# http://www.tutorialspoint.com/python/python_cgi_programming.htm
import sys
import cgi
import os
import cgitb
cgitb.enable()
CSV_DIR = '../csv/' # CSV upload directory
form = cgi.FieldStorage()
fileitem = form['filename'] # Get filename
# Check if the file was uploaded
... | #!/usr/bin/python
# Based on examples from
# http://www.tutorialspoint.com/python/python_cgi_programming.htm
import cgi
import os
import cgitb
cgitb.enable()
CSV_DIR = '../csv/' # CSV upload directory
form = cgi.FieldStorage()
fileitem = form['filename'] # Get filename
# Check if the file was uploaded
if fileitem... | <commit_before>#!/usr/bin/python
# Based on examples from
# http://www.tutorialspoint.com/python/python_cgi_programming.htm
import sys
import cgi
import os
import cgitb
cgitb.enable()
CSV_DIR = '../csv/' # CSV upload directory
form = cgi.FieldStorage()
fileitem = form['filename'] # Get filename
# Check if the fil... | #!/usr/bin/python
# Based on examples from
# http://www.tutorialspoint.com/python/python_cgi_programming.htm
import cgi
import os
import cgitb
cgitb.enable()
CSV_DIR = '../csv/' # CSV upload directory
form = cgi.FieldStorage()
fileitem = form['filename'] # Get filename
# Check if the file was uploaded
if fileitem... | #!/usr/bin/python
# Based on examples from
# http://www.tutorialspoint.com/python/python_cgi_programming.htm
import sys
import cgi
import os
import cgitb
cgitb.enable()
CSV_DIR = '../csv/' # CSV upload directory
form = cgi.FieldStorage()
fileitem = form['filename'] # Get filename
# Check if the file was uploaded
... | <commit_before>#!/usr/bin/python
# Based on examples from
# http://www.tutorialspoint.com/python/python_cgi_programming.htm
import sys
import cgi
import os
import cgitb
cgitb.enable()
CSV_DIR = '../csv/' # CSV upload directory
form = cgi.FieldStorage()
fileitem = form['filename'] # Get filename
# Check if the fil... |
041d7285b2ec5c6f323c10a4bbfd388c9d1cb216 | skyscanner/__init__.py | skyscanner/__init__.py | # -*- coding: utf-8 -*-
__author__ = 'Ardy Dedase'
__email__ = 'ardy.dedase@skyscanner.net'
__version__ = '0.1.0'
from skyscanner import Flights, FlightsCache, Hotels, CarHire | # -*- coding: utf-8 -*-
__author__ = 'Ardy Dedase'
__email__ = 'ardy.dedase@skyscanner.net'
__version__ = '0.1.0'
from .skyscanner import Flights, FlightsCache, Hotels, CarHire | Make it work with Python 3. | Make it work with Python 3.
| Python | apache-2.0 | valery-barysok/skyscanner-python-sdk,Skyscanner/skyscanner-python-sdk,joesarre/skyscanner-python-sdk | # -*- coding: utf-8 -*-
__author__ = 'Ardy Dedase'
__email__ = 'ardy.dedase@skyscanner.net'
__version__ = '0.1.0'
from skyscanner import Flights, FlightsCache, Hotels, CarHireMake it work with Python 3. | # -*- coding: utf-8 -*-
__author__ = 'Ardy Dedase'
__email__ = 'ardy.dedase@skyscanner.net'
__version__ = '0.1.0'
from .skyscanner import Flights, FlightsCache, Hotels, CarHire | <commit_before># -*- coding: utf-8 -*-
__author__ = 'Ardy Dedase'
__email__ = 'ardy.dedase@skyscanner.net'
__version__ = '0.1.0'
from skyscanner import Flights, FlightsCache, Hotels, CarHire<commit_msg>Make it work with Python 3.<commit_after> | # -*- coding: utf-8 -*-
__author__ = 'Ardy Dedase'
__email__ = 'ardy.dedase@skyscanner.net'
__version__ = '0.1.0'
from .skyscanner import Flights, FlightsCache, Hotels, CarHire | # -*- coding: utf-8 -*-
__author__ = 'Ardy Dedase'
__email__ = 'ardy.dedase@skyscanner.net'
__version__ = '0.1.0'
from skyscanner import Flights, FlightsCache, Hotels, CarHireMake it work with Python 3.# -*- coding: utf-8 -*-
__author__ = 'Ardy Dedase'
__email__ = 'ardy.dedase@skyscanner.net'
__version__ = '0.1.0'
fr... | <commit_before># -*- coding: utf-8 -*-
__author__ = 'Ardy Dedase'
__email__ = 'ardy.dedase@skyscanner.net'
__version__ = '0.1.0'
from skyscanner import Flights, FlightsCache, Hotels, CarHire<commit_msg>Make it work with Python 3.<commit_after># -*- coding: utf-8 -*-
__author__ = 'Ardy Dedase'
__email__ = 'ardy.dedase@... |
cb31dcc7be5e89c865686d9a2a07e8a64c9c0179 | gamernews/apps/threadedcomments/views.py | gamernews/apps/threadedcomments/views.py | from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from django.utils.translation import ugettext as _
from django.views.generic.list import ListView
from core.models import Account as User
from django_c... | from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from django.utils.translation import ugettext as _
from django.views.generic.list import ListView
from core.models import Account as User
from django_c... | Remove name, url and email from comment form | Remove name, url and email from comment form
| Python | mit | underlost/GamerNews,underlost/GamerNews | from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from django.utils.translation import ugettext as _
from django.views.generic.list import ListView
from core.models import Account as User
from django_c... | from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from django.utils.translation import ugettext as _
from django.views.generic.list import ListView
from core.models import Account as User
from django_c... | <commit_before>from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from django.utils.translation import ugettext as _
from django.views.generic.list import ListView
from core.models import Account as Use... | from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from django.utils.translation import ugettext as _
from django.views.generic.list import ListView
from core.models import Account as User
from django_c... | from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from django.utils.translation import ugettext as _
from django.views.generic.list import ListView
from core.models import Account as User
from django_c... | <commit_before>from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from django.utils.translation import ugettext as _
from django.views.generic.list import ListView
from core.models import Account as Use... |
5fd5d32a04615656af03e0c1fa71ca7b81a72b1f | conda_env/installers/conda.py | conda_env/installers/conda.py | from __future__ import absolute_import
import sys
from conda.cli import common
from conda import plan
def install(prefix, specs, args, data):
# TODO: do we need this?
common.check_specs(prefix, specs, json=args.json)
# TODO: support all various ways this happens
index = common.get_index_trap()
a... | from __future__ import absolute_import
import sys
from conda.cli import common
from conda import plan
def install(prefix, specs, args, data):
# TODO: do we need this?
common.check_specs(prefix, specs, json=args.json)
# TODO: support all various ways this happens
index = common.get_index_trap(
... | Add support for channels in the spec | Add support for channels in the spec
| Python | bsd-3-clause | conda/conda-env,ESSS/conda-env,phobson/conda-env,asmeurer/conda-env,nicoddemus/conda-env,mikecroucher/conda-env,conda/conda-env,dan-blanchard/conda-env,isaac-kit/conda-env,isaac-kit/conda-env,mikecroucher/conda-env,ESSS/conda-env,nicoddemus/conda-env,phobson/conda-env,dan-blanchard/conda-env,asmeurer/conda-env | from __future__ import absolute_import
import sys
from conda.cli import common
from conda import plan
def install(prefix, specs, args, data):
# TODO: do we need this?
common.check_specs(prefix, specs, json=args.json)
# TODO: support all various ways this happens
index = common.get_index_trap()
a... | from __future__ import absolute_import
import sys
from conda.cli import common
from conda import plan
def install(prefix, specs, args, data):
# TODO: do we need this?
common.check_specs(prefix, specs, json=args.json)
# TODO: support all various ways this happens
index = common.get_index_trap(
... | <commit_before>from __future__ import absolute_import
import sys
from conda.cli import common
from conda import plan
def install(prefix, specs, args, data):
# TODO: do we need this?
common.check_specs(prefix, specs, json=args.json)
# TODO: support all various ways this happens
index = common.get_ind... | from __future__ import absolute_import
import sys
from conda.cli import common
from conda import plan
def install(prefix, specs, args, data):
# TODO: do we need this?
common.check_specs(prefix, specs, json=args.json)
# TODO: support all various ways this happens
index = common.get_index_trap(
... | from __future__ import absolute_import
import sys
from conda.cli import common
from conda import plan
def install(prefix, specs, args, data):
# TODO: do we need this?
common.check_specs(prefix, specs, json=args.json)
# TODO: support all various ways this happens
index = common.get_index_trap()
a... | <commit_before>from __future__ import absolute_import
import sys
from conda.cli import common
from conda import plan
def install(prefix, specs, args, data):
# TODO: do we need this?
common.check_specs(prefix, specs, json=args.json)
# TODO: support all various ways this happens
index = common.get_ind... |
08da4c91853b14a264ea07fa5314be437fbce9d4 | src/gui/graphscheme.py | src/gui/graphscheme.py | # -*- coding: utf-8 -*-
from PySide import QtGui
class GraphScheme( QtGui.QGraphicsScene):
""" Graph scheme drawing class
This class inherits from QtGui.QGraphicsScene and add functions
for manage GraphBlocks objects in scheme.
"""
def __init__(self ):
super(GraphSc... | # -*- coding: utf-8 -*-
from PySide import QtGui, QtCore
class GraphScheme( QtGui.QGraphicsScene):
""" Graph scheme drawing class
This class inherits from QtGui.QGraphicsScene and add functions
for manage GraphBlocks objects in scheme.
"""
def __init__(self ):
super... | Add gradient background to GraphScheme | Add gradient background to GraphScheme
| Python | lgpl-2.1 | anton-golubkov/Garland,anton-golubkov/Garland | # -*- coding: utf-8 -*-
from PySide import QtGui
class GraphScheme( QtGui.QGraphicsScene):
""" Graph scheme drawing class
This class inherits from QtGui.QGraphicsScene and add functions
for manage GraphBlocks objects in scheme.
"""
def __init__(self ):
super(GraphSc... | # -*- coding: utf-8 -*-
from PySide import QtGui, QtCore
class GraphScheme( QtGui.QGraphicsScene):
""" Graph scheme drawing class
This class inherits from QtGui.QGraphicsScene and add functions
for manage GraphBlocks objects in scheme.
"""
def __init__(self ):
super... | <commit_before># -*- coding: utf-8 -*-
from PySide import QtGui
class GraphScheme( QtGui.QGraphicsScene):
""" Graph scheme drawing class
This class inherits from QtGui.QGraphicsScene and add functions
for manage GraphBlocks objects in scheme.
"""
def __init__(self ):
... | # -*- coding: utf-8 -*-
from PySide import QtGui, QtCore
class GraphScheme( QtGui.QGraphicsScene):
""" Graph scheme drawing class
This class inherits from QtGui.QGraphicsScene and add functions
for manage GraphBlocks objects in scheme.
"""
def __init__(self ):
super... | # -*- coding: utf-8 -*-
from PySide import QtGui
class GraphScheme( QtGui.QGraphicsScene):
""" Graph scheme drawing class
This class inherits from QtGui.QGraphicsScene and add functions
for manage GraphBlocks objects in scheme.
"""
def __init__(self ):
super(GraphSc... | <commit_before># -*- coding: utf-8 -*-
from PySide import QtGui
class GraphScheme( QtGui.QGraphicsScene):
""" Graph scheme drawing class
This class inherits from QtGui.QGraphicsScene and add functions
for manage GraphBlocks objects in scheme.
"""
def __init__(self ):
... |
c5742bb27aa8446cb5b4c491df6be9c733a1408f | unitary/examples/tictactoe/enums.py | unitary/examples/tictactoe/enums.py | # Copyright 2022 Google
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | # Copyright 2022 Google
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | Add enum for different rulesets | Add enum for different rulesets
| Python | apache-2.0 | quantumlib/unitary,quantumlib/unitary | # Copyright 2022 Google
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | # Copyright 2022 Google
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | <commit_before># Copyright 2022 Google
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | # Copyright 2022 Google
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | # Copyright 2022 Google
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | <commit_before># Copyright 2022 Google
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
1dfb9fd979206af415e20fc58b905c435a187008 | app/soc/models/grading_project_survey.py | app/soc/models/grading_project_survey.py | #!/usr/bin/python2.5
#
# Copyright 2009 the Melange authors.
#
# 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... | #!/usr/bin/python2.5
#
# Copyright 2009 the Melange authors.
#
# 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... | Set default taking access for GradingProjectSurvey to org. | Set default taking access for GradingProjectSurvey to org.
This will allow Mentors and Org Admins to take GradingProjectSurveys in case that an Org Admin has no Mentor roles.
| Python | apache-2.0 | MatthewWilkes/mw4068-packaging,MatthewWilkes/mw4068-packaging,MatthewWilkes/mw4068-packaging,MatthewWilkes/mw4068-packaging | #!/usr/bin/python2.5
#
# Copyright 2009 the Melange authors.
#
# 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... | #!/usr/bin/python2.5
#
# Copyright 2009 the Melange authors.
#
# 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... | <commit_before>#!/usr/bin/python2.5
#
# Copyright 2009 the Melange authors.
#
# 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 require... | #!/usr/bin/python2.5
#
# Copyright 2009 the Melange authors.
#
# 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... | #!/usr/bin/python2.5
#
# Copyright 2009 the Melange authors.
#
# 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... | <commit_before>#!/usr/bin/python2.5
#
# Copyright 2009 the Melange authors.
#
# 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 require... |
ee37119a4f77eef5c8163936d982e178c42cbc00 | src/adhocracy/lib/machine_name.py | src/adhocracy/lib/machine_name.py |
import platform
class IncludeMachineName(object):
def __init__(self, app, config):
self.app = app
self.config = config
def __call__(self, environ, start_response):
def local_response(status, headers, exc_info=None):
headers.append(('X-Server-Machine', platform.node()))
... |
import os
import platform
class IncludeMachineName(object):
def __init__(self, app, config):
self.app = app
self.config = config
def __call__(self, environ, start_response):
def local_response(status, headers, exc_info=None):
machine_id = '%s:%s (PID %d)' % (
... | Add Server Port and PID to the X-Server-Machine header | Add Server Port and PID to the X-Server-Machine header
Fixes hhucn/adhocracy.hhu_theme#429
| Python | agpl-3.0 | liqd/adhocracy,liqd/adhocracy,DanielNeugebauer/adhocracy,DanielNeugebauer/adhocracy,alkadis/vcv,liqd/adhocracy,alkadis/vcv,phihag/adhocracy,alkadis/vcv,DanielNeugebauer/adhocracy,phihag/adhocracy,liqd/adhocracy,phihag/adhocracy,phihag/adhocracy,alkadis/vcv,phihag/adhocracy,alkadis/vcv,DanielNeugebauer/adhocracy,DanielN... |
import platform
class IncludeMachineName(object):
def __init__(self, app, config):
self.app = app
self.config = config
def __call__(self, environ, start_response):
def local_response(status, headers, exc_info=None):
headers.append(('X-Server-Machine', platform.node()))
... |
import os
import platform
class IncludeMachineName(object):
def __init__(self, app, config):
self.app = app
self.config = config
def __call__(self, environ, start_response):
def local_response(status, headers, exc_info=None):
machine_id = '%s:%s (PID %d)' % (
... | <commit_before>
import platform
class IncludeMachineName(object):
def __init__(self, app, config):
self.app = app
self.config = config
def __call__(self, environ, start_response):
def local_response(status, headers, exc_info=None):
headers.append(('X-Server-Machine', plat... |
import os
import platform
class IncludeMachineName(object):
def __init__(self, app, config):
self.app = app
self.config = config
def __call__(self, environ, start_response):
def local_response(status, headers, exc_info=None):
machine_id = '%s:%s (PID %d)' % (
... |
import platform
class IncludeMachineName(object):
def __init__(self, app, config):
self.app = app
self.config = config
def __call__(self, environ, start_response):
def local_response(status, headers, exc_info=None):
headers.append(('X-Server-Machine', platform.node()))
... | <commit_before>
import platform
class IncludeMachineName(object):
def __init__(self, app, config):
self.app = app
self.config = config
def __call__(self, environ, start_response):
def local_response(status, headers, exc_info=None):
headers.append(('X-Server-Machine', plat... |
60c4534b1d375aecfe39948e27bc06d0f34907f3 | bioagents/resources/trips_ont_manager.py | bioagents/resources/trips_ont_manager.py | import os
from indra.preassembler.hierarchy_manager import HierarchyManager
# Make a TRIPS ontology
_fname = os.path.join(os.path.dirname(__file__), 'trips_ontology.rdf')
trips_ontology = HierarchyManager(_fname, uri_as_name=False)
trips_ontology.relations_prefix = 'http://trips.ihmc.us/relations/'
trips_ontology.init... | import os
from indra.preassembler.hierarchy_manager import HierarchyManager
# Make a TRIPS ontology
_fname = os.path.join(os.path.dirname(__file__), 'trips_ontology.rdf')
trips_ontology = HierarchyManager(_fname, uri_as_name=False, build_closure=True)
trips_ontology.relations_prefix = 'http://trips.ihmc.us/relations/'... | Build closure for TRIPS ontology | Build closure for TRIPS ontology
| Python | bsd-2-clause | sorgerlab/bioagents,bgyori/bioagents | import os
from indra.preassembler.hierarchy_manager import HierarchyManager
# Make a TRIPS ontology
_fname = os.path.join(os.path.dirname(__file__), 'trips_ontology.rdf')
trips_ontology = HierarchyManager(_fname, uri_as_name=False)
trips_ontology.relations_prefix = 'http://trips.ihmc.us/relations/'
trips_ontology.init... | import os
from indra.preassembler.hierarchy_manager import HierarchyManager
# Make a TRIPS ontology
_fname = os.path.join(os.path.dirname(__file__), 'trips_ontology.rdf')
trips_ontology = HierarchyManager(_fname, uri_as_name=False, build_closure=True)
trips_ontology.relations_prefix = 'http://trips.ihmc.us/relations/'... | <commit_before>import os
from indra.preassembler.hierarchy_manager import HierarchyManager
# Make a TRIPS ontology
_fname = os.path.join(os.path.dirname(__file__), 'trips_ontology.rdf')
trips_ontology = HierarchyManager(_fname, uri_as_name=False)
trips_ontology.relations_prefix = 'http://trips.ihmc.us/relations/'
trip... | import os
from indra.preassembler.hierarchy_manager import HierarchyManager
# Make a TRIPS ontology
_fname = os.path.join(os.path.dirname(__file__), 'trips_ontology.rdf')
trips_ontology = HierarchyManager(_fname, uri_as_name=False, build_closure=True)
trips_ontology.relations_prefix = 'http://trips.ihmc.us/relations/'... | import os
from indra.preassembler.hierarchy_manager import HierarchyManager
# Make a TRIPS ontology
_fname = os.path.join(os.path.dirname(__file__), 'trips_ontology.rdf')
trips_ontology = HierarchyManager(_fname, uri_as_name=False)
trips_ontology.relations_prefix = 'http://trips.ihmc.us/relations/'
trips_ontology.init... | <commit_before>import os
from indra.preassembler.hierarchy_manager import HierarchyManager
# Make a TRIPS ontology
_fname = os.path.join(os.path.dirname(__file__), 'trips_ontology.rdf')
trips_ontology = HierarchyManager(_fname, uri_as_name=False)
trips_ontology.relations_prefix = 'http://trips.ihmc.us/relations/'
trip... |
89e2991109447893b06edf363f223c64e9cafb61 | query_result_list.py | query_result_list.py | from query_result_document import QueryResultDocument
class QueryResultList:
def __init__(self, query, result_documents = []):
self.result_documents = result_documents # Guaranteed to be in rank order
self.query = query
def add( self, rank, document ):
self.result_documents.insert( int(rank) - 1, Que... | from query_result_document import QueryResultDocument
class QueryResultList:
def __init__(self, query):
self.result_documents = [] # Guaranteed to be in rank order
self.query = query
def add( self, rank, document ):
self.result_documents.insert( int(rank) - 1, QueryResultDocument( self, rank, documen... | Fix query result list having an empty list default parameter (default parameters get initialized only once!) | Fix query result list having an empty list default parameter (default parameters get initialized only once!)
| Python | mit | fire-uta/iiix-data-parser | from query_result_document import QueryResultDocument
class QueryResultList:
def __init__(self, query, result_documents = []):
self.result_documents = result_documents # Guaranteed to be in rank order
self.query = query
def add( self, rank, document ):
self.result_documents.insert( int(rank) - 1, Que... | from query_result_document import QueryResultDocument
class QueryResultList:
def __init__(self, query):
self.result_documents = [] # Guaranteed to be in rank order
self.query = query
def add( self, rank, document ):
self.result_documents.insert( int(rank) - 1, QueryResultDocument( self, rank, documen... | <commit_before>from query_result_document import QueryResultDocument
class QueryResultList:
def __init__(self, query, result_documents = []):
self.result_documents = result_documents # Guaranteed to be in rank order
self.query = query
def add( self, rank, document ):
self.result_documents.insert( int... | from query_result_document import QueryResultDocument
class QueryResultList:
def __init__(self, query):
self.result_documents = [] # Guaranteed to be in rank order
self.query = query
def add( self, rank, document ):
self.result_documents.insert( int(rank) - 1, QueryResultDocument( self, rank, documen... | from query_result_document import QueryResultDocument
class QueryResultList:
def __init__(self, query, result_documents = []):
self.result_documents = result_documents # Guaranteed to be in rank order
self.query = query
def add( self, rank, document ):
self.result_documents.insert( int(rank) - 1, Que... | <commit_before>from query_result_document import QueryResultDocument
class QueryResultList:
def __init__(self, query, result_documents = []):
self.result_documents = result_documents # Guaranteed to be in rank order
self.query = query
def add( self, rank, document ):
self.result_documents.insert( int... |
74a944c47432f707bb8cf6cde421e4927eeeaebb | lib/cretonne/meta/isa/riscv/__init__.py | lib/cretonne/meta/isa/riscv/__init__.py | """
RISC-V Target
-------------
`RISC-V <http://riscv.org/>`_ is an open instruction set architecture
originally developed at UC Berkeley. It is a RISC-style ISA with either a
32-bit (RV32I) or 64-bit (RV32I) base instruction set and a number of optional
extensions:
RV32M / RV64M
Integer multiplication and divisi... | """
RISC-V Target
-------------
`RISC-V <https://riscv.org/>`_ is an open instruction set architecture
originally developed at UC Berkeley. It is a RISC-style ISA with either a
32-bit (RV32I) or 64-bit (RV32I) base instruction set and a number of optional
extensions:
RV32M / RV64M
Integer multiplication and divis... | Use an https URL rather than http. | Use an https URL rather than http.
Found by sphinx's linkcheck.
| Python | apache-2.0 | sunfishcode/cretonne,stoklund/cretonne,stoklund/cretonne,stoklund/cretonne,sunfishcode/cretonne,sunfishcode/cretonne | """
RISC-V Target
-------------
`RISC-V <http://riscv.org/>`_ is an open instruction set architecture
originally developed at UC Berkeley. It is a RISC-style ISA with either a
32-bit (RV32I) or 64-bit (RV32I) base instruction set and a number of optional
extensions:
RV32M / RV64M
Integer multiplication and divisi... | """
RISC-V Target
-------------
`RISC-V <https://riscv.org/>`_ is an open instruction set architecture
originally developed at UC Berkeley. It is a RISC-style ISA with either a
32-bit (RV32I) or 64-bit (RV32I) base instruction set and a number of optional
extensions:
RV32M / RV64M
Integer multiplication and divis... | <commit_before>"""
RISC-V Target
-------------
`RISC-V <http://riscv.org/>`_ is an open instruction set architecture
originally developed at UC Berkeley. It is a RISC-style ISA with either a
32-bit (RV32I) or 64-bit (RV32I) base instruction set and a number of optional
extensions:
RV32M / RV64M
Integer multiplica... | """
RISC-V Target
-------------
`RISC-V <https://riscv.org/>`_ is an open instruction set architecture
originally developed at UC Berkeley. It is a RISC-style ISA with either a
32-bit (RV32I) or 64-bit (RV32I) base instruction set and a number of optional
extensions:
RV32M / RV64M
Integer multiplication and divis... | """
RISC-V Target
-------------
`RISC-V <http://riscv.org/>`_ is an open instruction set architecture
originally developed at UC Berkeley. It is a RISC-style ISA with either a
32-bit (RV32I) or 64-bit (RV32I) base instruction set and a number of optional
extensions:
RV32M / RV64M
Integer multiplication and divisi... | <commit_before>"""
RISC-V Target
-------------
`RISC-V <http://riscv.org/>`_ is an open instruction set architecture
originally developed at UC Berkeley. It is a RISC-style ISA with either a
32-bit (RV32I) or 64-bit (RV32I) base instruction set and a number of optional
extensions:
RV32M / RV64M
Integer multiplica... |
660e38254788f4eae8bb970d4949e93739374383 | src/stratisd_client_dbus/_connection.py | src/stratisd_client_dbus/_connection.py | # Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | # Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | Change to connect to Stratisd on the system bus | Change to connect to Stratisd on the system bus
Stratisd is changing to use the system bus, so naturally we need to
also change in order to continue working.
Signed-off-by: Andy Grover <b7d524d2f5cc5aebadb6b92b08d3ab26911cde33@redhat.com>
| Python | mpl-2.0 | trgill/stratisd,trgill/stratisd,stratis-storage/stratisd,stratis-storage/stratisd-client-dbus,mulkieran/stratisd,stratis-storage/stratisd,stratis-storage/stratisd,mulkieran/stratisd | # Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | # Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | <commit_before># Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | # Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | # Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | <commit_before># Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
015bc46057db405107799d7214b0fe5264843277 | run_deploy_job_wr.py | run_deploy_job_wr.py | #!/usr/bin/env python
import json
import os
import subprocess
import sys
from tempfile import NamedTemporaryFile
def main():
revision_build = os.environ['revision_build']
job_name = os.environ['JOB_NAME']
build_number = os.environ['BUILD_NUMBER']
prefix='juju-ci/products/version-{}/{}/build-{}'.format... | #!/usr/bin/env python
import json
import os
from os.path import join
import subprocess
import sys
from tempfile import NamedTemporaryFile
def main():
revision_build = os.environ['revision_build']
job_name = os.environ['JOB_NAME']
build_number = os.environ['BUILD_NUMBER']
prefix='juju-ci/products/versi... | Fix artifact spec for deploy-job. | Fix artifact spec for deploy-job. | Python | agpl-3.0 | mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju | #!/usr/bin/env python
import json
import os
import subprocess
import sys
from tempfile import NamedTemporaryFile
def main():
revision_build = os.environ['revision_build']
job_name = os.environ['JOB_NAME']
build_number = os.environ['BUILD_NUMBER']
prefix='juju-ci/products/version-{}/{}/build-{}'.format... | #!/usr/bin/env python
import json
import os
from os.path import join
import subprocess
import sys
from tempfile import NamedTemporaryFile
def main():
revision_build = os.environ['revision_build']
job_name = os.environ['JOB_NAME']
build_number = os.environ['BUILD_NUMBER']
prefix='juju-ci/products/versi... | <commit_before>#!/usr/bin/env python
import json
import os
import subprocess
import sys
from tempfile import NamedTemporaryFile
def main():
revision_build = os.environ['revision_build']
job_name = os.environ['JOB_NAME']
build_number = os.environ['BUILD_NUMBER']
prefix='juju-ci/products/version-{}/{}/b... | #!/usr/bin/env python
import json
import os
from os.path import join
import subprocess
import sys
from tempfile import NamedTemporaryFile
def main():
revision_build = os.environ['revision_build']
job_name = os.environ['JOB_NAME']
build_number = os.environ['BUILD_NUMBER']
prefix='juju-ci/products/versi... | #!/usr/bin/env python
import json
import os
import subprocess
import sys
from tempfile import NamedTemporaryFile
def main():
revision_build = os.environ['revision_build']
job_name = os.environ['JOB_NAME']
build_number = os.environ['BUILD_NUMBER']
prefix='juju-ci/products/version-{}/{}/build-{}'.format... | <commit_before>#!/usr/bin/env python
import json
import os
import subprocess
import sys
from tempfile import NamedTemporaryFile
def main():
revision_build = os.environ['revision_build']
job_name = os.environ['JOB_NAME']
build_number = os.environ['BUILD_NUMBER']
prefix='juju-ci/products/version-{}/{}/b... |
78f8634ac7ae959cfc7f34188ce4f56156922dcb | pkgpanda/integration-tests/test_fetch.py | pkgpanda/integration-tests/test_fetch.py | import os
from pkgpanda.util import expect_fs
from util import run
fetch_output = """\rFetching: mesos--0.22.0\rFetched: mesos--0.22.0\n"""
def test_fetch(tmpdir):
# NOTE: tmpdir is explicitly empty because we want to be sure a fetch.
# succeeds when there isn't anything yet.
# Start a simpleHTTPServer ... | import os
from pkgpanda.util import expect_fs
from util import run
fetch_output = """\rFetching: mesos--0.22.0\rFetched: mesos--0.22.0\n"""
def test_fetch(tmpdir):
# NOTE: tmpdir is explicitly empty because we want to be sure a fetch.
# succeeds when there isn't anything yet.
# Start a simpleHTTPServer ... | Add integration test for `pkgpanda add` | Add integration test for `pkgpanda add`
| Python | apache-2.0 | mesosphere-mergebot/dcos,vishnu2kmohan/dcos,xinxian0458/dcos,GoelDeepak/dcos,jeid64/dcos,mesosphere-mergebot/dcos,kensipe/dcos,lingmann/dcos,surdy/dcos,mesosphere-mergebot/mergebot-test-dcos,amitaekbote/dcos,amitaekbote/dcos,mnaboka/dcos,surdy/dcos,lingmann/dcos,amitaekbote/dcos,vishnu2kmohan/dcos,jeid64/dcos,mesospher... | import os
from pkgpanda.util import expect_fs
from util import run
fetch_output = """\rFetching: mesos--0.22.0\rFetched: mesos--0.22.0\n"""
def test_fetch(tmpdir):
# NOTE: tmpdir is explicitly empty because we want to be sure a fetch.
# succeeds when there isn't anything yet.
# Start a simpleHTTPServer ... | import os
from pkgpanda.util import expect_fs
from util import run
fetch_output = """\rFetching: mesos--0.22.0\rFetched: mesos--0.22.0\n"""
def test_fetch(tmpdir):
# NOTE: tmpdir is explicitly empty because we want to be sure a fetch.
# succeeds when there isn't anything yet.
# Start a simpleHTTPServer ... | <commit_before>import os
from pkgpanda.util import expect_fs
from util import run
fetch_output = """\rFetching: mesos--0.22.0\rFetched: mesos--0.22.0\n"""
def test_fetch(tmpdir):
# NOTE: tmpdir is explicitly empty because we want to be sure a fetch.
# succeeds when there isn't anything yet.
# Start a si... | import os
from pkgpanda.util import expect_fs
from util import run
fetch_output = """\rFetching: mesos--0.22.0\rFetched: mesos--0.22.0\n"""
def test_fetch(tmpdir):
# NOTE: tmpdir is explicitly empty because we want to be sure a fetch.
# succeeds when there isn't anything yet.
# Start a simpleHTTPServer ... | import os
from pkgpanda.util import expect_fs
from util import run
fetch_output = """\rFetching: mesos--0.22.0\rFetched: mesos--0.22.0\n"""
def test_fetch(tmpdir):
# NOTE: tmpdir is explicitly empty because we want to be sure a fetch.
# succeeds when there isn't anything yet.
# Start a simpleHTTPServer ... | <commit_before>import os
from pkgpanda.util import expect_fs
from util import run
fetch_output = """\rFetching: mesos--0.22.0\rFetched: mesos--0.22.0\n"""
def test_fetch(tmpdir):
# NOTE: tmpdir is explicitly empty because we want to be sure a fetch.
# succeeds when there isn't anything yet.
# Start a si... |
f1e5e2cc7fd35e0446f105d619dc01d3ba837865 | byceps/blueprints/admin/party/forms.py | byceps/blueprints/admin/party/forms.py | """
byceps.blueprints.admin.party.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from wtforms import BooleanField, DateTimeField, IntegerField, StringField
from wtforms.validators import InputRequired, Length, Optional
from ..... | """
byceps.blueprints.admin.party.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from wtforms import BooleanField, DateTimeField, IntegerField, StringField
from wtforms.validators import InputRequired, Length, Optional
from ..... | Introduce base party form, limit `archived` flag to update form | Introduce base party form, limit `archived` flag to update form
| Python | bsd-3-clause | m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps,m-ober/byceps | """
byceps.blueprints.admin.party.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from wtforms import BooleanField, DateTimeField, IntegerField, StringField
from wtforms.validators import InputRequired, Length, Optional
from ..... | """
byceps.blueprints.admin.party.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from wtforms import BooleanField, DateTimeField, IntegerField, StringField
from wtforms.validators import InputRequired, Length, Optional
from ..... | <commit_before>"""
byceps.blueprints.admin.party.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from wtforms import BooleanField, DateTimeField, IntegerField, StringField
from wtforms.validators import InputRequired, Length, Op... | """
byceps.blueprints.admin.party.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from wtforms import BooleanField, DateTimeField, IntegerField, StringField
from wtforms.validators import InputRequired, Length, Optional
from ..... | """
byceps.blueprints.admin.party.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from wtforms import BooleanField, DateTimeField, IntegerField, StringField
from wtforms.validators import InputRequired, Length, Optional
from ..... | <commit_before>"""
byceps.blueprints.admin.party.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from wtforms import BooleanField, DateTimeField, IntegerField, StringField
from wtforms.validators import InputRequired, Length, Op... |
f9a0b8395adcf70c23c975a06e7667d673f74ac5 | stoneridge_uploader.py | stoneridge_uploader.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import glob
import os
import requests
import stoneridge
class StoneRidgeUploader(object):
""... | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import glob
import os
import requests
import stoneridge
class StoneRidgeUploader(object):
""... | Fix uploader when there is nothing to upload | Fix uploader when there is nothing to upload
| Python | mpl-2.0 | mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import glob
import os
import requests
import stoneridge
class StoneRidgeUploader(object):
""... | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import glob
import os
import requests
import stoneridge
class StoneRidgeUploader(object):
""... | <commit_before>#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import glob
import os
import requests
import stoneridge
class StoneRidgeUploader(... | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import glob
import os
import requests
import stoneridge
class StoneRidgeUploader(object):
""... | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import glob
import os
import requests
import stoneridge
class StoneRidgeUploader(object):
""... | <commit_before>#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import glob
import os
import requests
import stoneridge
class StoneRidgeUploader(... |
32d7921de5768fd74983ebff6fa37212aed24e83 | all/shellenv/_win.py | all/shellenv/_win.py | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import os
import locale
from ._types import str_cls
_sys_encoding = locale.getpreferredencoding()
def get_env(shell=None):
"""
Return environment variables for the current user
:param shell:
The... | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import os
import locale
import sys
import ctypes
from ._types import str_cls
_sys_encoding = locale.getpreferredencoding()
kernel32 = ctypes.windll.kernel32
kernel32.GetEnvironmentStringsW.argtypes = []
kernel32.Get... | Use kernel32 with ST2 on Windows to get unicode environmental variable values | Use kernel32 with ST2 on Windows to get unicode environmental variable values
| Python | mit | codexns/shellenv | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import os
import locale
from ._types import str_cls
_sys_encoding = locale.getpreferredencoding()
def get_env(shell=None):
"""
Return environment variables for the current user
:param shell:
The... | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import os
import locale
import sys
import ctypes
from ._types import str_cls
_sys_encoding = locale.getpreferredencoding()
kernel32 = ctypes.windll.kernel32
kernel32.GetEnvironmentStringsW.argtypes = []
kernel32.Get... | <commit_before># coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import os
import locale
from ._types import str_cls
_sys_encoding = locale.getpreferredencoding()
def get_env(shell=None):
"""
Return environment variables for the current user
:param she... | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import os
import locale
import sys
import ctypes
from ._types import str_cls
_sys_encoding = locale.getpreferredencoding()
kernel32 = ctypes.windll.kernel32
kernel32.GetEnvironmentStringsW.argtypes = []
kernel32.Get... | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import os
import locale
from ._types import str_cls
_sys_encoding = locale.getpreferredencoding()
def get_env(shell=None):
"""
Return environment variables for the current user
:param shell:
The... | <commit_before># coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import os
import locale
from ._types import str_cls
_sys_encoding = locale.getpreferredencoding()
def get_env(shell=None):
"""
Return environment variables for the current user
:param she... |
59fc12548422ecaa861f810d0e40b631801e2de0 | interface/backend/static/tests.py | interface/backend/static/tests.py | from django.test import TestCase
from django.urls import reverse
class SmokeTest(TestCase):
def test_landing(self):
url = reverse('static:home')
resp = self.client.get(url)
self.assertContains(resp, 'Concept to Clinic')
self.assertEqual(resp.status_code, 200)
| from django.test import TestCase
from django.urls import reverse
class SmokeTest(TestCase):
def test_landing(self):
url = reverse('static:open_image')
resp = self.client.get(url)
self.assertContains(resp, 'Concept to Clinic')
self.assertEqual(resp.status_code, 200)
| Fix failing test caused by view rename | Fix failing test caused by view rename
| Python | mit | vessemer/concept-to-clinic,antonow/concept-to-clinic,antonow/concept-to-clinic,antonow/concept-to-clinic,antonow/concept-to-clinic,vessemer/concept-to-clinic,vessemer/concept-to-clinic,vessemer/concept-to-clinic | from django.test import TestCase
from django.urls import reverse
class SmokeTest(TestCase):
def test_landing(self):
url = reverse('static:home')
resp = self.client.get(url)
self.assertContains(resp, 'Concept to Clinic')
self.assertEqual(resp.status_code, 200)
Fix failing test cause... | from django.test import TestCase
from django.urls import reverse
class SmokeTest(TestCase):
def test_landing(self):
url = reverse('static:open_image')
resp = self.client.get(url)
self.assertContains(resp, 'Concept to Clinic')
self.assertEqual(resp.status_code, 200)
| <commit_before>from django.test import TestCase
from django.urls import reverse
class SmokeTest(TestCase):
def test_landing(self):
url = reverse('static:home')
resp = self.client.get(url)
self.assertContains(resp, 'Concept to Clinic')
self.assertEqual(resp.status_code, 200)
<commit... | from django.test import TestCase
from django.urls import reverse
class SmokeTest(TestCase):
def test_landing(self):
url = reverse('static:open_image')
resp = self.client.get(url)
self.assertContains(resp, 'Concept to Clinic')
self.assertEqual(resp.status_code, 200)
| from django.test import TestCase
from django.urls import reverse
class SmokeTest(TestCase):
def test_landing(self):
url = reverse('static:home')
resp = self.client.get(url)
self.assertContains(resp, 'Concept to Clinic')
self.assertEqual(resp.status_code, 200)
Fix failing test cause... | <commit_before>from django.test import TestCase
from django.urls import reverse
class SmokeTest(TestCase):
def test_landing(self):
url = reverse('static:home')
resp = self.client.get(url)
self.assertContains(resp, 'Concept to Clinic')
self.assertEqual(resp.status_code, 200)
<commit... |
f4aad7a704628e2ecdbc2222e71998bb71cf37ec | wake.py | wake.py | from been.couch import CouchStore
from flask import Flask, render_template
app = Flask(__name__)
app.jinja_env.trim_blocks = True
store = CouchStore()
store.load()
@app.route('/')
def wake():
return render_template('stream.html', events=store.events())
if __name__ == '__main__':
app.run(debug=True)
| #!/usr/bin/env python
from been.couch import CouchStore
from flask import Flask, render_template
app = Flask(__name__)
app.jinja_env.trim_blocks = True
store = CouchStore()
store.load()
@app.route('/')
def wake():
return render_template('stream.html', events=store.events())
if __name__ == '__main__':
app.ru... | Add shebang to main script. | Add shebang to main script.
| Python | bsd-3-clause | chromakode/wake | from been.couch import CouchStore
from flask import Flask, render_template
app = Flask(__name__)
app.jinja_env.trim_blocks = True
store = CouchStore()
store.load()
@app.route('/')
def wake():
return render_template('stream.html', events=store.events())
if __name__ == '__main__':
app.run(debug=True)
Add sheb... | #!/usr/bin/env python
from been.couch import CouchStore
from flask import Flask, render_template
app = Flask(__name__)
app.jinja_env.trim_blocks = True
store = CouchStore()
store.load()
@app.route('/')
def wake():
return render_template('stream.html', events=store.events())
if __name__ == '__main__':
app.ru... | <commit_before>from been.couch import CouchStore
from flask import Flask, render_template
app = Flask(__name__)
app.jinja_env.trim_blocks = True
store = CouchStore()
store.load()
@app.route('/')
def wake():
return render_template('stream.html', events=store.events())
if __name__ == '__main__':
app.run(debug... | #!/usr/bin/env python
from been.couch import CouchStore
from flask import Flask, render_template
app = Flask(__name__)
app.jinja_env.trim_blocks = True
store = CouchStore()
store.load()
@app.route('/')
def wake():
return render_template('stream.html', events=store.events())
if __name__ == '__main__':
app.ru... | from been.couch import CouchStore
from flask import Flask, render_template
app = Flask(__name__)
app.jinja_env.trim_blocks = True
store = CouchStore()
store.load()
@app.route('/')
def wake():
return render_template('stream.html', events=store.events())
if __name__ == '__main__':
app.run(debug=True)
Add sheb... | <commit_before>from been.couch import CouchStore
from flask import Flask, render_template
app = Flask(__name__)
app.jinja_env.trim_blocks = True
store = CouchStore()
store.load()
@app.route('/')
def wake():
return render_template('stream.html', events=store.events())
if __name__ == '__main__':
app.run(debug... |
3eaf93f2ecee68fafa1ff4f75d4c6e7f09a37043 | api/streams/views.py | api/streams/views.py | from api.streams.models import StreamConfiguration
from django.http import JsonResponse
from django.http.request import HttpRequest
import requests
def get_stream_status(request: HttpRequest, stream_slug: str):
stream = StreamConfiguration.objects.get(slug=stream_slug)
r = requests.get('http://{stream.host}:{... | from api.streams.models import StreamConfiguration
from django.http import JsonResponse
from django.http.request import HttpRequest
import requests
def get_stream_status(request: HttpRequest, stream_slug: str):
stream = StreamConfiguration.objects.get(slug=stream_slug)
r = requests.get('http://{stream.host}:{... | Add timeout to Icecast status request | Add timeout to Icecast status request
| Python | mit | urfonline/api,urfonline/api,urfonline/api | from api.streams.models import StreamConfiguration
from django.http import JsonResponse
from django.http.request import HttpRequest
import requests
def get_stream_status(request: HttpRequest, stream_slug: str):
stream = StreamConfiguration.objects.get(slug=stream_slug)
r = requests.get('http://{stream.host}:{... | from api.streams.models import StreamConfiguration
from django.http import JsonResponse
from django.http.request import HttpRequest
import requests
def get_stream_status(request: HttpRequest, stream_slug: str):
stream = StreamConfiguration.objects.get(slug=stream_slug)
r = requests.get('http://{stream.host}:{... | <commit_before>from api.streams.models import StreamConfiguration
from django.http import JsonResponse
from django.http.request import HttpRequest
import requests
def get_stream_status(request: HttpRequest, stream_slug: str):
stream = StreamConfiguration.objects.get(slug=stream_slug)
r = requests.get('http://... | from api.streams.models import StreamConfiguration
from django.http import JsonResponse
from django.http.request import HttpRequest
import requests
def get_stream_status(request: HttpRequest, stream_slug: str):
stream = StreamConfiguration.objects.get(slug=stream_slug)
r = requests.get('http://{stream.host}:{... | from api.streams.models import StreamConfiguration
from django.http import JsonResponse
from django.http.request import HttpRequest
import requests
def get_stream_status(request: HttpRequest, stream_slug: str):
stream = StreamConfiguration.objects.get(slug=stream_slug)
r = requests.get('http://{stream.host}:{... | <commit_before>from api.streams.models import StreamConfiguration
from django.http import JsonResponse
from django.http.request import HttpRequest
import requests
def get_stream_status(request: HttpRequest, stream_slug: str):
stream = StreamConfiguration.objects.get(slug=stream_slug)
r = requests.get('http://... |
5f05c1f6e06594328a2b328f6b995288707f593c | src/winton_kafka_streams/kafka_stream.py | src/winton_kafka_streams/kafka_stream.py | """
Primary entrypoint for applications wishing to implement Python Kafka Streams
"""
import logging
import confluent_kafka as kafka
log = logging.getLogger(__name__)
class KafkaStream(object):
"""
Encapsulates stream graph processing units
"""
def __init__(self, topology, kafka_config):
... | """
Primary entrypoint for applications wishing to implement Python Kafka Streams
"""
import logging
import confluent_kafka as kafka
log = logging.getLogger(__name__)
class KafkaStream(object):
"""
Encapsulates stream graph processing units
"""
def __init__(self, topology, kafka_config):
... | Handle None returned from poll() | Handle None returned from poll()
| Python | apache-2.0 | wintoncode/winton-kafka-streams | """
Primary entrypoint for applications wishing to implement Python Kafka Streams
"""
import logging
import confluent_kafka as kafka
log = logging.getLogger(__name__)
class KafkaStream(object):
"""
Encapsulates stream graph processing units
"""
def __init__(self, topology, kafka_config):
... | """
Primary entrypoint for applications wishing to implement Python Kafka Streams
"""
import logging
import confluent_kafka as kafka
log = logging.getLogger(__name__)
class KafkaStream(object):
"""
Encapsulates stream graph processing units
"""
def __init__(self, topology, kafka_config):
... | <commit_before>"""
Primary entrypoint for applications wishing to implement Python Kafka Streams
"""
import logging
import confluent_kafka as kafka
log = logging.getLogger(__name__)
class KafkaStream(object):
"""
Encapsulates stream graph processing units
"""
def __init__(self, topology, kafka_co... | """
Primary entrypoint for applications wishing to implement Python Kafka Streams
"""
import logging
import confluent_kafka as kafka
log = logging.getLogger(__name__)
class KafkaStream(object):
"""
Encapsulates stream graph processing units
"""
def __init__(self, topology, kafka_config):
... | """
Primary entrypoint for applications wishing to implement Python Kafka Streams
"""
import logging
import confluent_kafka as kafka
log = logging.getLogger(__name__)
class KafkaStream(object):
"""
Encapsulates stream graph processing units
"""
def __init__(self, topology, kafka_config):
... | <commit_before>"""
Primary entrypoint for applications wishing to implement Python Kafka Streams
"""
import logging
import confluent_kafka as kafka
log = logging.getLogger(__name__)
class KafkaStream(object):
"""
Encapsulates stream graph processing units
"""
def __init__(self, topology, kafka_co... |
6adc30c9db58b2372c3d38f516f39faee3b87393 | tests/test_settings.py | tests/test_settings.py | from __future__ import unicode_literals
from os.path import dirname
MIU_TEST_ROOT = dirname(__file__)
INSTALLED_APPS = [
"django.contrib.auth",
"django.contrib.contenttypes",
"markitup",
"tests",
"tests.test_migration",
]
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlit... | from __future__ import unicode_literals
from os.path import dirname, abspath, join
BASE_DIR = dirname(abspath(__file__))
INSTALLED_APPS = [
"django.contrib.auth",
"django.contrib.contenttypes",
"markitup",
"tests",
"tests.test_migration",
]
DATABASES = {
"default": {
"ENGINE": "djang... | Configure TEMPLATES in test settings. | Configure TEMPLATES in test settings.
| Python | bsd-3-clause | carljm/django-markitup,carljm/django-markitup,zsiciarz/django-markitup,zsiciarz/django-markitup,carljm/django-markitup,zsiciarz/django-markitup | from __future__ import unicode_literals
from os.path import dirname
MIU_TEST_ROOT = dirname(__file__)
INSTALLED_APPS = [
"django.contrib.auth",
"django.contrib.contenttypes",
"markitup",
"tests",
"tests.test_migration",
]
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlit... | from __future__ import unicode_literals
from os.path import dirname, abspath, join
BASE_DIR = dirname(abspath(__file__))
INSTALLED_APPS = [
"django.contrib.auth",
"django.contrib.contenttypes",
"markitup",
"tests",
"tests.test_migration",
]
DATABASES = {
"default": {
"ENGINE": "djang... | <commit_before>from __future__ import unicode_literals
from os.path import dirname
MIU_TEST_ROOT = dirname(__file__)
INSTALLED_APPS = [
"django.contrib.auth",
"django.contrib.contenttypes",
"markitup",
"tests",
"tests.test_migration",
]
DATABASES = {
"default": {
"ENGINE": "django.db... | from __future__ import unicode_literals
from os.path import dirname, abspath, join
BASE_DIR = dirname(abspath(__file__))
INSTALLED_APPS = [
"django.contrib.auth",
"django.contrib.contenttypes",
"markitup",
"tests",
"tests.test_migration",
]
DATABASES = {
"default": {
"ENGINE": "djang... | from __future__ import unicode_literals
from os.path import dirname
MIU_TEST_ROOT = dirname(__file__)
INSTALLED_APPS = [
"django.contrib.auth",
"django.contrib.contenttypes",
"markitup",
"tests",
"tests.test_migration",
]
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlit... | <commit_before>from __future__ import unicode_literals
from os.path import dirname
MIU_TEST_ROOT = dirname(__file__)
INSTALLED_APPS = [
"django.contrib.auth",
"django.contrib.contenttypes",
"markitup",
"tests",
"tests.test_migration",
]
DATABASES = {
"default": {
"ENGINE": "django.db... |
655f46a10245de0b7f4d9727f816815c6493d230 | tests/test_settings.py | tests/test_settings.py | # -*- coding:utf-8 -*-
import os
try:
import unittest2 as unittest
except ImportError:
import unittest # NOQA
from sigal.settings import read_settings
class TestSettings(unittest.TestCase):
"Read a settings file and check that the configuration is well done."
def setUp(self):
"Read the sa... | # -*- coding:utf-8 -*-
import os
try:
import unittest2 as unittest
except ImportError:
import unittest # NOQA
from sigal.settings import read_settings, get_thumb
class TestSettings(unittest.TestCase):
"Read a settings file and check that the configuration is well done."
def setUp(self):
"... | Add a test for the get_thumb function. | Add a test for the get_thumb function.
| Python | mit | jdn06/sigal,Ferada/sigal,elaOnMars/sigal,kontza/sigal,kontza/sigal,t-animal/sigal,kontza/sigal,franek/sigal,cbosdo/sigal,cbosdo/sigal,saimn/sigal,saimn/sigal,jasuarez/sigal,xouillet/sigal,t-animal/sigal,muggenhor/sigal,saimn/sigal,elaOnMars/sigal,Ferada/sigal,franek/sigal,muggenhor/sigal,cbosdo/sigal,jdn06/sigal,xouill... | # -*- coding:utf-8 -*-
import os
try:
import unittest2 as unittest
except ImportError:
import unittest # NOQA
from sigal.settings import read_settings
class TestSettings(unittest.TestCase):
"Read a settings file and check that the configuration is well done."
def setUp(self):
"Read the sa... | # -*- coding:utf-8 -*-
import os
try:
import unittest2 as unittest
except ImportError:
import unittest # NOQA
from sigal.settings import read_settings, get_thumb
class TestSettings(unittest.TestCase):
"Read a settings file and check that the configuration is well done."
def setUp(self):
"... | <commit_before># -*- coding:utf-8 -*-
import os
try:
import unittest2 as unittest
except ImportError:
import unittest # NOQA
from sigal.settings import read_settings
class TestSettings(unittest.TestCase):
"Read a settings file and check that the configuration is well done."
def setUp(self):
... | # -*- coding:utf-8 -*-
import os
try:
import unittest2 as unittest
except ImportError:
import unittest # NOQA
from sigal.settings import read_settings, get_thumb
class TestSettings(unittest.TestCase):
"Read a settings file and check that the configuration is well done."
def setUp(self):
"... | # -*- coding:utf-8 -*-
import os
try:
import unittest2 as unittest
except ImportError:
import unittest # NOQA
from sigal.settings import read_settings
class TestSettings(unittest.TestCase):
"Read a settings file and check that the configuration is well done."
def setUp(self):
"Read the sa... | <commit_before># -*- coding:utf-8 -*-
import os
try:
import unittest2 as unittest
except ImportError:
import unittest # NOQA
from sigal.settings import read_settings
class TestSettings(unittest.TestCase):
"Read a settings file and check that the configuration is well done."
def setUp(self):
... |
733f2006f84ade6033a4be2fe3334213b8a2ce85 | mepcheck/savemeps.py | mepcheck/savemeps.py | import requests
from bs4 import BeautifulSoup
import pickle
import os
def save_meps():
url = "http://www.votewatch.eu//en/term8-european-parliament-members.html?limit=804"
path = os.path.expanduser("~")
r = requests.get(url)
r.encoding = 'utf-8'
soup = BeautifulSoup(r.text, "html.parser")
meps... | import requests
from bs4 import BeautifulSoup
import pickle
import os
def save_meps():
# TODO - make this configurable
url = "http://www.votewatch.eu//en/term9-european-parliament-members.html?limit=1000"
path = os.path.expanduser("~")
r = requests.get(url)
r.encoding = 'utf-8'
soup = Beautifu... | Update url for new term | [HOTFIX] Update url for new term
There's a new term, I have to make this configurable | Python | mit | alanmarazzi/mepcheck | import requests
from bs4 import BeautifulSoup
import pickle
import os
def save_meps():
url = "http://www.votewatch.eu//en/term8-european-parliament-members.html?limit=804"
path = os.path.expanduser("~")
r = requests.get(url)
r.encoding = 'utf-8'
soup = BeautifulSoup(r.text, "html.parser")
meps... | import requests
from bs4 import BeautifulSoup
import pickle
import os
def save_meps():
# TODO - make this configurable
url = "http://www.votewatch.eu//en/term9-european-parliament-members.html?limit=1000"
path = os.path.expanduser("~")
r = requests.get(url)
r.encoding = 'utf-8'
soup = Beautifu... | <commit_before>import requests
from bs4 import BeautifulSoup
import pickle
import os
def save_meps():
url = "http://www.votewatch.eu//en/term8-european-parliament-members.html?limit=804"
path = os.path.expanduser("~")
r = requests.get(url)
r.encoding = 'utf-8'
soup = BeautifulSoup(r.text, "html.pa... | import requests
from bs4 import BeautifulSoup
import pickle
import os
def save_meps():
# TODO - make this configurable
url = "http://www.votewatch.eu//en/term9-european-parliament-members.html?limit=1000"
path = os.path.expanduser("~")
r = requests.get(url)
r.encoding = 'utf-8'
soup = Beautifu... | import requests
from bs4 import BeautifulSoup
import pickle
import os
def save_meps():
url = "http://www.votewatch.eu//en/term8-european-parliament-members.html?limit=804"
path = os.path.expanduser("~")
r = requests.get(url)
r.encoding = 'utf-8'
soup = BeautifulSoup(r.text, "html.parser")
meps... | <commit_before>import requests
from bs4 import BeautifulSoup
import pickle
import os
def save_meps():
url = "http://www.votewatch.eu//en/term8-european-parliament-members.html?limit=804"
path = os.path.expanduser("~")
r = requests.get(url)
r.encoding = 'utf-8'
soup = BeautifulSoup(r.text, "html.pa... |
bba325111b47c9ba7dfc0bc9556a655e3f5afcee | tools/jtag/discover.py | tools/jtag/discover.py | #! /usr/bin/env python
'''
Simplistic chain discovery
'''
import sys
sys.path.append('../..')
from playtag.cables.digilent import Jtagger
from playtag.jtag.discover import Chain
print Chain(Jtagger())
| #! /usr/bin/env python
'''
Simplistic chain discovery
'''
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..'))
from playtag.cables.digilent import Jtagger
from playtag.jtag.discover import Chain
print Chain(Jtagger())
| Make it work when executed from a different directory | Make it work when executed from a different directory | Python | mit | E3V3A/playtag,proteus-cpi/playtag | #! /usr/bin/env python
'''
Simplistic chain discovery
'''
import sys
sys.path.append('../..')
from playtag.cables.digilent import Jtagger
from playtag.jtag.discover import Chain
print Chain(Jtagger())
Make it work when executed from a different directory | #! /usr/bin/env python
'''
Simplistic chain discovery
'''
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..'))
from playtag.cables.digilent import Jtagger
from playtag.jtag.discover import Chain
print Chain(Jtagger())
| <commit_before>#! /usr/bin/env python
'''
Simplistic chain discovery
'''
import sys
sys.path.append('../..')
from playtag.cables.digilent import Jtagger
from playtag.jtag.discover import Chain
print Chain(Jtagger())
<commit_msg>Make it work when executed from a different directory<commit_after> | #! /usr/bin/env python
'''
Simplistic chain discovery
'''
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..'))
from playtag.cables.digilent import Jtagger
from playtag.jtag.discover import Chain
print Chain(Jtagger())
| #! /usr/bin/env python
'''
Simplistic chain discovery
'''
import sys
sys.path.append('../..')
from playtag.cables.digilent import Jtagger
from playtag.jtag.discover import Chain
print Chain(Jtagger())
Make it work when executed from a different directory#! /usr/bin/env python
'''
Simplistic chain discovery
'''
impo... | <commit_before>#! /usr/bin/env python
'''
Simplistic chain discovery
'''
import sys
sys.path.append('../..')
from playtag.cables.digilent import Jtagger
from playtag.jtag.discover import Chain
print Chain(Jtagger())
<commit_msg>Make it work when executed from a different directory<commit_after>#! /usr/bin/env python... |
78351e785f413f44e07faa0b8a856639296a5591 | examples/drawing/ego_graph.py | examples/drawing/ego_graph.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Example using the NetworkX ego_graph() function to return the main egonet of
the largest hub in a Barabási-Albert network.
"""
__author__="""Drew Conway (drew.conway@nyu.edu)"""
from operator import itemgetter
import networkx as nx
import matplotlib.pyplot as plt
if... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Example using the NetworkX ego_graph() function to return the main egonet of
the largest hub in a Barabási-Albert network.
"""
__author__="""Drew Conway (drew.conway@nyu.edu)"""
from operator import itemgetter
import networkx as nx
import matplotlib.pyplot as plt
if... | Change name of output file in example | Change name of output file in example
--HG--
extra : convert_revision : svn%3A3ed01bd8-26fb-0310-9e4c-ca1a4053419f/networkx/trunk%401549
| Python | bsd-3-clause | RMKD/networkx,RMKD/networkx,jni/networkx,kernc/networkx,sharifulgeo/networkx,debsankha/networkx,kai5263499/networkx,farhaanbukhsh/networkx,jfinkels/networkx,NvanAdrichem/networkx,jakevdp/networkx,dmoliveira/networkx,jni/networkx,jakevdp/networkx,SanketDG/networkx,kernc/networkx,beni55/networkx,sharifulgeo/networkx,dhim... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Example using the NetworkX ego_graph() function to return the main egonet of
the largest hub in a Barabási-Albert network.
"""
__author__="""Drew Conway (drew.conway@nyu.edu)"""
from operator import itemgetter
import networkx as nx
import matplotlib.pyplot as plt
if... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Example using the NetworkX ego_graph() function to return the main egonet of
the largest hub in a Barabási-Albert network.
"""
__author__="""Drew Conway (drew.conway@nyu.edu)"""
from operator import itemgetter
import networkx as nx
import matplotlib.pyplot as plt
if... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Example using the NetworkX ego_graph() function to return the main egonet of
the largest hub in a Barabási-Albert network.
"""
__author__="""Drew Conway (drew.conway@nyu.edu)"""
from operator import itemgetter
import networkx as nx
import matplotlib.pyp... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Example using the NetworkX ego_graph() function to return the main egonet of
the largest hub in a Barabási-Albert network.
"""
__author__="""Drew Conway (drew.conway@nyu.edu)"""
from operator import itemgetter
import networkx as nx
import matplotlib.pyplot as plt
if... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Example using the NetworkX ego_graph() function to return the main egonet of
the largest hub in a Barabási-Albert network.
"""
__author__="""Drew Conway (drew.conway@nyu.edu)"""
from operator import itemgetter
import networkx as nx
import matplotlib.pyplot as plt
if... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Example using the NetworkX ego_graph() function to return the main egonet of
the largest hub in a Barabási-Albert network.
"""
__author__="""Drew Conway (drew.conway@nyu.edu)"""
from operator import itemgetter
import networkx as nx
import matplotlib.pyp... |
6ecbcfd1b132b0c4acd2d413818348a2fe2b6bfe | Cauldron/utils/referencecompat.py | Cauldron/utils/referencecompat.py | # -*- coding: utf-8 -*-
try:
from __builtins__ import ReferenceError
except (NameError, ImportError): # pragma: no cover
from weakref import ReferenceError
__all__ = ['ReferenceError']
| # -*- coding: utf-8 -*-
import sys
try:
if sys.version_info[0] < 3:
from __builtins__ import ReferenceError
else:
from builtins import ReferenceError
except (NameError, ImportError): # pragma: no cover
from weakref import ReferenceError
__all__ = ['ReferenceError']
| Fix a py3 bug in reference compatibility | Fix a py3 bug in reference compatibility
| Python | bsd-3-clause | alexrudy/Cauldron | # -*- coding: utf-8 -*-
try:
from __builtins__ import ReferenceError
except (NameError, ImportError): # pragma: no cover
from weakref import ReferenceError
__all__ = ['ReferenceError']
Fix a py3 bug in reference compatibility | # -*- coding: utf-8 -*-
import sys
try:
if sys.version_info[0] < 3:
from __builtins__ import ReferenceError
else:
from builtins import ReferenceError
except (NameError, ImportError): # pragma: no cover
from weakref import ReferenceError
__all__ = ['ReferenceError']
| <commit_before># -*- coding: utf-8 -*-
try:
from __builtins__ import ReferenceError
except (NameError, ImportError): # pragma: no cover
from weakref import ReferenceError
__all__ = ['ReferenceError']
<commit_msg>Fix a py3 bug in reference compatibility<commit_after> | # -*- coding: utf-8 -*-
import sys
try:
if sys.version_info[0] < 3:
from __builtins__ import ReferenceError
else:
from builtins import ReferenceError
except (NameError, ImportError): # pragma: no cover
from weakref import ReferenceError
__all__ = ['ReferenceError']
| # -*- coding: utf-8 -*-
try:
from __builtins__ import ReferenceError
except (NameError, ImportError): # pragma: no cover
from weakref import ReferenceError
__all__ = ['ReferenceError']
Fix a py3 bug in reference compatibility# -*- coding: utf-8 -*-
import sys
try:
if sys.version_info[0] < 3:
from ... | <commit_before># -*- coding: utf-8 -*-
try:
from __builtins__ import ReferenceError
except (NameError, ImportError): # pragma: no cover
from weakref import ReferenceError
__all__ = ['ReferenceError']
<commit_msg>Fix a py3 bug in reference compatibility<commit_after># -*- coding: utf-8 -*-
import sys
try:
... |
492004049da87744cd96a6e6afeb9a6239a8ac44 | ocradmin/lib/nodetree/registry.py | ocradmin/lib/nodetree/registry.py | """
Registry class and global node registry.
"""
class NotRegistered(KeyError):
pass
__all__ = ["NodeRegistry", "nodes"]
class NodeRegistry(dict):
NotRegistered = NotRegistered
def register(self, node):
"""Register a node in the node registry.
The node will be automatically instantiat... | """
Registry class and global node registry.
"""
import inspect
class NotRegistered(KeyError):
pass
class NodeRegistry(dict):
NotRegistered = NotRegistered
def register(self, node):
"""Register a node class in the node registry."""
self[node.name] = inspect.isclass(node) and node or nod... | Fix missing import. Add method to get all nodes with a particular attribute | Fix missing import. Add method to get all nodes with a particular attribute
| Python | apache-2.0 | vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium | """
Registry class and global node registry.
"""
class NotRegistered(KeyError):
pass
__all__ = ["NodeRegistry", "nodes"]
class NodeRegistry(dict):
NotRegistered = NotRegistered
def register(self, node):
"""Register a node in the node registry.
The node will be automatically instantiat... | """
Registry class and global node registry.
"""
import inspect
class NotRegistered(KeyError):
pass
class NodeRegistry(dict):
NotRegistered = NotRegistered
def register(self, node):
"""Register a node class in the node registry."""
self[node.name] = inspect.isclass(node) and node or nod... | <commit_before>"""
Registry class and global node registry.
"""
class NotRegistered(KeyError):
pass
__all__ = ["NodeRegistry", "nodes"]
class NodeRegistry(dict):
NotRegistered = NotRegistered
def register(self, node):
"""Register a node in the node registry.
The node will be automatic... | """
Registry class and global node registry.
"""
import inspect
class NotRegistered(KeyError):
pass
class NodeRegistry(dict):
NotRegistered = NotRegistered
def register(self, node):
"""Register a node class in the node registry."""
self[node.name] = inspect.isclass(node) and node or nod... | """
Registry class and global node registry.
"""
class NotRegistered(KeyError):
pass
__all__ = ["NodeRegistry", "nodes"]
class NodeRegistry(dict):
NotRegistered = NotRegistered
def register(self, node):
"""Register a node in the node registry.
The node will be automatically instantiat... | <commit_before>"""
Registry class and global node registry.
"""
class NotRegistered(KeyError):
pass
__all__ = ["NodeRegistry", "nodes"]
class NodeRegistry(dict):
NotRegistered = NotRegistered
def register(self, node):
"""Register a node in the node registry.
The node will be automatic... |
0225177c39df95bc12d9d9b53433f310d083905f | tests/test_heroku.py | tests/test_heroku.py | """Tests for the Wallace API."""
import subprocess
import re
import os
import requests
class TestHeroku(object):
"""The Heroku test class."""
sandbox_output = subprocess.check_output(
"cd examples/bartlett1932; wallace sandbox --verbose", shell=True)
os.environ['app_id'] = re.search(
'... | """Tests for the Wallace API."""
import subprocess
import re
import os
import requests
class TestHeroku(object):
"""The Heroku test class."""
sandbox_output = subprocess.check_output(
"cd examples/bartlett1932; wallace sandbox --verbose", shell=True)
os.environ['app_id'] = re.search(
'... | Add test for correct error for nonexistent routes | Add test for correct error for nonexistent routes
| Python | mit | berkeley-cocosci/Wallace,jcpeterson/Dallinger,Dallinger/Dallinger,Dallinger/Dallinger,Dallinger/Dallinger,suchow/Wallace,Dallinger/Dallinger,berkeley-cocosci/Wallace,berkeley-cocosci/Wallace,jcpeterson/Dallinger,jcpeterson/Dallinger,suchow/Wallace,suchow/Wallace,jcpeterson/Dallinger,Dallinger/Dallinger,jcpeterson/Dalli... | """Tests for the Wallace API."""
import subprocess
import re
import os
import requests
class TestHeroku(object):
"""The Heroku test class."""
sandbox_output = subprocess.check_output(
"cd examples/bartlett1932; wallace sandbox --verbose", shell=True)
os.environ['app_id'] = re.search(
'... | """Tests for the Wallace API."""
import subprocess
import re
import os
import requests
class TestHeroku(object):
"""The Heroku test class."""
sandbox_output = subprocess.check_output(
"cd examples/bartlett1932; wallace sandbox --verbose", shell=True)
os.environ['app_id'] = re.search(
'... | <commit_before>"""Tests for the Wallace API."""
import subprocess
import re
import os
import requests
class TestHeroku(object):
"""The Heroku test class."""
sandbox_output = subprocess.check_output(
"cd examples/bartlett1932; wallace sandbox --verbose", shell=True)
os.environ['app_id'] = re.se... | """Tests for the Wallace API."""
import subprocess
import re
import os
import requests
class TestHeroku(object):
"""The Heroku test class."""
sandbox_output = subprocess.check_output(
"cd examples/bartlett1932; wallace sandbox --verbose", shell=True)
os.environ['app_id'] = re.search(
'... | """Tests for the Wallace API."""
import subprocess
import re
import os
import requests
class TestHeroku(object):
"""The Heroku test class."""
sandbox_output = subprocess.check_output(
"cd examples/bartlett1932; wallace sandbox --verbose", shell=True)
os.environ['app_id'] = re.search(
'... | <commit_before>"""Tests for the Wallace API."""
import subprocess
import re
import os
import requests
class TestHeroku(object):
"""The Heroku test class."""
sandbox_output = subprocess.check_output(
"cd examples/bartlett1932; wallace sandbox --verbose", shell=True)
os.environ['app_id'] = re.se... |
f97d9d6462ce9e60c1811bd40428a1f30835ce95 | hb_res/storage/FileExplanationStorage.py | hb_res/storage/FileExplanationStorage.py | from hb_res.storage import ExplanationStorage
__author__ = 'skird'
import codecs
from hb_res.explanations.Explanation import Explanation
class FileExplanationStorage(ExplanationStorage):
"""
Class representing explanation resource connected with some text file
"""
def __init__(self, path_to_file):
... | from hb_res.storage import ExplanationStorage
from hb_res.explanations.Explanation import Explanation
__author__ = 'skird'
class FileExplanationStorage(ExplanationStorage):
"""
Class representing explanation resource connected with some text file
"""
def __init__(self, path_to_file):
self.fi... | Fix permission-denied error in read-only context | Fix permission-denied error in read-only context
| Python | mit | hatbot-team/hatbot_resources | from hb_res.storage import ExplanationStorage
__author__ = 'skird'
import codecs
from hb_res.explanations.Explanation import Explanation
class FileExplanationStorage(ExplanationStorage):
"""
Class representing explanation resource connected with some text file
"""
def __init__(self, path_to_file):
... | from hb_res.storage import ExplanationStorage
from hb_res.explanations.Explanation import Explanation
__author__ = 'skird'
class FileExplanationStorage(ExplanationStorage):
"""
Class representing explanation resource connected with some text file
"""
def __init__(self, path_to_file):
self.fi... | <commit_before>from hb_res.storage import ExplanationStorage
__author__ = 'skird'
import codecs
from hb_res.explanations.Explanation import Explanation
class FileExplanationStorage(ExplanationStorage):
"""
Class representing explanation resource connected with some text file
"""
def __init__(self, ... | from hb_res.storage import ExplanationStorage
from hb_res.explanations.Explanation import Explanation
__author__ = 'skird'
class FileExplanationStorage(ExplanationStorage):
"""
Class representing explanation resource connected with some text file
"""
def __init__(self, path_to_file):
self.fi... | from hb_res.storage import ExplanationStorage
__author__ = 'skird'
import codecs
from hb_res.explanations.Explanation import Explanation
class FileExplanationStorage(ExplanationStorage):
"""
Class representing explanation resource connected with some text file
"""
def __init__(self, path_to_file):
... | <commit_before>from hb_res.storage import ExplanationStorage
__author__ = 'skird'
import codecs
from hb_res.explanations.Explanation import Explanation
class FileExplanationStorage(ExplanationStorage):
"""
Class representing explanation resource connected with some text file
"""
def __init__(self, ... |
c471a5d6421e32e9c6e3ca2db0f07eae45a85408 | fuckit_commit.py | fuckit_commit.py | '''
This module will send SMS reminders periodically, using Twilio.
The aim is to encourage user to code, commit and push to GitHub everyday
'''
import requests
def set_configuration():
'''
Set Twilio configuration
'''
pass
def get_twilio_client():
'''
Connect to Twilio Client
'''
pas... | '''
This module will send SMS reminders periodically, using Twilio.
The aim is to encourage user to code, commit and push to GitHub everyday
'''
import requests
from twilio.rest import TwilioRestClient
def get_configuration():
'''
Set Twilio configuration
'''
pass
def get_twilio_client(config):
'... | Add code to send sms | Add code to send sms
| Python | mit | ueg1990/fuckit_commit | '''
This module will send SMS reminders periodically, using Twilio.
The aim is to encourage user to code, commit and push to GitHub everyday
'''
import requests
def set_configuration():
'''
Set Twilio configuration
'''
pass
def get_twilio_client():
'''
Connect to Twilio Client
'''
pas... | '''
This module will send SMS reminders periodically, using Twilio.
The aim is to encourage user to code, commit and push to GitHub everyday
'''
import requests
from twilio.rest import TwilioRestClient
def get_configuration():
'''
Set Twilio configuration
'''
pass
def get_twilio_client(config):
'... | <commit_before>'''
This module will send SMS reminders periodically, using Twilio.
The aim is to encourage user to code, commit and push to GitHub everyday
'''
import requests
def set_configuration():
'''
Set Twilio configuration
'''
pass
def get_twilio_client():
'''
Connect to Twilio Client
... | '''
This module will send SMS reminders periodically, using Twilio.
The aim is to encourage user to code, commit and push to GitHub everyday
'''
import requests
from twilio.rest import TwilioRestClient
def get_configuration():
'''
Set Twilio configuration
'''
pass
def get_twilio_client(config):
'... | '''
This module will send SMS reminders periodically, using Twilio.
The aim is to encourage user to code, commit and push to GitHub everyday
'''
import requests
def set_configuration():
'''
Set Twilio configuration
'''
pass
def get_twilio_client():
'''
Connect to Twilio Client
'''
pas... | <commit_before>'''
This module will send SMS reminders periodically, using Twilio.
The aim is to encourage user to code, commit and push to GitHub everyday
'''
import requests
def set_configuration():
'''
Set Twilio configuration
'''
pass
def get_twilio_client():
'''
Connect to Twilio Client
... |
048994463cda7df1bbaf502bef2bf84036e73403 | i18n/loaders/python_loader.py | i18n/loaders/python_loader.py | import os.path
import sys
from .loader import Loader, I18nFileLoadError
class PythonLoader(Loader):
"""class to load python files"""
def __init__(self):
super(PythonLoader, self).__init__()
def load_file(self, filename):
path, name = os.path.split(filename)
module_name, ext = os.p... | import os.path
import sys
from .loader import Loader, I18nFileLoadError
class PythonLoader(Loader):
"""class to load python files"""
def __init__(self):
super(PythonLoader, self).__init__()
def load_file(self, filename):
path, name = os.path.split(filename)
module_name, ext = os.... | Fix bug in python loader. | Fix bug in python loader.
| Python | mit | tuvistavie/python-i18n | import os.path
import sys
from .loader import Loader, I18nFileLoadError
class PythonLoader(Loader):
"""class to load python files"""
def __init__(self):
super(PythonLoader, self).__init__()
def load_file(self, filename):
path, name = os.path.split(filename)
module_name, ext = os.p... | import os.path
import sys
from .loader import Loader, I18nFileLoadError
class PythonLoader(Loader):
"""class to load python files"""
def __init__(self):
super(PythonLoader, self).__init__()
def load_file(self, filename):
path, name = os.path.split(filename)
module_name, ext = os.... | <commit_before>import os.path
import sys
from .loader import Loader, I18nFileLoadError
class PythonLoader(Loader):
"""class to load python files"""
def __init__(self):
super(PythonLoader, self).__init__()
def load_file(self, filename):
path, name = os.path.split(filename)
module_n... | import os.path
import sys
from .loader import Loader, I18nFileLoadError
class PythonLoader(Loader):
"""class to load python files"""
def __init__(self):
super(PythonLoader, self).__init__()
def load_file(self, filename):
path, name = os.path.split(filename)
module_name, ext = os.... | import os.path
import sys
from .loader import Loader, I18nFileLoadError
class PythonLoader(Loader):
"""class to load python files"""
def __init__(self):
super(PythonLoader, self).__init__()
def load_file(self, filename):
path, name = os.path.split(filename)
module_name, ext = os.p... | <commit_before>import os.path
import sys
from .loader import Loader, I18nFileLoadError
class PythonLoader(Loader):
"""class to load python files"""
def __init__(self):
super(PythonLoader, self).__init__()
def load_file(self, filename):
path, name = os.path.split(filename)
module_n... |
7bc247550f136c5f0e34f411b868f9e5949e1ec4 | api/tests/destinations/endpoint_tests.py | api/tests/destinations/endpoint_tests.py | import unittest
from peewee import SqliteDatabase
from playhouse.test_utils import test_database
import api.tests.helpers as helpers
from api.destinations.endpoint import *
from api.destinations.endpoint import _get_destinations
test_db = SqliteDatabase(':memory:')
class DestinationsTests(unittest.TestCase):
... | from peewee import SqliteDatabase
from api.destinations.endpoint import _get_destinations
from api.tests.dbtestcase import DBTestCase
test_db = SqliteDatabase(':memory:')
class DestinationsTests(DBTestCase):
def test_get_destinations_filters_zone(self):
self.assertEqual(2, len(_get_destinations()))
... | Update destination endpoint tests to work with new version of peewee | Update destination endpoint tests to work with new version of peewee
| Python | mit | mdowds/commutercalculator,mdowds/commutercalculator,mdowds/commutercalculator | import unittest
from peewee import SqliteDatabase
from playhouse.test_utils import test_database
import api.tests.helpers as helpers
from api.destinations.endpoint import *
from api.destinations.endpoint import _get_destinations
test_db = SqliteDatabase(':memory:')
class DestinationsTests(unittest.TestCase):
... | from peewee import SqliteDatabase
from api.destinations.endpoint import _get_destinations
from api.tests.dbtestcase import DBTestCase
test_db = SqliteDatabase(':memory:')
class DestinationsTests(DBTestCase):
def test_get_destinations_filters_zone(self):
self.assertEqual(2, len(_get_destinations()))
... | <commit_before>import unittest
from peewee import SqliteDatabase
from playhouse.test_utils import test_database
import api.tests.helpers as helpers
from api.destinations.endpoint import *
from api.destinations.endpoint import _get_destinations
test_db = SqliteDatabase(':memory:')
class DestinationsTests(unittest.T... | from peewee import SqliteDatabase
from api.destinations.endpoint import _get_destinations
from api.tests.dbtestcase import DBTestCase
test_db = SqliteDatabase(':memory:')
class DestinationsTests(DBTestCase):
def test_get_destinations_filters_zone(self):
self.assertEqual(2, len(_get_destinations()))
... | import unittest
from peewee import SqliteDatabase
from playhouse.test_utils import test_database
import api.tests.helpers as helpers
from api.destinations.endpoint import *
from api.destinations.endpoint import _get_destinations
test_db = SqliteDatabase(':memory:')
class DestinationsTests(unittest.TestCase):
... | <commit_before>import unittest
from peewee import SqliteDatabase
from playhouse.test_utils import test_database
import api.tests.helpers as helpers
from api.destinations.endpoint import *
from api.destinations.endpoint import _get_destinations
test_db = SqliteDatabase(':memory:')
class DestinationsTests(unittest.T... |
0e14aaba251e3257bc298561a9004d88e0d8e3b6 | turbasen/__init__.py | turbasen/__init__.py | # encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
# Import the models we want directly available through the root module
from .models import \
Gruppe, \
Omrade, \
Sted
# Make configure directly available through the root module
from .settings import confi... | # encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
# Import the models we want directly available through the root module
from .models import (
Gruppe,
Omrade,
Sted,
)
# Make configure directly available through the root module
from .settings import config... | Apply parentheses for group import | Apply parentheses for group import
| Python | mit | Turbasen/turbasen.py | # encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
# Import the models we want directly available through the root module
from .models import \
Gruppe, \
Omrade, \
Sted
# Make configure directly available through the root module
from .settings import confi... | # encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
# Import the models we want directly available through the root module
from .models import (
Gruppe,
Omrade,
Sted,
)
# Make configure directly available through the root module
from .settings import config... | <commit_before># encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
# Import the models we want directly available through the root module
from .models import \
Gruppe, \
Omrade, \
Sted
# Make configure directly available through the root module
from .settin... | # encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
# Import the models we want directly available through the root module
from .models import (
Gruppe,
Omrade,
Sted,
)
# Make configure directly available through the root module
from .settings import config... | # encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
# Import the models we want directly available through the root module
from .models import \
Gruppe, \
Omrade, \
Sted
# Make configure directly available through the root module
from .settings import confi... | <commit_before># encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
# Import the models we want directly available through the root module
from .models import \
Gruppe, \
Omrade, \
Sted
# Make configure directly available through the root module
from .settin... |
4f9569037ad835b852e6389b082155d45a88774c | kokki/cookbooks/nginx/recipes/default.py | kokki/cookbooks/nginx/recipes/default.py |
from kokki import *
Package("nginx")
Directory(env.config.nginx.log_dir,
mode = 0755,
owner = env.config.nginx.user,
action = 'create')
for nxscript in ('nxensite', 'nxdissite'):
File("/usr/sbin/%s" % nxscript,
content = Template("nginx/%s.j2" % nxscript),
mode = 0755,
owner ... |
from kokki import *
Package("nginx")
Directory(env.config.nginx.log_dir,
mode = 0755,
owner = env.config.nginx.user,
action = 'create')
for nxscript in ('nxensite', 'nxdissite'):
File("/usr/sbin/%s" % nxscript,
content = Template("nginx/%s.j2" % nxscript),
mode = 0755,
owner ... | Add silverline environment to nginx | Add silverline environment to nginx
| Python | bsd-3-clause | samuel/kokki |
from kokki import *
Package("nginx")
Directory(env.config.nginx.log_dir,
mode = 0755,
owner = env.config.nginx.user,
action = 'create')
for nxscript in ('nxensite', 'nxdissite'):
File("/usr/sbin/%s" % nxscript,
content = Template("nginx/%s.j2" % nxscript),
mode = 0755,
owner ... |
from kokki import *
Package("nginx")
Directory(env.config.nginx.log_dir,
mode = 0755,
owner = env.config.nginx.user,
action = 'create')
for nxscript in ('nxensite', 'nxdissite'):
File("/usr/sbin/%s" % nxscript,
content = Template("nginx/%s.j2" % nxscript),
mode = 0755,
owner ... | <commit_before>
from kokki import *
Package("nginx")
Directory(env.config.nginx.log_dir,
mode = 0755,
owner = env.config.nginx.user,
action = 'create')
for nxscript in ('nxensite', 'nxdissite'):
File("/usr/sbin/%s" % nxscript,
content = Template("nginx/%s.j2" % nxscript),
mode = 0755,... |
from kokki import *
Package("nginx")
Directory(env.config.nginx.log_dir,
mode = 0755,
owner = env.config.nginx.user,
action = 'create')
for nxscript in ('nxensite', 'nxdissite'):
File("/usr/sbin/%s" % nxscript,
content = Template("nginx/%s.j2" % nxscript),
mode = 0755,
owner ... |
from kokki import *
Package("nginx")
Directory(env.config.nginx.log_dir,
mode = 0755,
owner = env.config.nginx.user,
action = 'create')
for nxscript in ('nxensite', 'nxdissite'):
File("/usr/sbin/%s" % nxscript,
content = Template("nginx/%s.j2" % nxscript),
mode = 0755,
owner ... | <commit_before>
from kokki import *
Package("nginx")
Directory(env.config.nginx.log_dir,
mode = 0755,
owner = env.config.nginx.user,
action = 'create')
for nxscript in ('nxensite', 'nxdissite'):
File("/usr/sbin/%s" % nxscript,
content = Template("nginx/%s.j2" % nxscript),
mode = 0755,... |
c1889a71be161400a42ad6b7c72b2559a84f69bf | src/nodeconductor_assembly_waldur/invoices/tests/test_report.py | src/nodeconductor_assembly_waldur/invoices/tests/test_report.py | from django.test import TestCase
from nodeconductor_assembly_waldur.invoices.tasks import format_invoice_csv
from .. import models
from . import fixtures
class TestReportFormatter(TestCase):
def test_invoice_items_are_properly_formatted(self):
fixture = fixtures.InvoiceFixture()
package = fixtur... | from django.test import TestCase
from nodeconductor_assembly_waldur.invoices.tasks import format_invoice_csv
from .. import models
from . import fixtures
class TestReportFormatter(TestCase):
def setUp(self):
fixture = fixtures.InvoiceFixture()
package = fixture.openstack_package
invoice ... | Add unit test for report formatter | Add unit test for report formatter [WAL-905]
| Python | mit | opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/nodeconductor-assembly-waldur | from django.test import TestCase
from nodeconductor_assembly_waldur.invoices.tasks import format_invoice_csv
from .. import models
from . import fixtures
class TestReportFormatter(TestCase):
def test_invoice_items_are_properly_formatted(self):
fixture = fixtures.InvoiceFixture()
package = fixtur... | from django.test import TestCase
from nodeconductor_assembly_waldur.invoices.tasks import format_invoice_csv
from .. import models
from . import fixtures
class TestReportFormatter(TestCase):
def setUp(self):
fixture = fixtures.InvoiceFixture()
package = fixture.openstack_package
invoice ... | <commit_before>from django.test import TestCase
from nodeconductor_assembly_waldur.invoices.tasks import format_invoice_csv
from .. import models
from . import fixtures
class TestReportFormatter(TestCase):
def test_invoice_items_are_properly_formatted(self):
fixture = fixtures.InvoiceFixture()
p... | from django.test import TestCase
from nodeconductor_assembly_waldur.invoices.tasks import format_invoice_csv
from .. import models
from . import fixtures
class TestReportFormatter(TestCase):
def setUp(self):
fixture = fixtures.InvoiceFixture()
package = fixture.openstack_package
invoice ... | from django.test import TestCase
from nodeconductor_assembly_waldur.invoices.tasks import format_invoice_csv
from .. import models
from . import fixtures
class TestReportFormatter(TestCase):
def test_invoice_items_are_properly_formatted(self):
fixture = fixtures.InvoiceFixture()
package = fixtur... | <commit_before>from django.test import TestCase
from nodeconductor_assembly_waldur.invoices.tasks import format_invoice_csv
from .. import models
from . import fixtures
class TestReportFormatter(TestCase):
def test_invoice_items_are_properly_formatted(self):
fixture = fixtures.InvoiceFixture()
p... |
11c30f5dd765475a9f5f0f847f31c47af8c40a39 | user_agent/device.py | user_agent/device.py | import os.path
import json
PACKAGE_DIR = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(PACKAGE_DIR, 'data/smartphone_dev_id.json')) as f:
SMARTPHONE_DEV_IDS = json.load(open(f))
with open(os.path.join(PACKAGE_DIR, 'data/tablet_dev_id.json')) as f:
TABLET_DEV_IDS = json.load(open())
| import os.path
import json
PACKAGE_DIR = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(PACKAGE_DIR, 'data/smartphone_dev_id.json')) as f:
SMARTPHONE_DEV_IDS = json.load(f)
with open(os.path.join(PACKAGE_DIR, 'data/tablet_dev_id.json')) as f:
TABLET_DEV_IDS = json.load(f)
| Fix uses of file objects | Fix uses of file objects | Python | mit | lorien/user_agent | import os.path
import json
PACKAGE_DIR = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(PACKAGE_DIR, 'data/smartphone_dev_id.json')) as f:
SMARTPHONE_DEV_IDS = json.load(open(f))
with open(os.path.join(PACKAGE_DIR, 'data/tablet_dev_id.json')) as f:
TABLET_DEV_IDS = json.load(open())
Fix us... | import os.path
import json
PACKAGE_DIR = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(PACKAGE_DIR, 'data/smartphone_dev_id.json')) as f:
SMARTPHONE_DEV_IDS = json.load(f)
with open(os.path.join(PACKAGE_DIR, 'data/tablet_dev_id.json')) as f:
TABLET_DEV_IDS = json.load(f)
| <commit_before>import os.path
import json
PACKAGE_DIR = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(PACKAGE_DIR, 'data/smartphone_dev_id.json')) as f:
SMARTPHONE_DEV_IDS = json.load(open(f))
with open(os.path.join(PACKAGE_DIR, 'data/tablet_dev_id.json')) as f:
TABLET_DEV_IDS = json.load... | import os.path
import json
PACKAGE_DIR = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(PACKAGE_DIR, 'data/smartphone_dev_id.json')) as f:
SMARTPHONE_DEV_IDS = json.load(f)
with open(os.path.join(PACKAGE_DIR, 'data/tablet_dev_id.json')) as f:
TABLET_DEV_IDS = json.load(f)
| import os.path
import json
PACKAGE_DIR = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(PACKAGE_DIR, 'data/smartphone_dev_id.json')) as f:
SMARTPHONE_DEV_IDS = json.load(open(f))
with open(os.path.join(PACKAGE_DIR, 'data/tablet_dev_id.json')) as f:
TABLET_DEV_IDS = json.load(open())
Fix us... | <commit_before>import os.path
import json
PACKAGE_DIR = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(PACKAGE_DIR, 'data/smartphone_dev_id.json')) as f:
SMARTPHONE_DEV_IDS = json.load(open(f))
with open(os.path.join(PACKAGE_DIR, 'data/tablet_dev_id.json')) as f:
TABLET_DEV_IDS = json.load... |
2158edb92cba6c19fa258f19445191d0308c4153 | utils/async_tasks.py | utils/async_tasks.py | from utils.redis_store import store
def data_from_async_task(task_func, task_args, task_kwargs, store_key, refresh_time=60):
# Get task results previously stored in store
output, elapsed_time = store.get(store_key, include_elapsed_time=True)
# If there are no previously stored results (elapsed_time will ... | from utils.redis_store import store
from celery.signals import task_postrun, task_prerun
def data_from_async_task(task_func, task_args, task_kwargs, store_key, refresh_time=60, run_once=True):
# Get task results previously stored in store
output, elapsed_time = store.get(store_key, include_elapsed_time=True)... | Add option to run async tasks only on at a time | Add option to run async tasks only on at a time
This is implemented with a simple lock like mechanism using redis.
| Python | agpl-3.0 | MTG/freesound-datasets,MTG/freesound-datasets,MTG/freesound-datasets,MTG/freesound-datasets | from utils.redis_store import store
def data_from_async_task(task_func, task_args, task_kwargs, store_key, refresh_time=60):
# Get task results previously stored in store
output, elapsed_time = store.get(store_key, include_elapsed_time=True)
# If there are no previously stored results (elapsed_time will ... | from utils.redis_store import store
from celery.signals import task_postrun, task_prerun
def data_from_async_task(task_func, task_args, task_kwargs, store_key, refresh_time=60, run_once=True):
# Get task results previously stored in store
output, elapsed_time = store.get(store_key, include_elapsed_time=True)... | <commit_before>from utils.redis_store import store
def data_from_async_task(task_func, task_args, task_kwargs, store_key, refresh_time=60):
# Get task results previously stored in store
output, elapsed_time = store.get(store_key, include_elapsed_time=True)
# If there are no previously stored results (ela... | from utils.redis_store import store
from celery.signals import task_postrun, task_prerun
def data_from_async_task(task_func, task_args, task_kwargs, store_key, refresh_time=60, run_once=True):
# Get task results previously stored in store
output, elapsed_time = store.get(store_key, include_elapsed_time=True)... | from utils.redis_store import store
def data_from_async_task(task_func, task_args, task_kwargs, store_key, refresh_time=60):
# Get task results previously stored in store
output, elapsed_time = store.get(store_key, include_elapsed_time=True)
# If there are no previously stored results (elapsed_time will ... | <commit_before>from utils.redis_store import store
def data_from_async_task(task_func, task_args, task_kwargs, store_key, refresh_time=60):
# Get task results previously stored in store
output, elapsed_time = store.get(store_key, include_elapsed_time=True)
# If there are no previously stored results (ela... |
43e86a3ac5f63c702ce409c45e3aaaac60990fe9 | python/ensure_haddock_coverage.py | python/ensure_haddock_coverage.py | #!/usr/bin/env python
"""
Tiny utility script to check that coverage statistics output by stack haddock
are all 100%.
"""
import sys
import re
def main():
"""Entry point to ensure-haddock-coverage.py."""
# Verify that the number of arguments is correct.
if len(sys.argv) != 2:
print("Usage: ./ensure... | #!/usr/bin/env python
"""
Tiny utility script to check that coverage statistics output by stack haddock
are all 100%.
"""
import sys
import re
def main():
"""Entry point to ensure-haddock-coverage.py."""
# Verify that the number of arguments is correct.
if len(sys.argv) != 2:
print("Usage: ./ensure... | Check for number of modules in haddock-checking script | Check for number of modules in haddock-checking script
| Python | mit | gibiansky/jupyter-haskell | #!/usr/bin/env python
"""
Tiny utility script to check that coverage statistics output by stack haddock
are all 100%.
"""
import sys
import re
def main():
"""Entry point to ensure-haddock-coverage.py."""
# Verify that the number of arguments is correct.
if len(sys.argv) != 2:
print("Usage: ./ensure... | #!/usr/bin/env python
"""
Tiny utility script to check that coverage statistics output by stack haddock
are all 100%.
"""
import sys
import re
def main():
"""Entry point to ensure-haddock-coverage.py."""
# Verify that the number of arguments is correct.
if len(sys.argv) != 2:
print("Usage: ./ensure... | <commit_before>#!/usr/bin/env python
"""
Tiny utility script to check that coverage statistics output by stack haddock
are all 100%.
"""
import sys
import re
def main():
"""Entry point to ensure-haddock-coverage.py."""
# Verify that the number of arguments is correct.
if len(sys.argv) != 2:
print("... | #!/usr/bin/env python
"""
Tiny utility script to check that coverage statistics output by stack haddock
are all 100%.
"""
import sys
import re
def main():
"""Entry point to ensure-haddock-coverage.py."""
# Verify that the number of arguments is correct.
if len(sys.argv) != 2:
print("Usage: ./ensure... | #!/usr/bin/env python
"""
Tiny utility script to check that coverage statistics output by stack haddock
are all 100%.
"""
import sys
import re
def main():
"""Entry point to ensure-haddock-coverage.py."""
# Verify that the number of arguments is correct.
if len(sys.argv) != 2:
print("Usage: ./ensure... | <commit_before>#!/usr/bin/env python
"""
Tiny utility script to check that coverage statistics output by stack haddock
are all 100%.
"""
import sys
import re
def main():
"""Entry point to ensure-haddock-coverage.py."""
# Verify that the number of arguments is correct.
if len(sys.argv) != 2:
print("... |
8b9ebbad9e87af3f56570ba3c32dcdb2d7ca4a39 | django_iceberg/models/base_models.py | django_iceberg/models/base_models.py |
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
DEFAULT_ICEBERG_ENV = getattr(settings, 'ICEBERG_DEFAULT_ENVIRO', "prod")
class IcebergBaseModel(models.Model):
ICEBERG_PROD, ICEBERG_SANDBOX, ICEBERG_STAGE, ICEBERG_SANDBOX_STAGE = "prod", "sa... |
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
DEFAULT_ICEBERG_ENV = getattr(settings, 'ICEBERG_DEFAULT_ENVIRO', "prod")
class IcebergBaseModel(models.Model):
ICEBERG_PROD, ICEBERG_SANDBOX, ICEBERG_STAGE, ICEBERG_SANDBOX_STAGE = "prod", "sa... | Add app_name for django < 1.7 compatibility | Add app_name for django < 1.7 compatibility
| Python | mit | izberg-marketplace/django-izberg,izberg-marketplace/django-izberg,Iceberg-Marketplace/django-iceberg,Iceberg-Marketplace/django-iceberg |
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
DEFAULT_ICEBERG_ENV = getattr(settings, 'ICEBERG_DEFAULT_ENVIRO', "prod")
class IcebergBaseModel(models.Model):
ICEBERG_PROD, ICEBERG_SANDBOX, ICEBERG_STAGE, ICEBERG_SANDBOX_STAGE = "prod", "sa... |
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
DEFAULT_ICEBERG_ENV = getattr(settings, 'ICEBERG_DEFAULT_ENVIRO', "prod")
class IcebergBaseModel(models.Model):
ICEBERG_PROD, ICEBERG_SANDBOX, ICEBERG_STAGE, ICEBERG_SANDBOX_STAGE = "prod", "sa... | <commit_before>
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
DEFAULT_ICEBERG_ENV = getattr(settings, 'ICEBERG_DEFAULT_ENVIRO', "prod")
class IcebergBaseModel(models.Model):
ICEBERG_PROD, ICEBERG_SANDBOX, ICEBERG_STAGE, ICEBERG_SANDBOX_STAG... |
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
DEFAULT_ICEBERG_ENV = getattr(settings, 'ICEBERG_DEFAULT_ENVIRO', "prod")
class IcebergBaseModel(models.Model):
ICEBERG_PROD, ICEBERG_SANDBOX, ICEBERG_STAGE, ICEBERG_SANDBOX_STAGE = "prod", "sa... |
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
DEFAULT_ICEBERG_ENV = getattr(settings, 'ICEBERG_DEFAULT_ENVIRO', "prod")
class IcebergBaseModel(models.Model):
ICEBERG_PROD, ICEBERG_SANDBOX, ICEBERG_STAGE, ICEBERG_SANDBOX_STAGE = "prod", "sa... | <commit_before>
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
DEFAULT_ICEBERG_ENV = getattr(settings, 'ICEBERG_DEFAULT_ENVIRO', "prod")
class IcebergBaseModel(models.Model):
ICEBERG_PROD, ICEBERG_SANDBOX, ICEBERG_STAGE, ICEBERG_SANDBOX_STAG... |
9535234db263f0155f515236457ee7ba5e9e1e0e | punic/cartfile.py | punic/cartfile.py | from __future__ import division, absolute_import, print_function
__all__ = ['Cartfile']
import re
from pathlib2 import Path
from .basic_types import *
from .errors import *
class Cartfile(object):
def __init__(self, specifications=None, overrides=None):
self.specifications = specifications if specificat... | from __future__ import division, absolute_import, print_function
__all__ = ['Cartfile']
import re
from pathlib2 import Path
from .basic_types import *
from .errors import *
class Cartfile(object):
def __init__(self, specifications=None, overrides=None):
self.specifications = specifications if specificat... | Fix processing of empty lines. | Fix processing of empty lines.
| Python | mit | schwa/punic | from __future__ import division, absolute_import, print_function
__all__ = ['Cartfile']
import re
from pathlib2 import Path
from .basic_types import *
from .errors import *
class Cartfile(object):
def __init__(self, specifications=None, overrides=None):
self.specifications = specifications if specificat... | from __future__ import division, absolute_import, print_function
__all__ = ['Cartfile']
import re
from pathlib2 import Path
from .basic_types import *
from .errors import *
class Cartfile(object):
def __init__(self, specifications=None, overrides=None):
self.specifications = specifications if specificat... | <commit_before>from __future__ import division, absolute_import, print_function
__all__ = ['Cartfile']
import re
from pathlib2 import Path
from .basic_types import *
from .errors import *
class Cartfile(object):
def __init__(self, specifications=None, overrides=None):
self.specifications = specification... | from __future__ import division, absolute_import, print_function
__all__ = ['Cartfile']
import re
from pathlib2 import Path
from .basic_types import *
from .errors import *
class Cartfile(object):
def __init__(self, specifications=None, overrides=None):
self.specifications = specifications if specificat... | from __future__ import division, absolute_import, print_function
__all__ = ['Cartfile']
import re
from pathlib2 import Path
from .basic_types import *
from .errors import *
class Cartfile(object):
def __init__(self, specifications=None, overrides=None):
self.specifications = specifications if specificat... | <commit_before>from __future__ import division, absolute_import, print_function
__all__ = ['Cartfile']
import re
from pathlib2 import Path
from .basic_types import *
from .errors import *
class Cartfile(object):
def __init__(self, specifications=None, overrides=None):
self.specifications = specification... |
0c186d8e0fb5bd7170ec55943e546f1e4e335839 | masters/master.tryserver.chromium/master_site_config.py | masters/master.tryserver.chromium/master_site_config.py | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""ActiveMaster definition."""
from config_bootstrap import Master
class TryServer(Master.Master4):
project_name = 'Chromium Try Server'
master_port = ... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""ActiveMaster definition."""
from config_bootstrap import Master
class TryServer(Master.Master4):
project_name = 'Chromium Try Server'
master_port = ... | Remove last good URL for tryserver.chromium | Remove last good URL for tryserver.chromium
The expected behavior of this change is that the tryserver master no longer tries
to resolve revisions to LKGR when trying jobs.
BUG=372499, 386667
Review URL: https://codereview.chromium.org/394653002
git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@283469 0039d316-1... | Python | bsd-3-clause | eunchong/build,eunchong/build,eunchong/build,eunchong/build | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""ActiveMaster definition."""
from config_bootstrap import Master
class TryServer(Master.Master4):
project_name = 'Chromium Try Server'
master_port = ... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""ActiveMaster definition."""
from config_bootstrap import Master
class TryServer(Master.Master4):
project_name = 'Chromium Try Server'
master_port = ... | <commit_before># Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""ActiveMaster definition."""
from config_bootstrap import Master
class TryServer(Master.Master4):
project_name = 'Chromium Try Server'
... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""ActiveMaster definition."""
from config_bootstrap import Master
class TryServer(Master.Master4):
project_name = 'Chromium Try Server'
master_port = ... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""ActiveMaster definition."""
from config_bootstrap import Master
class TryServer(Master.Master4):
project_name = 'Chromium Try Server'
master_port = ... | <commit_before># Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""ActiveMaster definition."""
from config_bootstrap import Master
class TryServer(Master.Master4):
project_name = 'Chromium Try Server'
... |
94e344b48161e20fec5023fbeea4a14cdc736158 | pynuts/filters.py | pynuts/filters.py | # -*- coding: utf-8 -*-
"""Jinja environment filters for Pynuts."""
from flask import escape
from flask.ext.wtf import (
QuerySelectField, QuerySelectMultipleField, BooleanField)
def data(field):
"""Field data beautifier.
QuerySelectMultipleField
Renders comma-separated data.
QuerySelectField... | # -*- coding: utf-8 -*-
"""Jinja environment filters for Pynuts."""
from flask import escape
from flask.ext.wtf import (
QuerySelectField, QuerySelectMultipleField, BooleanField)
def data(field):
"""Field data beautifier.
QuerySelectMultipleField
Renders comma-separated data.
QuerySelectField... | Return an "empty sequence" character instead of an empty list for empty select fields | Return an "empty sequence" character instead of an empty list for empty select fields
| Python | bsd-3-clause | Kozea/Pynuts,Kozea/Pynuts,Kozea/Pynuts | # -*- coding: utf-8 -*-
"""Jinja environment filters for Pynuts."""
from flask import escape
from flask.ext.wtf import (
QuerySelectField, QuerySelectMultipleField, BooleanField)
def data(field):
"""Field data beautifier.
QuerySelectMultipleField
Renders comma-separated data.
QuerySelectField... | # -*- coding: utf-8 -*-
"""Jinja environment filters for Pynuts."""
from flask import escape
from flask.ext.wtf import (
QuerySelectField, QuerySelectMultipleField, BooleanField)
def data(field):
"""Field data beautifier.
QuerySelectMultipleField
Renders comma-separated data.
QuerySelectField... | <commit_before># -*- coding: utf-8 -*-
"""Jinja environment filters for Pynuts."""
from flask import escape
from flask.ext.wtf import (
QuerySelectField, QuerySelectMultipleField, BooleanField)
def data(field):
"""Field data beautifier.
QuerySelectMultipleField
Renders comma-separated data.
Q... | # -*- coding: utf-8 -*-
"""Jinja environment filters for Pynuts."""
from flask import escape
from flask.ext.wtf import (
QuerySelectField, QuerySelectMultipleField, BooleanField)
def data(field):
"""Field data beautifier.
QuerySelectMultipleField
Renders comma-separated data.
QuerySelectField... | # -*- coding: utf-8 -*-
"""Jinja environment filters for Pynuts."""
from flask import escape
from flask.ext.wtf import (
QuerySelectField, QuerySelectMultipleField, BooleanField)
def data(field):
"""Field data beautifier.
QuerySelectMultipleField
Renders comma-separated data.
QuerySelectField... | <commit_before># -*- coding: utf-8 -*-
"""Jinja environment filters for Pynuts."""
from flask import escape
from flask.ext.wtf import (
QuerySelectField, QuerySelectMultipleField, BooleanField)
def data(field):
"""Field data beautifier.
QuerySelectMultipleField
Renders comma-separated data.
Q... |
7111860577c921dc3d1602fa16b22ddfb45b69ed | lots/migrations/0002_auto_20170717_2115.py | lots/migrations/0002_auto_20170717_2115.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-18 02:15
from __future__ import unicode_literals
from django.db import models, migrations
def load_data(apps, schema_editor):
LotType = apps.get_model("lots", "LotType")
LotType(name="Casa").save()
LotType(name="Lote").save()
class Migrat... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-18 02:15
from __future__ import unicode_literals
from django.db import models, migrations
from lots.models import LotType
def load_data(apps, schema_editor):
LotType = apps.get_model("lots", "LotType")
LotType(name="Casa").save()
LotType(n... | Add reverse action to importing default lot types | Add reverse action to importing default lot types
| Python | mpl-2.0 | jackbravo/condorest-django,jackbravo/condorest-django,jackbravo/condorest-django | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-18 02:15
from __future__ import unicode_literals
from django.db import models, migrations
def load_data(apps, schema_editor):
LotType = apps.get_model("lots", "LotType")
LotType(name="Casa").save()
LotType(name="Lote").save()
class Migrat... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-18 02:15
from __future__ import unicode_literals
from django.db import models, migrations
from lots.models import LotType
def load_data(apps, schema_editor):
LotType = apps.get_model("lots", "LotType")
LotType(name="Casa").save()
LotType(n... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-18 02:15
from __future__ import unicode_literals
from django.db import models, migrations
def load_data(apps, schema_editor):
LotType = apps.get_model("lots", "LotType")
LotType(name="Casa").save()
LotType(name="Lote").save()... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-18 02:15
from __future__ import unicode_literals
from django.db import models, migrations
from lots.models import LotType
def load_data(apps, schema_editor):
LotType = apps.get_model("lots", "LotType")
LotType(name="Casa").save()
LotType(n... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-18 02:15
from __future__ import unicode_literals
from django.db import models, migrations
def load_data(apps, schema_editor):
LotType = apps.get_model("lots", "LotType")
LotType(name="Casa").save()
LotType(name="Lote").save()
class Migrat... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-18 02:15
from __future__ import unicode_literals
from django.db import models, migrations
def load_data(apps, schema_editor):
LotType = apps.get_model("lots", "LotType")
LotType(name="Casa").save()
LotType(name="Lote").save()... |
78f55cf57d88378e59cf1399d7ef80082d3f9555 | bluebottle/partners/serializers.py | bluebottle/partners/serializers.py | from bluebottle.bluebottle_drf2.serializers import ImageSerializer
from bluebottle.projects.models import PartnerOrganization
from bluebottle.projects.serializers import ProjectPreviewSerializer as BaseProjectPreviewSerializer
from rest_framework import serializers
# This is a bit of a hack. We have an existing Proje... | from bluebottle.bluebottle_drf2.serializers import ImageSerializer
from bluebottle.projects.models import PartnerOrganization
from bluebottle.projects.serializers import ProjectPreviewSerializer
from rest_framework import serializers
class PartnerOrganizationPreviewSerializer(serializers.ModelSerializer):
id = se... | Fix partner project serializer. (The comment was outdated btw) | Fix partner project serializer. (The comment was outdated btw)
| Python | bsd-3-clause | onepercentclub/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle | from bluebottle.bluebottle_drf2.serializers import ImageSerializer
from bluebottle.projects.models import PartnerOrganization
from bluebottle.projects.serializers import ProjectPreviewSerializer as BaseProjectPreviewSerializer
from rest_framework import serializers
# This is a bit of a hack. We have an existing Proje... | from bluebottle.bluebottle_drf2.serializers import ImageSerializer
from bluebottle.projects.models import PartnerOrganization
from bluebottle.projects.serializers import ProjectPreviewSerializer
from rest_framework import serializers
class PartnerOrganizationPreviewSerializer(serializers.ModelSerializer):
id = se... | <commit_before>from bluebottle.bluebottle_drf2.serializers import ImageSerializer
from bluebottle.projects.models import PartnerOrganization
from bluebottle.projects.serializers import ProjectPreviewSerializer as BaseProjectPreviewSerializer
from rest_framework import serializers
# This is a bit of a hack. We have an... | from bluebottle.bluebottle_drf2.serializers import ImageSerializer
from bluebottle.projects.models import PartnerOrganization
from bluebottle.projects.serializers import ProjectPreviewSerializer
from rest_framework import serializers
class PartnerOrganizationPreviewSerializer(serializers.ModelSerializer):
id = se... | from bluebottle.bluebottle_drf2.serializers import ImageSerializer
from bluebottle.projects.models import PartnerOrganization
from bluebottle.projects.serializers import ProjectPreviewSerializer as BaseProjectPreviewSerializer
from rest_framework import serializers
# This is a bit of a hack. We have an existing Proje... | <commit_before>from bluebottle.bluebottle_drf2.serializers import ImageSerializer
from bluebottle.projects.models import PartnerOrganization
from bluebottle.projects.serializers import ProjectPreviewSerializer as BaseProjectPreviewSerializer
from rest_framework import serializers
# This is a bit of a hack. We have an... |
b973a1686f269044e670704b56c07ca79336c29c | mythril/laser/ethereum/strategy/basic.py | mythril/laser/ethereum/strategy/basic.py | class DepthFirstSearchStrategy:
def __init__(self, content, max_depth):
self.content = content
self.max_depth = max_depth
def __iter__(self):
return self
def __next__(self):
try:
global_state = self.content.pop(0)
if global_state.mstate.depth >= sel... | """
This module implements basic symbolic execution search strategies
"""
class DepthFirstSearchStrategy:
"""
Implements a depth first search strategy
I.E. Follow one path to a leaf, and then continue to the next one
"""
def __init__(self, work_list, max_depth):
self.work_list = work_list
... | Add documentation and fix pop | Add documentation and fix pop
| Python | mit | b-mueller/mythril,b-mueller/mythril,b-mueller/mythril,b-mueller/mythril | class DepthFirstSearchStrategy:
def __init__(self, content, max_depth):
self.content = content
self.max_depth = max_depth
def __iter__(self):
return self
def __next__(self):
try:
global_state = self.content.pop(0)
if global_state.mstate.depth >= sel... | """
This module implements basic symbolic execution search strategies
"""
class DepthFirstSearchStrategy:
"""
Implements a depth first search strategy
I.E. Follow one path to a leaf, and then continue to the next one
"""
def __init__(self, work_list, max_depth):
self.work_list = work_list
... | <commit_before>class DepthFirstSearchStrategy:
def __init__(self, content, max_depth):
self.content = content
self.max_depth = max_depth
def __iter__(self):
return self
def __next__(self):
try:
global_state = self.content.pop(0)
if global_state.msta... | """
This module implements basic symbolic execution search strategies
"""
class DepthFirstSearchStrategy:
"""
Implements a depth first search strategy
I.E. Follow one path to a leaf, and then continue to the next one
"""
def __init__(self, work_list, max_depth):
self.work_list = work_list
... | class DepthFirstSearchStrategy:
def __init__(self, content, max_depth):
self.content = content
self.max_depth = max_depth
def __iter__(self):
return self
def __next__(self):
try:
global_state = self.content.pop(0)
if global_state.mstate.depth >= sel... | <commit_before>class DepthFirstSearchStrategy:
def __init__(self, content, max_depth):
self.content = content
self.max_depth = max_depth
def __iter__(self):
return self
def __next__(self):
try:
global_state = self.content.pop(0)
if global_state.msta... |
052c0cfd1ce21b36c9c9a44193e3a9c89ca871f1 | ciscripts/coverage/bii/coverage.py | ciscripts/coverage/bii/coverage.py | # /ciscripts/coverage/bii/coverage.py
#
# Submit coverage totals for a bii project to coveralls
#
# See /LICENCE.md for Copyright information
"""Submit coverage totals for a bii project to coveralls."""
import errno
import os
from contextlib import contextmanager
@contextmanager
def _bii_deps_in_place(cont):
"... | # /ciscripts/coverage/bii/coverage.py
#
# Submit coverage totals for a bii project to coveralls
#
# See /LICENCE.md for Copyright information
"""Submit coverage totals for a bii project to coveralls."""
import errno
import os
from contextlib import contextmanager
def _move_ignore_enoent(src, dst):
"""Move src ... | Make _bii_deps_in_place actually behave like a context manager | bii: Make _bii_deps_in_place actually behave like a context manager
| Python | mit | polysquare/polysquare-ci-scripts,polysquare/polysquare-ci-scripts | # /ciscripts/coverage/bii/coverage.py
#
# Submit coverage totals for a bii project to coveralls
#
# See /LICENCE.md for Copyright information
"""Submit coverage totals for a bii project to coveralls."""
import errno
import os
from contextlib import contextmanager
@contextmanager
def _bii_deps_in_place(cont):
"... | # /ciscripts/coverage/bii/coverage.py
#
# Submit coverage totals for a bii project to coveralls
#
# See /LICENCE.md for Copyright information
"""Submit coverage totals for a bii project to coveralls."""
import errno
import os
from contextlib import contextmanager
def _move_ignore_enoent(src, dst):
"""Move src ... | <commit_before># /ciscripts/coverage/bii/coverage.py
#
# Submit coverage totals for a bii project to coveralls
#
# See /LICENCE.md for Copyright information
"""Submit coverage totals for a bii project to coveralls."""
import errno
import os
from contextlib import contextmanager
@contextmanager
def _bii_deps_in_pla... | # /ciscripts/coverage/bii/coverage.py
#
# Submit coverage totals for a bii project to coveralls
#
# See /LICENCE.md for Copyright information
"""Submit coverage totals for a bii project to coveralls."""
import errno
import os
from contextlib import contextmanager
def _move_ignore_enoent(src, dst):
"""Move src ... | # /ciscripts/coverage/bii/coverage.py
#
# Submit coverage totals for a bii project to coveralls
#
# See /LICENCE.md for Copyright information
"""Submit coverage totals for a bii project to coveralls."""
import errno
import os
from contextlib import contextmanager
@contextmanager
def _bii_deps_in_place(cont):
"... | <commit_before># /ciscripts/coverage/bii/coverage.py
#
# Submit coverage totals for a bii project to coveralls
#
# See /LICENCE.md for Copyright information
"""Submit coverage totals for a bii project to coveralls."""
import errno
import os
from contextlib import contextmanager
@contextmanager
def _bii_deps_in_pla... |
08300895dc8d2abb740dd71b027e9acda8bb84dd | chatterbot/ext/django_chatterbot/views.py | chatterbot/ext/django_chatterbot/views.py | from django.views.generic import View
from django.http import JsonResponse
from django.conf import settings
class ChatterBotView(View):
def post(self, request, *args, **kwargs):
input_statement = request.POST.get('text')
response_data = settings.CHATTERBOT.get_response(input_statement)
... | from django.views.generic import View
from django.http import JsonResponse
from django.conf import settings
from chatterbot import ChatBot
class ChatterBotView(View):
chatterbot = ChatBot(
settings.CHATTERBOT['NAME'],
storage_adapter='chatterbot.adapters.storage.DjangoStorageAdapter',
inp... | Initialize ChatterBot in django view module instead of settings. | Initialize ChatterBot in django view module instead of settings.
| Python | bsd-3-clause | Reinaesaya/OUIRL-ChatBot,Reinaesaya/OUIRL-ChatBot,vkosuri/ChatterBot,davizucon/ChatterBot,gunthercox/ChatterBot,maclogan/VirtualPenPal,Gustavo6046/ChatterBot | from django.views.generic import View
from django.http import JsonResponse
from django.conf import settings
class ChatterBotView(View):
def post(self, request, *args, **kwargs):
input_statement = request.POST.get('text')
response_data = settings.CHATTERBOT.get_response(input_statement)
... | from django.views.generic import View
from django.http import JsonResponse
from django.conf import settings
from chatterbot import ChatBot
class ChatterBotView(View):
chatterbot = ChatBot(
settings.CHATTERBOT['NAME'],
storage_adapter='chatterbot.adapters.storage.DjangoStorageAdapter',
inp... | <commit_before>from django.views.generic import View
from django.http import JsonResponse
from django.conf import settings
class ChatterBotView(View):
def post(self, request, *args, **kwargs):
input_statement = request.POST.get('text')
response_data = settings.CHATTERBOT.get_response(input_state... | from django.views.generic import View
from django.http import JsonResponse
from django.conf import settings
from chatterbot import ChatBot
class ChatterBotView(View):
chatterbot = ChatBot(
settings.CHATTERBOT['NAME'],
storage_adapter='chatterbot.adapters.storage.DjangoStorageAdapter',
inp... | from django.views.generic import View
from django.http import JsonResponse
from django.conf import settings
class ChatterBotView(View):
def post(self, request, *args, **kwargs):
input_statement = request.POST.get('text')
response_data = settings.CHATTERBOT.get_response(input_statement)
... | <commit_before>from django.views.generic import View
from django.http import JsonResponse
from django.conf import settings
class ChatterBotView(View):
def post(self, request, *args, **kwargs):
input_statement = request.POST.get('text')
response_data = settings.CHATTERBOT.get_response(input_state... |
5c0c2f470451c69a2b4cbba3746d26207c6b17a9 | lang/__init__.py | lang/__init__.py | from . import tokenizer, ast, codegen
import sys, os, subprocess
TRIPLES = {
'darwin': 'x86_64-apple-darwin11.0.0',
'linux2': 'x86_64-pc-linux-gnu',
}
def llir(fn, full=True):
src = codegen.source(ast.parse(tokenizer.tokenize(open(fn))))
if not full:
return src
std = []
for fn in sorted(os.listdir('rt')):... | from . import tokenizer, ast, codegen
import sys, os, subprocess
BASE = os.path.dirname(__path__[0])
RT_DIR = os.path.join(BASE, 'rt')
TRIPLES = {
'darwin': 'x86_64-apple-darwin11.0.0',
'linux2': 'x86_64-pc-linux-gnu',
}
def llir(fn, full=True):
src = codegen.source(ast.parse(tokenizer.tokenize(open(fn))))
if ... | Fix up path to runtime library directory. | Fix up path to runtime library directory.
| Python | mit | djc/runa,djc/runa,djc/runa,djc/runa | from . import tokenizer, ast, codegen
import sys, os, subprocess
TRIPLES = {
'darwin': 'x86_64-apple-darwin11.0.0',
'linux2': 'x86_64-pc-linux-gnu',
}
def llir(fn, full=True):
src = codegen.source(ast.parse(tokenizer.tokenize(open(fn))))
if not full:
return src
std = []
for fn in sorted(os.listdir('rt')):... | from . import tokenizer, ast, codegen
import sys, os, subprocess
BASE = os.path.dirname(__path__[0])
RT_DIR = os.path.join(BASE, 'rt')
TRIPLES = {
'darwin': 'x86_64-apple-darwin11.0.0',
'linux2': 'x86_64-pc-linux-gnu',
}
def llir(fn, full=True):
src = codegen.source(ast.parse(tokenizer.tokenize(open(fn))))
if ... | <commit_before>from . import tokenizer, ast, codegen
import sys, os, subprocess
TRIPLES = {
'darwin': 'x86_64-apple-darwin11.0.0',
'linux2': 'x86_64-pc-linux-gnu',
}
def llir(fn, full=True):
src = codegen.source(ast.parse(tokenizer.tokenize(open(fn))))
if not full:
return src
std = []
for fn in sorted(os.... | from . import tokenizer, ast, codegen
import sys, os, subprocess
BASE = os.path.dirname(__path__[0])
RT_DIR = os.path.join(BASE, 'rt')
TRIPLES = {
'darwin': 'x86_64-apple-darwin11.0.0',
'linux2': 'x86_64-pc-linux-gnu',
}
def llir(fn, full=True):
src = codegen.source(ast.parse(tokenizer.tokenize(open(fn))))
if ... | from . import tokenizer, ast, codegen
import sys, os, subprocess
TRIPLES = {
'darwin': 'x86_64-apple-darwin11.0.0',
'linux2': 'x86_64-pc-linux-gnu',
}
def llir(fn, full=True):
src = codegen.source(ast.parse(tokenizer.tokenize(open(fn))))
if not full:
return src
std = []
for fn in sorted(os.listdir('rt')):... | <commit_before>from . import tokenizer, ast, codegen
import sys, os, subprocess
TRIPLES = {
'darwin': 'x86_64-apple-darwin11.0.0',
'linux2': 'x86_64-pc-linux-gnu',
}
def llir(fn, full=True):
src = codegen.source(ast.parse(tokenizer.tokenize(open(fn))))
if not full:
return src
std = []
for fn in sorted(os.... |
4c00c394e4015a7cae5c5de574d996b20252ea3f | corgi/numpy_utils.py | corgi/numpy_utils.py | def remove_low_variance(X, low_variance_threshold=1e-4, axis=0):
low_variance = X.var(axis=axis) < low_variance_threshold
X[:, ~low_variance]
return X
def normalize(X):
zero_mean = X - X.mean()
return (zero_mean + zero_mean.min()) / X.max()
| def remove_low_variance(X, low_variance_threshold=1e-4, axis=0):
low_variance = X.var(axis=axis) < low_variance_threshold
X[:, ~low_variance]
return X
def normalize(X):
zero_mean = X - X.mean()
return (zero_mean + zero_mean.min()) / X.max()
def independent_columns(A, tol=1e-05):
"""
Retu... | Add a function for removing & finding independent columns from an array | Add a function for removing & finding independent columns from an array
| Python | mit | log0ymxm/corgi | def remove_low_variance(X, low_variance_threshold=1e-4, axis=0):
low_variance = X.var(axis=axis) < low_variance_threshold
X[:, ~low_variance]
return X
def normalize(X):
zero_mean = X - X.mean()
return (zero_mean + zero_mean.min()) / X.max()
Add a function for removing & finding independent columns... | def remove_low_variance(X, low_variance_threshold=1e-4, axis=0):
low_variance = X.var(axis=axis) < low_variance_threshold
X[:, ~low_variance]
return X
def normalize(X):
zero_mean = X - X.mean()
return (zero_mean + zero_mean.min()) / X.max()
def independent_columns(A, tol=1e-05):
"""
Retu... | <commit_before>def remove_low_variance(X, low_variance_threshold=1e-4, axis=0):
low_variance = X.var(axis=axis) < low_variance_threshold
X[:, ~low_variance]
return X
def normalize(X):
zero_mean = X - X.mean()
return (zero_mean + zero_mean.min()) / X.max()
<commit_msg>Add a function for removing & ... | def remove_low_variance(X, low_variance_threshold=1e-4, axis=0):
low_variance = X.var(axis=axis) < low_variance_threshold
X[:, ~low_variance]
return X
def normalize(X):
zero_mean = X - X.mean()
return (zero_mean + zero_mean.min()) / X.max()
def independent_columns(A, tol=1e-05):
"""
Retu... | def remove_low_variance(X, low_variance_threshold=1e-4, axis=0):
low_variance = X.var(axis=axis) < low_variance_threshold
X[:, ~low_variance]
return X
def normalize(X):
zero_mean = X - X.mean()
return (zero_mean + zero_mean.min()) / X.max()
Add a function for removing & finding independent columns... | <commit_before>def remove_low_variance(X, low_variance_threshold=1e-4, axis=0):
low_variance = X.var(axis=axis) < low_variance_threshold
X[:, ~low_variance]
return X
def normalize(X):
zero_mean = X - X.mean()
return (zero_mean + zero_mean.min()) / X.max()
<commit_msg>Add a function for removing & ... |
129cd22de51d58cc956ca5586fc15cd2e247446b | gpkitmodels/GP/aircraft/prop/propeller.py | gpkitmodels/GP/aircraft/prop/propeller.py | " propeller model "
from numpy import pi
from gpkit import Model, parse_variables, SignomialsEnabled, SignomialEquality
class Propeller(Model):
""" Propeller Model
Variables
---------
R 10 [m] prop radius
"""
def setup(self):
exec parse_variables(Propeller._... | " propeller model "
from numpy import pi
from gpkit import Model, parse_variables, SignomialsEnabled, SignomialEquality
class Propeller(Model):
""" Propeller Model
Variables
---------
R 10 [m] prop radius
W 10 [lbf] prop weight
"""
def ... | Add prop structure and performance models | Add prop structure and performance models
| Python | mit | convexengineering/gplibrary,convexengineering/gplibrary | " propeller model "
from numpy import pi
from gpkit import Model, parse_variables, SignomialsEnabled, SignomialEquality
class Propeller(Model):
""" Propeller Model
Variables
---------
R 10 [m] prop radius
"""
def setup(self):
exec parse_variables(Propeller._... | " propeller model "
from numpy import pi
from gpkit import Model, parse_variables, SignomialsEnabled, SignomialEquality
class Propeller(Model):
""" Propeller Model
Variables
---------
R 10 [m] prop radius
W 10 [lbf] prop weight
"""
def ... | <commit_before>" propeller model "
from numpy import pi
from gpkit import Model, parse_variables, SignomialsEnabled, SignomialEquality
class Propeller(Model):
""" Propeller Model
Variables
---------
R 10 [m] prop radius
"""
def setup(self):
exec parse_variab... | " propeller model "
from numpy import pi
from gpkit import Model, parse_variables, SignomialsEnabled, SignomialEquality
class Propeller(Model):
""" Propeller Model
Variables
---------
R 10 [m] prop radius
W 10 [lbf] prop weight
"""
def ... | " propeller model "
from numpy import pi
from gpkit import Model, parse_variables, SignomialsEnabled, SignomialEquality
class Propeller(Model):
""" Propeller Model
Variables
---------
R 10 [m] prop radius
"""
def setup(self):
exec parse_variables(Propeller._... | <commit_before>" propeller model "
from numpy import pi
from gpkit import Model, parse_variables, SignomialsEnabled, SignomialEquality
class Propeller(Model):
""" Propeller Model
Variables
---------
R 10 [m] prop radius
"""
def setup(self):
exec parse_variab... |
085a61894143b525a8cf8fe7f2029e4993a4279a | lib/exp/filters/ransac.py | lib/exp/filters/ransac.py | import numpy as np
import cv2
from core import KpFilter
class Ransac(KpFilter):
def __init__(self, data):
KpFilter.__init__(self, data)
def __good_pts(self, kps, mps):
rr = [kps[m].pt for m in mps]
return np.float32(rr).reshape(-1, 1, 2)
def __compute(self, good, skp, vkp, min_ma... | import numpy as np
import cv2
from core import KpFilter
class Ransac(KpFilter):
def __init__(self, data):
KpFilter.__init__(self, data)
def __good_pts(self, kps, mps):
rr = [kps[m].pt for m in mps]
return np.float32(rr).reshape(-1, 1, 2)
def __compute(self, good, skp, vkp, min_ma... | Fix filter_ method calling parent method bug | Fix filter_ method calling parent method bug
| Python | agpl-3.0 | speed-of-light/pyslider | import numpy as np
import cv2
from core import KpFilter
class Ransac(KpFilter):
def __init__(self, data):
KpFilter.__init__(self, data)
def __good_pts(self, kps, mps):
rr = [kps[m].pt for m in mps]
return np.float32(rr).reshape(-1, 1, 2)
def __compute(self, good, skp, vkp, min_ma... | import numpy as np
import cv2
from core import KpFilter
class Ransac(KpFilter):
def __init__(self, data):
KpFilter.__init__(self, data)
def __good_pts(self, kps, mps):
rr = [kps[m].pt for m in mps]
return np.float32(rr).reshape(-1, 1, 2)
def __compute(self, good, skp, vkp, min_ma... | <commit_before>import numpy as np
import cv2
from core import KpFilter
class Ransac(KpFilter):
def __init__(self, data):
KpFilter.__init__(self, data)
def __good_pts(self, kps, mps):
rr = [kps[m].pt for m in mps]
return np.float32(rr).reshape(-1, 1, 2)
def __compute(self, good, s... | import numpy as np
import cv2
from core import KpFilter
class Ransac(KpFilter):
def __init__(self, data):
KpFilter.__init__(self, data)
def __good_pts(self, kps, mps):
rr = [kps[m].pt for m in mps]
return np.float32(rr).reshape(-1, 1, 2)
def __compute(self, good, skp, vkp, min_ma... | import numpy as np
import cv2
from core import KpFilter
class Ransac(KpFilter):
def __init__(self, data):
KpFilter.__init__(self, data)
def __good_pts(self, kps, mps):
rr = [kps[m].pt for m in mps]
return np.float32(rr).reshape(-1, 1, 2)
def __compute(self, good, skp, vkp, min_ma... | <commit_before>import numpy as np
import cv2
from core import KpFilter
class Ransac(KpFilter):
def __init__(self, data):
KpFilter.__init__(self, data)
def __good_pts(self, kps, mps):
rr = [kps[m].pt for m in mps]
return np.float32(rr).reshape(-1, 1, 2)
def __compute(self, good, s... |
570bbe3add6a19a7ec6c14adfa04da76d14aa740 | common/templatetags/lutris.py | common/templatetags/lutris.py | import copy
from django import template
from django.conf import settings
from games import models
register = template.Library()
def get_links(user_agent):
systems = ['ubuntu', 'fedora', 'linux']
downloads = copy.copy(settings.DOWNLOADS)
main_download = None
for system in systems:
if system ... | import copy
from django import template
from django.conf import settings
from games import models
register = template.Library()
def get_links(user_agent):
systems = ['ubuntu', 'fedora', 'linux']
downloads = copy.copy(settings.DOWNLOADS)
main_download = None
for system in systems:
if system ... | Fix bug in download links | Fix bug in download links
| Python | agpl-3.0 | Turupawn/website,Turupawn/website,Turupawn/website,lutris/website,Turupawn/website,lutris/website,lutris/website,lutris/website | import copy
from django import template
from django.conf import settings
from games import models
register = template.Library()
def get_links(user_agent):
systems = ['ubuntu', 'fedora', 'linux']
downloads = copy.copy(settings.DOWNLOADS)
main_download = None
for system in systems:
if system ... | import copy
from django import template
from django.conf import settings
from games import models
register = template.Library()
def get_links(user_agent):
systems = ['ubuntu', 'fedora', 'linux']
downloads = copy.copy(settings.DOWNLOADS)
main_download = None
for system in systems:
if system ... | <commit_before>import copy
from django import template
from django.conf import settings
from games import models
register = template.Library()
def get_links(user_agent):
systems = ['ubuntu', 'fedora', 'linux']
downloads = copy.copy(settings.DOWNLOADS)
main_download = None
for system in systems:
... | import copy
from django import template
from django.conf import settings
from games import models
register = template.Library()
def get_links(user_agent):
systems = ['ubuntu', 'fedora', 'linux']
downloads = copy.copy(settings.DOWNLOADS)
main_download = None
for system in systems:
if system ... | import copy
from django import template
from django.conf import settings
from games import models
register = template.Library()
def get_links(user_agent):
systems = ['ubuntu', 'fedora', 'linux']
downloads = copy.copy(settings.DOWNLOADS)
main_download = None
for system in systems:
if system ... | <commit_before>import copy
from django import template
from django.conf import settings
from games import models
register = template.Library()
def get_links(user_agent):
systems = ['ubuntu', 'fedora', 'linux']
downloads = copy.copy(settings.DOWNLOADS)
main_download = None
for system in systems:
... |
2c63efeb705637a068c909be7dc72f18e90561bf | cloudbridge/cloud/providers/azure/test/test_azure_resource_group.py | cloudbridge/cloud/providers/azure/test/test_azure_resource_group.py | from cloudbridge.cloud.providers.azure.test.helpers import ProviderTestBase
class AzureResourceGroupTestCase(ProviderTestBase):
def test_resource_group_create(self):
resource_group_params = {'location': self.provider.region_name}
rg = self.provider.azure_client. \
create_resource_group... | from cloudbridge.cloud.providers.azure.test.helpers import ProviderTestBase
class AzureResourceGroupTestCase(ProviderTestBase):
def test_resource_group_create(self):
resource_group_params = {'location': self.provider.region_name}
rg = self.provider.azure_client. \
create_resource_group... | Update resource group unit test | Update resource group unit test
| Python | mit | ms-azure-cloudbroker/cloudbridge | from cloudbridge.cloud.providers.azure.test.helpers import ProviderTestBase
class AzureResourceGroupTestCase(ProviderTestBase):
def test_resource_group_create(self):
resource_group_params = {'location': self.provider.region_name}
rg = self.provider.azure_client. \
create_resource_group... | from cloudbridge.cloud.providers.azure.test.helpers import ProviderTestBase
class AzureResourceGroupTestCase(ProviderTestBase):
def test_resource_group_create(self):
resource_group_params = {'location': self.provider.region_name}
rg = self.provider.azure_client. \
create_resource_group... | <commit_before>from cloudbridge.cloud.providers.azure.test.helpers import ProviderTestBase
class AzureResourceGroupTestCase(ProviderTestBase):
def test_resource_group_create(self):
resource_group_params = {'location': self.provider.region_name}
rg = self.provider.azure_client. \
create... | from cloudbridge.cloud.providers.azure.test.helpers import ProviderTestBase
class AzureResourceGroupTestCase(ProviderTestBase):
def test_resource_group_create(self):
resource_group_params = {'location': self.provider.region_name}
rg = self.provider.azure_client. \
create_resource_group... | from cloudbridge.cloud.providers.azure.test.helpers import ProviderTestBase
class AzureResourceGroupTestCase(ProviderTestBase):
def test_resource_group_create(self):
resource_group_params = {'location': self.provider.region_name}
rg = self.provider.azure_client. \
create_resource_group... | <commit_before>from cloudbridge.cloud.providers.azure.test.helpers import ProviderTestBase
class AzureResourceGroupTestCase(ProviderTestBase):
def test_resource_group_create(self):
resource_group_params = {'location': self.provider.region_name}
rg = self.provider.azure_client. \
create... |
276f74dfef46f5fa0913ddd3759d682eb58c7cec | chmvh_website/gallery/tasks.py | chmvh_website/gallery/tasks.py | from io import BytesIO
from django.conf import settings
from django.core.files.base import ContentFile
from PIL import Image
from chmvh_website import celery_app
@celery_app.task
def create_thumbnail(patient):
image = Image.open(patient.picture.path)
pil_type = image.format
if pil_type == 'JPEG':
... | from io import BytesIO
from celery.utils.log import get_task_logger
from django.conf import settings
from django.core.files.base import ContentFile
from PIL import Image
from chmvh_website import celery_app
_INVALID_FORMAT_ERROR = ("Can't generate thumbnail for {type} filetype. "
"(Path: ... | Add logging to thumbnail creation task. | Add logging to thumbnail creation task.
| Python | mit | cdriehuys/chmvh-website,cdriehuys/chmvh-website,cdriehuys/chmvh-website | from io import BytesIO
from django.conf import settings
from django.core.files.base import ContentFile
from PIL import Image
from chmvh_website import celery_app
@celery_app.task
def create_thumbnail(patient):
image = Image.open(patient.picture.path)
pil_type = image.format
if pil_type == 'JPEG':
... | from io import BytesIO
from celery.utils.log import get_task_logger
from django.conf import settings
from django.core.files.base import ContentFile
from PIL import Image
from chmvh_website import celery_app
_INVALID_FORMAT_ERROR = ("Can't generate thumbnail for {type} filetype. "
"(Path: ... | <commit_before>from io import BytesIO
from django.conf import settings
from django.core.files.base import ContentFile
from PIL import Image
from chmvh_website import celery_app
@celery_app.task
def create_thumbnail(patient):
image = Image.open(patient.picture.path)
pil_type = image.format
if pil_type ... | from io import BytesIO
from celery.utils.log import get_task_logger
from django.conf import settings
from django.core.files.base import ContentFile
from PIL import Image
from chmvh_website import celery_app
_INVALID_FORMAT_ERROR = ("Can't generate thumbnail for {type} filetype. "
"(Path: ... | from io import BytesIO
from django.conf import settings
from django.core.files.base import ContentFile
from PIL import Image
from chmvh_website import celery_app
@celery_app.task
def create_thumbnail(patient):
image = Image.open(patient.picture.path)
pil_type = image.format
if pil_type == 'JPEG':
... | <commit_before>from io import BytesIO
from django.conf import settings
from django.core.files.base import ContentFile
from PIL import Image
from chmvh_website import celery_app
@celery_app.task
def create_thumbnail(patient):
image = Image.open(patient.picture.path)
pil_type = image.format
if pil_type ... |
d535cf76b3129c0e5b6908a720bdf3e3a804e41b | mopidy/mixers/gstreamer_software.py | mopidy/mixers/gstreamer_software.py | import multiprocessing
from mopidy.mixers import BaseMixer
from mopidy.utils.process import pickle_connection
class GStreamerSoftwareMixer(BaseMixer):
"""Mixer which uses GStreamer to control volume in software."""
def __init__(self, *args, **kwargs):
super(GStreamerSoftwareMixer, self).__init__(*arg... | from mopidy.mixers import BaseMixer
class GStreamerSoftwareMixer(BaseMixer):
"""Mixer which uses GStreamer to control volume in software."""
def __init__(self, *args, **kwargs):
super(GStreamerSoftwareMixer, self).__init__(*args, **kwargs)
def _get_volume(self):
return self.backend.output... | Update GStreamer software mixer to use new output API | Update GStreamer software mixer to use new output API
| Python | apache-2.0 | SuperStarPL/mopidy,bacontext/mopidy,dbrgn/mopidy,ali/mopidy,quartz55/mopidy,adamcik/mopidy,liamw9534/mopidy,ali/mopidy,swak/mopidy,liamw9534/mopidy,abarisain/mopidy,swak/mopidy,mopidy/mopidy,pacificIT/mopidy,swak/mopidy,diandiankan/mopidy,adamcik/mopidy,bencevans/mopidy,hkariti/mopidy,glogiotatidis/mopidy,vrs01/mopidy,... | import multiprocessing
from mopidy.mixers import BaseMixer
from mopidy.utils.process import pickle_connection
class GStreamerSoftwareMixer(BaseMixer):
"""Mixer which uses GStreamer to control volume in software."""
def __init__(self, *args, **kwargs):
super(GStreamerSoftwareMixer, self).__init__(*arg... | from mopidy.mixers import BaseMixer
class GStreamerSoftwareMixer(BaseMixer):
"""Mixer which uses GStreamer to control volume in software."""
def __init__(self, *args, **kwargs):
super(GStreamerSoftwareMixer, self).__init__(*args, **kwargs)
def _get_volume(self):
return self.backend.output... | <commit_before>import multiprocessing
from mopidy.mixers import BaseMixer
from mopidy.utils.process import pickle_connection
class GStreamerSoftwareMixer(BaseMixer):
"""Mixer which uses GStreamer to control volume in software."""
def __init__(self, *args, **kwargs):
super(GStreamerSoftwareMixer, self... | from mopidy.mixers import BaseMixer
class GStreamerSoftwareMixer(BaseMixer):
"""Mixer which uses GStreamer to control volume in software."""
def __init__(self, *args, **kwargs):
super(GStreamerSoftwareMixer, self).__init__(*args, **kwargs)
def _get_volume(self):
return self.backend.output... | import multiprocessing
from mopidy.mixers import BaseMixer
from mopidy.utils.process import pickle_connection
class GStreamerSoftwareMixer(BaseMixer):
"""Mixer which uses GStreamer to control volume in software."""
def __init__(self, *args, **kwargs):
super(GStreamerSoftwareMixer, self).__init__(*arg... | <commit_before>import multiprocessing
from mopidy.mixers import BaseMixer
from mopidy.utils.process import pickle_connection
class GStreamerSoftwareMixer(BaseMixer):
"""Mixer which uses GStreamer to control volume in software."""
def __init__(self, *args, **kwargs):
super(GStreamerSoftwareMixer, self... |
104c136488d468f26c7fe247d0548636cbf3c6fe | random_4.py | random_4.py | """ How to generate a random 4 digit number not starting with 0 and having unique digits in python? """
import random
l = [0,1,2,3,4,5,6,7,8,9]
random.shuffle(l)
if l[0] == 0:
print(''.join(map(str, l[1:5])))
else:
print(''.join(map(str, l[0:4])))
| """ How to generate a random 4 digit number not starting with 0 and having unique digits in python? """
import random
# 1.
l = [0,1,2,3,4,5,6,7,8,9]
random.shuffle(l)
if l[0] == 0:
pos = random.choice(range(1, len(l)))
l[0], l[pos] = l[pos], l[0]
print(''.join(map(str, l[0:4])))
# 2.
# We create a set of dig... | Fix of shuffle. There should be random swap of leading zero with one from nine (non-zero) positions. | Fix of shuffle. There should be random swap of leading zero with one from nine (non-zero) positions.
| Python | mit | foobar167/junkyard,foobar167/junkyard,foobar167/junkyard,foobar167/junkyard,foobar167/junkyard,foobar167/junkyard | """ How to generate a random 4 digit number not starting with 0 and having unique digits in python? """
import random
l = [0,1,2,3,4,5,6,7,8,9]
random.shuffle(l)
if l[0] == 0:
print(''.join(map(str, l[1:5])))
else:
print(''.join(map(str, l[0:4])))
Fix of shuffle. There should be random swap of leading zero wit... | """ How to generate a random 4 digit number not starting with 0 and having unique digits in python? """
import random
# 1.
l = [0,1,2,3,4,5,6,7,8,9]
random.shuffle(l)
if l[0] == 0:
pos = random.choice(range(1, len(l)))
l[0], l[pos] = l[pos], l[0]
print(''.join(map(str, l[0:4])))
# 2.
# We create a set of dig... | <commit_before>""" How to generate a random 4 digit number not starting with 0 and having unique digits in python? """
import random
l = [0,1,2,3,4,5,6,7,8,9]
random.shuffle(l)
if l[0] == 0:
print(''.join(map(str, l[1:5])))
else:
print(''.join(map(str, l[0:4])))
<commit_msg>Fix of shuffle. There should be rand... | """ How to generate a random 4 digit number not starting with 0 and having unique digits in python? """
import random
# 1.
l = [0,1,2,3,4,5,6,7,8,9]
random.shuffle(l)
if l[0] == 0:
pos = random.choice(range(1, len(l)))
l[0], l[pos] = l[pos], l[0]
print(''.join(map(str, l[0:4])))
# 2.
# We create a set of dig... | """ How to generate a random 4 digit number not starting with 0 and having unique digits in python? """
import random
l = [0,1,2,3,4,5,6,7,8,9]
random.shuffle(l)
if l[0] == 0:
print(''.join(map(str, l[1:5])))
else:
print(''.join(map(str, l[0:4])))
Fix of shuffle. There should be random swap of leading zero wit... | <commit_before>""" How to generate a random 4 digit number not starting with 0 and having unique digits in python? """
import random
l = [0,1,2,3,4,5,6,7,8,9]
random.shuffle(l)
if l[0] == 0:
print(''.join(map(str, l[1:5])))
else:
print(''.join(map(str, l[0:4])))
<commit_msg>Fix of shuffle. There should be rand... |
863b12e503559b24de29407cd674d432bdcbbfc0 | cs251tk/referee/send_email.py | cs251tk/referee/send_email.py | import smtplib
def send_email(msg):
# Send the message via our own SMTP server.
with smtplib.SMTP_SSL('smtp.gmail.com', 465) as s:
# s.starttls()
s.set_debuglevel(2)
s.send_message(msg)
| import smtplib
def send_email(msg):
# Send the message via our own SMTP server.
with smtplib.SMTP_SSL('smtp.gmail.com', 465) as s:
s.send_message(msg)
| Remove somore more lines related to email | Remove somore more lines related to email
| Python | mit | StoDevX/cs251-toolkit,StoDevX/cs251-toolkit,StoDevX/cs251-toolkit,StoDevX/cs251-toolkit | import smtplib
def send_email(msg):
# Send the message via our own SMTP server.
with smtplib.SMTP_SSL('smtp.gmail.com', 465) as s:
# s.starttls()
s.set_debuglevel(2)
s.send_message(msg)
Remove somore more lines related to email | import smtplib
def send_email(msg):
# Send the message via our own SMTP server.
with smtplib.SMTP_SSL('smtp.gmail.com', 465) as s:
s.send_message(msg)
| <commit_before>import smtplib
def send_email(msg):
# Send the message via our own SMTP server.
with smtplib.SMTP_SSL('smtp.gmail.com', 465) as s:
# s.starttls()
s.set_debuglevel(2)
s.send_message(msg)
<commit_msg>Remove somore more lines related to email<commit_after> | import smtplib
def send_email(msg):
# Send the message via our own SMTP server.
with smtplib.SMTP_SSL('smtp.gmail.com', 465) as s:
s.send_message(msg)
| import smtplib
def send_email(msg):
# Send the message via our own SMTP server.
with smtplib.SMTP_SSL('smtp.gmail.com', 465) as s:
# s.starttls()
s.set_debuglevel(2)
s.send_message(msg)
Remove somore more lines related to emailimport smtplib
def send_email(msg):
# Send the messag... | <commit_before>import smtplib
def send_email(msg):
# Send the message via our own SMTP server.
with smtplib.SMTP_SSL('smtp.gmail.com', 465) as s:
# s.starttls()
s.set_debuglevel(2)
s.send_message(msg)
<commit_msg>Remove somore more lines related to email<commit_after>import smtplib
d... |
1c0d42889b721cf68deb199711d8ae7700c40b66 | marcottimls/tools/logsetup.py | marcottimls/tools/logsetup.py | import os
import json
import logging
import logging.config
def setup_logging(log_path, settings_path="logging.json", default_level=logging.INFO):
"""Setup logging configuration"""
path = settings_path
if os.path.exists(path):
with open(path, 'rt') as f:
config = json.load(f)
co... | import os
import json
import logging
import logging.config
def setup_logging(settings_path="logging.json", default_level=logging.INFO):
"""Setup logging configuration"""
path = settings_path
if os.path.exists(path):
with open(path, 'rt') as f:
config = json.load(f)
logging.conf... | Remove kludge from setup_logging as no longer necessary | Remove kludge from setup_logging as no longer necessary
| Python | mit | soccermetrics/marcotti-mls | import os
import json
import logging
import logging.config
def setup_logging(log_path, settings_path="logging.json", default_level=logging.INFO):
"""Setup logging configuration"""
path = settings_path
if os.path.exists(path):
with open(path, 'rt') as f:
config = json.load(f)
co... | import os
import json
import logging
import logging.config
def setup_logging(settings_path="logging.json", default_level=logging.INFO):
"""Setup logging configuration"""
path = settings_path
if os.path.exists(path):
with open(path, 'rt') as f:
config = json.load(f)
logging.conf... | <commit_before>import os
import json
import logging
import logging.config
def setup_logging(log_path, settings_path="logging.json", default_level=logging.INFO):
"""Setup logging configuration"""
path = settings_path
if os.path.exists(path):
with open(path, 'rt') as f:
config = json.loa... | import os
import json
import logging
import logging.config
def setup_logging(settings_path="logging.json", default_level=logging.INFO):
"""Setup logging configuration"""
path = settings_path
if os.path.exists(path):
with open(path, 'rt') as f:
config = json.load(f)
logging.conf... | import os
import json
import logging
import logging.config
def setup_logging(log_path, settings_path="logging.json", default_level=logging.INFO):
"""Setup logging configuration"""
path = settings_path
if os.path.exists(path):
with open(path, 'rt') as f:
config = json.load(f)
co... | <commit_before>import os
import json
import logging
import logging.config
def setup_logging(log_path, settings_path="logging.json", default_level=logging.INFO):
"""Setup logging configuration"""
path = settings_path
if os.path.exists(path):
with open(path, 'rt') as f:
config = json.loa... |
93be3585d269360641091f18a6443979eb8f1f98 | cito/dump_db.py | cito/dump_db.py | """Delete all documents every second forever"""
__author__ = 'tunnell'
import sys
import time
import json
import pymongo
if __name__ == "__main__":
c = pymongo.MongoClient()
db = c.data
collection = db.test
# Key to sort by so we can use an index for quick query
sort_key = [("_id", pymongo.AS... | """Delete all documents every second forever"""
__author__ = 'tunnell'
import sys
import time
import json
import pymongo
if __name__ == "__main__":
c = pymongo.MongoClient()
db = c.data
collection = db.test
# Key to sort by so we can use an index for quick query
sort_key = [("_id", pymongo.AS... | Write concern bug fix in constantly deleting DB. It's on by default and w=1 does nothing. | BUG: Write concern bug fix in constantly deleting DB. It's on by default and w=1 does nothing.
| Python | bsd-3-clause | tunnell/wax,tunnell/wax,tunnell/wax | """Delete all documents every second forever"""
__author__ = 'tunnell'
import sys
import time
import json
import pymongo
if __name__ == "__main__":
c = pymongo.MongoClient()
db = c.data
collection = db.test
# Key to sort by so we can use an index for quick query
sort_key = [("_id", pymongo.AS... | """Delete all documents every second forever"""
__author__ = 'tunnell'
import sys
import time
import json
import pymongo
if __name__ == "__main__":
c = pymongo.MongoClient()
db = c.data
collection = db.test
# Key to sort by so we can use an index for quick query
sort_key = [("_id", pymongo.AS... | <commit_before>"""Delete all documents every second forever"""
__author__ = 'tunnell'
import sys
import time
import json
import pymongo
if __name__ == "__main__":
c = pymongo.MongoClient()
db = c.data
collection = db.test
# Key to sort by so we can use an index for quick query
sort_key = [("_... | """Delete all documents every second forever"""
__author__ = 'tunnell'
import sys
import time
import json
import pymongo
if __name__ == "__main__":
c = pymongo.MongoClient()
db = c.data
collection = db.test
# Key to sort by so we can use an index for quick query
sort_key = [("_id", pymongo.AS... | """Delete all documents every second forever"""
__author__ = 'tunnell'
import sys
import time
import json
import pymongo
if __name__ == "__main__":
c = pymongo.MongoClient()
db = c.data
collection = db.test
# Key to sort by so we can use an index for quick query
sort_key = [("_id", pymongo.AS... | <commit_before>"""Delete all documents every second forever"""
__author__ = 'tunnell'
import sys
import time
import json
import pymongo
if __name__ == "__main__":
c = pymongo.MongoClient()
db = c.data
collection = db.test
# Key to sort by so we can use an index for quick query
sort_key = [("_... |
44ed4ceffcbf95ed42e4bdebcc87a7137a97de50 | been/source/markdown.py | been/source/markdown.py | from been.core import DirectorySource, source_registry
class Markdown(DirectorySource):
kind = 'markdown'
def process_event(self, event):
lines = event['content'].splitlines()
event['title'] = lines[0]
event['content'] = "\n".join(lines[1:])
event['summary'] = event['content']
... | from been.core import DirectorySource, source_registry
class MarkdownDirectory(DirectorySource):
kind = 'markdown'
def process_event(self, event):
lines = event['content'].splitlines()
event['title'] = lines[0]
event['content'] = "\n".join(lines[1:])
event['summary'] = event['co... | Rename Markdown source to MarkdownDirectory. | Rename Markdown source to MarkdownDirectory.
| Python | bsd-3-clause | chromakode/been | from been.core import DirectorySource, source_registry
class Markdown(DirectorySource):
kind = 'markdown'
def process_event(self, event):
lines = event['content'].splitlines()
event['title'] = lines[0]
event['content'] = "\n".join(lines[1:])
event['summary'] = event['content']
... | from been.core import DirectorySource, source_registry
class MarkdownDirectory(DirectorySource):
kind = 'markdown'
def process_event(self, event):
lines = event['content'].splitlines()
event['title'] = lines[0]
event['content'] = "\n".join(lines[1:])
event['summary'] = event['co... | <commit_before>from been.core import DirectorySource, source_registry
class Markdown(DirectorySource):
kind = 'markdown'
def process_event(self, event):
lines = event['content'].splitlines()
event['title'] = lines[0]
event['content'] = "\n".join(lines[1:])
event['summary'] = eve... | from been.core import DirectorySource, source_registry
class MarkdownDirectory(DirectorySource):
kind = 'markdown'
def process_event(self, event):
lines = event['content'].splitlines()
event['title'] = lines[0]
event['content'] = "\n".join(lines[1:])
event['summary'] = event['co... | from been.core import DirectorySource, source_registry
class Markdown(DirectorySource):
kind = 'markdown'
def process_event(self, event):
lines = event['content'].splitlines()
event['title'] = lines[0]
event['content'] = "\n".join(lines[1:])
event['summary'] = event['content']
... | <commit_before>from been.core import DirectorySource, source_registry
class Markdown(DirectorySource):
kind = 'markdown'
def process_event(self, event):
lines = event['content'].splitlines()
event['title'] = lines[0]
event['content'] = "\n".join(lines[1:])
event['summary'] = eve... |
a28f6a45f37d906a9f9901d46d683c3ca5406da4 | code/csv2map.py | code/csv2map.py | # csv2map.py -- Convert .csv into a .map format
# Description of MAP format: http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#map
#
# jean-daniel.granet@mines-paristech.fr
import sys
import argparse
def main():
parser = argparse.ArgumentParser(description='Convert .csv to .map')
parser.add_argument('cs... | # csv2map.py -- Convert .csv into a .map format
# Description of MAP format: http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#map
#
# jean-daniel.granet@mines-paristech.fr
import sys
import argparse
def main():
parser = argparse.ArgumentParser(description='Convert .csv to .map')
parser.add_argument('cs... | Add infos about MAP file | Add infos about MAP file
| Python | mit | chagaz/sfan,chagaz/sfan,chagaz/sfan,chagaz/sfan,chagaz/sfan | # csv2map.py -- Convert .csv into a .map format
# Description of MAP format: http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#map
#
# jean-daniel.granet@mines-paristech.fr
import sys
import argparse
def main():
parser = argparse.ArgumentParser(description='Convert .csv to .map')
parser.add_argument('cs... | # csv2map.py -- Convert .csv into a .map format
# Description of MAP format: http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#map
#
# jean-daniel.granet@mines-paristech.fr
import sys
import argparse
def main():
parser = argparse.ArgumentParser(description='Convert .csv to .map')
parser.add_argument('cs... | <commit_before># csv2map.py -- Convert .csv into a .map format
# Description of MAP format: http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#map
#
# jean-daniel.granet@mines-paristech.fr
import sys
import argparse
def main():
parser = argparse.ArgumentParser(description='Convert .csv to .map')
parser.a... | # csv2map.py -- Convert .csv into a .map format
# Description of MAP format: http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#map
#
# jean-daniel.granet@mines-paristech.fr
import sys
import argparse
def main():
parser = argparse.ArgumentParser(description='Convert .csv to .map')
parser.add_argument('cs... | # csv2map.py -- Convert .csv into a .map format
# Description of MAP format: http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#map
#
# jean-daniel.granet@mines-paristech.fr
import sys
import argparse
def main():
parser = argparse.ArgumentParser(description='Convert .csv to .map')
parser.add_argument('cs... | <commit_before># csv2map.py -- Convert .csv into a .map format
# Description of MAP format: http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#map
#
# jean-daniel.granet@mines-paristech.fr
import sys
import argparse
def main():
parser = argparse.ArgumentParser(description='Convert .csv to .map')
parser.a... |
b1f06fc602f2d787b9d564a99d8c92f731ab104c | twext/internet/test/__init__.py | twext/internet/test/__init__.py | ##
# Copyright (c) 2005-2007 Apple 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 l... | Build system doesn't approve of empty files | Build system doesn't approve of empty files
git-svn-id: 81e381228600e5752b80483efd2b45b26c451ea2@6616 e27351fd-9f3e-4f54-a53b-843176b1656c
| Python | apache-2.0 | trevor/calendarserver,trevor/calendarserver,trevor/calendarserver | Build system doesn't approve of empty files
git-svn-id: 81e381228600e5752b80483efd2b45b26c451ea2@6616 e27351fd-9f3e-4f54-a53b-843176b1656c | ##
# Copyright (c) 2005-2007 Apple 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 l... | <commit_before><commit_msg>Build system doesn't approve of empty files
git-svn-id: 81e381228600e5752b80483efd2b45b26c451ea2@6616 e27351fd-9f3e-4f54-a53b-843176b1656c<commit_after> | ##
# Copyright (c) 2005-2007 Apple 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 l... | Build system doesn't approve of empty files
git-svn-id: 81e381228600e5752b80483efd2b45b26c451ea2@6616 e27351fd-9f3e-4f54-a53b-843176b1656c##
# Copyright (c) 2005-2007 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance wi... | <commit_before><commit_msg>Build system doesn't approve of empty files
git-svn-id: 81e381228600e5752b80483efd2b45b26c451ea2@6616 e27351fd-9f3e-4f54-a53b-843176b1656c<commit_after>##
# Copyright (c) 2005-2007 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may ... | |
75225c176135b6d17c8f10ea67dabb4b0fc02505 | nodeconductor/iaas/migrations/0009_add_min_ram_and_disk_to_image.py | nodeconductor/iaas/migrations/0009_add_min_ram_and_disk_to_image.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_fsm
class Migration(migrations.Migration):
dependencies = [
('iaas', '0008_add_instance_restarting_state'),
]
operations = [
migrations.AddField(
model_name... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_fsm
class Migration(migrations.Migration):
dependencies = [
('iaas', '0008_add_instance_restarting_state'),
]
operations = [
migrations.AddField(
model_name... | Remove field duplication from migrations(nc-301) | Remove field duplication from migrations(nc-301)
| Python | mit | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_fsm
class Migration(migrations.Migration):
dependencies = [
('iaas', '0008_add_instance_restarting_state'),
]
operations = [
migrations.AddField(
model_name... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_fsm
class Migration(migrations.Migration):
dependencies = [
('iaas', '0008_add_instance_restarting_state'),
]
operations = [
migrations.AddField(
model_name... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_fsm
class Migration(migrations.Migration):
dependencies = [
('iaas', '0008_add_instance_restarting_state'),
]
operations = [
migrations.AddField(
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_fsm
class Migration(migrations.Migration):
dependencies = [
('iaas', '0008_add_instance_restarting_state'),
]
operations = [
migrations.AddField(
model_name... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_fsm
class Migration(migrations.Migration):
dependencies = [
('iaas', '0008_add_instance_restarting_state'),
]
operations = [
migrations.AddField(
model_name... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_fsm
class Migration(migrations.Migration):
dependencies = [
('iaas', '0008_add_instance_restarting_state'),
]
operations = [
migrations.AddField(
... |
496fc83101155bd0cd2fb4256e2878007aec8eaa | api/base/exceptions.py | api/base/exceptions.py |
from rest_framework import status
from rest_framework.exceptions import APIException
def json_api_exception_handler(exc, context):
""" Custom exception handler that returns errors object as an array """
# Import inside method to avoid errors when the OSF is loaded without Django
from rest_framework.view... |
from rest_framework import status
from rest_framework.exceptions import APIException
def json_api_exception_handler(exc, context):
""" Custom exception handler that returns errors object as an array """
# Import inside method to avoid errors when the OSF is loaded without Django
from rest_framework.view... | Use source key instead of meta and detail fields | Use source key instead of meta and detail fields
| Python | apache-2.0 | asanfilippo7/osf.io,emetsger/osf.io,rdhyee/osf.io,cosenal/osf.io,haoyuchen1992/osf.io,haoyuchen1992/osf.io,DanielSBrown/osf.io,doublebits/osf.io,mluke93/osf.io,amyshi188/osf.io,monikagrabowska/osf.io,doublebits/osf.io,icereval/osf.io,sloria/osf.io,pattisdr/osf.io,ZobairAlijan/osf.io,adlius/osf.io,hmoco/osf.io,Johnetord... |
from rest_framework import status
from rest_framework.exceptions import APIException
def json_api_exception_handler(exc, context):
""" Custom exception handler that returns errors object as an array """
# Import inside method to avoid errors when the OSF is loaded without Django
from rest_framework.view... |
from rest_framework import status
from rest_framework.exceptions import APIException
def json_api_exception_handler(exc, context):
""" Custom exception handler that returns errors object as an array """
# Import inside method to avoid errors when the OSF is loaded without Django
from rest_framework.view... | <commit_before>
from rest_framework import status
from rest_framework.exceptions import APIException
def json_api_exception_handler(exc, context):
""" Custom exception handler that returns errors object as an array """
# Import inside method to avoid errors when the OSF is loaded without Django
from rest... |
from rest_framework import status
from rest_framework.exceptions import APIException
def json_api_exception_handler(exc, context):
""" Custom exception handler that returns errors object as an array """
# Import inside method to avoid errors when the OSF is loaded without Django
from rest_framework.view... |
from rest_framework import status
from rest_framework.exceptions import APIException
def json_api_exception_handler(exc, context):
""" Custom exception handler that returns errors object as an array """
# Import inside method to avoid errors when the OSF is loaded without Django
from rest_framework.view... | <commit_before>
from rest_framework import status
from rest_framework.exceptions import APIException
def json_api_exception_handler(exc, context):
""" Custom exception handler that returns errors object as an array """
# Import inside method to avoid errors when the OSF is loaded without Django
from rest... |
0223b6fc332bdbc8a641832ebd06b79969b65853 | pyfibot/modules/module_btc.py | pyfibot/modules/module_btc.py | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals, print_function, division
def command_btc(bot, user, channel, args):
"""Display BTC exchange rates"""
r = bot.get_url("http://bitcoincharts.com/t/weighted_prices.json")
data = r.json()
eur_rate = float(data['EUR']['24h'])
usd_rate ... | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals, print_function, division
def command_btc(bot, user, channel, args):
"""Display current BTC exchange rates from mtgox"""
r = bot.get_url("http://data.mtgox.com/api/1/BTCUSD/ticker")
btcusd = r.json()['return']['avg']['display_short']
r... | Use mtgox as data source | Use mtgox as data source
| Python | bsd-3-clause | rnyberg/pyfibot,lepinkainen/pyfibot,EArmour/pyfibot,huqa/pyfibot,aapa/pyfibot,huqa/pyfibot,rnyberg/pyfibot,EArmour/pyfibot,lepinkainen/pyfibot,aapa/pyfibot | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals, print_function, division
def command_btc(bot, user, channel, args):
"""Display BTC exchange rates"""
r = bot.get_url("http://bitcoincharts.com/t/weighted_prices.json")
data = r.json()
eur_rate = float(data['EUR']['24h'])
usd_rate ... | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals, print_function, division
def command_btc(bot, user, channel, args):
"""Display current BTC exchange rates from mtgox"""
r = bot.get_url("http://data.mtgox.com/api/1/BTCUSD/ticker")
btcusd = r.json()['return']['avg']['display_short']
r... | <commit_before># -*- encoding: utf-8 -*-
from __future__ import unicode_literals, print_function, division
def command_btc(bot, user, channel, args):
"""Display BTC exchange rates"""
r = bot.get_url("http://bitcoincharts.com/t/weighted_prices.json")
data = r.json()
eur_rate = float(data['EUR']['24h']... | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals, print_function, division
def command_btc(bot, user, channel, args):
"""Display current BTC exchange rates from mtgox"""
r = bot.get_url("http://data.mtgox.com/api/1/BTCUSD/ticker")
btcusd = r.json()['return']['avg']['display_short']
r... | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals, print_function, division
def command_btc(bot, user, channel, args):
"""Display BTC exchange rates"""
r = bot.get_url("http://bitcoincharts.com/t/weighted_prices.json")
data = r.json()
eur_rate = float(data['EUR']['24h'])
usd_rate ... | <commit_before># -*- encoding: utf-8 -*-
from __future__ import unicode_literals, print_function, division
def command_btc(bot, user, channel, args):
"""Display BTC exchange rates"""
r = bot.get_url("http://bitcoincharts.com/t/weighted_prices.json")
data = r.json()
eur_rate = float(data['EUR']['24h']... |
0868bbd0e445cb39217351cd13d2c3f7a173416c | mws/__init__.py | mws/__init__.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from .mws import MWS, MWSError
from .apis import Feeds, Finances, InboundShipments, Inventory, MerchantFulfillment,\
OffAmazonPayments, Orders, OutboundShipments, Products, Recommendations,\
Reports, Sellers
__all__ = [
... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from .mws import MWS, MWSError
from .apis import Feeds, Finances, InboundShipments, Inventory, MerchantFulfillment,\
OffAmazonPayments, Orders, OutboundShipments, Products, Recommendations,\
Reports, Sellers, Subscriptio... | Include the new Subscriptions stub | Include the new Subscriptions stub | Python | unlicense | GriceTurrble/python-amazon-mws,Bobspadger/python-amazon-mws | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from .mws import MWS, MWSError
from .apis import Feeds, Finances, InboundShipments, Inventory, MerchantFulfillment,\
OffAmazonPayments, Orders, OutboundShipments, Products, Recommendations,\
Reports, Sellers
__all__ = [
... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from .mws import MWS, MWSError
from .apis import Feeds, Finances, InboundShipments, Inventory, MerchantFulfillment,\
OffAmazonPayments, Orders, OutboundShipments, Products, Recommendations,\
Reports, Sellers, Subscriptio... | <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import
from .mws import MWS, MWSError
from .apis import Feeds, Finances, InboundShipments, Inventory, MerchantFulfillment,\
OffAmazonPayments, Orders, OutboundShipments, Products, Recommendations,\
Reports, Selle... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from .mws import MWS, MWSError
from .apis import Feeds, Finances, InboundShipments, Inventory, MerchantFulfillment,\
OffAmazonPayments, Orders, OutboundShipments, Products, Recommendations,\
Reports, Sellers, Subscriptio... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from .mws import MWS, MWSError
from .apis import Feeds, Finances, InboundShipments, Inventory, MerchantFulfillment,\
OffAmazonPayments, Orders, OutboundShipments, Products, Recommendations,\
Reports, Sellers
__all__ = [
... | <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import
from .mws import MWS, MWSError
from .apis import Feeds, Finances, InboundShipments, Inventory, MerchantFulfillment,\
OffAmazonPayments, Orders, OutboundShipments, Products, Recommendations,\
Reports, Selle... |
a91a81c16a27d72cdc41de322130e97889657561 | marbaloo_mako/__init__.py | marbaloo_mako/__init__.py | import cherrypy
from mako.lookup import TemplateLookup
class Tool(cherrypy.Tool):
_lookups = {}
def __init__(self):
cherrypy.Tool.__init__(self, 'before_handler',
self.callable,
priority=40)
def callable(self,
filenam... | import cherrypy
from mako.lookup import TemplateLookup
class Tool(cherrypy.Tool):
_lookups = {}
def __init__(self):
cherrypy.Tool.__init__(self, 'before_handler',
self.callable,
priority=40)
def callable(self,
filenam... | Load template from `cherrypy.request.template` in handler. | Load template from `cherrypy.request.template` in handler.
| Python | mit | marbaloo/marbaloo_mako | import cherrypy
from mako.lookup import TemplateLookup
class Tool(cherrypy.Tool):
_lookups = {}
def __init__(self):
cherrypy.Tool.__init__(self, 'before_handler',
self.callable,
priority=40)
def callable(self,
filenam... | import cherrypy
from mako.lookup import TemplateLookup
class Tool(cherrypy.Tool):
_lookups = {}
def __init__(self):
cherrypy.Tool.__init__(self, 'before_handler',
self.callable,
priority=40)
def callable(self,
filenam... | <commit_before>import cherrypy
from mako.lookup import TemplateLookup
class Tool(cherrypy.Tool):
_lookups = {}
def __init__(self):
cherrypy.Tool.__init__(self, 'before_handler',
self.callable,
priority=40)
def callable(self,
... | import cherrypy
from mako.lookup import TemplateLookup
class Tool(cherrypy.Tool):
_lookups = {}
def __init__(self):
cherrypy.Tool.__init__(self, 'before_handler',
self.callable,
priority=40)
def callable(self,
filenam... | import cherrypy
from mako.lookup import TemplateLookup
class Tool(cherrypy.Tool):
_lookups = {}
def __init__(self):
cherrypy.Tool.__init__(self, 'before_handler',
self.callable,
priority=40)
def callable(self,
filenam... | <commit_before>import cherrypy
from mako.lookup import TemplateLookup
class Tool(cherrypy.Tool):
_lookups = {}
def __init__(self):
cherrypy.Tool.__init__(self, 'before_handler',
self.callable,
priority=40)
def callable(self,
... |
90a94b1d511aa17f167d783992fe0f874ad529c1 | examples/python_interop/python_interop.py | examples/python_interop/python_interop.py | #!/usr/bin/env python
# Copyright 2017 Stanford University
#
# 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 applicabl... | #!/usr/bin/env python
# Copyright 2017 Stanford University
#
# 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 applicabl... | Test Python support for arguments. | examples: Test Python support for arguments.
| Python | apache-2.0 | StanfordLegion/legion,StanfordLegion/legion,StanfordLegion/legion,StanfordLegion/legion,StanfordLegion/legion,StanfordLegion/legion,StanfordLegion/legion,StanfordLegion/legion | #!/usr/bin/env python
# Copyright 2017 Stanford University
#
# 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 applicabl... | #!/usr/bin/env python
# Copyright 2017 Stanford University
#
# 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 applicabl... | <commit_before>#!/usr/bin/env python
# Copyright 2017 Stanford University
#
# 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 requir... | #!/usr/bin/env python
# Copyright 2017 Stanford University
#
# 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 applicabl... | #!/usr/bin/env python
# Copyright 2017 Stanford University
#
# 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 applicabl... | <commit_before>#!/usr/bin/env python
# Copyright 2017 Stanford University
#
# 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 requir... |
f1fcce8f0c2022948fb310268a7769d9c9ef04ad | runtests.py | runtests.py | #!/usr/bin/env python
import sys
import logging
from optparse import OptionParser
from coverage import coverage
from tests.config import configure
logging.disable(logging.CRITICAL)
def run_tests(options, *test_args):
from django_nose import NoseTestSuiteRunner
test_runner = NoseTestSuiteRunner(verbosity=opt... | #!/usr/bin/env python
import sys
import logging
from optparse import OptionParser
from tests.config import configure
logging.disable(logging.CRITICAL)
def run_tests(*test_args):
from django_nose import NoseTestSuiteRunner
test_runner = NoseTestSuiteRunner()
if not test_args:
test_args = ['tests'... | Rework test runner to generate coverage stats correctly. | Rework test runner to generate coverage stats correctly.
Nose seems to pick up argv automatically - which is annoying. Will need
to look into at some point.
| Python | bsd-3-clause | michaelkuty/django-oscar,WillisXChen/django-oscar,lijoantony/django-oscar,Bogh/django-oscar,sasha0/django-oscar,okfish/django-oscar,nickpack/django-oscar,rocopartners/django-oscar,django-oscar/django-oscar,WillisXChen/django-oscar,makielab/django-oscar,jinnykoo/wuyisj.com,WillisXChen/django-oscar,jinnykoo/wuyisj.com,nf... | #!/usr/bin/env python
import sys
import logging
from optparse import OptionParser
from coverage import coverage
from tests.config import configure
logging.disable(logging.CRITICAL)
def run_tests(options, *test_args):
from django_nose import NoseTestSuiteRunner
test_runner = NoseTestSuiteRunner(verbosity=opt... | #!/usr/bin/env python
import sys
import logging
from optparse import OptionParser
from tests.config import configure
logging.disable(logging.CRITICAL)
def run_tests(*test_args):
from django_nose import NoseTestSuiteRunner
test_runner = NoseTestSuiteRunner()
if not test_args:
test_args = ['tests'... | <commit_before>#!/usr/bin/env python
import sys
import logging
from optparse import OptionParser
from coverage import coverage
from tests.config import configure
logging.disable(logging.CRITICAL)
def run_tests(options, *test_args):
from django_nose import NoseTestSuiteRunner
test_runner = NoseTestSuiteRunne... | #!/usr/bin/env python
import sys
import logging
from optparse import OptionParser
from tests.config import configure
logging.disable(logging.CRITICAL)
def run_tests(*test_args):
from django_nose import NoseTestSuiteRunner
test_runner = NoseTestSuiteRunner()
if not test_args:
test_args = ['tests'... | #!/usr/bin/env python
import sys
import logging
from optparse import OptionParser
from coverage import coverage
from tests.config import configure
logging.disable(logging.CRITICAL)
def run_tests(options, *test_args):
from django_nose import NoseTestSuiteRunner
test_runner = NoseTestSuiteRunner(verbosity=opt... | <commit_before>#!/usr/bin/env python
import sys
import logging
from optparse import OptionParser
from coverage import coverage
from tests.config import configure
logging.disable(logging.CRITICAL)
def run_tests(options, *test_args):
from django_nose import NoseTestSuiteRunner
test_runner = NoseTestSuiteRunne... |
3c833053f6da71d1eed6d1a0720a1a8cb1997de7 | runtests.py | runtests.py | #!/usr/bin/env python
from os.path import dirname, abspath
import sys
from django.conf import settings
if not settings.configured:
from django import VERSION
settings_dict = dict(
INSTALLED_APPS=(
'localeurl',
),
ROOT_URLCONF='localeurl.tests.test_urls',
)
... | #!/usr/bin/env python
from os.path import dirname, abspath
import sys
from django.conf import settings
if not settings.configured:
from django import VERSION
settings_dict = dict(
INSTALLED_APPS=(
'localeurl',
'django.contrib.sites', # for sitemap test
),
R... | Include contrib.sites when running tests; needed for sitemaps in Django >= 1.2. | Include contrib.sites when running tests; needed for sitemaps in Django >= 1.2.
| Python | mit | extertioner/django-localeurl,gonnado/django-localeurl,carljm/django-localeurl | #!/usr/bin/env python
from os.path import dirname, abspath
import sys
from django.conf import settings
if not settings.configured:
from django import VERSION
settings_dict = dict(
INSTALLED_APPS=(
'localeurl',
),
ROOT_URLCONF='localeurl.tests.test_urls',
)
... | #!/usr/bin/env python
from os.path import dirname, abspath
import sys
from django.conf import settings
if not settings.configured:
from django import VERSION
settings_dict = dict(
INSTALLED_APPS=(
'localeurl',
'django.contrib.sites', # for sitemap test
),
R... | <commit_before>#!/usr/bin/env python
from os.path import dirname, abspath
import sys
from django.conf import settings
if not settings.configured:
from django import VERSION
settings_dict = dict(
INSTALLED_APPS=(
'localeurl',
),
ROOT_URLCONF='localeurl.tests.test_urls',... | #!/usr/bin/env python
from os.path import dirname, abspath
import sys
from django.conf import settings
if not settings.configured:
from django import VERSION
settings_dict = dict(
INSTALLED_APPS=(
'localeurl',
'django.contrib.sites', # for sitemap test
),
R... | #!/usr/bin/env python
from os.path import dirname, abspath
import sys
from django.conf import settings
if not settings.configured:
from django import VERSION
settings_dict = dict(
INSTALLED_APPS=(
'localeurl',
),
ROOT_URLCONF='localeurl.tests.test_urls',
)
... | <commit_before>#!/usr/bin/env python
from os.path import dirname, abspath
import sys
from django.conf import settings
if not settings.configured:
from django import VERSION
settings_dict = dict(
INSTALLED_APPS=(
'localeurl',
),
ROOT_URLCONF='localeurl.tests.test_urls',... |
d873380a3ad382ac359ebf41f3f775f585b674f8 | mopidy_gmusic/__init__.py | mopidy_gmusic/__init__.py | from __future__ import unicode_literals
import os
from mopidy import config, ext
__version__ = '0.2.2'
class GMusicExtension(ext.Extension):
dist_name = 'Mopidy-GMusic'
ext_name = 'gmusic'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__file... | from __future__ import unicode_literals
import os
from mopidy import config, ext
__version__ = '0.2.2'
class GMusicExtension(ext.Extension):
dist_name = 'Mopidy-GMusic'
ext_name = 'gmusic'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__file... | Use new extension setup() API | Use new extension setup() API
| Python | apache-2.0 | Tilley/mopidy-gmusic,jodal/mopidy-gmusic,mopidy/mopidy-gmusic,jaibot/mopidy-gmusic,hechtus/mopidy-gmusic,elrosti/mopidy-gmusic,jaapz/mopidy-gmusic | from __future__ import unicode_literals
import os
from mopidy import config, ext
__version__ = '0.2.2'
class GMusicExtension(ext.Extension):
dist_name = 'Mopidy-GMusic'
ext_name = 'gmusic'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__file... | from __future__ import unicode_literals
import os
from mopidy import config, ext
__version__ = '0.2.2'
class GMusicExtension(ext.Extension):
dist_name = 'Mopidy-GMusic'
ext_name = 'gmusic'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__file... | <commit_before>from __future__ import unicode_literals
import os
from mopidy import config, ext
__version__ = '0.2.2'
class GMusicExtension(ext.Extension):
dist_name = 'Mopidy-GMusic'
ext_name = 'gmusic'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path... | from __future__ import unicode_literals
import os
from mopidy import config, ext
__version__ = '0.2.2'
class GMusicExtension(ext.Extension):
dist_name = 'Mopidy-GMusic'
ext_name = 'gmusic'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__file... | from __future__ import unicode_literals
import os
from mopidy import config, ext
__version__ = '0.2.2'
class GMusicExtension(ext.Extension):
dist_name = 'Mopidy-GMusic'
ext_name = 'gmusic'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__file... | <commit_before>from __future__ import unicode_literals
import os
from mopidy import config, ext
__version__ = '0.2.2'
class GMusicExtension(ext.Extension):
dist_name = 'Mopidy-GMusic'
ext_name = 'gmusic'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path... |
07135d2e24eab7855c55c9213b0653dec23ccbcf | authomatic/__init__.py | authomatic/__init__.py | # -*- coding: utf-8 -*-
"""
This is the only interface that you should ever need to get a **user** logged in, get
**his/her** info and credentials, deserialize the credentials
and access **his/her protected resources**.
.. autosummary::
:nosignatures:
authomatic.setup
authomatic.login
authomatic.p... | # -*- coding: utf-8 -*-
"""
This is the only interface that you should ever need to get a **user** logged in, get
**his/her** info and credentials, deserialize the credentials
and access **his/her protected resources**.
.. autosummary::
:nosignatures:
authomatic.setup
authomatic.login
authomatic.p... | Correct six local import for python3 compatibility | Correct six local import for python3 compatibility | Python | mit | liorshahverdi/authomatic,authomatic/authomatic,kshitizanand/authomatic,artitj/authomatic,farcaz/authomatic,liorshahverdi/authomatic,scorphus/authomatic,leadbrick/authomatic,erasanimoulika/authomatic,c24b/authomatic,authomatic/authomatic,erasanimoulika/authomatic,dougchestnut/authomatic,scorphus/authomatic,vivek8943/aut... | # -*- coding: utf-8 -*-
"""
This is the only interface that you should ever need to get a **user** logged in, get
**his/her** info and credentials, deserialize the credentials
and access **his/her protected resources**.
.. autosummary::
:nosignatures:
authomatic.setup
authomatic.login
authomatic.p... | # -*- coding: utf-8 -*-
"""
This is the only interface that you should ever need to get a **user** logged in, get
**his/her** info and credentials, deserialize the credentials
and access **his/her protected resources**.
.. autosummary::
:nosignatures:
authomatic.setup
authomatic.login
authomatic.p... | <commit_before># -*- coding: utf-8 -*-
"""
This is the only interface that you should ever need to get a **user** logged in, get
**his/her** info and credentials, deserialize the credentials
and access **his/her protected resources**.
.. autosummary::
:nosignatures:
authomatic.setup
authomatic.login
... | # -*- coding: utf-8 -*-
"""
This is the only interface that you should ever need to get a **user** logged in, get
**his/her** info and credentials, deserialize the credentials
and access **his/her protected resources**.
.. autosummary::
:nosignatures:
authomatic.setup
authomatic.login
authomatic.p... | # -*- coding: utf-8 -*-
"""
This is the only interface that you should ever need to get a **user** logged in, get
**his/her** info and credentials, deserialize the credentials
and access **his/her protected resources**.
.. autosummary::
:nosignatures:
authomatic.setup
authomatic.login
authomatic.p... | <commit_before># -*- coding: utf-8 -*-
"""
This is the only interface that you should ever need to get a **user** logged in, get
**his/her** info and credentials, deserialize the credentials
and access **his/her protected resources**.
.. autosummary::
:nosignatures:
authomatic.setup
authomatic.login
... |
13f4373fc415faba717033f0e8b87a7c5cd83033 | slackclient/_slackrequest.py | slackclient/_slackrequest.py | import json
import requests
import six
class SlackRequest(object):
@staticmethod
def do(token, request="?", post_data=None, domain="slack.com"):
post_data = post_data or {}
for k, v in six.iteritems(post_data):
if not isinstance(v, six.string_types):
post_data[k]... | import json
import requests
import six
class SlackRequest(object):
@staticmethod
def do(token, request="?", post_data=None, domain="slack.com"):
post_data = post_data or {}
for k, v in six.iteritems(post_data):
if not isinstance(v, six.string_types):
post_data[k]... | Add support for files.upload API call. | Add support for files.upload API call.
Closes #64, #88.
| Python | mit | slackapi/python-slackclient,slackhq/python-slackclient,slackapi/python-slackclient,slackapi/python-slackclient | import json
import requests
import six
class SlackRequest(object):
@staticmethod
def do(token, request="?", post_data=None, domain="slack.com"):
post_data = post_data or {}
for k, v in six.iteritems(post_data):
if not isinstance(v, six.string_types):
post_data[k]... | import json
import requests
import six
class SlackRequest(object):
@staticmethod
def do(token, request="?", post_data=None, domain="slack.com"):
post_data = post_data or {}
for k, v in six.iteritems(post_data):
if not isinstance(v, six.string_types):
post_data[k]... | <commit_before>import json
import requests
import six
class SlackRequest(object):
@staticmethod
def do(token, request="?", post_data=None, domain="slack.com"):
post_data = post_data or {}
for k, v in six.iteritems(post_data):
if not isinstance(v, six.string_types):
... | import json
import requests
import six
class SlackRequest(object):
@staticmethod
def do(token, request="?", post_data=None, domain="slack.com"):
post_data = post_data or {}
for k, v in six.iteritems(post_data):
if not isinstance(v, six.string_types):
post_data[k]... | import json
import requests
import six
class SlackRequest(object):
@staticmethod
def do(token, request="?", post_data=None, domain="slack.com"):
post_data = post_data or {}
for k, v in six.iteritems(post_data):
if not isinstance(v, six.string_types):
post_data[k]... | <commit_before>import json
import requests
import six
class SlackRequest(object):
@staticmethod
def do(token, request="?", post_data=None, domain="slack.com"):
post_data = post_data or {}
for k, v in six.iteritems(post_data):
if not isinstance(v, six.string_types):
... |
04640beab352f8797d68c33f940e920d2ed9ca6b | nolang/objects/list.py | nolang/objects/list.py | from nolang.error import AppError
from nolang.objects.root import W_Root
class W_ListObject(W_Root):
def __init__(self, w_items):
self._w_items = w_items
def str(self, space):
return '[' + ', '.join([space.str(i) for i in self._w_items]) + ']'
def len(self, space):
return len(sel... | from nolang.error import AppError
from nolang.objects.root import W_Root
class W_ListObject(W_Root):
def __init__(self, w_items):
self._w_items = w_items
def str(self, space):
return '[' + ', '.join([space.str(i) for i in self._w_items]) + ']'
def len(self, space):
return len(sel... | Use is instead of == for types. | Use is instead of == for types.
| Python | mit | fijal/quill | from nolang.error import AppError
from nolang.objects.root import W_Root
class W_ListObject(W_Root):
def __init__(self, w_items):
self._w_items = w_items
def str(self, space):
return '[' + ', '.join([space.str(i) for i in self._w_items]) + ']'
def len(self, space):
return len(sel... | from nolang.error import AppError
from nolang.objects.root import W_Root
class W_ListObject(W_Root):
def __init__(self, w_items):
self._w_items = w_items
def str(self, space):
return '[' + ', '.join([space.str(i) for i in self._w_items]) + ']'
def len(self, space):
return len(sel... | <commit_before>from nolang.error import AppError
from nolang.objects.root import W_Root
class W_ListObject(W_Root):
def __init__(self, w_items):
self._w_items = w_items
def str(self, space):
return '[' + ', '.join([space.str(i) for i in self._w_items]) + ']'
def len(self, space):
... | from nolang.error import AppError
from nolang.objects.root import W_Root
class W_ListObject(W_Root):
def __init__(self, w_items):
self._w_items = w_items
def str(self, space):
return '[' + ', '.join([space.str(i) for i in self._w_items]) + ']'
def len(self, space):
return len(sel... | from nolang.error import AppError
from nolang.objects.root import W_Root
class W_ListObject(W_Root):
def __init__(self, w_items):
self._w_items = w_items
def str(self, space):
return '[' + ', '.join([space.str(i) for i in self._w_items]) + ']'
def len(self, space):
return len(sel... | <commit_before>from nolang.error import AppError
from nolang.objects.root import W_Root
class W_ListObject(W_Root):
def __init__(self, w_items):
self._w_items = w_items
def str(self, space):
return '[' + ', '.join([space.str(i) for i in self._w_items]) + ']'
def len(self, space):
... |
0676485054c01abb41b95901c1af0af63fdcb650 | AFQ/utils/volume.py | AFQ/utils/volume.py | import scipy.ndimage as ndim
from skimage.filters import gaussian
def patch_up_roi(roi, sigma=0.5):
"""
After being non-linearly transformed, ROIs tend to have holes in them.
We perform a couple of computational geometry operations on the ROI to
fix that up.
Parameters
----------
roi : 3D... | import scipy.ndimage as ndim
from skimage.filters import gaussian
def patch_up_roi(roi, sigma=0.5, truncate=2):
"""
After being non-linearly transformed, ROIs tend to have holes in them.
We perform a couple of computational geometry operations on the ROI to
fix that up.
Parameters
----------
... | Truncate ROI-smoothing Gaussian at 2 STD per default. | Truncate ROI-smoothing Gaussian at 2 STD per default.
| Python | bsd-2-clause | yeatmanlab/pyAFQ,yeatmanlab/pyAFQ,arokem/pyAFQ,arokem/pyAFQ | import scipy.ndimage as ndim
from skimage.filters import gaussian
def patch_up_roi(roi, sigma=0.5):
"""
After being non-linearly transformed, ROIs tend to have holes in them.
We perform a couple of computational geometry operations on the ROI to
fix that up.
Parameters
----------
roi : 3D... | import scipy.ndimage as ndim
from skimage.filters import gaussian
def patch_up_roi(roi, sigma=0.5, truncate=2):
"""
After being non-linearly transformed, ROIs tend to have holes in them.
We perform a couple of computational geometry operations on the ROI to
fix that up.
Parameters
----------
... | <commit_before>import scipy.ndimage as ndim
from skimage.filters import gaussian
def patch_up_roi(roi, sigma=0.5):
"""
After being non-linearly transformed, ROIs tend to have holes in them.
We perform a couple of computational geometry operations on the ROI to
fix that up.
Parameters
--------... | import scipy.ndimage as ndim
from skimage.filters import gaussian
def patch_up_roi(roi, sigma=0.5, truncate=2):
"""
After being non-linearly transformed, ROIs tend to have holes in them.
We perform a couple of computational geometry operations on the ROI to
fix that up.
Parameters
----------
... | import scipy.ndimage as ndim
from skimage.filters import gaussian
def patch_up_roi(roi, sigma=0.5):
"""
After being non-linearly transformed, ROIs tend to have holes in them.
We perform a couple of computational geometry operations on the ROI to
fix that up.
Parameters
----------
roi : 3D... | <commit_before>import scipy.ndimage as ndim
from skimage.filters import gaussian
def patch_up_roi(roi, sigma=0.5):
"""
After being non-linearly transformed, ROIs tend to have holes in them.
We perform a couple of computational geometry operations on the ROI to
fix that up.
Parameters
--------... |
11528044c054ac8f1d65c1b64c2e76fbe22dad20 | lpthw/ex24.py | lpthw/ex24.py | print "Let's practice everything."
print 'You\'d need to know \'bout escapes with \\ that do \n newlines and \t tabs."
poem = """
\t the lovely world
wtih logic so firmly planted
cannot discern \n the needs of love
nor comprehend passion from intuition
and requires an explanation
\n\t\twhere there is none.
"""
print ... | print "Let's practice everything."
print "You\'d need to know \'bout escapes with \\ that do \n newlines and \t tabs."
poem = """
\t the lovely world
wtih logic so firmly planted
cannot discern \n the needs of love
nor comprehend passion from intuition
and requires an explanation
\n\t\twhere there is none.
"""
print ... | Change single quote to double quote to make it run -.- | Change single quote to double quote to make it run -.-
| Python | mit | jaredmanning/learning,jaredmanning/learning | print "Let's practice everything."
print 'You\'d need to know \'bout escapes with \\ that do \n newlines and \t tabs."
poem = """
\t the lovely world
wtih logic so firmly planted
cannot discern \n the needs of love
nor comprehend passion from intuition
and requires an explanation
\n\t\twhere there is none.
"""
print ... | print "Let's practice everything."
print "You\'d need to know \'bout escapes with \\ that do \n newlines and \t tabs."
poem = """
\t the lovely world
wtih logic so firmly planted
cannot discern \n the needs of love
nor comprehend passion from intuition
and requires an explanation
\n\t\twhere there is none.
"""
print ... | <commit_before>print "Let's practice everything."
print 'You\'d need to know \'bout escapes with \\ that do \n newlines and \t tabs."
poem = """
\t the lovely world
wtih logic so firmly planted
cannot discern \n the needs of love
nor comprehend passion from intuition
and requires an explanation
\n\t\twhere there is no... | print "Let's practice everything."
print "You\'d need to know \'bout escapes with \\ that do \n newlines and \t tabs."
poem = """
\t the lovely world
wtih logic so firmly planted
cannot discern \n the needs of love
nor comprehend passion from intuition
and requires an explanation
\n\t\twhere there is none.
"""
print ... | print "Let's practice everything."
print 'You\'d need to know \'bout escapes with \\ that do \n newlines and \t tabs."
poem = """
\t the lovely world
wtih logic so firmly planted
cannot discern \n the needs of love
nor comprehend passion from intuition
and requires an explanation
\n\t\twhere there is none.
"""
print ... | <commit_before>print "Let's practice everything."
print 'You\'d need to know \'bout escapes with \\ that do \n newlines and \t tabs."
poem = """
\t the lovely world
wtih logic so firmly planted
cannot discern \n the needs of love
nor comprehend passion from intuition
and requires an explanation
\n\t\twhere there is no... |
a24fe6cb58439d295455116574463ebdaf621f2c | mgsv_names.py | mgsv_names.py | import random, os
global adjectives, animals, rares
with open(os.path.join(os.path.dirname(__file__), 'adjectives.txt')) as f:
adjectives = f.readlines()
with open(os.path.join(os.path.dirname(__file__), 'animals.txt')) as f:
animals = f.readlines()
with open(os.path.join(os.path.dirname(__file__), 'rares.t... | from __future__ import unicode_literals, print_function
import sqlite3, os, random
_select = 'select {} from {} order by random() limit 1'
_uncommon_select = 'select value from uncommons where key=?'
def generate_name():
conn = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'names.db'))
cursor = conn... | Replace text files with database access. | Replace text files with database access.
| Python | unlicense | rotated8/mgsv_names | import random, os
global adjectives, animals, rares
with open(os.path.join(os.path.dirname(__file__), 'adjectives.txt')) as f:
adjectives = f.readlines()
with open(os.path.join(os.path.dirname(__file__), 'animals.txt')) as f:
animals = f.readlines()
with open(os.path.join(os.path.dirname(__file__), 'rares.t... | from __future__ import unicode_literals, print_function
import sqlite3, os, random
_select = 'select {} from {} order by random() limit 1'
_uncommon_select = 'select value from uncommons where key=?'
def generate_name():
conn = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'names.db'))
cursor = conn... | <commit_before>import random, os
global adjectives, animals, rares
with open(os.path.join(os.path.dirname(__file__), 'adjectives.txt')) as f:
adjectives = f.readlines()
with open(os.path.join(os.path.dirname(__file__), 'animals.txt')) as f:
animals = f.readlines()
with open(os.path.join(os.path.dirname(__fi... | from __future__ import unicode_literals, print_function
import sqlite3, os, random
_select = 'select {} from {} order by random() limit 1'
_uncommon_select = 'select value from uncommons where key=?'
def generate_name():
conn = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'names.db'))
cursor = conn... | import random, os
global adjectives, animals, rares
with open(os.path.join(os.path.dirname(__file__), 'adjectives.txt')) as f:
adjectives = f.readlines()
with open(os.path.join(os.path.dirname(__file__), 'animals.txt')) as f:
animals = f.readlines()
with open(os.path.join(os.path.dirname(__file__), 'rares.t... | <commit_before>import random, os
global adjectives, animals, rares
with open(os.path.join(os.path.dirname(__file__), 'adjectives.txt')) as f:
adjectives = f.readlines()
with open(os.path.join(os.path.dirname(__file__), 'animals.txt')) as f:
animals = f.readlines()
with open(os.path.join(os.path.dirname(__fi... |
33903a72a48a6d36792cec0f1fb3a6999c04b486 | blendergltf/exporters/base.py | blendergltf/exporters/base.py | import json
def _is_serializable(value):
try:
json.dumps(value)
return True
except TypeError:
return False
_IGNORED_CUSTOM_PROPS = [
'_RNA_UI',
'cycles',
'cycles_visibility',
]
# pylint: disable=unused-argument
class BaseExporter:
gltf_key = ''
blender_key = ''
... | import json
def _is_serializable(value):
try:
json.dumps(value)
return True
except TypeError:
return False
_IGNORED_CUSTOM_PROPS = [
'_RNA_UI',
'cycles',
'cycles_visibility',
]
# pylint: disable=unused-argument
class BaseExporter:
gltf_key = ''
blender_key = ''
... | Convert custom properties before checking for serializability | Convert custom properties before checking for serializability
| Python | apache-2.0 | Kupoman/blendergltf | import json
def _is_serializable(value):
try:
json.dumps(value)
return True
except TypeError:
return False
_IGNORED_CUSTOM_PROPS = [
'_RNA_UI',
'cycles',
'cycles_visibility',
]
# pylint: disable=unused-argument
class BaseExporter:
gltf_key = ''
blender_key = ''
... | import json
def _is_serializable(value):
try:
json.dumps(value)
return True
except TypeError:
return False
_IGNORED_CUSTOM_PROPS = [
'_RNA_UI',
'cycles',
'cycles_visibility',
]
# pylint: disable=unused-argument
class BaseExporter:
gltf_key = ''
blender_key = ''
... | <commit_before>import json
def _is_serializable(value):
try:
json.dumps(value)
return True
except TypeError:
return False
_IGNORED_CUSTOM_PROPS = [
'_RNA_UI',
'cycles',
'cycles_visibility',
]
# pylint: disable=unused-argument
class BaseExporter:
gltf_key = ''
bl... | import json
def _is_serializable(value):
try:
json.dumps(value)
return True
except TypeError:
return False
_IGNORED_CUSTOM_PROPS = [
'_RNA_UI',
'cycles',
'cycles_visibility',
]
# pylint: disable=unused-argument
class BaseExporter:
gltf_key = ''
blender_key = ''
... | import json
def _is_serializable(value):
try:
json.dumps(value)
return True
except TypeError:
return False
_IGNORED_CUSTOM_PROPS = [
'_RNA_UI',
'cycles',
'cycles_visibility',
]
# pylint: disable=unused-argument
class BaseExporter:
gltf_key = ''
blender_key = ''
... | <commit_before>import json
def _is_serializable(value):
try:
json.dumps(value)
return True
except TypeError:
return False
_IGNORED_CUSTOM_PROPS = [
'_RNA_UI',
'cycles',
'cycles_visibility',
]
# pylint: disable=unused-argument
class BaseExporter:
gltf_key = ''
bl... |
fc97832d0d96017ac71da125c3a7f29caceface6 | app/mod_budget/model.py | app/mod_budget/model.py | from app import db
from app.mod_auth.model import User
class Category(db.Document):
# The name of the category.
name = db.StringField(required = True)
class Entry(db.Document):
# The amount of the entry.
amount = db.DecimalField(precision = 2, required = True)
# A short description for the entry.... | from app import db
from app.mod_auth.model import User
class Category(db.Document):
# The name of the category.
name = db.StringField(required = True)
class Entry(db.Document):
# The amount of the entry.
amount = db.DecimalField(precision = 2, required = True)
# A short description for the entry.... | Make category an optional field for an entry. | Make category an optional field for an entry.
Income entries should not have a category. So the field should
be made optional.
| Python | mit | Zillolo/mana-vault,Zillolo/mana-vault,Zillolo/mana-vault | from app import db
from app.mod_auth.model import User
class Category(db.Document):
# The name of the category.
name = db.StringField(required = True)
class Entry(db.Document):
# The amount of the entry.
amount = db.DecimalField(precision = 2, required = True)
# A short description for the entry.... | from app import db
from app.mod_auth.model import User
class Category(db.Document):
# The name of the category.
name = db.StringField(required = True)
class Entry(db.Document):
# The amount of the entry.
amount = db.DecimalField(precision = 2, required = True)
# A short description for the entry.... | <commit_before>from app import db
from app.mod_auth.model import User
class Category(db.Document):
# The name of the category.
name = db.StringField(required = True)
class Entry(db.Document):
# The amount of the entry.
amount = db.DecimalField(precision = 2, required = True)
# A short description... | from app import db
from app.mod_auth.model import User
class Category(db.Document):
# The name of the category.
name = db.StringField(required = True)
class Entry(db.Document):
# The amount of the entry.
amount = db.DecimalField(precision = 2, required = True)
# A short description for the entry.... | from app import db
from app.mod_auth.model import User
class Category(db.Document):
# The name of the category.
name = db.StringField(required = True)
class Entry(db.Document):
# The amount of the entry.
amount = db.DecimalField(precision = 2, required = True)
# A short description for the entry.... | <commit_before>from app import db
from app.mod_auth.model import User
class Category(db.Document):
# The name of the category.
name = db.StringField(required = True)
class Entry(db.Document):
# The amount of the entry.
amount = db.DecimalField(precision = 2, required = True)
# A short description... |
094cb428316ac0fceb0178d5a507e746550f4509 | bin/task_usage_index.py | bin/task_usage_index.py | #!/usr/bin/env python3
import os, sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'lib'))
import glob, json
import numpy as np
import task_usage
def main(data_path, index_path):
count = 0
index = []
for path in sorted(glob.glob('{}/**/*.sqlite3'.format(data_path))):
data = task... | #!/usr/bin/env python3
import os, sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'lib'))
import glob, json
import numpy as np
import task_usage
def main(data_path, index_path, report_each=10000):
print('Looking for data in "{}"...'.format(data_path))
paths = sorted(glob.glob('{}/**/*.sqli... | Print progress from the indexing script | Print progress from the indexing script
| Python | mit | learning-on-chip/google-cluster-prediction | #!/usr/bin/env python3
import os, sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'lib'))
import glob, json
import numpy as np
import task_usage
def main(data_path, index_path):
count = 0
index = []
for path in sorted(glob.glob('{}/**/*.sqlite3'.format(data_path))):
data = task... | #!/usr/bin/env python3
import os, sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'lib'))
import glob, json
import numpy as np
import task_usage
def main(data_path, index_path, report_each=10000):
print('Looking for data in "{}"...'.format(data_path))
paths = sorted(glob.glob('{}/**/*.sqli... | <commit_before>#!/usr/bin/env python3
import os, sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'lib'))
import glob, json
import numpy as np
import task_usage
def main(data_path, index_path):
count = 0
index = []
for path in sorted(glob.glob('{}/**/*.sqlite3'.format(data_path))):
... | #!/usr/bin/env python3
import os, sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'lib'))
import glob, json
import numpy as np
import task_usage
def main(data_path, index_path, report_each=10000):
print('Looking for data in "{}"...'.format(data_path))
paths = sorted(glob.glob('{}/**/*.sqli... | #!/usr/bin/env python3
import os, sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'lib'))
import glob, json
import numpy as np
import task_usage
def main(data_path, index_path):
count = 0
index = []
for path in sorted(glob.glob('{}/**/*.sqlite3'.format(data_path))):
data = task... | <commit_before>#!/usr/bin/env python3
import os, sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'lib'))
import glob, json
import numpy as np
import task_usage
def main(data_path, index_path):
count = 0
index = []
for path in sorted(glob.glob('{}/**/*.sqlite3'.format(data_path))):
... |
9ca46da9d0cf8b5f4b4a6e9234d7089665df5e8b | chef/tests/__init__.py | chef/tests/__init__.py | import os
from unittest2 import TestCase
from chef.api import ChefAPI
TEST_ROOT = os.path.dirname(os.path.abspath(__file__))
def test_chef_api():
return ChefAPI('https://api.opscode.com/organizations/pycheftest', os.path.join(TEST_ROOT, 'client.pem'), 'unittests')
class ChefTestCase(TestCase):
"""Base cla... | import os
import random
from unittest2 import TestCase
from chef.api import ChefAPI
TEST_ROOT = os.path.dirname(os.path.abspath(__file__))
def test_chef_api():
return ChefAPI('https://api.opscode.com/organizations/pycheftest', os.path.join(TEST_ROOT, 'client.pem'), 'unittests')
class ChefTestCase(TestCase):
... | Add a method to generate random names for testing. | Add a method to generate random names for testing. | Python | apache-2.0 | jarosser06/pychef,dipakvwarade/pychef,coderanger/pychef,jarosser06/pychef,Scalr/pychef,dipakvwarade/pychef,cread/pychef,Scalr/pychef,coderanger/pychef,cread/pychef | import os
from unittest2 import TestCase
from chef.api import ChefAPI
TEST_ROOT = os.path.dirname(os.path.abspath(__file__))
def test_chef_api():
return ChefAPI('https://api.opscode.com/organizations/pycheftest', os.path.join(TEST_ROOT, 'client.pem'), 'unittests')
class ChefTestCase(TestCase):
"""Base cla... | import os
import random
from unittest2 import TestCase
from chef.api import ChefAPI
TEST_ROOT = os.path.dirname(os.path.abspath(__file__))
def test_chef_api():
return ChefAPI('https://api.opscode.com/organizations/pycheftest', os.path.join(TEST_ROOT, 'client.pem'), 'unittests')
class ChefTestCase(TestCase):
... | <commit_before>import os
from unittest2 import TestCase
from chef.api import ChefAPI
TEST_ROOT = os.path.dirname(os.path.abspath(__file__))
def test_chef_api():
return ChefAPI('https://api.opscode.com/organizations/pycheftest', os.path.join(TEST_ROOT, 'client.pem'), 'unittests')
class ChefTestCase(TestCase):
... | import os
import random
from unittest2 import TestCase
from chef.api import ChefAPI
TEST_ROOT = os.path.dirname(os.path.abspath(__file__))
def test_chef_api():
return ChefAPI('https://api.opscode.com/organizations/pycheftest', os.path.join(TEST_ROOT, 'client.pem'), 'unittests')
class ChefTestCase(TestCase):
... | import os
from unittest2 import TestCase
from chef.api import ChefAPI
TEST_ROOT = os.path.dirname(os.path.abspath(__file__))
def test_chef_api():
return ChefAPI('https://api.opscode.com/organizations/pycheftest', os.path.join(TEST_ROOT, 'client.pem'), 'unittests')
class ChefTestCase(TestCase):
"""Base cla... | <commit_before>import os
from unittest2 import TestCase
from chef.api import ChefAPI
TEST_ROOT = os.path.dirname(os.path.abspath(__file__))
def test_chef_api():
return ChefAPI('https://api.opscode.com/organizations/pycheftest', os.path.join(TEST_ROOT, 'client.pem'), 'unittests')
class ChefTestCase(TestCase):
... |
86a992dc15482087773f1591752a667a6014ba5d | docker/settings/celery.py | docker/settings/celery.py | from .docker_compose import DockerBaseSettings
class CeleryDevSettings(DockerBaseSettings):
pass
CeleryDevSettings.load_settings(__name__)
| from .docker_compose import DockerBaseSettings
class CeleryDevSettings(DockerBaseSettings):
# Since we can't properly set CORS on Azurite container
# (see https://github.com/Azure/Azurite/issues/55#issuecomment-503380561)
# trying to fetch ``objects.inv`` from celery container fails because the
# URL ... | Use proper domain for AZURE_MEDIA_STORAGE_HOSTNAME | Use proper domain for AZURE_MEDIA_STORAGE_HOSTNAME
We can't access docs.dev.readthedocs.io from celery container because
that domain points to 127.0.0.1 and we don't have the storage in that
IP. So, we need to override the AZURE_MEDIA_STORAGE_HOSTNAME in the
celery container to point to the storage.
We should do this... | Python | mit | rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org | from .docker_compose import DockerBaseSettings
class CeleryDevSettings(DockerBaseSettings):
pass
CeleryDevSettings.load_settings(__name__)
Use proper domain for AZURE_MEDIA_STORAGE_HOSTNAME
We can't access docs.dev.readthedocs.io from celery container because
that domain points to 127.0.0.1 and we don't have th... | from .docker_compose import DockerBaseSettings
class CeleryDevSettings(DockerBaseSettings):
# Since we can't properly set CORS on Azurite container
# (see https://github.com/Azure/Azurite/issues/55#issuecomment-503380561)
# trying to fetch ``objects.inv`` from celery container fails because the
# URL ... | <commit_before>from .docker_compose import DockerBaseSettings
class CeleryDevSettings(DockerBaseSettings):
pass
CeleryDevSettings.load_settings(__name__)
<commit_msg>Use proper domain for AZURE_MEDIA_STORAGE_HOSTNAME
We can't access docs.dev.readthedocs.io from celery container because
that domain points to 127... | from .docker_compose import DockerBaseSettings
class CeleryDevSettings(DockerBaseSettings):
# Since we can't properly set CORS on Azurite container
# (see https://github.com/Azure/Azurite/issues/55#issuecomment-503380561)
# trying to fetch ``objects.inv`` from celery container fails because the
# URL ... | from .docker_compose import DockerBaseSettings
class CeleryDevSettings(DockerBaseSettings):
pass
CeleryDevSettings.load_settings(__name__)
Use proper domain for AZURE_MEDIA_STORAGE_HOSTNAME
We can't access docs.dev.readthedocs.io from celery container because
that domain points to 127.0.0.1 and we don't have th... | <commit_before>from .docker_compose import DockerBaseSettings
class CeleryDevSettings(DockerBaseSettings):
pass
CeleryDevSettings.load_settings(__name__)
<commit_msg>Use proper domain for AZURE_MEDIA_STORAGE_HOSTNAME
We can't access docs.dev.readthedocs.io from celery container because
that domain points to 127... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.