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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6b15bf92f8995542361ce1fe57f7b101f9ceba5e | flask_jsonapi/filters_schema.py | flask_jsonapi/filters_schema.py | import contextlib
import flask
class FilterSchema:
def __init__(self, fields: dict):
self.fields = fields
def parse(self):
result = {}
for name, field in self.fields.items():
with contextlib.suppress(KeyError):
result[name] = field.parse(name)
retu... | import contextlib
import flask
from flask_jsonapi import exceptions
class FilterSchema:
def __init__(self, fields: dict):
self.fields = fields
def parse(self):
result = {}
for name, field in self.fields.items():
with contextlib.suppress(KeyError):
result[... | Return jsonapi error when parsing filters failed. | Return jsonapi error when parsing filters failed.
Change-Id: I4bd26823d9e29b31ab8fdc47b8ef2bb65071d27b
Reviewed-on: https://review.socialwifi.com/14069
Reviewed-by: Piotr Maliński <[email protected]>
Tested-by: Jakub Skiepko <[email protected]... | Python | bsd-3-clause | maruqu/flask-jsonapi | import contextlib
import flask
class FilterSchema:
def __init__(self, fields: dict):
self.fields = fields
def parse(self):
result = {}
for name, field in self.fields.items():
with contextlib.suppress(KeyError):
result[name] = field.parse(name)
retu... | import contextlib
import flask
from flask_jsonapi import exceptions
class FilterSchema:
def __init__(self, fields: dict):
self.fields = fields
def parse(self):
result = {}
for name, field in self.fields.items():
with contextlib.suppress(KeyError):
result[... | <commit_before>import contextlib
import flask
class FilterSchema:
def __init__(self, fields: dict):
self.fields = fields
def parse(self):
result = {}
for name, field in self.fields.items():
with contextlib.suppress(KeyError):
result[name] = field.parse(nam... | import contextlib
import flask
from flask_jsonapi import exceptions
class FilterSchema:
def __init__(self, fields: dict):
self.fields = fields
def parse(self):
result = {}
for name, field in self.fields.items():
with contextlib.suppress(KeyError):
result[... | import contextlib
import flask
class FilterSchema:
def __init__(self, fields: dict):
self.fields = fields
def parse(self):
result = {}
for name, field in self.fields.items():
with contextlib.suppress(KeyError):
result[name] = field.parse(name)
retu... | <commit_before>import contextlib
import flask
class FilterSchema:
def __init__(self, fields: dict):
self.fields = fields
def parse(self):
result = {}
for name, field in self.fields.items():
with contextlib.suppress(KeyError):
result[name] = field.parse(nam... |
6e3fc4bea60130b02e0f35cec4d656faed9229cf | smarkets/__init__.py | smarkets/__init__.py | # Copyright (C) 2011 Smarkets Limited <[email protected]>
#
# This module is released under the MIT License:
# http://www.opensource.org/licenses/mit-license.php
__version__ = '1.5.5'
def private(something):
something.__private__ = True
return something
__all__ = ()
| # Copyright (C) 2011 Smarkets Limited <[email protected]>
#
# This module is released under the MIT License:
# http://www.opensource.org/licenses/mit-license.php
__version__ = '2.0.0'
def private(something):
something.__private__ = True
return something
__all__ = ()
| Change version number to reflect most recent changes | Change version number to reflect most recent changes
| Python | mit | smarkets/smk_python_sdk | # Copyright (C) 2011 Smarkets Limited <[email protected]>
#
# This module is released under the MIT License:
# http://www.opensource.org/licenses/mit-license.php
__version__ = '1.5.5'
def private(something):
something.__private__ = True
return something
__all__ = ()
Change version number to reflect most ... | # Copyright (C) 2011 Smarkets Limited <[email protected]>
#
# This module is released under the MIT License:
# http://www.opensource.org/licenses/mit-license.php
__version__ = '2.0.0'
def private(something):
something.__private__ = True
return something
__all__ = ()
| <commit_before># Copyright (C) 2011 Smarkets Limited <[email protected]>
#
# This module is released under the MIT License:
# http://www.opensource.org/licenses/mit-license.php
__version__ = '1.5.5'
def private(something):
something.__private__ = True
return something
__all__ = ()
<commit_msg>Change vers... | # Copyright (C) 2011 Smarkets Limited <[email protected]>
#
# This module is released under the MIT License:
# http://www.opensource.org/licenses/mit-license.php
__version__ = '2.0.0'
def private(something):
something.__private__ = True
return something
__all__ = ()
| # Copyright (C) 2011 Smarkets Limited <[email protected]>
#
# This module is released under the MIT License:
# http://www.opensource.org/licenses/mit-license.php
__version__ = '1.5.5'
def private(something):
something.__private__ = True
return something
__all__ = ()
Change version number to reflect most ... | <commit_before># Copyright (C) 2011 Smarkets Limited <[email protected]>
#
# This module is released under the MIT License:
# http://www.opensource.org/licenses/mit-license.php
__version__ = '1.5.5'
def private(something):
something.__private__ = True
return something
__all__ = ()
<commit_msg>Change vers... |
3c901a198f6396a0c48a0766618b9971e795530f | board/views.py | board/views.py | from django.core.urlresolvers import reverse
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.views.generic.edit import CreateView
from board.forms import PostCreateForm
from board.mixins import BoardMixin, UserLoggingMixin
from board.models import Board, Po... | from django.core.urlresolvers import reverse
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.views.generic.edit import CreateView
from board.forms import PostCreateForm
from board.mixins import BoardMixin, UserLoggingMixin
from board.models import Board, Po... | Add filtering and ordering to PostListView | Add filtering and ordering to PostListView
| Python | mit | devunt/hydrocarbon,devunt/hydrocarbon,devunt/hydrocarbon | from django.core.urlresolvers import reverse
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.views.generic.edit import CreateView
from board.forms import PostCreateForm
from board.mixins import BoardMixin, UserLoggingMixin
from board.models import Board, Po... | from django.core.urlresolvers import reverse
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.views.generic.edit import CreateView
from board.forms import PostCreateForm
from board.mixins import BoardMixin, UserLoggingMixin
from board.models import Board, Po... | <commit_before>from django.core.urlresolvers import reverse
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.views.generic.edit import CreateView
from board.forms import PostCreateForm
from board.mixins import BoardMixin, UserLoggingMixin
from board.models i... | from django.core.urlresolvers import reverse
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.views.generic.edit import CreateView
from board.forms import PostCreateForm
from board.mixins import BoardMixin, UserLoggingMixin
from board.models import Board, Po... | from django.core.urlresolvers import reverse
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.views.generic.edit import CreateView
from board.forms import PostCreateForm
from board.mixins import BoardMixin, UserLoggingMixin
from board.models import Board, Po... | <commit_before>from django.core.urlresolvers import reverse
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.views.generic.edit import CreateView
from board.forms import PostCreateForm
from board.mixins import BoardMixin, UserLoggingMixin
from board.models i... |
d0feed675897570d92eeb7b801b8ba094171bee0 | send_email.py | send_email.py | import smtplib
from email.mime.text import MIMEText
def process_email(data):
table_template = open('table_template.html', 'r').read()
same_guild_html = []
for game in data['same_guild']:
tt = table_template
same_guild_html.append(tt.format(**game))
games_html = []
for game in dat... | import datetime
import smtplib
from email.mime.text import MIMEText
def process_email(data):
table_template = open('table_template.html', 'r').read()
same_guild_html = []
for game in data['same_guild']:
tt = table_template
same_guild_html.append(tt.format(**game))
games_html = []
... | Update email subject with datetime so as to not have it end up in a thread in email client. | Update email subject with datetime so as to not have it end up in a thread in email client.
| Python | agpl-3.0 | v01d-cypher/kgs_league_scorer,v01d-cypher/kgs_league_scorer | import smtplib
from email.mime.text import MIMEText
def process_email(data):
table_template = open('table_template.html', 'r').read()
same_guild_html = []
for game in data['same_guild']:
tt = table_template
same_guild_html.append(tt.format(**game))
games_html = []
for game in dat... | import datetime
import smtplib
from email.mime.text import MIMEText
def process_email(data):
table_template = open('table_template.html', 'r').read()
same_guild_html = []
for game in data['same_guild']:
tt = table_template
same_guild_html.append(tt.format(**game))
games_html = []
... | <commit_before>import smtplib
from email.mime.text import MIMEText
def process_email(data):
table_template = open('table_template.html', 'r').read()
same_guild_html = []
for game in data['same_guild']:
tt = table_template
same_guild_html.append(tt.format(**game))
games_html = []
... | import datetime
import smtplib
from email.mime.text import MIMEText
def process_email(data):
table_template = open('table_template.html', 'r').read()
same_guild_html = []
for game in data['same_guild']:
tt = table_template
same_guild_html.append(tt.format(**game))
games_html = []
... | import smtplib
from email.mime.text import MIMEText
def process_email(data):
table_template = open('table_template.html', 'r').read()
same_guild_html = []
for game in data['same_guild']:
tt = table_template
same_guild_html.append(tt.format(**game))
games_html = []
for game in dat... | <commit_before>import smtplib
from email.mime.text import MIMEText
def process_email(data):
table_template = open('table_template.html', 'r').read()
same_guild_html = []
for game in data['same_guild']:
tt = table_template
same_guild_html.append(tt.format(**game))
games_html = []
... |
198d1d8827ffc04bf7f33e99bc929a33c8a7ba8c | src/sana/core/models/__init__.py | src/sana/core/models/__init__.py | """
Data models for the core Sana data engine. These should be extended as
required.
:Authors: Sana dev team
:Version: 2.0
"""
from sana.core.models.concept import Concept, Relationship, RelationshipCategory
from sana.core.models.device import Device
from sana.core.models.encounter import Encounter
from sana.core.m... | """
Data models for the core Sana data engine. These should be extended as
required.
:Authors: Sana dev team
:Version: 2.0
"""
from .concept import Concept, Relationship, RelationshipCategory
from .device import Device
from .encounter import Encounter
from .events import Event
from .notification import Notification... | Update to use relative imports. | Update to use relative imports. | Python | bsd-3-clause | SanaMobile/sana.mds,rryan/sana.mds,SanaMobile/sana.mds,SanaMobile/sana.mds,rryan/sana.mds,SanaMobile/sana.mds | """
Data models for the core Sana data engine. These should be extended as
required.
:Authors: Sana dev team
:Version: 2.0
"""
from sana.core.models.concept import Concept, Relationship, RelationshipCategory
from sana.core.models.device import Device
from sana.core.models.encounter import Encounter
from sana.core.m... | """
Data models for the core Sana data engine. These should be extended as
required.
:Authors: Sana dev team
:Version: 2.0
"""
from .concept import Concept, Relationship, RelationshipCategory
from .device import Device
from .encounter import Encounter
from .events import Event
from .notification import Notification... | <commit_before>"""
Data models for the core Sana data engine. These should be extended as
required.
:Authors: Sana dev team
:Version: 2.0
"""
from sana.core.models.concept import Concept, Relationship, RelationshipCategory
from sana.core.models.device import Device
from sana.core.models.encounter import Encounter
f... | """
Data models for the core Sana data engine. These should be extended as
required.
:Authors: Sana dev team
:Version: 2.0
"""
from .concept import Concept, Relationship, RelationshipCategory
from .device import Device
from .encounter import Encounter
from .events import Event
from .notification import Notification... | """
Data models for the core Sana data engine. These should be extended as
required.
:Authors: Sana dev team
:Version: 2.0
"""
from sana.core.models.concept import Concept, Relationship, RelationshipCategory
from sana.core.models.device import Device
from sana.core.models.encounter import Encounter
from sana.core.m... | <commit_before>"""
Data models for the core Sana data engine. These should be extended as
required.
:Authors: Sana dev team
:Version: 2.0
"""
from sana.core.models.concept import Concept, Relationship, RelationshipCategory
from sana.core.models.device import Device
from sana.core.models.encounter import Encounter
f... |
5531cac216918d4482858b5eb487003c67c96406 | bluebottle/auth/tests/test_api.py | bluebottle/auth/tests/test_api.py | import json
import mock
from rest_framework import status
from bluebottle.test.utils import BluebottleTestCase
from bluebottle.test.factory_models.accounts import BlueBottleUserFactory
from django.core.urlresolvers import reverse
class UserTokenTestCase(BluebottleTestCase):
def setUp(self):
super(UserTo... | import json
import mock
from rest_framework import status
from bluebottle.test.utils import BluebottleTestCase
from bluebottle.test.factory_models.accounts import BlueBottleUserFactory
from django.core.urlresolvers import reverse
class UserTokenTestCase(BluebottleTestCase):
def setUp(self):
super(UserTo... | Add tests for API login | Add tests for API login
| Python | bsd-3-clause | onepercentclub/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle,jfterpstra/bluebottle,jfterpstra/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | import json
import mock
from rest_framework import status
from bluebottle.test.utils import BluebottleTestCase
from bluebottle.test.factory_models.accounts import BlueBottleUserFactory
from django.core.urlresolvers import reverse
class UserTokenTestCase(BluebottleTestCase):
def setUp(self):
super(UserTo... | import json
import mock
from rest_framework import status
from bluebottle.test.utils import BluebottleTestCase
from bluebottle.test.factory_models.accounts import BlueBottleUserFactory
from django.core.urlresolvers import reverse
class UserTokenTestCase(BluebottleTestCase):
def setUp(self):
super(UserTo... | <commit_before>import json
import mock
from rest_framework import status
from bluebottle.test.utils import BluebottleTestCase
from bluebottle.test.factory_models.accounts import BlueBottleUserFactory
from django.core.urlresolvers import reverse
class UserTokenTestCase(BluebottleTestCase):
def setUp(self):
... | import json
import mock
from rest_framework import status
from bluebottle.test.utils import BluebottleTestCase
from bluebottle.test.factory_models.accounts import BlueBottleUserFactory
from django.core.urlresolvers import reverse
class UserTokenTestCase(BluebottleTestCase):
def setUp(self):
super(UserTo... | import json
import mock
from rest_framework import status
from bluebottle.test.utils import BluebottleTestCase
from bluebottle.test.factory_models.accounts import BlueBottleUserFactory
from django.core.urlresolvers import reverse
class UserTokenTestCase(BluebottleTestCase):
def setUp(self):
super(UserTo... | <commit_before>import json
import mock
from rest_framework import status
from bluebottle.test.utils import BluebottleTestCase
from bluebottle.test.factory_models.accounts import BlueBottleUserFactory
from django.core.urlresolvers import reverse
class UserTokenTestCase(BluebottleTestCase):
def setUp(self):
... |
622e1e780b84a8e04c5af2d6758fb457ff92ea93 | polymorphic/formsets/utils.py | polymorphic/formsets/utils.py | """
Internal utils
"""
import django
def add_media(dest, media):
"""
Optimized version of django.forms.Media.__add__() that doesn't create new objects.
Only required for Django < 2.0
"""
if django.VERSION >= (2, 0):
combined = dest + media
dest._css = combined._css
dest._j... | """
Internal utils
"""
import django
def add_media(dest, media):
"""
Optimized version of django.forms.Media.__add__() that doesn't create new objects.
"""
if django.VERSION >= (2, 2):
dest._css_lists += media._css_lists
dest._js_lists += media._js_lists
elif django.VERSION >= (2, ... | Fix media-combining in formsets on Django 2.2 | Fix media-combining in formsets on Django 2.2
| Python | bsd-3-clause | chrisglass/django_polymorphic,chrisglass/django_polymorphic | """
Internal utils
"""
import django
def add_media(dest, media):
"""
Optimized version of django.forms.Media.__add__() that doesn't create new objects.
Only required for Django < 2.0
"""
if django.VERSION >= (2, 0):
combined = dest + media
dest._css = combined._css
dest._j... | """
Internal utils
"""
import django
def add_media(dest, media):
"""
Optimized version of django.forms.Media.__add__() that doesn't create new objects.
"""
if django.VERSION >= (2, 2):
dest._css_lists += media._css_lists
dest._js_lists += media._js_lists
elif django.VERSION >= (2, ... | <commit_before>"""
Internal utils
"""
import django
def add_media(dest, media):
"""
Optimized version of django.forms.Media.__add__() that doesn't create new objects.
Only required for Django < 2.0
"""
if django.VERSION >= (2, 0):
combined = dest + media
dest._css = combined._css
... | """
Internal utils
"""
import django
def add_media(dest, media):
"""
Optimized version of django.forms.Media.__add__() that doesn't create new objects.
"""
if django.VERSION >= (2, 2):
dest._css_lists += media._css_lists
dest._js_lists += media._js_lists
elif django.VERSION >= (2, ... | """
Internal utils
"""
import django
def add_media(dest, media):
"""
Optimized version of django.forms.Media.__add__() that doesn't create new objects.
Only required for Django < 2.0
"""
if django.VERSION >= (2, 0):
combined = dest + media
dest._css = combined._css
dest._j... | <commit_before>"""
Internal utils
"""
import django
def add_media(dest, media):
"""
Optimized version of django.forms.Media.__add__() that doesn't create new objects.
Only required for Django < 2.0
"""
if django.VERSION >= (2, 0):
combined = dest + media
dest._css = combined._css
... |
3cbe02f1a5410148269113f7b8f41949086c9ac1 | instance/tasks.py | instance/tasks.py | # -*- encoding: utf-8 -*-
#
# Copyright (c) 2015, OpenCraft
#
# Imports #####################################################################
from pprint import pprint
from django.conf import settings
from huey.djhuey import task
from .ansible import run_ansible_playbook, get_inventory_str, get_vars_str
from .gandi... | # -*- encoding: utf-8 -*-
#
# Copyright (c) 2015, OpenCraft
#
# Imports #####################################################################
from pprint import pprint
from django.conf import settings
from huey.djhuey import task
from .ansible import run_ansible_playbook, get_inventory_str, get_vars_str
from .gandi... | Return command output log in `create_sandbox_instance()` | Return command output log in `create_sandbox_instance()`
| Python | agpl-3.0 | brousch/opencraft,omarkhan/opencraft,omarkhan/opencraft,open-craft/opencraft,brousch/opencraft,open-craft/opencraft,omarkhan/opencraft,open-craft/opencraft,omarkhan/opencraft,brousch/opencraft,open-craft/opencraft,open-craft/opencraft | # -*- encoding: utf-8 -*-
#
# Copyright (c) 2015, OpenCraft
#
# Imports #####################################################################
from pprint import pprint
from django.conf import settings
from huey.djhuey import task
from .ansible import run_ansible_playbook, get_inventory_str, get_vars_str
from .gandi... | # -*- encoding: utf-8 -*-
#
# Copyright (c) 2015, OpenCraft
#
# Imports #####################################################################
from pprint import pprint
from django.conf import settings
from huey.djhuey import task
from .ansible import run_ansible_playbook, get_inventory_str, get_vars_str
from .gandi... | <commit_before># -*- encoding: utf-8 -*-
#
# Copyright (c) 2015, OpenCraft
#
# Imports #####################################################################
from pprint import pprint
from django.conf import settings
from huey.djhuey import task
from .ansible import run_ansible_playbook, get_inventory_str, get_vars_... | # -*- encoding: utf-8 -*-
#
# Copyright (c) 2015, OpenCraft
#
# Imports #####################################################################
from pprint import pprint
from django.conf import settings
from huey.djhuey import task
from .ansible import run_ansible_playbook, get_inventory_str, get_vars_str
from .gandi... | # -*- encoding: utf-8 -*-
#
# Copyright (c) 2015, OpenCraft
#
# Imports #####################################################################
from pprint import pprint
from django.conf import settings
from huey.djhuey import task
from .ansible import run_ansible_playbook, get_inventory_str, get_vars_str
from .gandi... | <commit_before># -*- encoding: utf-8 -*-
#
# Copyright (c) 2015, OpenCraft
#
# Imports #####################################################################
from pprint import pprint
from django.conf import settings
from huey.djhuey import task
from .ansible import run_ansible_playbook, get_inventory_str, get_vars_... |
20115684ea5ab52e0c51f43fd85aa9945560d103 | interleave-pdf.py | interleave-pdf.py | import PyPDF2
from formlayout import fedit
def main():
paths = [('Input', ''), ('Output', '')]
pathsRead = fedit(paths,
title="Interleave pdf",
comment="Enter the full path to the source pdf and a path to output the result."
)
# Full path to files should be... | import PyPDF2
from tkinter import *
from tkinter.filedialog import askopenfilename
from tkinter.filedialog import asksaveasfilename
class Application(Frame):
def __init__(self):
self.input_path = None;
self.output_path = None;
Frame.__init__(self)
self.master.resizable(False, False)
self.master.title('Int... | Replace formlayout GUI with tkinter | Replace formlayout GUI with tkinter
Separate buttons for selecting input and output, and for running
the interleave procedure.
| Python | mit | sproberts92/interleave-pdf | import PyPDF2
from formlayout import fedit
def main():
paths = [('Input', ''), ('Output', '')]
pathsRead = fedit(paths,
title="Interleave pdf",
comment="Enter the full path to the source pdf and a path to output the result."
)
# Full path to files should be... | import PyPDF2
from tkinter import *
from tkinter.filedialog import askopenfilename
from tkinter.filedialog import asksaveasfilename
class Application(Frame):
def __init__(self):
self.input_path = None;
self.output_path = None;
Frame.__init__(self)
self.master.resizable(False, False)
self.master.title('Int... | <commit_before>import PyPDF2
from formlayout import fedit
def main():
paths = [('Input', ''), ('Output', '')]
pathsRead = fedit(paths,
title="Interleave pdf",
comment="Enter the full path to the source pdf and a path to output the result."
)
# Full path to ... | import PyPDF2
from tkinter import *
from tkinter.filedialog import askopenfilename
from tkinter.filedialog import asksaveasfilename
class Application(Frame):
def __init__(self):
self.input_path = None;
self.output_path = None;
Frame.__init__(self)
self.master.resizable(False, False)
self.master.title('Int... | import PyPDF2
from formlayout import fedit
def main():
paths = [('Input', ''), ('Output', '')]
pathsRead = fedit(paths,
title="Interleave pdf",
comment="Enter the full path to the source pdf and a path to output the result."
)
# Full path to files should be... | <commit_before>import PyPDF2
from formlayout import fedit
def main():
paths = [('Input', ''), ('Output', '')]
pathsRead = fedit(paths,
title="Interleave pdf",
comment="Enter the full path to the source pdf and a path to output the result."
)
# Full path to ... |
89af0ed8bf7f62f6a48d7dd5b09a3fa46a2cf9c7 | spyder_terminal/__init__.py | spyder_terminal/__init__.py | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) Spyder Project Contributors
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# -----------------------------------------------------------------------------
"""Spyder Te... | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) Spyder Project Contributors
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# -----------------------------------------------------------------------------
"""Spyder Te... | Set release version to v0.2.3 | Set release version to v0.2.3
| Python | mit | andfoy/spyder-terminal,spyder-ide/spyder-terminal,spyder-ide/spyder-terminal,andfoy/spyder-terminal,andfoy/spyder-terminal,spyder-ide/spyder-terminal,spyder-ide/spyder-terminal | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) Spyder Project Contributors
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# -----------------------------------------------------------------------------
"""Spyder Te... | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) Spyder Project Contributors
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# -----------------------------------------------------------------------------
"""Spyder Te... | <commit_before># -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) Spyder Project Contributors
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# ---------------------------------------------------------------------------... | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) Spyder Project Contributors
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# -----------------------------------------------------------------------------
"""Spyder Te... | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) Spyder Project Contributors
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# -----------------------------------------------------------------------------
"""Spyder Te... | <commit_before># -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) Spyder Project Contributors
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# ---------------------------------------------------------------------------... |
232f2961d8ff26f7263df5ab59c8b36ac8bd9b43 | stars/serializers.py | stars/serializers.py | from .models import Star
from employees.models import Employee
from rest_framework import serializers
class EmployeeSimpleSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
fields = ('pk', 'username', 'first_name', 'last_name')
class StarSerializer(serializers.ModelSerializer)... | from .models import Star
from employees.models import Employee
from rest_framework import serializers
class EmployeeSimpleSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
fields = ('pk', 'username', 'first_name', 'last_name')
class StarSerializer(serializers.ModelSerializer)... | Replace subcategory__ prefix to endpoint response field names. | Replace subcategory__ prefix to endpoint response field names.
| Python | apache-2.0 | belatrix/BackendAllStars | from .models import Star
from employees.models import Employee
from rest_framework import serializers
class EmployeeSimpleSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
fields = ('pk', 'username', 'first_name', 'last_name')
class StarSerializer(serializers.ModelSerializer)... | from .models import Star
from employees.models import Employee
from rest_framework import serializers
class EmployeeSimpleSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
fields = ('pk', 'username', 'first_name', 'last_name')
class StarSerializer(serializers.ModelSerializer)... | <commit_before>from .models import Star
from employees.models import Employee
from rest_framework import serializers
class EmployeeSimpleSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
fields = ('pk', 'username', 'first_name', 'last_name')
class StarSerializer(serializers.M... | from .models import Star
from employees.models import Employee
from rest_framework import serializers
class EmployeeSimpleSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
fields = ('pk', 'username', 'first_name', 'last_name')
class StarSerializer(serializers.ModelSerializer)... | from .models import Star
from employees.models import Employee
from rest_framework import serializers
class EmployeeSimpleSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
fields = ('pk', 'username', 'first_name', 'last_name')
class StarSerializer(serializers.ModelSerializer)... | <commit_before>from .models import Star
from employees.models import Employee
from rest_framework import serializers
class EmployeeSimpleSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
fields = ('pk', 'username', 'first_name', 'last_name')
class StarSerializer(serializers.M... |
aa4a032016944f581ad7485ebdf8c39108511098 | commandbased/commandbasedrobot.py | commandbased/commandbasedrobot.py | import hal
from wpilib.timedrobot import TimedRobot
from wpilib.command.scheduler import Scheduler
from wpilib.livewindow import LiveWindow
class CommandBasedRobot(TimedRobot):
'''
The base class for a Command-Based Robot. To use, instantiate commands and
trigger them.
'''
def startCompetition(s... | from wpilib import TimedRobot
from wpilib.command import Scheduler
class CommandBasedRobot(TimedRobot):
'''
The base class for a Command-Based Robot. To use, instantiate commands and
trigger them.
'''
def startCompetition(self):
"""Initalizes the scheduler before starting robotInit()"""
... | Remove LiveWindow call from CommandBasedRobot | Remove LiveWindow call from CommandBasedRobot
LiveWindow is automatically updated regardless of mode as part of 2018
WPILib IterativeRobot changes, so calling LiveWindow.run() manually is
unnecessary.
| Python | bsd-3-clause | robotpy/robotpy-wpilib-utilities,robotpy/robotpy-wpilib-utilities | import hal
from wpilib.timedrobot import TimedRobot
from wpilib.command.scheduler import Scheduler
from wpilib.livewindow import LiveWindow
class CommandBasedRobot(TimedRobot):
'''
The base class for a Command-Based Robot. To use, instantiate commands and
trigger them.
'''
def startCompetition(s... | from wpilib import TimedRobot
from wpilib.command import Scheduler
class CommandBasedRobot(TimedRobot):
'''
The base class for a Command-Based Robot. To use, instantiate commands and
trigger them.
'''
def startCompetition(self):
"""Initalizes the scheduler before starting robotInit()"""
... | <commit_before>import hal
from wpilib.timedrobot import TimedRobot
from wpilib.command.scheduler import Scheduler
from wpilib.livewindow import LiveWindow
class CommandBasedRobot(TimedRobot):
'''
The base class for a Command-Based Robot. To use, instantiate commands and
trigger them.
'''
def sta... | from wpilib import TimedRobot
from wpilib.command import Scheduler
class CommandBasedRobot(TimedRobot):
'''
The base class for a Command-Based Robot. To use, instantiate commands and
trigger them.
'''
def startCompetition(self):
"""Initalizes the scheduler before starting robotInit()"""
... | import hal
from wpilib.timedrobot import TimedRobot
from wpilib.command.scheduler import Scheduler
from wpilib.livewindow import LiveWindow
class CommandBasedRobot(TimedRobot):
'''
The base class for a Command-Based Robot. To use, instantiate commands and
trigger them.
'''
def startCompetition(s... | <commit_before>import hal
from wpilib.timedrobot import TimedRobot
from wpilib.command.scheduler import Scheduler
from wpilib.livewindow import LiveWindow
class CommandBasedRobot(TimedRobot):
'''
The base class for a Command-Based Robot. To use, instantiate commands and
trigger them.
'''
def sta... |
a8fcd8c56db0ce862c6c0ac79fc58a9e65992f6e | onlineweb4/context_processors.py | onlineweb4/context_processors.py | from django.conf import settings
from apps.feedback.models import FeedbackRelation
def context_settings(request):
context_extras = {}
if hasattr(settings, 'GOOGLE_ANALYTICS_KEY'):
context_extras['GOOGLE_ANALYTICS_KEY'] = settings.GOOGLE_ANALYTICS_KEY
if hasattr(settings, 'HOT_RELOAD'):
con... | # -*- coding: utf-8 -*-
from django.conf import settings
from django.utils import timezone
from apps.feedback.models import FeedbackRelation
def context_settings(request):
context_extras = {}
if hasattr(settings, 'GOOGLE_ANALYTICS_KEY'):
context_extras['GOOGLE_ANALYTICS_KEY'] = settings.GOOGLE_ANALYT... | Add more constraints to active feedback schemas | Add more constraints to active feedback schemas
| Python | mit | dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4 | from django.conf import settings
from apps.feedback.models import FeedbackRelation
def context_settings(request):
context_extras = {}
if hasattr(settings, 'GOOGLE_ANALYTICS_KEY'):
context_extras['GOOGLE_ANALYTICS_KEY'] = settings.GOOGLE_ANALYTICS_KEY
if hasattr(settings, 'HOT_RELOAD'):
con... | # -*- coding: utf-8 -*-
from django.conf import settings
from django.utils import timezone
from apps.feedback.models import FeedbackRelation
def context_settings(request):
context_extras = {}
if hasattr(settings, 'GOOGLE_ANALYTICS_KEY'):
context_extras['GOOGLE_ANALYTICS_KEY'] = settings.GOOGLE_ANALYT... | <commit_before>from django.conf import settings
from apps.feedback.models import FeedbackRelation
def context_settings(request):
context_extras = {}
if hasattr(settings, 'GOOGLE_ANALYTICS_KEY'):
context_extras['GOOGLE_ANALYTICS_KEY'] = settings.GOOGLE_ANALYTICS_KEY
if hasattr(settings, 'HOT_RELOAD... | # -*- coding: utf-8 -*-
from django.conf import settings
from django.utils import timezone
from apps.feedback.models import FeedbackRelation
def context_settings(request):
context_extras = {}
if hasattr(settings, 'GOOGLE_ANALYTICS_KEY'):
context_extras['GOOGLE_ANALYTICS_KEY'] = settings.GOOGLE_ANALYT... | from django.conf import settings
from apps.feedback.models import FeedbackRelation
def context_settings(request):
context_extras = {}
if hasattr(settings, 'GOOGLE_ANALYTICS_KEY'):
context_extras['GOOGLE_ANALYTICS_KEY'] = settings.GOOGLE_ANALYTICS_KEY
if hasattr(settings, 'HOT_RELOAD'):
con... | <commit_before>from django.conf import settings
from apps.feedback.models import FeedbackRelation
def context_settings(request):
context_extras = {}
if hasattr(settings, 'GOOGLE_ANALYTICS_KEY'):
context_extras['GOOGLE_ANALYTICS_KEY'] = settings.GOOGLE_ANALYTICS_KEY
if hasattr(settings, 'HOT_RELOAD... |
175c1775aa7f5cd0ba2022e95389507d8a4c87dc | syncplay/__init__.py | syncplay/__init__.py | version = '1.6.6'
revision = ' development'
milestone = 'Yoitsu'
release_number = '87'
projectURL = 'https://syncplay.pl/'
| version = '1.6.6'
revision = ' beta 1'
milestone = 'Yoitsu'
release_number = '88'
projectURL = 'https://syncplay.pl/'
| Mark as 1.6.6 beta 1 | Mark as 1.6.6 beta 1
| Python | apache-2.0 | alby128/syncplay,Syncplay/syncplay,Syncplay/syncplay,alby128/syncplay | version = '1.6.6'
revision = ' development'
milestone = 'Yoitsu'
release_number = '87'
projectURL = 'https://syncplay.pl/'
Mark as 1.6.6 beta 1 | version = '1.6.6'
revision = ' beta 1'
milestone = 'Yoitsu'
release_number = '88'
projectURL = 'https://syncplay.pl/'
| <commit_before>version = '1.6.6'
revision = ' development'
milestone = 'Yoitsu'
release_number = '87'
projectURL = 'https://syncplay.pl/'
<commit_msg>Mark as 1.6.6 beta 1<commit_after> | version = '1.6.6'
revision = ' beta 1'
milestone = 'Yoitsu'
release_number = '88'
projectURL = 'https://syncplay.pl/'
| version = '1.6.6'
revision = ' development'
milestone = 'Yoitsu'
release_number = '87'
projectURL = 'https://syncplay.pl/'
Mark as 1.6.6 beta 1version = '1.6.6'
revision = ' beta 1'
milestone = 'Yoitsu'
release_number = '88'
projectURL = 'https://syncplay.pl/'
| <commit_before>version = '1.6.6'
revision = ' development'
milestone = 'Yoitsu'
release_number = '87'
projectURL = 'https://syncplay.pl/'
<commit_msg>Mark as 1.6.6 beta 1<commit_after>version = '1.6.6'
revision = ' beta 1'
milestone = 'Yoitsu'
release_number = '88'
projectURL = 'https://syncplay.pl/'
|
1c7928a5aeff55518bfda2b9a9ef1ec2a2ef76e4 | corehq/celery_monitoring/tests.py | corehq/celery_monitoring/tests.py | from __future__ import absolute_import
from __future__ import print_function
import datetime
from freezegun import freeze_time
from corehq.celery_monitoring.heartbeat import Heartbeat, HeartbeatNeverRecorded, \
HEARTBEAT_FREQUENCY
from testil import assert_raises, eq
def test_heartbeat():
hb = Heartbeat('c... | from __future__ import absolute_import
from __future__ import print_function
import datetime
from freezegun import freeze_time
from corehq.celery_monitoring.heartbeat import Heartbeat, HeartbeatNeverRecorded, \
HEARTBEAT_FREQUENCY
from testil import assert_raises, eq
from corehq.celery_monitoring.signals import... | Add simple test for celery time to start timer | Add simple test for celery time to start timer
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | from __future__ import absolute_import
from __future__ import print_function
import datetime
from freezegun import freeze_time
from corehq.celery_monitoring.heartbeat import Heartbeat, HeartbeatNeverRecorded, \
HEARTBEAT_FREQUENCY
from testil import assert_raises, eq
def test_heartbeat():
hb = Heartbeat('c... | from __future__ import absolute_import
from __future__ import print_function
import datetime
from freezegun import freeze_time
from corehq.celery_monitoring.heartbeat import Heartbeat, HeartbeatNeverRecorded, \
HEARTBEAT_FREQUENCY
from testil import assert_raises, eq
from corehq.celery_monitoring.signals import... | <commit_before>from __future__ import absolute_import
from __future__ import print_function
import datetime
from freezegun import freeze_time
from corehq.celery_monitoring.heartbeat import Heartbeat, HeartbeatNeverRecorded, \
HEARTBEAT_FREQUENCY
from testil import assert_raises, eq
def test_heartbeat():
hb... | from __future__ import absolute_import
from __future__ import print_function
import datetime
from freezegun import freeze_time
from corehq.celery_monitoring.heartbeat import Heartbeat, HeartbeatNeverRecorded, \
HEARTBEAT_FREQUENCY
from testil import assert_raises, eq
from corehq.celery_monitoring.signals import... | from __future__ import absolute_import
from __future__ import print_function
import datetime
from freezegun import freeze_time
from corehq.celery_monitoring.heartbeat import Heartbeat, HeartbeatNeverRecorded, \
HEARTBEAT_FREQUENCY
from testil import assert_raises, eq
def test_heartbeat():
hb = Heartbeat('c... | <commit_before>from __future__ import absolute_import
from __future__ import print_function
import datetime
from freezegun import freeze_time
from corehq.celery_monitoring.heartbeat import Heartbeat, HeartbeatNeverRecorded, \
HEARTBEAT_FREQUENCY
from testil import assert_raises, eq
def test_heartbeat():
hb... |
fa4e6e849eaff2611a5d978c7f7727a16a8c301e | daedalus/attacks/sample_attack.py | daedalus/attacks/sample_attack.py | # This file should serve as a template
# We will be importing all such files into daedalus from which any attack can be then called with required input
###########################################################################
# attack(input={})
# This function will be called from with daedalus.py
# along with the r... | # This file should serve as a template
# We will be importing all such files into daedalus from which any attack can be then called with required input
###########################################################################
# attack(input={})
# This function will be called from with daedalus.py
# along with the r... | Remove extra parameters to "attack()" | Remove extra parameters to "attack()"
The `results` and `errors` structures aren't needed as input parameters.
All we need to ensure is that these are returned by `attack()`. | Python | mit | IEEE-NITK/Daedalus,IEEE-NITK/Daedalus,chinmaydd/NITK_IEEE_SaS,IEEE-NITK/Daedalus | # This file should serve as a template
# We will be importing all such files into daedalus from which any attack can be then called with required input
###########################################################################
# attack(input={})
# This function will be called from with daedalus.py
# along with the r... | # This file should serve as a template
# We will be importing all such files into daedalus from which any attack can be then called with required input
###########################################################################
# attack(input={})
# This function will be called from with daedalus.py
# along with the r... | <commit_before># This file should serve as a template
# We will be importing all such files into daedalus from which any attack can be then called with required input
###########################################################################
# attack(input={})
# This function will be called from with daedalus.py
# a... | # This file should serve as a template
# We will be importing all such files into daedalus from which any attack can be then called with required input
###########################################################################
# attack(input={})
# This function will be called from with daedalus.py
# along with the r... | # This file should serve as a template
# We will be importing all such files into daedalus from which any attack can be then called with required input
###########################################################################
# attack(input={})
# This function will be called from with daedalus.py
# along with the r... | <commit_before># This file should serve as a template
# We will be importing all such files into daedalus from which any attack can be then called with required input
###########################################################################
# attack(input={})
# This function will be called from with daedalus.py
# a... |
66cc9d8c6f91378fadbbc3e40fe4397e43b7b757 | mopidy/frontends/mpd/__init__.py | mopidy/frontends/mpd/__init__.py | import logging
from mopidy.frontends.base import BaseFrontend
from mopidy.frontends.mpd.dispatcher import MpdDispatcher
from mopidy.frontends.mpd.thread import MpdThread
from mopidy.utils.process import unpickle_connection
logger = logging.getLogger('mopidy.frontends.mpd')
class MpdFrontend(BaseFrontend):
"""
... | import logging
from mopidy.frontends.base import BaseFrontend
from mopidy.frontends.mpd.dispatcher import MpdDispatcher
from mopidy.frontends.mpd.thread import MpdThread
from mopidy.utils.process import unpickle_connection
logger = logging.getLogger('mopidy.frontends.mpd')
class MpdFrontend(BaseFrontend):
"""
... | Allow reply_to to not be set in messages to the MPD frontend | Allow reply_to to not be set in messages to the MPD frontend
| Python | apache-2.0 | vrs01/mopidy,dbrgn/mopidy,bencevans/mopidy,swak/mopidy,diandiankan/mopidy,tkem/mopidy,glogiotatidis/mopidy,priestd09/mopidy,dbrgn/mopidy,abarisain/mopidy,vrs01/mopidy,swak/mopidy,jmarsik/mopidy,ali/mopidy,vrs01/mopidy,priestd09/mopidy,SuperStarPL/mopidy,mopidy/mopidy,liamw9534/mopidy,pacificIT/mopidy,bencevans/mopidy,w... | import logging
from mopidy.frontends.base import BaseFrontend
from mopidy.frontends.mpd.dispatcher import MpdDispatcher
from mopidy.frontends.mpd.thread import MpdThread
from mopidy.utils.process import unpickle_connection
logger = logging.getLogger('mopidy.frontends.mpd')
class MpdFrontend(BaseFrontend):
"""
... | import logging
from mopidy.frontends.base import BaseFrontend
from mopidy.frontends.mpd.dispatcher import MpdDispatcher
from mopidy.frontends.mpd.thread import MpdThread
from mopidy.utils.process import unpickle_connection
logger = logging.getLogger('mopidy.frontends.mpd')
class MpdFrontend(BaseFrontend):
"""
... | <commit_before>import logging
from mopidy.frontends.base import BaseFrontend
from mopidy.frontends.mpd.dispatcher import MpdDispatcher
from mopidy.frontends.mpd.thread import MpdThread
from mopidy.utils.process import unpickle_connection
logger = logging.getLogger('mopidy.frontends.mpd')
class MpdFrontend(BaseFronte... | import logging
from mopidy.frontends.base import BaseFrontend
from mopidy.frontends.mpd.dispatcher import MpdDispatcher
from mopidy.frontends.mpd.thread import MpdThread
from mopidy.utils.process import unpickle_connection
logger = logging.getLogger('mopidy.frontends.mpd')
class MpdFrontend(BaseFrontend):
"""
... | import logging
from mopidy.frontends.base import BaseFrontend
from mopidy.frontends.mpd.dispatcher import MpdDispatcher
from mopidy.frontends.mpd.thread import MpdThread
from mopidy.utils.process import unpickle_connection
logger = logging.getLogger('mopidy.frontends.mpd')
class MpdFrontend(BaseFrontend):
"""
... | <commit_before>import logging
from mopidy.frontends.base import BaseFrontend
from mopidy.frontends.mpd.dispatcher import MpdDispatcher
from mopidy.frontends.mpd.thread import MpdThread
from mopidy.utils.process import unpickle_connection
logger = logging.getLogger('mopidy.frontends.mpd')
class MpdFrontend(BaseFronte... |
98bd24100097473ac771dd08b19640f30970a62d | chainerrl/explorers/additive_gaussian.py | chainerrl/explorers/additive_gaussian.py | from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases() # NOQA
import numpy as np
from chainerrl import explorer
class A... | from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases() # NOQA
import numpy as np
from chainerrl import explorer
class A... | Add low and high to docstring and __repr__ | Add low and high to docstring and __repr__
| Python | mit | toslunar/chainerrl,toslunar/chainerrl | from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases() # NOQA
import numpy as np
from chainerrl import explorer
class A... | from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases() # NOQA
import numpy as np
from chainerrl import explorer
class A... | <commit_before>from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases() # NOQA
import numpy as np
from chainerrl import exp... | from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases() # NOQA
import numpy as np
from chainerrl import explorer
class A... | from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases() # NOQA
import numpy as np
from chainerrl import explorer
class A... | <commit_before>from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases() # NOQA
import numpy as np
from chainerrl import exp... |
39a534d380afea37231cc0c2ca4c8a742354d6e1 | app.py | app.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask, render_template
from sh import git
app = Flask(__name__)
version = git("rev-parse", "--short", "HEAD").strip()
@app.route("/", methods=["GET"])
def status():
"""
Status check. Display the current version of heatlamp, some basic
diag... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from flask import Flask, render_template
from sh import git
app = Flask(__name__)
version = git("rev-parse", "--short", "HEAD").strip()
command = os.getenv("HEATLAMP_COMMAND")
def validate():
"""
Validate the application configuration befor... | Configure the command that's executed. | Configure the command that's executed.
| Python | mit | heatlamp/heatlamp-core,heatlamp/heatlamp-core | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask, render_template
from sh import git
app = Flask(__name__)
version = git("rev-parse", "--short", "HEAD").strip()
@app.route("/", methods=["GET"])
def status():
"""
Status check. Display the current version of heatlamp, some basic
diag... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from flask import Flask, render_template
from sh import git
app = Flask(__name__)
version = git("rev-parse", "--short", "HEAD").strip()
command = os.getenv("HEATLAMP_COMMAND")
def validate():
"""
Validate the application configuration befor... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask, render_template
from sh import git
app = Flask(__name__)
version = git("rev-parse", "--short", "HEAD").strip()
@app.route("/", methods=["GET"])
def status():
"""
Status check. Display the current version of heatlamp, some... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from flask import Flask, render_template
from sh import git
app = Flask(__name__)
version = git("rev-parse", "--short", "HEAD").strip()
command = os.getenv("HEATLAMP_COMMAND")
def validate():
"""
Validate the application configuration befor... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask, render_template
from sh import git
app = Flask(__name__)
version = git("rev-parse", "--short", "HEAD").strip()
@app.route("/", methods=["GET"])
def status():
"""
Status check. Display the current version of heatlamp, some basic
diag... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask, render_template
from sh import git
app = Flask(__name__)
version = git("rev-parse", "--short", "HEAD").strip()
@app.route("/", methods=["GET"])
def status():
"""
Status check. Display the current version of heatlamp, some... |
603fccbbdda5fa45dcc84421901fec085fffcb81 | test/test_general.py | test/test_general.py | import hive
import threading
import time
import sys
import worker
# import pash from another directory
import pash
class ErrWorker(worker.Worker):
def work(self, command):
proc = pash.ShellProc()
proc.run(command)
return "Exit code: %s" % proc.get_val('exit_code')
def test():
apiary = hive.Hive()
apiary.crea... | import threading
import time
import sys
from busybees import worker
from busybees import hive
import pash
class ErrWorker(worker.Worker):
def work(self, command):
proc = pash.ShellProc()
proc.run(command)
return "Exit code: %s" % proc.get_val('exit_code')
def test():
apiary = hive.Hive()
apiary.create_quee... | Change imports to work with new scheme | Change imports to work with new scheme
| Python | bsd-3-clause | iansmcf/busybees | import hive
import threading
import time
import sys
import worker
# import pash from another directory
import pash
class ErrWorker(worker.Worker):
def work(self, command):
proc = pash.ShellProc()
proc.run(command)
return "Exit code: %s" % proc.get_val('exit_code')
def test():
apiary = hive.Hive()
apiary.crea... | import threading
import time
import sys
from busybees import worker
from busybees import hive
import pash
class ErrWorker(worker.Worker):
def work(self, command):
proc = pash.ShellProc()
proc.run(command)
return "Exit code: %s" % proc.get_val('exit_code')
def test():
apiary = hive.Hive()
apiary.create_quee... | <commit_before>import hive
import threading
import time
import sys
import worker
# import pash from another directory
import pash
class ErrWorker(worker.Worker):
def work(self, command):
proc = pash.ShellProc()
proc.run(command)
return "Exit code: %s" % proc.get_val('exit_code')
def test():
apiary = hive.Hive... | import threading
import time
import sys
from busybees import worker
from busybees import hive
import pash
class ErrWorker(worker.Worker):
def work(self, command):
proc = pash.ShellProc()
proc.run(command)
return "Exit code: %s" % proc.get_val('exit_code')
def test():
apiary = hive.Hive()
apiary.create_quee... | import hive
import threading
import time
import sys
import worker
# import pash from another directory
import pash
class ErrWorker(worker.Worker):
def work(self, command):
proc = pash.ShellProc()
proc.run(command)
return "Exit code: %s" % proc.get_val('exit_code')
def test():
apiary = hive.Hive()
apiary.crea... | <commit_before>import hive
import threading
import time
import sys
import worker
# import pash from another directory
import pash
class ErrWorker(worker.Worker):
def work(self, command):
proc = pash.ShellProc()
proc.run(command)
return "Exit code: %s" % proc.get_val('exit_code')
def test():
apiary = hive.Hive... |
abb23c47f503197e005637ce220a07975dc01094 | recipes/spyder-line-profiler/run_test.py | recipes/spyder-line-profiler/run_test.py | from xvfbwrapper import Xvfb
vdisplay = Xvfb()
vdisplay.start()
import spyder_line_profiler
vdisplay.stop()
| """
Test whether spyder_line_profiler is installed
The test is only whether the module can be found. It does not attempt
to import the module because this needs an X server.
"""
import imp
imp.find_module('spyder_line_profiler')
| Use imp.find_module in test for spyder-line-profiler | Use imp.find_module in test for spyder-line-profiler
| Python | bsd-3-clause | jjhelmus/staged-recipes,igortg/staged-recipes,petrushy/staged-recipes,Cashalow/staged-recipes,patricksnape/staged-recipes,conda-forge/staged-recipes,NOAA-ORR-ERD/staged-recipes,petrushy/staged-recipes,synapticarbors/staged-recipes,grlee77/staged-recipes,larray-project/staged-recipes,shadowwalkersb/staged-recipes,patric... | from xvfbwrapper import Xvfb
vdisplay = Xvfb()
vdisplay.start()
import spyder_line_profiler
vdisplay.stop()
Use imp.find_module in test for spyder-line-profiler | """
Test whether spyder_line_profiler is installed
The test is only whether the module can be found. It does not attempt
to import the module because this needs an X server.
"""
import imp
imp.find_module('spyder_line_profiler')
| <commit_before>from xvfbwrapper import Xvfb
vdisplay = Xvfb()
vdisplay.start()
import spyder_line_profiler
vdisplay.stop()
<commit_msg>Use imp.find_module in test for spyder-line-profiler<commit_after> | """
Test whether spyder_line_profiler is installed
The test is only whether the module can be found. It does not attempt
to import the module because this needs an X server.
"""
import imp
imp.find_module('spyder_line_profiler')
| from xvfbwrapper import Xvfb
vdisplay = Xvfb()
vdisplay.start()
import spyder_line_profiler
vdisplay.stop()
Use imp.find_module in test for spyder-line-profiler"""
Test whether spyder_line_profiler is installed
The test is only whether the module can be found. It does not attempt
to import the module because this nee... | <commit_before>from xvfbwrapper import Xvfb
vdisplay = Xvfb()
vdisplay.start()
import spyder_line_profiler
vdisplay.stop()
<commit_msg>Use imp.find_module in test for spyder-line-profiler<commit_after>"""
Test whether spyder_line_profiler is installed
The test is only whether the module can be found. It does not atte... |
323e24e86943fd00fc09799361c86bec6383a210 | test/tst_filepath.py | test/tst_filepath.py | import os, sys, shutil
import tempfile
import unittest
import netCDF4
class test_filepath(unittest.TestCase):
def setUp(self):
self.netcdf_file = os.path.join(os.getcwd(), "netcdf_dummy_file.nc")
self.nc = netCDF4.Dataset(self.netcdf_file)
def test_filepath(self):
assert self.nc.file... | import os, sys, shutil
import tempfile
import unittest
import netCDF4
class test_filepath(unittest.TestCase):
def setUp(self):
self.netcdf_file = os.path.join(os.getcwd(), "netcdf_dummy_file.nc")
self.nc = netCDF4.Dataset(self.netcdf_file)
def test_filepath(self):
assert self.nc.file... | Use assertRaisesRegex instead of assertRaisesRegexp for Python 3.11 compatibility. | Use assertRaisesRegex instead of assertRaisesRegexp for Python 3.11 compatibility.
| Python | mit | Unidata/netcdf4-python,Unidata/netcdf4-python,Unidata/netcdf4-python | import os, sys, shutil
import tempfile
import unittest
import netCDF4
class test_filepath(unittest.TestCase):
def setUp(self):
self.netcdf_file = os.path.join(os.getcwd(), "netcdf_dummy_file.nc")
self.nc = netCDF4.Dataset(self.netcdf_file)
def test_filepath(self):
assert self.nc.file... | import os, sys, shutil
import tempfile
import unittest
import netCDF4
class test_filepath(unittest.TestCase):
def setUp(self):
self.netcdf_file = os.path.join(os.getcwd(), "netcdf_dummy_file.nc")
self.nc = netCDF4.Dataset(self.netcdf_file)
def test_filepath(self):
assert self.nc.file... | <commit_before>import os, sys, shutil
import tempfile
import unittest
import netCDF4
class test_filepath(unittest.TestCase):
def setUp(self):
self.netcdf_file = os.path.join(os.getcwd(), "netcdf_dummy_file.nc")
self.nc = netCDF4.Dataset(self.netcdf_file)
def test_filepath(self):
asse... | import os, sys, shutil
import tempfile
import unittest
import netCDF4
class test_filepath(unittest.TestCase):
def setUp(self):
self.netcdf_file = os.path.join(os.getcwd(), "netcdf_dummy_file.nc")
self.nc = netCDF4.Dataset(self.netcdf_file)
def test_filepath(self):
assert self.nc.file... | import os, sys, shutil
import tempfile
import unittest
import netCDF4
class test_filepath(unittest.TestCase):
def setUp(self):
self.netcdf_file = os.path.join(os.getcwd(), "netcdf_dummy_file.nc")
self.nc = netCDF4.Dataset(self.netcdf_file)
def test_filepath(self):
assert self.nc.file... | <commit_before>import os, sys, shutil
import tempfile
import unittest
import netCDF4
class test_filepath(unittest.TestCase):
def setUp(self):
self.netcdf_file = os.path.join(os.getcwd(), "netcdf_dummy_file.nc")
self.nc = netCDF4.Dataset(self.netcdf_file)
def test_filepath(self):
asse... |
4ff1eb00f8e212d280ac858feb4efcc795d97d80 | tests/test_models.py | tests/test_models.py | import pytest
from suddendev.models import GameController
def test_create_game(session):
pass
| import pytest
from suddendev.models import GameSetup
def test_create_game(session):
game_setup = GameSetup('ASDF')
assert game_setup.player_count == 1
| Fix broken import in model tests. | [NG] Fix broken import in model tests.
| Python | mit | SuddenDevs/SuddenDev,SuddenDevs/SuddenDev,SuddenDevs/SuddenDev,SuddenDevs/SuddenDev | import pytest
from suddendev.models import GameController
def test_create_game(session):
pass
[NG] Fix broken import in model tests. | import pytest
from suddendev.models import GameSetup
def test_create_game(session):
game_setup = GameSetup('ASDF')
assert game_setup.player_count == 1
| <commit_before>import pytest
from suddendev.models import GameController
def test_create_game(session):
pass
<commit_msg>[NG] Fix broken import in model tests.<commit_after> | import pytest
from suddendev.models import GameSetup
def test_create_game(session):
game_setup = GameSetup('ASDF')
assert game_setup.player_count == 1
| import pytest
from suddendev.models import GameController
def test_create_game(session):
pass
[NG] Fix broken import in model tests.import pytest
from suddendev.models import GameSetup
def test_create_game(session):
game_setup = GameSetup('ASDF')
assert game_setup.player_count == 1
| <commit_before>import pytest
from suddendev.models import GameController
def test_create_game(session):
pass
<commit_msg>[NG] Fix broken import in model tests.<commit_after>import pytest
from suddendev.models import GameSetup
def test_create_game(session):
game_setup = GameSetup('ASDF')
assert game_setu... |
5b046f74c794737b9f1b9534ce0d9f635fe31210 | record.py | record.py | #!/usr/bin/env python
# record.py - List a calling context tree.
import argparse
from cct import CCT
import json
from lldbRecorder import lldbRecorder
def main():
parser = argparse.ArgumentParser(description='Record a calling context tree.')
parser.add_argument('executable', help='Executable to run (any addi... | #!/usr/bin/env python
# record.py - List a calling context tree.
#
# FIXME(phil): Switch to a kernel-level function tracing (dtrace, utrace/systemtap, etc.) over LLDB.
# Kernel hooks are difficult to use for reliably recording all function calls in complex codebases
# due to inlining, RVO, etc (see [1]). Relying on LL... | Add note about why lldbRecorder is used, and a FIXME to use kernel hooks in the future | Add note about why lldbRecorder is used, and a FIXME to use kernel hooks in the future
| Python | apache-2.0 | progers/cctdb,progers/cctdb | #!/usr/bin/env python
# record.py - List a calling context tree.
import argparse
from cct import CCT
import json
from lldbRecorder import lldbRecorder
def main():
parser = argparse.ArgumentParser(description='Record a calling context tree.')
parser.add_argument('executable', help='Executable to run (any addi... | #!/usr/bin/env python
# record.py - List a calling context tree.
#
# FIXME(phil): Switch to a kernel-level function tracing (dtrace, utrace/systemtap, etc.) over LLDB.
# Kernel hooks are difficult to use for reliably recording all function calls in complex codebases
# due to inlining, RVO, etc (see [1]). Relying on LL... | <commit_before>#!/usr/bin/env python
# record.py - List a calling context tree.
import argparse
from cct import CCT
import json
from lldbRecorder import lldbRecorder
def main():
parser = argparse.ArgumentParser(description='Record a calling context tree.')
parser.add_argument('executable', help='Executable t... | #!/usr/bin/env python
# record.py - List a calling context tree.
#
# FIXME(phil): Switch to a kernel-level function tracing (dtrace, utrace/systemtap, etc.) over LLDB.
# Kernel hooks are difficult to use for reliably recording all function calls in complex codebases
# due to inlining, RVO, etc (see [1]). Relying on LL... | #!/usr/bin/env python
# record.py - List a calling context tree.
import argparse
from cct import CCT
import json
from lldbRecorder import lldbRecorder
def main():
parser = argparse.ArgumentParser(description='Record a calling context tree.')
parser.add_argument('executable', help='Executable to run (any addi... | <commit_before>#!/usr/bin/env python
# record.py - List a calling context tree.
import argparse
from cct import CCT
import json
from lldbRecorder import lldbRecorder
def main():
parser = argparse.ArgumentParser(description='Record a calling context tree.')
parser.add_argument('executable', help='Executable t... |
8b9124dc957b1ee1626dd227f6f709b8700dfdb8 | OneDriveUploader/config.py | OneDriveUploader/config.py | from os.path import join, dirname
from dotenv import load_dotenv, find_dotenv
dotenv_path = join(dirname(__file__), '.env')
load_dotenv(find_dotenv())
client = dict(id = '8dfcc6ca-304f-4351-a2c9-299e72eb8605')
urls = dict(redirect = 'http://localhost:8080',
discovery = 'https://api.office.com/discovery/',
au... | from os.path import join, dirname
from dotenv import load_dotenv, find_dotenv
dotenv_path = join(dirname(__file__), '.env')
load_dotenv(find_dotenv())
client = dict(id = '8dfcc6ca-304f-4351-a2c9-299e72eb8605')
urls = dict(redirect = 'http://localhost:8081',
discovery = 'https://api.office.com/discovery/',
au... | Change local web server's URL | Change local web server's URL
| Python | mit | SimeoneVilardo/OneDriveUploader | from os.path import join, dirname
from dotenv import load_dotenv, find_dotenv
dotenv_path = join(dirname(__file__), '.env')
load_dotenv(find_dotenv())
client = dict(id = '8dfcc6ca-304f-4351-a2c9-299e72eb8605')
urls = dict(redirect = 'http://localhost:8080',
discovery = 'https://api.office.com/discovery/',
au... | from os.path import join, dirname
from dotenv import load_dotenv, find_dotenv
dotenv_path = join(dirname(__file__), '.env')
load_dotenv(find_dotenv())
client = dict(id = '8dfcc6ca-304f-4351-a2c9-299e72eb8605')
urls = dict(redirect = 'http://localhost:8081',
discovery = 'https://api.office.com/discovery/',
au... | <commit_before>from os.path import join, dirname
from dotenv import load_dotenv, find_dotenv
dotenv_path = join(dirname(__file__), '.env')
load_dotenv(find_dotenv())
client = dict(id = '8dfcc6ca-304f-4351-a2c9-299e72eb8605')
urls = dict(redirect = 'http://localhost:8080',
discovery = 'https://api.office.com/disc... | from os.path import join, dirname
from dotenv import load_dotenv, find_dotenv
dotenv_path = join(dirname(__file__), '.env')
load_dotenv(find_dotenv())
client = dict(id = '8dfcc6ca-304f-4351-a2c9-299e72eb8605')
urls = dict(redirect = 'http://localhost:8081',
discovery = 'https://api.office.com/discovery/',
au... | from os.path import join, dirname
from dotenv import load_dotenv, find_dotenv
dotenv_path = join(dirname(__file__), '.env')
load_dotenv(find_dotenv())
client = dict(id = '8dfcc6ca-304f-4351-a2c9-299e72eb8605')
urls = dict(redirect = 'http://localhost:8080',
discovery = 'https://api.office.com/discovery/',
au... | <commit_before>from os.path import join, dirname
from dotenv import load_dotenv, find_dotenv
dotenv_path = join(dirname(__file__), '.env')
load_dotenv(find_dotenv())
client = dict(id = '8dfcc6ca-304f-4351-a2c9-299e72eb8605')
urls = dict(redirect = 'http://localhost:8080',
discovery = 'https://api.office.com/disc... |
9e413449f6f85e0cf9465762e31e8f251e14c23e | spacy/tests/regression/test_issue1537.py | spacy/tests/regression/test_issue1537.py | '''Test Span.as_doc() doesn't segfault'''
from ...tokens import Doc
from ...vocab import Vocab
from ... import load as load_spacy
def test_issue1537():
string = 'The sky is blue . The man is pink . The dog is purple .'
doc = Doc(Vocab(), words=string.split())
doc[0].sent_start = True
for word in doc[... | '''Test Span.as_doc() doesn't segfault'''
from __future__ import unicode_literals
from ...tokens import Doc
from ...vocab import Vocab
from ... import load as load_spacy
def test_issue1537():
string = 'The sky is blue . The man is pink . The dog is purple .'
doc = Doc(Vocab(), words=string.split())
doc[0... | Fix unicode error in new test | Fix unicode error in new test
| Python | mit | spacy-io/spaCy,explosion/spaCy,explosion/spaCy,spacy-io/spaCy,recognai/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,honnibal/spaCy,honnibal/spaCy,aikramer2/spaCy,recognai/spaCy,honnibal/spaCy,recognai/spaCy,explosion/spaCy,recognai/spaCy,aikramer2/spaCy,recognai/spaCy,aikramer2/spaCy,honnibal/spaCy,aikramer2/sp... | '''Test Span.as_doc() doesn't segfault'''
from ...tokens import Doc
from ...vocab import Vocab
from ... import load as load_spacy
def test_issue1537():
string = 'The sky is blue . The man is pink . The dog is purple .'
doc = Doc(Vocab(), words=string.split())
doc[0].sent_start = True
for word in doc[... | '''Test Span.as_doc() doesn't segfault'''
from __future__ import unicode_literals
from ...tokens import Doc
from ...vocab import Vocab
from ... import load as load_spacy
def test_issue1537():
string = 'The sky is blue . The man is pink . The dog is purple .'
doc = Doc(Vocab(), words=string.split())
doc[0... | <commit_before>'''Test Span.as_doc() doesn't segfault'''
from ...tokens import Doc
from ...vocab import Vocab
from ... import load as load_spacy
def test_issue1537():
string = 'The sky is blue . The man is pink . The dog is purple .'
doc = Doc(Vocab(), words=string.split())
doc[0].sent_start = True
f... | '''Test Span.as_doc() doesn't segfault'''
from __future__ import unicode_literals
from ...tokens import Doc
from ...vocab import Vocab
from ... import load as load_spacy
def test_issue1537():
string = 'The sky is blue . The man is pink . The dog is purple .'
doc = Doc(Vocab(), words=string.split())
doc[0... | '''Test Span.as_doc() doesn't segfault'''
from ...tokens import Doc
from ...vocab import Vocab
from ... import load as load_spacy
def test_issue1537():
string = 'The sky is blue . The man is pink . The dog is purple .'
doc = Doc(Vocab(), words=string.split())
doc[0].sent_start = True
for word in doc[... | <commit_before>'''Test Span.as_doc() doesn't segfault'''
from ...tokens import Doc
from ...vocab import Vocab
from ... import load as load_spacy
def test_issue1537():
string = 'The sky is blue . The man is pink . The dog is purple .'
doc = Doc(Vocab(), words=string.split())
doc[0].sent_start = True
f... |
df9dc6f613916cd96f626e2b337f8d9fe15bb864 | tests/test_cayley_client.py | tests/test_cayley_client.py | from unittest import TestCase
from pyley import CayleyClient, GraphObject
class CayleyClientTests(TestCase):
def test_send(self):
client = CayleyClient()
g = GraphObject()
query = g.V().Has("name", "Casablanca") \
.Out("/film/film/starring") \
.Out("/film/performanc... | from unittest import TestCase
import unittest
from pyley import CayleyClient, GraphObject
class CayleyClientTests(TestCase):
@unittest.skip('Disabled for now!')
def test_send(self):
client = CayleyClient()
g = GraphObject()
query = g.V().Has("name", "Casablanca") \
.Out("/f... | Add skip attribute for CayleyClient send test. | Add skip attribute for CayleyClient send test.
| Python | unlicense | ziyasal/pyley,ziyasal/pyley,joshainglis/pyley,joshainglis/pyley | from unittest import TestCase
from pyley import CayleyClient, GraphObject
class CayleyClientTests(TestCase):
def test_send(self):
client = CayleyClient()
g = GraphObject()
query = g.V().Has("name", "Casablanca") \
.Out("/film/film/starring") \
.Out("/film/performanc... | from unittest import TestCase
import unittest
from pyley import CayleyClient, GraphObject
class CayleyClientTests(TestCase):
@unittest.skip('Disabled for now!')
def test_send(self):
client = CayleyClient()
g = GraphObject()
query = g.V().Has("name", "Casablanca") \
.Out("/f... | <commit_before>from unittest import TestCase
from pyley import CayleyClient, GraphObject
class CayleyClientTests(TestCase):
def test_send(self):
client = CayleyClient()
g = GraphObject()
query = g.V().Has("name", "Casablanca") \
.Out("/film/film/starring") \
.Out("/... | from unittest import TestCase
import unittest
from pyley import CayleyClient, GraphObject
class CayleyClientTests(TestCase):
@unittest.skip('Disabled for now!')
def test_send(self):
client = CayleyClient()
g = GraphObject()
query = g.V().Has("name", "Casablanca") \
.Out("/f... | from unittest import TestCase
from pyley import CayleyClient, GraphObject
class CayleyClientTests(TestCase):
def test_send(self):
client = CayleyClient()
g = GraphObject()
query = g.V().Has("name", "Casablanca") \
.Out("/film/film/starring") \
.Out("/film/performanc... | <commit_before>from unittest import TestCase
from pyley import CayleyClient, GraphObject
class CayleyClientTests(TestCase):
def test_send(self):
client = CayleyClient()
g = GraphObject()
query = g.V().Has("name", "Casablanca") \
.Out("/film/film/starring") \
.Out("/... |
0a9f2d46325ce6856a3979127390f2e48357abd9 | schedule2stimuli.py | schedule2stimuli.py | #!/usr/bin/python
import csv
import pprint
p = 0
# read schedule (from SCRT)
schedule_f = 'schedule_' + str(p)
inf = open(schedule_f,'r')
for line in inf.readlines():
line = line.rstrip()
schedule = line.split(' ')
inf.close()
# allocate stimuli
a = 0
b = []
phase = ''
for session in range(1,36):
print ... | #!/usr/bin/python
import csv
import pprint
p = 0
# read schedule (from SCRT)
schedule_f = 'schedule_' + str(p)
inf = open(schedule_f,'r')
for line in inf.readlines():
line = line.rstrip()
schedule = line.split(' ')
inf.close()
# allocate stimuli and write csv
a = 0
b = []
phase = ''
csvfile = ... | Write stimuli schedule to csv file. | Write stimuli schedule to csv file.
| Python | cc0-1.0 | earcanal/dotprobe,earcanal/dotprobe,earcanal/dotprobe | #!/usr/bin/python
import csv
import pprint
p = 0
# read schedule (from SCRT)
schedule_f = 'schedule_' + str(p)
inf = open(schedule_f,'r')
for line in inf.readlines():
line = line.rstrip()
schedule = line.split(' ')
inf.close()
# allocate stimuli
a = 0
b = []
phase = ''
for session in range(1,36):
print ... | #!/usr/bin/python
import csv
import pprint
p = 0
# read schedule (from SCRT)
schedule_f = 'schedule_' + str(p)
inf = open(schedule_f,'r')
for line in inf.readlines():
line = line.rstrip()
schedule = line.split(' ')
inf.close()
# allocate stimuli and write csv
a = 0
b = []
phase = ''
csvfile = ... | <commit_before>#!/usr/bin/python
import csv
import pprint
p = 0
# read schedule (from SCRT)
schedule_f = 'schedule_' + str(p)
inf = open(schedule_f,'r')
for line in inf.readlines():
line = line.rstrip()
schedule = line.split(' ')
inf.close()
# allocate stimuli
a = 0
b = []
phase = ''
for session in range(1,... | #!/usr/bin/python
import csv
import pprint
p = 0
# read schedule (from SCRT)
schedule_f = 'schedule_' + str(p)
inf = open(schedule_f,'r')
for line in inf.readlines():
line = line.rstrip()
schedule = line.split(' ')
inf.close()
# allocate stimuli and write csv
a = 0
b = []
phase = ''
csvfile = ... | #!/usr/bin/python
import csv
import pprint
p = 0
# read schedule (from SCRT)
schedule_f = 'schedule_' + str(p)
inf = open(schedule_f,'r')
for line in inf.readlines():
line = line.rstrip()
schedule = line.split(' ')
inf.close()
# allocate stimuli
a = 0
b = []
phase = ''
for session in range(1,36):
print ... | <commit_before>#!/usr/bin/python
import csv
import pprint
p = 0
# read schedule (from SCRT)
schedule_f = 'schedule_' + str(p)
inf = open(schedule_f,'r')
for line in inf.readlines():
line = line.rstrip()
schedule = line.split(' ')
inf.close()
# allocate stimuli
a = 0
b = []
phase = ''
for session in range(1,... |
0dfc3ab0537757bb5e4b5cc6918024c4ea75ed94 | fs/archive/opener.py | fs/archive/opener.py | # coding: utf-8
from __future__ import absolute_import
from __future__ import unicode_literals
import contextlib
from pkg_resources import iter_entry_points
from ..opener import open_fs
from ..opener._errors import Unsupported
from ..path import basename
@contextlib.contextmanager
def open_archive(fs_url, archive):
... | # coding: utf-8
from __future__ import absolute_import
from __future__ import unicode_literals
import contextlib
from pkg_resources import iter_entry_points
from ..opener import open_fs
from ..opener._errors import Unsupported
from ..path import basename
@contextlib.contextmanager
def open_archive(fs_url, archive):
... | Patch binfile name only when needed in open_archive | Patch binfile name only when needed in open_archive
| Python | mit | althonos/fs.archive | # coding: utf-8
from __future__ import absolute_import
from __future__ import unicode_literals
import contextlib
from pkg_resources import iter_entry_points
from ..opener import open_fs
from ..opener._errors import Unsupported
from ..path import basename
@contextlib.contextmanager
def open_archive(fs_url, archive):
... | # coding: utf-8
from __future__ import absolute_import
from __future__ import unicode_literals
import contextlib
from pkg_resources import iter_entry_points
from ..opener import open_fs
from ..opener._errors import Unsupported
from ..path import basename
@contextlib.contextmanager
def open_archive(fs_url, archive):
... | <commit_before># coding: utf-8
from __future__ import absolute_import
from __future__ import unicode_literals
import contextlib
from pkg_resources import iter_entry_points
from ..opener import open_fs
from ..opener._errors import Unsupported
from ..path import basename
@contextlib.contextmanager
def open_archive(fs_... | # coding: utf-8
from __future__ import absolute_import
from __future__ import unicode_literals
import contextlib
from pkg_resources import iter_entry_points
from ..opener import open_fs
from ..opener._errors import Unsupported
from ..path import basename
@contextlib.contextmanager
def open_archive(fs_url, archive):
... | # coding: utf-8
from __future__ import absolute_import
from __future__ import unicode_literals
import contextlib
from pkg_resources import iter_entry_points
from ..opener import open_fs
from ..opener._errors import Unsupported
from ..path import basename
@contextlib.contextmanager
def open_archive(fs_url, archive):
... | <commit_before># coding: utf-8
from __future__ import absolute_import
from __future__ import unicode_literals
import contextlib
from pkg_resources import iter_entry_points
from ..opener import open_fs
from ..opener._errors import Unsupported
from ..path import basename
@contextlib.contextmanager
def open_archive(fs_... |
f061499b9d415b7471edf072c81b93ce5453494d | githubtrending/utils.py | githubtrending/utils.py | import os
def get_console_size():
'''
returns no of rows, no of cols
'''
return map(int, os.popen('stty size', 'r').read().split())
def get_print_size_for_repo(data):
name, lang, star = [0]*3
for each in data:
repo_name, desc, [stars, language] = each
name = max(len(repo_name... | import os
def get_console_size():
'''
returns no of rows, no of cols
'''
with os.popen('stty size', 'r') as f:
size = map(int, f.read().split())
return size
def get_print_size_for_repo(data):
name, lang, star = [0]*3
for each in data:
repo_name, desc, [stars, language] = e... | Refactor get_console_size to close file after reading | Utils: Refactor get_console_size to close file after reading
| Python | mit | staranjeet/github-trending-cli | import os
def get_console_size():
'''
returns no of rows, no of cols
'''
return map(int, os.popen('stty size', 'r').read().split())
def get_print_size_for_repo(data):
name, lang, star = [0]*3
for each in data:
repo_name, desc, [stars, language] = each
name = max(len(repo_name... | import os
def get_console_size():
'''
returns no of rows, no of cols
'''
with os.popen('stty size', 'r') as f:
size = map(int, f.read().split())
return size
def get_print_size_for_repo(data):
name, lang, star = [0]*3
for each in data:
repo_name, desc, [stars, language] = e... | <commit_before>import os
def get_console_size():
'''
returns no of rows, no of cols
'''
return map(int, os.popen('stty size', 'r').read().split())
def get_print_size_for_repo(data):
name, lang, star = [0]*3
for each in data:
repo_name, desc, [stars, language] = each
name = ma... | import os
def get_console_size():
'''
returns no of rows, no of cols
'''
with os.popen('stty size', 'r') as f:
size = map(int, f.read().split())
return size
def get_print_size_for_repo(data):
name, lang, star = [0]*3
for each in data:
repo_name, desc, [stars, language] = e... | import os
def get_console_size():
'''
returns no of rows, no of cols
'''
return map(int, os.popen('stty size', 'r').read().split())
def get_print_size_for_repo(data):
name, lang, star = [0]*3
for each in data:
repo_name, desc, [stars, language] = each
name = max(len(repo_name... | <commit_before>import os
def get_console_size():
'''
returns no of rows, no of cols
'''
return map(int, os.popen('stty size', 'r').read().split())
def get_print_size_for_repo(data):
name, lang, star = [0]*3
for each in data:
repo_name, desc, [stars, language] = each
name = ma... |
237b66c8b9cef714b64a75b1f20a79a4357c71b5 | apps/continiousauth/serializers.py | apps/continiousauth/serializers.py | from rest_framework import serializers
from .models import AuthenticationSession
class AuthenticationSessionSerializer(serializers.ModelSerializer):
class Meta:
model = AuthenticationSession
fields = ('application', 'external_session_id', 'session_photo_bytes', 'flag', 'start_time', 'end_time')
| from rest_framework import serializers
from .models import AuthenticationSession
class AuthenticationSessionSerializer(serializers.ModelSerializer):
class Meta:
model = AuthenticationSession
fields = ('application', 'external_session_id', 'session_photo_bytes', 'flag')
| Change serializer to omit dates | Change serializer to omit dates
| Python | mit | larserikgk/mobiauth-server,larserikgk/mobiauth-server,larserikgk/mobiauth-server | from rest_framework import serializers
from .models import AuthenticationSession
class AuthenticationSessionSerializer(serializers.ModelSerializer):
class Meta:
model = AuthenticationSession
fields = ('application', 'external_session_id', 'session_photo_bytes', 'flag', 'start_time', 'end_time')
C... | from rest_framework import serializers
from .models import AuthenticationSession
class AuthenticationSessionSerializer(serializers.ModelSerializer):
class Meta:
model = AuthenticationSession
fields = ('application', 'external_session_id', 'session_photo_bytes', 'flag')
| <commit_before>from rest_framework import serializers
from .models import AuthenticationSession
class AuthenticationSessionSerializer(serializers.ModelSerializer):
class Meta:
model = AuthenticationSession
fields = ('application', 'external_session_id', 'session_photo_bytes', 'flag', 'start_time'... | from rest_framework import serializers
from .models import AuthenticationSession
class AuthenticationSessionSerializer(serializers.ModelSerializer):
class Meta:
model = AuthenticationSession
fields = ('application', 'external_session_id', 'session_photo_bytes', 'flag')
| from rest_framework import serializers
from .models import AuthenticationSession
class AuthenticationSessionSerializer(serializers.ModelSerializer):
class Meta:
model = AuthenticationSession
fields = ('application', 'external_session_id', 'session_photo_bytes', 'flag', 'start_time', 'end_time')
C... | <commit_before>from rest_framework import serializers
from .models import AuthenticationSession
class AuthenticationSessionSerializer(serializers.ModelSerializer):
class Meta:
model = AuthenticationSession
fields = ('application', 'external_session_id', 'session_photo_bytes', 'flag', 'start_time'... |
aec33e5eaf40deed73c580a170714810229678fc | treetojson.py | treetojson.py | # !/usr/bin/env python
# coding: utf-8
"""
Converts a list or a list with a given regex grammar which contains a tree structure into a valid JSON.
This module works with both Python 2 and 3.
"""
__version__ = '0.1'
version = __version__
import logging
from nltk.chunk.regexp import *
LOG = logging.getLogger("treet... | # !/usr/bin/env python
# coding: utf-8
"""
Converts a list or a list with a given regex grammar which contains a tree structure into a valid JSON.
This module works with both Python 2 and 3.
"""
__version__ = '0.1'
version = __version__
import logging
from nltk.chunk.regexp import *
LOG = logging.getLogger("treet... | Add get_json method to provide json output | Add get_json method to provide json output
| Python | mit | saadsahibjan/treetojson | # !/usr/bin/env python
# coding: utf-8
"""
Converts a list or a list with a given regex grammar which contains a tree structure into a valid JSON.
This module works with both Python 2 and 3.
"""
__version__ = '0.1'
version = __version__
import logging
from nltk.chunk.regexp import *
LOG = logging.getLogger("treet... | # !/usr/bin/env python
# coding: utf-8
"""
Converts a list or a list with a given regex grammar which contains a tree structure into a valid JSON.
This module works with both Python 2 and 3.
"""
__version__ = '0.1'
version = __version__
import logging
from nltk.chunk.regexp import *
LOG = logging.getLogger("treet... | <commit_before># !/usr/bin/env python
# coding: utf-8
"""
Converts a list or a list with a given regex grammar which contains a tree structure into a valid JSON.
This module works with both Python 2 and 3.
"""
__version__ = '0.1'
version = __version__
import logging
from nltk.chunk.regexp import *
LOG = logging.g... | # !/usr/bin/env python
# coding: utf-8
"""
Converts a list or a list with a given regex grammar which contains a tree structure into a valid JSON.
This module works with both Python 2 and 3.
"""
__version__ = '0.1'
version = __version__
import logging
from nltk.chunk.regexp import *
LOG = logging.getLogger("treet... | # !/usr/bin/env python
# coding: utf-8
"""
Converts a list or a list with a given regex grammar which contains a tree structure into a valid JSON.
This module works with both Python 2 and 3.
"""
__version__ = '0.1'
version = __version__
import logging
from nltk.chunk.regexp import *
LOG = logging.getLogger("treet... | <commit_before># !/usr/bin/env python
# coding: utf-8
"""
Converts a list or a list with a given regex grammar which contains a tree structure into a valid JSON.
This module works with both Python 2 and 3.
"""
__version__ = '0.1'
version = __version__
import logging
from nltk.chunk.regexp import *
LOG = logging.g... |
dbb668c3f72ab6d20abe08f9f23b7d66cfa0d8c3 | ideascube/blog/forms.py | ideascube/blog/forms.py | from django import forms
from ideascube.widgets import LangSelect
from .models import Content
class ContentForm(forms.ModelForm):
class Meta:
model = Content
widgets = {
# We need a normalized date string for JS datepicker, so we take
# control over the format to bypass ... | from django import forms
from ideascube.widgets import LangSelect
from .models import Content
class ContentForm(forms.ModelForm):
use_required_attribute = False
class Meta:
model = Content
widgets = {
# We need a normalized date string for JS datepicker, so we take
#... | Fix the blog content form | Fix the blog content form
The form plays a trick on the 'text' field: it hides it, and creates a
nicer-looking 'content' field. When submitting the form, the content of
the 'content' field is injected into the 'text' field.
This works great, until Django 1.10.
With Django 1.10, the browser refuses to submit the form... | Python | agpl-3.0 | ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,ideascube/ideascube | from django import forms
from ideascube.widgets import LangSelect
from .models import Content
class ContentForm(forms.ModelForm):
class Meta:
model = Content
widgets = {
# We need a normalized date string for JS datepicker, so we take
# control over the format to bypass ... | from django import forms
from ideascube.widgets import LangSelect
from .models import Content
class ContentForm(forms.ModelForm):
use_required_attribute = False
class Meta:
model = Content
widgets = {
# We need a normalized date string for JS datepicker, so we take
#... | <commit_before>from django import forms
from ideascube.widgets import LangSelect
from .models import Content
class ContentForm(forms.ModelForm):
class Meta:
model = Content
widgets = {
# We need a normalized date string for JS datepicker, so we take
# control over the fo... | from django import forms
from ideascube.widgets import LangSelect
from .models import Content
class ContentForm(forms.ModelForm):
use_required_attribute = False
class Meta:
model = Content
widgets = {
# We need a normalized date string for JS datepicker, so we take
#... | from django import forms
from ideascube.widgets import LangSelect
from .models import Content
class ContentForm(forms.ModelForm):
class Meta:
model = Content
widgets = {
# We need a normalized date string for JS datepicker, so we take
# control over the format to bypass ... | <commit_before>from django import forms
from ideascube.widgets import LangSelect
from .models import Content
class ContentForm(forms.ModelForm):
class Meta:
model = Content
widgets = {
# We need a normalized date string for JS datepicker, so we take
# control over the fo... |
4b80c061073857cffebcb23cf2e597919318e1ba | db/__init__.py | db/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from .common import session_scope
def commit_db_item(db_item, add=False):
with session_scope() as session:
if add:
session.add(db_item)
else:
session.merge(db_item)
session.commit()
def create_or_update_db_item(db_ite... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
from .common import session_scope
logger = logging.getLogger()
def commit_db_item(db_item, add=False):
with session_scope() as session:
if add:
session.add(db_item)
else:
session.merge(db_item)
session.... | Add alternate function to create or update database item | Add alternate function to create or update database item
| Python | mit | leaffan/pynhldb | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from .common import session_scope
def commit_db_item(db_item, add=False):
with session_scope() as session:
if add:
session.add(db_item)
else:
session.merge(db_item)
session.commit()
def create_or_update_db_item(db_ite... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
from .common import session_scope
logger = logging.getLogger()
def commit_db_item(db_item, add=False):
with session_scope() as session:
if add:
session.add(db_item)
else:
session.merge(db_item)
session.... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from .common import session_scope
def commit_db_item(db_item, add=False):
with session_scope() as session:
if add:
session.add(db_item)
else:
session.merge(db_item)
session.commit()
def create_or_update... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
from .common import session_scope
logger = logging.getLogger()
def commit_db_item(db_item, add=False):
with session_scope() as session:
if add:
session.add(db_item)
else:
session.merge(db_item)
session.... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from .common import session_scope
def commit_db_item(db_item, add=False):
with session_scope() as session:
if add:
session.add(db_item)
else:
session.merge(db_item)
session.commit()
def create_or_update_db_item(db_ite... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from .common import session_scope
def commit_db_item(db_item, add=False):
with session_scope() as session:
if add:
session.add(db_item)
else:
session.merge(db_item)
session.commit()
def create_or_update... |
2d0901eb60302750cd42007241d4e0f6010bea7c | pypeerassets/provider/rpcnode.py | pypeerassets/provider/rpcnode.py |
'''Communicate with local or remote peercoin-daemon via JSON-RPC'''
from operator import itemgetter
try:
from peercoin_rpc import Client
except:
raise EnvironmentError("peercoin_rpc library is required for this to work,\
use pip to install it.")
def select_inputs(cls, total_amoun... |
'''Communicate with local or remote peercoin-daemon via JSON-RPC'''
from operator import itemgetter
try:
from peercoin_rpc import Client
except:
raise EnvironmentError("peercoin_rpc library is required for this to work,\
use pip to install it.")
def select_inputs(cls, total_amoun... | Return dict with selected utxo list and total | Return dict with selected utxo list and total | Python | bsd-3-clause | backpacker69/pypeerassets,PeerAssets/pypeerassets |
'''Communicate with local or remote peercoin-daemon via JSON-RPC'''
from operator import itemgetter
try:
from peercoin_rpc import Client
except:
raise EnvironmentError("peercoin_rpc library is required for this to work,\
use pip to install it.")
def select_inputs(cls, total_amoun... |
'''Communicate with local or remote peercoin-daemon via JSON-RPC'''
from operator import itemgetter
try:
from peercoin_rpc import Client
except:
raise EnvironmentError("peercoin_rpc library is required for this to work,\
use pip to install it.")
def select_inputs(cls, total_amoun... | <commit_before>
'''Communicate with local or remote peercoin-daemon via JSON-RPC'''
from operator import itemgetter
try:
from peercoin_rpc import Client
except:
raise EnvironmentError("peercoin_rpc library is required for this to work,\
use pip to install it.")
def select_inputs(c... |
'''Communicate with local or remote peercoin-daemon via JSON-RPC'''
from operator import itemgetter
try:
from peercoin_rpc import Client
except:
raise EnvironmentError("peercoin_rpc library is required for this to work,\
use pip to install it.")
def select_inputs(cls, total_amoun... |
'''Communicate with local or remote peercoin-daemon via JSON-RPC'''
from operator import itemgetter
try:
from peercoin_rpc import Client
except:
raise EnvironmentError("peercoin_rpc library is required for this to work,\
use pip to install it.")
def select_inputs(cls, total_amoun... | <commit_before>
'''Communicate with local or remote peercoin-daemon via JSON-RPC'''
from operator import itemgetter
try:
from peercoin_rpc import Client
except:
raise EnvironmentError("peercoin_rpc library is required for this to work,\
use pip to install it.")
def select_inputs(c... |
c3792ccdde5a44979f34d84cebad722c7a64ab64 | juliet_importer.py | juliet_importer.py | import os
import imp
modules = {}
def load_modules(path="./modules/"): # Consider adding recursive sorting at some point in the future
names = os.listdir(path)
for name in names:
if not name.endswith(".py"): continue
print("Importing module {0}".format(name))
name = name.split('.')[0]
... | import os
import imp
modules = {}
def load_modules(path="./modules/"): # Consider adding recursive searching at some point in the future
modules['juliet_module'] = imp.load_source('juliet_module', path + "juliet_module.py")
names = os.listdir(path)
for name in names:
if not name.endswith(".py"): c... | Change juliet_module to load before other modules for dependency reasons | Change juliet_module to load before other modules for dependency reasons
| Python | bsd-2-clause | halfbro/juliet | import os
import imp
modules = {}
def load_modules(path="./modules/"): # Consider adding recursive sorting at some point in the future
names = os.listdir(path)
for name in names:
if not name.endswith(".py"): continue
print("Importing module {0}".format(name))
name = name.split('.')[0]
... | import os
import imp
modules = {}
def load_modules(path="./modules/"): # Consider adding recursive searching at some point in the future
modules['juliet_module'] = imp.load_source('juliet_module', path + "juliet_module.py")
names = os.listdir(path)
for name in names:
if not name.endswith(".py"): c... | <commit_before>import os
import imp
modules = {}
def load_modules(path="./modules/"): # Consider adding recursive sorting at some point in the future
names = os.listdir(path)
for name in names:
if not name.endswith(".py"): continue
print("Importing module {0}".format(name))
name = name... | import os
import imp
modules = {}
def load_modules(path="./modules/"): # Consider adding recursive searching at some point in the future
modules['juliet_module'] = imp.load_source('juliet_module', path + "juliet_module.py")
names = os.listdir(path)
for name in names:
if not name.endswith(".py"): c... | import os
import imp
modules = {}
def load_modules(path="./modules/"): # Consider adding recursive sorting at some point in the future
names = os.listdir(path)
for name in names:
if not name.endswith(".py"): continue
print("Importing module {0}".format(name))
name = name.split('.')[0]
... | <commit_before>import os
import imp
modules = {}
def load_modules(path="./modules/"): # Consider adding recursive sorting at some point in the future
names = os.listdir(path)
for name in names:
if not name.endswith(".py"): continue
print("Importing module {0}".format(name))
name = name... |
33ceea40e41d9f568b11e30779b8b7c16ba8f5b8 | bench/split-file.py | bench/split-file.py | """
Split out a monolithic file with many different runs of
indexed_search.py. The resulting files are meant for use in
get-figures.py.
Usage: python split-file.py prefix filename
"""
import sys
prefix = sys.argv[1]
filename = sys.argv[2]
f = open(filename)
sf = None
for line in f:
if line.startswith('Processing... | """
Split out a monolithic file with many different runs of
indexed_search.py. The resulting files are meant for use in
get-figures.py.
Usage: python split-file.py prefix filename
"""
import sys
prefix = sys.argv[1]
filename = sys.argv[2]
f = open(filename)
sf = None
for line in f:
if line.startswith('Processing... | Support for splitting outputs for PyTables and Postgres indexing benchmarks all in one. | Support for splitting outputs for PyTables and Postgres indexing
benchmarks all in one.
git-svn-id: 92c705c98a17f0f7623a131b3c42ed50fcde59b4@2885 1b98710c-d8ec-0310-ae81-f5f2bcd8cb94
| Python | bsd-3-clause | jennolsen84/PyTables,rabernat/PyTables,avalentino/PyTables,jack-pappas/PyTables,rdhyee/PyTables,gdementen/PyTables,joonro/PyTables,PyTables/PyTables,mohamed-ali/PyTables,andreabedini/PyTables,tp199911/PyTables,jennolsen84/PyTables,tp199911/PyTables,dotsdl/PyTables,cpcloud/PyTables,tp199911/PyTables,FrancescAlted/PyTabl... | """
Split out a monolithic file with many different runs of
indexed_search.py. The resulting files are meant for use in
get-figures.py.
Usage: python split-file.py prefix filename
"""
import sys
prefix = sys.argv[1]
filename = sys.argv[2]
f = open(filename)
sf = None
for line in f:
if line.startswith('Processing... | """
Split out a monolithic file with many different runs of
indexed_search.py. The resulting files are meant for use in
get-figures.py.
Usage: python split-file.py prefix filename
"""
import sys
prefix = sys.argv[1]
filename = sys.argv[2]
f = open(filename)
sf = None
for line in f:
if line.startswith('Processing... | <commit_before>"""
Split out a monolithic file with many different runs of
indexed_search.py. The resulting files are meant for use in
get-figures.py.
Usage: python split-file.py prefix filename
"""
import sys
prefix = sys.argv[1]
filename = sys.argv[2]
f = open(filename)
sf = None
for line in f:
if line.startsw... | """
Split out a monolithic file with many different runs of
indexed_search.py. The resulting files are meant for use in
get-figures.py.
Usage: python split-file.py prefix filename
"""
import sys
prefix = sys.argv[1]
filename = sys.argv[2]
f = open(filename)
sf = None
for line in f:
if line.startswith('Processing... | """
Split out a monolithic file with many different runs of
indexed_search.py. The resulting files are meant for use in
get-figures.py.
Usage: python split-file.py prefix filename
"""
import sys
prefix = sys.argv[1]
filename = sys.argv[2]
f = open(filename)
sf = None
for line in f:
if line.startswith('Processing... | <commit_before>"""
Split out a monolithic file with many different runs of
indexed_search.py. The resulting files are meant for use in
get-figures.py.
Usage: python split-file.py prefix filename
"""
import sys
prefix = sys.argv[1]
filename = sys.argv[2]
f = open(filename)
sf = None
for line in f:
if line.startsw... |
ba026f431ca7196a489dd1157af0c58972fe2356 | localore/people/wagtail_hooks.py | localore/people/wagtail_hooks.py | from django.utils.html import format_html
from wagtailmodeladmin.options import ModelAdmin, wagtailmodeladmin_register
from .models import Person
class PeopleAdmin(ModelAdmin):
model = Person
menu_icon = 'group'
menu_label = 'Team'
menu_order = 300
list_display = ('profile_photo', 'full_name', '... | from django.utils.html import format_html
from wagtailmodeladmin.options import ModelAdmin, wagtailmodeladmin_register
from .models import Person
class PeopleAdmin(ModelAdmin):
model = Person
menu_icon = 'group'
menu_label = 'Team'
menu_order = 300
list_display = ('profile_photo', 'full_name', '... | Fix people list breaking due to deleted photo. | Fix people list breaking due to deleted photo.
| Python | mpl-2.0 | ghostwords/localore,ghostwords/localore,ghostwords/localore | from django.utils.html import format_html
from wagtailmodeladmin.options import ModelAdmin, wagtailmodeladmin_register
from .models import Person
class PeopleAdmin(ModelAdmin):
model = Person
menu_icon = 'group'
menu_label = 'Team'
menu_order = 300
list_display = ('profile_photo', 'full_name', '... | from django.utils.html import format_html
from wagtailmodeladmin.options import ModelAdmin, wagtailmodeladmin_register
from .models import Person
class PeopleAdmin(ModelAdmin):
model = Person
menu_icon = 'group'
menu_label = 'Team'
menu_order = 300
list_display = ('profile_photo', 'full_name', '... | <commit_before>from django.utils.html import format_html
from wagtailmodeladmin.options import ModelAdmin, wagtailmodeladmin_register
from .models import Person
class PeopleAdmin(ModelAdmin):
model = Person
menu_icon = 'group'
menu_label = 'Team'
menu_order = 300
list_display = ('profile_photo',... | from django.utils.html import format_html
from wagtailmodeladmin.options import ModelAdmin, wagtailmodeladmin_register
from .models import Person
class PeopleAdmin(ModelAdmin):
model = Person
menu_icon = 'group'
menu_label = 'Team'
menu_order = 300
list_display = ('profile_photo', 'full_name', '... | from django.utils.html import format_html
from wagtailmodeladmin.options import ModelAdmin, wagtailmodeladmin_register
from .models import Person
class PeopleAdmin(ModelAdmin):
model = Person
menu_icon = 'group'
menu_label = 'Team'
menu_order = 300
list_display = ('profile_photo', 'full_name', '... | <commit_before>from django.utils.html import format_html
from wagtailmodeladmin.options import ModelAdmin, wagtailmodeladmin_register
from .models import Person
class PeopleAdmin(ModelAdmin):
model = Person
menu_icon = 'group'
menu_label = 'Team'
menu_order = 300
list_display = ('profile_photo',... |
a8b4409dd2261edea536f3e8080b90a770eccf70 | mediacloud/mediawords/tm/mine.py | mediacloud/mediawords/tm/mine.py | from typing import List
from mediawords.db.handler import DatabaseHandler
from mediawords.util.log import create_logger
from mediawords.util.perl import decode_object_from_bytes_if_needed
l = create_logger(__name__)
class McPostgresRegexMatch(Exception):
"""postgres_regex_match() exception."""
pass
def po... | from typing import List
from mediawords.db.handler import DatabaseHandler
from mediawords.util.log import create_logger
from mediawords.util.perl import decode_object_from_bytes_if_needed
l = create_logger(__name__)
class McPostgresRegexMatch(Exception):
"""postgres_regex_match() exception."""
pass
def po... | Add LIMIT 1 to speed up query | Add LIMIT 1 to speed up query
| Python | agpl-3.0 | berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud | from typing import List
from mediawords.db.handler import DatabaseHandler
from mediawords.util.log import create_logger
from mediawords.util.perl import decode_object_from_bytes_if_needed
l = create_logger(__name__)
class McPostgresRegexMatch(Exception):
"""postgres_regex_match() exception."""
pass
def po... | from typing import List
from mediawords.db.handler import DatabaseHandler
from mediawords.util.log import create_logger
from mediawords.util.perl import decode_object_from_bytes_if_needed
l = create_logger(__name__)
class McPostgresRegexMatch(Exception):
"""postgres_regex_match() exception."""
pass
def po... | <commit_before>from typing import List
from mediawords.db.handler import DatabaseHandler
from mediawords.util.log import create_logger
from mediawords.util.perl import decode_object_from_bytes_if_needed
l = create_logger(__name__)
class McPostgresRegexMatch(Exception):
"""postgres_regex_match() exception."""
... | from typing import List
from mediawords.db.handler import DatabaseHandler
from mediawords.util.log import create_logger
from mediawords.util.perl import decode_object_from_bytes_if_needed
l = create_logger(__name__)
class McPostgresRegexMatch(Exception):
"""postgres_regex_match() exception."""
pass
def po... | from typing import List
from mediawords.db.handler import DatabaseHandler
from mediawords.util.log import create_logger
from mediawords.util.perl import decode_object_from_bytes_if_needed
l = create_logger(__name__)
class McPostgresRegexMatch(Exception):
"""postgres_regex_match() exception."""
pass
def po... | <commit_before>from typing import List
from mediawords.db.handler import DatabaseHandler
from mediawords.util.log import create_logger
from mediawords.util.perl import decode_object_from_bytes_if_needed
l = create_logger(__name__)
class McPostgresRegexMatch(Exception):
"""postgres_regex_match() exception."""
... |
779874f573d8bddb835ac8ac7875f2f04c093222 | tests/test_client.py | tests/test_client.py | import six
import sys
import test_helper
import unittest
from authy import AuthyException
from authy.api import AuthyApiClient
from authy.api.resources import Tokens
from authy.api.resources import Users
class ApiClientTest(unittest.TestCase):
def setUp(self):
self.api = AuthyApiClient(test_helper.API_K... | import six
import sys
import test_helper
import unittest
from authy import AuthyException
from authy.api import AuthyApiClient
from authy.api.resources import Tokens
from authy.api.resources import Users
class ApiClientTest(unittest.TestCase):
def setUp(self):
self.api = AuthyApiClient(test_helper.API_K... | Fix deprecation warnings due to invalid escape sequences. | Fix deprecation warnings due to invalid escape sequences.
| Python | mit | authy/authy-python,authy/authy-python | import six
import sys
import test_helper
import unittest
from authy import AuthyException
from authy.api import AuthyApiClient
from authy.api.resources import Tokens
from authy.api.resources import Users
class ApiClientTest(unittest.TestCase):
def setUp(self):
self.api = AuthyApiClient(test_helper.API_K... | import six
import sys
import test_helper
import unittest
from authy import AuthyException
from authy.api import AuthyApiClient
from authy.api.resources import Tokens
from authy.api.resources import Users
class ApiClientTest(unittest.TestCase):
def setUp(self):
self.api = AuthyApiClient(test_helper.API_K... | <commit_before>import six
import sys
import test_helper
import unittest
from authy import AuthyException
from authy.api import AuthyApiClient
from authy.api.resources import Tokens
from authy.api.resources import Users
class ApiClientTest(unittest.TestCase):
def setUp(self):
self.api = AuthyApiClient(te... | import six
import sys
import test_helper
import unittest
from authy import AuthyException
from authy.api import AuthyApiClient
from authy.api.resources import Tokens
from authy.api.resources import Users
class ApiClientTest(unittest.TestCase):
def setUp(self):
self.api = AuthyApiClient(test_helper.API_K... | import six
import sys
import test_helper
import unittest
from authy import AuthyException
from authy.api import AuthyApiClient
from authy.api.resources import Tokens
from authy.api.resources import Users
class ApiClientTest(unittest.TestCase):
def setUp(self):
self.api = AuthyApiClient(test_helper.API_K... | <commit_before>import six
import sys
import test_helper
import unittest
from authy import AuthyException
from authy.api import AuthyApiClient
from authy.api.resources import Tokens
from authy.api.resources import Users
class ApiClientTest(unittest.TestCase):
def setUp(self):
self.api = AuthyApiClient(te... |
5d0df4c15bc28cba8b7c766f3e5bd63a27f8d5b7 | tflitehub/lit.cfg.py | tflitehub/lit.cfg.py | import os
import sys
import lit.formats
import lit.util
import lit.llvm
# Configuration file for the 'lit' test runner.
lit.llvm.initialize(lit_config, config)
# name: The name of this test suite.
config.name = 'TFLITEHUB'
config.test_format = lit.formats.ShTest()
# suffixes: A list of file extensions to treat as... | import os
import sys
import lit.formats
import lit.util
import lit.llvm
# Configuration file for the 'lit' test runner.
lit.llvm.initialize(lit_config, config)
# name: The name of this test suite.
config.name = 'TFLITEHUB'
config.test_format = lit.formats.ShTest()
# suffixes: A list of file extensions to treat as... | Add coco_test_data.py to lit ignore list | Add coco_test_data.py to lit ignore list
| Python | apache-2.0 | iree-org/iree-samples,iree-org/iree-samples,iree-org/iree-samples,iree-org/iree-samples | import os
import sys
import lit.formats
import lit.util
import lit.llvm
# Configuration file for the 'lit' test runner.
lit.llvm.initialize(lit_config, config)
# name: The name of this test suite.
config.name = 'TFLITEHUB'
config.test_format = lit.formats.ShTest()
# suffixes: A list of file extensions to treat as... | import os
import sys
import lit.formats
import lit.util
import lit.llvm
# Configuration file for the 'lit' test runner.
lit.llvm.initialize(lit_config, config)
# name: The name of this test suite.
config.name = 'TFLITEHUB'
config.test_format = lit.formats.ShTest()
# suffixes: A list of file extensions to treat as... | <commit_before>import os
import sys
import lit.formats
import lit.util
import lit.llvm
# Configuration file for the 'lit' test runner.
lit.llvm.initialize(lit_config, config)
# name: The name of this test suite.
config.name = 'TFLITEHUB'
config.test_format = lit.formats.ShTest()
# suffixes: A list of file extensi... | import os
import sys
import lit.formats
import lit.util
import lit.llvm
# Configuration file for the 'lit' test runner.
lit.llvm.initialize(lit_config, config)
# name: The name of this test suite.
config.name = 'TFLITEHUB'
config.test_format = lit.formats.ShTest()
# suffixes: A list of file extensions to treat as... | import os
import sys
import lit.formats
import lit.util
import lit.llvm
# Configuration file for the 'lit' test runner.
lit.llvm.initialize(lit_config, config)
# name: The name of this test suite.
config.name = 'TFLITEHUB'
config.test_format = lit.formats.ShTest()
# suffixes: A list of file extensions to treat as... | <commit_before>import os
import sys
import lit.formats
import lit.util
import lit.llvm
# Configuration file for the 'lit' test runner.
lit.llvm.initialize(lit_config, config)
# name: The name of this test suite.
config.name = 'TFLITEHUB'
config.test_format = lit.formats.ShTest()
# suffixes: A list of file extensi... |
6bc11ea44c07cddd567a5039b9442a95e9ce04fe | comics/crawler/utils/lxmlparser.py | comics/crawler/utils/lxmlparser.py | #encoding: utf-8
from lxml.html import parse, fromstring
class LxmlParser(object):
def __init__(self, url=None, string=None):
if url:
self.root = parse(url).getroot()
self.root.make_links_absolute(url)
elif string:
self.root = fromstring(string)
def text(se... | #encoding: utf-8
from lxml.html import parse, fromstring
class LxmlParser(object):
def __init__(self, url=None, string=None):
if url is not None:
self.root = parse(url).getroot()
self.root.make_links_absolute(url)
elif string is not None:
self.root = fromstring(... | Update exception handling in LxmlParser | Update exception handling in LxmlParser
| Python | agpl-3.0 | datagutten/comics,klette/comics,klette/comics,jodal/comics,jodal/comics,klette/comics,jodal/comics,datagutten/comics,jodal/comics,datagutten/comics,datagutten/comics | #encoding: utf-8
from lxml.html import parse, fromstring
class LxmlParser(object):
def __init__(self, url=None, string=None):
if url:
self.root = parse(url).getroot()
self.root.make_links_absolute(url)
elif string:
self.root = fromstring(string)
def text(se... | #encoding: utf-8
from lxml.html import parse, fromstring
class LxmlParser(object):
def __init__(self, url=None, string=None):
if url is not None:
self.root = parse(url).getroot()
self.root.make_links_absolute(url)
elif string is not None:
self.root = fromstring(... | <commit_before>#encoding: utf-8
from lxml.html import parse, fromstring
class LxmlParser(object):
def __init__(self, url=None, string=None):
if url:
self.root = parse(url).getroot()
self.root.make_links_absolute(url)
elif string:
self.root = fromstring(string)
... | #encoding: utf-8
from lxml.html import parse, fromstring
class LxmlParser(object):
def __init__(self, url=None, string=None):
if url is not None:
self.root = parse(url).getroot()
self.root.make_links_absolute(url)
elif string is not None:
self.root = fromstring(... | #encoding: utf-8
from lxml.html import parse, fromstring
class LxmlParser(object):
def __init__(self, url=None, string=None):
if url:
self.root = parse(url).getroot()
self.root.make_links_absolute(url)
elif string:
self.root = fromstring(string)
def text(se... | <commit_before>#encoding: utf-8
from lxml.html import parse, fromstring
class LxmlParser(object):
def __init__(self, url=None, string=None):
if url:
self.root = parse(url).getroot()
self.root.make_links_absolute(url)
elif string:
self.root = fromstring(string)
... |
32789be8f1f98f7538f4452a8118c261037f2d75 | tempwatcher/watch.py | tempwatcher/watch.py | import json
import requests
class TemperatureWatch(object):
thermostat_url = None
alert_high = 80
alert_low = 60
_last_response = None
def get_info(self):
r = requests.get(self.thermostat_url + '/tstat')
self._last_response = json.loads(r.text)
return r.text
def check... | import json
import requests
class TemperatureWatch(object):
thermostat_url = None
alert_high = 80
alert_low = 60
_last_response = None
def get_info(self):
r = requests.get(self.thermostat_url + '/tstat')
self._last_response = json.loads(r.text)
return r.text
def check... | Refactor the initialization a bit to make configuration easier. | Refactor the initialization a bit to make configuration easier.
| Python | bsd-3-clause | adamfast/tempwatcher | import json
import requests
class TemperatureWatch(object):
thermostat_url = None
alert_high = 80
alert_low = 60
_last_response = None
def get_info(self):
r = requests.get(self.thermostat_url + '/tstat')
self._last_response = json.loads(r.text)
return r.text
def check... | import json
import requests
class TemperatureWatch(object):
thermostat_url = None
alert_high = 80
alert_low = 60
_last_response = None
def get_info(self):
r = requests.get(self.thermostat_url + '/tstat')
self._last_response = json.loads(r.text)
return r.text
def check... | <commit_before>import json
import requests
class TemperatureWatch(object):
thermostat_url = None
alert_high = 80
alert_low = 60
_last_response = None
def get_info(self):
r = requests.get(self.thermostat_url + '/tstat')
self._last_response = json.loads(r.text)
return r.text... | import json
import requests
class TemperatureWatch(object):
thermostat_url = None
alert_high = 80
alert_low = 60
_last_response = None
def get_info(self):
r = requests.get(self.thermostat_url + '/tstat')
self._last_response = json.loads(r.text)
return r.text
def check... | import json
import requests
class TemperatureWatch(object):
thermostat_url = None
alert_high = 80
alert_low = 60
_last_response = None
def get_info(self):
r = requests.get(self.thermostat_url + '/tstat')
self._last_response = json.loads(r.text)
return r.text
def check... | <commit_before>import json
import requests
class TemperatureWatch(object):
thermostat_url = None
alert_high = 80
alert_low = 60
_last_response = None
def get_info(self):
r = requests.get(self.thermostat_url + '/tstat')
self._last_response = json.loads(r.text)
return r.text... |
89804f4d2caeab07b56a90912afc058145620375 | jal_stats/stats/views.py | jal_stats/stats/views.py | # from django.contrib.auth.models import User
from django.shortcuts import get_object_or_404
from rest_framework import viewsets, permissions # , serializers
from .models import Stat, Activity
from .permissions import IsAPIUser
from .serializers import ActivitySerializer, ActivityListSerializer, StatSerializer
# Crea... | # from django.contrib.auth.models import User
from django.shortcuts import get_object_or_404
from rest_framework import viewsets, mixins, permissions # , serializers
from .models import Stat, Activity
# from .permissions import IsAPIUser
from .serializers import ActivitySerializer, ActivityListSerializer, StatSerializ... | Update StatViewSet to generic, add necessary mixins | Update StatViewSet to generic, add necessary mixins
| Python | mit | jal-stats/django | # from django.contrib.auth.models import User
from django.shortcuts import get_object_or_404
from rest_framework import viewsets, permissions # , serializers
from .models import Stat, Activity
from .permissions import IsAPIUser
from .serializers import ActivitySerializer, ActivityListSerializer, StatSerializer
# Crea... | # from django.contrib.auth.models import User
from django.shortcuts import get_object_or_404
from rest_framework import viewsets, mixins, permissions # , serializers
from .models import Stat, Activity
# from .permissions import IsAPIUser
from .serializers import ActivitySerializer, ActivityListSerializer, StatSerializ... | <commit_before># from django.contrib.auth.models import User
from django.shortcuts import get_object_or_404
from rest_framework import viewsets, permissions # , serializers
from .models import Stat, Activity
from .permissions import IsAPIUser
from .serializers import ActivitySerializer, ActivityListSerializer, StatSer... | # from django.contrib.auth.models import User
from django.shortcuts import get_object_or_404
from rest_framework import viewsets, mixins, permissions # , serializers
from .models import Stat, Activity
# from .permissions import IsAPIUser
from .serializers import ActivitySerializer, ActivityListSerializer, StatSerializ... | # from django.contrib.auth.models import User
from django.shortcuts import get_object_or_404
from rest_framework import viewsets, permissions # , serializers
from .models import Stat, Activity
from .permissions import IsAPIUser
from .serializers import ActivitySerializer, ActivityListSerializer, StatSerializer
# Crea... | <commit_before># from django.contrib.auth.models import User
from django.shortcuts import get_object_or_404
from rest_framework import viewsets, permissions # , serializers
from .models import Stat, Activity
from .permissions import IsAPIUser
from .serializers import ActivitySerializer, ActivityListSerializer, StatSer... |
9887b962ddc27f7bebe212e169d1a2c442a35239 | ironic_ui/content/ironic/panel.py | ironic_ui/content/ironic/panel.py | # Copyright 2016 Cisco Systems, Inc.
# Copyright (c) 2016 Hewlett Packard Enterprise Development Company LP
#
# 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.apa... | # Copyright 2016 Cisco Systems, Inc.
# Copyright (c) 2016 Hewlett Packard Enterprise Development Company LP
#
# 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.apa... | Use permissions attribute to detect ironic service | Use permissions attribute to detect ironic service
Horizon implements a logic to enable/disable panel by permissions
defined in each panel class. This change replaces the current redundant
logic by that built-in feature to simplify how we define requirements
of the Ironic panels.
Change-Id: I4a9dabfea79c23155fb8986fe... | Python | apache-2.0 | openstack/ironic-ui,openstack/ironic-ui,openstack/ironic-ui,openstack/ironic-ui | # Copyright 2016 Cisco Systems, Inc.
# Copyright (c) 2016 Hewlett Packard Enterprise Development Company LP
#
# 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.apa... | # Copyright 2016 Cisco Systems, Inc.
# Copyright (c) 2016 Hewlett Packard Enterprise Development Company LP
#
# 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.apa... | <commit_before># Copyright 2016 Cisco Systems, Inc.
# Copyright (c) 2016 Hewlett Packard Enterprise Development Company LP
#
# 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
#
# ... | # Copyright 2016 Cisco Systems, Inc.
# Copyright (c) 2016 Hewlett Packard Enterprise Development Company LP
#
# 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.apa... | # Copyright 2016 Cisco Systems, Inc.
# Copyright (c) 2016 Hewlett Packard Enterprise Development Company LP
#
# 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.apa... | <commit_before># Copyright 2016 Cisco Systems, Inc.
# Copyright (c) 2016 Hewlett Packard Enterprise Development Company LP
#
# 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
#
# ... |
058882a1d0e4ac458fe8cab972010e17c248ee81 | wate/views.py | wate/views.py | from wate import app
import db_ops
@app.route('/')
def index():
users = db_ops.users_everything_get()
header = db_ops.COMPLETE_USER_SCHEMA
retval = ""
# First, print the header
for item in header:
retval += ( item + ", " )
retval += ( "<br>"*2 )
# Now print each user
for use... | from wate import app
import db_ops
@app.route('/')
def index():
users = db_ops.users_everything_get()
header = db_ops.COMPLETE_USER_SCHEMA
retval = '<table border="1">'
# First, print the header
retval += '<tr>'
for item in header:
retval += "<th>{}</th>".format(item)
retval += ... | Make a table for the front page | Make a table for the front page
| Python | mit | jamesmunns/wate,jamesmunns/wate,jamesmunns/wate | from wate import app
import db_ops
@app.route('/')
def index():
users = db_ops.users_everything_get()
header = db_ops.COMPLETE_USER_SCHEMA
retval = ""
# First, print the header
for item in header:
retval += ( item + ", " )
retval += ( "<br>"*2 )
# Now print each user
for use... | from wate import app
import db_ops
@app.route('/')
def index():
users = db_ops.users_everything_get()
header = db_ops.COMPLETE_USER_SCHEMA
retval = '<table border="1">'
# First, print the header
retval += '<tr>'
for item in header:
retval += "<th>{}</th>".format(item)
retval += ... | <commit_before>from wate import app
import db_ops
@app.route('/')
def index():
users = db_ops.users_everything_get()
header = db_ops.COMPLETE_USER_SCHEMA
retval = ""
# First, print the header
for item in header:
retval += ( item + ", " )
retval += ( "<br>"*2 )
# Now print each u... | from wate import app
import db_ops
@app.route('/')
def index():
users = db_ops.users_everything_get()
header = db_ops.COMPLETE_USER_SCHEMA
retval = '<table border="1">'
# First, print the header
retval += '<tr>'
for item in header:
retval += "<th>{}</th>".format(item)
retval += ... | from wate import app
import db_ops
@app.route('/')
def index():
users = db_ops.users_everything_get()
header = db_ops.COMPLETE_USER_SCHEMA
retval = ""
# First, print the header
for item in header:
retval += ( item + ", " )
retval += ( "<br>"*2 )
# Now print each user
for use... | <commit_before>from wate import app
import db_ops
@app.route('/')
def index():
users = db_ops.users_everything_get()
header = db_ops.COMPLETE_USER_SCHEMA
retval = ""
# First, print the header
for item in header:
retval += ( item + ", " )
retval += ( "<br>"*2 )
# Now print each u... |
935043dda123a030130571a2a4bb45b2b13f145c | addons/website_quote/__manifest__.py | addons/website_quote/__manifest__.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Online Proposals',
'category': 'Website',
'summary': 'Sales',
'website': 'https://www.odoo.com/page/quote-builder',
'version': '1.0',
'description': "",
'depends': ['website', 'sale_... | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Online Proposals',
'category': 'Website',
'summary': 'Sales',
'website': 'https://www.odoo.com/page/quote-builder',
'version': '1.0',
'description': "",
'depends': ['website', 'sale_... | Revert "[FIX] website_quote: make 'Pay & Confirm' work without website_sale" | Revert "[FIX] website_quote: make 'Pay & Confirm' work without website_sale"
No dependency change in stable version
This reverts commit 65a589eb54a1421baa71074701bea2873a83c75f.
| Python | agpl-3.0 | ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Online Proposals',
'category': 'Website',
'summary': 'Sales',
'website': 'https://www.odoo.com/page/quote-builder',
'version': '1.0',
'description': "",
'depends': ['website', 'sale_... | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Online Proposals',
'category': 'Website',
'summary': 'Sales',
'website': 'https://www.odoo.com/page/quote-builder',
'version': '1.0',
'description': "",
'depends': ['website', 'sale_... | <commit_before># -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Online Proposals',
'category': 'Website',
'summary': 'Sales',
'website': 'https://www.odoo.com/page/quote-builder',
'version': '1.0',
'description': "",
'depends': ['w... | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Online Proposals',
'category': 'Website',
'summary': 'Sales',
'website': 'https://www.odoo.com/page/quote-builder',
'version': '1.0',
'description': "",
'depends': ['website', 'sale_... | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Online Proposals',
'category': 'Website',
'summary': 'Sales',
'website': 'https://www.odoo.com/page/quote-builder',
'version': '1.0',
'description': "",
'depends': ['website', 'sale_... | <commit_before># -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Online Proposals',
'category': 'Website',
'summary': 'Sales',
'website': 'https://www.odoo.com/page/quote-builder',
'version': '1.0',
'description': "",
'depends': ['w... |
c295e3644eb6a49f953c6d7bb346000b5e673c89 | badgekit_webhooks/views.py | badgekit_webhooks/views.py | from __future__ import unicode_literals
import datetime
from django.http import HttpResponse, HttpResponseBadRequest
from django.core.exceptions import ValidationError
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
import models
import json
def hello(request... | from __future__ import unicode_literals
import datetime
from django.http import HttpResponse, HttpResponseBadRequest
from django.core.exceptions import ValidationError
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
from . import models
import json
def hello(... | Fix relative import for py3 | Fix relative import for py3
| Python | mit | tgs/django-badgekit-webhooks | from __future__ import unicode_literals
import datetime
from django.http import HttpResponse, HttpResponseBadRequest
from django.core.exceptions import ValidationError
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
import models
import json
def hello(request... | from __future__ import unicode_literals
import datetime
from django.http import HttpResponse, HttpResponseBadRequest
from django.core.exceptions import ValidationError
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
from . import models
import json
def hello(... | <commit_before>from __future__ import unicode_literals
import datetime
from django.http import HttpResponse, HttpResponseBadRequest
from django.core.exceptions import ValidationError
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
import models
import json
de... | from __future__ import unicode_literals
import datetime
from django.http import HttpResponse, HttpResponseBadRequest
from django.core.exceptions import ValidationError
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
from . import models
import json
def hello(... | from __future__ import unicode_literals
import datetime
from django.http import HttpResponse, HttpResponseBadRequest
from django.core.exceptions import ValidationError
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
import models
import json
def hello(request... | <commit_before>from __future__ import unicode_literals
import datetime
from django.http import HttpResponse, HttpResponseBadRequest
from django.core.exceptions import ValidationError
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
import models
import json
de... |
0985890e76596495ee83c67d7e4dfa5d6996cf06 | 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... | Fix minor function call naming bug | Fix minor function call naming bug
| 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 = ... |
e0ef570c072bbb170a21b460f8422a63293b9983 | regressiontests/userapp/admin.py | regressiontests/userapp/admin.py | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from rollyourown.seo.admin import register_seo_admin, get_inline
from django.contrib import admin
from userapp.seo import Coverage, WithSites
register_seo_admin(admin.site, Coverage)
register_seo_admin(admin.site, WithSites)
from userapp.models import Product, Page, Cate... | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from rollyourown.seo.admin import register_seo_admin, get_inline
from django.contrib import admin
from userapp.seo import Coverage, WithSites
register_seo_admin(admin.site, Coverage)
register_seo_admin(admin.site, WithSites)
from userapp.models import Product, Page, Cate... | Test now fails properly without feature. | Test now fails properly without feature.
| Python | bsd-3-clause | AlexLSB/django-seo,nikhila05/django-seo,nikhila05/django-seo,MicroPyramid/django-seo,nimoism/django-seo,annikaC/django-seo,willhardy/django-seo,romansalin/django-seo2,asfaltboy/django-seo,tangochin/django-seo,winzard/django-seo2,whyflyru/django-seo,vintasoftware/django-seo,winzard/django-seo,AlexLSB/django-seo,winzard/... | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from rollyourown.seo.admin import register_seo_admin, get_inline
from django.contrib import admin
from userapp.seo import Coverage, WithSites
register_seo_admin(admin.site, Coverage)
register_seo_admin(admin.site, WithSites)
from userapp.models import Product, Page, Cate... | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from rollyourown.seo.admin import register_seo_admin, get_inline
from django.contrib import admin
from userapp.seo import Coverage, WithSites
register_seo_admin(admin.site, Coverage)
register_seo_admin(admin.site, WithSites)
from userapp.models import Product, Page, Cate... | <commit_before>#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from rollyourown.seo.admin import register_seo_admin, get_inline
from django.contrib import admin
from userapp.seo import Coverage, WithSites
register_seo_admin(admin.site, Coverage)
register_seo_admin(admin.site, WithSites)
from userapp.models import Prod... | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from rollyourown.seo.admin import register_seo_admin, get_inline
from django.contrib import admin
from userapp.seo import Coverage, WithSites
register_seo_admin(admin.site, Coverage)
register_seo_admin(admin.site, WithSites)
from userapp.models import Product, Page, Cate... | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from rollyourown.seo.admin import register_seo_admin, get_inline
from django.contrib import admin
from userapp.seo import Coverage, WithSites
register_seo_admin(admin.site, Coverage)
register_seo_admin(admin.site, WithSites)
from userapp.models import Product, Page, Cate... | <commit_before>#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from rollyourown.seo.admin import register_seo_admin, get_inline
from django.contrib import admin
from userapp.seo import Coverage, WithSites
register_seo_admin(admin.site, Coverage)
register_seo_admin(admin.site, WithSites)
from userapp.models import Prod... |
8b8c7f851b96456e80201295af645066ab8f6fbb | contrib/internal/build-media.py | contrib/internal/build-media.py | #!/usr/bin/env python
from __future__ import unicode_literals
import os
import sys
scripts_dir = os.path.abspath(os.path.dirname(__file__))
# Source root directory
sys.path.insert(0, os.path.abspath(os.path.join(scripts_dir, '..', '..')))
# Script config directory
sys.path.insert(0, os.path.join(scripts_dir, 'conf... | #!/usr/bin/env python
from __future__ import unicode_literals
import os
import sys
scripts_dir = os.path.abspath(os.path.dirname(__file__))
# Source root directory
sys.path.insert(0, os.path.abspath(os.path.join(scripts_dir, '..', '..')))
# Script config directory
sys.path.insert(0, os.path.join(scripts_dir, 'conf... | Fix building static media on Django 1.11. | Fix building static media on Django 1.11.
Our wrapper script for building static media attempted to honor the
exit code of the `collectstatic` management command, passing it along to
`sys.exit()` so that we wouldn't have a failure show up as a successful
result.
However, exit codes are never returned. Instead, we wer... | Python | mit | reviewboard/reviewboard,reviewboard/reviewboard,chipx86/reviewboard,reviewboard/reviewboard,chipx86/reviewboard,chipx86/reviewboard,reviewboard/reviewboard,chipx86/reviewboard | #!/usr/bin/env python
from __future__ import unicode_literals
import os
import sys
scripts_dir = os.path.abspath(os.path.dirname(__file__))
# Source root directory
sys.path.insert(0, os.path.abspath(os.path.join(scripts_dir, '..', '..')))
# Script config directory
sys.path.insert(0, os.path.join(scripts_dir, 'conf... | #!/usr/bin/env python
from __future__ import unicode_literals
import os
import sys
scripts_dir = os.path.abspath(os.path.dirname(__file__))
# Source root directory
sys.path.insert(0, os.path.abspath(os.path.join(scripts_dir, '..', '..')))
# Script config directory
sys.path.insert(0, os.path.join(scripts_dir, 'conf... | <commit_before>#!/usr/bin/env python
from __future__ import unicode_literals
import os
import sys
scripts_dir = os.path.abspath(os.path.dirname(__file__))
# Source root directory
sys.path.insert(0, os.path.abspath(os.path.join(scripts_dir, '..', '..')))
# Script config directory
sys.path.insert(0, os.path.join(scr... | #!/usr/bin/env python
from __future__ import unicode_literals
import os
import sys
scripts_dir = os.path.abspath(os.path.dirname(__file__))
# Source root directory
sys.path.insert(0, os.path.abspath(os.path.join(scripts_dir, '..', '..')))
# Script config directory
sys.path.insert(0, os.path.join(scripts_dir, 'conf... | #!/usr/bin/env python
from __future__ import unicode_literals
import os
import sys
scripts_dir = os.path.abspath(os.path.dirname(__file__))
# Source root directory
sys.path.insert(0, os.path.abspath(os.path.join(scripts_dir, '..', '..')))
# Script config directory
sys.path.insert(0, os.path.join(scripts_dir, 'conf... | <commit_before>#!/usr/bin/env python
from __future__ import unicode_literals
import os
import sys
scripts_dir = os.path.abspath(os.path.dirname(__file__))
# Source root directory
sys.path.insert(0, os.path.abspath(os.path.join(scripts_dir, '..', '..')))
# Script config directory
sys.path.insert(0, os.path.join(scr... |
9acf278a0a20262174e68829f9725731771e2601 | example/app.py | example/app.py | from flask import Flask, render_template
from flask_gears import Gears
from gears_stylus import StylusCompiler
from gears_clean_css import CleanCSSCompressor
app = Flask(__name__)
gears = Gears(
compilers={'.styl': StylusCompiler.as_handler()},
compressors={'text/css': CleanCSSCompressor.as_handler()},
)
ge... | from flask import Flask, render_template
from flask.ext.gears import Gears
from gears_stylus import StylusCompiler
from gears_clean_css import CleanCSSCompressor
app = Flask(__name__)
gears = Gears(
compilers={'.styl': StylusCompiler.as_handler()},
compressors={'text/css': CleanCSSCompressor.as_handler()},
... | Use the preferred import style | Example: Use the preferred import style
[Using Flask Extensions](http://flask.readthedocs.org/en/latest/extensions/#using-extensions) suggests to import like ``from flask.ext import foo``. | Python | isc | gears/flask-gears | from flask import Flask, render_template
from flask_gears import Gears
from gears_stylus import StylusCompiler
from gears_clean_css import CleanCSSCompressor
app = Flask(__name__)
gears = Gears(
compilers={'.styl': StylusCompiler.as_handler()},
compressors={'text/css': CleanCSSCompressor.as_handler()},
)
ge... | from flask import Flask, render_template
from flask.ext.gears import Gears
from gears_stylus import StylusCompiler
from gears_clean_css import CleanCSSCompressor
app = Flask(__name__)
gears = Gears(
compilers={'.styl': StylusCompiler.as_handler()},
compressors={'text/css': CleanCSSCompressor.as_handler()},
... | <commit_before>from flask import Flask, render_template
from flask_gears import Gears
from gears_stylus import StylusCompiler
from gears_clean_css import CleanCSSCompressor
app = Flask(__name__)
gears = Gears(
compilers={'.styl': StylusCompiler.as_handler()},
compressors={'text/css': CleanCSSCompressor.as_h... | from flask import Flask, render_template
from flask.ext.gears import Gears
from gears_stylus import StylusCompiler
from gears_clean_css import CleanCSSCompressor
app = Flask(__name__)
gears = Gears(
compilers={'.styl': StylusCompiler.as_handler()},
compressors={'text/css': CleanCSSCompressor.as_handler()},
... | from flask import Flask, render_template
from flask_gears import Gears
from gears_stylus import StylusCompiler
from gears_clean_css import CleanCSSCompressor
app = Flask(__name__)
gears = Gears(
compilers={'.styl': StylusCompiler.as_handler()},
compressors={'text/css': CleanCSSCompressor.as_handler()},
)
ge... | <commit_before>from flask import Flask, render_template
from flask_gears import Gears
from gears_stylus import StylusCompiler
from gears_clean_css import CleanCSSCompressor
app = Flask(__name__)
gears = Gears(
compilers={'.styl': StylusCompiler.as_handler()},
compressors={'text/css': CleanCSSCompressor.as_h... |
a6eaf7d4b43e1bb3177e4eb0e3e288db2d419020 | halo/_utils.py | halo/_utils.py | # -*- coding: utf-8 -*-
"""Utilities for Halo library.
"""
import platform
import six
import codecs
from colorama import init, Fore
from termcolor import colored
init(autoreset=True)
def is_supported():
"""Check whether operating system supports main symbols or not.
Returns
-------
boolean
... | # -*- coding: utf-8 -*-
"""Utilities for Halo library.
"""
import platform
import six
import codecs
import shutil
from colorama import init, Fore
from termcolor import colored
init(autoreset=True)
def is_supported():
"""Check whether operating system supports main symbols or not.
Returns
-------
... | Add shutil dependency to get the terminal size | Add shutil dependency to get the terminal size
| Python | mit | manrajgrover/halo,ManrajGrover/halo | # -*- coding: utf-8 -*-
"""Utilities for Halo library.
"""
import platform
import six
import codecs
from colorama import init, Fore
from termcolor import colored
init(autoreset=True)
def is_supported():
"""Check whether operating system supports main symbols or not.
Returns
-------
boolean
... | # -*- coding: utf-8 -*-
"""Utilities for Halo library.
"""
import platform
import six
import codecs
import shutil
from colorama import init, Fore
from termcolor import colored
init(autoreset=True)
def is_supported():
"""Check whether operating system supports main symbols or not.
Returns
-------
... | <commit_before># -*- coding: utf-8 -*-
"""Utilities for Halo library.
"""
import platform
import six
import codecs
from colorama import init, Fore
from termcolor import colored
init(autoreset=True)
def is_supported():
"""Check whether operating system supports main symbols or not.
Returns
-------
... | # -*- coding: utf-8 -*-
"""Utilities for Halo library.
"""
import platform
import six
import codecs
import shutil
from colorama import init, Fore
from termcolor import colored
init(autoreset=True)
def is_supported():
"""Check whether operating system supports main symbols or not.
Returns
-------
... | # -*- coding: utf-8 -*-
"""Utilities for Halo library.
"""
import platform
import six
import codecs
from colorama import init, Fore
from termcolor import colored
init(autoreset=True)
def is_supported():
"""Check whether operating system supports main symbols or not.
Returns
-------
boolean
... | <commit_before># -*- coding: utf-8 -*-
"""Utilities for Halo library.
"""
import platform
import six
import codecs
from colorama import init, Fore
from termcolor import colored
init(autoreset=True)
def is_supported():
"""Check whether operating system supports main symbols or not.
Returns
-------
... |
9fa562a413900252acd27d6f1b90055df2e95fe2 | tests/test_apply.py | tests/test_apply.py | import unittest
import cbs
class AttrSettings():
PROJECT_NAME = 'fancy_project'
class MethodSettings():
def PROJECT_NAME(self):
return 'fancy_project'
class TestApply(unittest.TestCase):
def test_apply_settings_attr(self):
g = {}
cbs.apply(AttrSettings, g)
self.assert... | import unittest
import cbs
class AttrSettings():
PROJECT_NAME = 'fancy_project'
class MethodSettings():
def PROJECT_NAME(self):
return 'fancy_project'
class TestApply(unittest.TestCase):
def test_apply_settings_attr(self):
g = {}
cbs.apply(AttrSettings, g)
self.assert... | Test all the code paths | Test all the code paths
| Python | bsd-2-clause | ar45/django-classy-settings,pombredanne/django-classy-settings,tysonclugg/django-classy-settings,funkybob/django-classy-settings | import unittest
import cbs
class AttrSettings():
PROJECT_NAME = 'fancy_project'
class MethodSettings():
def PROJECT_NAME(self):
return 'fancy_project'
class TestApply(unittest.TestCase):
def test_apply_settings_attr(self):
g = {}
cbs.apply(AttrSettings, g)
self.assert... | import unittest
import cbs
class AttrSettings():
PROJECT_NAME = 'fancy_project'
class MethodSettings():
def PROJECT_NAME(self):
return 'fancy_project'
class TestApply(unittest.TestCase):
def test_apply_settings_attr(self):
g = {}
cbs.apply(AttrSettings, g)
self.assert... | <commit_before>import unittest
import cbs
class AttrSettings():
PROJECT_NAME = 'fancy_project'
class MethodSettings():
def PROJECT_NAME(self):
return 'fancy_project'
class TestApply(unittest.TestCase):
def test_apply_settings_attr(self):
g = {}
cbs.apply(AttrSettings, g)
... | import unittest
import cbs
class AttrSettings():
PROJECT_NAME = 'fancy_project'
class MethodSettings():
def PROJECT_NAME(self):
return 'fancy_project'
class TestApply(unittest.TestCase):
def test_apply_settings_attr(self):
g = {}
cbs.apply(AttrSettings, g)
self.assert... | import unittest
import cbs
class AttrSettings():
PROJECT_NAME = 'fancy_project'
class MethodSettings():
def PROJECT_NAME(self):
return 'fancy_project'
class TestApply(unittest.TestCase):
def test_apply_settings_attr(self):
g = {}
cbs.apply(AttrSettings, g)
self.assert... | <commit_before>import unittest
import cbs
class AttrSettings():
PROJECT_NAME = 'fancy_project'
class MethodSettings():
def PROJECT_NAME(self):
return 'fancy_project'
class TestApply(unittest.TestCase):
def test_apply_settings_attr(self):
g = {}
cbs.apply(AttrSettings, g)
... |
6cc1e7ca79b8730cfd5e0db71dd19aae9848e3d2 | mownfish/db/api.py | mownfish/db/api.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012 Ethan Zhang<http://github.com/Ethan-Zhang>
#
# 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/lice... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012 Ethan Zhang<http://github.com/Ethan-Zhang>
#
# 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/lice... | Modify db client to __new__ | Modify db client to __new__
change db singlton from instance() staticmethod to __new__()
| Python | apache-2.0 | Ethan-Zhang/mownfish | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012 Ethan Zhang<http://github.com/Ethan-Zhang>
#
# 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/lice... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012 Ethan Zhang<http://github.com/Ethan-Zhang>
#
# 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/lice... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012 Ethan Zhang<http://github.com/Ethan-Zhang>
#
# 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.... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012 Ethan Zhang<http://github.com/Ethan-Zhang>
#
# 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/lice... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012 Ethan Zhang<http://github.com/Ethan-Zhang>
#
# 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/lice... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012 Ethan Zhang<http://github.com/Ethan-Zhang>
#
# 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.... |
158b37b1bd45eb1f554386e4866820296f8ea537 | metal/label_model/lm_defaults.py | metal/label_model/lm_defaults.py | lm_default_config = {
### GENERAL
'seed': None,
'verbose': True,
'show_plots': True,
### TRAIN
'train_config': {
# Classifier
# Class balance (if learn_class_balance=False, fix to class_balance)
'learn_class_balance': False,
# Class balance initialization / p... | lm_default_config = {
### GENERAL
'seed': None,
'verbose': True,
'show_plots': True,
### TRAIN
'train_config': {
# Classifier
# Class balance (if learn_class_balance=False, fix to class_balance)
'learn_class_balance': False,
# Class balance initialization / p... | Remove l2 from lm_default_config since it is currently unused | Remove l2 from lm_default_config since it is currently unused
| Python | apache-2.0 | HazyResearch/metal,HazyResearch/metal | lm_default_config = {
### GENERAL
'seed': None,
'verbose': True,
'show_plots': True,
### TRAIN
'train_config': {
# Classifier
# Class balance (if learn_class_balance=False, fix to class_balance)
'learn_class_balance': False,
# Class balance initialization / p... | lm_default_config = {
### GENERAL
'seed': None,
'verbose': True,
'show_plots': True,
### TRAIN
'train_config': {
# Classifier
# Class balance (if learn_class_balance=False, fix to class_balance)
'learn_class_balance': False,
# Class balance initialization / p... | <commit_before>lm_default_config = {
### GENERAL
'seed': None,
'verbose': True,
'show_plots': True,
### TRAIN
'train_config': {
# Classifier
# Class balance (if learn_class_balance=False, fix to class_balance)
'learn_class_balance': False,
# Class balance ini... | lm_default_config = {
### GENERAL
'seed': None,
'verbose': True,
'show_plots': True,
### TRAIN
'train_config': {
# Classifier
# Class balance (if learn_class_balance=False, fix to class_balance)
'learn_class_balance': False,
# Class balance initialization / p... | lm_default_config = {
### GENERAL
'seed': None,
'verbose': True,
'show_plots': True,
### TRAIN
'train_config': {
# Classifier
# Class balance (if learn_class_balance=False, fix to class_balance)
'learn_class_balance': False,
# Class balance initialization / p... | <commit_before>lm_default_config = {
### GENERAL
'seed': None,
'verbose': True,
'show_plots': True,
### TRAIN
'train_config': {
# Classifier
# Class balance (if learn_class_balance=False, fix to class_balance)
'learn_class_balance': False,
# Class balance ini... |
d33d059821e391fcf34630cfb3ea8d67a0c6ec59 | tests/test_views.py | tests/test_views.py | import unittest
from mongows import views
from tests import MongoWSTestCase
class ViewsTestCase(MongoWSTestCase):
def test_hello(self):
rv = self.app.get('/')
self.assertTrue('Hello World!' in rv.data)
| import unittest
from mongows import views
from tests import MongoWSTestCase
class ViewsTestCase(MongoWSTestCase):
def test_hello(self):
rv = self.app.get('/')
self.assertTrue('Hello World!' in rv.data)
def test_create_mws_resource(self):
url = '/mws'
rv = self.app.post(url)
... | Add stub unit tests for stub views funcs. | Views: Add stub unit tests for stub views funcs.
| Python | apache-2.0 | ecbtln/mongo-web-shell,xl76/mongo-web-shell,ecbtln/mongo-web-shell,FuegoFro/mongo-web-shell,mongodb-labs/mongo-web-shell,10gen-labs/mongo-web-shell,pilliq/mongo-web-shell,xl76/mongo-web-shell,pilliq/mongo-web-shell,rcchan/mongo-web-shell,mongodb-labs/mongo-web-shell,rcchan/mongo-web-shell,mongodb-labs/mongo-web-shell,m... | import unittest
from mongows import views
from tests import MongoWSTestCase
class ViewsTestCase(MongoWSTestCase):
def test_hello(self):
rv = self.app.get('/')
self.assertTrue('Hello World!' in rv.data)
Views: Add stub unit tests for stub views funcs. | import unittest
from mongows import views
from tests import MongoWSTestCase
class ViewsTestCase(MongoWSTestCase):
def test_hello(self):
rv = self.app.get('/')
self.assertTrue('Hello World!' in rv.data)
def test_create_mws_resource(self):
url = '/mws'
rv = self.app.post(url)
... | <commit_before>import unittest
from mongows import views
from tests import MongoWSTestCase
class ViewsTestCase(MongoWSTestCase):
def test_hello(self):
rv = self.app.get('/')
self.assertTrue('Hello World!' in rv.data)
<commit_msg>Views: Add stub unit tests for stub views funcs.<commit_after> | import unittest
from mongows import views
from tests import MongoWSTestCase
class ViewsTestCase(MongoWSTestCase):
def test_hello(self):
rv = self.app.get('/')
self.assertTrue('Hello World!' in rv.data)
def test_create_mws_resource(self):
url = '/mws'
rv = self.app.post(url)
... | import unittest
from mongows import views
from tests import MongoWSTestCase
class ViewsTestCase(MongoWSTestCase):
def test_hello(self):
rv = self.app.get('/')
self.assertTrue('Hello World!' in rv.data)
Views: Add stub unit tests for stub views funcs.import unittest
from mongows import views
from... | <commit_before>import unittest
from mongows import views
from tests import MongoWSTestCase
class ViewsTestCase(MongoWSTestCase):
def test_hello(self):
rv = self.app.get('/')
self.assertTrue('Hello World!' in rv.data)
<commit_msg>Views: Add stub unit tests for stub views funcs.<commit_after>import... |
ebbcbed26731a24e02be6e90751a21a04051bb4b | tests/test_write.py | tests/test_write.py | from __future__ import absolute_import
from ofxparse import OfxParser, OfxPrinter
from unittest import TestCase
from io import StringIO
from os import close, remove
from tempfile import mkstemp
import sys
sys.path.append('..')
from .support import open_file
class TestOfxWrite(TestCase):
def test_write(self):
... | from __future__ import absolute_import
from ofxparse import OfxParser, OfxPrinter
from unittest import TestCase
from six import StringIO
from os import close, remove
from tempfile import mkstemp
import sys
sys.path.append('..')
from .support import open_file
class TestOfxWrite(TestCase):
def test_write(self):
... | Fix test_using_ofx_printer_with_stringio for python 2.7 | Fix test_using_ofx_printer_with_stringio for python 2.7
| Python | mit | rdsteed/ofxparse,udibr/ofxparse,jseutter/ofxparse | from __future__ import absolute_import
from ofxparse import OfxParser, OfxPrinter
from unittest import TestCase
from io import StringIO
from os import close, remove
from tempfile import mkstemp
import sys
sys.path.append('..')
from .support import open_file
class TestOfxWrite(TestCase):
def test_write(self):
... | from __future__ import absolute_import
from ofxparse import OfxParser, OfxPrinter
from unittest import TestCase
from six import StringIO
from os import close, remove
from tempfile import mkstemp
import sys
sys.path.append('..')
from .support import open_file
class TestOfxWrite(TestCase):
def test_write(self):
... | <commit_before>from __future__ import absolute_import
from ofxparse import OfxParser, OfxPrinter
from unittest import TestCase
from io import StringIO
from os import close, remove
from tempfile import mkstemp
import sys
sys.path.append('..')
from .support import open_file
class TestOfxWrite(TestCase):
def test_w... | from __future__ import absolute_import
from ofxparse import OfxParser, OfxPrinter
from unittest import TestCase
from six import StringIO
from os import close, remove
from tempfile import mkstemp
import sys
sys.path.append('..')
from .support import open_file
class TestOfxWrite(TestCase):
def test_write(self):
... | from __future__ import absolute_import
from ofxparse import OfxParser, OfxPrinter
from unittest import TestCase
from io import StringIO
from os import close, remove
from tempfile import mkstemp
import sys
sys.path.append('..')
from .support import open_file
class TestOfxWrite(TestCase):
def test_write(self):
... | <commit_before>from __future__ import absolute_import
from ofxparse import OfxParser, OfxPrinter
from unittest import TestCase
from io import StringIO
from os import close, remove
from tempfile import mkstemp
import sys
sys.path.append('..')
from .support import open_file
class TestOfxWrite(TestCase):
def test_w... |
925fefdcdaf32123a9ed4ed2b038bcb11269d77d | main/appengine_config.py | main/appengine_config.py | # coding: utf-8
import os
import sys
sys.path.insert(0, 'libx')
if os.environ.get('SERVER_SOFTWARE', '').startswith('Google App Engine'):
sys.path.insert(0, 'lib.zip')
else:
import re
from google.appengine.tools.devappserver2.python import stubs
re_ = stubs.FakeFile._skip_files.pattern.replace('|^lib/.*', ''... | # coding: utf-8
import os
import sys
if os.environ.get('SERVER_SOFTWARE', '').startswith('Google App Engine'):
sys.path.insert(0, 'lib.zip')
else:
import re
from google.appengine.tools.devappserver2.python import stubs
re_ = stubs.FakeFile._skip_files.pattern.replace('|^lib/.*', '')
re_ = re.compile(re_)
... | Remove duplicate libx path insertion | Remove duplicate libx path insertion
| Python | mit | gae-init/gae-init-babel,lipis/life-line,lipis/life-line,mdxs/gae-init-babel,gae-init/gae-init-babel,gae-init/gae-init-babel,mdxs/gae-init-babel,gae-init/gae-init-babel,mdxs/gae-init-babel,lipis/life-line | # coding: utf-8
import os
import sys
sys.path.insert(0, 'libx')
if os.environ.get('SERVER_SOFTWARE', '').startswith('Google App Engine'):
sys.path.insert(0, 'lib.zip')
else:
import re
from google.appengine.tools.devappserver2.python import stubs
re_ = stubs.FakeFile._skip_files.pattern.replace('|^lib/.*', ''... | # coding: utf-8
import os
import sys
if os.environ.get('SERVER_SOFTWARE', '').startswith('Google App Engine'):
sys.path.insert(0, 'lib.zip')
else:
import re
from google.appengine.tools.devappserver2.python import stubs
re_ = stubs.FakeFile._skip_files.pattern.replace('|^lib/.*', '')
re_ = re.compile(re_)
... | <commit_before># coding: utf-8
import os
import sys
sys.path.insert(0, 'libx')
if os.environ.get('SERVER_SOFTWARE', '').startswith('Google App Engine'):
sys.path.insert(0, 'lib.zip')
else:
import re
from google.appengine.tools.devappserver2.python import stubs
re_ = stubs.FakeFile._skip_files.pattern.replace... | # coding: utf-8
import os
import sys
if os.environ.get('SERVER_SOFTWARE', '').startswith('Google App Engine'):
sys.path.insert(0, 'lib.zip')
else:
import re
from google.appengine.tools.devappserver2.python import stubs
re_ = stubs.FakeFile._skip_files.pattern.replace('|^lib/.*', '')
re_ = re.compile(re_)
... | # coding: utf-8
import os
import sys
sys.path.insert(0, 'libx')
if os.environ.get('SERVER_SOFTWARE', '').startswith('Google App Engine'):
sys.path.insert(0, 'lib.zip')
else:
import re
from google.appengine.tools.devappserver2.python import stubs
re_ = stubs.FakeFile._skip_files.pattern.replace('|^lib/.*', ''... | <commit_before># coding: utf-8
import os
import sys
sys.path.insert(0, 'libx')
if os.environ.get('SERVER_SOFTWARE', '').startswith('Google App Engine'):
sys.path.insert(0, 'lib.zip')
else:
import re
from google.appengine.tools.devappserver2.python import stubs
re_ = stubs.FakeFile._skip_files.pattern.replace... |
412f432cd09d39970171630666bab5fd2cc89924 | o3d/installer/win/o3d_version.py | o3d/installer/win/o3d_version.py | #!/usr/bin/python2.4
# Copyright 2008-9 Google Inc. All Rights Reserved.
# version = (major, minor, trunk, patch)
plugin_version = (0, 1, 43, 1)
sdk_version = plugin_version
| #!/usr/bin/python2.4
# Copyright 2008-9 Google Inc. All Rights Reserved.
# version = (major, minor, trunk, patch)
plugin_version = (0, 1, 43, 2)
sdk_version = plugin_version
| Bump version to turn on SET_MAX_FPS. | Bump version to turn on SET_MAX_FPS.
Review URL: http://codereview.chromium.org/1875002
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@46239 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | gavinp/chromium,gavinp/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,adobe/chromium,gavinp/chromium,gavinp/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,ropik/chromium,yitian134/chromium,Crystalni... | #!/usr/bin/python2.4
# Copyright 2008-9 Google Inc. All Rights Reserved.
# version = (major, minor, trunk, patch)
plugin_version = (0, 1, 43, 1)
sdk_version = plugin_version
Bump version to turn on SET_MAX_FPS.
Review URL: http://codereview.chromium.org/1875002
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@46... | #!/usr/bin/python2.4
# Copyright 2008-9 Google Inc. All Rights Reserved.
# version = (major, minor, trunk, patch)
plugin_version = (0, 1, 43, 2)
sdk_version = plugin_version
| <commit_before>#!/usr/bin/python2.4
# Copyright 2008-9 Google Inc. All Rights Reserved.
# version = (major, minor, trunk, patch)
plugin_version = (0, 1, 43, 1)
sdk_version = plugin_version
<commit_msg>Bump version to turn on SET_MAX_FPS.
Review URL: http://codereview.chromium.org/1875002
git-svn-id: de016e52bd170d2d... | #!/usr/bin/python2.4
# Copyright 2008-9 Google Inc. All Rights Reserved.
# version = (major, minor, trunk, patch)
plugin_version = (0, 1, 43, 2)
sdk_version = plugin_version
| #!/usr/bin/python2.4
# Copyright 2008-9 Google Inc. All Rights Reserved.
# version = (major, minor, trunk, patch)
plugin_version = (0, 1, 43, 1)
sdk_version = plugin_version
Bump version to turn on SET_MAX_FPS.
Review URL: http://codereview.chromium.org/1875002
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@46... | <commit_before>#!/usr/bin/python2.4
# Copyright 2008-9 Google Inc. All Rights Reserved.
# version = (major, minor, trunk, patch)
plugin_version = (0, 1, 43, 1)
sdk_version = plugin_version
<commit_msg>Bump version to turn on SET_MAX_FPS.
Review URL: http://codereview.chromium.org/1875002
git-svn-id: de016e52bd170d2d... |
62451e8c5b3d93409fa4bcc7ec29827be6253e88 | website/registries/utils.py | website/registries/utils.py | REG_CAMPAIGNS = {
'prereg': 'Prereg Challenge',
'registered_report': 'Registered Report Protocol Preregistration',
}
def get_campaign_schema(campaign):
from osf.models import RegistrationSchema
if campaign not in REG_CAMPAIGNS:
raise ValueError('campaign must be one of: {}'.format(', '.join(REG... | REG_CAMPAIGNS = {
'prereg': 'Prereg Challenge',
'registered_report': 'Registered Report Protocol Preregistration',
}
def get_campaign_schema(campaign):
from osf.models import RegistrationSchema
if campaign not in REG_CAMPAIGNS:
raise ValueError('campaign must be one of: {}'.format(', '.join(REG... | Speed up draft registrations query. | Speed up draft registrations query.
| Python | apache-2.0 | baylee-d/osf.io,brianjgeiger/osf.io,Johnetordoff/osf.io,cslzchen/osf.io,adlius/osf.io,mattclark/osf.io,felliott/osf.io,saradbowman/osf.io,Johnetordoff/osf.io,Johnetordoff/osf.io,cslzchen/osf.io,felliott/osf.io,CenterForOpenScience/osf.io,cslzchen/osf.io,baylee-d/osf.io,mattclark/osf.io,brianjgeiger/osf.io,mattclark/osf... | REG_CAMPAIGNS = {
'prereg': 'Prereg Challenge',
'registered_report': 'Registered Report Protocol Preregistration',
}
def get_campaign_schema(campaign):
from osf.models import RegistrationSchema
if campaign not in REG_CAMPAIGNS:
raise ValueError('campaign must be one of: {}'.format(', '.join(REG... | REG_CAMPAIGNS = {
'prereg': 'Prereg Challenge',
'registered_report': 'Registered Report Protocol Preregistration',
}
def get_campaign_schema(campaign):
from osf.models import RegistrationSchema
if campaign not in REG_CAMPAIGNS:
raise ValueError('campaign must be one of: {}'.format(', '.join(REG... | <commit_before>REG_CAMPAIGNS = {
'prereg': 'Prereg Challenge',
'registered_report': 'Registered Report Protocol Preregistration',
}
def get_campaign_schema(campaign):
from osf.models import RegistrationSchema
if campaign not in REG_CAMPAIGNS:
raise ValueError('campaign must be one of: {}'.forma... | REG_CAMPAIGNS = {
'prereg': 'Prereg Challenge',
'registered_report': 'Registered Report Protocol Preregistration',
}
def get_campaign_schema(campaign):
from osf.models import RegistrationSchema
if campaign not in REG_CAMPAIGNS:
raise ValueError('campaign must be one of: {}'.format(', '.join(REG... | REG_CAMPAIGNS = {
'prereg': 'Prereg Challenge',
'registered_report': 'Registered Report Protocol Preregistration',
}
def get_campaign_schema(campaign):
from osf.models import RegistrationSchema
if campaign not in REG_CAMPAIGNS:
raise ValueError('campaign must be one of: {}'.format(', '.join(REG... | <commit_before>REG_CAMPAIGNS = {
'prereg': 'Prereg Challenge',
'registered_report': 'Registered Report Protocol Preregistration',
}
def get_campaign_schema(campaign):
from osf.models import RegistrationSchema
if campaign not in REG_CAMPAIGNS:
raise ValueError('campaign must be one of: {}'.forma... |
c02b09b4f9bf3ed3f8b78d5f65f699407d51d1a2 | zou/app/models/task_type.py | zou/app/models/task_type.py | from sqlalchemy_utils import UUIDType
from zou.app import db
from zou.app.models.serializer import SerializerMixin
from zou.app.models.base import BaseMixin
class TaskType(db.Model, BaseMixin, SerializerMixin):
"""
Categorize tasks in domain areas: modeling, animation, etc.
"""
name = db.Column(db.St... | from sqlalchemy_utils import UUIDType
from zou.app import db
from zou.app.models.serializer import SerializerMixin
from zou.app.models.base import BaseMixin
class TaskType(db.Model, BaseMixin, SerializerMixin):
"""
Categorize tasks in domain areas: modeling, animation, etc.
"""
name = db.Column(db.St... | Make task type short field bigger | Make task type short field bigger
| Python | agpl-3.0 | cgwire/zou | from sqlalchemy_utils import UUIDType
from zou.app import db
from zou.app.models.serializer import SerializerMixin
from zou.app.models.base import BaseMixin
class TaskType(db.Model, BaseMixin, SerializerMixin):
"""
Categorize tasks in domain areas: modeling, animation, etc.
"""
name = db.Column(db.St... | from sqlalchemy_utils import UUIDType
from zou.app import db
from zou.app.models.serializer import SerializerMixin
from zou.app.models.base import BaseMixin
class TaskType(db.Model, BaseMixin, SerializerMixin):
"""
Categorize tasks in domain areas: modeling, animation, etc.
"""
name = db.Column(db.St... | <commit_before>from sqlalchemy_utils import UUIDType
from zou.app import db
from zou.app.models.serializer import SerializerMixin
from zou.app.models.base import BaseMixin
class TaskType(db.Model, BaseMixin, SerializerMixin):
"""
Categorize tasks in domain areas: modeling, animation, etc.
"""
name = ... | from sqlalchemy_utils import UUIDType
from zou.app import db
from zou.app.models.serializer import SerializerMixin
from zou.app.models.base import BaseMixin
class TaskType(db.Model, BaseMixin, SerializerMixin):
"""
Categorize tasks in domain areas: modeling, animation, etc.
"""
name = db.Column(db.St... | from sqlalchemy_utils import UUIDType
from zou.app import db
from zou.app.models.serializer import SerializerMixin
from zou.app.models.base import BaseMixin
class TaskType(db.Model, BaseMixin, SerializerMixin):
"""
Categorize tasks in domain areas: modeling, animation, etc.
"""
name = db.Column(db.St... | <commit_before>from sqlalchemy_utils import UUIDType
from zou.app import db
from zou.app.models.serializer import SerializerMixin
from zou.app.models.base import BaseMixin
class TaskType(db.Model, BaseMixin, SerializerMixin):
"""
Categorize tasks in domain areas: modeling, animation, etc.
"""
name = ... |
8afbd0fe7f4732d8484a2a41b91451ec220fc2f8 | tools/perf/benchmarks/memory.py | tools/perf/benchmarks/memory.py | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry import test
from measurements import memory
class Memory(test.Test):
test = memory.Memory
page_set = 'page_sets/top_25.json'
class... | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry import test
from measurements import memory
class MemoryTop25(test.Test):
test = memory.Memory
page_set = 'page_sets/top_25.json'
... | Rename Memory benchmark to avoid conflict with Memory measurement. | [telemetry] Rename Memory benchmark to avoid conflict with Memory measurement.
Quick fix for now, but I may need to reconsider how run_measurement resolved name conflicts.
BUG=263511
TEST=None.
[email protected]
Review URL: https://chromiumcodereview.appspot.com/19915008
git-svn-id: de016e52bd170d2d4f2344f9bf92... | Python | bsd-3-clause | PeterWangIntel/chromium-crosswalk,markYoungH/chromium.src,dednal/chromium.src,jaruba/chromium.src,mogoweb/chromium-crosswalk,jaruba/chromium.src,chuan9/chromium-crosswalk,Jonekee/chromium.src,mogoweb/chromium-crosswalk,M4sse/chromium.src,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,crosswalk-project/ch... | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry import test
from measurements import memory
class Memory(test.Test):
test = memory.Memory
page_set = 'page_sets/top_25.json'
class... | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry import test
from measurements import memory
class MemoryTop25(test.Test):
test = memory.Memory
page_set = 'page_sets/top_25.json'
... | <commit_before># Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry import test
from measurements import memory
class Memory(test.Test):
test = memory.Memory
page_set = 'page_sets/top_2... | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry import test
from measurements import memory
class MemoryTop25(test.Test):
test = memory.Memory
page_set = 'page_sets/top_25.json'
... | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry import test
from measurements import memory
class Memory(test.Test):
test = memory.Memory
page_set = 'page_sets/top_25.json'
class... | <commit_before># Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry import test
from measurements import memory
class Memory(test.Test):
test = memory.Memory
page_set = 'page_sets/top_2... |
39671789613e1811f2282d45a7c8970b0262e5ea | mopidy_jukebox/models.py | mopidy_jukebox/models.py | """
Models for the Jukebox application
User - All users
Vote - Votes on songs
"""
import logging
from peewee import SqliteDatabase, Model, CharField, DateTimeField, ForeignKeyField
db = SqliteDatabase(None)
logger = logging.getLogger(__name__)
class User(Model):
name = CharField()
@staticmethod
def c... | """
Models for the Jukebox application
User - All users
Vote - Votes on songs
"""
import datetime
import logging
from peewee import SqliteDatabase, Model, CharField, DateTimeField, ForeignKeyField, UUIDField
db = SqliteDatabase(None)
logger = logging.getLogger(__name__)
class User(Model):
id = CharField(prima... | Create model for session, add properties for user | Create model for session, add properties for user
| Python | mit | qurben/mopidy-jukebox,qurben/mopidy-jukebox,qurben/mopidy-jukebox | """
Models for the Jukebox application
User - All users
Vote - Votes on songs
"""
import logging
from peewee import SqliteDatabase, Model, CharField, DateTimeField, ForeignKeyField
db = SqliteDatabase(None)
logger = logging.getLogger(__name__)
class User(Model):
name = CharField()
@staticmethod
def c... | """
Models for the Jukebox application
User - All users
Vote - Votes on songs
"""
import datetime
import logging
from peewee import SqliteDatabase, Model, CharField, DateTimeField, ForeignKeyField, UUIDField
db = SqliteDatabase(None)
logger = logging.getLogger(__name__)
class User(Model):
id = CharField(prima... | <commit_before>"""
Models for the Jukebox application
User - All users
Vote - Votes on songs
"""
import logging
from peewee import SqliteDatabase, Model, CharField, DateTimeField, ForeignKeyField
db = SqliteDatabase(None)
logger = logging.getLogger(__name__)
class User(Model):
name = CharField()
@staticm... | """
Models for the Jukebox application
User - All users
Vote - Votes on songs
"""
import datetime
import logging
from peewee import SqliteDatabase, Model, CharField, DateTimeField, ForeignKeyField, UUIDField
db = SqliteDatabase(None)
logger = logging.getLogger(__name__)
class User(Model):
id = CharField(prima... | """
Models for the Jukebox application
User - All users
Vote - Votes on songs
"""
import logging
from peewee import SqliteDatabase, Model, CharField, DateTimeField, ForeignKeyField
db = SqliteDatabase(None)
logger = logging.getLogger(__name__)
class User(Model):
name = CharField()
@staticmethod
def c... | <commit_before>"""
Models for the Jukebox application
User - All users
Vote - Votes on songs
"""
import logging
from peewee import SqliteDatabase, Model, CharField, DateTimeField, ForeignKeyField
db = SqliteDatabase(None)
logger = logging.getLogger(__name__)
class User(Model):
name = CharField()
@staticm... |
c7650f69e1a1d7ff16e72a741b329b32636a5a3d | lizard_apps/views.py | lizard_apps/views.py | # -*- coding: utf-8 -*-
# (c) Nelen & Schuurmans, see LICENSE.rst.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from django.views.generic import TemplateView
from lizard_apps.models import Screen
class AppScreen... | # -*- coding: utf-8 -*-
# (c) Nelen & Schuurmans, see LICENSE.rst.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from django.views.generic import TemplateView
from django.shortcuts import get_object_or_404
from liz... | Return 404 instead of incorrect JS file when screen does not exist. | Return 404 instead of incorrect JS file when screen does not exist.
| Python | mit | lizardsystem/lizard-apps,lizardsystem/lizard-apps | # -*- coding: utf-8 -*-
# (c) Nelen & Schuurmans, see LICENSE.rst.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from django.views.generic import TemplateView
from lizard_apps.models import Screen
class AppScreen... | # -*- coding: utf-8 -*-
# (c) Nelen & Schuurmans, see LICENSE.rst.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from django.views.generic import TemplateView
from django.shortcuts import get_object_or_404
from liz... | <commit_before># -*- coding: utf-8 -*-
# (c) Nelen & Schuurmans, see LICENSE.rst.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from django.views.generic import TemplateView
from lizard_apps.models import Screen
... | # -*- coding: utf-8 -*-
# (c) Nelen & Schuurmans, see LICENSE.rst.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from django.views.generic import TemplateView
from django.shortcuts import get_object_or_404
from liz... | # -*- coding: utf-8 -*-
# (c) Nelen & Schuurmans, see LICENSE.rst.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from django.views.generic import TemplateView
from lizard_apps.models import Screen
class AppScreen... | <commit_before># -*- coding: utf-8 -*-
# (c) Nelen & Schuurmans, see LICENSE.rst.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from django.views.generic import TemplateView
from lizard_apps.models import Screen
... |
360bdaa2df7673bc2090476df077c86c6f7c5633 | utils/exceptions.py | utils/exceptions.py | class ResponseError(Exception):
"""For throwing in case of a non-200 response status."""
def __init__(self, *args, code=None, **kwargs):
self.code = code
super().__init__(*args, **kwargs)
| class ResponseError(Exception):
"""For throwing in case of a non-200 response status."""
def __init__(self, code=None, *args):
self.code = code
super().__init__(code, *args)
| Change constructor to be more appropriate | Change constructor to be more appropriate
| Python | mit | BeatButton/beattie-bot,BeatButton/beattie | class ResponseError(Exception):
"""For throwing in case of a non-200 response status."""
def __init__(self, *args, code=None, **kwargs):
self.code = code
super().__init__(*args, **kwargs)
Change constructor to be more appropriate | class ResponseError(Exception):
"""For throwing in case of a non-200 response status."""
def __init__(self, code=None, *args):
self.code = code
super().__init__(code, *args)
| <commit_before>class ResponseError(Exception):
"""For throwing in case of a non-200 response status."""
def __init__(self, *args, code=None, **kwargs):
self.code = code
super().__init__(*args, **kwargs)
<commit_msg>Change constructor to be more appropriate<commit_after> | class ResponseError(Exception):
"""For throwing in case of a non-200 response status."""
def __init__(self, code=None, *args):
self.code = code
super().__init__(code, *args)
| class ResponseError(Exception):
"""For throwing in case of a non-200 response status."""
def __init__(self, *args, code=None, **kwargs):
self.code = code
super().__init__(*args, **kwargs)
Change constructor to be more appropriateclass ResponseError(Exception):
"""For throwing in case of a no... | <commit_before>class ResponseError(Exception):
"""For throwing in case of a non-200 response status."""
def __init__(self, *args, code=None, **kwargs):
self.code = code
super().__init__(*args, **kwargs)
<commit_msg>Change constructor to be more appropriate<commit_after>class ResponseError(Except... |
597ad813ca91a2fe71f96c0843e2631059a88358 | debug_toolbar/panels/request_vars.py | debug_toolbar/panels/request_vars.py | from django.template.loader import render_to_string
from debug_toolbar.panels import DebugPanel
class RequestVarsDebugPanel(DebugPanel):
"""
A panel to display request variables (POST/GET, session, cookies).
"""
name = 'RequestVars'
has_content = True
def nav_title(self):
return 'Reque... | from django.template.loader import render_to_string
from debug_toolbar.panels import DebugPanel
class RequestVarsDebugPanel(DebugPanel):
"""
A panel to display request variables (POST/GET, session, cookies).
"""
name = 'RequestVars'
has_content = True
def nav_title(self):
return 'Reque... | Allow request vars to work even with disabled session middleware. | Allow request vars to work even with disabled session middleware.
| Python | bsd-3-clause | alex/django-debug-toolbar,Endika/django-debug-toolbar,spookylukey/django-debug-toolbar,stored/django-debug-toolbar,ivelum/django-debug-toolbar,stored/django-debug-toolbar,peap/django-debug-toolbar,ivelum/django-debug-toolbar,ivelum/django-debug-toolbar,spookylukey/django-debug-toolbar,django-debug-toolbar/django-debug-... | from django.template.loader import render_to_string
from debug_toolbar.panels import DebugPanel
class RequestVarsDebugPanel(DebugPanel):
"""
A panel to display request variables (POST/GET, session, cookies).
"""
name = 'RequestVars'
has_content = True
def nav_title(self):
return 'Reque... | from django.template.loader import render_to_string
from debug_toolbar.panels import DebugPanel
class RequestVarsDebugPanel(DebugPanel):
"""
A panel to display request variables (POST/GET, session, cookies).
"""
name = 'RequestVars'
has_content = True
def nav_title(self):
return 'Reque... | <commit_before>from django.template.loader import render_to_string
from debug_toolbar.panels import DebugPanel
class RequestVarsDebugPanel(DebugPanel):
"""
A panel to display request variables (POST/GET, session, cookies).
"""
name = 'RequestVars'
has_content = True
def nav_title(self):
... | from django.template.loader import render_to_string
from debug_toolbar.panels import DebugPanel
class RequestVarsDebugPanel(DebugPanel):
"""
A panel to display request variables (POST/GET, session, cookies).
"""
name = 'RequestVars'
has_content = True
def nav_title(self):
return 'Reque... | from django.template.loader import render_to_string
from debug_toolbar.panels import DebugPanel
class RequestVarsDebugPanel(DebugPanel):
"""
A panel to display request variables (POST/GET, session, cookies).
"""
name = 'RequestVars'
has_content = True
def nav_title(self):
return 'Reque... | <commit_before>from django.template.loader import render_to_string
from debug_toolbar.panels import DebugPanel
class RequestVarsDebugPanel(DebugPanel):
"""
A panel to display request variables (POST/GET, session, cookies).
"""
name = 'RequestVars'
has_content = True
def nav_title(self):
... |
b1f1c95ba28546d166568b5bb202dfa87e5edb3b | protractor/test.py | protractor/test.py | # -*- coding: utf-8 -*-
import os
import subprocess
class ProtractorTestCaseMixin(object):
protractor_conf = 'protractor.conf.js'
suite = None
specs = None
@classmethod
def setUpClass(cls):
super(ProtractorTestCaseMixin, cls).setUpClass()
with open(os.devnull, 'wb') as f:
... | # -*- coding: utf-8 -*-
import os
import subprocess
class ProtractorTestCaseMixin(object):
protractor_conf = 'protractor.conf.js'
suite = None
specs = None
@classmethod
def setUpClass(cls):
super(ProtractorTestCaseMixin, cls).setUpClass()
with open(os.devnull, 'wb') as f:
... | Add quotes so all params are strings | Add quotes so all params are strings
| Python | mit | jpulec/django-protractor | # -*- coding: utf-8 -*-
import os
import subprocess
class ProtractorTestCaseMixin(object):
protractor_conf = 'protractor.conf.js'
suite = None
specs = None
@classmethod
def setUpClass(cls):
super(ProtractorTestCaseMixin, cls).setUpClass()
with open(os.devnull, 'wb') as f:
... | # -*- coding: utf-8 -*-
import os
import subprocess
class ProtractorTestCaseMixin(object):
protractor_conf = 'protractor.conf.js'
suite = None
specs = None
@classmethod
def setUpClass(cls):
super(ProtractorTestCaseMixin, cls).setUpClass()
with open(os.devnull, 'wb') as f:
... | <commit_before># -*- coding: utf-8 -*-
import os
import subprocess
class ProtractorTestCaseMixin(object):
protractor_conf = 'protractor.conf.js'
suite = None
specs = None
@classmethod
def setUpClass(cls):
super(ProtractorTestCaseMixin, cls).setUpClass()
with open(os.devnull, 'wb'... | # -*- coding: utf-8 -*-
import os
import subprocess
class ProtractorTestCaseMixin(object):
protractor_conf = 'protractor.conf.js'
suite = None
specs = None
@classmethod
def setUpClass(cls):
super(ProtractorTestCaseMixin, cls).setUpClass()
with open(os.devnull, 'wb') as f:
... | # -*- coding: utf-8 -*-
import os
import subprocess
class ProtractorTestCaseMixin(object):
protractor_conf = 'protractor.conf.js'
suite = None
specs = None
@classmethod
def setUpClass(cls):
super(ProtractorTestCaseMixin, cls).setUpClass()
with open(os.devnull, 'wb') as f:
... | <commit_before># -*- coding: utf-8 -*-
import os
import subprocess
class ProtractorTestCaseMixin(object):
protractor_conf = 'protractor.conf.js'
suite = None
specs = None
@classmethod
def setUpClass(cls):
super(ProtractorTestCaseMixin, cls).setUpClass()
with open(os.devnull, 'wb'... |
7740ff36679b13be9d63b333cff35f913e0066dc | python/tests/py3/test_asyncio.py | python/tests/py3/test_asyncio.py | import asyncio
import pytest
def test_hello_world(workspace):
workspace.src('main.py', r"""
import asyncio
async def main():
print('Hello, ', end='')
await asyncio.sleep(1)
print('World!')
# Python 3.7+
asyncio.run(main())
""")
r = workspace.run('python main.py')
... | import asyncio
import pytest
def test_hello_world(workspace):
workspace.src('main.py', r"""
import asyncio
async def do_something_else():
print('...', end='')
await asyncio.sleep(1)
print('!', end='')
async def say_hello_async(who):
print('Hello, ', end='')
awa... | Make hello world (asyncio) more involved | [python] Make hello world (asyncio) more involved
| Python | mit | imsardine/learning,imsardine/learning,imsardine/learning,imsardine/learning,imsardine/learning,imsardine/learning,imsardine/learning | import asyncio
import pytest
def test_hello_world(workspace):
workspace.src('main.py', r"""
import asyncio
async def main():
print('Hello, ', end='')
await asyncio.sleep(1)
print('World!')
# Python 3.7+
asyncio.run(main())
""")
r = workspace.run('python main.py')
... | import asyncio
import pytest
def test_hello_world(workspace):
workspace.src('main.py', r"""
import asyncio
async def do_something_else():
print('...', end='')
await asyncio.sleep(1)
print('!', end='')
async def say_hello_async(who):
print('Hello, ', end='')
awa... | <commit_before>import asyncio
import pytest
def test_hello_world(workspace):
workspace.src('main.py', r"""
import asyncio
async def main():
print('Hello, ', end='')
await asyncio.sleep(1)
print('World!')
# Python 3.7+
asyncio.run(main())
""")
r = workspace.run('py... | import asyncio
import pytest
def test_hello_world(workspace):
workspace.src('main.py', r"""
import asyncio
async def do_something_else():
print('...', end='')
await asyncio.sleep(1)
print('!', end='')
async def say_hello_async(who):
print('Hello, ', end='')
awa... | import asyncio
import pytest
def test_hello_world(workspace):
workspace.src('main.py', r"""
import asyncio
async def main():
print('Hello, ', end='')
await asyncio.sleep(1)
print('World!')
# Python 3.7+
asyncio.run(main())
""")
r = workspace.run('python main.py')
... | <commit_before>import asyncio
import pytest
def test_hello_world(workspace):
workspace.src('main.py', r"""
import asyncio
async def main():
print('Hello, ', end='')
await asyncio.sleep(1)
print('World!')
# Python 3.7+
asyncio.run(main())
""")
r = workspace.run('py... |
30fa612a2ef5ebcc6b8d84aa9b57cca098b3d8ad | py2neo/__init__.py | py2neo/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011-2014, Nigel Small
#
# 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... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011-2014, Nigel Small
#
# 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... | Add lang to global export list. | Add lang to global export list.
| Python | apache-2.0 | nigelsmall/py2neo,nicolewhite/py2neo,technige/py2neo,fpieper/py2neo,fpieper/py2neo,technige/py2neo,technige/py2neo,fpieper/py2neo,nigelsmall/py2neo,nicolewhite/py2neo,nicolewhite/py2neo | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011-2014, Nigel Small
#
# 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... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011-2014, Nigel Small
#
# 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... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011-2014, Nigel Small
#
# 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... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011-2014, Nigel Small
#
# 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... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011-2014, Nigel Small
#
# 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... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011-2014, Nigel Small
#
# 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... |
144280ff8c656fb589e92a3f0fe5cba7ce63d85d | tailor/listeners/mainlistener.py | tailor/listeners/mainlistener.py | from tailor.swift.swiftlistener import SwiftListener
from tailor.utils.charformat import isUpperCamelCase
class MainListener(SwiftListener):
def enterClassName(self, ctx):
self.__verify_upper_camel_case(ctx, 'Class names should be in UpperCamelCase')
def enterEnumName(self, ctx):
pass
d... | from tailor.swift.swiftlistener import SwiftListener
from tailor.utils.charformat import isUpperCamelCase
class MainListener(SwiftListener):
def enterClassName(self, ctx):
self.__verify_upper_camel_case(ctx, 'Class names should be in UpperCamelCase')
def enterEnumName(self, ctx):
self.__veri... | Implement UpperCamelCase name check for enums | Implement UpperCamelCase name check for enums
| Python | mit | sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor | from tailor.swift.swiftlistener import SwiftListener
from tailor.utils.charformat import isUpperCamelCase
class MainListener(SwiftListener):
def enterClassName(self, ctx):
self.__verify_upper_camel_case(ctx, 'Class names should be in UpperCamelCase')
def enterEnumName(self, ctx):
pass
d... | from tailor.swift.swiftlistener import SwiftListener
from tailor.utils.charformat import isUpperCamelCase
class MainListener(SwiftListener):
def enterClassName(self, ctx):
self.__verify_upper_camel_case(ctx, 'Class names should be in UpperCamelCase')
def enterEnumName(self, ctx):
self.__veri... | <commit_before>from tailor.swift.swiftlistener import SwiftListener
from tailor.utils.charformat import isUpperCamelCase
class MainListener(SwiftListener):
def enterClassName(self, ctx):
self.__verify_upper_camel_case(ctx, 'Class names should be in UpperCamelCase')
def enterEnumName(self, ctx):
... | from tailor.swift.swiftlistener import SwiftListener
from tailor.utils.charformat import isUpperCamelCase
class MainListener(SwiftListener):
def enterClassName(self, ctx):
self.__verify_upper_camel_case(ctx, 'Class names should be in UpperCamelCase')
def enterEnumName(self, ctx):
self.__veri... | from tailor.swift.swiftlistener import SwiftListener
from tailor.utils.charformat import isUpperCamelCase
class MainListener(SwiftListener):
def enterClassName(self, ctx):
self.__verify_upper_camel_case(ctx, 'Class names should be in UpperCamelCase')
def enterEnumName(self, ctx):
pass
d... | <commit_before>from tailor.swift.swiftlistener import SwiftListener
from tailor.utils.charformat import isUpperCamelCase
class MainListener(SwiftListener):
def enterClassName(self, ctx):
self.__verify_upper_camel_case(ctx, 'Class names should be in UpperCamelCase')
def enterEnumName(self, ctx):
... |
55237ad67dddaf070a40ea1ab64f84799356edfa | requests/_oauth.py | requests/_oauth.py | # -*- coding: utf-8 -*-
"""
requests._oauth
~~~~~~~~~~~~~~~
This module comtains the path hack neccesary for oauthlib to be vendored into requests
while allowing upstream changes.
"""
import os
import sys
try:
from oauthlib.oauth1 import rfc5849
from oauthlib.common import extract_params
from oauthlib.o... | # -*- coding: utf-8 -*-
"""
requests._oauth
~~~~~~~~~~~~~~~
This module contains the path hack necessary for oauthlib to be vendored into
requests while allowing upstream changes.
"""
import os
import sys
try:
from oauthlib.oauth1 import rfc5849
from oauthlib.common import extract_params
from oauthlib.o... | Comment typo fix and move newline. | Comment typo fix and move newline.
| Python | isc | revolunet/requests,Bluehorn/requests,revolunet/requests,psf/requests | # -*- coding: utf-8 -*-
"""
requests._oauth
~~~~~~~~~~~~~~~
This module comtains the path hack neccesary for oauthlib to be vendored into requests
while allowing upstream changes.
"""
import os
import sys
try:
from oauthlib.oauth1 import rfc5849
from oauthlib.common import extract_params
from oauthlib.o... | # -*- coding: utf-8 -*-
"""
requests._oauth
~~~~~~~~~~~~~~~
This module contains the path hack necessary for oauthlib to be vendored into
requests while allowing upstream changes.
"""
import os
import sys
try:
from oauthlib.oauth1 import rfc5849
from oauthlib.common import extract_params
from oauthlib.o... | <commit_before># -*- coding: utf-8 -*-
"""
requests._oauth
~~~~~~~~~~~~~~~
This module comtains the path hack neccesary for oauthlib to be vendored into requests
while allowing upstream changes.
"""
import os
import sys
try:
from oauthlib.oauth1 import rfc5849
from oauthlib.common import extract_params
... | # -*- coding: utf-8 -*-
"""
requests._oauth
~~~~~~~~~~~~~~~
This module contains the path hack necessary for oauthlib to be vendored into
requests while allowing upstream changes.
"""
import os
import sys
try:
from oauthlib.oauth1 import rfc5849
from oauthlib.common import extract_params
from oauthlib.o... | # -*- coding: utf-8 -*-
"""
requests._oauth
~~~~~~~~~~~~~~~
This module comtains the path hack neccesary for oauthlib to be vendored into requests
while allowing upstream changes.
"""
import os
import sys
try:
from oauthlib.oauth1 import rfc5849
from oauthlib.common import extract_params
from oauthlib.o... | <commit_before># -*- coding: utf-8 -*-
"""
requests._oauth
~~~~~~~~~~~~~~~
This module comtains the path hack neccesary for oauthlib to be vendored into requests
while allowing upstream changes.
"""
import os
import sys
try:
from oauthlib.oauth1 import rfc5849
from oauthlib.common import extract_params
... |
ef0d59781fbc9dcd89334843e5b6fc1461aed246 | rollbar/contrib/asgi/__init__.py | rollbar/contrib/asgi/__init__.py | __all__ = ["ASGIMiddleware"]
import rollbar
try:
from starlette.types import ASGIApp, Receive, Scope, Send
except ImportError:
STARLETTE_INSTALLED = False
else:
STARLETTE_INSTALLED = True
# Optional class annotations must be statically declared because
# IDEs cannot infer type hinting for arbitrary dyna... | __all__ = ["ASGIMiddleware"]
import rollbar
try:
from starlette.types import ASGIApp as ASGIAppType, Receive, Scope, Send
except ImportError:
STARLETTE_INSTALLED = False
else:
STARLETTE_INSTALLED = True
# Optional class annotations must be statically declared because
# IDEs cannot infer type hinting for... | Use unique identifier name for ASGIApp type | Use unique identifier name for ASGIApp type
Due to collision with ASGIApp class decorator
| Python | mit | rollbar/pyrollbar | __all__ = ["ASGIMiddleware"]
import rollbar
try:
from starlette.types import ASGIApp, Receive, Scope, Send
except ImportError:
STARLETTE_INSTALLED = False
else:
STARLETTE_INSTALLED = True
# Optional class annotations must be statically declared because
# IDEs cannot infer type hinting for arbitrary dyna... | __all__ = ["ASGIMiddleware"]
import rollbar
try:
from starlette.types import ASGIApp as ASGIAppType, Receive, Scope, Send
except ImportError:
STARLETTE_INSTALLED = False
else:
STARLETTE_INSTALLED = True
# Optional class annotations must be statically declared because
# IDEs cannot infer type hinting for... | <commit_before>__all__ = ["ASGIMiddleware"]
import rollbar
try:
from starlette.types import ASGIApp, Receive, Scope, Send
except ImportError:
STARLETTE_INSTALLED = False
else:
STARLETTE_INSTALLED = True
# Optional class annotations must be statically declared because
# IDEs cannot infer type hinting for... | __all__ = ["ASGIMiddleware"]
import rollbar
try:
from starlette.types import ASGIApp as ASGIAppType, Receive, Scope, Send
except ImportError:
STARLETTE_INSTALLED = False
else:
STARLETTE_INSTALLED = True
# Optional class annotations must be statically declared because
# IDEs cannot infer type hinting for... | __all__ = ["ASGIMiddleware"]
import rollbar
try:
from starlette.types import ASGIApp, Receive, Scope, Send
except ImportError:
STARLETTE_INSTALLED = False
else:
STARLETTE_INSTALLED = True
# Optional class annotations must be statically declared because
# IDEs cannot infer type hinting for arbitrary dyna... | <commit_before>__all__ = ["ASGIMiddleware"]
import rollbar
try:
from starlette.types import ASGIApp, Receive, Scope, Send
except ImportError:
STARLETTE_INSTALLED = False
else:
STARLETTE_INSTALLED = True
# Optional class annotations must be statically declared because
# IDEs cannot infer type hinting for... |
2b83d2dd0c3e0230968a5ab2bd55a647eee2eb3a | packs/aws/actions/run.py | packs/aws/actions/run.py | from lib import action
class ActionManager(action.BaseAction):
def run(self, **kwargs):
action = kwargs['action']
del kwargs['action']
module_path = kwargs['module_path']
del kwargs['module_path']
if action == 'run_instances':
kwargs['user_data'] = self.st2_use... | from lib import action
class ActionManager(action.BaseAction):
def run(self, **kwargs):
action = kwargs['action']
del kwargs['action']
module_path = kwargs['module_path']
del kwargs['module_path']
if action == 'run_instances':
kwargs['user_data'] = self.st2_use... | Support DNS round-robin balancing through Route53 | Support DNS round-robin balancing through Route53
Our codegen actions for adding/updating A records in Route53 only support a single IP as a value. Changing to accept a comma-separated list, which will add an unweighted round-robin A record.
Should also add WRR at some point probably, but I just don't care enough. | Python | apache-2.0 | StackStorm/st2contrib,StackStorm/st2contrib,StackStorm/st2contrib | from lib import action
class ActionManager(action.BaseAction):
def run(self, **kwargs):
action = kwargs['action']
del kwargs['action']
module_path = kwargs['module_path']
del kwargs['module_path']
if action == 'run_instances':
kwargs['user_data'] = self.st2_use... | from lib import action
class ActionManager(action.BaseAction):
def run(self, **kwargs):
action = kwargs['action']
del kwargs['action']
module_path = kwargs['module_path']
del kwargs['module_path']
if action == 'run_instances':
kwargs['user_data'] = self.st2_use... | <commit_before>from lib import action
class ActionManager(action.BaseAction):
def run(self, **kwargs):
action = kwargs['action']
del kwargs['action']
module_path = kwargs['module_path']
del kwargs['module_path']
if action == 'run_instances':
kwargs['user_data']... | from lib import action
class ActionManager(action.BaseAction):
def run(self, **kwargs):
action = kwargs['action']
del kwargs['action']
module_path = kwargs['module_path']
del kwargs['module_path']
if action == 'run_instances':
kwargs['user_data'] = self.st2_use... | from lib import action
class ActionManager(action.BaseAction):
def run(self, **kwargs):
action = kwargs['action']
del kwargs['action']
module_path = kwargs['module_path']
del kwargs['module_path']
if action == 'run_instances':
kwargs['user_data'] = self.st2_use... | <commit_before>from lib import action
class ActionManager(action.BaseAction):
def run(self, **kwargs):
action = kwargs['action']
del kwargs['action']
module_path = kwargs['module_path']
del kwargs['module_path']
if action == 'run_instances':
kwargs['user_data']... |
ee3634fbee7e0bd311337007743b30934aca73ba | pyfibot/modules/module_thetvdb.py | pyfibot/modules/module_thetvdb.py | #!/usr/bin/python
from datetime import datetime, timedelta
import tvdb_api
import tvdb_exceptions
def command_ep(bot, user, channel, args):
t = tvdb_api.Tvdb()
now = datetime.now()
try:
series = t[args]
except tvdb_exceptions.tvdb_shownotfound:
bot.say(channel, "Series '%s' not found"... | #!/usr/bin/python
from datetime import datetime, timedelta
import tvdb_api
import tvdb_exceptions
def command_ep(bot, user, channel, args):
t = tvdb_api.Tvdb()
now = datetime.now()
try:
series = t[args]
except tvdb_exceptions.tvdb_shownotfound:
bot.say(channel, "Series '%s' not found"... | Fix episode finding logic to handle specials and cases where episodes are out of order in tvdb api result | Fix episode finding logic to handle specials and cases where episodes are out of order in tvdb api result
git-svn-id: 056f9092885898c4775d98c479d2d33d00273e45@374 dda364a1-ef19-0410-af65-756c83048fb2
| Python | bsd-3-clause | rnyberg/pyfibot,rnyberg/pyfibot,aapa/pyfibot,huqa/pyfibot,lepinkainen/pyfibot,lepinkainen/pyfibot,EArmour/pyfibot,aapa/pyfibot,EArmour/pyfibot,huqa/pyfibot | #!/usr/bin/python
from datetime import datetime, timedelta
import tvdb_api
import tvdb_exceptions
def command_ep(bot, user, channel, args):
t = tvdb_api.Tvdb()
now = datetime.now()
try:
series = t[args]
except tvdb_exceptions.tvdb_shownotfound:
bot.say(channel, "Series '%s' not found"... | #!/usr/bin/python
from datetime import datetime, timedelta
import tvdb_api
import tvdb_exceptions
def command_ep(bot, user, channel, args):
t = tvdb_api.Tvdb()
now = datetime.now()
try:
series = t[args]
except tvdb_exceptions.tvdb_shownotfound:
bot.say(channel, "Series '%s' not found"... | <commit_before>#!/usr/bin/python
from datetime import datetime, timedelta
import tvdb_api
import tvdb_exceptions
def command_ep(bot, user, channel, args):
t = tvdb_api.Tvdb()
now = datetime.now()
try:
series = t[args]
except tvdb_exceptions.tvdb_shownotfound:
bot.say(channel, "Series ... | #!/usr/bin/python
from datetime import datetime, timedelta
import tvdb_api
import tvdb_exceptions
def command_ep(bot, user, channel, args):
t = tvdb_api.Tvdb()
now = datetime.now()
try:
series = t[args]
except tvdb_exceptions.tvdb_shownotfound:
bot.say(channel, "Series '%s' not found"... | #!/usr/bin/python
from datetime import datetime, timedelta
import tvdb_api
import tvdb_exceptions
def command_ep(bot, user, channel, args):
t = tvdb_api.Tvdb()
now = datetime.now()
try:
series = t[args]
except tvdb_exceptions.tvdb_shownotfound:
bot.say(channel, "Series '%s' not found"... | <commit_before>#!/usr/bin/python
from datetime import datetime, timedelta
import tvdb_api
import tvdb_exceptions
def command_ep(bot, user, channel, args):
t = tvdb_api.Tvdb()
now = datetime.now()
try:
series = t[args]
except tvdb_exceptions.tvdb_shownotfound:
bot.say(channel, "Series ... |
5b194d658e85dee0415a087704acfc9bdb23dd00 | server/__init__.py | server/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... | Allow girder to show load errors in more cases. | Allow girder to show load errors in more cases.
If girder is installed but requirements of large_image are not, the
plugin would report as enabled but not be functional. This checks if
girder is available, and, if so, allows girder to report errors.
Eventually, it will be nice to separate large_image without girder ... | Python | apache-2.0 | girder/large_image,girder/large_image,DigitalSlideArchive/large_image,DigitalSlideArchive/large_image,girder/large_image,DigitalSlideArchive/large_image | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ob... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ob... |
4aa6714284cb45a2747cea8e0f38e8fbcd8ec0bc | pymatgen/core/design_patterns.py | pymatgen/core/design_patterns.py | # coding: utf-8
from __future__ import division, unicode_literals
"""
This module defines some useful design patterns.
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "1.0"
__maintainer__ = "Shyue Ping Ong"
__email__ = "[email protected]"
__status__ = "Producti... | # coding: utf-8
from __future__ import division, unicode_literals
"""
This module defines some useful design patterns.
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "1.0"
__maintainer__ = "Shyue Ping Ong"
__email__ = "[email protected]"
__status__ = "Producti... | Move NullFile and NullStream to monty | Move NullFile and NullStream to monty
| Python | mit | Bismarrck/pymatgen,Bismarrck/pymatgen,sonium0/pymatgen,rousseab/pymatgen,Dioptas/pymatgen,migueldiascosta/pymatgen,yanikou19/pymatgen,ctoher/pymatgen,migueldiascosta/pymatgen,yanikou19/pymatgen,rousseab/pymatgen,sonium0/pymatgen,ctoher/pymatgen,ctoher/pymatgen,rousseab/pymatgen,sonium0/pymatgen,Bismarrck/pymatgen,migue... | # coding: utf-8
from __future__ import division, unicode_literals
"""
This module defines some useful design patterns.
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "1.0"
__maintainer__ = "Shyue Ping Ong"
__email__ = "[email protected]"
__status__ = "Producti... | # coding: utf-8
from __future__ import division, unicode_literals
"""
This module defines some useful design patterns.
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "1.0"
__maintainer__ = "Shyue Ping Ong"
__email__ = "[email protected]"
__status__ = "Producti... | <commit_before># coding: utf-8
from __future__ import division, unicode_literals
"""
This module defines some useful design patterns.
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "1.0"
__maintainer__ = "Shyue Ping Ong"
__email__ = "[email protected]"
__statu... | # coding: utf-8
from __future__ import division, unicode_literals
"""
This module defines some useful design patterns.
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "1.0"
__maintainer__ = "Shyue Ping Ong"
__email__ = "[email protected]"
__status__ = "Producti... | # coding: utf-8
from __future__ import division, unicode_literals
"""
This module defines some useful design patterns.
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "1.0"
__maintainer__ = "Shyue Ping Ong"
__email__ = "[email protected]"
__status__ = "Producti... | <commit_before># coding: utf-8
from __future__ import division, unicode_literals
"""
This module defines some useful design patterns.
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "1.0"
__maintainer__ = "Shyue Ping Ong"
__email__ = "[email protected]"
__statu... |
b2fd89928f2462c4c8de8a6028c65996d69bfd31 | motion_test.py | motion_test.py | from gpiozero import MotionSensor
##Quick script to check communication between motion sensor and Pi on GPIO 4.
pir = MotionSensor(4)
i = 0
while(i < 5):
if pir.motion_detected:
print i , 'motion detected'
i+=1; | from gpiozero import MotionSensor
##Send an email upon motion detecion
pir = MotionSensor(4)
i = 0
while(i < 1):
if pir.motion_detected:
print i , 'motion detected'
execfile("send_email.py")
i+=1; | Send email when motion is detected | Send email when motion is detected
| Python | mit | efagerberg/PiCam | from gpiozero import MotionSensor
##Quick script to check communication between motion sensor and Pi on GPIO 4.
pir = MotionSensor(4)
i = 0
while(i < 5):
if pir.motion_detected:
print i , 'motion detected'
i+=1;Send email when motion is detected | from gpiozero import MotionSensor
##Send an email upon motion detecion
pir = MotionSensor(4)
i = 0
while(i < 1):
if pir.motion_detected:
print i , 'motion detected'
execfile("send_email.py")
i+=1; | <commit_before>from gpiozero import MotionSensor
##Quick script to check communication between motion sensor and Pi on GPIO 4.
pir = MotionSensor(4)
i = 0
while(i < 5):
if pir.motion_detected:
print i , 'motion detected'
i+=1;<commit_msg>Send email when motion is detected<commit_after> | from gpiozero import MotionSensor
##Send an email upon motion detecion
pir = MotionSensor(4)
i = 0
while(i < 1):
if pir.motion_detected:
print i , 'motion detected'
execfile("send_email.py")
i+=1; | from gpiozero import MotionSensor
##Quick script to check communication between motion sensor and Pi on GPIO 4.
pir = MotionSensor(4)
i = 0
while(i < 5):
if pir.motion_detected:
print i , 'motion detected'
i+=1;Send email when motion is detectedfrom gpiozero import MotionSensor
##Send an email up... | <commit_before>from gpiozero import MotionSensor
##Quick script to check communication between motion sensor and Pi on GPIO 4.
pir = MotionSensor(4)
i = 0
while(i < 5):
if pir.motion_detected:
print i , 'motion detected'
i+=1;<commit_msg>Send email when motion is detected<commit_after>from gpiozer... |
4c96f2dc52810c10ef6d73732be0ecd8745c4567 | moviePlayer.py | moviePlayer.py | import tkinter as tk
from time import sleep
from movie01 import reel
window = tk.Tk()
def main():
window.title("Tkinter Movie Player")
button = tk.Button(window, text = "Play", command = processPlay)
button.pack()
window.mainloop()
def processPlay():
TIME_STEP = 0.3
label =... | import tkinter as tk
from time import sleep
from movie01 import reel
window = tk.Tk()
def main():
window.title("Tkinter Movie Player")
button = tk.Button(window, text = "Play", command = processPlay)
button.pack()
window.mainloop()
def processPlay():
TIME_STEP = 0.3
label =... | Change font of ASCII to Courier | Change font of ASCII to Courier
| Python | apache-2.0 | awhittle3/ASCII-Movie | import tkinter as tk
from time import sleep
from movie01 import reel
window = tk.Tk()
def main():
window.title("Tkinter Movie Player")
button = tk.Button(window, text = "Play", command = processPlay)
button.pack()
window.mainloop()
def processPlay():
TIME_STEP = 0.3
label =... | import tkinter as tk
from time import sleep
from movie01 import reel
window = tk.Tk()
def main():
window.title("Tkinter Movie Player")
button = tk.Button(window, text = "Play", command = processPlay)
button.pack()
window.mainloop()
def processPlay():
TIME_STEP = 0.3
label =... | <commit_before>import tkinter as tk
from time import sleep
from movie01 import reel
window = tk.Tk()
def main():
window.title("Tkinter Movie Player")
button = tk.Button(window, text = "Play", command = processPlay)
button.pack()
window.mainloop()
def processPlay():
TIME_STEP = 0.3
... | import tkinter as tk
from time import sleep
from movie01 import reel
window = tk.Tk()
def main():
window.title("Tkinter Movie Player")
button = tk.Button(window, text = "Play", command = processPlay)
button.pack()
window.mainloop()
def processPlay():
TIME_STEP = 0.3
label =... | import tkinter as tk
from time import sleep
from movie01 import reel
window = tk.Tk()
def main():
window.title("Tkinter Movie Player")
button = tk.Button(window, text = "Play", command = processPlay)
button.pack()
window.mainloop()
def processPlay():
TIME_STEP = 0.3
label =... | <commit_before>import tkinter as tk
from time import sleep
from movie01 import reel
window = tk.Tk()
def main():
window.title("Tkinter Movie Player")
button = tk.Button(window, text = "Play", command = processPlay)
button.pack()
window.mainloop()
def processPlay():
TIME_STEP = 0.3
... |
2bd5887a62d0f6bfd6f9290604effad322e8ab1e | myElsClient.py | myElsClient.py | import requests
class myElsClient:
"""A class that implements a Python interface to api.elsevier.com"""
# local variables
__base_url = "https://api.elsevier.com/"
# constructors
def __init__(self, apiKey):
"""Instantiates a client with a given API Key."""
self.apiKey = apiKey
... | import requests
class myElsClient:
"""A class that implements a Python interface to api.elsevier.com"""
# local variables
__base_url = "https://api.elsevier.com/"
# constructors
def __init__(self, apiKey):
"""Instantiates a client with a given API Key."""
self.apiKey = apiKey
... | Add basic HTTP error handling. | Add basic HTTP error handling.
| Python | bsd-3-clause | ElsevierDev/elsapy | import requests
class myElsClient:
"""A class that implements a Python interface to api.elsevier.com"""
# local variables
__base_url = "https://api.elsevier.com/"
# constructors
def __init__(self, apiKey):
"""Instantiates a client with a given API Key."""
self.apiKey = apiKey
... | import requests
class myElsClient:
"""A class that implements a Python interface to api.elsevier.com"""
# local variables
__base_url = "https://api.elsevier.com/"
# constructors
def __init__(self, apiKey):
"""Instantiates a client with a given API Key."""
self.apiKey = apiKey
... | <commit_before>import requests
class myElsClient:
"""A class that implements a Python interface to api.elsevier.com"""
# local variables
__base_url = "https://api.elsevier.com/"
# constructors
def __init__(self, apiKey):
"""Instantiates a client with a given API Key."""
self.apiK... | import requests
class myElsClient:
"""A class that implements a Python interface to api.elsevier.com"""
# local variables
__base_url = "https://api.elsevier.com/"
# constructors
def __init__(self, apiKey):
"""Instantiates a client with a given API Key."""
self.apiKey = apiKey
... | import requests
class myElsClient:
"""A class that implements a Python interface to api.elsevier.com"""
# local variables
__base_url = "https://api.elsevier.com/"
# constructors
def __init__(self, apiKey):
"""Instantiates a client with a given API Key."""
self.apiKey = apiKey
... | <commit_before>import requests
class myElsClient:
"""A class that implements a Python interface to api.elsevier.com"""
# local variables
__base_url = "https://api.elsevier.com/"
# constructors
def __init__(self, apiKey):
"""Instantiates a client with a given API Key."""
self.apiK... |
e7eb0697f9362cc5ec5b8a21b064873eda6ed329 | apps/basaltApp/scripts/photoDataExport.py | apps/basaltApp/scripts/photoDataExport.py | #! /usr/bin/env python
import django
from datetime import datetime
import pytz
django.setup()
from basaltApp.models import BasaltImageSet, BasaltSingleImage
from geocamTrack.utils import getClosestPosition
hawaiiStandardTime = pytz.timezone('US/Hawaii')
startTime = datetime(2016, 11, 8, 0, 0, 0, tzinfo=hawaiiStandard... | #! /usr/bin/env python
import django
from datetime import datetime
import pytz
django.setup()
from basaltApp.models import BasaltImageSet, BasaltSingleImage, BasaltResource
from geocamTrack.utils import getClosestPosition
hawaiiStandardTime = pytz.timezone('US/Hawaii')
startTime = datetime(2016, 11, 8, 0, 0, 0, tzinf... | Add postion lookup stuff to script. Use acquistion_time for timestamp | Add postion lookup stuff to script. Use acquistion_time for timestamp
| Python | apache-2.0 | xgds/xgds_basalt,xgds/xgds_basalt,xgds/xgds_basalt,xgds/xgds_basalt | #! /usr/bin/env python
import django
from datetime import datetime
import pytz
django.setup()
from basaltApp.models import BasaltImageSet, BasaltSingleImage
from geocamTrack.utils import getClosestPosition
hawaiiStandardTime = pytz.timezone('US/Hawaii')
startTime = datetime(2016, 11, 8, 0, 0, 0, tzinfo=hawaiiStandard... | #! /usr/bin/env python
import django
from datetime import datetime
import pytz
django.setup()
from basaltApp.models import BasaltImageSet, BasaltSingleImage, BasaltResource
from geocamTrack.utils import getClosestPosition
hawaiiStandardTime = pytz.timezone('US/Hawaii')
startTime = datetime(2016, 11, 8, 0, 0, 0, tzinf... | <commit_before>#! /usr/bin/env python
import django
from datetime import datetime
import pytz
django.setup()
from basaltApp.models import BasaltImageSet, BasaltSingleImage
from geocamTrack.utils import getClosestPosition
hawaiiStandardTime = pytz.timezone('US/Hawaii')
startTime = datetime(2016, 11, 8, 0, 0, 0, tzinfo... | #! /usr/bin/env python
import django
from datetime import datetime
import pytz
django.setup()
from basaltApp.models import BasaltImageSet, BasaltSingleImage, BasaltResource
from geocamTrack.utils import getClosestPosition
hawaiiStandardTime = pytz.timezone('US/Hawaii')
startTime = datetime(2016, 11, 8, 0, 0, 0, tzinf... | #! /usr/bin/env python
import django
from datetime import datetime
import pytz
django.setup()
from basaltApp.models import BasaltImageSet, BasaltSingleImage
from geocamTrack.utils import getClosestPosition
hawaiiStandardTime = pytz.timezone('US/Hawaii')
startTime = datetime(2016, 11, 8, 0, 0, 0, tzinfo=hawaiiStandard... | <commit_before>#! /usr/bin/env python
import django
from datetime import datetime
import pytz
django.setup()
from basaltApp.models import BasaltImageSet, BasaltSingleImage
from geocamTrack.utils import getClosestPosition
hawaiiStandardTime = pytz.timezone('US/Hawaii')
startTime = datetime(2016, 11, 8, 0, 0, 0, tzinfo... |
d12401b25c3ec8a2087601d5fb85731fba77be04 | wellsfargo/tasks.py | wellsfargo/tasks.py | from __future__ import absolute_import
from celery import shared_task
from django.core.exceptions import ValidationError
from wellsfargo.connector import actions
from wellsfargo.models import AccountMetadata
import logging
logger = logging.getLogger(__name__)
@shared_task(bind=True, ignore_result=True)
def reconcile... | from __future__ import absolute_import
from celery import shared_task
from django.core.exceptions import ValidationError
from wellsfargo.connector import actions
from wellsfargo.models import AccountMetadata
import logging
logger = logging.getLogger(__name__)
@shared_task(bind=True, ignore_result=True)
def reconcile... | Downgrade 'Failed to reconcile' from error to warning | Downgrade 'Failed to reconcile' from error to warning
| Python | isc | thelabnyc/django-oscar-wfrs,thelabnyc/django-oscar-wfrs | from __future__ import absolute_import
from celery import shared_task
from django.core.exceptions import ValidationError
from wellsfargo.connector import actions
from wellsfargo.models import AccountMetadata
import logging
logger = logging.getLogger(__name__)
@shared_task(bind=True, ignore_result=True)
def reconcile... | from __future__ import absolute_import
from celery import shared_task
from django.core.exceptions import ValidationError
from wellsfargo.connector import actions
from wellsfargo.models import AccountMetadata
import logging
logger = logging.getLogger(__name__)
@shared_task(bind=True, ignore_result=True)
def reconcile... | <commit_before>from __future__ import absolute_import
from celery import shared_task
from django.core.exceptions import ValidationError
from wellsfargo.connector import actions
from wellsfargo.models import AccountMetadata
import logging
logger = logging.getLogger(__name__)
@shared_task(bind=True, ignore_result=True... | from __future__ import absolute_import
from celery import shared_task
from django.core.exceptions import ValidationError
from wellsfargo.connector import actions
from wellsfargo.models import AccountMetadata
import logging
logger = logging.getLogger(__name__)
@shared_task(bind=True, ignore_result=True)
def reconcile... | from __future__ import absolute_import
from celery import shared_task
from django.core.exceptions import ValidationError
from wellsfargo.connector import actions
from wellsfargo.models import AccountMetadata
import logging
logger = logging.getLogger(__name__)
@shared_task(bind=True, ignore_result=True)
def reconcile... | <commit_before>from __future__ import absolute_import
from celery import shared_task
from django.core.exceptions import ValidationError
from wellsfargo.connector import actions
from wellsfargo.models import AccountMetadata
import logging
logger = logging.getLogger(__name__)
@shared_task(bind=True, ignore_result=True... |
d3a9657b7318327a59c3eee08a25f1e5c4ba4edf | django_casscache.py | django_casscache.py | """
django_casscache
~~~~~~~~~~~~~~~~
:copyright: (c) 2013 by Matt Robenolt.
:license: BSD, see LICENSE for more details.
"""
from django.core.cache.backends.memcached import BaseMemcachedCache
class CasscacheCache(BaseMemcachedCache):
"An implementation of a cache binding using casscache"
def __init__(self... | """
django_casscache
~~~~~~~~~~~~~~~~
:copyright: (c) 2013 by Matt Robenolt.
:license: BSD, see LICENSE for more details.
"""
from django.core.cache.backends.memcached import BaseMemcachedCache
class CasscacheCache(BaseMemcachedCache):
"An implementation of a cache binding using casscache"
def __init__(self... | Add a method to noop the make_key in Django | Add a method to noop the make_key in Django | Python | bsd-3-clause | mattrobenolt/django-casscache | """
django_casscache
~~~~~~~~~~~~~~~~
:copyright: (c) 2013 by Matt Robenolt.
:license: BSD, see LICENSE for more details.
"""
from django.core.cache.backends.memcached import BaseMemcachedCache
class CasscacheCache(BaseMemcachedCache):
"An implementation of a cache binding using casscache"
def __init__(self... | """
django_casscache
~~~~~~~~~~~~~~~~
:copyright: (c) 2013 by Matt Robenolt.
:license: BSD, see LICENSE for more details.
"""
from django.core.cache.backends.memcached import BaseMemcachedCache
class CasscacheCache(BaseMemcachedCache):
"An implementation of a cache binding using casscache"
def __init__(self... | <commit_before>"""
django_casscache
~~~~~~~~~~~~~~~~
:copyright: (c) 2013 by Matt Robenolt.
:license: BSD, see LICENSE for more details.
"""
from django.core.cache.backends.memcached import BaseMemcachedCache
class CasscacheCache(BaseMemcachedCache):
"An implementation of a cache binding using casscache"
de... | """
django_casscache
~~~~~~~~~~~~~~~~
:copyright: (c) 2013 by Matt Robenolt.
:license: BSD, see LICENSE for more details.
"""
from django.core.cache.backends.memcached import BaseMemcachedCache
class CasscacheCache(BaseMemcachedCache):
"An implementation of a cache binding using casscache"
def __init__(self... | """
django_casscache
~~~~~~~~~~~~~~~~
:copyright: (c) 2013 by Matt Robenolt.
:license: BSD, see LICENSE for more details.
"""
from django.core.cache.backends.memcached import BaseMemcachedCache
class CasscacheCache(BaseMemcachedCache):
"An implementation of a cache binding using casscache"
def __init__(self... | <commit_before>"""
django_casscache
~~~~~~~~~~~~~~~~
:copyright: (c) 2013 by Matt Robenolt.
:license: BSD, see LICENSE for more details.
"""
from django.core.cache.backends.memcached import BaseMemcachedCache
class CasscacheCache(BaseMemcachedCache):
"An implementation of a cache binding using casscache"
de... |
8a25b5f76ffe5b32f6c1a8d691c3d78ce3fb07c8 | fluent_contents/utils/search.py | fluent_contents/utils/search.py | """
Internal utils for search.
"""
from django.utils.encoding import force_unicode
from django.utils.html import strip_tags
import six
def get_search_field_values(contentitem):
"""
Extract the search fields from the model.
"""
plugin = contentitem.plugin
values = []
for field_name in plugin.se... | """
Internal utils for search.
"""
from django.utils.encoding import force_text
from django.utils.html import strip_tags
import six
def get_search_field_values(contentitem):
"""
Extract the search fields from the model.
"""
plugin = contentitem.plugin
values = []
for field_name in plugin.searc... | Fix force_unicode for Python 3, use force_text() | Fix force_unicode for Python 3, use force_text()
| Python | apache-2.0 | django-fluent/django-fluent-contents,django-fluent/django-fluent-contents,edoburu/django-fluent-contents,edoburu/django-fluent-contents,django-fluent/django-fluent-contents,edoburu/django-fluent-contents | """
Internal utils for search.
"""
from django.utils.encoding import force_unicode
from django.utils.html import strip_tags
import six
def get_search_field_values(contentitem):
"""
Extract the search fields from the model.
"""
plugin = contentitem.plugin
values = []
for field_name in plugin.se... | """
Internal utils for search.
"""
from django.utils.encoding import force_text
from django.utils.html import strip_tags
import six
def get_search_field_values(contentitem):
"""
Extract the search fields from the model.
"""
plugin = contentitem.plugin
values = []
for field_name in plugin.searc... | <commit_before>"""
Internal utils for search.
"""
from django.utils.encoding import force_unicode
from django.utils.html import strip_tags
import six
def get_search_field_values(contentitem):
"""
Extract the search fields from the model.
"""
plugin = contentitem.plugin
values = []
for field_na... | """
Internal utils for search.
"""
from django.utils.encoding import force_text
from django.utils.html import strip_tags
import six
def get_search_field_values(contentitem):
"""
Extract the search fields from the model.
"""
plugin = contentitem.plugin
values = []
for field_name in plugin.searc... | """
Internal utils for search.
"""
from django.utils.encoding import force_unicode
from django.utils.html import strip_tags
import six
def get_search_field_values(contentitem):
"""
Extract the search fields from the model.
"""
plugin = contentitem.plugin
values = []
for field_name in plugin.se... | <commit_before>"""
Internal utils for search.
"""
from django.utils.encoding import force_unicode
from django.utils.html import strip_tags
import six
def get_search_field_values(contentitem):
"""
Extract the search fields from the model.
"""
plugin = contentitem.plugin
values = []
for field_na... |
2685b94838c8ec7ce31da60bc6f28953152c788a | pixelmap/pixelmap.py | pixelmap/pixelmap.py | """Pixelmap
Cool pixelmap of Pixels.
Last updated: March 7, 2017
"""
from pixel import Pixel
class Pixelmap:
def __init__(self, width, height):
"""Pixelmap constructor
:param width: Width of map in pixels.
:param height: Height of map in pixels.
"""
self.width = width
... | """Pixelmap
Cool pixelmap of Pixels.
Last updated: March 11, 2017
"""
from .pixel import Pixel
class Pixelmap:
def __init__(self, cols, rows, default_val=None):
"""Pixelmap constructor
:param cols: Width of map in pixels.
:param rows: Height of map in pixels.
:param default_val... | Add default value for matrix and methods to get columns and rows. | Add default value for matrix and methods to get columns and rows.
| Python | mit | yebra06/pixelmap | """Pixelmap
Cool pixelmap of Pixels.
Last updated: March 7, 2017
"""
from pixel import Pixel
class Pixelmap:
def __init__(self, width, height):
"""Pixelmap constructor
:param width: Width of map in pixels.
:param height: Height of map in pixels.
"""
self.width = width
... | """Pixelmap
Cool pixelmap of Pixels.
Last updated: March 11, 2017
"""
from .pixel import Pixel
class Pixelmap:
def __init__(self, cols, rows, default_val=None):
"""Pixelmap constructor
:param cols: Width of map in pixels.
:param rows: Height of map in pixels.
:param default_val... | <commit_before>"""Pixelmap
Cool pixelmap of Pixels.
Last updated: March 7, 2017
"""
from pixel import Pixel
class Pixelmap:
def __init__(self, width, height):
"""Pixelmap constructor
:param width: Width of map in pixels.
:param height: Height of map in pixels.
"""
self.... | """Pixelmap
Cool pixelmap of Pixels.
Last updated: March 11, 2017
"""
from .pixel import Pixel
class Pixelmap:
def __init__(self, cols, rows, default_val=None):
"""Pixelmap constructor
:param cols: Width of map in pixels.
:param rows: Height of map in pixels.
:param default_val... | """Pixelmap
Cool pixelmap of Pixels.
Last updated: March 7, 2017
"""
from pixel import Pixel
class Pixelmap:
def __init__(self, width, height):
"""Pixelmap constructor
:param width: Width of map in pixels.
:param height: Height of map in pixels.
"""
self.width = width
... | <commit_before>"""Pixelmap
Cool pixelmap of Pixels.
Last updated: March 7, 2017
"""
from pixel import Pixel
class Pixelmap:
def __init__(self, width, height):
"""Pixelmap constructor
:param width: Width of map in pixels.
:param height: Height of map in pixels.
"""
self.... |
96733510eeee4b06c3b509097e7c26fd143d687f | plugins/clue/clue.py | plugins/clue/clue.py | from __future__ import unicode_literals
import re
crontable = []
outputs = []
state = {}
class ClueState:
def __init__(self):
self.count = 0
self.clue = ''
def process_message(data):
channel = data['channel']
if channel not in state.keys():
state[channel] = ClueState()
st... | from __future__ import unicode_literals
import re
crontable = []
outputs = []
state = {}
class ClueState:
def __init__(self):
self.count = 0
self.clue = ''
def process_message(data):
channel = data['channel']
if channel not in state.keys():
state[channel] = ClueState()
st... | Fix to only match '>' at the beginning of a line | Fix to only match '>' at the beginning of a line
Which was the intention with the '\n' in the pattern before, but I had
made it optional for the common case of the '>' being at the beginning
of the message, which of course had the side effect of allowing the
'>' to be matched anywhere (bleh).
Now, with a MULTLINE-mod... | Python | mit | cworth-gh/stony | from __future__ import unicode_literals
import re
crontable = []
outputs = []
state = {}
class ClueState:
def __init__(self):
self.count = 0
self.clue = ''
def process_message(data):
channel = data['channel']
if channel not in state.keys():
state[channel] = ClueState()
st... | from __future__ import unicode_literals
import re
crontable = []
outputs = []
state = {}
class ClueState:
def __init__(self):
self.count = 0
self.clue = ''
def process_message(data):
channel = data['channel']
if channel not in state.keys():
state[channel] = ClueState()
st... | <commit_before>from __future__ import unicode_literals
import re
crontable = []
outputs = []
state = {}
class ClueState:
def __init__(self):
self.count = 0
self.clue = ''
def process_message(data):
channel = data['channel']
if channel not in state.keys():
state[channel] = Clue... | from __future__ import unicode_literals
import re
crontable = []
outputs = []
state = {}
class ClueState:
def __init__(self):
self.count = 0
self.clue = ''
def process_message(data):
channel = data['channel']
if channel not in state.keys():
state[channel] = ClueState()
st... | from __future__ import unicode_literals
import re
crontable = []
outputs = []
state = {}
class ClueState:
def __init__(self):
self.count = 0
self.clue = ''
def process_message(data):
channel = data['channel']
if channel not in state.keys():
state[channel] = ClueState()
st... | <commit_before>from __future__ import unicode_literals
import re
crontable = []
outputs = []
state = {}
class ClueState:
def __init__(self):
self.count = 0
self.clue = ''
def process_message(data):
channel = data['channel']
if channel not in state.keys():
state[channel] = Clue... |
4a32bd6bdc91564276a4e46210fc9019dd1b8a89 | statement_format.py | statement_format.py | import pandas as pd
def fn(row):
if row['Type'] == 'DIRECT DEBIT':
return 'DD'
if row['Type'] == 'DIRECT CREDIT' or row['Spending Category'] == 'INCOME':
return 'BP'
if row['Amount (GBP)'] < 0:
return 'SO'
raise Exception('Unintended state')
df = pd.read_csv('statement.csv')
... | import json
import pandas as pd
def fn(row):
if row['Type'] == 'DIRECT DEBIT':
return 'DD'
if row['Type'] == 'DIRECT CREDIT' or row['Spending Category'] == 'INCOME':
return 'BP'
if row['Amount (GBP)'] < 0:
return 'SO'
raise Exception('Unintended state')
df = pd.read_csv('stat... | Correct operation. Now to fix panda warnings | Correct operation. Now to fix panda warnings
| Python | mit | noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit | import pandas as pd
def fn(row):
if row['Type'] == 'DIRECT DEBIT':
return 'DD'
if row['Type'] == 'DIRECT CREDIT' or row['Spending Category'] == 'INCOME':
return 'BP'
if row['Amount (GBP)'] < 0:
return 'SO'
raise Exception('Unintended state')
df = pd.read_csv('statement.csv')
... | import json
import pandas as pd
def fn(row):
if row['Type'] == 'DIRECT DEBIT':
return 'DD'
if row['Type'] == 'DIRECT CREDIT' or row['Spending Category'] == 'INCOME':
return 'BP'
if row['Amount (GBP)'] < 0:
return 'SO'
raise Exception('Unintended state')
df = pd.read_csv('stat... | <commit_before>import pandas as pd
def fn(row):
if row['Type'] == 'DIRECT DEBIT':
return 'DD'
if row['Type'] == 'DIRECT CREDIT' or row['Spending Category'] == 'INCOME':
return 'BP'
if row['Amount (GBP)'] < 0:
return 'SO'
raise Exception('Unintended state')
df = pd.read_csv('s... | import json
import pandas as pd
def fn(row):
if row['Type'] == 'DIRECT DEBIT':
return 'DD'
if row['Type'] == 'DIRECT CREDIT' or row['Spending Category'] == 'INCOME':
return 'BP'
if row['Amount (GBP)'] < 0:
return 'SO'
raise Exception('Unintended state')
df = pd.read_csv('stat... | import pandas as pd
def fn(row):
if row['Type'] == 'DIRECT DEBIT':
return 'DD'
if row['Type'] == 'DIRECT CREDIT' or row['Spending Category'] == 'INCOME':
return 'BP'
if row['Amount (GBP)'] < 0:
return 'SO'
raise Exception('Unintended state')
df = pd.read_csv('statement.csv')
... | <commit_before>import pandas as pd
def fn(row):
if row['Type'] == 'DIRECT DEBIT':
return 'DD'
if row['Type'] == 'DIRECT CREDIT' or row['Spending Category'] == 'INCOME':
return 'BP'
if row['Amount (GBP)'] < 0:
return 'SO'
raise Exception('Unintended state')
df = pd.read_csv('s... |
896f7b82eb1c84538a94e65d8ff55282e36c6818 | squadron/exthandlers/__init__.py | squadron/exthandlers/__init__.py | from .dir import ext_dir
from .makegit import ext_git
from .download import ext_download
from .template import ext_template
extension_handles = {
'dir':ext_dir,
'git':ext_git,
'download':ext_download,
'virtualenv',ext_virtualenv,
'tpl':ext_template
}
| from .dir import ext_dir
from .makegit import ext_git
from .download import ext_download
from .template import ext_template
from .virtualenv import ext_virtualenv
extension_handles = {
'dir':ext_dir,
'git':ext_git,
'download':ext_download,
'virtualenv':ext_virtualenv,
'tpl':ext_template
}
| Fix broken tests because of virtualenv handler | Fix broken tests because of virtualenv handler
| Python | mit | gosquadron/squadron,gosquadron/squadron | from .dir import ext_dir
from .makegit import ext_git
from .download import ext_download
from .template import ext_template
extension_handles = {
'dir':ext_dir,
'git':ext_git,
'download':ext_download,
'virtualenv',ext_virtualenv,
'tpl':ext_template
}
Fix broken tests because of virtualenv handler | from .dir import ext_dir
from .makegit import ext_git
from .download import ext_download
from .template import ext_template
from .virtualenv import ext_virtualenv
extension_handles = {
'dir':ext_dir,
'git':ext_git,
'download':ext_download,
'virtualenv':ext_virtualenv,
'tpl':ext_template
}
| <commit_before>from .dir import ext_dir
from .makegit import ext_git
from .download import ext_download
from .template import ext_template
extension_handles = {
'dir':ext_dir,
'git':ext_git,
'download':ext_download,
'virtualenv',ext_virtualenv,
'tpl':ext_template
}
<commit_msg>Fix broken tests beca... | from .dir import ext_dir
from .makegit import ext_git
from .download import ext_download
from .template import ext_template
from .virtualenv import ext_virtualenv
extension_handles = {
'dir':ext_dir,
'git':ext_git,
'download':ext_download,
'virtualenv':ext_virtualenv,
'tpl':ext_template
}
| from .dir import ext_dir
from .makegit import ext_git
from .download import ext_download
from .template import ext_template
extension_handles = {
'dir':ext_dir,
'git':ext_git,
'download':ext_download,
'virtualenv',ext_virtualenv,
'tpl':ext_template
}
Fix broken tests because of virtualenv handlerfr... | <commit_before>from .dir import ext_dir
from .makegit import ext_git
from .download import ext_download
from .template import ext_template
extension_handles = {
'dir':ext_dir,
'git':ext_git,
'download':ext_download,
'virtualenv',ext_virtualenv,
'tpl':ext_template
}
<commit_msg>Fix broken tests beca... |
9afa8829f0ded4c19f0467f1a5e2c8539f33ac31 | profile_bs_xf03id/startup/52-suspenders.py | profile_bs_xf03id/startup/52-suspenders.py | from bluesky.suspenders import (SuspendFloor, SuspendBoolHigh, SuspendBoolLow)
from bluesky.global_state import get_gs
gs = get_gs()
RE = gs.RE
# Here are some conditions that will cause scans to pause automatically:
# - when the beam current goes below a certain threshold
susp_current = SuspendFloor(beamline_status... | from bluesky.suspenders import (SuspendFloor, SuspendBoolHigh, SuspendBoolLow)
from bluesky.global_state import get_gs
gs = get_gs()
RE = gs.RE
# Here are some conditions that will cause scans to pause automatically:
# - when the beam current goes below a certain threshold
susp_current = SuspendFloor(beamline_status... | Add a tripped message to the suspenders, but disable for now | Add a tripped message to the suspenders, but disable for now
| Python | bsd-2-clause | NSLS-II-HXN/ipython_ophyd,NSLS-II-HXN/ipython_ophyd | from bluesky.suspenders import (SuspendFloor, SuspendBoolHigh, SuspendBoolLow)
from bluesky.global_state import get_gs
gs = get_gs()
RE = gs.RE
# Here are some conditions that will cause scans to pause automatically:
# - when the beam current goes below a certain threshold
susp_current = SuspendFloor(beamline_status... | from bluesky.suspenders import (SuspendFloor, SuspendBoolHigh, SuspendBoolLow)
from bluesky.global_state import get_gs
gs = get_gs()
RE = gs.RE
# Here are some conditions that will cause scans to pause automatically:
# - when the beam current goes below a certain threshold
susp_current = SuspendFloor(beamline_status... | <commit_before>from bluesky.suspenders import (SuspendFloor, SuspendBoolHigh, SuspendBoolLow)
from bluesky.global_state import get_gs
gs = get_gs()
RE = gs.RE
# Here are some conditions that will cause scans to pause automatically:
# - when the beam current goes below a certain threshold
susp_current = SuspendFloor(... | from bluesky.suspenders import (SuspendFloor, SuspendBoolHigh, SuspendBoolLow)
from bluesky.global_state import get_gs
gs = get_gs()
RE = gs.RE
# Here are some conditions that will cause scans to pause automatically:
# - when the beam current goes below a certain threshold
susp_current = SuspendFloor(beamline_status... | from bluesky.suspenders import (SuspendFloor, SuspendBoolHigh, SuspendBoolLow)
from bluesky.global_state import get_gs
gs = get_gs()
RE = gs.RE
# Here are some conditions that will cause scans to pause automatically:
# - when the beam current goes below a certain threshold
susp_current = SuspendFloor(beamline_status... | <commit_before>from bluesky.suspenders import (SuspendFloor, SuspendBoolHigh, SuspendBoolLow)
from bluesky.global_state import get_gs
gs = get_gs()
RE = gs.RE
# Here are some conditions that will cause scans to pause automatically:
# - when the beam current goes below a certain threshold
susp_current = SuspendFloor(... |
0641de52396a97f109d02d2ee05967eb31a56a39 | swiftly/__init__.py | swiftly/__init__.py | """
Client for Swift
Copyright 2012 Gregory Holt
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... | """
Client for Swift
Copyright 2012 Gregory Holt
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... | Work on master is now 1.7 dev work | Work on master is now 1.7 dev work
| Python | apache-2.0 | dpgoetz/swiftly,gholt/swiftly,rackerlabs/swiftly | """
Client for Swift
Copyright 2012 Gregory Holt
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... | """
Client for Swift
Copyright 2012 Gregory Holt
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... | <commit_before>"""
Client for Swift
Copyright 2012 Gregory Holt
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... | """
Client for Swift
Copyright 2012 Gregory Holt
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... | """
Client for Swift
Copyright 2012 Gregory Holt
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... | <commit_before>"""
Client for Swift
Copyright 2012 Gregory Holt
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... |
48fd99751ddd000bb179214c69ee65ac7f70d2a2 | scripts/remove-all-annotations.py | scripts/remove-all-annotations.py | #!/usr/bin/python
# This is a small helper script to remove all annotations from a
# project.
# You may need to install psycopg2, e.g. with:
# sudo apt-get install python-psycopg2
import sys
import psycopg2
import os
from common import db_connection, conf
if len(sys.argv) != 1:
print >> sys.stderr, "Usage:", ... | #!/usr/bin/python
# This is a small helper script to remove all annotations from a
# project.
# You may need to install psycopg2, e.g. with:
# sudo apt-get install python-psycopg2
import sys
import psycopg2
import os
from common import db_connection, conf
if len(sys.argv) != 1:
print >> sys.stderr, "Usage:", ... | Make remove all annotation also remove classes and relations | Make remove all annotation also remove classes and relations
| Python | agpl-3.0 | fzadow/CATMAID,fzadow/CATMAID,htem/CATMAID,htem/CATMAID,htem/CATMAID,htem/CATMAID,fzadow/CATMAID,fzadow/CATMAID | #!/usr/bin/python
# This is a small helper script to remove all annotations from a
# project.
# You may need to install psycopg2, e.g. with:
# sudo apt-get install python-psycopg2
import sys
import psycopg2
import os
from common import db_connection, conf
if len(sys.argv) != 1:
print >> sys.stderr, "Usage:", ... | #!/usr/bin/python
# This is a small helper script to remove all annotations from a
# project.
# You may need to install psycopg2, e.g. with:
# sudo apt-get install python-psycopg2
import sys
import psycopg2
import os
from common import db_connection, conf
if len(sys.argv) != 1:
print >> sys.stderr, "Usage:", ... | <commit_before>#!/usr/bin/python
# This is a small helper script to remove all annotations from a
# project.
# You may need to install psycopg2, e.g. with:
# sudo apt-get install python-psycopg2
import sys
import psycopg2
import os
from common import db_connection, conf
if len(sys.argv) != 1:
print >> sys.std... | #!/usr/bin/python
# This is a small helper script to remove all annotations from a
# project.
# You may need to install psycopg2, e.g. with:
# sudo apt-get install python-psycopg2
import sys
import psycopg2
import os
from common import db_connection, conf
if len(sys.argv) != 1:
print >> sys.stderr, "Usage:", ... | #!/usr/bin/python
# This is a small helper script to remove all annotations from a
# project.
# You may need to install psycopg2, e.g. with:
# sudo apt-get install python-psycopg2
import sys
import psycopg2
import os
from common import db_connection, conf
if len(sys.argv) != 1:
print >> sys.stderr, "Usage:", ... | <commit_before>#!/usr/bin/python
# This is a small helper script to remove all annotations from a
# project.
# You may need to install psycopg2, e.g. with:
# sudo apt-get install python-psycopg2
import sys
import psycopg2
import os
from common import db_connection, conf
if len(sys.argv) != 1:
print >> sys.std... |
426d3fd0572d0b648ceb7d5394b555f4a7c65a1e | source/cytoplasm/configuration.py | source/cytoplasm/configuration.py | # This module contains the user's configurations, to be accessed like:
# `print cytoplasm.configuration.build_dir`
import os, imp
# If the user has a file called _config.py, import that.
# The user's _config.py should "from cytoplasm.defaults import *" if they want to use
# some of the defaults.
if os.path.exists("_co... | # This module contains the user's configurations, to be accessed like:
# `print cytoplasm.configuration.build_dir`
import os, imp
from .errors import CytoplasmError
# If the user has a file called _config.py, import that.
# The user's _config.py should "from cytoplasm.defaults import *" if they want to use
# some of t... | Raise an error if the user doesn't have a _config.py | Raise an error if the user doesn't have a _config.py
This raises a less cryptic error.
| Python | mit | startling/cytoplasm | # This module contains the user's configurations, to be accessed like:
# `print cytoplasm.configuration.build_dir`
import os, imp
# If the user has a file called _config.py, import that.
# The user's _config.py should "from cytoplasm.defaults import *" if they want to use
# some of the defaults.
if os.path.exists("_co... | # This module contains the user's configurations, to be accessed like:
# `print cytoplasm.configuration.build_dir`
import os, imp
from .errors import CytoplasmError
# If the user has a file called _config.py, import that.
# The user's _config.py should "from cytoplasm.defaults import *" if they want to use
# some of t... | <commit_before># This module contains the user's configurations, to be accessed like:
# `print cytoplasm.configuration.build_dir`
import os, imp
# If the user has a file called _config.py, import that.
# The user's _config.py should "from cytoplasm.defaults import *" if they want to use
# some of the defaults.
if os.p... | # This module contains the user's configurations, to be accessed like:
# `print cytoplasm.configuration.build_dir`
import os, imp
from .errors import CytoplasmError
# If the user has a file called _config.py, import that.
# The user's _config.py should "from cytoplasm.defaults import *" if they want to use
# some of t... | # This module contains the user's configurations, to be accessed like:
# `print cytoplasm.configuration.build_dir`
import os, imp
# If the user has a file called _config.py, import that.
# The user's _config.py should "from cytoplasm.defaults import *" if they want to use
# some of the defaults.
if os.path.exists("_co... | <commit_before># This module contains the user's configurations, to be accessed like:
# `print cytoplasm.configuration.build_dir`
import os, imp
# If the user has a file called _config.py, import that.
# The user's _config.py should "from cytoplasm.defaults import *" if they want to use
# some of the defaults.
if os.p... |
c5bc66351870ce369b0d06161f07a1943dfeed93 | plugin_handler.py | plugin_handler.py | # -*- coding: utf-8 -*-
# Execute this file to see what plugins will be loaded.
# Implementation leans to Lex Toumbourou's example:
# https://lextoumbourou.com/blog/posts/dynamically-loading-modules-and-classes-in-python/
import os
import pkgutil
import sys
def load_venue_plugins():
"""
Read plugin directo... | # -*- coding: utf-8 -*-
# Execute this file to see what plugins will be loaded.
# Implementation leans to Lex Toumbourou's example:
# https://lextoumbourou.com/blog/posts/dynamically-loading-modules-and-classes-in-python/
import os
import pkgutil
import sys
def load_venue_plugins():
"""
Read plugin directo... | Enable On the rocks plugin | Enable On the rocks plugin
| Python | isc | weezel/BandEventNotifier | # -*- coding: utf-8 -*-
# Execute this file to see what plugins will be loaded.
# Implementation leans to Lex Toumbourou's example:
# https://lextoumbourou.com/blog/posts/dynamically-loading-modules-and-classes-in-python/
import os
import pkgutil
import sys
def load_venue_plugins():
"""
Read plugin directo... | # -*- coding: utf-8 -*-
# Execute this file to see what plugins will be loaded.
# Implementation leans to Lex Toumbourou's example:
# https://lextoumbourou.com/blog/posts/dynamically-loading-modules-and-classes-in-python/
import os
import pkgutil
import sys
def load_venue_plugins():
"""
Read plugin directo... | <commit_before># -*- coding: utf-8 -*-
# Execute this file to see what plugins will be loaded.
# Implementation leans to Lex Toumbourou's example:
# https://lextoumbourou.com/blog/posts/dynamically-loading-modules-and-classes-in-python/
import os
import pkgutil
import sys
def load_venue_plugins():
"""
Read... | # -*- coding: utf-8 -*-
# Execute this file to see what plugins will be loaded.
# Implementation leans to Lex Toumbourou's example:
# https://lextoumbourou.com/blog/posts/dynamically-loading-modules-and-classes-in-python/
import os
import pkgutil
import sys
def load_venue_plugins():
"""
Read plugin directo... | # -*- coding: utf-8 -*-
# Execute this file to see what plugins will be loaded.
# Implementation leans to Lex Toumbourou's example:
# https://lextoumbourou.com/blog/posts/dynamically-loading-modules-and-classes-in-python/
import os
import pkgutil
import sys
def load_venue_plugins():
"""
Read plugin directo... | <commit_before># -*- coding: utf-8 -*-
# Execute this file to see what plugins will be loaded.
# Implementation leans to Lex Toumbourou's example:
# https://lextoumbourou.com/blog/posts/dynamically-loading-modules-and-classes-in-python/
import os
import pkgutil
import sys
def load_venue_plugins():
"""
Read... |
b9b21cbcc04ce5d24a82817002c99eb5b5d70cf5 | molly/apps/service_status/views.py | molly/apps/service_status/views.py | import logging
from django.utils.translation import ugettext as _
from molly.utils.views import BaseView
from molly.utils.breadcrumbs import *
logger = logging.getLogger("molly.apps.service_status.views")
class IndexView(BaseView):
"""
View to display service status information
"""
# TODO Remove sp... | import logging
from django.utils.translation import ugettext as _
from molly.utils.views import BaseView
from molly.utils.breadcrumbs import *
logger = logging.getLogger("molly.apps.service_status.views")
class IndexView(BaseView):
"""
View to display service status information
"""
# TODO Remove sp... | Fix syntax error in service_status | Fix syntax error in service_status
| Python | apache-2.0 | mollyproject/mollyproject,mollyproject/mollyproject,mollyproject/mollyproject | import logging
from django.utils.translation import ugettext as _
from molly.utils.views import BaseView
from molly.utils.breadcrumbs import *
logger = logging.getLogger("molly.apps.service_status.views")
class IndexView(BaseView):
"""
View to display service status information
"""
# TODO Remove sp... | import logging
from django.utils.translation import ugettext as _
from molly.utils.views import BaseView
from molly.utils.breadcrumbs import *
logger = logging.getLogger("molly.apps.service_status.views")
class IndexView(BaseView):
"""
View to display service status information
"""
# TODO Remove sp... | <commit_before>import logging
from django.utils.translation import ugettext as _
from molly.utils.views import BaseView
from molly.utils.breadcrumbs import *
logger = logging.getLogger("molly.apps.service_status.views")
class IndexView(BaseView):
"""
View to display service status information
"""
#... | import logging
from django.utils.translation import ugettext as _
from molly.utils.views import BaseView
from molly.utils.breadcrumbs import *
logger = logging.getLogger("molly.apps.service_status.views")
class IndexView(BaseView):
"""
View to display service status information
"""
# TODO Remove sp... | import logging
from django.utils.translation import ugettext as _
from molly.utils.views import BaseView
from molly.utils.breadcrumbs import *
logger = logging.getLogger("molly.apps.service_status.views")
class IndexView(BaseView):
"""
View to display service status information
"""
# TODO Remove sp... | <commit_before>import logging
from django.utils.translation import ugettext as _
from molly.utils.views import BaseView
from molly.utils.breadcrumbs import *
logger = logging.getLogger("molly.apps.service_status.views")
class IndexView(BaseView):
"""
View to display service status information
"""
#... |
90e8f58c24608c503697e9d491ff77b5b46972ba | pi_director/controllers/controllers.py | pi_director/controllers/controllers.py | from pi_director.models.models import (
DBSession,
MyModel,
)
def get_pis():
PiList=DBSession.query(MyModel).filter(MyModel.uuid!="default").all()
return PiList
| from pi_director.models.models import (
DBSession,
MyModel,
)
def get_pis():
PiList=DBSession.query(MyModel).filter(MyModel.uuid!="default").order_by(MyModel.lastseen).all()
return PiList
| Order Pis in list by lastseen, showing non-communicating pis at the top | Order Pis in list by lastseen, showing non-communicating pis at the top
| Python | mit | PeterGrace/pi_director,PeterGrace/pi_director,PeterGrace/pi_director,selfcommit/pi_director,selfcommit/pi_director,selfcommit/pi_director | from pi_director.models.models import (
DBSession,
MyModel,
)
def get_pis():
PiList=DBSession.query(MyModel).filter(MyModel.uuid!="default").all()
return PiList
Order Pis in list by lastseen, showing non-communicating pis at the top | from pi_director.models.models import (
DBSession,
MyModel,
)
def get_pis():
PiList=DBSession.query(MyModel).filter(MyModel.uuid!="default").order_by(MyModel.lastseen).all()
return PiList
| <commit_before>from pi_director.models.models import (
DBSession,
MyModel,
)
def get_pis():
PiList=DBSession.query(MyModel).filter(MyModel.uuid!="default").all()
return PiList
<commit_msg>Order Pis in list by lastseen, showing non-communicating pis at the top<commit_after> | from pi_director.models.models import (
DBSession,
MyModel,
)
def get_pis():
PiList=DBSession.query(MyModel).filter(MyModel.uuid!="default").order_by(MyModel.lastseen).all()
return PiList
| from pi_director.models.models import (
DBSession,
MyModel,
)
def get_pis():
PiList=DBSession.query(MyModel).filter(MyModel.uuid!="default").all()
return PiList
Order Pis in list by lastseen, showing non-communicating pis at the topfrom pi_director.models.models import (
DBSession,
MyModel... | <commit_before>from pi_director.models.models import (
DBSession,
MyModel,
)
def get_pis():
PiList=DBSession.query(MyModel).filter(MyModel.uuid!="default").all()
return PiList
<commit_msg>Order Pis in list by lastseen, showing non-communicating pis at the top<commit_after>from pi_director.models.m... |
1046157fa2e062f12123e110c82851c2484216be | gallery_plugins/plugin_gfycat.py | gallery_plugins/plugin_gfycat.py | import re
try:
import urllib.request as urllib
except:
import urllib # Python 2
def title(source):
gfyId = re.findall(r'href=\".*gfycat.com/(\w+).*\">', source)[-1]
link = 'https://gfycat.com/cajax/get/' + gfyId
respond = urllib.urlopen(link).read()
username = re.findall(r'\"userName\":\"(.+?)\... | import re
try:
import urllib.request as urllib
except:
import urllib # Python 2
def title(source):
gfyId = re.findall(r'href=\".*gfycat.com/(\w+).*\">', source)[-1]
link = 'https://gfycat.com/cajax/get/' + gfyId
respond = urllib.urlopen(link).read().decode("utf8")
username = re.findall(r'\"user... | Update gfycat plugin for python3 support | Update gfycat plugin for python3 support
| Python | mit | regosen/gallery_get | import re
try:
import urllib.request as urllib
except:
import urllib # Python 2
def title(source):
gfyId = re.findall(r'href=\".*gfycat.com/(\w+).*\">', source)[-1]
link = 'https://gfycat.com/cajax/get/' + gfyId
respond = urllib.urlopen(link).read()
username = re.findall(r'\"userName\":\"(.+?)\... | import re
try:
import urllib.request as urllib
except:
import urllib # Python 2
def title(source):
gfyId = re.findall(r'href=\".*gfycat.com/(\w+).*\">', source)[-1]
link = 'https://gfycat.com/cajax/get/' + gfyId
respond = urllib.urlopen(link).read().decode("utf8")
username = re.findall(r'\"user... | <commit_before>import re
try:
import urllib.request as urllib
except:
import urllib # Python 2
def title(source):
gfyId = re.findall(r'href=\".*gfycat.com/(\w+).*\">', source)[-1]
link = 'https://gfycat.com/cajax/get/' + gfyId
respond = urllib.urlopen(link).read()
username = re.findall(r'\"user... | import re
try:
import urllib.request as urllib
except:
import urllib # Python 2
def title(source):
gfyId = re.findall(r'href=\".*gfycat.com/(\w+).*\">', source)[-1]
link = 'https://gfycat.com/cajax/get/' + gfyId
respond = urllib.urlopen(link).read().decode("utf8")
username = re.findall(r'\"user... | import re
try:
import urllib.request as urllib
except:
import urllib # Python 2
def title(source):
gfyId = re.findall(r'href=\".*gfycat.com/(\w+).*\">', source)[-1]
link = 'https://gfycat.com/cajax/get/' + gfyId
respond = urllib.urlopen(link).read()
username = re.findall(r'\"userName\":\"(.+?)\... | <commit_before>import re
try:
import urllib.request as urllib
except:
import urllib # Python 2
def title(source):
gfyId = re.findall(r'href=\".*gfycat.com/(\w+).*\">', source)[-1]
link = 'https://gfycat.com/cajax/get/' + gfyId
respond = urllib.urlopen(link).read()
username = re.findall(r'\"user... |
55c60d059a4f6a6ae6633318420a7c0cd22c2513 | product/models.py | product/models.py | from django.db import models
from amadaa.models import AmadaaModel
from django.urls import reverse
from ckeditor.fields import RichTextField
# Create your models here.
class ProductCategory(AmadaaModel):
name = models.CharField(max_length=100, unique=True)
def get_absolute_url(self):
return reverse('... | from django.db import models
from amadaa.models import AmadaaModel
from django.urls import reverse
from ckeditor.fields import RichTextField
# Create your models here.
class ProductCategory(AmadaaModel):
name = models.CharField(max_length=100, unique=True)
def get_absolute_url(self):
return reverse('... | Fix in string representation of product model. | Fix in string representation of product model.
| Python | mit | borderitsolutions/amadaa,borderitsolutions/amadaa,borderitsolutions/amadaa | from django.db import models
from amadaa.models import AmadaaModel
from django.urls import reverse
from ckeditor.fields import RichTextField
# Create your models here.
class ProductCategory(AmadaaModel):
name = models.CharField(max_length=100, unique=True)
def get_absolute_url(self):
return reverse('... | from django.db import models
from amadaa.models import AmadaaModel
from django.urls import reverse
from ckeditor.fields import RichTextField
# Create your models here.
class ProductCategory(AmadaaModel):
name = models.CharField(max_length=100, unique=True)
def get_absolute_url(self):
return reverse('... | <commit_before>from django.db import models
from amadaa.models import AmadaaModel
from django.urls import reverse
from ckeditor.fields import RichTextField
# Create your models here.
class ProductCategory(AmadaaModel):
name = models.CharField(max_length=100, unique=True)
def get_absolute_url(self):
r... | from django.db import models
from amadaa.models import AmadaaModel
from django.urls import reverse
from ckeditor.fields import RichTextField
# Create your models here.
class ProductCategory(AmadaaModel):
name = models.CharField(max_length=100, unique=True)
def get_absolute_url(self):
return reverse('... | from django.db import models
from amadaa.models import AmadaaModel
from django.urls import reverse
from ckeditor.fields import RichTextField
# Create your models here.
class ProductCategory(AmadaaModel):
name = models.CharField(max_length=100, unique=True)
def get_absolute_url(self):
return reverse('... | <commit_before>from django.db import models
from amadaa.models import AmadaaModel
from django.urls import reverse
from ckeditor.fields import RichTextField
# Create your models here.
class ProductCategory(AmadaaModel):
name = models.CharField(max_length=100, unique=True)
def get_absolute_url(self):
r... |
df5040b728ec59f9f548c7bd032d9e8b7ab0c2e0 | database/queries/update_queries.py | database/queries/update_queries.py | UPDATE_MOVIE = '''
UPDATE MOVIE
SET column1=?, RATING=?
WHERE MOVIE.ID=?;
'''
UPDATE_PROJECTION = '''
UPDATE PROJECTION
SET MOVIE_ID=?, TYPE=?, DATE=?
WHERE PROJECTION.ID=?;
'''
| UPDATE_MOVIE = '''
UPDATE MOVIE
SET column1=?, RATING=?
WHERE MOVIE.ID=?;
'''
UPDATE_PROJECTION = '''
UPDATE PROJECTION
SET MOVIE_ID=?, TYPE=?, DATE=?
WHERE PROJECTION.ID=?;
'''
DELETE_RESERVATION = '''
UPDATE RESERVATION
SET USER_ID=?, PROJECTION_ID=?, ROW=?, COL=?
WHERE RESERVATI... | Add update queries for reservation | Add update queries for reservation
| Python | mit | BrickText/JHROM | UPDATE_MOVIE = '''
UPDATE MOVIE
SET column1=?, RATING=?
WHERE MOVIE.ID=?;
'''
UPDATE_PROJECTION = '''
UPDATE PROJECTION
SET MOVIE_ID=?, TYPE=?, DATE=?
WHERE PROJECTION.ID=?;
'''
Add update queries for reservation | UPDATE_MOVIE = '''
UPDATE MOVIE
SET column1=?, RATING=?
WHERE MOVIE.ID=?;
'''
UPDATE_PROJECTION = '''
UPDATE PROJECTION
SET MOVIE_ID=?, TYPE=?, DATE=?
WHERE PROJECTION.ID=?;
'''
DELETE_RESERVATION = '''
UPDATE RESERVATION
SET USER_ID=?, PROJECTION_ID=?, ROW=?, COL=?
WHERE RESERVATI... | <commit_before>UPDATE_MOVIE = '''
UPDATE MOVIE
SET column1=?, RATING=?
WHERE MOVIE.ID=?;
'''
UPDATE_PROJECTION = '''
UPDATE PROJECTION
SET MOVIE_ID=?, TYPE=?, DATE=?
WHERE PROJECTION.ID=?;
'''
<commit_msg>Add update queries for reservation<commit_after> | UPDATE_MOVIE = '''
UPDATE MOVIE
SET column1=?, RATING=?
WHERE MOVIE.ID=?;
'''
UPDATE_PROJECTION = '''
UPDATE PROJECTION
SET MOVIE_ID=?, TYPE=?, DATE=?
WHERE PROJECTION.ID=?;
'''
DELETE_RESERVATION = '''
UPDATE RESERVATION
SET USER_ID=?, PROJECTION_ID=?, ROW=?, COL=?
WHERE RESERVATI... | UPDATE_MOVIE = '''
UPDATE MOVIE
SET column1=?, RATING=?
WHERE MOVIE.ID=?;
'''
UPDATE_PROJECTION = '''
UPDATE PROJECTION
SET MOVIE_ID=?, TYPE=?, DATE=?
WHERE PROJECTION.ID=?;
'''
Add update queries for reservationUPDATE_MOVIE = '''
UPDATE MOVIE
SET column1=?, RATING=?
WHERE MOVIE.ID=... | <commit_before>UPDATE_MOVIE = '''
UPDATE MOVIE
SET column1=?, RATING=?
WHERE MOVIE.ID=?;
'''
UPDATE_PROJECTION = '''
UPDATE PROJECTION
SET MOVIE_ID=?, TYPE=?, DATE=?
WHERE PROJECTION.ID=?;
'''
<commit_msg>Add update queries for reservation<commit_after>UPDATE_MOVIE = '''
UPDATE MOVIE
SE... |
1d355a2143daf438b5a2f5185a7f60268ad7c686 | tests/local_test.py | tests/local_test.py | from nose.tools import istest, assert_equal
from spur import LocalShell
shell = LocalShell()
@istest
def output_of_run_is_stored():
result = shell.run(["echo", "hello"])
assert_equal("hello\n", result.output)
| from nose.tools import istest, assert_equal
from spur import LocalShell
shell = LocalShell()
@istest
def output_of_run_is_stored():
result = shell.run(["echo", "hello"])
assert_equal("hello\n", result.output)
@istest
def cwd_of_run_can_be_set():
result = shell.run(["pwd"], cwd="/")
assert_equal("/\n... | Add test for setting cwd in LocalShell.run | Add test for setting cwd in LocalShell.run
| Python | bsd-2-clause | mwilliamson/spur.py | from nose.tools import istest, assert_equal
from spur import LocalShell
shell = LocalShell()
@istest
def output_of_run_is_stored():
result = shell.run(["echo", "hello"])
assert_equal("hello\n", result.output)
Add test for setting cwd in LocalShell.run | from nose.tools import istest, assert_equal
from spur import LocalShell
shell = LocalShell()
@istest
def output_of_run_is_stored():
result = shell.run(["echo", "hello"])
assert_equal("hello\n", result.output)
@istest
def cwd_of_run_can_be_set():
result = shell.run(["pwd"], cwd="/")
assert_equal("/\n... | <commit_before>from nose.tools import istest, assert_equal
from spur import LocalShell
shell = LocalShell()
@istest
def output_of_run_is_stored():
result = shell.run(["echo", "hello"])
assert_equal("hello\n", result.output)
<commit_msg>Add test for setting cwd in LocalShell.run<commit_after> | from nose.tools import istest, assert_equal
from spur import LocalShell
shell = LocalShell()
@istest
def output_of_run_is_stored():
result = shell.run(["echo", "hello"])
assert_equal("hello\n", result.output)
@istest
def cwd_of_run_can_be_set():
result = shell.run(["pwd"], cwd="/")
assert_equal("/\n... | from nose.tools import istest, assert_equal
from spur import LocalShell
shell = LocalShell()
@istest
def output_of_run_is_stored():
result = shell.run(["echo", "hello"])
assert_equal("hello\n", result.output)
Add test for setting cwd in LocalShell.runfrom nose.tools import istest, assert_equal
from spur imp... | <commit_before>from nose.tools import istest, assert_equal
from spur import LocalShell
shell = LocalShell()
@istest
def output_of_run_is_stored():
result = shell.run(["echo", "hello"])
assert_equal("hello\n", result.output)
<commit_msg>Add test for setting cwd in LocalShell.run<commit_after>from nose.tools i... |
2f02960607b75e74a757ded1e2472a5fb8585d4f | tests/pyb/extint.py | tests/pyb/extint.py | import pyb
ext = pyb.ExtInt('X1', pyb.ExtInt.IRQ_RISING, pyb.Pin.PULL_DOWN, lambda l:print('line:', l))
ext.disable()
ext.enable()
print(ext.line())
ext.swint()
ext.disable()
| import pyb
# test basic functionality
ext = pyb.ExtInt('X1', pyb.ExtInt.IRQ_RISING, pyb.Pin.PULL_DOWN, lambda l:print('line:', l))
ext.disable()
ext.enable()
print(ext.line())
ext.swint()
# test swint while disabled, then again after re-enabled
ext.disable()
ext.swint()
ext.enable()
ext.swint()
# disable now that th... | Add test for ExtInt when doing swint while disabled. | tests/pyb: Add test for ExtInt when doing swint while disabled.
| Python | mit | infinnovation/micropython,adafruit/circuitpython,turbinenreiter/micropython,dxxb/micropython,pfalcon/micropython,infinnovation/micropython,Timmenem/micropython,oopy/micropython,mhoffma/micropython,pfalcon/micropython,selste/micropython,adafruit/circuitpython,Peetz0r/micropython-esp32,oopy/micropython,torwag/micropython... | import pyb
ext = pyb.ExtInt('X1', pyb.ExtInt.IRQ_RISING, pyb.Pin.PULL_DOWN, lambda l:print('line:', l))
ext.disable()
ext.enable()
print(ext.line())
ext.swint()
ext.disable()
tests/pyb: Add test for ExtInt when doing swint while disabled. | import pyb
# test basic functionality
ext = pyb.ExtInt('X1', pyb.ExtInt.IRQ_RISING, pyb.Pin.PULL_DOWN, lambda l:print('line:', l))
ext.disable()
ext.enable()
print(ext.line())
ext.swint()
# test swint while disabled, then again after re-enabled
ext.disable()
ext.swint()
ext.enable()
ext.swint()
# disable now that th... | <commit_before>import pyb
ext = pyb.ExtInt('X1', pyb.ExtInt.IRQ_RISING, pyb.Pin.PULL_DOWN, lambda l:print('line:', l))
ext.disable()
ext.enable()
print(ext.line())
ext.swint()
ext.disable()
<commit_msg>tests/pyb: Add test for ExtInt when doing swint while disabled.<commit_after> | import pyb
# test basic functionality
ext = pyb.ExtInt('X1', pyb.ExtInt.IRQ_RISING, pyb.Pin.PULL_DOWN, lambda l:print('line:', l))
ext.disable()
ext.enable()
print(ext.line())
ext.swint()
# test swint while disabled, then again after re-enabled
ext.disable()
ext.swint()
ext.enable()
ext.swint()
# disable now that th... | import pyb
ext = pyb.ExtInt('X1', pyb.ExtInt.IRQ_RISING, pyb.Pin.PULL_DOWN, lambda l:print('line:', l))
ext.disable()
ext.enable()
print(ext.line())
ext.swint()
ext.disable()
tests/pyb: Add test for ExtInt when doing swint while disabled.import pyb
# test basic functionality
ext = pyb.ExtInt('X1', pyb.ExtInt.IRQ_RISI... | <commit_before>import pyb
ext = pyb.ExtInt('X1', pyb.ExtInt.IRQ_RISING, pyb.Pin.PULL_DOWN, lambda l:print('line:', l))
ext.disable()
ext.enable()
print(ext.line())
ext.swint()
ext.disable()
<commit_msg>tests/pyb: Add test for ExtInt when doing swint while disabled.<commit_after>import pyb
# test basic functionality
e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.