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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8228a862654dfd0418d1e756042fa8f8746b57b9 | ideascube/conf/kb_usa_wmapache.py | ideascube/conf/kb_usa_wmapache.py | # -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
LANGUAGE_CODE = 'en'
IDEASCUBE_NAME = 'WHITE MOUNTAIN APACHE'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'blog',
},
{
'id': 'mediacenter',
},
{
'id': 'gutenberg',
},
{
'id': 'wiktionary',
... | # -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
LANGUAGE_CODE = 'en'
IDEASCUBE_NAME = 'WHITE MOUNTAIN APACHE'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'blog',
},
{
'id': 'mediacenter',
},
{
'id': 'gutenberg',
},
{
'id': 'wikipedia',
... | Remove Ted and add Wikiepdia | Remove Ted and add Wikiepdia
| Python | agpl-3.0 | ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,ideascube/ideascube | # -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
LANGUAGE_CODE = 'en'
IDEASCUBE_NAME = 'WHITE MOUNTAIN APACHE'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'blog',
},
{
'id': 'mediacenter',
},
{
'id': 'gutenberg',
},
{
'id': 'wiktionary',
... | # -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
LANGUAGE_CODE = 'en'
IDEASCUBE_NAME = 'WHITE MOUNTAIN APACHE'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'blog',
},
{
'id': 'mediacenter',
},
{
'id': 'gutenberg',
},
{
'id': 'wikipedia',
... | <commit_before># -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
LANGUAGE_CODE = 'en'
IDEASCUBE_NAME = 'WHITE MOUNTAIN APACHE'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'blog',
},
{
'id': 'mediacenter',
},
{
'id': 'gutenberg',
},
{
'id': '... | # -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
LANGUAGE_CODE = 'en'
IDEASCUBE_NAME = 'WHITE MOUNTAIN APACHE'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'blog',
},
{
'id': 'mediacenter',
},
{
'id': 'gutenberg',
},
{
'id': 'wikipedia',
... | # -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
LANGUAGE_CODE = 'en'
IDEASCUBE_NAME = 'WHITE MOUNTAIN APACHE'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'blog',
},
{
'id': 'mediacenter',
},
{
'id': 'gutenberg',
},
{
'id': 'wiktionary',
... | <commit_before># -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
LANGUAGE_CODE = 'en'
IDEASCUBE_NAME = 'WHITE MOUNTAIN APACHE'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'blog',
},
{
'id': 'mediacenter',
},
{
'id': 'gutenberg',
},
{
'id': '... |
4a8540dd374d4f75f4ded6a3e555776489b8d190 | imagersite/imager_images/tests.py | imagersite/imager_images/tests.py | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.test import TestCase
import factory
from faker import Faker
from imager_profile.models import ImagerProfile
from .models import Album, Photo
# Create your tests here.
fake = Faker()
class UserFactory(factory.Factory):
... | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.test import TestCase
import factory
from faker import Faker
from imager_profile.models import ImagerProfile
from .models import Album, Photo
# Create your tests here.
fake = Faker()
class UserFactory(factory.django.Djang... | Use DjangoModelFactory subclass for images test | Use DjangoModelFactory subclass for images test
| Python | mit | jesseklein406/django-imager,jesseklein406/django-imager,jesseklein406/django-imager | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.test import TestCase
import factory
from faker import Faker
from imager_profile.models import ImagerProfile
from .models import Album, Photo
# Create your tests here.
fake = Faker()
class UserFactory(factory.Factory):
... | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.test import TestCase
import factory
from faker import Faker
from imager_profile.models import ImagerProfile
from .models import Album, Photo
# Create your tests here.
fake = Faker()
class UserFactory(factory.django.Djang... | <commit_before>from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.test import TestCase
import factory
from faker import Faker
from imager_profile.models import ImagerProfile
from .models import Album, Photo
# Create your tests here.
fake = Faker()
class UserFactory(facto... | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.test import TestCase
import factory
from faker import Faker
from imager_profile.models import ImagerProfile
from .models import Album, Photo
# Create your tests here.
fake = Faker()
class UserFactory(factory.django.Djang... | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.test import TestCase
import factory
from faker import Faker
from imager_profile.models import ImagerProfile
from .models import Album, Photo
# Create your tests here.
fake = Faker()
class UserFactory(factory.Factory):
... | <commit_before>from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.test import TestCase
import factory
from faker import Faker
from imager_profile.models import ImagerProfile
from .models import Album, Photo
# Create your tests here.
fake = Faker()
class UserFactory(facto... |
cd26af9f5edb1b39e2ead09102c7dee409263c15 | sensor_consumers/bathroom_door.py | sensor_consumers/bathroom_door.py | # coding=utf-8
from utils import SensorConsumerBase
import sys
class Bathroom(SensorConsumerBase):
def __init__(self):
SensorConsumerBase.__init__(self, "home")
def run(self):
self.subscribe("bathroom-pubsub", self.pubsub_callback)
def pubsub_callback(self, data):
if "action" i... | # coding=utf-8
from utils import SensorConsumerBase
import sys
class Bathroom(SensorConsumerBase):
def __init__(self):
SensorConsumerBase.__init__(self, "home")
def run(self):
self.subscribe("bathroom-pubsub", self.pubsub_callback)
def pubsub_callback(self, data):
if "action" i... | Add sanity checks for temperature readings | Add sanity checks for temperature readings
| Python | bsd-3-clause | ojarva/home-info-display,ojarva/home-info-display,ojarva/home-info-display,ojarva/home-info-display | # coding=utf-8
from utils import SensorConsumerBase
import sys
class Bathroom(SensorConsumerBase):
def __init__(self):
SensorConsumerBase.__init__(self, "home")
def run(self):
self.subscribe("bathroom-pubsub", self.pubsub_callback)
def pubsub_callback(self, data):
if "action" i... | # coding=utf-8
from utils import SensorConsumerBase
import sys
class Bathroom(SensorConsumerBase):
def __init__(self):
SensorConsumerBase.__init__(self, "home")
def run(self):
self.subscribe("bathroom-pubsub", self.pubsub_callback)
def pubsub_callback(self, data):
if "action" i... | <commit_before># coding=utf-8
from utils import SensorConsumerBase
import sys
class Bathroom(SensorConsumerBase):
def __init__(self):
SensorConsumerBase.__init__(self, "home")
def run(self):
self.subscribe("bathroom-pubsub", self.pubsub_callback)
def pubsub_callback(self, data):
... | # coding=utf-8
from utils import SensorConsumerBase
import sys
class Bathroom(SensorConsumerBase):
def __init__(self):
SensorConsumerBase.__init__(self, "home")
def run(self):
self.subscribe("bathroom-pubsub", self.pubsub_callback)
def pubsub_callback(self, data):
if "action" i... | # coding=utf-8
from utils import SensorConsumerBase
import sys
class Bathroom(SensorConsumerBase):
def __init__(self):
SensorConsumerBase.__init__(self, "home")
def run(self):
self.subscribe("bathroom-pubsub", self.pubsub_callback)
def pubsub_callback(self, data):
if "action" i... | <commit_before># coding=utf-8
from utils import SensorConsumerBase
import sys
class Bathroom(SensorConsumerBase):
def __init__(self):
SensorConsumerBase.__init__(self, "home")
def run(self):
self.subscribe("bathroom-pubsub", self.pubsub_callback)
def pubsub_callback(self, data):
... |
72658874727d877996b413aa7d7d1beb1375a9c3 | stagecraft/libs/backdrop_client/backdrop_client.py | stagecraft/libs/backdrop_client/backdrop_client.py | from __future__ import unicode_literals
import json
import requests
from django.conf import settings
class BackdropError(Exception):
pass
def create_dataset(name, capped_size):
"""
Connect to Backdrop and create a new collection called ``name``.
Specify ``capped_size`` in bytes to create a capped ... | from __future__ import unicode_literals
import json
import requests
from django.conf import settings
class BackdropError(Exception):
pass
def create_dataset(name, capped_size):
"""
Connect to Backdrop and create a new collection called ``name``.
Specify ``capped_size`` in bytes to create a capped ... | Add further constrains to create_dataset | Add further constrains to create_dataset
To clarify that it capped_size must be zero or a positive integer.
| Python | mit | alphagov/stagecraft,alphagov/stagecraft,alphagov/stagecraft,alphagov/stagecraft | from __future__ import unicode_literals
import json
import requests
from django.conf import settings
class BackdropError(Exception):
pass
def create_dataset(name, capped_size):
"""
Connect to Backdrop and create a new collection called ``name``.
Specify ``capped_size`` in bytes to create a capped ... | from __future__ import unicode_literals
import json
import requests
from django.conf import settings
class BackdropError(Exception):
pass
def create_dataset(name, capped_size):
"""
Connect to Backdrop and create a new collection called ``name``.
Specify ``capped_size`` in bytes to create a capped ... | <commit_before>from __future__ import unicode_literals
import json
import requests
from django.conf import settings
class BackdropError(Exception):
pass
def create_dataset(name, capped_size):
"""
Connect to Backdrop and create a new collection called ``name``.
Specify ``capped_size`` in bytes to c... | from __future__ import unicode_literals
import json
import requests
from django.conf import settings
class BackdropError(Exception):
pass
def create_dataset(name, capped_size):
"""
Connect to Backdrop and create a new collection called ``name``.
Specify ``capped_size`` in bytes to create a capped ... | from __future__ import unicode_literals
import json
import requests
from django.conf import settings
class BackdropError(Exception):
pass
def create_dataset(name, capped_size):
"""
Connect to Backdrop and create a new collection called ``name``.
Specify ``capped_size`` in bytes to create a capped ... | <commit_before>from __future__ import unicode_literals
import json
import requests
from django.conf import settings
class BackdropError(Exception):
pass
def create_dataset(name, capped_size):
"""
Connect to Backdrop and create a new collection called ``name``.
Specify ``capped_size`` in bytes to c... |
8f42513d6845b6b1461150b1e92890c78c72280e | find_text_type_file.py | find_text_type_file.py | #!/usr/bin/env python3
import os
import subprocess
import sys
def find_text_files(directory):
''' , '''
file_list = []
abspath = os.path.abspath(directory)
for i in os.listdir(directory):
result = subprocess.run(['file', "{}/{}".format(abspath, i)], stdout=subprocess.PIPE)
if 'text'... | #!/usr/bin/env python3
from pathlib import Path
import os
import subprocess
import sys
LINE_LIMIT = 100
def find_text_files(directory):
''' find text files and look for file content less than 100 characters. '''
file_list = []
abspath = os.path.abspath(directory)
files = [i[0] for i in os.walk(abs... | Update find text, walk through the directories with os.walk and print line length less than 100 characters. | Update find text, walk through the directories with os.walk and print line length less than 100 characters.
Signed-off-by: SJ Huang <[email protected]>
| Python | apache-2.0 | sjh/python | #!/usr/bin/env python3
import os
import subprocess
import sys
def find_text_files(directory):
''' , '''
file_list = []
abspath = os.path.abspath(directory)
for i in os.listdir(directory):
result = subprocess.run(['file', "{}/{}".format(abspath, i)], stdout=subprocess.PIPE)
if 'text'... | #!/usr/bin/env python3
from pathlib import Path
import os
import subprocess
import sys
LINE_LIMIT = 100
def find_text_files(directory):
''' find text files and look for file content less than 100 characters. '''
file_list = []
abspath = os.path.abspath(directory)
files = [i[0] for i in os.walk(abs... | <commit_before>#!/usr/bin/env python3
import os
import subprocess
import sys
def find_text_files(directory):
''' , '''
file_list = []
abspath = os.path.abspath(directory)
for i in os.listdir(directory):
result = subprocess.run(['file', "{}/{}".format(abspath, i)], stdout=subprocess.PIPE)
... | #!/usr/bin/env python3
from pathlib import Path
import os
import subprocess
import sys
LINE_LIMIT = 100
def find_text_files(directory):
''' find text files and look for file content less than 100 characters. '''
file_list = []
abspath = os.path.abspath(directory)
files = [i[0] for i in os.walk(abs... | #!/usr/bin/env python3
import os
import subprocess
import sys
def find_text_files(directory):
''' , '''
file_list = []
abspath = os.path.abspath(directory)
for i in os.listdir(directory):
result = subprocess.run(['file', "{}/{}".format(abspath, i)], stdout=subprocess.PIPE)
if 'text'... | <commit_before>#!/usr/bin/env python3
import os
import subprocess
import sys
def find_text_files(directory):
''' , '''
file_list = []
abspath = os.path.abspath(directory)
for i in os.listdir(directory):
result = subprocess.run(['file', "{}/{}".format(abspath, i)], stdout=subprocess.PIPE)
... |
c53e8aaadb35b6ca23d60bf4f4aa84812f186128 | flake8_respect_noqa.py | flake8_respect_noqa.py | # -*- coding: utf-8 -*-
"""
Always ignore lines with '# noqa'
"""
__version__ = 0.1
import pep8
class RespectNoqaReport(pep8.StandardReport):
def error(self, line_number, offset, text, check):
if pep8.noqa(self.lines[line_number - 1]):
return
else:
return super(RespectNoq... | # -*- coding: utf-8 -*-
"""
Always ignore lines with '# noqa'
"""
__version__ = 0.1
import pep8
class RespectNoqaReport(pep8.StandardReport):
def error(self, line_number, offset, text, check):
if len(self.lines) > line_number - 1 and pep8.noqa(self.lines[line_number - 1]):
return
els... | Fix for case when file can't be opened due to IOError or similar | Fix for case when file can't be opened due to IOError or similar
| Python | mit | spookylukey/flake8-respect-noqa | # -*- coding: utf-8 -*-
"""
Always ignore lines with '# noqa'
"""
__version__ = 0.1
import pep8
class RespectNoqaReport(pep8.StandardReport):
def error(self, line_number, offset, text, check):
if pep8.noqa(self.lines[line_number - 1]):
return
else:
return super(RespectNoq... | # -*- coding: utf-8 -*-
"""
Always ignore lines with '# noqa'
"""
__version__ = 0.1
import pep8
class RespectNoqaReport(pep8.StandardReport):
def error(self, line_number, offset, text, check):
if len(self.lines) > line_number - 1 and pep8.noqa(self.lines[line_number - 1]):
return
els... | <commit_before># -*- coding: utf-8 -*-
"""
Always ignore lines with '# noqa'
"""
__version__ = 0.1
import pep8
class RespectNoqaReport(pep8.StandardReport):
def error(self, line_number, offset, text, check):
if pep8.noqa(self.lines[line_number - 1]):
return
else:
return s... | # -*- coding: utf-8 -*-
"""
Always ignore lines with '# noqa'
"""
__version__ = 0.1
import pep8
class RespectNoqaReport(pep8.StandardReport):
def error(self, line_number, offset, text, check):
if len(self.lines) > line_number - 1 and pep8.noqa(self.lines[line_number - 1]):
return
els... | # -*- coding: utf-8 -*-
"""
Always ignore lines with '# noqa'
"""
__version__ = 0.1
import pep8
class RespectNoqaReport(pep8.StandardReport):
def error(self, line_number, offset, text, check):
if pep8.noqa(self.lines[line_number - 1]):
return
else:
return super(RespectNoq... | <commit_before># -*- coding: utf-8 -*-
"""
Always ignore lines with '# noqa'
"""
__version__ = 0.1
import pep8
class RespectNoqaReport(pep8.StandardReport):
def error(self, line_number, offset, text, check):
if pep8.noqa(self.lines[line_number - 1]):
return
else:
return s... |
c54bca55a4b0be4f1b2be7bda5ae5cdb215959ed | flask_toybox/compat.py | flask_toybox/compat.py | """
Cross-version compatibility module.
"""
from __future__ import absolute_import
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
| """
Cross-version compatibility module.
"""
from __future__ import absolute_import
try:
from collections import OrderedDict
except ImportError: # pragma: no cover
from ordereddict import OrderedDict
| Exclude fallback from coverage reporting | Exclude fallback from coverage reporting
| Python | mit | drdaeman/flask-toybox | """
Cross-version compatibility module.
"""
from __future__ import absolute_import
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
Exclude fallback from coverage reporting | """
Cross-version compatibility module.
"""
from __future__ import absolute_import
try:
from collections import OrderedDict
except ImportError: # pragma: no cover
from ordereddict import OrderedDict
| <commit_before>"""
Cross-version compatibility module.
"""
from __future__ import absolute_import
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
<commit_msg>Exclude fallback from coverage reporting<commit_after> | """
Cross-version compatibility module.
"""
from __future__ import absolute_import
try:
from collections import OrderedDict
except ImportError: # pragma: no cover
from ordereddict import OrderedDict
| """
Cross-version compatibility module.
"""
from __future__ import absolute_import
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
Exclude fallback from coverage reporting"""
Cross-version compatibility module.
"""
from __future__ import absolute_import
try:
... | <commit_before>"""
Cross-version compatibility module.
"""
from __future__ import absolute_import
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
<commit_msg>Exclude fallback from coverage reporting<commit_after>"""
Cross-version compatibility module.
"""
from ... |
d3b544f5977a433488d9abde6ff1a078def15647 | app/crosswalk.py | app/crosswalk.py | from app.clients import factualClient
from app.util import log
from factual import APIException
CROSSWALK_CACHE_VERSION = 1
def getVenueIdentifiers(yelpID):
yelpURL = "https://yelp.com/biz/%s" % yelpID
mapping = {
"id": yelpID,
"version": CROSSWALK_CACHE_VERSION,
"yelp": {
... | from app.clients import factualClient
from app.util import log
from factual import APIException
CROSSWALK_CACHE_VERSION = 1
def getVenueIdentifiers(yelpID):
yelpURL = "https://yelp.com/biz/%s" % yelpID
mapping = {
"id": yelpID,
"version": CROSSWALK_CACHE_VERSION,
"yelp": {
... | Fix branch in caching logic | Fix branch in caching logic
| Python | mpl-2.0 | liuche/prox-server | from app.clients import factualClient
from app.util import log
from factual import APIException
CROSSWALK_CACHE_VERSION = 1
def getVenueIdentifiers(yelpID):
yelpURL = "https://yelp.com/biz/%s" % yelpID
mapping = {
"id": yelpID,
"version": CROSSWALK_CACHE_VERSION,
"yelp": {
... | from app.clients import factualClient
from app.util import log
from factual import APIException
CROSSWALK_CACHE_VERSION = 1
def getVenueIdentifiers(yelpID):
yelpURL = "https://yelp.com/biz/%s" % yelpID
mapping = {
"id": yelpID,
"version": CROSSWALK_CACHE_VERSION,
"yelp": {
... | <commit_before>from app.clients import factualClient
from app.util import log
from factual import APIException
CROSSWALK_CACHE_VERSION = 1
def getVenueIdentifiers(yelpID):
yelpURL = "https://yelp.com/biz/%s" % yelpID
mapping = {
"id": yelpID,
"version": CROSSWALK_CACHE_VERSION,
... | from app.clients import factualClient
from app.util import log
from factual import APIException
CROSSWALK_CACHE_VERSION = 1
def getVenueIdentifiers(yelpID):
yelpURL = "https://yelp.com/biz/%s" % yelpID
mapping = {
"id": yelpID,
"version": CROSSWALK_CACHE_VERSION,
"yelp": {
... | from app.clients import factualClient
from app.util import log
from factual import APIException
CROSSWALK_CACHE_VERSION = 1
def getVenueIdentifiers(yelpID):
yelpURL = "https://yelp.com/biz/%s" % yelpID
mapping = {
"id": yelpID,
"version": CROSSWALK_CACHE_VERSION,
"yelp": {
... | <commit_before>from app.clients import factualClient
from app.util import log
from factual import APIException
CROSSWALK_CACHE_VERSION = 1
def getVenueIdentifiers(yelpID):
yelpURL = "https://yelp.com/biz/%s" % yelpID
mapping = {
"id": yelpID,
"version": CROSSWALK_CACHE_VERSION,
... |
e317812daaae4ff1b50c7d56931425e86a7255b8 | run_IRIDA_Uploader.py | run_IRIDA_Uploader.py | #!/usr/bin/env python
import wx
from GUI.iridaUploaderMain import MainFrame
if __name__ == "__main__":
app = wx.App(False)
frame = MainFrame()
frame.Show()
frame.mp.api = frame.settings_frame.attempt_connect_to_api()
app.MainLoop()
| #!/usr/bin/env python
import wx
from GUI.MainFrame import MainFrame
if __name__ == "__main__":
app = wx.App(False)
frame = MainFrame()
frame.Show()
frame.mp.api = frame.settings_frame.attempt_connect_to_api()
app.MainLoop()
| Use the right package name for running the uploader. | Use the right package name for running the uploader.
| Python | apache-2.0 | phac-nml/irida-miseq-uploader,phac-nml/irida-miseq-uploader | #!/usr/bin/env python
import wx
from GUI.iridaUploaderMain import MainFrame
if __name__ == "__main__":
app = wx.App(False)
frame = MainFrame()
frame.Show()
frame.mp.api = frame.settings_frame.attempt_connect_to_api()
app.MainLoop()
Use the right package name for running the uploader. | #!/usr/bin/env python
import wx
from GUI.MainFrame import MainFrame
if __name__ == "__main__":
app = wx.App(False)
frame = MainFrame()
frame.Show()
frame.mp.api = frame.settings_frame.attempt_connect_to_api()
app.MainLoop()
| <commit_before>#!/usr/bin/env python
import wx
from GUI.iridaUploaderMain import MainFrame
if __name__ == "__main__":
app = wx.App(False)
frame = MainFrame()
frame.Show()
frame.mp.api = frame.settings_frame.attempt_connect_to_api()
app.MainLoop()
<commit_msg>Use the right package name for running ... | #!/usr/bin/env python
import wx
from GUI.MainFrame import MainFrame
if __name__ == "__main__":
app = wx.App(False)
frame = MainFrame()
frame.Show()
frame.mp.api = frame.settings_frame.attempt_connect_to_api()
app.MainLoop()
| #!/usr/bin/env python
import wx
from GUI.iridaUploaderMain import MainFrame
if __name__ == "__main__":
app = wx.App(False)
frame = MainFrame()
frame.Show()
frame.mp.api = frame.settings_frame.attempt_connect_to_api()
app.MainLoop()
Use the right package name for running the uploader.#!/usr/bin/env... | <commit_before>#!/usr/bin/env python
import wx
from GUI.iridaUploaderMain import MainFrame
if __name__ == "__main__":
app = wx.App(False)
frame = MainFrame()
frame.Show()
frame.mp.api = frame.settings_frame.attempt_connect_to_api()
app.MainLoop()
<commit_msg>Use the right package name for running ... |
e3c79b7851aafad2a491c0ceafe2d3f539a4e3df | number_to_words.py | number_to_words.py | class NumberToWords(object):
"""
Class for converting positive integer values to a textual representation
of the submitted number for value of 0 up to 999999999.
"""
MAX = 999999999
SMALL_NUMBERS = ['', 'one', 'two', 'three', 'four', 'five', 'six',
'seven', 'eight', 'nine',... | class NumberToWords(object):
"""
Class for converting positive integer values to a textual representation
of the submitted number for value of 0 up to 999999999.
"""
MAX = 999999999
SMALL_NUMBERS = ['', 'one', 'two', 'three', 'four', 'five', 'six',
'seven', 'eight', 'nine',... | Add initial function definition and documentation for function to do conversion | Add initial function definition and documentation for function to do conversion | Python | mit | ianfieldhouse/number_to_words | class NumberToWords(object):
"""
Class for converting positive integer values to a textual representation
of the submitted number for value of 0 up to 999999999.
"""
MAX = 999999999
SMALL_NUMBERS = ['', 'one', 'two', 'three', 'four', 'five', 'six',
'seven', 'eight', 'nine',... | class NumberToWords(object):
"""
Class for converting positive integer values to a textual representation
of the submitted number for value of 0 up to 999999999.
"""
MAX = 999999999
SMALL_NUMBERS = ['', 'one', 'two', 'three', 'four', 'five', 'six',
'seven', 'eight', 'nine',... | <commit_before>class NumberToWords(object):
"""
Class for converting positive integer values to a textual representation
of the submitted number for value of 0 up to 999999999.
"""
MAX = 999999999
SMALL_NUMBERS = ['', 'one', 'two', 'three', 'four', 'five', 'six',
'seven', '... | class NumberToWords(object):
"""
Class for converting positive integer values to a textual representation
of the submitted number for value of 0 up to 999999999.
"""
MAX = 999999999
SMALL_NUMBERS = ['', 'one', 'two', 'three', 'four', 'five', 'six',
'seven', 'eight', 'nine',... | class NumberToWords(object):
"""
Class for converting positive integer values to a textual representation
of the submitted number for value of 0 up to 999999999.
"""
MAX = 999999999
SMALL_NUMBERS = ['', 'one', 'two', 'three', 'four', 'five', 'six',
'seven', 'eight', 'nine',... | <commit_before>class NumberToWords(object):
"""
Class for converting positive integer values to a textual representation
of the submitted number for value of 0 up to 999999999.
"""
MAX = 999999999
SMALL_NUMBERS = ['', 'one', 'two', 'three', 'four', 'five', 'six',
'seven', '... |
27c3ebfee3789de817defc18ac4a3dbc37a7d03f | tests/munge_js_test.py | tests/munge_js_test.py | import os.path
import unittest
import munge_js
class TestCase(unittest.TestCase):
pass
TestCase.assert_false = TestCase.assertFalse
TestCase.assert_equal = TestCase.assertEqual
fixture_root = os.path.join(os.path.dirname(__file__), 'fixtures')
def get_fixtures():
dir = os.path.join(fixture_root, 'input')
... | import os.path
import unittest
import munge_js
class TestCase(unittest.TestCase):
pass
TestCase.assert_false = TestCase.assertFalse
TestCase.assert_equal = TestCase.assertEqual
fixture_root = os.path.join(os.path.dirname(__file__), 'fixtures')
def get_fixtures():
dir = os.path.join(fixture_root, 'input')
... | Use an additional function to scope everything properly | Use an additional function to scope everything properly
| Python | mit | p/munge-js,p/munge-js | import os.path
import unittest
import munge_js
class TestCase(unittest.TestCase):
pass
TestCase.assert_false = TestCase.assertFalse
TestCase.assert_equal = TestCase.assertEqual
fixture_root = os.path.join(os.path.dirname(__file__), 'fixtures')
def get_fixtures():
dir = os.path.join(fixture_root, 'input')
... | import os.path
import unittest
import munge_js
class TestCase(unittest.TestCase):
pass
TestCase.assert_false = TestCase.assertFalse
TestCase.assert_equal = TestCase.assertEqual
fixture_root = os.path.join(os.path.dirname(__file__), 'fixtures')
def get_fixtures():
dir = os.path.join(fixture_root, 'input')
... | <commit_before>import os.path
import unittest
import munge_js
class TestCase(unittest.TestCase):
pass
TestCase.assert_false = TestCase.assertFalse
TestCase.assert_equal = TestCase.assertEqual
fixture_root = os.path.join(os.path.dirname(__file__), 'fixtures')
def get_fixtures():
dir = os.path.join(fixture_ro... | import os.path
import unittest
import munge_js
class TestCase(unittest.TestCase):
pass
TestCase.assert_false = TestCase.assertFalse
TestCase.assert_equal = TestCase.assertEqual
fixture_root = os.path.join(os.path.dirname(__file__), 'fixtures')
def get_fixtures():
dir = os.path.join(fixture_root, 'input')
... | import os.path
import unittest
import munge_js
class TestCase(unittest.TestCase):
pass
TestCase.assert_false = TestCase.assertFalse
TestCase.assert_equal = TestCase.assertEqual
fixture_root = os.path.join(os.path.dirname(__file__), 'fixtures')
def get_fixtures():
dir = os.path.join(fixture_root, 'input')
... | <commit_before>import os.path
import unittest
import munge_js
class TestCase(unittest.TestCase):
pass
TestCase.assert_false = TestCase.assertFalse
TestCase.assert_equal = TestCase.assertEqual
fixture_root = os.path.join(os.path.dirname(__file__), 'fixtures')
def get_fixtures():
dir = os.path.join(fixture_ro... |
7be4d15bfba24e090647d40c4f4a7f5f14e54204 | scheduler/schedule.py | scheduler/schedule.py | import sys
import time
import logging
logging.basicConfig(level=logging.DEBUG)
from redis import StrictRedis
from rq import Queue
from apscheduler.schedulers.blocking import BlockingScheduler
from d1lod import jobs
conn = StrictRedis(host='redis', port='6379')
q = Queue(connection=conn)
sched = BlockingScheduler()
... | import sys
import time
import logging
logging.basicConfig(level=logging.DEBUG)
from redis import StrictRedis
from rq import Queue
from apscheduler.schedulers.blocking import BlockingScheduler
from d1lod import jobs
conn = StrictRedis(host='redis', port='6379')
q = Queue(connection=conn)
sched = BlockingScheduler()
... | Remove timeout argument on update job | Remove timeout argument on update job
| Python | apache-2.0 | ec-geolink/d1lod,ec-geolink/d1lod,ec-geolink/d1lod,ec-geolink/d1lod | import sys
import time
import logging
logging.basicConfig(level=logging.DEBUG)
from redis import StrictRedis
from rq import Queue
from apscheduler.schedulers.blocking import BlockingScheduler
from d1lod import jobs
conn = StrictRedis(host='redis', port='6379')
q = Queue(connection=conn)
sched = BlockingScheduler()
... | import sys
import time
import logging
logging.basicConfig(level=logging.DEBUG)
from redis import StrictRedis
from rq import Queue
from apscheduler.schedulers.blocking import BlockingScheduler
from d1lod import jobs
conn = StrictRedis(host='redis', port='6379')
q = Queue(connection=conn)
sched = BlockingScheduler()
... | <commit_before>import sys
import time
import logging
logging.basicConfig(level=logging.DEBUG)
from redis import StrictRedis
from rq import Queue
from apscheduler.schedulers.blocking import BlockingScheduler
from d1lod import jobs
conn = StrictRedis(host='redis', port='6379')
q = Queue(connection=conn)
sched = Block... | import sys
import time
import logging
logging.basicConfig(level=logging.DEBUG)
from redis import StrictRedis
from rq import Queue
from apscheduler.schedulers.blocking import BlockingScheduler
from d1lod import jobs
conn = StrictRedis(host='redis', port='6379')
q = Queue(connection=conn)
sched = BlockingScheduler()
... | import sys
import time
import logging
logging.basicConfig(level=logging.DEBUG)
from redis import StrictRedis
from rq import Queue
from apscheduler.schedulers.blocking import BlockingScheduler
from d1lod import jobs
conn = StrictRedis(host='redis', port='6379')
q = Queue(connection=conn)
sched = BlockingScheduler()
... | <commit_before>import sys
import time
import logging
logging.basicConfig(level=logging.DEBUG)
from redis import StrictRedis
from rq import Queue
from apscheduler.schedulers.blocking import BlockingScheduler
from d1lod import jobs
conn = StrictRedis(host='redis', port='6379')
q = Queue(connection=conn)
sched = Block... |
29b26aa8b44ea5820cfcd20e324d2c3631338228 | portal/models/research_protocol.py | portal/models/research_protocol.py | """Research Protocol module"""
from datetime import datetime
from ..database import db
from ..date_tools import FHIR_datetime
class ResearchProtocol(db.Model):
"""ResearchProtocol model for tracking QB versions"""
__tablename__ = 'research_protocols'
id = db.Column(db.Integer, primary_key=True)
name ... | """Research Protocol module"""
from datetime import datetime
from ..database import db
from ..date_tools import FHIR_datetime
class ResearchProtocol(db.Model):
"""ResearchProtocol model for tracking QB versions"""
__tablename__ = 'research_protocols'
id = db.Column(db.Integer, primary_key=True)
name ... | Implement common pattern from_json calls update_from_json | Implement common pattern from_json calls update_from_json
| Python | bsd-3-clause | uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal | """Research Protocol module"""
from datetime import datetime
from ..database import db
from ..date_tools import FHIR_datetime
class ResearchProtocol(db.Model):
"""ResearchProtocol model for tracking QB versions"""
__tablename__ = 'research_protocols'
id = db.Column(db.Integer, primary_key=True)
name ... | """Research Protocol module"""
from datetime import datetime
from ..database import db
from ..date_tools import FHIR_datetime
class ResearchProtocol(db.Model):
"""ResearchProtocol model for tracking QB versions"""
__tablename__ = 'research_protocols'
id = db.Column(db.Integer, primary_key=True)
name ... | <commit_before>"""Research Protocol module"""
from datetime import datetime
from ..database import db
from ..date_tools import FHIR_datetime
class ResearchProtocol(db.Model):
"""ResearchProtocol model for tracking QB versions"""
__tablename__ = 'research_protocols'
id = db.Column(db.Integer, primary_key=... | """Research Protocol module"""
from datetime import datetime
from ..database import db
from ..date_tools import FHIR_datetime
class ResearchProtocol(db.Model):
"""ResearchProtocol model for tracking QB versions"""
__tablename__ = 'research_protocols'
id = db.Column(db.Integer, primary_key=True)
name ... | """Research Protocol module"""
from datetime import datetime
from ..database import db
from ..date_tools import FHIR_datetime
class ResearchProtocol(db.Model):
"""ResearchProtocol model for tracking QB versions"""
__tablename__ = 'research_protocols'
id = db.Column(db.Integer, primary_key=True)
name ... | <commit_before>"""Research Protocol module"""
from datetime import datetime
from ..database import db
from ..date_tools import FHIR_datetime
class ResearchProtocol(db.Model):
"""ResearchProtocol model for tracking QB versions"""
__tablename__ = 'research_protocols'
id = db.Column(db.Integer, primary_key=... |
e68b8146c6ae509489fde97faf10d5748904a20c | sentrylogs/helpers.py | sentrylogs/helpers.py | """
Helper functions for Sentry Logs
"""
from sentry_sdk import capture_message, configure_scope
from .conf.settings import SENTRY_LOG_LEVEL, SENTRY_LOG_LEVELS
def send_message(message, level, data):
"""Send a message to the Sentry server"""
# Only send messages for desired log level
if (SENTRY_LOG_LEVEL... | """
Helper functions for Sentry Logs
"""
from sentry_sdk import capture_message, configure_scope
from .conf.settings import SENTRY_LOG_LEVEL, SENTRY_LOG_LEVELS
def send_message(message, level, data):
"""Send a message to the Sentry server"""
# Only send messages for desired log level
if (SENTRY_LOG_LEVEL... | Use structured context instead of additional data | Use structured context instead of additional data
Additional Data is deprecated https://docs.sentry.io/platforms/python/enriching-events/context/#additional-data
| Python | bsd-3-clause | mdgart/sentrylogs | """
Helper functions for Sentry Logs
"""
from sentry_sdk import capture_message, configure_scope
from .conf.settings import SENTRY_LOG_LEVEL, SENTRY_LOG_LEVELS
def send_message(message, level, data):
"""Send a message to the Sentry server"""
# Only send messages for desired log level
if (SENTRY_LOG_LEVEL... | """
Helper functions for Sentry Logs
"""
from sentry_sdk import capture_message, configure_scope
from .conf.settings import SENTRY_LOG_LEVEL, SENTRY_LOG_LEVELS
def send_message(message, level, data):
"""Send a message to the Sentry server"""
# Only send messages for desired log level
if (SENTRY_LOG_LEVEL... | <commit_before>"""
Helper functions for Sentry Logs
"""
from sentry_sdk import capture_message, configure_scope
from .conf.settings import SENTRY_LOG_LEVEL, SENTRY_LOG_LEVELS
def send_message(message, level, data):
"""Send a message to the Sentry server"""
# Only send messages for desired log level
if (S... | """
Helper functions for Sentry Logs
"""
from sentry_sdk import capture_message, configure_scope
from .conf.settings import SENTRY_LOG_LEVEL, SENTRY_LOG_LEVELS
def send_message(message, level, data):
"""Send a message to the Sentry server"""
# Only send messages for desired log level
if (SENTRY_LOG_LEVEL... | """
Helper functions for Sentry Logs
"""
from sentry_sdk import capture_message, configure_scope
from .conf.settings import SENTRY_LOG_LEVEL, SENTRY_LOG_LEVELS
def send_message(message, level, data):
"""Send a message to the Sentry server"""
# Only send messages for desired log level
if (SENTRY_LOG_LEVEL... | <commit_before>"""
Helper functions for Sentry Logs
"""
from sentry_sdk import capture_message, configure_scope
from .conf.settings import SENTRY_LOG_LEVEL, SENTRY_LOG_LEVELS
def send_message(message, level, data):
"""Send a message to the Sentry server"""
# Only send messages for desired log level
if (S... |
f0d19857914f196db624abcd9de718d1d4b73e84 | organizer/views.py | organizer/views.py | from django.http.response import HttpResponse
from django.template import Context, loader
from .models import Tag
def homepage(request):
tag_list = Tag.objects.all()
template = loader.get_template(
'organizer/tag_list.html')
context = Context({'tag_list': tag_list})
output = template.render(c... | from django.http.response import HttpResponse
from django.template import Context, loader
from .models import Tag
def homepage(request):
tag_list = Tag.objects.all()
template = loader.get_template(
'organizer/tag_list.html')
context = Context({'tag_list': tag_list})
output = template.render(c... | Tag Detail: create view skeleton. | Ch05: Tag Detail: create view skeleton.
| Python | bsd-2-clause | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | from django.http.response import HttpResponse
from django.template import Context, loader
from .models import Tag
def homepage(request):
tag_list = Tag.objects.all()
template = loader.get_template(
'organizer/tag_list.html')
context = Context({'tag_list': tag_list})
output = template.render(c... | from django.http.response import HttpResponse
from django.template import Context, loader
from .models import Tag
def homepage(request):
tag_list = Tag.objects.all()
template = loader.get_template(
'organizer/tag_list.html')
context = Context({'tag_list': tag_list})
output = template.render(c... | <commit_before>from django.http.response import HttpResponse
from django.template import Context, loader
from .models import Tag
def homepage(request):
tag_list = Tag.objects.all()
template = loader.get_template(
'organizer/tag_list.html')
context = Context({'tag_list': tag_list})
output = te... | from django.http.response import HttpResponse
from django.template import Context, loader
from .models import Tag
def homepage(request):
tag_list = Tag.objects.all()
template = loader.get_template(
'organizer/tag_list.html')
context = Context({'tag_list': tag_list})
output = template.render(c... | from django.http.response import HttpResponse
from django.template import Context, loader
from .models import Tag
def homepage(request):
tag_list = Tag.objects.all()
template = loader.get_template(
'organizer/tag_list.html')
context = Context({'tag_list': tag_list})
output = template.render(c... | <commit_before>from django.http.response import HttpResponse
from django.template import Context, loader
from .models import Tag
def homepage(request):
tag_list = Tag.objects.all()
template = loader.get_template(
'organizer/tag_list.html')
context = Context({'tag_list': tag_list})
output = te... |
12c57c385ad60cf48f99082bb486b429250e5921 | gittip/orm/__init__.py | gittip/orm/__init__.py | from __future__ import unicode_literals
import os
import pdb
from sqlalchemy import create_engine, MetaData
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, scoped_session
class Model(object):
def __repr__(self):
cols = self.__mapper__.c.keys()
class... | from __future__ import unicode_literals
import os
import pdb
from sqlalchemy import create_engine, MetaData
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, scoped_session
class Model(object):
def __repr__(self):
cols = self.__mapper__.c.keys()
class... | Add convenience methods for creating/deleting all tables, for bootstrapping/testing use | Add convenience methods for creating/deleting all tables, for bootstrapping/testing use
Signed-off-by: Joonas Bergius <[email protected]>
| Python | cc0-1.0 | bountysource/www.gittip.com,gratipay/gratipay.com,bountysource/www.gittip.com,gratipay/gratipay.com,studio666/gratipay.com,studio666/gratipay.com,eXcomm/gratipay.com,gratipay/gratipay.com,eXcomm/gratipay.com,studio666/gratipay.com,mccolgst/www.gittip.com,eXcomm/gratipay.com,bountysource/www.gittip.com,bountysource/www.... | from __future__ import unicode_literals
import os
import pdb
from sqlalchemy import create_engine, MetaData
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, scoped_session
class Model(object):
def __repr__(self):
cols = self.__mapper__.c.keys()
class... | from __future__ import unicode_literals
import os
import pdb
from sqlalchemy import create_engine, MetaData
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, scoped_session
class Model(object):
def __repr__(self):
cols = self.__mapper__.c.keys()
class... | <commit_before>from __future__ import unicode_literals
import os
import pdb
from sqlalchemy import create_engine, MetaData
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, scoped_session
class Model(object):
def __repr__(self):
cols = self.__mapper__.c.keys(... | from __future__ import unicode_literals
import os
import pdb
from sqlalchemy import create_engine, MetaData
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, scoped_session
class Model(object):
def __repr__(self):
cols = self.__mapper__.c.keys()
class... | from __future__ import unicode_literals
import os
import pdb
from sqlalchemy import create_engine, MetaData
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, scoped_session
class Model(object):
def __repr__(self):
cols = self.__mapper__.c.keys()
class... | <commit_before>from __future__ import unicode_literals
import os
import pdb
from sqlalchemy import create_engine, MetaData
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, scoped_session
class Model(object):
def __repr__(self):
cols = self.__mapper__.c.keys(... |
393abd296c65a5fd8fd094ca2c6925f132b77ad4 | utc-time/utc-time.py | utc-time/utc-time.py | #!/usr/bin/env python
import time
print 'Content-Type: text/javascript'
print ''
print 'var timeskew = new Date().getTime() - ' + str(time.time()*1000) + ';'
| #!/usr/bin/env python
import time
t = time.time()
u = time.gmtime(t)
s = time.strftime('%a, %e %b %Y %T GMT', u)
print 'Content-Type: text/javascript'
print 'Cache-Control: no-cache'
print 'Date: ' + s
print 'Expires: ' + s
print ''
print 'var timeskew = new Date().getTime() - ' + str(t*1000) + ';'
| Disable caching of stale time stamp information. | Disable caching of stale time stamp information.
| Python | apache-2.0 | google/google-authenticator-libpam,google/google-authenticator-libpam,google/google-authenticator-libpam,google/google-authenticator-libpam | #!/usr/bin/env python
import time
print 'Content-Type: text/javascript'
print ''
print 'var timeskew = new Date().getTime() - ' + str(time.time()*1000) + ';'
Disable caching of stale time stamp information. | #!/usr/bin/env python
import time
t = time.time()
u = time.gmtime(t)
s = time.strftime('%a, %e %b %Y %T GMT', u)
print 'Content-Type: text/javascript'
print 'Cache-Control: no-cache'
print 'Date: ' + s
print 'Expires: ' + s
print ''
print 'var timeskew = new Date().getTime() - ' + str(t*1000) + ';'
| <commit_before>#!/usr/bin/env python
import time
print 'Content-Type: text/javascript'
print ''
print 'var timeskew = new Date().getTime() - ' + str(time.time()*1000) + ';'
<commit_msg>Disable caching of stale time stamp information.<commit_after> | #!/usr/bin/env python
import time
t = time.time()
u = time.gmtime(t)
s = time.strftime('%a, %e %b %Y %T GMT', u)
print 'Content-Type: text/javascript'
print 'Cache-Control: no-cache'
print 'Date: ' + s
print 'Expires: ' + s
print ''
print 'var timeskew = new Date().getTime() - ' + str(t*1000) + ';'
| #!/usr/bin/env python
import time
print 'Content-Type: text/javascript'
print ''
print 'var timeskew = new Date().getTime() - ' + str(time.time()*1000) + ';'
Disable caching of stale time stamp information.#!/usr/bin/env python
import time
t = time.time()
u = time.gmtime(t)
s = time.strftime('%a, %e %b %Y %T GMT', u)
p... | <commit_before>#!/usr/bin/env python
import time
print 'Content-Type: text/javascript'
print ''
print 'var timeskew = new Date().getTime() - ' + str(time.time()*1000) + ';'
<commit_msg>Disable caching of stale time stamp information.<commit_after>#!/usr/bin/env python
import time
t = time.time()
u = time.gmtime(t)
s = ... |
745568d54b705cf767142911556c7d87a0397919 | lfs/shipping/migrations/0002_auto_20170216_0739.py | lfs/shipping/migrations/0002_auto_20170216_0739.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-02-16 07:39
from __future__ import unicode_literals
from django.db import migrations
def update_price_calculator(apps, schema_editor):
ShippingMethod = apps.get_model("shipping", "ShippingMethod")
for shipping_method in ShippingMethod.objects.filter(... | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-02-16 07:39
from __future__ import unicode_literals
from django.db import migrations
def update_price_calculator(apps, schema_editor):
ShippingMethod = apps.get_model("shipping", "ShippingMethod")
for shipping_method in ShippingMethod.objects.filter(... | Fix price calculator class names | Fix price calculator class names | Python | bsd-3-clause | diefenbach/django-lfs,diefenbach/django-lfs,diefenbach/django-lfs | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-02-16 07:39
from __future__ import unicode_literals
from django.db import migrations
def update_price_calculator(apps, schema_editor):
ShippingMethod = apps.get_model("shipping", "ShippingMethod")
for shipping_method in ShippingMethod.objects.filter(... | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-02-16 07:39
from __future__ import unicode_literals
from django.db import migrations
def update_price_calculator(apps, schema_editor):
ShippingMethod = apps.get_model("shipping", "ShippingMethod")
for shipping_method in ShippingMethod.objects.filter(... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-02-16 07:39
from __future__ import unicode_literals
from django.db import migrations
def update_price_calculator(apps, schema_editor):
ShippingMethod = apps.get_model("shipping", "ShippingMethod")
for shipping_method in ShippingMethod.... | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-02-16 07:39
from __future__ import unicode_literals
from django.db import migrations
def update_price_calculator(apps, schema_editor):
ShippingMethod = apps.get_model("shipping", "ShippingMethod")
for shipping_method in ShippingMethod.objects.filter(... | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-02-16 07:39
from __future__ import unicode_literals
from django.db import migrations
def update_price_calculator(apps, schema_editor):
ShippingMethod = apps.get_model("shipping", "ShippingMethod")
for shipping_method in ShippingMethod.objects.filter(... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-02-16 07:39
from __future__ import unicode_literals
from django.db import migrations
def update_price_calculator(apps, schema_editor):
ShippingMethod = apps.get_model("shipping", "ShippingMethod")
for shipping_method in ShippingMethod.... |
46c535faf5dec41c34740104d4f6ee6770309ccf | spicedham/__init__.py | spicedham/__init__.py | from pkg_resources import iter_entry_points
from config import config
plugins = []
for plugin in iter_entry_points(group='spicedham.classifiers', name=None):
plugins.append(plugin.load())
def train(training_data, is_spam):
for plugin in plugins:
plugin.train(training_data, is_spam)
def classify(c... | from pkg_resources import iter_entry_points
from config import config
plugins = []
for plugin in iter_entry_points(group='spicedham.classifiers', name=None):
pluginClass = plugin.load()
plugins.append(pluginClass())
def train(training_data, is_spam):
for plugin in plugins:
plugin.train(training... | Fix plugin system loader and remove setup | Fix plugin system loader and remove setup
* We don't need a setup function, that's waht __init__ is for
* There were copy pasta problems with classify. They're fixed.
| Python | mpl-2.0 | mozilla/spicedham,mozilla/spicedham | from pkg_resources import iter_entry_points
from config import config
plugins = []
for plugin in iter_entry_points(group='spicedham.classifiers', name=None):
plugins.append(plugin.load())
def train(training_data, is_spam):
for plugin in plugins:
plugin.train(training_data, is_spam)
def classify(c... | from pkg_resources import iter_entry_points
from config import config
plugins = []
for plugin in iter_entry_points(group='spicedham.classifiers', name=None):
pluginClass = plugin.load()
plugins.append(pluginClass())
def train(training_data, is_spam):
for plugin in plugins:
plugin.train(training... | <commit_before>from pkg_resources import iter_entry_points
from config import config
plugins = []
for plugin in iter_entry_points(group='spicedham.classifiers', name=None):
plugins.append(plugin.load())
def train(training_data, is_spam):
for plugin in plugins:
plugin.train(training_data, is_spam)
... | from pkg_resources import iter_entry_points
from config import config
plugins = []
for plugin in iter_entry_points(group='spicedham.classifiers', name=None):
pluginClass = plugin.load()
plugins.append(pluginClass())
def train(training_data, is_spam):
for plugin in plugins:
plugin.train(training... | from pkg_resources import iter_entry_points
from config import config
plugins = []
for plugin in iter_entry_points(group='spicedham.classifiers', name=None):
plugins.append(plugin.load())
def train(training_data, is_spam):
for plugin in plugins:
plugin.train(training_data, is_spam)
def classify(c... | <commit_before>from pkg_resources import iter_entry_points
from config import config
plugins = []
for plugin in iter_entry_points(group='spicedham.classifiers', name=None):
plugins.append(plugin.load())
def train(training_data, is_spam):
for plugin in plugins:
plugin.train(training_data, is_spam)
... |
fbae85917839aabaf83ff3dd003a6f3b239360d3 | python/convert_line_endings.py | python/convert_line_endings.py | #!/usr/bin/python
import os
def convert_line_endings(file):
if '\r\n' in open(file, 'rb').read():
print '%s contains DOS line endings. Converting' % file
with open(file, 'rb') as infile:
text = infile.read()
text = text.replace('\r\n', '\n')
with open(file, 'wb') as outfile:
outfile.wr... | #!/usr/bin/python
import os
import sys
def convert_line_endings(file):
if '\r\n' in open(file, 'rb').read():
print '%s contains DOS line endings. Converting' % file
with open(file, 'rb') as infile:
text = infile.read()
text = text.replace('\r\n', '\n')
with open(file, 'wb') as outfile:
... | Add option to Python line ending conversion to specify a single filename on the command line | [trunk] Add option to Python line ending conversion to specify a single filename on the command line
| Python | bsd-3-clause | markfinal/BuildAMation,markfinal/BuildAMation,markfinal/BuildAMation,markfinal/BuildAMation,markfinal/BuildAMation | #!/usr/bin/python
import os
def convert_line_endings(file):
if '\r\n' in open(file, 'rb').read():
print '%s contains DOS line endings. Converting' % file
with open(file, 'rb') as infile:
text = infile.read()
text = text.replace('\r\n', '\n')
with open(file, 'wb') as outfile:
outfile.wr... | #!/usr/bin/python
import os
import sys
def convert_line_endings(file):
if '\r\n' in open(file, 'rb').read():
print '%s contains DOS line endings. Converting' % file
with open(file, 'rb') as infile:
text = infile.read()
text = text.replace('\r\n', '\n')
with open(file, 'wb') as outfile:
... | <commit_before>#!/usr/bin/python
import os
def convert_line_endings(file):
if '\r\n' in open(file, 'rb').read():
print '%s contains DOS line endings. Converting' % file
with open(file, 'rb') as infile:
text = infile.read()
text = text.replace('\r\n', '\n')
with open(file, 'wb') as outfile:
... | #!/usr/bin/python
import os
import sys
def convert_line_endings(file):
if '\r\n' in open(file, 'rb').read():
print '%s contains DOS line endings. Converting' % file
with open(file, 'rb') as infile:
text = infile.read()
text = text.replace('\r\n', '\n')
with open(file, 'wb') as outfile:
... | #!/usr/bin/python
import os
def convert_line_endings(file):
if '\r\n' in open(file, 'rb').read():
print '%s contains DOS line endings. Converting' % file
with open(file, 'rb') as infile:
text = infile.read()
text = text.replace('\r\n', '\n')
with open(file, 'wb') as outfile:
outfile.wr... | <commit_before>#!/usr/bin/python
import os
def convert_line_endings(file):
if '\r\n' in open(file, 'rb').read():
print '%s contains DOS line endings. Converting' % file
with open(file, 'rb') as infile:
text = infile.read()
text = text.replace('\r\n', '\n')
with open(file, 'wb') as outfile:
... |
c0d0ea6b01ed7ddd9f5817b2debe7c58f64a8ba5 | tests/test_service.py | tests/test_service.py | from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
import base64
import unittest
import sys
import os
sys.path.append(os.path.abspath('../server.py'))
import server
class TestPosieService(unittest.TestCase):
def test_key_generation(self):
... | from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization, hashes
from cryptography.hazmat.primitives.asymmetric import padding
from server import app
import base64
import unittest
class TestPosieService(unittest.TestCase):
key_endpoint = "/key"
decryp... | Update tests to init flask and use test client | Update tests to init flask and use test client
| Python | mit | ONSdigital/edcdi | from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
import base64
import unittest
import sys
import os
sys.path.append(os.path.abspath('../server.py'))
import server
class TestPosieService(unittest.TestCase):
def test_key_generation(self):
... | from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization, hashes
from cryptography.hazmat.primitives.asymmetric import padding
from server import app
import base64
import unittest
class TestPosieService(unittest.TestCase):
key_endpoint = "/key"
decryp... | <commit_before>from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
import base64
import unittest
import sys
import os
sys.path.append(os.path.abspath('../server.py'))
import server
class TestPosieService(unittest.TestCase):
def test_key_generation(... | from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization, hashes
from cryptography.hazmat.primitives.asymmetric import padding
from server import app
import base64
import unittest
class TestPosieService(unittest.TestCase):
key_endpoint = "/key"
decryp... | from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
import base64
import unittest
import sys
import os
sys.path.append(os.path.abspath('../server.py'))
import server
class TestPosieService(unittest.TestCase):
def test_key_generation(self):
... | <commit_before>from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
import base64
import unittest
import sys
import os
sys.path.append(os.path.abspath('../server.py'))
import server
class TestPosieService(unittest.TestCase):
def test_key_generation(... |
5ac6cc208bf1a3fbe4e860a2356102a2457a1e43 | server/mod_auth/auth.py | server/mod_auth/auth.py | from app_factory.create_app import db
from models import User
from forms import RegistrationForm, LoginForm
def load_user(user_id):
return User.query.filter_by(id=user_id).first()
def login(request):
form = LoginForm.from_json(request.form)
if request.method == 'POST' and form.validate():
return... | from models import User
from forms import LoginForm
def load_user(user_id):
"""Returns a user from the database based on their id"""
return User.query.filter_by(id=user_id).first()
def login(request):
"""Handle a login request from a user."""
form = LoginForm.from_json(request.form)
if request.m... | Clean up unused imports and add docstrings | Clean up unused imports and add docstrings
| Python | mit | ganemone/ontheside,ganemone/ontheside,ganemone/ontheside | from app_factory.create_app import db
from models import User
from forms import RegistrationForm, LoginForm
def load_user(user_id):
return User.query.filter_by(id=user_id).first()
def login(request):
form = LoginForm.from_json(request.form)
if request.method == 'POST' and form.validate():
return... | from models import User
from forms import LoginForm
def load_user(user_id):
"""Returns a user from the database based on their id"""
return User.query.filter_by(id=user_id).first()
def login(request):
"""Handle a login request from a user."""
form = LoginForm.from_json(request.form)
if request.m... | <commit_before>from app_factory.create_app import db
from models import User
from forms import RegistrationForm, LoginForm
def load_user(user_id):
return User.query.filter_by(id=user_id).first()
def login(request):
form = LoginForm.from_json(request.form)
if request.method == 'POST' and form.validate():... | from models import User
from forms import LoginForm
def load_user(user_id):
"""Returns a user from the database based on their id"""
return User.query.filter_by(id=user_id).first()
def login(request):
"""Handle a login request from a user."""
form = LoginForm.from_json(request.form)
if request.m... | from app_factory.create_app import db
from models import User
from forms import RegistrationForm, LoginForm
def load_user(user_id):
return User.query.filter_by(id=user_id).first()
def login(request):
form = LoginForm.from_json(request.form)
if request.method == 'POST' and form.validate():
return... | <commit_before>from app_factory.create_app import db
from models import User
from forms import RegistrationForm, LoginForm
def load_user(user_id):
return User.query.filter_by(id=user_id).first()
def login(request):
form = LoginForm.from_json(request.form)
if request.method == 'POST' and form.validate():... |
276cb99f893443e4f1d242f861cd74d77770def4 | inselect/tests/lib/test_segment.py | inselect/tests/lib/test_segment.py | import json
import unittest
from pathlib import Path
from inselect.lib.document import InselectDocument
from inselect.lib.segment import segment_document
TESTDATA = Path(__file__).parent.parent / 'test_data'
class TestSegment(unittest.TestCase):
def test_segment_document(self):
doc = InselectDocument.l... | import json
import unittest
from pathlib import Path
from inselect.lib.document import InselectDocument
from inselect.lib.segment import segment_document
TESTDATA = Path(__file__).parent.parent / 'test_data'
class TestSegment(unittest.TestCase):
def test_segment_document(self):
doc = InselectDocument.l... | Remove commented-out debug code :-( | Remove commented-out debug code :-(
| Python | bsd-3-clause | NaturalHistoryMuseum/inselect,NaturalHistoryMuseum/inselect | import json
import unittest
from pathlib import Path
from inselect.lib.document import InselectDocument
from inselect.lib.segment import segment_document
TESTDATA = Path(__file__).parent.parent / 'test_data'
class TestSegment(unittest.TestCase):
def test_segment_document(self):
doc = InselectDocument.l... | import json
import unittest
from pathlib import Path
from inselect.lib.document import InselectDocument
from inselect.lib.segment import segment_document
TESTDATA = Path(__file__).parent.parent / 'test_data'
class TestSegment(unittest.TestCase):
def test_segment_document(self):
doc = InselectDocument.l... | <commit_before>import json
import unittest
from pathlib import Path
from inselect.lib.document import InselectDocument
from inselect.lib.segment import segment_document
TESTDATA = Path(__file__).parent.parent / 'test_data'
class TestSegment(unittest.TestCase):
def test_segment_document(self):
doc = Ins... | import json
import unittest
from pathlib import Path
from inselect.lib.document import InselectDocument
from inselect.lib.segment import segment_document
TESTDATA = Path(__file__).parent.parent / 'test_data'
class TestSegment(unittest.TestCase):
def test_segment_document(self):
doc = InselectDocument.l... | import json
import unittest
from pathlib import Path
from inselect.lib.document import InselectDocument
from inselect.lib.segment import segment_document
TESTDATA = Path(__file__).parent.parent / 'test_data'
class TestSegment(unittest.TestCase):
def test_segment_document(self):
doc = InselectDocument.l... | <commit_before>import json
import unittest
from pathlib import Path
from inselect.lib.document import InselectDocument
from inselect.lib.segment import segment_document
TESTDATA = Path(__file__).parent.parent / 'test_data'
class TestSegment(unittest.TestCase):
def test_segment_document(self):
doc = Ins... |
eed7727afd1622cbefb8ef1e113f15706170dfdf | parens.py | parens.py | def balanceness(paren_series):
indicator = 0
for paren in paren_series:
if paren == u'(':
indicator += 1
elif paren == u')':
indicator -= 1
# At any point in time, if a ')' precedes a '(', then the series
# of parenthesis is broken.
if indicator <... | def balanceness(paren_series):
indicator = 0
for paren in paren_series:
print paren
if paren == u'(':
indicator += 1
elif paren == u')':
indicator -= 1
# At any point in time, if a ')' precedes a '(', then the series
# of parenthesis is broken, an... | Complete quick attempt at function. | Complete quick attempt at function.
| Python | mit | jefimenko/data-structures | def balanceness(paren_series):
indicator = 0
for paren in paren_series:
if paren == u'(':
indicator += 1
elif paren == u')':
indicator -= 1
# At any point in time, if a ')' precedes a '(', then the series
# of parenthesis is broken.
if indicator <... | def balanceness(paren_series):
indicator = 0
for paren in paren_series:
print paren
if paren == u'(':
indicator += 1
elif paren == u')':
indicator -= 1
# At any point in time, if a ')' precedes a '(', then the series
# of parenthesis is broken, an... | <commit_before>def balanceness(paren_series):
indicator = 0
for paren in paren_series:
if paren == u'(':
indicator += 1
elif paren == u')':
indicator -= 1
# At any point in time, if a ')' precedes a '(', then the series
# of parenthesis is broken.
... | def balanceness(paren_series):
indicator = 0
for paren in paren_series:
print paren
if paren == u'(':
indicator += 1
elif paren == u')':
indicator -= 1
# At any point in time, if a ')' precedes a '(', then the series
# of parenthesis is broken, an... | def balanceness(paren_series):
indicator = 0
for paren in paren_series:
if paren == u'(':
indicator += 1
elif paren == u')':
indicator -= 1
# At any point in time, if a ')' precedes a '(', then the series
# of parenthesis is broken.
if indicator <... | <commit_before>def balanceness(paren_series):
indicator = 0
for paren in paren_series:
if paren == u'(':
indicator += 1
elif paren == u')':
indicator -= 1
# At any point in time, if a ')' precedes a '(', then the series
# of parenthesis is broken.
... |
0d2667684f0b65cb832528a80ef7bf008bf9c706 | pentai/ai/standardise.py | pentai/ai/standardise.py | import rot_standardise as rs_m
import trans_standardise as t_m
def standardise(orig_state): # Test code only
possibilities = rs_m.rot_possibilities(orig_state)
all_combined = []
for p in possibilities:
c = combine_and_trim(p)
all_combined.append((c[0], c))
try:
s = min(all_comb... | import rot_standardise as rs_m
import trans_standardise as t_m
def standardise(orig_state):
possibilities = rs_m.rot_possibilities(orig_state)
all_combined = []
for p in possibilities:
c = combine_and_trim(p)
all_combined.append((c[0], c))
try:
s = max(all_combined)[1]
exce... | Use max representation for smaller space usage. | Use max representation for smaller space usage.
| Python | mit | cropleyb/pentai,cropleyb/pentai,cropleyb/pentai | import rot_standardise as rs_m
import trans_standardise as t_m
def standardise(orig_state): # Test code only
possibilities = rs_m.rot_possibilities(orig_state)
all_combined = []
for p in possibilities:
c = combine_and_trim(p)
all_combined.append((c[0], c))
try:
s = min(all_comb... | import rot_standardise as rs_m
import trans_standardise as t_m
def standardise(orig_state):
possibilities = rs_m.rot_possibilities(orig_state)
all_combined = []
for p in possibilities:
c = combine_and_trim(p)
all_combined.append((c[0], c))
try:
s = max(all_combined)[1]
exce... | <commit_before>import rot_standardise as rs_m
import trans_standardise as t_m
def standardise(orig_state): # Test code only
possibilities = rs_m.rot_possibilities(orig_state)
all_combined = []
for p in possibilities:
c = combine_and_trim(p)
all_combined.append((c[0], c))
try:
s... | import rot_standardise as rs_m
import trans_standardise as t_m
def standardise(orig_state):
possibilities = rs_m.rot_possibilities(orig_state)
all_combined = []
for p in possibilities:
c = combine_and_trim(p)
all_combined.append((c[0], c))
try:
s = max(all_combined)[1]
exce... | import rot_standardise as rs_m
import trans_standardise as t_m
def standardise(orig_state): # Test code only
possibilities = rs_m.rot_possibilities(orig_state)
all_combined = []
for p in possibilities:
c = combine_and_trim(p)
all_combined.append((c[0], c))
try:
s = min(all_comb... | <commit_before>import rot_standardise as rs_m
import trans_standardise as t_m
def standardise(orig_state): # Test code only
possibilities = rs_m.rot_possibilities(orig_state)
all_combined = []
for p in possibilities:
c = combine_and_trim(p)
all_combined.append((c[0], c))
try:
s... |
a5c2e4d8eeaaaa03195344fdd2cb9654e63f8a55 | NagiosWrapper/NagiosWrapper.py | NagiosWrapper/NagiosWrapper.py | import subprocess
nagiosPluginsCommandLines = [
"/usr/lib64/nagios/plugins/check_sensors",
"/usr/lib64/nagios/plugins/check_mailq -w 10 -c 20 -M postfix",
]
class NagiosWrapper:
def __init__(self, agentConfig, checksLogger, rawConfig):
self.agentConfig = agentConfig
self.checksLogger = ch... | import subprocess
nagiosPluginsCommandLines = [
"/usr/lib64/nagios/plugins/check_sensors",
"/usr/lib64/nagios/plugins/check_mailq -w 10 -c 20 -M postfix",
]
class NagiosWrapper:
def __init__(self, agentConfig, checksLogger, rawConfig):
self.agentConfig = agentConfig
self.checksLogger = ch... | Add error logging to nagios wrapper | Add error logging to nagios wrapper
| Python | bsd-3-clause | shanethehat/sd-agent-plugins,bastiendonjon/sd-agent-plugins,bencer/sd-agent-plugins,bencer/sd-agent-plugins,shanethehat/sd-agent-plugins,bastiendonjon/sd-agent-plugins | import subprocess
nagiosPluginsCommandLines = [
"/usr/lib64/nagios/plugins/check_sensors",
"/usr/lib64/nagios/plugins/check_mailq -w 10 -c 20 -M postfix",
]
class NagiosWrapper:
def __init__(self, agentConfig, checksLogger, rawConfig):
self.agentConfig = agentConfig
self.checksLogger = ch... | import subprocess
nagiosPluginsCommandLines = [
"/usr/lib64/nagios/plugins/check_sensors",
"/usr/lib64/nagios/plugins/check_mailq -w 10 -c 20 -M postfix",
]
class NagiosWrapper:
def __init__(self, agentConfig, checksLogger, rawConfig):
self.agentConfig = agentConfig
self.checksLogger = ch... | <commit_before>import subprocess
nagiosPluginsCommandLines = [
"/usr/lib64/nagios/plugins/check_sensors",
"/usr/lib64/nagios/plugins/check_mailq -w 10 -c 20 -M postfix",
]
class NagiosWrapper:
def __init__(self, agentConfig, checksLogger, rawConfig):
self.agentConfig = agentConfig
self.ch... | import subprocess
nagiosPluginsCommandLines = [
"/usr/lib64/nagios/plugins/check_sensors",
"/usr/lib64/nagios/plugins/check_mailq -w 10 -c 20 -M postfix",
]
class NagiosWrapper:
def __init__(self, agentConfig, checksLogger, rawConfig):
self.agentConfig = agentConfig
self.checksLogger = ch... | import subprocess
nagiosPluginsCommandLines = [
"/usr/lib64/nagios/plugins/check_sensors",
"/usr/lib64/nagios/plugins/check_mailq -w 10 -c 20 -M postfix",
]
class NagiosWrapper:
def __init__(self, agentConfig, checksLogger, rawConfig):
self.agentConfig = agentConfig
self.checksLogger = ch... | <commit_before>import subprocess
nagiosPluginsCommandLines = [
"/usr/lib64/nagios/plugins/check_sensors",
"/usr/lib64/nagios/plugins/check_mailq -w 10 -c 20 -M postfix",
]
class NagiosWrapper:
def __init__(self, agentConfig, checksLogger, rawConfig):
self.agentConfig = agentConfig
self.ch... |
7560c3efc638940cca8f25a6e58e4ea1f85dc9dc | src/sentry/filters/builtins.py | src/sentry/filters/builtins.py | """
sentry.filters.base
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from django.utils.datastructures import SortedDict
from django.utils.translation import ugettext_lazy as _
from sentry.conf import settings
from .base... | """
sentry.filters.base
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from django.utils.datastructures import SortedDict
from django.utils.translation import ugettext_lazy as _
from sentry.conf import settings
from sentr... | Change Status filters to build from constant | Change Status filters to build from constant
| Python | bsd-3-clause | jean/sentry,zenefits/sentry,camilonova/sentry,mitsuhiko/sentry,nicholasserra/sentry,wujuguang/sentry,zenefits/sentry,rdio/sentry,BuildingLink/sentry,JamesMura/sentry,drcapulet/sentry,imankulov/sentry,fotinakis/sentry,llonchj/sentry,BayanGroup/sentry,looker/sentry,felixbuenemann/sentry,fotinakis/sentry,Kryz/sentry,NickP... | """
sentry.filters.base
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from django.utils.datastructures import SortedDict
from django.utils.translation import ugettext_lazy as _
from sentry.conf import settings
from .base... | """
sentry.filters.base
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from django.utils.datastructures import SortedDict
from django.utils.translation import ugettext_lazy as _
from sentry.conf import settings
from sentr... | <commit_before>"""
sentry.filters.base
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from django.utils.datastructures import SortedDict
from django.utils.translation import ugettext_lazy as _
from sentry.conf import sett... | """
sentry.filters.base
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from django.utils.datastructures import SortedDict
from django.utils.translation import ugettext_lazy as _
from sentry.conf import settings
from sentr... | """
sentry.filters.base
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from django.utils.datastructures import SortedDict
from django.utils.translation import ugettext_lazy as _
from sentry.conf import settings
from .base... | <commit_before>"""
sentry.filters.base
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from django.utils.datastructures import SortedDict
from django.utils.translation import ugettext_lazy as _
from sentry.conf import sett... |
ada858de787991c885030bb122e50df36b6fdc11 | github3/__init__.py | github3/__init__.py | """
github3
=======
See http://github3py.rtfd.org/ for documentation.
:copyright: (c) 2012 by Ian Cordasco
:license: Modified BSD, see LICENSE for more details
"""
__title__ = 'github3'
__author__ = 'Ian Cordasco'
__license__ = 'Modified BSD'
__copyright__ = 'Copyright 2012 Ian Cordasco'
__version__ = '0.1a5'
from... | """
github3
=======
See http://github3py.rtfd.org/ for documentation.
:copyright: (c) 2012 by Ian Cordasco
:license: Modified BSD, see LICENSE for more details
"""
__title__ = 'github3'
__author__ = 'Ian Cordasco'
__license__ = 'Modified BSD'
__copyright__ = 'Copyright 2012 Ian Cordasco'
__version__ = '0.1a5'
from... | Clean up namespace as mentioned. | Clean up namespace as mentioned.
| Python | bsd-3-clause | balloob/github3.py,krxsky/github3.py,icio/github3.py,sigmavirus24/github3.py,wbrefvem/github3.py,christophelec/github3.py,ueg1990/github3.py,itsmemattchung/github3.py,agamdua/github3.py,h4ck3rm1k3/github3.py,degustaf/github3.py,jim-minter/github3.py | """
github3
=======
See http://github3py.rtfd.org/ for documentation.
:copyright: (c) 2012 by Ian Cordasco
:license: Modified BSD, see LICENSE for more details
"""
__title__ = 'github3'
__author__ = 'Ian Cordasco'
__license__ = 'Modified BSD'
__copyright__ = 'Copyright 2012 Ian Cordasco'
__version__ = '0.1a5'
from... | """
github3
=======
See http://github3py.rtfd.org/ for documentation.
:copyright: (c) 2012 by Ian Cordasco
:license: Modified BSD, see LICENSE for more details
"""
__title__ = 'github3'
__author__ = 'Ian Cordasco'
__license__ = 'Modified BSD'
__copyright__ = 'Copyright 2012 Ian Cordasco'
__version__ = '0.1a5'
from... | <commit_before>"""
github3
=======
See http://github3py.rtfd.org/ for documentation.
:copyright: (c) 2012 by Ian Cordasco
:license: Modified BSD, see LICENSE for more details
"""
__title__ = 'github3'
__author__ = 'Ian Cordasco'
__license__ = 'Modified BSD'
__copyright__ = 'Copyright 2012 Ian Cordasco'
__version__ ... | """
github3
=======
See http://github3py.rtfd.org/ for documentation.
:copyright: (c) 2012 by Ian Cordasco
:license: Modified BSD, see LICENSE for more details
"""
__title__ = 'github3'
__author__ = 'Ian Cordasco'
__license__ = 'Modified BSD'
__copyright__ = 'Copyright 2012 Ian Cordasco'
__version__ = '0.1a5'
from... | """
github3
=======
See http://github3py.rtfd.org/ for documentation.
:copyright: (c) 2012 by Ian Cordasco
:license: Modified BSD, see LICENSE for more details
"""
__title__ = 'github3'
__author__ = 'Ian Cordasco'
__license__ = 'Modified BSD'
__copyright__ = 'Copyright 2012 Ian Cordasco'
__version__ = '0.1a5'
from... | <commit_before>"""
github3
=======
See http://github3py.rtfd.org/ for documentation.
:copyright: (c) 2012 by Ian Cordasco
:license: Modified BSD, see LICENSE for more details
"""
__title__ = 'github3'
__author__ = 'Ian Cordasco'
__license__ = 'Modified BSD'
__copyright__ = 'Copyright 2012 Ian Cordasco'
__version__ ... |
f56f98d5ec2b9cd689349cc239ca550f1182563e | src/olympia/core/tests/test_db.py | src/olympia/core/tests/test_db.py | # -*- coding: utf-8 -*-
import pytest
from olympia.core.tests.db_tests_testapp.models import TestRegularCharField
@pytest.mark.django_db
@pytest.mark.parametrize('value', [
u'a',
u'🔍', # Magnifying Glass Tilted Left (U+1F50D)
u'❤', # Heavy Black Heart (U+2764, U+FE0F)
])
def test_max_length_utf8mb4(va... | # -*- coding: utf-8 -*-
import os
import pytest
from olympia.core.tests.db_tests_testapp.models import TestRegularCharField
@pytest.mark.django_db
@pytest.mark.parametrize('value', [
u'a',
u'🔍', # Magnifying Glass Tilted Left (U+1F50D)
u'❤', # Heavy Black Heart (U+2764, U+FE0F)
])
def test_max_length_... | Add simple test to fail in case of duplicate migration ids. | Add simple test to fail in case of duplicate migration ids.
The test fails by showing which migrations are duplicated.
```python
src/olympia/core/tests/test_db.py:29: in test_no_duplicate_migration_ids
assert not duplicates
E AssertionError: assert not {'99'}
```
Fixes #11852
| Python | bsd-3-clause | eviljeff/olympia,eviljeff/olympia,psiinon/addons-server,eviljeff/olympia,psiinon/addons-server,psiinon/addons-server,bqbn/addons-server,diox/olympia,mozilla/addons-server,mozilla/olympia,bqbn/addons-server,wagnerand/addons-server,eviljeff/olympia,mozilla/olympia,wagnerand/addons-server,mozilla/olympia,wagnerand/addons-... | # -*- coding: utf-8 -*-
import pytest
from olympia.core.tests.db_tests_testapp.models import TestRegularCharField
@pytest.mark.django_db
@pytest.mark.parametrize('value', [
u'a',
u'🔍', # Magnifying Glass Tilted Left (U+1F50D)
u'❤', # Heavy Black Heart (U+2764, U+FE0F)
])
def test_max_length_utf8mb4(va... | # -*- coding: utf-8 -*-
import os
import pytest
from olympia.core.tests.db_tests_testapp.models import TestRegularCharField
@pytest.mark.django_db
@pytest.mark.parametrize('value', [
u'a',
u'🔍', # Magnifying Glass Tilted Left (U+1F50D)
u'❤', # Heavy Black Heart (U+2764, U+FE0F)
])
def test_max_length_... | <commit_before># -*- coding: utf-8 -*-
import pytest
from olympia.core.tests.db_tests_testapp.models import TestRegularCharField
@pytest.mark.django_db
@pytest.mark.parametrize('value', [
u'a',
u'🔍', # Magnifying Glass Tilted Left (U+1F50D)
u'❤', # Heavy Black Heart (U+2764, U+FE0F)
])
def test_max_le... | # -*- coding: utf-8 -*-
import os
import pytest
from olympia.core.tests.db_tests_testapp.models import TestRegularCharField
@pytest.mark.django_db
@pytest.mark.parametrize('value', [
u'a',
u'🔍', # Magnifying Glass Tilted Left (U+1F50D)
u'❤', # Heavy Black Heart (U+2764, U+FE0F)
])
def test_max_length_... | # -*- coding: utf-8 -*-
import pytest
from olympia.core.tests.db_tests_testapp.models import TestRegularCharField
@pytest.mark.django_db
@pytest.mark.parametrize('value', [
u'a',
u'🔍', # Magnifying Glass Tilted Left (U+1F50D)
u'❤', # Heavy Black Heart (U+2764, U+FE0F)
])
def test_max_length_utf8mb4(va... | <commit_before># -*- coding: utf-8 -*-
import pytest
from olympia.core.tests.db_tests_testapp.models import TestRegularCharField
@pytest.mark.django_db
@pytest.mark.parametrize('value', [
u'a',
u'🔍', # Magnifying Glass Tilted Left (U+1F50D)
u'❤', # Heavy Black Heart (U+2764, U+FE0F)
])
def test_max_le... |
d483e49d826607c0f59ee4b531a2b8e98beffa40 | guizero/__init__.py | guizero/__init__.py | try:
from tkinter import *
except:
from Tkinter import *
# -----------------------------
import utilities as utils
from alerts import *
from App import App
from Box import Box
from ButtonGroup import ButtonGroup
from CheckBox import CheckBox
from Combo import Combo
from MenuBar import MenuBar
from Picture... | try:
from tkinter import *
except:
from Tkinter import *
# -----------------------------
__all__ = ['utilities', 'alerts', 'App', 'Box', 'ButtonGroup', 'CheckBox', 'Combo', 'MenuBar', 'Picture', 'PushButton',
'RadioButton', 'Slider', 'Text', 'TextBox', 'PushButton']
import utilities as utils
from ... | Add an all to init | Add an all to init
| Python | bsd-3-clause | lawsie/guizero,lawsie/guizero,lawsie/guizero | try:
from tkinter import *
except:
from Tkinter import *
# -----------------------------
import utilities as utils
from alerts import *
from App import App
from Box import Box
from ButtonGroup import ButtonGroup
from CheckBox import CheckBox
from Combo import Combo
from MenuBar import MenuBar
from Picture... | try:
from tkinter import *
except:
from Tkinter import *
# -----------------------------
__all__ = ['utilities', 'alerts', 'App', 'Box', 'ButtonGroup', 'CheckBox', 'Combo', 'MenuBar', 'Picture', 'PushButton',
'RadioButton', 'Slider', 'Text', 'TextBox', 'PushButton']
import utilities as utils
from ... | <commit_before>try:
from tkinter import *
except:
from Tkinter import *
# -----------------------------
import utilities as utils
from alerts import *
from App import App
from Box import Box
from ButtonGroup import ButtonGroup
from CheckBox import CheckBox
from Combo import Combo
from MenuBar import MenuB... | try:
from tkinter import *
except:
from Tkinter import *
# -----------------------------
__all__ = ['utilities', 'alerts', 'App', 'Box', 'ButtonGroup', 'CheckBox', 'Combo', 'MenuBar', 'Picture', 'PushButton',
'RadioButton', 'Slider', 'Text', 'TextBox', 'PushButton']
import utilities as utils
from ... | try:
from tkinter import *
except:
from Tkinter import *
# -----------------------------
import utilities as utils
from alerts import *
from App import App
from Box import Box
from ButtonGroup import ButtonGroup
from CheckBox import CheckBox
from Combo import Combo
from MenuBar import MenuBar
from Picture... | <commit_before>try:
from tkinter import *
except:
from Tkinter import *
# -----------------------------
import utilities as utils
from alerts import *
from App import App
from Box import Box
from ButtonGroup import ButtonGroup
from CheckBox import CheckBox
from Combo import Combo
from MenuBar import MenuB... |
9a1272082f8750565f727f2c97a71768a9ceb7ca | books/search_indexes.py | books/search_indexes.py | from haystack import indexes
from books.models import Book, Series
class BookIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
library = indexes.IntegerField(model_attr="library_id")
def get_model(self):
return Book
def index_queryset(... | from haystack import indexes
from books.models import Book, Series
class BookIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
library = indexes.IntegerField(model_attr="library_id")
def get_model(self):
return Book
def index_queryset(... | Add fields to index so 'update_index' works | Add fields to index so 'update_index' works
| Python | mit | phildini/bockus,phildini/bockus,phildini/bockus | from haystack import indexes
from books.models import Book, Series
class BookIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
library = indexes.IntegerField(model_attr="library_id")
def get_model(self):
return Book
def index_queryset(... | from haystack import indexes
from books.models import Book, Series
class BookIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
library = indexes.IntegerField(model_attr="library_id")
def get_model(self):
return Book
def index_queryset(... | <commit_before>from haystack import indexes
from books.models import Book, Series
class BookIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
library = indexes.IntegerField(model_attr="library_id")
def get_model(self):
return Book
def ... | from haystack import indexes
from books.models import Book, Series
class BookIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
library = indexes.IntegerField(model_attr="library_id")
def get_model(self):
return Book
def index_queryset(... | from haystack import indexes
from books.models import Book, Series
class BookIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
library = indexes.IntegerField(model_attr="library_id")
def get_model(self):
return Book
def index_queryset(... | <commit_before>from haystack import indexes
from books.models import Book, Series
class BookIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
library = indexes.IntegerField(model_attr="library_id")
def get_model(self):
return Book
def ... |
3fd3795eb1f055e93c74362dfa5bdf46a5141551 | py-bindings/ompl/util/__init__.py | py-bindings/ompl/util/__init__.py | from os.path import abspath, dirname
from sys import platform
if platform != 'nt' and platform != 'win32':
from ompl import dll_loader
dll_loader('ompl', dirname(abspath(__file__)))
from _util import *
| from os.path import abspath, dirname
from ompl import dll_loader
dll_loader('ompl', dirname(abspath(__file__)))
from _util import *
| Revert changes to py-bindings script | Revert changes to py-bindings script
--HG--
branch : windows
| Python | bsd-3-clause | jvgomez/ompl,davetcoleman/ompl,davetcoleman/ompl,florianhauer/ompl,florianhauer/ompl,florianhauer/ompl,sonny-tarbouriech/ompl,utiasASRL/batch-informed-trees,sonny-tarbouriech/ompl,davetcoleman/ompl,jvgomez/ompl,utiasASRL/batch-informed-trees,sonny-tarbouriech/ompl,davetcoleman/ompl,sonny-tarbouriech/ompl,florianhauer/o... | from os.path import abspath, dirname
from sys import platform
if platform != 'nt' and platform != 'win32':
from ompl import dll_loader
dll_loader('ompl', dirname(abspath(__file__)))
from _util import *
Revert changes to py-bindings script
--HG--
branch : windows | from os.path import abspath, dirname
from ompl import dll_loader
dll_loader('ompl', dirname(abspath(__file__)))
from _util import *
| <commit_before>from os.path import abspath, dirname
from sys import platform
if platform != 'nt' and platform != 'win32':
from ompl import dll_loader
dll_loader('ompl', dirname(abspath(__file__)))
from _util import *
<commit_msg>Revert changes to py-bindings script
--HG--
branch : windows<commit_after> | from os.path import abspath, dirname
from ompl import dll_loader
dll_loader('ompl', dirname(abspath(__file__)))
from _util import *
| from os.path import abspath, dirname
from sys import platform
if platform != 'nt' and platform != 'win32':
from ompl import dll_loader
dll_loader('ompl', dirname(abspath(__file__)))
from _util import *
Revert changes to py-bindings script
--HG--
branch : windowsfrom os.path import abspath, dirname
from ompl im... | <commit_before>from os.path import abspath, dirname
from sys import platform
if platform != 'nt' and platform != 'win32':
from ompl import dll_loader
dll_loader('ompl', dirname(abspath(__file__)))
from _util import *
<commit_msg>Revert changes to py-bindings script
--HG--
branch : windows<commit_after>from os.... |
6e1892daec726b44b1bbb4d085e27fa03c0a419b | server/kcaa/kcsapi/client_test.py | server/kcaa/kcsapi/client_test.py | #!/usr/bin/env python
import pytest
import client
from kcaa import screens
class TestScreen(object):
def test_mission_result(self):
screen = client.Screen()
assert screen.screen == screens.UNKNOWN
screen.update('/api_get_member/deck_port', None, None, None, False)
assert screen.... | #!/usr/bin/env python
import pytest
import client
from kcaa import screens
class TestScreen(object):
def update(self, screen, api_name):
screen.update(api_name, None, None, None, False)
def update_sequence(self, screen, api_names):
for api_name in api_names:
screen.update(api_n... | Add a Screen test for sequence of KCSAPI responses. | Add a Screen test for sequence of KCSAPI responses.
| Python | apache-2.0 | kcaa/kcaa,kcaa/kcaa,kcaa/kcaa,kcaa/kcaa | #!/usr/bin/env python
import pytest
import client
from kcaa import screens
class TestScreen(object):
def test_mission_result(self):
screen = client.Screen()
assert screen.screen == screens.UNKNOWN
screen.update('/api_get_member/deck_port', None, None, None, False)
assert screen.... | #!/usr/bin/env python
import pytest
import client
from kcaa import screens
class TestScreen(object):
def update(self, screen, api_name):
screen.update(api_name, None, None, None, False)
def update_sequence(self, screen, api_names):
for api_name in api_names:
screen.update(api_n... | <commit_before>#!/usr/bin/env python
import pytest
import client
from kcaa import screens
class TestScreen(object):
def test_mission_result(self):
screen = client.Screen()
assert screen.screen == screens.UNKNOWN
screen.update('/api_get_member/deck_port', None, None, None, False)
... | #!/usr/bin/env python
import pytest
import client
from kcaa import screens
class TestScreen(object):
def update(self, screen, api_name):
screen.update(api_name, None, None, None, False)
def update_sequence(self, screen, api_names):
for api_name in api_names:
screen.update(api_n... | #!/usr/bin/env python
import pytest
import client
from kcaa import screens
class TestScreen(object):
def test_mission_result(self):
screen = client.Screen()
assert screen.screen == screens.UNKNOWN
screen.update('/api_get_member/deck_port', None, None, None, False)
assert screen.... | <commit_before>#!/usr/bin/env python
import pytest
import client
from kcaa import screens
class TestScreen(object):
def test_mission_result(self):
screen = client.Screen()
assert screen.screen == screens.UNKNOWN
screen.update('/api_get_member/deck_port', None, None, None, False)
... |
8bed90b9d98cc148a03c5b422c90974ddd85e18f | Scripts/multi_process_files.py | Scripts/multi_process_files.py | #!/usr/bin/python
from joblib import Parallel, delayed
import multiprocessing
import os
from subprocess import call
# inputpath = '/data/amnh/darwin/images'
# segment_exe = '/home/luis_ibanez/bin/darwin-notes-image-processing/Release/Segmentation/ImageToEdges'
inputpath = '/home/ibanez/data/amnh/darwin_notes/images'
... | #!/usr/bin/python
from joblib import Parallel, delayed
import multiprocessing
import os
from subprocess import call
# inputpath = '/data/amnh/darwin/images'
# segment_exe = '/home/luis_ibanez/bin/darwin-notes-image-processing/Release/Segmentation/ImageToEdges'
inputpath = '/home/ibanez/data/amnh/darwin_notes/images'
... | Set the new ImageAnalyzer executable for multi-processing. | Set the new ImageAnalyzer executable for multi-processing.
| Python | apache-2.0 | HackTheStacks/darwin-notes-image-processing,HackTheStacks/darwin-notes-image-processing | #!/usr/bin/python
from joblib import Parallel, delayed
import multiprocessing
import os
from subprocess import call
# inputpath = '/data/amnh/darwin/images'
# segment_exe = '/home/luis_ibanez/bin/darwin-notes-image-processing/Release/Segmentation/ImageToEdges'
inputpath = '/home/ibanez/data/amnh/darwin_notes/images'
... | #!/usr/bin/python
from joblib import Parallel, delayed
import multiprocessing
import os
from subprocess import call
# inputpath = '/data/amnh/darwin/images'
# segment_exe = '/home/luis_ibanez/bin/darwin-notes-image-processing/Release/Segmentation/ImageToEdges'
inputpath = '/home/ibanez/data/amnh/darwin_notes/images'
... | <commit_before>#!/usr/bin/python
from joblib import Parallel, delayed
import multiprocessing
import os
from subprocess import call
# inputpath = '/data/amnh/darwin/images'
# segment_exe = '/home/luis_ibanez/bin/darwin-notes-image-processing/Release/Segmentation/ImageToEdges'
inputpath = '/home/ibanez/data/amnh/darwin... | #!/usr/bin/python
from joblib import Parallel, delayed
import multiprocessing
import os
from subprocess import call
# inputpath = '/data/amnh/darwin/images'
# segment_exe = '/home/luis_ibanez/bin/darwin-notes-image-processing/Release/Segmentation/ImageToEdges'
inputpath = '/home/ibanez/data/amnh/darwin_notes/images'
... | #!/usr/bin/python
from joblib import Parallel, delayed
import multiprocessing
import os
from subprocess import call
# inputpath = '/data/amnh/darwin/images'
# segment_exe = '/home/luis_ibanez/bin/darwin-notes-image-processing/Release/Segmentation/ImageToEdges'
inputpath = '/home/ibanez/data/amnh/darwin_notes/images'
... | <commit_before>#!/usr/bin/python
from joblib import Parallel, delayed
import multiprocessing
import os
from subprocess import call
# inputpath = '/data/amnh/darwin/images'
# segment_exe = '/home/luis_ibanez/bin/darwin-notes-image-processing/Release/Segmentation/ImageToEdges'
inputpath = '/home/ibanez/data/amnh/darwin... |
5a9ff0cbfade513b592bf309953bd2f927eb705c | mozillians/graphql/views.py | mozillians/graphql/views.py | from django.views.decorators.csrf import csrf_exempt
from graphene_django.views import GraphQLView
class MozilliansGraphQLView(GraphQLView):
"""Class Based View to handle GraphQL requests."""
@csrf_exempt
def dispatch(self, *args, **kwargs):
"""Override dispatch method to allow the use of multip... | from django.http import Http404
from django.views.decorators.csrf import csrf_exempt
import waffle
from graphene_django.views import GraphQLView
class MozilliansGraphQLView(GraphQLView):
"""Class Based View to handle GraphQL requests."""
@csrf_exempt
def dispatch(self, *args, **kwargs):
"""Overr... | Add a waffle flag for GraphQL. | Add a waffle flag for GraphQL.
| Python | bsd-3-clause | akatsoulas/mozillians,akatsoulas/mozillians,johngian/mozillians,akatsoulas/mozillians,mozilla/mozillians,johngian/mozillians,mozilla/mozillians,akatsoulas/mozillians,mozilla/mozillians,johngian/mozillians,mozilla/mozillians,johngian/mozillians | from django.views.decorators.csrf import csrf_exempt
from graphene_django.views import GraphQLView
class MozilliansGraphQLView(GraphQLView):
"""Class Based View to handle GraphQL requests."""
@csrf_exempt
def dispatch(self, *args, **kwargs):
"""Override dispatch method to allow the use of multip... | from django.http import Http404
from django.views.decorators.csrf import csrf_exempt
import waffle
from graphene_django.views import GraphQLView
class MozilliansGraphQLView(GraphQLView):
"""Class Based View to handle GraphQL requests."""
@csrf_exempt
def dispatch(self, *args, **kwargs):
"""Overr... | <commit_before>from django.views.decorators.csrf import csrf_exempt
from graphene_django.views import GraphQLView
class MozilliansGraphQLView(GraphQLView):
"""Class Based View to handle GraphQL requests."""
@csrf_exempt
def dispatch(self, *args, **kwargs):
"""Override dispatch method to allow th... | from django.http import Http404
from django.views.decorators.csrf import csrf_exempt
import waffle
from graphene_django.views import GraphQLView
class MozilliansGraphQLView(GraphQLView):
"""Class Based View to handle GraphQL requests."""
@csrf_exempt
def dispatch(self, *args, **kwargs):
"""Overr... | from django.views.decorators.csrf import csrf_exempt
from graphene_django.views import GraphQLView
class MozilliansGraphQLView(GraphQLView):
"""Class Based View to handle GraphQL requests."""
@csrf_exempt
def dispatch(self, *args, **kwargs):
"""Override dispatch method to allow the use of multip... | <commit_before>from django.views.decorators.csrf import csrf_exempt
from graphene_django.views import GraphQLView
class MozilliansGraphQLView(GraphQLView):
"""Class Based View to handle GraphQL requests."""
@csrf_exempt
def dispatch(self, *args, **kwargs):
"""Override dispatch method to allow th... |
0731a34fd55477b20ffcd19c9b41cda0dd084d75 | ggplot/utils/date_breaks.py | ggplot/utils/date_breaks.py | from matplotlib.dates import DayLocator, WeekdayLocator, MonthLocator, YearLocator
def parse_break_str(txt):
"parses '10 weeks' into tuple (10, week)."
txt = txt.strip()
if len(txt.split()) == 2:
n, units = txt.split()
else:
n,units = 1, txt
units = units.rstrip('s') # e.g. weeks =>... | from matplotlib.dates import MinuteLocator, HourLocator, DayLocator
from matplotlib.dates import WeekdayLocator, MonthLocator, YearLocator
def parse_break_str(txt):
"parses '10 weeks' into tuple (10, week)."
txt = txt.strip()
if len(txt.split()) == 2:
n, units = txt.split()
else:
n,unit... | Add more granular date locators | Add more granular date locators
| Python | bsd-2-clause | xguse/ggplot,andnovar/ggplot,benslice/ggplot,bitemyapp/ggplot,kmather73/ggplot,benslice/ggplot,udacity/ggplot,ricket1978/ggplot,mizzao/ggplot,wllmtrng/ggplot,smblance/ggplot,assad2012/ggplot,Cophy08/ggplot,xguse/ggplot,ricket1978/ggplot,mizzao/ggplot | from matplotlib.dates import DayLocator, WeekdayLocator, MonthLocator, YearLocator
def parse_break_str(txt):
"parses '10 weeks' into tuple (10, week)."
txt = txt.strip()
if len(txt.split()) == 2:
n, units = txt.split()
else:
n,units = 1, txt
units = units.rstrip('s') # e.g. weeks =>... | from matplotlib.dates import MinuteLocator, HourLocator, DayLocator
from matplotlib.dates import WeekdayLocator, MonthLocator, YearLocator
def parse_break_str(txt):
"parses '10 weeks' into tuple (10, week)."
txt = txt.strip()
if len(txt.split()) == 2:
n, units = txt.split()
else:
n,unit... | <commit_before>from matplotlib.dates import DayLocator, WeekdayLocator, MonthLocator, YearLocator
def parse_break_str(txt):
"parses '10 weeks' into tuple (10, week)."
txt = txt.strip()
if len(txt.split()) == 2:
n, units = txt.split()
else:
n,units = 1, txt
units = units.rstrip('s') ... | from matplotlib.dates import MinuteLocator, HourLocator, DayLocator
from matplotlib.dates import WeekdayLocator, MonthLocator, YearLocator
def parse_break_str(txt):
"parses '10 weeks' into tuple (10, week)."
txt = txt.strip()
if len(txt.split()) == 2:
n, units = txt.split()
else:
n,unit... | from matplotlib.dates import DayLocator, WeekdayLocator, MonthLocator, YearLocator
def parse_break_str(txt):
"parses '10 weeks' into tuple (10, week)."
txt = txt.strip()
if len(txt.split()) == 2:
n, units = txt.split()
else:
n,units = 1, txt
units = units.rstrip('s') # e.g. weeks =>... | <commit_before>from matplotlib.dates import DayLocator, WeekdayLocator, MonthLocator, YearLocator
def parse_break_str(txt):
"parses '10 weeks' into tuple (10, week)."
txt = txt.strip()
if len(txt.split()) == 2:
n, units = txt.split()
else:
n,units = 1, txt
units = units.rstrip('s') ... |
97daa3e89cbe98602cedddc383876c45ad3f3813 | purchase_stock_picking_invoice_link/__manifest__.py | purchase_stock_picking_invoice_link/__manifest__.py | # Copyright 2019 Vicent Cubells <[email protected]>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Purchase Stock Picking Invoice Link",
"version": "13.0.1.0.0",
"category": "Warehouse Management",
"summary": "Adds link between purchases, pickings and invoices",
... | # Copyright 2019 Vicent Cubells <[email protected]>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Purchase Stock Picking Invoice Link",
"version": "13.0.1.0.0",
"category": "Warehouse Management",
"summary": "Adds link between purchases, pickings and invoices",
... | Update dotfiles + switch to GH actions | [IMP] Update dotfiles + switch to GH actions
| Python | agpl-3.0 | OCA/stock-logistics-workflow,OCA/stock-logistics-workflow,BT-ojossen/stock-logistics-workflow,BT-ojossen/stock-logistics-workflow | # Copyright 2019 Vicent Cubells <[email protected]>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Purchase Stock Picking Invoice Link",
"version": "13.0.1.0.0",
"category": "Warehouse Management",
"summary": "Adds link between purchases, pickings and invoices",
... | # Copyright 2019 Vicent Cubells <[email protected]>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Purchase Stock Picking Invoice Link",
"version": "13.0.1.0.0",
"category": "Warehouse Management",
"summary": "Adds link between purchases, pickings and invoices",
... | <commit_before># Copyright 2019 Vicent Cubells <[email protected]>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Purchase Stock Picking Invoice Link",
"version": "13.0.1.0.0",
"category": "Warehouse Management",
"summary": "Adds link between purchases, pickings ... | # Copyright 2019 Vicent Cubells <[email protected]>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Purchase Stock Picking Invoice Link",
"version": "13.0.1.0.0",
"category": "Warehouse Management",
"summary": "Adds link between purchases, pickings and invoices",
... | # Copyright 2019 Vicent Cubells <[email protected]>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Purchase Stock Picking Invoice Link",
"version": "13.0.1.0.0",
"category": "Warehouse Management",
"summary": "Adds link between purchases, pickings and invoices",
... | <commit_before># Copyright 2019 Vicent Cubells <[email protected]>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Purchase Stock Picking Invoice Link",
"version": "13.0.1.0.0",
"category": "Warehouse Management",
"summary": "Adds link between purchases, pickings ... |
6514e75b9a9b3bfeba1c43f95e386afcf67354bd | tests/test_django1_8_fixers.py | tests/test_django1_8_fixers.py | from __future__ import absolute_import, print_function, unicode_literals
import os
import pytest
import _test_utilities
def test_fix_outsourcing_contrib_comments():
if os.environ.get(
"IGNORE_CONTRIB_COMMENTS"
): # case where external dependency "django_comments" isn't loaded
with pytest... | from __future__ import absolute_import, print_function, unicode_literals
import os
import pytest
import _test_utilities
def test_fix_outsourcing_contrib_comments():
if os.environ.get(
"IGNORE_CONTRIB_COMMENTS"
): # case where external dependency "django_comments" isn't loaded
with pytest... | Fix buggy use of pytest.raises() in tests. | Fix buggy use of pytest.raises() in tests.
| Python | mit | pakal/django-compat-patcher,pakal/django-compat-patcher | from __future__ import absolute_import, print_function, unicode_literals
import os
import pytest
import _test_utilities
def test_fix_outsourcing_contrib_comments():
if os.environ.get(
"IGNORE_CONTRIB_COMMENTS"
): # case where external dependency "django_comments" isn't loaded
with pytest... | from __future__ import absolute_import, print_function, unicode_literals
import os
import pytest
import _test_utilities
def test_fix_outsourcing_contrib_comments():
if os.environ.get(
"IGNORE_CONTRIB_COMMENTS"
): # case where external dependency "django_comments" isn't loaded
with pytest... | <commit_before>from __future__ import absolute_import, print_function, unicode_literals
import os
import pytest
import _test_utilities
def test_fix_outsourcing_contrib_comments():
if os.environ.get(
"IGNORE_CONTRIB_COMMENTS"
): # case where external dependency "django_comments" isn't loaded
... | from __future__ import absolute_import, print_function, unicode_literals
import os
import pytest
import _test_utilities
def test_fix_outsourcing_contrib_comments():
if os.environ.get(
"IGNORE_CONTRIB_COMMENTS"
): # case where external dependency "django_comments" isn't loaded
with pytest... | from __future__ import absolute_import, print_function, unicode_literals
import os
import pytest
import _test_utilities
def test_fix_outsourcing_contrib_comments():
if os.environ.get(
"IGNORE_CONTRIB_COMMENTS"
): # case where external dependency "django_comments" isn't loaded
with pytest... | <commit_before>from __future__ import absolute_import, print_function, unicode_literals
import os
import pytest
import _test_utilities
def test_fix_outsourcing_contrib_comments():
if os.environ.get(
"IGNORE_CONTRIB_COMMENTS"
): # case where external dependency "django_comments" isn't loaded
... |
61e4b4fe80a2d89de5bb30310d65e08e45548208 | tests/test_read_user_choice.py | tests/test_read_user_choice.py | # -*- coding: utf-8 -*-
import click
import pytest
from cookiecutter.compat import read_user_choice
OPTIONS = ['hello', 'world', 'foo', 'bar']
EXPECTED_PROMPT = """Select varname:
1 - hello
2 - world
3 - foo
4 - bar
Choose from 1, 2, 3, 4!"""
@pytest.mark.parametrize('user_choice, expected_value', enumerate(OPTI... | # -*- coding: utf-8 -*-
import click
import pytest
from cookiecutter.compat import read_user_choice
OPTIONS = ['hello', 'world', 'foo', 'bar']
EXPECTED_PROMPT = """Select varname:
1 - hello
2 - world
3 - foo
4 - bar
Choose from 1, 2, 3, 4!"""
@pytest.mark.parametrize('user_choice, expected_value', enumerate(OPTI... | Implement a test checking that options needs to be a non empty list | Implement a test checking that options needs to be a non empty list
| Python | bsd-3-clause | pjbull/cookiecutter,benthomasson/cookiecutter,dajose/cookiecutter,atlassian/cookiecutter,dajose/cookiecutter,nhomar/cookiecutter,ionelmc/cookiecutter,christabor/cookiecutter,sp1rs/cookiecutter,luzfcb/cookiecutter,hackebrot/cookiecutter,lgp171188/cookiecutter,Springerle/cookiecutter,agconti/cookiecutter,lucius-feng/cook... | # -*- coding: utf-8 -*-
import click
import pytest
from cookiecutter.compat import read_user_choice
OPTIONS = ['hello', 'world', 'foo', 'bar']
EXPECTED_PROMPT = """Select varname:
1 - hello
2 - world
3 - foo
4 - bar
Choose from 1, 2, 3, 4!"""
@pytest.mark.parametrize('user_choice, expected_value', enumerate(OPTI... | # -*- coding: utf-8 -*-
import click
import pytest
from cookiecutter.compat import read_user_choice
OPTIONS = ['hello', 'world', 'foo', 'bar']
EXPECTED_PROMPT = """Select varname:
1 - hello
2 - world
3 - foo
4 - bar
Choose from 1, 2, 3, 4!"""
@pytest.mark.parametrize('user_choice, expected_value', enumerate(OPTI... | <commit_before># -*- coding: utf-8 -*-
import click
import pytest
from cookiecutter.compat import read_user_choice
OPTIONS = ['hello', 'world', 'foo', 'bar']
EXPECTED_PROMPT = """Select varname:
1 - hello
2 - world
3 - foo
4 - bar
Choose from 1, 2, 3, 4!"""
@pytest.mark.parametrize('user_choice, expected_value',... | # -*- coding: utf-8 -*-
import click
import pytest
from cookiecutter.compat import read_user_choice
OPTIONS = ['hello', 'world', 'foo', 'bar']
EXPECTED_PROMPT = """Select varname:
1 - hello
2 - world
3 - foo
4 - bar
Choose from 1, 2, 3, 4!"""
@pytest.mark.parametrize('user_choice, expected_value', enumerate(OPTI... | # -*- coding: utf-8 -*-
import click
import pytest
from cookiecutter.compat import read_user_choice
OPTIONS = ['hello', 'world', 'foo', 'bar']
EXPECTED_PROMPT = """Select varname:
1 - hello
2 - world
3 - foo
4 - bar
Choose from 1, 2, 3, 4!"""
@pytest.mark.parametrize('user_choice, expected_value', enumerate(OPTI... | <commit_before># -*- coding: utf-8 -*-
import click
import pytest
from cookiecutter.compat import read_user_choice
OPTIONS = ['hello', 'world', 'foo', 'bar']
EXPECTED_PROMPT = """Select varname:
1 - hello
2 - world
3 - foo
4 - bar
Choose from 1, 2, 3, 4!"""
@pytest.mark.parametrize('user_choice, expected_value',... |
0b746180bbb3d7008ac0ece14407b661b01941e2 | website/tests/models/test_short_url.py | website/tests/models/test_short_url.py | import app
from models import ShortURL
def test_encode_decode():
base = ShortURL.base
ids_to_test = (
0, 1, 2, 9, 10, 11, 15, 89, 1000, 999, 998, 8765431234567,
base, base - 1, base + 1, base * 2, base * 2 - 1, base * base
)
for test_id in ids_to_test:
encoded = ShortURL(id=tes... | from models import ShortURL
def test_encode_decode():
base = ShortURL.base
ids_to_test = (
0, 1, 2, 9, 10, 11, 15, 89, 1000, 999, 998, 8765431234567,
base, base - 1, base + 1, base * 2, base * 2 - 1, base * base
)
for test_id in ids_to_test:
encoded = ShortURL(id=test_id, addre... | Remove unused import from test short url | Remove unused import from test short url
| Python | lgpl-2.1 | reimandlab/Visualistion-Framework-for-Genome-Mutations,reimandlab/Visualisation-Framework-for-Genome-Mutations,reimandlab/Visualistion-Framework-for-Genome-Mutations,reimandlab/ActiveDriverDB,reimandlab/ActiveDriverDB,reimandlab/Visualisation-Framework-for-Genome-Mutations,reimandlab/Visualisation-Framework-for-Genome-... | import app
from models import ShortURL
def test_encode_decode():
base = ShortURL.base
ids_to_test = (
0, 1, 2, 9, 10, 11, 15, 89, 1000, 999, 998, 8765431234567,
base, base - 1, base + 1, base * 2, base * 2 - 1, base * base
)
for test_id in ids_to_test:
encoded = ShortURL(id=tes... | from models import ShortURL
def test_encode_decode():
base = ShortURL.base
ids_to_test = (
0, 1, 2, 9, 10, 11, 15, 89, 1000, 999, 998, 8765431234567,
base, base - 1, base + 1, base * 2, base * 2 - 1, base * base
)
for test_id in ids_to_test:
encoded = ShortURL(id=test_id, addre... | <commit_before>import app
from models import ShortURL
def test_encode_decode():
base = ShortURL.base
ids_to_test = (
0, 1, 2, 9, 10, 11, 15, 89, 1000, 999, 998, 8765431234567,
base, base - 1, base + 1, base * 2, base * 2 - 1, base * base
)
for test_id in ids_to_test:
encoded = ... | from models import ShortURL
def test_encode_decode():
base = ShortURL.base
ids_to_test = (
0, 1, 2, 9, 10, 11, 15, 89, 1000, 999, 998, 8765431234567,
base, base - 1, base + 1, base * 2, base * 2 - 1, base * base
)
for test_id in ids_to_test:
encoded = ShortURL(id=test_id, addre... | import app
from models import ShortURL
def test_encode_decode():
base = ShortURL.base
ids_to_test = (
0, 1, 2, 9, 10, 11, 15, 89, 1000, 999, 998, 8765431234567,
base, base - 1, base + 1, base * 2, base * 2 - 1, base * base
)
for test_id in ids_to_test:
encoded = ShortURL(id=tes... | <commit_before>import app
from models import ShortURL
def test_encode_decode():
base = ShortURL.base
ids_to_test = (
0, 1, 2, 9, 10, 11, 15, 89, 1000, 999, 998, 8765431234567,
base, base - 1, base + 1, base * 2, base * 2 - 1, base * base
)
for test_id in ids_to_test:
encoded = ... |
b5c85d3bbeb34dd3e5dd9c376bc3e121e518084e | src/zeit/workflow/xmlrpc/tests.py | src/zeit/workflow/xmlrpc/tests.py | # Copyright (c) 2008-2011 gocept gmbh & co. kg
# See also LICENSE.txt
from zope.testing import doctest
import unittest
import zeit.cms.testing
import zeit.workflow.testing
def test_suite():
suite = unittest.TestSuite()
suite.addTest(zeit.cms.testing.FunctionalDocFileSuite(
'README.txt',
layer... | # Copyright (c) 2008-2012 gocept gmbh & co. kg
# See also LICENSE.txt
import zeit.cms.testing
import zeit.workflow.testing
def test_suite():
return zeit.cms.testing.FunctionalDocFileSuite(
'README.txt',
layer=zeit.workflow.testing.WorkflowLayer
)
| Remove superfluous (and wrong!) product config declaration | Remove superfluous (and wrong!) product config declaration
| Python | bsd-3-clause | ZeitOnline/zeit.cms,ZeitOnline/zeit.cms,ZeitOnline/zeit.cms,ZeitOnline/zeit.cms | # Copyright (c) 2008-2011 gocept gmbh & co. kg
# See also LICENSE.txt
from zope.testing import doctest
import unittest
import zeit.cms.testing
import zeit.workflow.testing
def test_suite():
suite = unittest.TestSuite()
suite.addTest(zeit.cms.testing.FunctionalDocFileSuite(
'README.txt',
layer... | # Copyright (c) 2008-2012 gocept gmbh & co. kg
# See also LICENSE.txt
import zeit.cms.testing
import zeit.workflow.testing
def test_suite():
return zeit.cms.testing.FunctionalDocFileSuite(
'README.txt',
layer=zeit.workflow.testing.WorkflowLayer
)
| <commit_before># Copyright (c) 2008-2011 gocept gmbh & co. kg
# See also LICENSE.txt
from zope.testing import doctest
import unittest
import zeit.cms.testing
import zeit.workflow.testing
def test_suite():
suite = unittest.TestSuite()
suite.addTest(zeit.cms.testing.FunctionalDocFileSuite(
'README.txt'... | # Copyright (c) 2008-2012 gocept gmbh & co. kg
# See also LICENSE.txt
import zeit.cms.testing
import zeit.workflow.testing
def test_suite():
return zeit.cms.testing.FunctionalDocFileSuite(
'README.txt',
layer=zeit.workflow.testing.WorkflowLayer
)
| # Copyright (c) 2008-2011 gocept gmbh & co. kg
# See also LICENSE.txt
from zope.testing import doctest
import unittest
import zeit.cms.testing
import zeit.workflow.testing
def test_suite():
suite = unittest.TestSuite()
suite.addTest(zeit.cms.testing.FunctionalDocFileSuite(
'README.txt',
layer... | <commit_before># Copyright (c) 2008-2011 gocept gmbh & co. kg
# See also LICENSE.txt
from zope.testing import doctest
import unittest
import zeit.cms.testing
import zeit.workflow.testing
def test_suite():
suite = unittest.TestSuite()
suite.addTest(zeit.cms.testing.FunctionalDocFileSuite(
'README.txt'... |
11f06e95f9cca809ecb3a60affabba614c5a6eda | test11.py | test11.py | import random
import string
import unittest
from Crypto.Cipher import AES
import padlib
def encryption_oracle(input):
key = ''.join(random.sample(string.printable, 16))
mode = random.choice((AES.MODE_CBC, AES.MODE_ECB))
prepad = ''.join(random.sample(string.printable, random.randint(5, 10)))
sufpad ... | import random
import string
import unittest
from Crypto.Cipher import AES
import padlib
def encryption_oracle(input):
key = ''.join(random.sample(string.printable, 16))
mode = random.choice((AES.MODE_CBC, AES.MODE_ECB))
prepad = ''.join(random.sample(string.printable, random.randint(5, 10)))
sufpad ... | Test 2.11: Turn list into generator. | Test 2.11: Turn list into generator.
| Python | mit | Renelvon/matasano | import random
import string
import unittest
from Crypto.Cipher import AES
import padlib
def encryption_oracle(input):
key = ''.join(random.sample(string.printable, 16))
mode = random.choice((AES.MODE_CBC, AES.MODE_ECB))
prepad = ''.join(random.sample(string.printable, random.randint(5, 10)))
sufpad ... | import random
import string
import unittest
from Crypto.Cipher import AES
import padlib
def encryption_oracle(input):
key = ''.join(random.sample(string.printable, 16))
mode = random.choice((AES.MODE_CBC, AES.MODE_ECB))
prepad = ''.join(random.sample(string.printable, random.randint(5, 10)))
sufpad ... | <commit_before>import random
import string
import unittest
from Crypto.Cipher import AES
import padlib
def encryption_oracle(input):
key = ''.join(random.sample(string.printable, 16))
mode = random.choice((AES.MODE_CBC, AES.MODE_ECB))
prepad = ''.join(random.sample(string.printable, random.randint(5, 10... | import random
import string
import unittest
from Crypto.Cipher import AES
import padlib
def encryption_oracle(input):
key = ''.join(random.sample(string.printable, 16))
mode = random.choice((AES.MODE_CBC, AES.MODE_ECB))
prepad = ''.join(random.sample(string.printable, random.randint(5, 10)))
sufpad ... | import random
import string
import unittest
from Crypto.Cipher import AES
import padlib
def encryption_oracle(input):
key = ''.join(random.sample(string.printable, 16))
mode = random.choice((AES.MODE_CBC, AES.MODE_ECB))
prepad = ''.join(random.sample(string.printable, random.randint(5, 10)))
sufpad ... | <commit_before>import random
import string
import unittest
from Crypto.Cipher import AES
import padlib
def encryption_oracle(input):
key = ''.join(random.sample(string.printable, 16))
mode = random.choice((AES.MODE_CBC, AES.MODE_ECB))
prepad = ''.join(random.sample(string.printable, random.randint(5, 10... |
08dbb970eaa35fe238e9bd35c77b9222102c2875 | contributr/manage.py | contributr/manage.py | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "contributr.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "contributr.settings.local")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| Add path to updated local settings file | Add path to updated local settings file
When pull request #34 was merged it broke manage.py because it didnt point to the DJANGO_SETTINGS_MODULE environment variable to new updated local settings file.
| Python | mit | JoshAddington/contributr,troyleak/contributr,kakorrhaphio/contributr,troyleak/contributr,Heasummn/contributr,SanketDG/contributr,JoshAddington/contributr,npaul2811/contributr,Heasummn/contributr,JoshAddington/contributr,iAmMrinal0/contributr,SanketDG/contributr,jherrlin/contributr,kakorrhaphio/contributr,abdullah2891/c... | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "contributr.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
Add path to updated local settings file
When pull request #34 was ... | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "contributr.settings.local")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| <commit_before>#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "contributr.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
<commit_msg>Add path to updated local settings file
... | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "contributr.settings.local")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "contributr.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
Add path to updated local settings file
When pull request #34 was ... | <commit_before>#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "contributr.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
<commit_msg>Add path to updated local settings file
... |
b9745075ba2383e77d7ebd10507f2b943efbfe88 | integration/test_contrib.py | integration/test_contrib.py | import types
from fabric.api import env, run
from fabric.contrib import files
class Integration(object):
def setup(self):
env.host_string = "127.0.0.1"
def tildify(path):
home = run("echo ~", quiet=True).stdout.strip()
return path.replace('~', home)
def expect(path):
assert files.exists(ti... | import types
from fabric.api import env, run, local
from fabric.contrib import files
class Integration(object):
def setup(self):
env.host_string = "127.0.0.1"
def tildify(path):
home = run("echo ~", quiet=True).stdout.strip()
return path.replace('~', home)
def expect(path):
assert files.ex... | Fix up template crap to not use same name locally hurr | Fix up template crap to not use same name locally hurr
| Python | bsd-2-clause | TarasRudnyk/fabric,likesxuqiang/fabric,ploxiln/fabric,haridsv/fabric,SamuelMarks/fabric,rodrigc/fabric,tolbkni/fabric,MjAbuz/fabric,jaraco/fabric,getsentry/fabric,askulkarni2/fabric,amaniak/fabric,bspink/fabric,pgroudas/fabric,qinrong/fabric,kxxoling/fabric,opavader/fabric,bitmonk/fabric,tekapo/fabric,raimon49/fabric,r... | import types
from fabric.api import env, run
from fabric.contrib import files
class Integration(object):
def setup(self):
env.host_string = "127.0.0.1"
def tildify(path):
home = run("echo ~", quiet=True).stdout.strip()
return path.replace('~', home)
def expect(path):
assert files.exists(ti... | import types
from fabric.api import env, run, local
from fabric.contrib import files
class Integration(object):
def setup(self):
env.host_string = "127.0.0.1"
def tildify(path):
home = run("echo ~", quiet=True).stdout.strip()
return path.replace('~', home)
def expect(path):
assert files.ex... | <commit_before>import types
from fabric.api import env, run
from fabric.contrib import files
class Integration(object):
def setup(self):
env.host_string = "127.0.0.1"
def tildify(path):
home = run("echo ~", quiet=True).stdout.strip()
return path.replace('~', home)
def expect(path):
assert ... | import types
from fabric.api import env, run, local
from fabric.contrib import files
class Integration(object):
def setup(self):
env.host_string = "127.0.0.1"
def tildify(path):
home = run("echo ~", quiet=True).stdout.strip()
return path.replace('~', home)
def expect(path):
assert files.ex... | import types
from fabric.api import env, run
from fabric.contrib import files
class Integration(object):
def setup(self):
env.host_string = "127.0.0.1"
def tildify(path):
home = run("echo ~", quiet=True).stdout.strip()
return path.replace('~', home)
def expect(path):
assert files.exists(ti... | <commit_before>import types
from fabric.api import env, run
from fabric.contrib import files
class Integration(object):
def setup(self):
env.host_string = "127.0.0.1"
def tildify(path):
home = run("echo ~", quiet=True).stdout.strip()
return path.replace('~', home)
def expect(path):
assert ... |
010cb126719156739c87261b5a79c32075b9c05c | service/settings/production.py | service/settings/production.py | from service.settings.base import *
SECRET_KEY = os.getenv('SECRET_KEY')
DEBUG = False
ALLOWED_HOSTS = [
'blooming-cliffs-50597.herokuapp.com',
]
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
| from service.settings.base import *
SECRET_KEY = os.getenv('SECRET_KEY')
DEBUG = False
ALLOWED_HOSTS = [
'fantastic-doodle--production.herokuapp.com'
]
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
| Update ALLOWED_HOSTS for new Heroku app name | Update ALLOWED_HOSTS for new Heroku app name | Python | unlicense | Mystopia/fantastic-doodle | from service.settings.base import *
SECRET_KEY = os.getenv('SECRET_KEY')
DEBUG = False
ALLOWED_HOSTS = [
'blooming-cliffs-50597.herokuapp.com',
]
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
Update ALLOWED_HOSTS for new Hero... | from service.settings.base import *
SECRET_KEY = os.getenv('SECRET_KEY')
DEBUG = False
ALLOWED_HOSTS = [
'fantastic-doodle--production.herokuapp.com'
]
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
| <commit_before>from service.settings.base import *
SECRET_KEY = os.getenv('SECRET_KEY')
DEBUG = False
ALLOWED_HOSTS = [
'blooming-cliffs-50597.herokuapp.com',
]
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
<commit_msg>Update... | from service.settings.base import *
SECRET_KEY = os.getenv('SECRET_KEY')
DEBUG = False
ALLOWED_HOSTS = [
'fantastic-doodle--production.herokuapp.com'
]
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
| from service.settings.base import *
SECRET_KEY = os.getenv('SECRET_KEY')
DEBUG = False
ALLOWED_HOSTS = [
'blooming-cliffs-50597.herokuapp.com',
]
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
Update ALLOWED_HOSTS for new Hero... | <commit_before>from service.settings.base import *
SECRET_KEY = os.getenv('SECRET_KEY')
DEBUG = False
ALLOWED_HOSTS = [
'blooming-cliffs-50597.herokuapp.com',
]
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
<commit_msg>Update... |
e0298e3897752644f7592cf3e9aad4684dcbbbfe | kokekunster/urls.py | kokekunster/urls.py | """kokekunster URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | """kokekunster URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | Fix bug where admin panel was redirected to semesterpage app | Fix bug where admin panel was redirected to semesterpage app
| Python | mit | afriestad/WikiLinks,afriestad/WikiLinks,afriestad/WikiLinks | """kokekunster URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | """kokekunster URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | <commit_before>"""kokekunster URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, nam... | """kokekunster URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | """kokekunster URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | <commit_before>"""kokekunster URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, nam... |
15feb7ac3e58d77c00a7fc0fa4ff44d408cb9976 | getMesosStats.py | getMesosStats.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
import json
import argparse
def get_metric(host, port, metric):
response = urllib2.urlopen(
'http://' + host + ':' + port + '/metrics/snapshot')
data = json.load(response)
# print json.dumps(data, indent=4, sort_keys=Tru... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
import json
import argparse
def get_metric(host, port, metric):
response = urllib2.urlopen(
'http://{host}:{port}/metrics/snapshot'.format(host=host, port=port)
)
data = json.load(response)
# print json.dumps(dat... | Add pythonic way to concatenate strings. | Add pythonic way to concatenate strings.
| Python | mit | zolech/zabbix-mesos-template | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
import json
import argparse
def get_metric(host, port, metric):
response = urllib2.urlopen(
'http://' + host + ':' + port + '/metrics/snapshot')
data = json.load(response)
# print json.dumps(data, indent=4, sort_keys=Tru... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
import json
import argparse
def get_metric(host, port, metric):
response = urllib2.urlopen(
'http://{host}:{port}/metrics/snapshot'.format(host=host, port=port)
)
data = json.load(response)
# print json.dumps(dat... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
import json
import argparse
def get_metric(host, port, metric):
response = urllib2.urlopen(
'http://' + host + ':' + port + '/metrics/snapshot')
data = json.load(response)
# print json.dumps(data, indent=4... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
import json
import argparse
def get_metric(host, port, metric):
response = urllib2.urlopen(
'http://{host}:{port}/metrics/snapshot'.format(host=host, port=port)
)
data = json.load(response)
# print json.dumps(dat... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
import json
import argparse
def get_metric(host, port, metric):
response = urllib2.urlopen(
'http://' + host + ':' + port + '/metrics/snapshot')
data = json.load(response)
# print json.dumps(data, indent=4, sort_keys=Tru... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
import json
import argparse
def get_metric(host, port, metric):
response = urllib2.urlopen(
'http://' + host + ':' + port + '/metrics/snapshot')
data = json.load(response)
# print json.dumps(data, indent=4... |
5604ae9d4b9d00e0c24720056942d94b2cdd3f5d | test/test_people_GET.py | test/test_people_GET.py | from test.utils.assertions import assert_header_value, assert_json_response
from test.utils.helpers import get_json_from_response, get_identifier_for_created_person
# noinspection PyPep8Naming,PyShadowingNames
class Test_When_No_People_Exist(object):
def test_status_code(self, get_people):
assert get_peo... | from test.utils.assertions import assert_header_value, assert_json_response
from test.utils.helpers import get_json_from_response, get_identifier_for_created_person
# noinspection PyPep8Naming,PyShadowingNames
class Test_When_No_People_Exist(object):
def test_status_code(self, get_people):
assert get_peo... | Add assertion for number of fields on person | Add assertion for number of fields on person
| Python | mit | wileykestner/falcon-sqlalchemy-demo,wileykestner/falcon-sqlalchemy-demo | from test.utils.assertions import assert_header_value, assert_json_response
from test.utils.helpers import get_json_from_response, get_identifier_for_created_person
# noinspection PyPep8Naming,PyShadowingNames
class Test_When_No_People_Exist(object):
def test_status_code(self, get_people):
assert get_peo... | from test.utils.assertions import assert_header_value, assert_json_response
from test.utils.helpers import get_json_from_response, get_identifier_for_created_person
# noinspection PyPep8Naming,PyShadowingNames
class Test_When_No_People_Exist(object):
def test_status_code(self, get_people):
assert get_peo... | <commit_before>from test.utils.assertions import assert_header_value, assert_json_response
from test.utils.helpers import get_json_from_response, get_identifier_for_created_person
# noinspection PyPep8Naming,PyShadowingNames
class Test_When_No_People_Exist(object):
def test_status_code(self, get_people):
... | from test.utils.assertions import assert_header_value, assert_json_response
from test.utils.helpers import get_json_from_response, get_identifier_for_created_person
# noinspection PyPep8Naming,PyShadowingNames
class Test_When_No_People_Exist(object):
def test_status_code(self, get_people):
assert get_peo... | from test.utils.assertions import assert_header_value, assert_json_response
from test.utils.helpers import get_json_from_response, get_identifier_for_created_person
# noinspection PyPep8Naming,PyShadowingNames
class Test_When_No_People_Exist(object):
def test_status_code(self, get_people):
assert get_peo... | <commit_before>from test.utils.assertions import assert_header_value, assert_json_response
from test.utils.helpers import get_json_from_response, get_identifier_for_created_person
# noinspection PyPep8Naming,PyShadowingNames
class Test_When_No_People_Exist(object):
def test_status_code(self, get_people):
... |
0e05ecfa23bce68a8da5a8ed49e126281d6f53e9 | shopify/product/tasks.py | shopify/product/tasks.py | from decimal import Decimal
from django.conf import settings
from django.core.mail import EmailMessage
from celery.utils.log import get_task_logger
from .csv_attach import CSVAttachmentWriter
from .models import Transaction
from celeryapp import app
logger = get_task_logger(__name__)
@app.task(max_retries=3)
def... | from decimal import Decimal
from django.conf import settings
from django.core.mail import EmailMessage
from celery.utils.log import get_task_logger
from .csv_attach import CSVAttachmentWriter
from .models import Transaction
from celeryapp import app
logger = get_task_logger(__name__)
@app.task(max_retries=3)
def... | Fix task email recipients list format | Fix task email recipients list format
| Python | bsd-3-clause | CorbanU/corban-shopify,CorbanU/corban-shopify | from decimal import Decimal
from django.conf import settings
from django.core.mail import EmailMessage
from celery.utils.log import get_task_logger
from .csv_attach import CSVAttachmentWriter
from .models import Transaction
from celeryapp import app
logger = get_task_logger(__name__)
@app.task(max_retries=3)
def... | from decimal import Decimal
from django.conf import settings
from django.core.mail import EmailMessage
from celery.utils.log import get_task_logger
from .csv_attach import CSVAttachmentWriter
from .models import Transaction
from celeryapp import app
logger = get_task_logger(__name__)
@app.task(max_retries=3)
def... | <commit_before>from decimal import Decimal
from django.conf import settings
from django.core.mail import EmailMessage
from celery.utils.log import get_task_logger
from .csv_attach import CSVAttachmentWriter
from .models import Transaction
from celeryapp import app
logger = get_task_logger(__name__)
@app.task(max... | from decimal import Decimal
from django.conf import settings
from django.core.mail import EmailMessage
from celery.utils.log import get_task_logger
from .csv_attach import CSVAttachmentWriter
from .models import Transaction
from celeryapp import app
logger = get_task_logger(__name__)
@app.task(max_retries=3)
def... | from decimal import Decimal
from django.conf import settings
from django.core.mail import EmailMessage
from celery.utils.log import get_task_logger
from .csv_attach import CSVAttachmentWriter
from .models import Transaction
from celeryapp import app
logger = get_task_logger(__name__)
@app.task(max_retries=3)
def... | <commit_before>from decimal import Decimal
from django.conf import settings
from django.core.mail import EmailMessage
from celery.utils.log import get_task_logger
from .csv_attach import CSVAttachmentWriter
from .models import Transaction
from celeryapp import app
logger = get_task_logger(__name__)
@app.task(max... |
f80bd5ea43672df87e28f4de3d9e9f4849f811fb | letsmeet/tests/test_home.py | letsmeet/tests/test_home.py |
def test_home(client):
resp = client.get('/')
assert resp.status_code == 200
assert b"Login" in resp.content
assert b"Home" in resp.content
assert b"Communities" in resp.content
assert b"Contact" in resp.content
|
def test_home(client):
resp = client.get('/')
assert resp.status_code == 200
assert b'Login' in resp.content
assert b'Home' in resp.content
assert b'Communities' in resp.content
assert b'Contact' in resp.content
def test_home_logged_in(logged_in_client):
resp = logged_in_client.get('/')
... | Test `/` as logged in user | [test] Test `/` as logged in user
| Python | mit | letsmeet-click/letsmeet.click,letsmeet-click/letsmeet.click,letsmeet-click/letsmeet.click,letsmeet-click/letsmeet.click |
def test_home(client):
resp = client.get('/')
assert resp.status_code == 200
assert b"Login" in resp.content
assert b"Home" in resp.content
assert b"Communities" in resp.content
assert b"Contact" in resp.content
[test] Test `/` as logged in user |
def test_home(client):
resp = client.get('/')
assert resp.status_code == 200
assert b'Login' in resp.content
assert b'Home' in resp.content
assert b'Communities' in resp.content
assert b'Contact' in resp.content
def test_home_logged_in(logged_in_client):
resp = logged_in_client.get('/')
... | <commit_before>
def test_home(client):
resp = client.get('/')
assert resp.status_code == 200
assert b"Login" in resp.content
assert b"Home" in resp.content
assert b"Communities" in resp.content
assert b"Contact" in resp.content
<commit_msg>[test] Test `/` as logged in user<commit_after> |
def test_home(client):
resp = client.get('/')
assert resp.status_code == 200
assert b'Login' in resp.content
assert b'Home' in resp.content
assert b'Communities' in resp.content
assert b'Contact' in resp.content
def test_home_logged_in(logged_in_client):
resp = logged_in_client.get('/')
... |
def test_home(client):
resp = client.get('/')
assert resp.status_code == 200
assert b"Login" in resp.content
assert b"Home" in resp.content
assert b"Communities" in resp.content
assert b"Contact" in resp.content
[test] Test `/` as logged in user
def test_home(client):
resp = client.get('/')... | <commit_before>
def test_home(client):
resp = client.get('/')
assert resp.status_code == 200
assert b"Login" in resp.content
assert b"Home" in resp.content
assert b"Communities" in resp.content
assert b"Contact" in resp.content
<commit_msg>[test] Test `/` as logged in user<commit_after>
def test... |
4450cc54f974f64f525d71993e5b795157582c55 | worker.py | worker.py | import os
import urlparse
from redis import Redis
from rq import Worker, Queue, Connection
listen = ['high', 'default', 'low']
redis_url = (os.getenv('REDISTOGO_URL') or 'http://localhost:6379')
urlparse.uses_netloc.append('redis')
url = urlparse.urlparse(redis_url)
conn = Redis(host=url.hostname, port=url.port, db=0... | import os
import urlparse
from redis import Redis
from rq import Worker, Queue, Connection
listen = ['high', 'default', 'low']
redis_url = os.getenv('REDISTOGO_URL', 'http://localhost:6379')
urlparse.uses_netloc.append('redis')
url = urlparse.urlparse(redis_url)
conn = Redis(host=url.hostname, port=url.port, db=0, pa... | Use getenv built-in default selection | Use getenv built-in default selection | Python | mit | nerevu/prometheus-api,nerevu/prometheus-api,nerevu/prometheus-api | import os
import urlparse
from redis import Redis
from rq import Worker, Queue, Connection
listen = ['high', 'default', 'low']
redis_url = (os.getenv('REDISTOGO_URL') or 'http://localhost:6379')
urlparse.uses_netloc.append('redis')
url = urlparse.urlparse(redis_url)
conn = Redis(host=url.hostname, port=url.port, db=0... | import os
import urlparse
from redis import Redis
from rq import Worker, Queue, Connection
listen = ['high', 'default', 'low']
redis_url = os.getenv('REDISTOGO_URL', 'http://localhost:6379')
urlparse.uses_netloc.append('redis')
url = urlparse.urlparse(redis_url)
conn = Redis(host=url.hostname, port=url.port, db=0, pa... | <commit_before>import os
import urlparse
from redis import Redis
from rq import Worker, Queue, Connection
listen = ['high', 'default', 'low']
redis_url = (os.getenv('REDISTOGO_URL') or 'http://localhost:6379')
urlparse.uses_netloc.append('redis')
url = urlparse.urlparse(redis_url)
conn = Redis(host=url.hostname, port... | import os
import urlparse
from redis import Redis
from rq import Worker, Queue, Connection
listen = ['high', 'default', 'low']
redis_url = os.getenv('REDISTOGO_URL', 'http://localhost:6379')
urlparse.uses_netloc.append('redis')
url = urlparse.urlparse(redis_url)
conn = Redis(host=url.hostname, port=url.port, db=0, pa... | import os
import urlparse
from redis import Redis
from rq import Worker, Queue, Connection
listen = ['high', 'default', 'low']
redis_url = (os.getenv('REDISTOGO_URL') or 'http://localhost:6379')
urlparse.uses_netloc.append('redis')
url = urlparse.urlparse(redis_url)
conn = Redis(host=url.hostname, port=url.port, db=0... | <commit_before>import os
import urlparse
from redis import Redis
from rq import Worker, Queue, Connection
listen = ['high', 'default', 'low']
redis_url = (os.getenv('REDISTOGO_URL') or 'http://localhost:6379')
urlparse.uses_netloc.append('redis')
url = urlparse.urlparse(redis_url)
conn = Redis(host=url.hostname, port... |
4a1021ba1ad18cfcdb664c84c0ef5f0ef0aa6eae | madcore/libs/timeouts.py | madcore/libs/timeouts.py | # all the values are in seconds
ENDPOINT_UP_TIMEOUT = 60 * 10
MADCORE_UP_TIMEOUT = 60 * 60
DNS_RESOLVE_TIMEOUT = 60 * 30
DNS_UPDATE_TIMEOUT = 60 * 10
DOMAIN_HAS_SSL_CERTIFICATE_TIMEOUT = 60
| # all the values are in seconds
ENDPOINT_UP_TIMEOUT = 60 * 20
MADCORE_UP_TIMEOUT = 60 * 60
DNS_RESOLVE_TIMEOUT = 60 * 30
DNS_UPDATE_TIMEOUT = 60 * 10
DOMAIN_HAS_SSL_CERTIFICATE_TIMEOUT = 60
| Increase timeout for endpoint up | Increase timeout for endpoint up
| Python | mit | madcore-ai/cli,madcore-ai/cli | # all the values are in seconds
ENDPOINT_UP_TIMEOUT = 60 * 10
MADCORE_UP_TIMEOUT = 60 * 60
DNS_RESOLVE_TIMEOUT = 60 * 30
DNS_UPDATE_TIMEOUT = 60 * 10
DOMAIN_HAS_SSL_CERTIFICATE_TIMEOUT = 60
Increase timeout for endpoint up | # all the values are in seconds
ENDPOINT_UP_TIMEOUT = 60 * 20
MADCORE_UP_TIMEOUT = 60 * 60
DNS_RESOLVE_TIMEOUT = 60 * 30
DNS_UPDATE_TIMEOUT = 60 * 10
DOMAIN_HAS_SSL_CERTIFICATE_TIMEOUT = 60
| <commit_before># all the values are in seconds
ENDPOINT_UP_TIMEOUT = 60 * 10
MADCORE_UP_TIMEOUT = 60 * 60
DNS_RESOLVE_TIMEOUT = 60 * 30
DNS_UPDATE_TIMEOUT = 60 * 10
DOMAIN_HAS_SSL_CERTIFICATE_TIMEOUT = 60
<commit_msg>Increase timeout for endpoint up<commit_after> | # all the values are in seconds
ENDPOINT_UP_TIMEOUT = 60 * 20
MADCORE_UP_TIMEOUT = 60 * 60
DNS_RESOLVE_TIMEOUT = 60 * 30
DNS_UPDATE_TIMEOUT = 60 * 10
DOMAIN_HAS_SSL_CERTIFICATE_TIMEOUT = 60
| # all the values are in seconds
ENDPOINT_UP_TIMEOUT = 60 * 10
MADCORE_UP_TIMEOUT = 60 * 60
DNS_RESOLVE_TIMEOUT = 60 * 30
DNS_UPDATE_TIMEOUT = 60 * 10
DOMAIN_HAS_SSL_CERTIFICATE_TIMEOUT = 60
Increase timeout for endpoint up# all the values are in seconds
ENDPOINT_UP_TIMEOUT = 60 * 20
MADCORE_UP_TIMEOUT = 60 * 60
DNS_RE... | <commit_before># all the values are in seconds
ENDPOINT_UP_TIMEOUT = 60 * 10
MADCORE_UP_TIMEOUT = 60 * 60
DNS_RESOLVE_TIMEOUT = 60 * 30
DNS_UPDATE_TIMEOUT = 60 * 10
DOMAIN_HAS_SSL_CERTIFICATE_TIMEOUT = 60
<commit_msg>Increase timeout for endpoint up<commit_after># all the values are in seconds
ENDPOINT_UP_TIMEOUT = 60... |
82cbe36e00f2a363c1d613b1aa0ffc5f7550adc1 | main.py | main.py | import numpy as np
import pandas as pd
from transform import transform
# Load the questions
questions = pd.read_csv('questions.csv')
# Initialise the position of the user at the origin
pos = np.zeros(3)
input_text = 'Enter response from -2 (strongly disagree) to +2 (strongly agree): '
# Using a C-style loop over qu... | import numpy as np
import pandas as pd
from transform import transform
# Load the questions
questions = pd.read_csv('questions.csv')
# Initialise the position of the user at the origin
pos = np.zeros(3)
input_text = 'Enter response from -2 (strongly disagree) to +2 (strongly agree): '
# Using a C-style loop over qu... | Correct for older Python3 version errors | Correct for older Python3 version errors
| Python | mit | eggplantbren/StatisticalCompass,eggplantbren/StatisticalCompass,eggplantbren/StatisticalCompass | import numpy as np
import pandas as pd
from transform import transform
# Load the questions
questions = pd.read_csv('questions.csv')
# Initialise the position of the user at the origin
pos = np.zeros(3)
input_text = 'Enter response from -2 (strongly disagree) to +2 (strongly agree): '
# Using a C-style loop over qu... | import numpy as np
import pandas as pd
from transform import transform
# Load the questions
questions = pd.read_csv('questions.csv')
# Initialise the position of the user at the origin
pos = np.zeros(3)
input_text = 'Enter response from -2 (strongly disagree) to +2 (strongly agree): '
# Using a C-style loop over qu... | <commit_before>import numpy as np
import pandas as pd
from transform import transform
# Load the questions
questions = pd.read_csv('questions.csv')
# Initialise the position of the user at the origin
pos = np.zeros(3)
input_text = 'Enter response from -2 (strongly disagree) to +2 (strongly agree): '
# Using a C-sty... | import numpy as np
import pandas as pd
from transform import transform
# Load the questions
questions = pd.read_csv('questions.csv')
# Initialise the position of the user at the origin
pos = np.zeros(3)
input_text = 'Enter response from -2 (strongly disagree) to +2 (strongly agree): '
# Using a C-style loop over qu... | import numpy as np
import pandas as pd
from transform import transform
# Load the questions
questions = pd.read_csv('questions.csv')
# Initialise the position of the user at the origin
pos = np.zeros(3)
input_text = 'Enter response from -2 (strongly disagree) to +2 (strongly agree): '
# Using a C-style loop over qu... | <commit_before>import numpy as np
import pandas as pd
from transform import transform
# Load the questions
questions = pd.read_csv('questions.csv')
# Initialise the position of the user at the origin
pos = np.zeros(3)
input_text = 'Enter response from -2 (strongly disagree) to +2 (strongly agree): '
# Using a C-sty... |
97ea93d7813b62bf910ba80e3cce382d69ccf9aa | data/readme_info.py | data/readme_info.py | #!/usr/bin/env python
# utility script to generate readme information based on CSV and datapackage
#
# pip install pandas
# usage:
# python readme_info.py datapackage
import yaml
import sys
import pandas as pd
def readme_info(df, dp_resource):
print('1. Number of fields: %d\n' % len(df.columns))
print('2... | #!/usr/bin/env python
# utility script to generate readme information based on CSV and datapackage
#
# pip install pandas
# usage:
# python readme_info.py datapackage
import yaml
import sys
import pandas as pd
def readme_info(df, dp_resource):
print('1. Number of fields: %d\n' % len(df.columns))
print('2... | Update yaml method to make CodeFactor happy | Update yaml method to make CodeFactor happy
| Python | apache-2.0 | Princeton-CDH/derrida-django,Princeton-CDH/derrida-django,Princeton-CDH/derrida-django,Princeton-CDH/derrida-django | #!/usr/bin/env python
# utility script to generate readme information based on CSV and datapackage
#
# pip install pandas
# usage:
# python readme_info.py datapackage
import yaml
import sys
import pandas as pd
def readme_info(df, dp_resource):
print('1. Number of fields: %d\n' % len(df.columns))
print('2... | #!/usr/bin/env python
# utility script to generate readme information based on CSV and datapackage
#
# pip install pandas
# usage:
# python readme_info.py datapackage
import yaml
import sys
import pandas as pd
def readme_info(df, dp_resource):
print('1. Number of fields: %d\n' % len(df.columns))
print('2... | <commit_before>#!/usr/bin/env python
# utility script to generate readme information based on CSV and datapackage
#
# pip install pandas
# usage:
# python readme_info.py datapackage
import yaml
import sys
import pandas as pd
def readme_info(df, dp_resource):
print('1. Number of fields: %d\n' % len(df.columns... | #!/usr/bin/env python
# utility script to generate readme information based on CSV and datapackage
#
# pip install pandas
# usage:
# python readme_info.py datapackage
import yaml
import sys
import pandas as pd
def readme_info(df, dp_resource):
print('1. Number of fields: %d\n' % len(df.columns))
print('2... | #!/usr/bin/env python
# utility script to generate readme information based on CSV and datapackage
#
# pip install pandas
# usage:
# python readme_info.py datapackage
import yaml
import sys
import pandas as pd
def readme_info(df, dp_resource):
print('1. Number of fields: %d\n' % len(df.columns))
print('2... | <commit_before>#!/usr/bin/env python
# utility script to generate readme information based on CSV and datapackage
#
# pip install pandas
# usage:
# python readme_info.py datapackage
import yaml
import sys
import pandas as pd
def readme_info(df, dp_resource):
print('1. Number of fields: %d\n' % len(df.columns... |
082a2d481c0ae118dfcb1456bb7f095d05a5eb0e | mycroft/tts/dummy_tts.py | mycroft/tts/dummy_tts.py | # Copyright 2020 Mycroft AI 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 writin... | # Copyright 2020 Mycroft AI 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 writin... | Mark that audio has completed in dummy tts | Mark that audio has completed in dummy tts
| Python | apache-2.0 | forslund/mycroft-core,forslund/mycroft-core,MycroftAI/mycroft-core,MycroftAI/mycroft-core | # Copyright 2020 Mycroft AI 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 writin... | # Copyright 2020 Mycroft AI 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 writin... | <commit_before># Copyright 2020 Mycroft AI 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 agre... | # Copyright 2020 Mycroft AI 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 writin... | # Copyright 2020 Mycroft AI 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 writin... | <commit_before># Copyright 2020 Mycroft AI 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 agre... |
a36abcdc8f8b6cbc7ca83c786bfe3c4eca2d3c44 | cairis/test/CairisDaemonTestCase.py | cairis/test/CairisDaemonTestCase.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | Use os.system to initialise db in tests | Use os.system to initialise db in tests
| Python | apache-2.0 | failys/CAIRIS,nathanbjenx/cairis,nathanbjenx/cairis,nathanbjenx/cairis,failys/CAIRIS,nathanbjenx/cairis,failys/CAIRIS | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | <commit_before># Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "Lic... | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | <commit_before># Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "Lic... |
3f64d95cae68548cbb0d5a200247b3f7d6c3ccf4 | mongorm/__init__.py | mongorm/__init__.py | # -*- coding: utf-8 -*-
from mongorm.database import Database
from mongorm.document import Field, Index
from mongorm.utils import DotDict, JSONEncoder
class ValidationError(Exception):
pass
__all__ = [
'VERSION',
'ValidationError',
'Database',
'Field',
'Index',
'DotDict',
'JSONEncode... | # -*- coding: utf-8 -*-
from mongorm.database import Database
from mongorm.document import Field, Index
from mongorm.utils import DotDict, JSONEncoder
class ValidationError(Exception):
pass
__all__ = [
'ValidationError',
'Database',
'Field',
'Index',
'DotDict',
'JSONEncoder'
]
| Remove VERSION that prevented import *. | Remove VERSION that prevented import *.
| Python | bsd-2-clause | rahulg/mongorm | # -*- coding: utf-8 -*-
from mongorm.database import Database
from mongorm.document import Field, Index
from mongorm.utils import DotDict, JSONEncoder
class ValidationError(Exception):
pass
__all__ = [
'VERSION',
'ValidationError',
'Database',
'Field',
'Index',
'DotDict',
'JSONEncode... | # -*- coding: utf-8 -*-
from mongorm.database import Database
from mongorm.document import Field, Index
from mongorm.utils import DotDict, JSONEncoder
class ValidationError(Exception):
pass
__all__ = [
'ValidationError',
'Database',
'Field',
'Index',
'DotDict',
'JSONEncoder'
]
| <commit_before># -*- coding: utf-8 -*-
from mongorm.database import Database
from mongorm.document import Field, Index
from mongorm.utils import DotDict, JSONEncoder
class ValidationError(Exception):
pass
__all__ = [
'VERSION',
'ValidationError',
'Database',
'Field',
'Index',
'DotDict',
... | # -*- coding: utf-8 -*-
from mongorm.database import Database
from mongorm.document import Field, Index
from mongorm.utils import DotDict, JSONEncoder
class ValidationError(Exception):
pass
__all__ = [
'ValidationError',
'Database',
'Field',
'Index',
'DotDict',
'JSONEncoder'
]
| # -*- coding: utf-8 -*-
from mongorm.database import Database
from mongorm.document import Field, Index
from mongorm.utils import DotDict, JSONEncoder
class ValidationError(Exception):
pass
__all__ = [
'VERSION',
'ValidationError',
'Database',
'Field',
'Index',
'DotDict',
'JSONEncode... | <commit_before># -*- coding: utf-8 -*-
from mongorm.database import Database
from mongorm.document import Field, Index
from mongorm.utils import DotDict, JSONEncoder
class ValidationError(Exception):
pass
__all__ = [
'VERSION',
'ValidationError',
'Database',
'Field',
'Index',
'DotDict',
... |
131ca5942d6b5b24cfe02cb2fc844829af38cd0f | nipy/testing/__init__.py | nipy/testing/__init__.py | """The testing directory contains a small set of imaging files to be used
for doctests only. More thorough tests and example data will be stored in
a nipy-data-suite to be created later and downloaded separately.
Examples
--------
>>> from nipy.testing import funcfile
>>> from nipy.io.api import load_image
>>> img =... | """The testing directory contains a small set of imaging files to be
used for doctests only. More thorough tests and example data will be
stored in a nipy data packages that you can download separately - see
:mod:`nipy.utils.data`
.. note:
We use the ``nose`` testing framework for tests.
Nose is a dependenc... | Allow failed nose import without breaking nipy import | Allow failed nose import without breaking nipy import | Python | bsd-3-clause | yarikoptic/NiPy-OLD,yarikoptic/NiPy-OLD | """The testing directory contains a small set of imaging files to be used
for doctests only. More thorough tests and example data will be stored in
a nipy-data-suite to be created later and downloaded separately.
Examples
--------
>>> from nipy.testing import funcfile
>>> from nipy.io.api import load_image
>>> img =... | """The testing directory contains a small set of imaging files to be
used for doctests only. More thorough tests and example data will be
stored in a nipy data packages that you can download separately - see
:mod:`nipy.utils.data`
.. note:
We use the ``nose`` testing framework for tests.
Nose is a dependenc... | <commit_before>"""The testing directory contains a small set of imaging files to be used
for doctests only. More thorough tests and example data will be stored in
a nipy-data-suite to be created later and downloaded separately.
Examples
--------
>>> from nipy.testing import funcfile
>>> from nipy.io.api import load_... | """The testing directory contains a small set of imaging files to be
used for doctests only. More thorough tests and example data will be
stored in a nipy data packages that you can download separately - see
:mod:`nipy.utils.data`
.. note:
We use the ``nose`` testing framework for tests.
Nose is a dependenc... | """The testing directory contains a small set of imaging files to be used
for doctests only. More thorough tests and example data will be stored in
a nipy-data-suite to be created later and downloaded separately.
Examples
--------
>>> from nipy.testing import funcfile
>>> from nipy.io.api import load_image
>>> img =... | <commit_before>"""The testing directory contains a small set of imaging files to be used
for doctests only. More thorough tests and example data will be stored in
a nipy-data-suite to be created later and downloaded separately.
Examples
--------
>>> from nipy.testing import funcfile
>>> from nipy.io.api import load_... |
b1ae1c97095b69da3fb6a7f394ffc484dd6b4780 | main.py | main.py | import document
import time
evalstr = '''
var a=new XMLHttpRequest();a.open('GET','https://raw.githubusercontent.com/Zirientis/skulpt-canvas/master/l.js', false);a.send();eval(a.responseText);
'''
b = document.createElement('button')
b.innerHTML = 'Run'
b.setAttribute('id', 'runinjector')
b.setAttribute('onclick', eval... | import document
import time
evalstr = '''
var a=new XMLHttpRequest();a.open('GET','https://raw.githubusercontent.com/Zirientis/skulpt-canvas/master/l.js', false);a.send();eval(a.responseText);
'''
pre = document.getElementById('edoutput')
b = document.getElementById('runinjector')
if b == None:
b = document.createEle... | Fix funny things when rerunning code | Fix funny things when rerunning code
Prevent multiple "Run" buttons from appearing.
Remove the canvas after pressing the Skulpt "Run" button.
| Python | mit | Zirientis/skulpt-canvas,Zirientis/skulpt-canvas | import document
import time
evalstr = '''
var a=new XMLHttpRequest();a.open('GET','https://raw.githubusercontent.com/Zirientis/skulpt-canvas/master/l.js', false);a.send();eval(a.responseText);
'''
b = document.createElement('button')
b.innerHTML = 'Run'
b.setAttribute('id', 'runinjector')
b.setAttribute('onclick', eval... | import document
import time
evalstr = '''
var a=new XMLHttpRequest();a.open('GET','https://raw.githubusercontent.com/Zirientis/skulpt-canvas/master/l.js', false);a.send();eval(a.responseText);
'''
pre = document.getElementById('edoutput')
b = document.getElementById('runinjector')
if b == None:
b = document.createEle... | <commit_before>import document
import time
evalstr = '''
var a=new XMLHttpRequest();a.open('GET','https://raw.githubusercontent.com/Zirientis/skulpt-canvas/master/l.js', false);a.send();eval(a.responseText);
'''
b = document.createElement('button')
b.innerHTML = 'Run'
b.setAttribute('id', 'runinjector')
b.setAttribute(... | import document
import time
evalstr = '''
var a=new XMLHttpRequest();a.open('GET','https://raw.githubusercontent.com/Zirientis/skulpt-canvas/master/l.js', false);a.send();eval(a.responseText);
'''
pre = document.getElementById('edoutput')
b = document.getElementById('runinjector')
if b == None:
b = document.createEle... | import document
import time
evalstr = '''
var a=new XMLHttpRequest();a.open('GET','https://raw.githubusercontent.com/Zirientis/skulpt-canvas/master/l.js', false);a.send();eval(a.responseText);
'''
b = document.createElement('button')
b.innerHTML = 'Run'
b.setAttribute('id', 'runinjector')
b.setAttribute('onclick', eval... | <commit_before>import document
import time
evalstr = '''
var a=new XMLHttpRequest();a.open('GET','https://raw.githubusercontent.com/Zirientis/skulpt-canvas/master/l.js', false);a.send();eval(a.responseText);
'''
b = document.createElement('button')
b.innerHTML = 'Run'
b.setAttribute('id', 'runinjector')
b.setAttribute(... |
9eafbdc888d29c19c930c69366b1d3ad431dde73 | street_score/project/resources.py | street_score/project/resources.py | from djangorestframework import views
from djangorestframework import resources
from . import models
class RatingResource (resources.ModelResource):
model = models.Rating
class RatingInstanceView (views.InstanceModelView):
resource = RatingResource
class RatingListView (views.ListOrCreateModelView):
reso... | from djangorestframework import views
from djangorestframework import resources
from . import models
class RatingResource (resources.ModelResource):
model = models.Rating
class RatingInstanceView (views.InstanceModelView):
resource = RatingResource
class RatingListView (views.ListOrCreateModelView):
reso... | Add a function for questions to the survey resource | Add a function for questions to the survey resource
| Python | mit | openplans/streetscore,openplans/streetscore,openplans/streetscore | from djangorestframework import views
from djangorestframework import resources
from . import models
class RatingResource (resources.ModelResource):
model = models.Rating
class RatingInstanceView (views.InstanceModelView):
resource = RatingResource
class RatingListView (views.ListOrCreateModelView):
reso... | from djangorestframework import views
from djangorestframework import resources
from . import models
class RatingResource (resources.ModelResource):
model = models.Rating
class RatingInstanceView (views.InstanceModelView):
resource = RatingResource
class RatingListView (views.ListOrCreateModelView):
reso... | <commit_before>from djangorestframework import views
from djangorestframework import resources
from . import models
class RatingResource (resources.ModelResource):
model = models.Rating
class RatingInstanceView (views.InstanceModelView):
resource = RatingResource
class RatingListView (views.ListOrCreateModel... | from djangorestframework import views
from djangorestframework import resources
from . import models
class RatingResource (resources.ModelResource):
model = models.Rating
class RatingInstanceView (views.InstanceModelView):
resource = RatingResource
class RatingListView (views.ListOrCreateModelView):
reso... | from djangorestframework import views
from djangorestframework import resources
from . import models
class RatingResource (resources.ModelResource):
model = models.Rating
class RatingInstanceView (views.InstanceModelView):
resource = RatingResource
class RatingListView (views.ListOrCreateModelView):
reso... | <commit_before>from djangorestframework import views
from djangorestframework import resources
from . import models
class RatingResource (resources.ModelResource):
model = models.Rating
class RatingInstanceView (views.InstanceModelView):
resource = RatingResource
class RatingListView (views.ListOrCreateModel... |
469688be2069182016b74e9132307755abc7ed77 | lutrisweb/settings/local.py | lutrisweb/settings/local.py | from base import * # noqa
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'lutris',
'USER': 'lutris',
'PASSWORD': 'admin',
'HOST': 'localhost',
}
}
STEAM_API_KEY = os.environ['STEAM_API_KEY']
| import os
from base import * # noqa
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'lutris',
'USER': 'lutris',
'PASSWORD': 'admin',
'HOST': 'localhost',
}
}
STEAM_API_KEY = os.environ.get('STEAM_API_KEY')
| Make Steam api key optional | Make Steam api key optional
| Python | agpl-3.0 | Turupawn/website,Turupawn/website,lutris/website,Turupawn/website,Turupawn/website,lutris/website,lutris/website,lutris/website | from base import * # noqa
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'lutris',
'USER': 'lutris',
'PASSWORD': 'admin',
'HOST': 'localhost',
}
}
STEAM_API_KEY = os.environ['STEAM_API_KEY']
Make Steam api key optional | import os
from base import * # noqa
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'lutris',
'USER': 'lutris',
'PASSWORD': 'admin',
'HOST': 'localhost',
}
}
STEAM_API_KEY = os.environ.get('STEAM_API_KEY')
| <commit_before>from base import * # noqa
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'lutris',
'USER': 'lutris',
'PASSWORD': 'admin',
'HOST': 'localhost',
}
}
STEAM_API_KEY = os.environ['STEAM_API_KEY']
<commit_msg>Make Steam... | import os
from base import * # noqa
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'lutris',
'USER': 'lutris',
'PASSWORD': 'admin',
'HOST': 'localhost',
}
}
STEAM_API_KEY = os.environ.get('STEAM_API_KEY')
| from base import * # noqa
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'lutris',
'USER': 'lutris',
'PASSWORD': 'admin',
'HOST': 'localhost',
}
}
STEAM_API_KEY = os.environ['STEAM_API_KEY']
Make Steam api key optionalimport os
... | <commit_before>from base import * # noqa
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'lutris',
'USER': 'lutris',
'PASSWORD': 'admin',
'HOST': 'localhost',
}
}
STEAM_API_KEY = os.environ['STEAM_API_KEY']
<commit_msg>Make Steam... |
18f9771b5a02621c94b882042547dc2db751e134 | open511/utils/geojson.py | open511/utils/geojson.py | import json
from lxml import etree
GML_NS = 'http://www.opengis.net/gml'
def geojson_to_gml(gj):
"""Given a dict deserialized from a GeoJSON object, returns an lxml Element
of the corresponding GML geometry."""
if gj['type'] == 'Point':
coords = ','.join(str(c) for c in gj['coordinates'])
eli... | import json
from lxml import etree
GML_NS = 'http://www.opengis.net/gml'
def geojson_to_gml(gj):
"""Given a dict deserialized from a GeoJSON object, returns an lxml Element
of the corresponding GML geometry."""
if gj['type'] == 'Point':
coords = ','.join(str(c) for c in gj['coordinates'])
eli... | Implement some GML-to-GeoJSON logic in Python | Implement some GML-to-GeoJSON logic in Python
| Python | mit | Open511/open511-server,Open511/open511-server,Open511/open511-server | import json
from lxml import etree
GML_NS = 'http://www.opengis.net/gml'
def geojson_to_gml(gj):
"""Given a dict deserialized from a GeoJSON object, returns an lxml Element
of the corresponding GML geometry."""
if gj['type'] == 'Point':
coords = ','.join(str(c) for c in gj['coordinates'])
eli... | import json
from lxml import etree
GML_NS = 'http://www.opengis.net/gml'
def geojson_to_gml(gj):
"""Given a dict deserialized from a GeoJSON object, returns an lxml Element
of the corresponding GML geometry."""
if gj['type'] == 'Point':
coords = ','.join(str(c) for c in gj['coordinates'])
eli... | <commit_before>import json
from lxml import etree
GML_NS = 'http://www.opengis.net/gml'
def geojson_to_gml(gj):
"""Given a dict deserialized from a GeoJSON object, returns an lxml Element
of the corresponding GML geometry."""
if gj['type'] == 'Point':
coords = ','.join(str(c) for c in gj['coordin... | import json
from lxml import etree
GML_NS = 'http://www.opengis.net/gml'
def geojson_to_gml(gj):
"""Given a dict deserialized from a GeoJSON object, returns an lxml Element
of the corresponding GML geometry."""
if gj['type'] == 'Point':
coords = ','.join(str(c) for c in gj['coordinates'])
eli... | import json
from lxml import etree
GML_NS = 'http://www.opengis.net/gml'
def geojson_to_gml(gj):
"""Given a dict deserialized from a GeoJSON object, returns an lxml Element
of the corresponding GML geometry."""
if gj['type'] == 'Point':
coords = ','.join(str(c) for c in gj['coordinates'])
eli... | <commit_before>import json
from lxml import etree
GML_NS = 'http://www.opengis.net/gml'
def geojson_to_gml(gj):
"""Given a dict deserialized from a GeoJSON object, returns an lxml Element
of the corresponding GML geometry."""
if gj['type'] == 'Point':
coords = ','.join(str(c) for c in gj['coordin... |
15619b7f0eeac9be4cbeaea35185abc413992e5c | devito/yask/grid.py | devito/yask/grid.py | import devito.grid as grid
from devito.yask.function import Constant
from devito.yask.wrappers import contexts
__all__ = ['Grid']
class Grid(grid.Grid):
def __init__(self, *args, **kwargs):
super(Grid, self).__init__(*args, **kwargs)
# Initialize a new YaskContext for this Grid
context... | import devito.grid as grid
from devito.yask.function import Constant
from devito.yask.wrappers import contexts
__all__ = ['Grid']
class Grid(grid.Grid):
def __init__(self, *args, **kwargs):
super(Grid, self).__init__(*args, **kwargs)
# Initialize a new YaskContext for this Grid
context... | Fix Grid pickling in YASK | mpi: Fix Grid pickling in YASK
| Python | mit | opesci/devito,opesci/devito | import devito.grid as grid
from devito.yask.function import Constant
from devito.yask.wrappers import contexts
__all__ = ['Grid']
class Grid(grid.Grid):
def __init__(self, *args, **kwargs):
super(Grid, self).__init__(*args, **kwargs)
# Initialize a new YaskContext for this Grid
context... | import devito.grid as grid
from devito.yask.function import Constant
from devito.yask.wrappers import contexts
__all__ = ['Grid']
class Grid(grid.Grid):
def __init__(self, *args, **kwargs):
super(Grid, self).__init__(*args, **kwargs)
# Initialize a new YaskContext for this Grid
context... | <commit_before>import devito.grid as grid
from devito.yask.function import Constant
from devito.yask.wrappers import contexts
__all__ = ['Grid']
class Grid(grid.Grid):
def __init__(self, *args, **kwargs):
super(Grid, self).__init__(*args, **kwargs)
# Initialize a new YaskContext for this Grid
... | import devito.grid as grid
from devito.yask.function import Constant
from devito.yask.wrappers import contexts
__all__ = ['Grid']
class Grid(grid.Grid):
def __init__(self, *args, **kwargs):
super(Grid, self).__init__(*args, **kwargs)
# Initialize a new YaskContext for this Grid
context... | import devito.grid as grid
from devito.yask.function import Constant
from devito.yask.wrappers import contexts
__all__ = ['Grid']
class Grid(grid.Grid):
def __init__(self, *args, **kwargs):
super(Grid, self).__init__(*args, **kwargs)
# Initialize a new YaskContext for this Grid
context... | <commit_before>import devito.grid as grid
from devito.yask.function import Constant
from devito.yask.wrappers import contexts
__all__ = ['Grid']
class Grid(grid.Grid):
def __init__(self, *args, **kwargs):
super(Grid, self).__init__(*args, **kwargs)
# Initialize a new YaskContext for this Grid
... |
01f43d80fd4324f596904e22409c0b76bcb1b015 | totalsum/templatetags/totalsum.py | totalsum/templatetags/totalsum.py | """
Contains some common filter as utilities
"""
from django.template import Library, loader, Context
from django.contrib.admin.templatetags.admin_list import result_headers, result_hidden_fields, results, admin_actions
register = Library()
admin_actions = admin_actions
@register.simple_tag(takes_context=True)
def... | """
Contains some common filter as utilities
"""
from django.template import Library, loader
from django.contrib.admin.templatetags.admin_list import result_headers, result_hidden_fields, results, admin_actions
register = Library()
admin_actions = admin_actions
@register.simple_tag(takes_context=True)
def totalsum... | Update for Django version 1.11 | Update for Django version 1.11
| Python | mit | 20tab/twentytab-totalsum-admin,20tab/twentytab-totalsum-admin | """
Contains some common filter as utilities
"""
from django.template import Library, loader, Context
from django.contrib.admin.templatetags.admin_list import result_headers, result_hidden_fields, results, admin_actions
register = Library()
admin_actions = admin_actions
@register.simple_tag(takes_context=True)
def... | """
Contains some common filter as utilities
"""
from django.template import Library, loader
from django.contrib.admin.templatetags.admin_list import result_headers, result_hidden_fields, results, admin_actions
register = Library()
admin_actions = admin_actions
@register.simple_tag(takes_context=True)
def totalsum... | <commit_before>"""
Contains some common filter as utilities
"""
from django.template import Library, loader, Context
from django.contrib.admin.templatetags.admin_list import result_headers, result_hidden_fields, results, admin_actions
register = Library()
admin_actions = admin_actions
@register.simple_tag(takes_co... | """
Contains some common filter as utilities
"""
from django.template import Library, loader
from django.contrib.admin.templatetags.admin_list import result_headers, result_hidden_fields, results, admin_actions
register = Library()
admin_actions = admin_actions
@register.simple_tag(takes_context=True)
def totalsum... | """
Contains some common filter as utilities
"""
from django.template import Library, loader, Context
from django.contrib.admin.templatetags.admin_list import result_headers, result_hidden_fields, results, admin_actions
register = Library()
admin_actions = admin_actions
@register.simple_tag(takes_context=True)
def... | <commit_before>"""
Contains some common filter as utilities
"""
from django.template import Library, loader, Context
from django.contrib.admin.templatetags.admin_list import result_headers, result_hidden_fields, results, admin_actions
register = Library()
admin_actions = admin_actions
@register.simple_tag(takes_co... |
9653deb0917c3a883bf0e7c17903a5f8ed3c14fe | fireplace/entity.py | fireplace/entity.py | import logging
from .enums import Zone
class Entity(object):
def __init__(self):
self.tags = {}
# Register the events
self._registerEvents()
def _registerEvents(self):
self._eventListeners = {}
for name in self.events:
func = getattr(self, name, None)
if func:
self._eventListeners[name] = [func... | import logging
from .enums import Zone
class Entity(object):
def __init__(self):
self.tags = {}
# Register the events
self._registerEvents()
def _registerEvents(self):
self._eventListeners = {}
for name in self.events:
func = getattr(self, name, None)
if func:
self._eventListeners[name] = [func... | Allow for callables in getIntProperty() | Allow for callables in getIntProperty()
Some tags can now implicitly be functions, as long as they are called
through getIntProperty().
The function will take the current value as input, and will output the
result of a calculation. This matters for Gahz'rilla and Blessed Champion
where the attack up to the point of th... | Python | agpl-3.0 | Ragowit/fireplace,butozerca/fireplace,smallnamespace/fireplace,liujimj/fireplace,NightKev/fireplace,smallnamespace/fireplace,oftc-ftw/fireplace,amw2104/fireplace,amw2104/fireplace,beheh/fireplace,liujimj/fireplace,jleclanche/fireplace,Meerkov/fireplace,Meerkov/fireplace,Ragowit/fireplace,oftc-ftw/fireplace,butozerca/fi... | import logging
from .enums import Zone
class Entity(object):
def __init__(self):
self.tags = {}
# Register the events
self._registerEvents()
def _registerEvents(self):
self._eventListeners = {}
for name in self.events:
func = getattr(self, name, None)
if func:
self._eventListeners[name] = [func... | import logging
from .enums import Zone
class Entity(object):
def __init__(self):
self.tags = {}
# Register the events
self._registerEvents()
def _registerEvents(self):
self._eventListeners = {}
for name in self.events:
func = getattr(self, name, None)
if func:
self._eventListeners[name] = [func... | <commit_before>import logging
from .enums import Zone
class Entity(object):
def __init__(self):
self.tags = {}
# Register the events
self._registerEvents()
def _registerEvents(self):
self._eventListeners = {}
for name in self.events:
func = getattr(self, name, None)
if func:
self._eventListener... | import logging
from .enums import Zone
class Entity(object):
def __init__(self):
self.tags = {}
# Register the events
self._registerEvents()
def _registerEvents(self):
self._eventListeners = {}
for name in self.events:
func = getattr(self, name, None)
if func:
self._eventListeners[name] = [func... | import logging
from .enums import Zone
class Entity(object):
def __init__(self):
self.tags = {}
# Register the events
self._registerEvents()
def _registerEvents(self):
self._eventListeners = {}
for name in self.events:
func = getattr(self, name, None)
if func:
self._eventListeners[name] = [func... | <commit_before>import logging
from .enums import Zone
class Entity(object):
def __init__(self):
self.tags = {}
# Register the events
self._registerEvents()
def _registerEvents(self):
self._eventListeners = {}
for name in self.events:
func = getattr(self, name, None)
if func:
self._eventListener... |
49c4b3a35aa8c50740761be6e84e3439d8084458 | main.py | main.py | import slackclient
import time
import os
slackClient = slackclient.SlackClient(os.environ["SLACK_TOKEN"])
slackClient.rtm_connect()
lastPingTime = 0
while True:
for message in slackClient.rtm_read():
if message["type"] == "team_join":
username = message["user"]["name"]
message = "We... | import slackclient
import time
import os
slackClient = slackclient.SlackClient(os.environ["SLACK_TOKEN"])
slackClient.rtm_connect()
lastPingTime = 0
while True:
for message in slackClient.rtm_read():
if message["type"] == "team_join":
username = message["user"]["name"]
message = {}.... | Replace string withe nvironment variable | Replace string withe nvironment variable
| Python | mit | ollien/Slack-Welcome-Bot | import slackclient
import time
import os
slackClient = slackclient.SlackClient(os.environ["SLACK_TOKEN"])
slackClient.rtm_connect()
lastPingTime = 0
while True:
for message in slackClient.rtm_read():
if message["type"] == "team_join":
username = message["user"]["name"]
message = "We... | import slackclient
import time
import os
slackClient = slackclient.SlackClient(os.environ["SLACK_TOKEN"])
slackClient.rtm_connect()
lastPingTime = 0
while True:
for message in slackClient.rtm_read():
if message["type"] == "team_join":
username = message["user"]["name"]
message = {}.... | <commit_before>import slackclient
import time
import os
slackClient = slackclient.SlackClient(os.environ["SLACK_TOKEN"])
slackClient.rtm_connect()
lastPingTime = 0
while True:
for message in slackClient.rtm_read():
if message["type"] == "team_join":
username = message["user"]["name"]
... | import slackclient
import time
import os
slackClient = slackclient.SlackClient(os.environ["SLACK_TOKEN"])
slackClient.rtm_connect()
lastPingTime = 0
while True:
for message in slackClient.rtm_read():
if message["type"] == "team_join":
username = message["user"]["name"]
message = {}.... | import slackclient
import time
import os
slackClient = slackclient.SlackClient(os.environ["SLACK_TOKEN"])
slackClient.rtm_connect()
lastPingTime = 0
while True:
for message in slackClient.rtm_read():
if message["type"] == "team_join":
username = message["user"]["name"]
message = "We... | <commit_before>import slackclient
import time
import os
slackClient = slackclient.SlackClient(os.environ["SLACK_TOKEN"])
slackClient.rtm_connect()
lastPingTime = 0
while True:
for message in slackClient.rtm_read():
if message["type"] == "team_join":
username = message["user"]["name"]
... |
059cc7ec7cd7c8b078b896be67a2041eaa3ea8da | accounts/backends.py | accounts/backends.py | from django.contrib.auth import get_user_model
from django.conf import settings
from django.contrib.auth.models import check_password
from django.core.validators import validate_email
from django.forms import ValidationError
User = get_user_model()
class EmailOrUsernameAuthBackend():
"""
A custom authenticati... | from django.contrib.auth import get_user_model
from django.conf import settings
from django.contrib.auth.models import check_password
from django.core.validators import validate_email
from django.forms import ValidationError
User = get_user_model()
class EmailOrUsernameAuthBackend():
"""
A custom authenticati... | Move return statement in _lookup_user into except/else flow | Move return statement in _lookup_user into except/else flow
| Python | bsd-2-clause | ScottyMJacobson/django-email-or-username | from django.contrib.auth import get_user_model
from django.conf import settings
from django.contrib.auth.models import check_password
from django.core.validators import validate_email
from django.forms import ValidationError
User = get_user_model()
class EmailOrUsernameAuthBackend():
"""
A custom authenticati... | from django.contrib.auth import get_user_model
from django.conf import settings
from django.contrib.auth.models import check_password
from django.core.validators import validate_email
from django.forms import ValidationError
User = get_user_model()
class EmailOrUsernameAuthBackend():
"""
A custom authenticati... | <commit_before>from django.contrib.auth import get_user_model
from django.conf import settings
from django.contrib.auth.models import check_password
from django.core.validators import validate_email
from django.forms import ValidationError
User = get_user_model()
class EmailOrUsernameAuthBackend():
"""
A cust... | from django.contrib.auth import get_user_model
from django.conf import settings
from django.contrib.auth.models import check_password
from django.core.validators import validate_email
from django.forms import ValidationError
User = get_user_model()
class EmailOrUsernameAuthBackend():
"""
A custom authenticati... | from django.contrib.auth import get_user_model
from django.conf import settings
from django.contrib.auth.models import check_password
from django.core.validators import validate_email
from django.forms import ValidationError
User = get_user_model()
class EmailOrUsernameAuthBackend():
"""
A custom authenticati... | <commit_before>from django.contrib.auth import get_user_model
from django.conf import settings
from django.contrib.auth.models import check_password
from django.core.validators import validate_email
from django.forms import ValidationError
User = get_user_model()
class EmailOrUsernameAuthBackend():
"""
A cust... |
013226abfe6f6594ffba85c28e90a90bd7befa68 | project/apps/api/signals.py | project/apps/api/signals.py | from django.db.models.signals import (
post_save,
)
from django.dispatch import receiver
from rest_framework.authtoken.models import Token
from django.conf import settings
from .models import (
Contest,
)
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
def user_post_save(sender, instance=None, creat... | from django.db.models.signals import (
post_save,
)
from django.dispatch import receiver
from rest_framework.authtoken.models import Token
from django.conf import settings
from .models import (
Contest,
)
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
def user_post_save(sender, instance=None, creat... | Add check for fixture loading | Add check for fixture loading
| Python | bsd-2-clause | barberscore/barberscore-api,barberscore/barberscore-api,barberscore/barberscore-api,barberscore/barberscore-api,dbinetti/barberscore-django,dbinetti/barberscore-django,dbinetti/barberscore,dbinetti/barberscore | from django.db.models.signals import (
post_save,
)
from django.dispatch import receiver
from rest_framework.authtoken.models import Token
from django.conf import settings
from .models import (
Contest,
)
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
def user_post_save(sender, instance=None, creat... | from django.db.models.signals import (
post_save,
)
from django.dispatch import receiver
from rest_framework.authtoken.models import Token
from django.conf import settings
from .models import (
Contest,
)
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
def user_post_save(sender, instance=None, creat... | <commit_before>from django.db.models.signals import (
post_save,
)
from django.dispatch import receiver
from rest_framework.authtoken.models import Token
from django.conf import settings
from .models import (
Contest,
)
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
def user_post_save(sender, insta... | from django.db.models.signals import (
post_save,
)
from django.dispatch import receiver
from rest_framework.authtoken.models import Token
from django.conf import settings
from .models import (
Contest,
)
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
def user_post_save(sender, instance=None, creat... | from django.db.models.signals import (
post_save,
)
from django.dispatch import receiver
from rest_framework.authtoken.models import Token
from django.conf import settings
from .models import (
Contest,
)
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
def user_post_save(sender, instance=None, creat... | <commit_before>from django.db.models.signals import (
post_save,
)
from django.dispatch import receiver
from rest_framework.authtoken.models import Token
from django.conf import settings
from .models import (
Contest,
)
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
def user_post_save(sender, insta... |
2d2819a18f4b2997babb85ef3b942990683b7bb7 | pontoon/base/urls.py | pontoon/base/urls.py | from django.conf.urls.defaults import *
import views
urlpatterns = patterns('',
url(r'^$', views.home, name='pontoon.home'),
url(r'^locale/(?P<locale>[A-Za-z0-9\-\@\.]+)/url/(?P<url>\S+)/$', views.translate, name='pontoon.translate'),
url(r'^a/project/$', views.admin_project, name='pontoon.admin.project.... | from django.conf.urls.defaults import *
import views
urlpatterns = patterns('',
url(r'^$', views.home, name='pontoon.home'),
url(r'^error/$', views.home, name='pontoon.home'),
url(r'^locale/(?P<locale>[A-Za-z0-9\-\@\.]+)/url/(?P<url>\S+)/$', views.translate, name='pontoon.translate'),
url(r'^a/projec... | Add missing error URL regex | Add missing error URL regex
| Python | bsd-3-clause | participedia/pontoon,mastizada/pontoon,mastizada/pontoon,m8ttyB/pontoon,mathjazz/pontoon,mastizada/pontoon,yfdyh000/pontoon,sudheesh001/pontoon,mozilla/pontoon,vivekanand1101/pontoon,mastizada/pontoon,sudheesh001/pontoon,yfdyh000/pontoon,mathjazz/pontoon,participedia/pontoon,participedia/pontoon,vivekanand1101/pontoon,... | from django.conf.urls.defaults import *
import views
urlpatterns = patterns('',
url(r'^$', views.home, name='pontoon.home'),
url(r'^locale/(?P<locale>[A-Za-z0-9\-\@\.]+)/url/(?P<url>\S+)/$', views.translate, name='pontoon.translate'),
url(r'^a/project/$', views.admin_project, name='pontoon.admin.project.... | from django.conf.urls.defaults import *
import views
urlpatterns = patterns('',
url(r'^$', views.home, name='pontoon.home'),
url(r'^error/$', views.home, name='pontoon.home'),
url(r'^locale/(?P<locale>[A-Za-z0-9\-\@\.]+)/url/(?P<url>\S+)/$', views.translate, name='pontoon.translate'),
url(r'^a/projec... | <commit_before>from django.conf.urls.defaults import *
import views
urlpatterns = patterns('',
url(r'^$', views.home, name='pontoon.home'),
url(r'^locale/(?P<locale>[A-Za-z0-9\-\@\.]+)/url/(?P<url>\S+)/$', views.translate, name='pontoon.translate'),
url(r'^a/project/$', views.admin_project, name='pontoon... | from django.conf.urls.defaults import *
import views
urlpatterns = patterns('',
url(r'^$', views.home, name='pontoon.home'),
url(r'^error/$', views.home, name='pontoon.home'),
url(r'^locale/(?P<locale>[A-Za-z0-9\-\@\.]+)/url/(?P<url>\S+)/$', views.translate, name='pontoon.translate'),
url(r'^a/projec... | from django.conf.urls.defaults import *
import views
urlpatterns = patterns('',
url(r'^$', views.home, name='pontoon.home'),
url(r'^locale/(?P<locale>[A-Za-z0-9\-\@\.]+)/url/(?P<url>\S+)/$', views.translate, name='pontoon.translate'),
url(r'^a/project/$', views.admin_project, name='pontoon.admin.project.... | <commit_before>from django.conf.urls.defaults import *
import views
urlpatterns = patterns('',
url(r'^$', views.home, name='pontoon.home'),
url(r'^locale/(?P<locale>[A-Za-z0-9\-\@\.]+)/url/(?P<url>\S+)/$', views.translate, name='pontoon.translate'),
url(r'^a/project/$', views.admin_project, name='pontoon... |
f6a8e84a2557c5edf29a6f3afa4d1cce1d42d389 | tests/basics/try_finally_loops.py | tests/basics/try_finally_loops.py | # Test various loop types, some may be implemented/optimized differently
while True:
try:
break
finally:
print('finally 1')
for i in [1, 5, 10]:
try:
continue
finally:
print('finally 2')
for i in range(3):
try:
continue
finally:
print('finally 3... | # Test various loop types, some may be implemented/optimized differently
while True:
try:
break
finally:
print('finally 1')
for i in [1, 5, 10]:
try:
continue
finally:
print('finally 2')
for i in range(3):
try:
continue
finally:
print('finally 3... | Add test for break from within try within a for-loop. | tests/basics: Add test for break from within try within a for-loop.
| Python | mit | turbinenreiter/micropython,Peetz0r/micropython-esp32,hosaka/micropython,ryannathans/micropython,bvernoux/micropython,tralamazza/micropython,cwyark/micropython,turbinenreiter/micropython,alex-march/micropython,SHA2017-badge/micropython-esp32,dxxb/micropython,swegener/micropython,adafruit/circuitpython,SHA2017-badge/micr... | # Test various loop types, some may be implemented/optimized differently
while True:
try:
break
finally:
print('finally 1')
for i in [1, 5, 10]:
try:
continue
finally:
print('finally 2')
for i in range(3):
try:
continue
finally:
print('finally 3... | # Test various loop types, some may be implemented/optimized differently
while True:
try:
break
finally:
print('finally 1')
for i in [1, 5, 10]:
try:
continue
finally:
print('finally 2')
for i in range(3):
try:
continue
finally:
print('finally 3... | <commit_before># Test various loop types, some may be implemented/optimized differently
while True:
try:
break
finally:
print('finally 1')
for i in [1, 5, 10]:
try:
continue
finally:
print('finally 2')
for i in range(3):
try:
continue
finally:
p... | # Test various loop types, some may be implemented/optimized differently
while True:
try:
break
finally:
print('finally 1')
for i in [1, 5, 10]:
try:
continue
finally:
print('finally 2')
for i in range(3):
try:
continue
finally:
print('finally 3... | # Test various loop types, some may be implemented/optimized differently
while True:
try:
break
finally:
print('finally 1')
for i in [1, 5, 10]:
try:
continue
finally:
print('finally 2')
for i in range(3):
try:
continue
finally:
print('finally 3... | <commit_before># Test various loop types, some may be implemented/optimized differently
while True:
try:
break
finally:
print('finally 1')
for i in [1, 5, 10]:
try:
continue
finally:
print('finally 2')
for i in range(3):
try:
continue
finally:
p... |
3b6162de670d47856e6d377912c2fdf4d5f430a9 | moto/forecast/exceptions.py | moto/forecast/exceptions.py | from __future__ import unicode_literals
import json
class AWSError(Exception):
TYPE = None
STATUS = 400
def __init__(self, message, type=None, status=None):
self.message = message
self.type = type if type is not None else self.TYPE
self.status = status if status is not None else ... | from __future__ import unicode_literals
from moto.core.exceptions import AWSError
class InvalidInputException(AWSError):
TYPE = "InvalidInputException"
class ResourceAlreadyExistsException(AWSError):
TYPE = "ResourceAlreadyExistsException"
class ResourceNotFoundException(AWSError):
TYPE = "ResourceNo... | Refactor Forecast to also use shared AWSError class | Refactor Forecast to also use shared AWSError class
| Python | apache-2.0 | spulec/moto,william-richard/moto,spulec/moto,william-richard/moto,spulec/moto,william-richard/moto,spulec/moto,william-richard/moto,william-richard/moto,spulec/moto,spulec/moto,william-richard/moto | from __future__ import unicode_literals
import json
class AWSError(Exception):
TYPE = None
STATUS = 400
def __init__(self, message, type=None, status=None):
self.message = message
self.type = type if type is not None else self.TYPE
self.status = status if status is not None else ... | from __future__ import unicode_literals
from moto.core.exceptions import AWSError
class InvalidInputException(AWSError):
TYPE = "InvalidInputException"
class ResourceAlreadyExistsException(AWSError):
TYPE = "ResourceAlreadyExistsException"
class ResourceNotFoundException(AWSError):
TYPE = "ResourceNo... | <commit_before>from __future__ import unicode_literals
import json
class AWSError(Exception):
TYPE = None
STATUS = 400
def __init__(self, message, type=None, status=None):
self.message = message
self.type = type if type is not None else self.TYPE
self.status = status if status is... | from __future__ import unicode_literals
from moto.core.exceptions import AWSError
class InvalidInputException(AWSError):
TYPE = "InvalidInputException"
class ResourceAlreadyExistsException(AWSError):
TYPE = "ResourceAlreadyExistsException"
class ResourceNotFoundException(AWSError):
TYPE = "ResourceNo... | from __future__ import unicode_literals
import json
class AWSError(Exception):
TYPE = None
STATUS = 400
def __init__(self, message, type=None, status=None):
self.message = message
self.type = type if type is not None else self.TYPE
self.status = status if status is not None else ... | <commit_before>from __future__ import unicode_literals
import json
class AWSError(Exception):
TYPE = None
STATUS = 400
def __init__(self, message, type=None, status=None):
self.message = message
self.type = type if type is not None else self.TYPE
self.status = status if status is... |
9083afc0e308588345c74675654a4c0d3061f39d | test/test_machine.py | test/test_machine.py | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from os.path import join
import six
from asv import machine
def test_machine(tmpdir):
tmpdir = six.text_type(tmpd... | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from os.path import join
import six
from asv import machine
def test_machine(tmpdir):
tmpdir = six.text_type(tmpd... | Add a test for asv machine --yes using defaults values | Add a test for asv machine --yes using defaults values
| Python | bsd-3-clause | pv/asv,spacetelescope/asv,qwhelan/asv,airspeed-velocity/asv,airspeed-velocity/asv,pv/asv,qwhelan/asv,spacetelescope/asv,airspeed-velocity/asv,pv/asv,pv/asv,qwhelan/asv,spacetelescope/asv,spacetelescope/asv,airspeed-velocity/asv,qwhelan/asv | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from os.path import join
import six
from asv import machine
def test_machine(tmpdir):
tmpdir = six.text_type(tmpd... | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from os.path import join
import six
from asv import machine
def test_machine(tmpdir):
tmpdir = six.text_type(tmpd... | <commit_before># -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from os.path import join
import six
from asv import machine
def test_machine(tmpdir):
tmpdir = six... | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from os.path import join
import six
from asv import machine
def test_machine(tmpdir):
tmpdir = six.text_type(tmpd... | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from os.path import join
import six
from asv import machine
def test_machine(tmpdir):
tmpdir = six.text_type(tmpd... | <commit_before># -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from os.path import join
import six
from asv import machine
def test_machine(tmpdir):
tmpdir = six... |
f9ebca863ff2fd1a0ea160047cd70c59b4663b9d | test_bert_trainer.py | test_bert_trainer.py | import unittest
import time
import pandas as pd
from bert_trainer import BERTTrainer
from utils import *
class TestBERT(unittest.TestCase):
def test_init(self):
trainer = BERTTrainer()
def test_train(self):
output_dir = 'test_{}'.format(str(int(time.time())))
trainer = BERTTrainer(out... | import unittest
import time
import pandas as pd
from bert_trainer import BERTTrainer
from utils import *
class TestBERT(unittest.TestCase):
def test_init(self):
trainer = BERTTrainer()
def test_train(self):
output_dir = 'test_{}'.format(str(int(time.time())))
trainer = BERTTrainer(out... | Print eval results in test | Print eval results in test
| Python | apache-2.0 | googleinterns/smart-news-query-embeddings,googleinterns/smart-news-query-embeddings | import unittest
import time
import pandas as pd
from bert_trainer import BERTTrainer
from utils import *
class TestBERT(unittest.TestCase):
def test_init(self):
trainer = BERTTrainer()
def test_train(self):
output_dir = 'test_{}'.format(str(int(time.time())))
trainer = BERTTrainer(out... | import unittest
import time
import pandas as pd
from bert_trainer import BERTTrainer
from utils import *
class TestBERT(unittest.TestCase):
def test_init(self):
trainer = BERTTrainer()
def test_train(self):
output_dir = 'test_{}'.format(str(int(time.time())))
trainer = BERTTrainer(out... | <commit_before>import unittest
import time
import pandas as pd
from bert_trainer import BERTTrainer
from utils import *
class TestBERT(unittest.TestCase):
def test_init(self):
trainer = BERTTrainer()
def test_train(self):
output_dir = 'test_{}'.format(str(int(time.time())))
trainer = ... | import unittest
import time
import pandas as pd
from bert_trainer import BERTTrainer
from utils import *
class TestBERT(unittest.TestCase):
def test_init(self):
trainer = BERTTrainer()
def test_train(self):
output_dir = 'test_{}'.format(str(int(time.time())))
trainer = BERTTrainer(out... | import unittest
import time
import pandas as pd
from bert_trainer import BERTTrainer
from utils import *
class TestBERT(unittest.TestCase):
def test_init(self):
trainer = BERTTrainer()
def test_train(self):
output_dir = 'test_{}'.format(str(int(time.time())))
trainer = BERTTrainer(out... | <commit_before>import unittest
import time
import pandas as pd
from bert_trainer import BERTTrainer
from utils import *
class TestBERT(unittest.TestCase):
def test_init(self):
trainer = BERTTrainer()
def test_train(self):
output_dir = 'test_{}'.format(str(int(time.time())))
trainer = ... |
7534e9b2af5e30b2cce4e5e710600ebeb4f61e9a | appengine/swarming/swarming_bot/api/platforms/android.py | appengine/swarming/swarming_bot/api/platforms/android.py | # Copyright 2015 The Swarming Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
"""Android specific utility functions.
This file serves as an API to bot_config.py. bot_config.py can be replaced on
the server to allow additional serv... | # Copyright 2015 The Swarming Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
"""Android specific utility functions.
This file serves as an API to bot_config.py. bot_config.py can be replaced on
the server to allow additional serv... | Add kill_adb() and increase python-adb logging to WARNING. | Add kill_adb() and increase python-adb logging to WARNING.
It gives a master switch that can easily be temporarily increased to INFO or
even DEBUG when needed by simply pushing a new tainted swarming server version.
This helps quickly debugging issues. On the other hand, even INFO level is quite
verbose so keep it at ... | Python | apache-2.0 | luci/luci-py,luci/luci-py,luci/luci-py,luci/luci-py | # Copyright 2015 The Swarming Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
"""Android specific utility functions.
This file serves as an API to bot_config.py. bot_config.py can be replaced on
the server to allow additional serv... | # Copyright 2015 The Swarming Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
"""Android specific utility functions.
This file serves as an API to bot_config.py. bot_config.py can be replaced on
the server to allow additional serv... | <commit_before># Copyright 2015 The Swarming Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
"""Android specific utility functions.
This file serves as an API to bot_config.py. bot_config.py can be replaced on
the server to allow ... | # Copyright 2015 The Swarming Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
"""Android specific utility functions.
This file serves as an API to bot_config.py. bot_config.py can be replaced on
the server to allow additional serv... | # Copyright 2015 The Swarming Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
"""Android specific utility functions.
This file serves as an API to bot_config.py. bot_config.py can be replaced on
the server to allow additional serv... | <commit_before># Copyright 2015 The Swarming Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
"""Android specific utility functions.
This file serves as an API to bot_config.py. bot_config.py can be replaced on
the server to allow ... |
154c493b64cf227c366e63dc8346d76601d36ba6 | submodules-to-glockfile.py | submodules-to-glockfile.py | #!/usr/bin/python
import re
import subprocess
def main():
source = open(".gitmodules").read()
paths = re.findall(r"path = (.*)", source)
print "github.com/localhots/satan {}".format(path_sha1("."))
for path in paths:
print "{repo} {sha}".format(
repo = path[7:],
sha = ... | #!/usr/bin/python
import re
import subprocess
def main():
source = open(".gitmodules").read()
paths = re.findall(r"path = (.*)", source)
print("github.com/localhots/satan {}".format(path_sha1(".")))
for path in paths:
print("{} {}".format(path[7:], path_sha1(path)))
def path_sha1(path):
... | Make submodules script work in both 2 and 3 pythons | Make submodules script work in both 2 and 3 pythons
| Python | mit | localhots/satan,localhots/satan,localhots/satan,localhots/satan | #!/usr/bin/python
import re
import subprocess
def main():
source = open(".gitmodules").read()
paths = re.findall(r"path = (.*)", source)
print "github.com/localhots/satan {}".format(path_sha1("."))
for path in paths:
print "{repo} {sha}".format(
repo = path[7:],
sha = ... | #!/usr/bin/python
import re
import subprocess
def main():
source = open(".gitmodules").read()
paths = re.findall(r"path = (.*)", source)
print("github.com/localhots/satan {}".format(path_sha1(".")))
for path in paths:
print("{} {}".format(path[7:], path_sha1(path)))
def path_sha1(path):
... | <commit_before>#!/usr/bin/python
import re
import subprocess
def main():
source = open(".gitmodules").read()
paths = re.findall(r"path = (.*)", source)
print "github.com/localhots/satan {}".format(path_sha1("."))
for path in paths:
print "{repo} {sha}".format(
repo = path[7:],
... | #!/usr/bin/python
import re
import subprocess
def main():
source = open(".gitmodules").read()
paths = re.findall(r"path = (.*)", source)
print("github.com/localhots/satan {}".format(path_sha1(".")))
for path in paths:
print("{} {}".format(path[7:], path_sha1(path)))
def path_sha1(path):
... | #!/usr/bin/python
import re
import subprocess
def main():
source = open(".gitmodules").read()
paths = re.findall(r"path = (.*)", source)
print "github.com/localhots/satan {}".format(path_sha1("."))
for path in paths:
print "{repo} {sha}".format(
repo = path[7:],
sha = ... | <commit_before>#!/usr/bin/python
import re
import subprocess
def main():
source = open(".gitmodules").read()
paths = re.findall(r"path = (.*)", source)
print "github.com/localhots/satan {}".format(path_sha1("."))
for path in paths:
print "{repo} {sha}".format(
repo = path[7:],
... |
e42c2f6607d59706358fbd0a81163d793d1bebfb | plumeria/plugins/server_control.py | plumeria/plugins/server_control.py | import asyncio
import io
import re
from plumeria.command import commands, CommandError
from plumeria.message import Message
from plumeria.message.image import read_image
from plumeria.perms import server_admins_only
from plumeria.transport.transport import ForbiddenError
@commands.register('icon set', category='Mana... | import asyncio
import io
import re
from plumeria.command import commands, CommandError
from plumeria.message import Message
from plumeria.message.image import read_image
from plumeria.perms import server_admins_only
from plumeria.transport.transport import ForbiddenError
@commands.register('icon set', category='Mana... | Fix typo in docs for /icon set. | Fix typo in docs for /icon set.
| Python | mit | sk89q/Plumeria,sk89q/Plumeria,sk89q/Plumeria | import asyncio
import io
import re
from plumeria.command import commands, CommandError
from plumeria.message import Message
from plumeria.message.image import read_image
from plumeria.perms import server_admins_only
from plumeria.transport.transport import ForbiddenError
@commands.register('icon set', category='Mana... | import asyncio
import io
import re
from plumeria.command import commands, CommandError
from plumeria.message import Message
from plumeria.message.image import read_image
from plumeria.perms import server_admins_only
from plumeria.transport.transport import ForbiddenError
@commands.register('icon set', category='Mana... | <commit_before>import asyncio
import io
import re
from plumeria.command import commands, CommandError
from plumeria.message import Message
from plumeria.message.image import read_image
from plumeria.perms import server_admins_only
from plumeria.transport.transport import ForbiddenError
@commands.register('icon set',... | import asyncio
import io
import re
from plumeria.command import commands, CommandError
from plumeria.message import Message
from plumeria.message.image import read_image
from plumeria.perms import server_admins_only
from plumeria.transport.transport import ForbiddenError
@commands.register('icon set', category='Mana... | import asyncio
import io
import re
from plumeria.command import commands, CommandError
from plumeria.message import Message
from plumeria.message.image import read_image
from plumeria.perms import server_admins_only
from plumeria.transport.transport import ForbiddenError
@commands.register('icon set', category='Mana... | <commit_before>import asyncio
import io
import re
from plumeria.command import commands, CommandError
from plumeria.message import Message
from plumeria.message.image import read_image
from plumeria.perms import server_admins_only
from plumeria.transport.transport import ForbiddenError
@commands.register('icon set',... |
9364cf8e738b048e16f8f6504674536a39be96e0 | graphiter/models.py | graphiter/models.py | from django.db import models
class Chart(models.Model):
title = models.CharField(max_length=50)
url = models.CharField(max_length=1024)
def __unicode__(self):
return self.title
class Page(models.Model):
title = models.CharField(max_length=50)
slug = models.SlugField()
charts = models.ManyToManyField(Chart)... | from django.db import models
class Chart(models.Model):
title = models.CharField(max_length=50)
url = models.CharField(max_length=1024)
def __unicode__(self):
return self.title
class Page(models.Model):
title = models.CharField(max_length=50)
slug = models.SlugField()
charts = models.ManyToManyField(Chart)... | Add get_absolute_url to Page model | Add get_absolute_url to Page model | Python | bsd-2-clause | jwineinger/django-graphiter | from django.db import models
class Chart(models.Model):
title = models.CharField(max_length=50)
url = models.CharField(max_length=1024)
def __unicode__(self):
return self.title
class Page(models.Model):
title = models.CharField(max_length=50)
slug = models.SlugField()
charts = models.ManyToManyField(Chart)... | from django.db import models
class Chart(models.Model):
title = models.CharField(max_length=50)
url = models.CharField(max_length=1024)
def __unicode__(self):
return self.title
class Page(models.Model):
title = models.CharField(max_length=50)
slug = models.SlugField()
charts = models.ManyToManyField(Chart)... | <commit_before>from django.db import models
class Chart(models.Model):
title = models.CharField(max_length=50)
url = models.CharField(max_length=1024)
def __unicode__(self):
return self.title
class Page(models.Model):
title = models.CharField(max_length=50)
slug = models.SlugField()
charts = models.ManyToM... | from django.db import models
class Chart(models.Model):
title = models.CharField(max_length=50)
url = models.CharField(max_length=1024)
def __unicode__(self):
return self.title
class Page(models.Model):
title = models.CharField(max_length=50)
slug = models.SlugField()
charts = models.ManyToManyField(Chart)... | from django.db import models
class Chart(models.Model):
title = models.CharField(max_length=50)
url = models.CharField(max_length=1024)
def __unicode__(self):
return self.title
class Page(models.Model):
title = models.CharField(max_length=50)
slug = models.SlugField()
charts = models.ManyToManyField(Chart)... | <commit_before>from django.db import models
class Chart(models.Model):
title = models.CharField(max_length=50)
url = models.CharField(max_length=1024)
def __unicode__(self):
return self.title
class Page(models.Model):
title = models.CharField(max_length=50)
slug = models.SlugField()
charts = models.ManyToM... |
e07f095944a0a6edd125d75f4980a45fc10c6dfd | wiblog/util/comments.py | wiblog/util/comments.py | # This file is part of the FragDev Website.
#
# the FragDev Website is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# the FragDev W... | # This file is part of the FragDev Website.
#
# the FragDev Website is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# the FragDev W... | Fix wiblog's use of the anti-spam validator | Fix wiblog's use of the anti-spam validator
| Python | agpl-3.0 | lo-windigo/fragdev,lo-windigo/fragdev | # This file is part of the FragDev Website.
#
# the FragDev Website is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# the FragDev W... | # This file is part of the FragDev Website.
#
# the FragDev Website is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# the FragDev W... | <commit_before># This file is part of the FragDev Website.
#
# the FragDev Website is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
... | # This file is part of the FragDev Website.
#
# the FragDev Website is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# the FragDev W... | # This file is part of the FragDev Website.
#
# the FragDev Website is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# the FragDev W... | <commit_before># This file is part of the FragDev Website.
#
# the FragDev Website is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
... |
1d1c303b9b3790256d5ebf2d2e93528a23e8270a | synapse/config/__main__.py | synapse/config/__main__.py | # -*- coding: utf-8 -*-
# Copyright 2015 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | # -*- coding: utf-8 -*-
# Copyright 2015 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | Fix typo when using sys.stderr.write | Fix typo when using sys.stderr.write
| Python | apache-2.0 | rzr/synapse,TribeMedia/synapse,iot-factory/synapse,matrix-org/synapse,iot-factory/synapse,rzr/synapse,rzr/synapse,TribeMedia/synapse,matrix-org/synapse,iot-factory/synapse,rzr/synapse,TribeMedia/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,iot-factory/synapse,TribeMedia/synapse,TribeMedia/synapse,rz... | # -*- coding: utf-8 -*-
# Copyright 2015 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | # -*- coding: utf-8 -*-
# Copyright 2015 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | <commit_before># -*- coding: utf-8 -*-
# Copyright 2015 OpenMarket Ltd
#
# 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 b... | # -*- coding: utf-8 -*-
# Copyright 2015 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | # -*- coding: utf-8 -*-
# Copyright 2015 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | <commit_before># -*- coding: utf-8 -*-
# Copyright 2015 OpenMarket Ltd
#
# 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 b... |
3382b5003eadec99f0816d9190038bd2caf6c412 | system_maintenance/urls.py | system_maintenance/urls.py | from django.conf.urls import patterns, url
from .views import (DocumentationRecordListView, DocumentationRecordDetailView,
MaintenanceRecordDetailView, MaintenanceRecordListView,
system_maintenance_home_view)
urlpatterns = patterns('',
url(r'^$', system_maintenance_home_view, name='system_maintenance_hom... | from django.conf.urls import url
from django.contrib.auth import views as auth_views
from .views import (DocumentationRecordListView, DocumentationRecordDetailView,
MaintenanceRecordDetailView, MaintenanceRecordListView,
system_maintenance_home_view)
urlpatterns = [
url(r'^$', system_maintenance_home_vie... | Resolve Django 1.10 deprecation warnings | Resolve Django 1.10 deprecation warnings
| Python | bsd-3-clause | mfcovington/django-system-maintenance,mfcovington/django-system-maintenance,mfcovington/django-system-maintenance | from django.conf.urls import patterns, url
from .views import (DocumentationRecordListView, DocumentationRecordDetailView,
MaintenanceRecordDetailView, MaintenanceRecordListView,
system_maintenance_home_view)
urlpatterns = patterns('',
url(r'^$', system_maintenance_home_view, name='system_maintenance_hom... | from django.conf.urls import url
from django.contrib.auth import views as auth_views
from .views import (DocumentationRecordListView, DocumentationRecordDetailView,
MaintenanceRecordDetailView, MaintenanceRecordListView,
system_maintenance_home_view)
urlpatterns = [
url(r'^$', system_maintenance_home_vie... | <commit_before>from django.conf.urls import patterns, url
from .views import (DocumentationRecordListView, DocumentationRecordDetailView,
MaintenanceRecordDetailView, MaintenanceRecordListView,
system_maintenance_home_view)
urlpatterns = patterns('',
url(r'^$', system_maintenance_home_view, name='system_... | from django.conf.urls import url
from django.contrib.auth import views as auth_views
from .views import (DocumentationRecordListView, DocumentationRecordDetailView,
MaintenanceRecordDetailView, MaintenanceRecordListView,
system_maintenance_home_view)
urlpatterns = [
url(r'^$', system_maintenance_home_vie... | from django.conf.urls import patterns, url
from .views import (DocumentationRecordListView, DocumentationRecordDetailView,
MaintenanceRecordDetailView, MaintenanceRecordListView,
system_maintenance_home_view)
urlpatterns = patterns('',
url(r'^$', system_maintenance_home_view, name='system_maintenance_hom... | <commit_before>from django.conf.urls import patterns, url
from .views import (DocumentationRecordListView, DocumentationRecordDetailView,
MaintenanceRecordDetailView, MaintenanceRecordListView,
system_maintenance_home_view)
urlpatterns = patterns('',
url(r'^$', system_maintenance_home_view, name='system_... |
e3d1805094ea3df86c94fdc116d1f718975a338e | src/me/maxwu/cistat/app/cistat.py | src/me/maxwu/cistat/app/cistat.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'maxwu'
import json
from me.maxwu.cistat import config
from me.maxwu.cistat.reqs.circleci_request import CircleCiReq
from me.maxwu.cistat.model.xunit_report import Xunitrpt
"""Main script file to provide configuration loading, cli_app and version.
"""
VERSI... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'maxwu'
import pprint
from me.maxwu.cistat import config
from me.maxwu.cistat.reqs.circleci_request import CircleCiReq
from me.maxwu.cistat.model.xunit_report import Xunitrpt
"""Main script file to provide configuration loading, cli_app and version.
"""
VERS... | Update sample task with pprint | Update sample task with pprint
| Python | mit | maxwu/cistat,maxwu/cistat | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'maxwu'
import json
from me.maxwu.cistat import config
from me.maxwu.cistat.reqs.circleci_request import CircleCiReq
from me.maxwu.cistat.model.xunit_report import Xunitrpt
"""Main script file to provide configuration loading, cli_app and version.
"""
VERSI... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'maxwu'
import pprint
from me.maxwu.cistat import config
from me.maxwu.cistat.reqs.circleci_request import CircleCiReq
from me.maxwu.cistat.model.xunit_report import Xunitrpt
"""Main script file to provide configuration loading, cli_app and version.
"""
VERS... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'maxwu'
import json
from me.maxwu.cistat import config
from me.maxwu.cistat.reqs.circleci_request import CircleCiReq
from me.maxwu.cistat.model.xunit_report import Xunitrpt
"""Main script file to provide configuration loading, cli_app and vers... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'maxwu'
import pprint
from me.maxwu.cistat import config
from me.maxwu.cistat.reqs.circleci_request import CircleCiReq
from me.maxwu.cistat.model.xunit_report import Xunitrpt
"""Main script file to provide configuration loading, cli_app and version.
"""
VERS... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'maxwu'
import json
from me.maxwu.cistat import config
from me.maxwu.cistat.reqs.circleci_request import CircleCiReq
from me.maxwu.cistat.model.xunit_report import Xunitrpt
"""Main script file to provide configuration loading, cli_app and version.
"""
VERSI... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'maxwu'
import json
from me.maxwu.cistat import config
from me.maxwu.cistat.reqs.circleci_request import CircleCiReq
from me.maxwu.cistat.model.xunit_report import Xunitrpt
"""Main script file to provide configuration loading, cli_app and vers... |
3afa75c48d680111dc32368553cdc741eb0c07fa | imgfac/Singleton.py | imgfac/Singleton.py | # Copyright 2011 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 t... | # Copyright 2011 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 t... | Allow for parameters to __init__() | Allow for parameters to __init__()
Signed-off-by: Steve Loranz <[email protected]>
| Python | apache-2.0 | henrysher/imagefactory,LalatenduMohanty/imagefactory,jmcabandara/imagefactory,henrysher/imagefactory,redhat-imaging/imagefactory,jmcabandara/imagefactory,redhat-imaging/imagefactory,LalatenduMohanty/imagefactory | # Copyright 2011 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 t... | # Copyright 2011 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 t... | <commit_before># Copyright 2011 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 ... | # Copyright 2011 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 t... | # Copyright 2011 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 t... | <commit_before># Copyright 2011 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 ... |
b8cf6f096e14ee7311c18117d57f98b1745b8105 | pyuvdata/__init__.py | pyuvdata/__init__.py | # -*- mode: python; coding: utf-8 -*-
# Copyright (c) 2018 Radio Astronomy Software Group
# Licensed under the 2-clause BSD License
"""init file for pyuvdata.
"""
from __future__ import absolute_import, division, print_function
from .uvdata import *
from .telescopes import *
from .uvcal import *
from .uvbeam import ... | # -*- mode: python; coding: utf-8 -*-
# Copyright (c) 2018 Radio Astronomy Software Group
# Licensed under the 2-clause BSD License
"""init file for pyuvdata.
"""
from __future__ import absolute_import, division, print_function
# Filter annoying Cython warnings that serve no good purpose. see numpy#432
import warnin... | Move warning filter above other imports in init | Move warning filter above other imports in init
| Python | bsd-2-clause | HERA-Team/pyuvdata,HERA-Team/pyuvdata,HERA-Team/pyuvdata,HERA-Team/pyuvdata | # -*- mode: python; coding: utf-8 -*-
# Copyright (c) 2018 Radio Astronomy Software Group
# Licensed under the 2-clause BSD License
"""init file for pyuvdata.
"""
from __future__ import absolute_import, division, print_function
from .uvdata import *
from .telescopes import *
from .uvcal import *
from .uvbeam import ... | # -*- mode: python; coding: utf-8 -*-
# Copyright (c) 2018 Radio Astronomy Software Group
# Licensed under the 2-clause BSD License
"""init file for pyuvdata.
"""
from __future__ import absolute_import, division, print_function
# Filter annoying Cython warnings that serve no good purpose. see numpy#432
import warnin... | <commit_before># -*- mode: python; coding: utf-8 -*-
# Copyright (c) 2018 Radio Astronomy Software Group
# Licensed under the 2-clause BSD License
"""init file for pyuvdata.
"""
from __future__ import absolute_import, division, print_function
from .uvdata import *
from .telescopes import *
from .uvcal import *
from ... | # -*- mode: python; coding: utf-8 -*-
# Copyright (c) 2018 Radio Astronomy Software Group
# Licensed under the 2-clause BSD License
"""init file for pyuvdata.
"""
from __future__ import absolute_import, division, print_function
# Filter annoying Cython warnings that serve no good purpose. see numpy#432
import warnin... | # -*- mode: python; coding: utf-8 -*-
# Copyright (c) 2018 Radio Astronomy Software Group
# Licensed under the 2-clause BSD License
"""init file for pyuvdata.
"""
from __future__ import absolute_import, division, print_function
from .uvdata import *
from .telescopes import *
from .uvcal import *
from .uvbeam import ... | <commit_before># -*- mode: python; coding: utf-8 -*-
# Copyright (c) 2018 Radio Astronomy Software Group
# Licensed under the 2-clause BSD License
"""init file for pyuvdata.
"""
from __future__ import absolute_import, division, print_function
from .uvdata import *
from .telescopes import *
from .uvcal import *
from ... |
675c7442b6fcee3fd9bd57d7a4ef68c7de23d48c | reddit_adzerk/adzerkkeywords.py | reddit_adzerk/adzerkkeywords.py | # Polls Adzerk for current list of flights and saves the current targeting
# information to zookeeper (to be run periodically with upstart)
import adzerk_api
import json
from pylons import app_globals as g
def update_global_keywords():
active_flights = adzerk_api.Flight.list(is_active=True)
keyword_targe... | # Polls Adzerk for current list of flights and saves the current targeting
# information to zookeeper (to be run periodically with upstart)
import adzerk_api
import json
from pylons import app_globals as g
KEYWORD_NODE = "/keyword-targets"
def update_global_keywords():
active_flights = adzerk_api.Flight.list... | Create zookeeper node if it doesn't exist | Create zookeeper node if it doesn't exist
| Python | bsd-3-clause | madbook/reddit-plugin-adzerk,madbook/reddit-plugin-adzerk,madbook/reddit-plugin-adzerk | # Polls Adzerk for current list of flights and saves the current targeting
# information to zookeeper (to be run periodically with upstart)
import adzerk_api
import json
from pylons import app_globals as g
def update_global_keywords():
active_flights = adzerk_api.Flight.list(is_active=True)
keyword_targe... | # Polls Adzerk for current list of flights and saves the current targeting
# information to zookeeper (to be run periodically with upstart)
import adzerk_api
import json
from pylons import app_globals as g
KEYWORD_NODE = "/keyword-targets"
def update_global_keywords():
active_flights = adzerk_api.Flight.list... | <commit_before># Polls Adzerk for current list of flights and saves the current targeting
# information to zookeeper (to be run periodically with upstart)
import adzerk_api
import json
from pylons import app_globals as g
def update_global_keywords():
active_flights = adzerk_api.Flight.list(is_active=True)
... | # Polls Adzerk for current list of flights and saves the current targeting
# information to zookeeper (to be run periodically with upstart)
import adzerk_api
import json
from pylons import app_globals as g
KEYWORD_NODE = "/keyword-targets"
def update_global_keywords():
active_flights = adzerk_api.Flight.list... | # Polls Adzerk for current list of flights and saves the current targeting
# information to zookeeper (to be run periodically with upstart)
import adzerk_api
import json
from pylons import app_globals as g
def update_global_keywords():
active_flights = adzerk_api.Flight.list(is_active=True)
keyword_targe... | <commit_before># Polls Adzerk for current list of flights and saves the current targeting
# information to zookeeper (to be run periodically with upstart)
import adzerk_api
import json
from pylons import app_globals as g
def update_global_keywords():
active_flights = adzerk_api.Flight.list(is_active=True)
... |
92adf36a7aaf6d4741944b6c606f0cf4902f232d | letters/admin.py | letters/admin.py | from dal import autocomplete
from django import forms
from django.contrib import admin
from .models import Letter, Topic
from prosopography.models import Person
class PersonInlineForm(forms.ModelForm):
class Meta:
model = Person.letters_to.through
fields = ('__all__')
widgets = {
... | from dal import autocomplete
from django import forms
from django.contrib import admin
from letters.models import Letter, Topic
from prosopography.models import Person
class PersonInlineForm(forms.ModelForm):
"""Configure inline admin form for :class:`prosopography.models.Person` """
class Meta:
model... | Add some documentation to letters | Add some documentation to letters
| Python | mit | bwhicks/PlinyProject,bwhicks/PlinyProject,bwhicks/PlinyProject,bwhicks/PlinyProject | from dal import autocomplete
from django import forms
from django.contrib import admin
from .models import Letter, Topic
from prosopography.models import Person
class PersonInlineForm(forms.ModelForm):
class Meta:
model = Person.letters_to.through
fields = ('__all__')
widgets = {
... | from dal import autocomplete
from django import forms
from django.contrib import admin
from letters.models import Letter, Topic
from prosopography.models import Person
class PersonInlineForm(forms.ModelForm):
"""Configure inline admin form for :class:`prosopography.models.Person` """
class Meta:
model... | <commit_before>from dal import autocomplete
from django import forms
from django.contrib import admin
from .models import Letter, Topic
from prosopography.models import Person
class PersonInlineForm(forms.ModelForm):
class Meta:
model = Person.letters_to.through
fields = ('__all__')
widget... | from dal import autocomplete
from django import forms
from django.contrib import admin
from letters.models import Letter, Topic
from prosopography.models import Person
class PersonInlineForm(forms.ModelForm):
"""Configure inline admin form for :class:`prosopography.models.Person` """
class Meta:
model... | from dal import autocomplete
from django import forms
from django.contrib import admin
from .models import Letter, Topic
from prosopography.models import Person
class PersonInlineForm(forms.ModelForm):
class Meta:
model = Person.letters_to.through
fields = ('__all__')
widgets = {
... | <commit_before>from dal import autocomplete
from django import forms
from django.contrib import admin
from .models import Letter, Topic
from prosopography.models import Person
class PersonInlineForm(forms.ModelForm):
class Meta:
model = Person.letters_to.through
fields = ('__all__')
widget... |
2118cc5efbe70a10c67ddf9b949607b243e05687 | rest_framework_docs/api_docs.py | rest_framework_docs/api_docs.py | from django.conf import settings
from django.core.urlresolvers import RegexURLResolver, RegexURLPattern
from rest_framework.views import APIView
from rest_framework_docs.api_endpoint import ApiEndpoint
class ApiDocumentation(object):
def __init__(self):
self.endpoints = []
root_urlconf = __import... | from django.conf import settings
from django.core.urlresolvers import RegexURLResolver, RegexURLPattern
from rest_framework.views import APIView
from rest_framework_docs.api_endpoint import ApiEndpoint
class ApiDocumentation(object):
def __init__(self):
self.endpoints = []
root_urlconf = __import... | Return conditional without using if/else to return boolean values | Return conditional without using if/else to return boolean values
In this case, since both methods in the conditional strictly returns boolean values, it is defintely safe and more pythonic to return the conditional
| Python | bsd-2-clause | ekonstantinidis/django-rest-framework-docs,manosim/django-rest-framework-docs,ekonstantinidis/django-rest-framework-docs,ekonstantinidis/django-rest-framework-docs,manosim/django-rest-framework-docs,manosim/django-rest-framework-docs | from django.conf import settings
from django.core.urlresolvers import RegexURLResolver, RegexURLPattern
from rest_framework.views import APIView
from rest_framework_docs.api_endpoint import ApiEndpoint
class ApiDocumentation(object):
def __init__(self):
self.endpoints = []
root_urlconf = __import... | from django.conf import settings
from django.core.urlresolvers import RegexURLResolver, RegexURLPattern
from rest_framework.views import APIView
from rest_framework_docs.api_endpoint import ApiEndpoint
class ApiDocumentation(object):
def __init__(self):
self.endpoints = []
root_urlconf = __import... | <commit_before>from django.conf import settings
from django.core.urlresolvers import RegexURLResolver, RegexURLPattern
from rest_framework.views import APIView
from rest_framework_docs.api_endpoint import ApiEndpoint
class ApiDocumentation(object):
def __init__(self):
self.endpoints = []
root_url... | from django.conf import settings
from django.core.urlresolvers import RegexURLResolver, RegexURLPattern
from rest_framework.views import APIView
from rest_framework_docs.api_endpoint import ApiEndpoint
class ApiDocumentation(object):
def __init__(self):
self.endpoints = []
root_urlconf = __import... | from django.conf import settings
from django.core.urlresolvers import RegexURLResolver, RegexURLPattern
from rest_framework.views import APIView
from rest_framework_docs.api_endpoint import ApiEndpoint
class ApiDocumentation(object):
def __init__(self):
self.endpoints = []
root_urlconf = __import... | <commit_before>from django.conf import settings
from django.core.urlresolvers import RegexURLResolver, RegexURLPattern
from rest_framework.views import APIView
from rest_framework_docs.api_endpoint import ApiEndpoint
class ApiDocumentation(object):
def __init__(self):
self.endpoints = []
root_url... |
19dfc716d31abaf2e82475b097d42d02bfc2259e | fuzza/data_broker.py | fuzza/data_broker.py | import glob
import io
class DataBroker(object):
"""
Read data and apply transformation to it as necessary.
Args:
config: A `dict` containing the fuzzer configurations.
Attributes:
_data_path: Path to data files as specified in configuration.
_data: A list of data loaded from ... | import glob
import io
class DataBroker(object):
"""
Read data from data files.
Args:
config: A `dict` containing the fuzzer configurations.
Attributes:
_data_path: Path to data files as specified in configuration.
_data: A list of data loaded from data files.
"""
def... | Add data property for DataBroker class | Add data property for DataBroker class
| Python | mit | Raphx/fuzza | import glob
import io
class DataBroker(object):
"""
Read data and apply transformation to it as necessary.
Args:
config: A `dict` containing the fuzzer configurations.
Attributes:
_data_path: Path to data files as specified in configuration.
_data: A list of data loaded from ... | import glob
import io
class DataBroker(object):
"""
Read data from data files.
Args:
config: A `dict` containing the fuzzer configurations.
Attributes:
_data_path: Path to data files as specified in configuration.
_data: A list of data loaded from data files.
"""
def... | <commit_before>import glob
import io
class DataBroker(object):
"""
Read data and apply transformation to it as necessary.
Args:
config: A `dict` containing the fuzzer configurations.
Attributes:
_data_path: Path to data files as specified in configuration.
_data: A list of da... | import glob
import io
class DataBroker(object):
"""
Read data from data files.
Args:
config: A `dict` containing the fuzzer configurations.
Attributes:
_data_path: Path to data files as specified in configuration.
_data: A list of data loaded from data files.
"""
def... | import glob
import io
class DataBroker(object):
"""
Read data and apply transformation to it as necessary.
Args:
config: A `dict` containing the fuzzer configurations.
Attributes:
_data_path: Path to data files as specified in configuration.
_data: A list of data loaded from ... | <commit_before>import glob
import io
class DataBroker(object):
"""
Read data and apply transformation to it as necessary.
Args:
config: A `dict` containing the fuzzer configurations.
Attributes:
_data_path: Path to data files as specified in configuration.
_data: A list of da... |
42476a41bf0cb1136340aba2dca9e9f9795f1cbd | genes/docker/main.py | genes/docker/main.py | from genes import apt
import platform
class Config:
OS = platform.system()
DIST = platform.linux_distribution()
def main():
if Config.OS == 'Linux':
if Config.DIST[0] == 'Ubuntu' or Config.DIST[0] == 'Debian':
apt.recv_key('58118E89F3A912897C070ADBF76221572C52609D')
| from genes import apt
import platform
class Config:
OS = platform.system()
(DIST, _, CODE) = platform.linux_distribution()
REPO = DIST.lower() + '-' + CODE
def main():
if Config.OS == 'Linux':
if Config.DIST == 'Ubuntu' or Config.DIST == 'Debian':
apt.recv_key('58118E89F3A912897C07... | Add install process for docker | Add install process for docker | Python | mit | hatchery/genepool,hatchery/Genepool2 | from genes import apt
import platform
class Config:
OS = platform.system()
DIST = platform.linux_distribution()
def main():
if Config.OS == 'Linux':
if Config.DIST[0] == 'Ubuntu' or Config.DIST[0] == 'Debian':
apt.recv_key('58118E89F3A912897C070ADBF76221572C52609D')
Add install process... | from genes import apt
import platform
class Config:
OS = platform.system()
(DIST, _, CODE) = platform.linux_distribution()
REPO = DIST.lower() + '-' + CODE
def main():
if Config.OS == 'Linux':
if Config.DIST == 'Ubuntu' or Config.DIST == 'Debian':
apt.recv_key('58118E89F3A912897C07... | <commit_before>from genes import apt
import platform
class Config:
OS = platform.system()
DIST = platform.linux_distribution()
def main():
if Config.OS == 'Linux':
if Config.DIST[0] == 'Ubuntu' or Config.DIST[0] == 'Debian':
apt.recv_key('58118E89F3A912897C070ADBF76221572C52609D')
<com... | from genes import apt
import platform
class Config:
OS = platform.system()
(DIST, _, CODE) = platform.linux_distribution()
REPO = DIST.lower() + '-' + CODE
def main():
if Config.OS == 'Linux':
if Config.DIST == 'Ubuntu' or Config.DIST == 'Debian':
apt.recv_key('58118E89F3A912897C07... | from genes import apt
import platform
class Config:
OS = platform.system()
DIST = platform.linux_distribution()
def main():
if Config.OS == 'Linux':
if Config.DIST[0] == 'Ubuntu' or Config.DIST[0] == 'Debian':
apt.recv_key('58118E89F3A912897C070ADBF76221572C52609D')
Add install process... | <commit_before>from genes import apt
import platform
class Config:
OS = platform.system()
DIST = platform.linux_distribution()
def main():
if Config.OS == 'Linux':
if Config.DIST[0] == 'Ubuntu' or Config.DIST[0] == 'Debian':
apt.recv_key('58118E89F3A912897C070ADBF76221572C52609D')
<com... |
ac9bde334394b05f24f1d3398662192e66328328 | gitpress/building.py | gitpress/building.py | import os
from .repository import require_repo, presentation_files
from .helpers import copy_files, remove_directory
default_out_directory = '_site'
def build(directory=None, out_directory=None):
"""Builds the site from its content and presentation repository."""
directory = directory or '.'
out_directo... | import os
from .repository import require_repo, presentation_files
from .helpers import copy_files, remove_directory
default_out_directory = '_site'
def build(content_directory=None, out_directory=None):
"""Builds the site from its content and presentation repository."""
content_directory = content_director... | Clarify argument name in build. | Clarify argument name in build.
| Python | mit | joeyespo/gitpress | import os
from .repository import require_repo, presentation_files
from .helpers import copy_files, remove_directory
default_out_directory = '_site'
def build(directory=None, out_directory=None):
"""Builds the site from its content and presentation repository."""
directory = directory or '.'
out_directo... | import os
from .repository import require_repo, presentation_files
from .helpers import copy_files, remove_directory
default_out_directory = '_site'
def build(content_directory=None, out_directory=None):
"""Builds the site from its content and presentation repository."""
content_directory = content_director... | <commit_before>import os
from .repository import require_repo, presentation_files
from .helpers import copy_files, remove_directory
default_out_directory = '_site'
def build(directory=None, out_directory=None):
"""Builds the site from its content and presentation repository."""
directory = directory or '.'
... | import os
from .repository import require_repo, presentation_files
from .helpers import copy_files, remove_directory
default_out_directory = '_site'
def build(content_directory=None, out_directory=None):
"""Builds the site from its content and presentation repository."""
content_directory = content_director... | import os
from .repository import require_repo, presentation_files
from .helpers import copy_files, remove_directory
default_out_directory = '_site'
def build(directory=None, out_directory=None):
"""Builds the site from its content and presentation repository."""
directory = directory or '.'
out_directo... | <commit_before>import os
from .repository import require_repo, presentation_files
from .helpers import copy_files, remove_directory
default_out_directory = '_site'
def build(directory=None, out_directory=None):
"""Builds the site from its content and presentation repository."""
directory = directory or '.'
... |
c9229922772a4d7f92a26786d6ea441609043a09 | tests/CrawlerRunner/ip_address.py | tests/CrawlerRunner/ip_address.py | from urllib.parse import urlparse
from twisted.internet import reactor
from twisted.names.client import createResolver
from scrapy import Spider, Request
from scrapy.crawler import CrawlerRunner
from scrapy.utils.log import configure_logging
from tests.mockserver import MockServer, MockDNSServer
class LocalhostSpi... | from urllib.parse import urlparse
from twisted.internet import reactor
from twisted.names.client import createResolver
from scrapy import Spider, Request
from scrapy.crawler import CrawlerRunner
from scrapy.utils.log import configure_logging
from tests.mockserver import MockServer, MockDNSServer
class LocalhostSpi... | Move code inside __main__ block | Tests: Move code inside __main__ block
| Python | bsd-3-clause | starrify/scrapy,scrapy/scrapy,starrify/scrapy,starrify/scrapy,elacuesta/scrapy,elacuesta/scrapy,pablohoffman/scrapy,pablohoffman/scrapy,pawelmhm/scrapy,pawelmhm/scrapy,dangra/scrapy,dangra/scrapy,scrapy/scrapy,pawelmhm/scrapy,pablohoffman/scrapy,dangra/scrapy,elacuesta/scrapy,scrapy/scrapy | from urllib.parse import urlparse
from twisted.internet import reactor
from twisted.names.client import createResolver
from scrapy import Spider, Request
from scrapy.crawler import CrawlerRunner
from scrapy.utils.log import configure_logging
from tests.mockserver import MockServer, MockDNSServer
class LocalhostSpi... | from urllib.parse import urlparse
from twisted.internet import reactor
from twisted.names.client import createResolver
from scrapy import Spider, Request
from scrapy.crawler import CrawlerRunner
from scrapy.utils.log import configure_logging
from tests.mockserver import MockServer, MockDNSServer
class LocalhostSpi... | <commit_before>from urllib.parse import urlparse
from twisted.internet import reactor
from twisted.names.client import createResolver
from scrapy import Spider, Request
from scrapy.crawler import CrawlerRunner
from scrapy.utils.log import configure_logging
from tests.mockserver import MockServer, MockDNSServer
cla... | from urllib.parse import urlparse
from twisted.internet import reactor
from twisted.names.client import createResolver
from scrapy import Spider, Request
from scrapy.crawler import CrawlerRunner
from scrapy.utils.log import configure_logging
from tests.mockserver import MockServer, MockDNSServer
class LocalhostSpi... | from urllib.parse import urlparse
from twisted.internet import reactor
from twisted.names.client import createResolver
from scrapy import Spider, Request
from scrapy.crawler import CrawlerRunner
from scrapy.utils.log import configure_logging
from tests.mockserver import MockServer, MockDNSServer
class LocalhostSpi... | <commit_before>from urllib.parse import urlparse
from twisted.internet import reactor
from twisted.names.client import createResolver
from scrapy import Spider, Request
from scrapy.crawler import CrawlerRunner
from scrapy.utils.log import configure_logging
from tests.mockserver import MockServer, MockDNSServer
cla... |
b3fa14e85182d1b0efa47452de51d93a66c63503 | tests/test_unstow.py | tests/test_unstow.py | import os
import steeve
def test_unstow(runner, stowed_foo_package):
"""Must remove all previously linked files."""
result = runner.invoke(steeve.cli, ['unstow', 'foo'])
assert result.exit_code == 0
assert not os.path.exists(os.path.join('bin', 'foo'))
def test_strict(runner):
"""Must fail when... | import os
import steeve
def test_no_current(runner, foo_package):
"""Must fail when unstowing a package with no 'current' symlink."""
result = runner.invoke(steeve.cli, ['unstow', 'foo'])
assert result.exit_code == 1
assert 'not stowed' in result.output
def test_unstow(runner, stowed_foo_package):
... | Test unstowing a package with no 'current' symlink | Test unstowing a package with no 'current' symlink
| Python | bsd-3-clause | Perlence/steeve,Perlence/steeve | import os
import steeve
def test_unstow(runner, stowed_foo_package):
"""Must remove all previously linked files."""
result = runner.invoke(steeve.cli, ['unstow', 'foo'])
assert result.exit_code == 0
assert not os.path.exists(os.path.join('bin', 'foo'))
def test_strict(runner):
"""Must fail when... | import os
import steeve
def test_no_current(runner, foo_package):
"""Must fail when unstowing a package with no 'current' symlink."""
result = runner.invoke(steeve.cli, ['unstow', 'foo'])
assert result.exit_code == 1
assert 'not stowed' in result.output
def test_unstow(runner, stowed_foo_package):
... | <commit_before>import os
import steeve
def test_unstow(runner, stowed_foo_package):
"""Must remove all previously linked files."""
result = runner.invoke(steeve.cli, ['unstow', 'foo'])
assert result.exit_code == 0
assert not os.path.exists(os.path.join('bin', 'foo'))
def test_strict(runner):
""... | import os
import steeve
def test_no_current(runner, foo_package):
"""Must fail when unstowing a package with no 'current' symlink."""
result = runner.invoke(steeve.cli, ['unstow', 'foo'])
assert result.exit_code == 1
assert 'not stowed' in result.output
def test_unstow(runner, stowed_foo_package):
... | import os
import steeve
def test_unstow(runner, stowed_foo_package):
"""Must remove all previously linked files."""
result = runner.invoke(steeve.cli, ['unstow', 'foo'])
assert result.exit_code == 0
assert not os.path.exists(os.path.join('bin', 'foo'))
def test_strict(runner):
"""Must fail when... | <commit_before>import os
import steeve
def test_unstow(runner, stowed_foo_package):
"""Must remove all previously linked files."""
result = runner.invoke(steeve.cli, ['unstow', 'foo'])
assert result.exit_code == 0
assert not os.path.exists(os.path.join('bin', 'foo'))
def test_strict(runner):
""... |
a18763fd8ecaa09d5d07d7bc5569fae55d9784f8 | tests/v5/conftest.py | tests/v5/conftest.py | import pytest
from .context import tohu
from tohu.v5.primitive_generators import *
EXEMPLAR_PRIMITIVE_GENERATORS = [
Constant("quux"),
Boolean(p=0.3),
]
@pytest.fixture
def exemplar_generators():
"""
Return a list of generators which contains an example
for each type of generator supported by t... | import pytest
from .context import tohu
from tohu.v5.primitive_generators import *
from tohu.v5.logging import logger
logger.setLevel('DEBUG')
EXEMPLAR_PRIMITIVE_GENERATORS = [
Constant("quux"),
Boolean(p=0.3),
]
@pytest.fixture
def exemplar_generators():
"""
Return a list of generators which cont... | Set logging level to DEBUG in tests | Set logging level to DEBUG in tests
| Python | mit | maxalbert/tohu | import pytest
from .context import tohu
from tohu.v5.primitive_generators import *
EXEMPLAR_PRIMITIVE_GENERATORS = [
Constant("quux"),
Boolean(p=0.3),
]
@pytest.fixture
def exemplar_generators():
"""
Return a list of generators which contains an example
for each type of generator supported by t... | import pytest
from .context import tohu
from tohu.v5.primitive_generators import *
from tohu.v5.logging import logger
logger.setLevel('DEBUG')
EXEMPLAR_PRIMITIVE_GENERATORS = [
Constant("quux"),
Boolean(p=0.3),
]
@pytest.fixture
def exemplar_generators():
"""
Return a list of generators which cont... | <commit_before>import pytest
from .context import tohu
from tohu.v5.primitive_generators import *
EXEMPLAR_PRIMITIVE_GENERATORS = [
Constant("quux"),
Boolean(p=0.3),
]
@pytest.fixture
def exemplar_generators():
"""
Return a list of generators which contains an example
for each type of generator... | import pytest
from .context import tohu
from tohu.v5.primitive_generators import *
from tohu.v5.logging import logger
logger.setLevel('DEBUG')
EXEMPLAR_PRIMITIVE_GENERATORS = [
Constant("quux"),
Boolean(p=0.3),
]
@pytest.fixture
def exemplar_generators():
"""
Return a list of generators which cont... | import pytest
from .context import tohu
from tohu.v5.primitive_generators import *
EXEMPLAR_PRIMITIVE_GENERATORS = [
Constant("quux"),
Boolean(p=0.3),
]
@pytest.fixture
def exemplar_generators():
"""
Return a list of generators which contains an example
for each type of generator supported by t... | <commit_before>import pytest
from .context import tohu
from tohu.v5.primitive_generators import *
EXEMPLAR_PRIMITIVE_GENERATORS = [
Constant("quux"),
Boolean(p=0.3),
]
@pytest.fixture
def exemplar_generators():
"""
Return a list of generators which contains an example
for each type of generator... |
1a4369c00ad927747a68b9a7f6e12d13020413fe | urls.py | urls.py | from django.conf.urls import patterns, include, url
from . import views
urlpatterns = patterns('',
url(r'^$', views.MealCreateView.as_view(), name='meal-create'),
url(r'^(?P<meal_id>[A-Z0-9]+)/$', views.MealServeView.as_view(), name='meal-serve'),
url(r'^set_style/$', views.SetStyleView.as_view(), name='s... | from django.conf.urls import patterns, include, url
from . import views
urlpatterns = patterns('',
url(r'^$', views.MealCreateView.as_view(), name='meal-create'),
url(r'^(?P<meal_id>[A-Z0-9]+)/?$', views.MealServeView.as_view(), name='meal-serve'),
url(r'^set_style/$', views.SetStyleView.as_view(), name='... | Make trailing slash optional in meal URLs | Make trailing slash optional in meal URLs
| Python | mit | ntrrgc/lasana,ntrrgc/lasana,ntrrgc/lasana | from django.conf.urls import patterns, include, url
from . import views
urlpatterns = patterns('',
url(r'^$', views.MealCreateView.as_view(), name='meal-create'),
url(r'^(?P<meal_id>[A-Z0-9]+)/$', views.MealServeView.as_view(), name='meal-serve'),
url(r'^set_style/$', views.SetStyleView.as_view(), name='s... | from django.conf.urls import patterns, include, url
from . import views
urlpatterns = patterns('',
url(r'^$', views.MealCreateView.as_view(), name='meal-create'),
url(r'^(?P<meal_id>[A-Z0-9]+)/?$', views.MealServeView.as_view(), name='meal-serve'),
url(r'^set_style/$', views.SetStyleView.as_view(), name='... | <commit_before>from django.conf.urls import patterns, include, url
from . import views
urlpatterns = patterns('',
url(r'^$', views.MealCreateView.as_view(), name='meal-create'),
url(r'^(?P<meal_id>[A-Z0-9]+)/$', views.MealServeView.as_view(), name='meal-serve'),
url(r'^set_style/$', views.SetStyleView.as_... | from django.conf.urls import patterns, include, url
from . import views
urlpatterns = patterns('',
url(r'^$', views.MealCreateView.as_view(), name='meal-create'),
url(r'^(?P<meal_id>[A-Z0-9]+)/?$', views.MealServeView.as_view(), name='meal-serve'),
url(r'^set_style/$', views.SetStyleView.as_view(), name='... | from django.conf.urls import patterns, include, url
from . import views
urlpatterns = patterns('',
url(r'^$', views.MealCreateView.as_view(), name='meal-create'),
url(r'^(?P<meal_id>[A-Z0-9]+)/$', views.MealServeView.as_view(), name='meal-serve'),
url(r'^set_style/$', views.SetStyleView.as_view(), name='s... | <commit_before>from django.conf.urls import patterns, include, url
from . import views
urlpatterns = patterns('',
url(r'^$', views.MealCreateView.as_view(), name='meal-create'),
url(r'^(?P<meal_id>[A-Z0-9]+)/$', views.MealServeView.as_view(), name='meal-serve'),
url(r'^set_style/$', views.SetStyleView.as_... |
43ef10b1ea2ef5744b9558ff9c6afacdbfb1ee80 | cacheops/__init__.py | cacheops/__init__.py | VERSION = (3, 2, 1)
__version__ = '.'.join(map(str, VERSION if VERSION[-1] else VERSION[:2]))
from django.apps import AppConfig
from .simple import *
from .query import *
from .invalidation import *
from .templatetags.cacheops import *
from .transaction import install_cacheops_transaction_support
class CacheopsCon... | __version__ = '3.2.1'
VERSION = tuple(__version__.split('.'))
from django.apps import AppConfig
from .simple import *
from .query import *
from .invalidation import *
from .templatetags.cacheops import *
from .transaction import install_cacheops_transaction_support
class CacheopsConfig(AppConfig):
name = 'cach... | Use cacheops.__version__ as source of truth | Use cacheops.__version__ as source of truth
| Python | bsd-3-clause | LPgenerator/django-cacheops,Suor/django-cacheops | VERSION = (3, 2, 1)
__version__ = '.'.join(map(str, VERSION if VERSION[-1] else VERSION[:2]))
from django.apps import AppConfig
from .simple import *
from .query import *
from .invalidation import *
from .templatetags.cacheops import *
from .transaction import install_cacheops_transaction_support
class CacheopsCon... | __version__ = '3.2.1'
VERSION = tuple(__version__.split('.'))
from django.apps import AppConfig
from .simple import *
from .query import *
from .invalidation import *
from .templatetags.cacheops import *
from .transaction import install_cacheops_transaction_support
class CacheopsConfig(AppConfig):
name = 'cach... | <commit_before>VERSION = (3, 2, 1)
__version__ = '.'.join(map(str, VERSION if VERSION[-1] else VERSION[:2]))
from django.apps import AppConfig
from .simple import *
from .query import *
from .invalidation import *
from .templatetags.cacheops import *
from .transaction import install_cacheops_transaction_support
cl... | __version__ = '3.2.1'
VERSION = tuple(__version__.split('.'))
from django.apps import AppConfig
from .simple import *
from .query import *
from .invalidation import *
from .templatetags.cacheops import *
from .transaction import install_cacheops_transaction_support
class CacheopsConfig(AppConfig):
name = 'cach... | VERSION = (3, 2, 1)
__version__ = '.'.join(map(str, VERSION if VERSION[-1] else VERSION[:2]))
from django.apps import AppConfig
from .simple import *
from .query import *
from .invalidation import *
from .templatetags.cacheops import *
from .transaction import install_cacheops_transaction_support
class CacheopsCon... | <commit_before>VERSION = (3, 2, 1)
__version__ = '.'.join(map(str, VERSION if VERSION[-1] else VERSION[:2]))
from django.apps import AppConfig
from .simple import *
from .query import *
from .invalidation import *
from .templatetags.cacheops import *
from .transaction import install_cacheops_transaction_support
cl... |
7c8a256f5d87ae70ac3f187f0010a8d66d8b95d5 | seabird/modules/metar.py | seabird/modules/metar.py | import asyncio
import aiohttp
from seabird.decorators import command
from seabird.plugin import Plugin
METAR_URL = 'http://weather.noaa.gov/pub/data/observations/metar/stations/%s.TXT'
class MetarPlugin(Plugin):
@command
def metar(self, msg):
"""<station>
Returns the METAR report given an... | import asyncio
import aiohttp
from seabird.decorators import command
from seabird.plugin import Plugin
METAR_URL = ('http://weather.noaa.gov/pub/data'
'/observations/metar/stations/%s.TXT')
class MetarPlugin(Plugin):
@command
def metar(self, msg):
"""<station>
Returns the MET... | Fix a line too long lint error | Fix a line too long lint error
| Python | mit | belak/python-seabird,belak/pyseabird | import asyncio
import aiohttp
from seabird.decorators import command
from seabird.plugin import Plugin
METAR_URL = 'http://weather.noaa.gov/pub/data/observations/metar/stations/%s.TXT'
class MetarPlugin(Plugin):
@command
def metar(self, msg):
"""<station>
Returns the METAR report given an... | import asyncio
import aiohttp
from seabird.decorators import command
from seabird.plugin import Plugin
METAR_URL = ('http://weather.noaa.gov/pub/data'
'/observations/metar/stations/%s.TXT')
class MetarPlugin(Plugin):
@command
def metar(self, msg):
"""<station>
Returns the MET... | <commit_before>import asyncio
import aiohttp
from seabird.decorators import command
from seabird.plugin import Plugin
METAR_URL = 'http://weather.noaa.gov/pub/data/observations/metar/stations/%s.TXT'
class MetarPlugin(Plugin):
@command
def metar(self, msg):
"""<station>
Returns the METAR ... | import asyncio
import aiohttp
from seabird.decorators import command
from seabird.plugin import Plugin
METAR_URL = ('http://weather.noaa.gov/pub/data'
'/observations/metar/stations/%s.TXT')
class MetarPlugin(Plugin):
@command
def metar(self, msg):
"""<station>
Returns the MET... | import asyncio
import aiohttp
from seabird.decorators import command
from seabird.plugin import Plugin
METAR_URL = 'http://weather.noaa.gov/pub/data/observations/metar/stations/%s.TXT'
class MetarPlugin(Plugin):
@command
def metar(self, msg):
"""<station>
Returns the METAR report given an... | <commit_before>import asyncio
import aiohttp
from seabird.decorators import command
from seabird.plugin import Plugin
METAR_URL = 'http://weather.noaa.gov/pub/data/observations/metar/stations/%s.TXT'
class MetarPlugin(Plugin):
@command
def metar(self, msg):
"""<station>
Returns the METAR ... |
66ae18a11290e73a996d1e2f2ba8018e29c0f92b | sheepdog_tables/forms.py | sheepdog_tables/forms.py | import logging
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, HTML, Div, Submit
logger = logging.getLogger("sheepdog_tables")
class CSVExportForm(forms.Form):
id = forms.CharField(widget=forms.HiddenInput)
class EditTableSubmitForm(forms.Form):
... | import logging
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, HTML, Div, Submit
logger = logging.getLogger("sheepdog_tables")
class CSVExportForm(forms.Form):
id = forms.CharField(widget=forms.HiddenInput)
class EditTableSubmitForm(forms.Form):
... | Remove logger warning in favor of print for now | Remove logger warning in favor of print for now
| Python | bsd-3-clause | SheepDogInc/sheepdog_tables,SheepDogInc/sheepdog_tables | import logging
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, HTML, Div, Submit
logger = logging.getLogger("sheepdog_tables")
class CSVExportForm(forms.Form):
id = forms.CharField(widget=forms.HiddenInput)
class EditTableSubmitForm(forms.Form):
... | import logging
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, HTML, Div, Submit
logger = logging.getLogger("sheepdog_tables")
class CSVExportForm(forms.Form):
id = forms.CharField(widget=forms.HiddenInput)
class EditTableSubmitForm(forms.Form):
... | <commit_before>import logging
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, HTML, Div, Submit
logger = logging.getLogger("sheepdog_tables")
class CSVExportForm(forms.Form):
id = forms.CharField(widget=forms.HiddenInput)
class EditTableSubmitForm(for... | import logging
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, HTML, Div, Submit
logger = logging.getLogger("sheepdog_tables")
class CSVExportForm(forms.Form):
id = forms.CharField(widget=forms.HiddenInput)
class EditTableSubmitForm(forms.Form):
... | import logging
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, HTML, Div, Submit
logger = logging.getLogger("sheepdog_tables")
class CSVExportForm(forms.Form):
id = forms.CharField(widget=forms.HiddenInput)
class EditTableSubmitForm(forms.Form):
... | <commit_before>import logging
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, HTML, Div, Submit
logger = logging.getLogger("sheepdog_tables")
class CSVExportForm(forms.Form):
id = forms.CharField(widget=forms.HiddenInput)
class EditTableSubmitForm(for... |
ae61346af8a813b6c0ecbb9f232f235ada982356 | main.py | main.py | import json
from datetime import date
from boto import sqs
from boto.dynamodb2.table import Table
def playlists_to_process():
accounts = Table('accounts')
target_date = date.isoformat(date.today())
attributes = ('spotify_username', 'spotify_playlist_id', )
return accounts.scan(last_processed__ne=targe... | import json
from datetime import date
from boto import sqs
from boto.dynamodb2.table import Table
def playlists_to_process(target_date):
accounts = Table('accounts')
attributes = ('spotify_username', 'spotify_playlist_id', )
return accounts.scan(last_processed__ne=target_date, attributes=attributes)
def... | Send date to process in message | Send date to process in message
| Python | mit | projectweekend/song-feed-queue-builder | import json
from datetime import date
from boto import sqs
from boto.dynamodb2.table import Table
def playlists_to_process():
accounts = Table('accounts')
target_date = date.isoformat(date.today())
attributes = ('spotify_username', 'spotify_playlist_id', )
return accounts.scan(last_processed__ne=targe... | import json
from datetime import date
from boto import sqs
from boto.dynamodb2.table import Table
def playlists_to_process(target_date):
accounts = Table('accounts')
attributes = ('spotify_username', 'spotify_playlist_id', )
return accounts.scan(last_processed__ne=target_date, attributes=attributes)
def... | <commit_before>import json
from datetime import date
from boto import sqs
from boto.dynamodb2.table import Table
def playlists_to_process():
accounts = Table('accounts')
target_date = date.isoformat(date.today())
attributes = ('spotify_username', 'spotify_playlist_id', )
return accounts.scan(last_proc... | import json
from datetime import date
from boto import sqs
from boto.dynamodb2.table import Table
def playlists_to_process(target_date):
accounts = Table('accounts')
attributes = ('spotify_username', 'spotify_playlist_id', )
return accounts.scan(last_processed__ne=target_date, attributes=attributes)
def... | import json
from datetime import date
from boto import sqs
from boto.dynamodb2.table import Table
def playlists_to_process():
accounts = Table('accounts')
target_date = date.isoformat(date.today())
attributes = ('spotify_username', 'spotify_playlist_id', )
return accounts.scan(last_processed__ne=targe... | <commit_before>import json
from datetime import date
from boto import sqs
from boto.dynamodb2.table import Table
def playlists_to_process():
accounts = Table('accounts')
target_date = date.isoformat(date.today())
attributes = ('spotify_username', 'spotify_playlist_id', )
return accounts.scan(last_proc... |
5e97cc700886b071dbe645634604fdf473df1137 | github/commands/create_fork.py | github/commands/create_fork.py | from sublime_plugin import WindowCommand
from ...common import util
from ...core.git_command import GitCommand
from .. import github, git_mixins
from GitSavvy.core.runtime import enqueue_on_worker
START_CREATE_MESSAGE = "Forking {repo} ..."
END_CREATE_MESSAGE = "Fork created successfully."
__all__ = ['gs_github_cr... | from sublime_plugin import WindowCommand
from ...common import util
from ...core.git_command import GitCommand
from .. import github, git_mixins
from GitSavvy.core.runtime import enqueue_on_worker
START_CREATE_MESSAGE = "Forking {repo} ..."
END_CREATE_MESSAGE = "Fork created successfully."
__all__ = ['gs_github_cr... | Fix logging the JSON result | Fix logging the JSON result
| Python | mit | divmain/GitSavvy,divmain/GitSavvy,divmain/GitSavvy | from sublime_plugin import WindowCommand
from ...common import util
from ...core.git_command import GitCommand
from .. import github, git_mixins
from GitSavvy.core.runtime import enqueue_on_worker
START_CREATE_MESSAGE = "Forking {repo} ..."
END_CREATE_MESSAGE = "Fork created successfully."
__all__ = ['gs_github_cr... | from sublime_plugin import WindowCommand
from ...common import util
from ...core.git_command import GitCommand
from .. import github, git_mixins
from GitSavvy.core.runtime import enqueue_on_worker
START_CREATE_MESSAGE = "Forking {repo} ..."
END_CREATE_MESSAGE = "Fork created successfully."
__all__ = ['gs_github_cr... | <commit_before>from sublime_plugin import WindowCommand
from ...common import util
from ...core.git_command import GitCommand
from .. import github, git_mixins
from GitSavvy.core.runtime import enqueue_on_worker
START_CREATE_MESSAGE = "Forking {repo} ..."
END_CREATE_MESSAGE = "Fork created successfully."
__all__ =... | from sublime_plugin import WindowCommand
from ...common import util
from ...core.git_command import GitCommand
from .. import github, git_mixins
from GitSavvy.core.runtime import enqueue_on_worker
START_CREATE_MESSAGE = "Forking {repo} ..."
END_CREATE_MESSAGE = "Fork created successfully."
__all__ = ['gs_github_cr... | from sublime_plugin import WindowCommand
from ...common import util
from ...core.git_command import GitCommand
from .. import github, git_mixins
from GitSavvy.core.runtime import enqueue_on_worker
START_CREATE_MESSAGE = "Forking {repo} ..."
END_CREATE_MESSAGE = "Fork created successfully."
__all__ = ['gs_github_cr... | <commit_before>from sublime_plugin import WindowCommand
from ...common import util
from ...core.git_command import GitCommand
from .. import github, git_mixins
from GitSavvy.core.runtime import enqueue_on_worker
START_CREATE_MESSAGE = "Forking {repo} ..."
END_CREATE_MESSAGE = "Fork created successfully."
__all__ =... |
b24fa6443e70cca01ff5059fe29ba6e33c0262ea | pylisp/packet/ip/protocol.py | pylisp/packet/ip/protocol.py | '''
Created on 11 jan. 2013
@author: sander
'''
from abc import abstractmethod, ABCMeta
class Protocol(object):
__metaclass__ = ABCMeta
header_type = None
@abstractmethod
def __init__(self, next_header=None, payload=''):
'''
Constructor
'''
self.next_header = next_he... | '''
Created on 11 jan. 2013
@author: sander
'''
from abc import abstractmethod, ABCMeta
class ProtocolElement(object):
__metaclass__ = ABCMeta
@abstractmethod
def __init__(self):
'''
Constructor
'''
def __repr__(self):
# This works as long as we accept all properties... | Split Protocol class in Protocol and ProtocolElement | Split Protocol class in Protocol and ProtocolElement
| Python | bsd-3-clause | steffann/pylisp | '''
Created on 11 jan. 2013
@author: sander
'''
from abc import abstractmethod, ABCMeta
class Protocol(object):
__metaclass__ = ABCMeta
header_type = None
@abstractmethod
def __init__(self, next_header=None, payload=''):
'''
Constructor
'''
self.next_header = next_he... | '''
Created on 11 jan. 2013
@author: sander
'''
from abc import abstractmethod, ABCMeta
class ProtocolElement(object):
__metaclass__ = ABCMeta
@abstractmethod
def __init__(self):
'''
Constructor
'''
def __repr__(self):
# This works as long as we accept all properties... | <commit_before>'''
Created on 11 jan. 2013
@author: sander
'''
from abc import abstractmethod, ABCMeta
class Protocol(object):
__metaclass__ = ABCMeta
header_type = None
@abstractmethod
def __init__(self, next_header=None, payload=''):
'''
Constructor
'''
self.next_h... | '''
Created on 11 jan. 2013
@author: sander
'''
from abc import abstractmethod, ABCMeta
class ProtocolElement(object):
__metaclass__ = ABCMeta
@abstractmethod
def __init__(self):
'''
Constructor
'''
def __repr__(self):
# This works as long as we accept all properties... | '''
Created on 11 jan. 2013
@author: sander
'''
from abc import abstractmethod, ABCMeta
class Protocol(object):
__metaclass__ = ABCMeta
header_type = None
@abstractmethod
def __init__(self, next_header=None, payload=''):
'''
Constructor
'''
self.next_header = next_he... | <commit_before>'''
Created on 11 jan. 2013
@author: sander
'''
from abc import abstractmethod, ABCMeta
class Protocol(object):
__metaclass__ = ABCMeta
header_type = None
@abstractmethod
def __init__(self, next_header=None, payload=''):
'''
Constructor
'''
self.next_h... |
d5b18b7d0249cffabfab5f4c62696abe527af5ff | product/models.py | product/models.py | from django.db import models
from amadaa.models import AmadaaModel
from django.urls import reverse
# Create your models here.
class ProductCategory(AmadaaModel):
name = models.CharField(max_length=100, unique=True)
def get_absolute_url(self):
return reverse('product-category-detail', kwargs={'pk': se... | from django.db import models
from amadaa.models import AmadaaModel
from django.urls import reverse
# Create your models here.
class ProductCategory(AmadaaModel):
name = models.CharField(max_length=100, unique=True)
def get_absolute_url(self):
return reverse('product-category-detail', kwargs={'pk': se... | Fix in string representation of unit of measurement. | Fix in string representation of unit of measurement.
| Python | mit | borderitsolutions/amadaa,borderitsolutions/amadaa,borderitsolutions/amadaa | from django.db import models
from amadaa.models import AmadaaModel
from django.urls import reverse
# Create your models here.
class ProductCategory(AmadaaModel):
name = models.CharField(max_length=100, unique=True)
def get_absolute_url(self):
return reverse('product-category-detail', kwargs={'pk': se... | from django.db import models
from amadaa.models import AmadaaModel
from django.urls import reverse
# Create your models here.
class ProductCategory(AmadaaModel):
name = models.CharField(max_length=100, unique=True)
def get_absolute_url(self):
return reverse('product-category-detail', kwargs={'pk': se... | <commit_before>from django.db import models
from amadaa.models import AmadaaModel
from django.urls import reverse
# Create your models here.
class ProductCategory(AmadaaModel):
name = models.CharField(max_length=100, unique=True)
def get_absolute_url(self):
return reverse('product-category-detail', k... | from django.db import models
from amadaa.models import AmadaaModel
from django.urls import reverse
# Create your models here.
class ProductCategory(AmadaaModel):
name = models.CharField(max_length=100, unique=True)
def get_absolute_url(self):
return reverse('product-category-detail', kwargs={'pk': se... | from django.db import models
from amadaa.models import AmadaaModel
from django.urls import reverse
# Create your models here.
class ProductCategory(AmadaaModel):
name = models.CharField(max_length=100, unique=True)
def get_absolute_url(self):
return reverse('product-category-detail', kwargs={'pk': se... | <commit_before>from django.db import models
from amadaa.models import AmadaaModel
from django.urls import reverse
# Create your models here.
class ProductCategory(AmadaaModel):
name = models.CharField(max_length=100, unique=True)
def get_absolute_url(self):
return reverse('product-category-detail', k... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.