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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b9701cfb65c4c641231bef385dde74b8d940f901 | gimlet/backends/sql.py | gimlet/backends/sql.py | from sqlalchemy import MetaData, Table, Column, types, create_engine, select
from .base import BaseBackend
class SQLBackend(BaseBackend):
def __init__(self, url, table_name='gimlet_channels', **engine_kwargs):
meta = MetaData(bind=create_engine(url, **engine_kwargs))
self.table = Table(table_nam... | from sqlalchemy import MetaData, Table, Column, types, create_engine, select
from .base import BaseBackend
class SQLBackend(BaseBackend):
def __init__(self, url, table_name='gimlet_channels', **engine_kwargs):
meta = MetaData(bind=create_engine(url, **engine_kwargs))
self.table = Table(table_nam... | Use count/scalar to test if key is present in SQL back end | Use count/scalar to test if key is present in SQL back end
This is simpler than using select/execute/fetchone. Also, scalar automatically
closes the result set whereas fetchone does not. This may fix some performance
issues.
| Python | mit | storborg/gimlet | from sqlalchemy import MetaData, Table, Column, types, create_engine, select
from .base import BaseBackend
class SQLBackend(BaseBackend):
def __init__(self, url, table_name='gimlet_channels', **engine_kwargs):
meta = MetaData(bind=create_engine(url, **engine_kwargs))
self.table = Table(table_nam... | from sqlalchemy import MetaData, Table, Column, types, create_engine, select
from .base import BaseBackend
class SQLBackend(BaseBackend):
def __init__(self, url, table_name='gimlet_channels', **engine_kwargs):
meta = MetaData(bind=create_engine(url, **engine_kwargs))
self.table = Table(table_nam... | <commit_before>from sqlalchemy import MetaData, Table, Column, types, create_engine, select
from .base import BaseBackend
class SQLBackend(BaseBackend):
def __init__(self, url, table_name='gimlet_channels', **engine_kwargs):
meta = MetaData(bind=create_engine(url, **engine_kwargs))
self.table = ... | from sqlalchemy import MetaData, Table, Column, types, create_engine, select
from .base import BaseBackend
class SQLBackend(BaseBackend):
def __init__(self, url, table_name='gimlet_channels', **engine_kwargs):
meta = MetaData(bind=create_engine(url, **engine_kwargs))
self.table = Table(table_nam... | from sqlalchemy import MetaData, Table, Column, types, create_engine, select
from .base import BaseBackend
class SQLBackend(BaseBackend):
def __init__(self, url, table_name='gimlet_channels', **engine_kwargs):
meta = MetaData(bind=create_engine(url, **engine_kwargs))
self.table = Table(table_nam... | <commit_before>from sqlalchemy import MetaData, Table, Column, types, create_engine, select
from .base import BaseBackend
class SQLBackend(BaseBackend):
def __init__(self, url, table_name='gimlet_channels', **engine_kwargs):
meta = MetaData(bind=create_engine(url, **engine_kwargs))
self.table = ... |
5cb6e90714ffe91377e01743451ed4aefe4a1e24 | greencard/greencard.py | greencard/greencard.py | """Greencard implementation."""
from functools import wraps
TESTS = []
def greencard(func):
"""
A decorator for providing a unittesting function/method with every card in
a librarian card library database when it is called.
"""
@wraps(func)
def wrapped(*args, **kwargs):
"""Transparen... | """Greencard implementation."""
from functools import wraps
TESTS = []
def greencard(func):
"""
A decorator for providing a unittesting function/method with every card in
a librarian card library database when it is called.
"""
@wraps(func)
def wrapped(*args, **kwargs):
"""Transparen... | Fix test descovery to correctly add test dir to path and import modules rather then files | Fix test descovery to correctly add test dir to path and import modules rather then files
| Python | mit | Nekroze/greencard,Nekroze/greencard | """Greencard implementation."""
from functools import wraps
TESTS = []
def greencard(func):
"""
A decorator for providing a unittesting function/method with every card in
a librarian card library database when it is called.
"""
@wraps(func)
def wrapped(*args, **kwargs):
"""Transparen... | """Greencard implementation."""
from functools import wraps
TESTS = []
def greencard(func):
"""
A decorator for providing a unittesting function/method with every card in
a librarian card library database when it is called.
"""
@wraps(func)
def wrapped(*args, **kwargs):
"""Transparen... | <commit_before>"""Greencard implementation."""
from functools import wraps
TESTS = []
def greencard(func):
"""
A decorator for providing a unittesting function/method with every card in
a librarian card library database when it is called.
"""
@wraps(func)
def wrapped(*args, **kwargs):
... | """Greencard implementation."""
from functools import wraps
TESTS = []
def greencard(func):
"""
A decorator for providing a unittesting function/method with every card in
a librarian card library database when it is called.
"""
@wraps(func)
def wrapped(*args, **kwargs):
"""Transparen... | """Greencard implementation."""
from functools import wraps
TESTS = []
def greencard(func):
"""
A decorator for providing a unittesting function/method with every card in
a librarian card library database when it is called.
"""
@wraps(func)
def wrapped(*args, **kwargs):
"""Transparen... | <commit_before>"""Greencard implementation."""
from functools import wraps
TESTS = []
def greencard(func):
"""
A decorator for providing a unittesting function/method with every card in
a librarian card library database when it is called.
"""
@wraps(func)
def wrapped(*args, **kwargs):
... |
8e3445e0ddedd5611be1f35166a9f37ae018e232 | client/initialize.py | client/initialize.py | #!/usr/bin/env python
import os
from tempfile import NamedTemporaryFile
from textwrap import dedent
import shutil
from qlmdm import top_dir
from qlmdm.prompts import get_bool
os.chdir(top_dir)
cron_file = '/etc/cron.d/qlmdm'
cron_exists = os.path.exists(cron_file)
if cron_exists:
prompt = 'Do you want to repla... | #!/usr/bin/env python
import os
from tempfile import NamedTemporaryFile
from textwrap import dedent
import shutil
from qlmdm import top_dir
from qlmdm.prompts import get_bool
os.chdir(top_dir)
cron_file = '/etc/cron.d/qlmdm'
cron_exists = os.path.exists(cron_file)
if cron_exists:
prompt = 'Do you want to repla... | Set client crontab file permissions before copying it into place | Set client crontab file permissions before copying it into place
Set the permissions on the client crontab file before copying it
rather than after, so the time during which the file is inconsistent
is reduced.
| Python | apache-2.0 | quantopian/PenguinDome,quantopian/PenguinDome | #!/usr/bin/env python
import os
from tempfile import NamedTemporaryFile
from textwrap import dedent
import shutil
from qlmdm import top_dir
from qlmdm.prompts import get_bool
os.chdir(top_dir)
cron_file = '/etc/cron.d/qlmdm'
cron_exists = os.path.exists(cron_file)
if cron_exists:
prompt = 'Do you want to repla... | #!/usr/bin/env python
import os
from tempfile import NamedTemporaryFile
from textwrap import dedent
import shutil
from qlmdm import top_dir
from qlmdm.prompts import get_bool
os.chdir(top_dir)
cron_file = '/etc/cron.d/qlmdm'
cron_exists = os.path.exists(cron_file)
if cron_exists:
prompt = 'Do you want to repla... | <commit_before>#!/usr/bin/env python
import os
from tempfile import NamedTemporaryFile
from textwrap import dedent
import shutil
from qlmdm import top_dir
from qlmdm.prompts import get_bool
os.chdir(top_dir)
cron_file = '/etc/cron.d/qlmdm'
cron_exists = os.path.exists(cron_file)
if cron_exists:
prompt = 'Do yo... | #!/usr/bin/env python
import os
from tempfile import NamedTemporaryFile
from textwrap import dedent
import shutil
from qlmdm import top_dir
from qlmdm.prompts import get_bool
os.chdir(top_dir)
cron_file = '/etc/cron.d/qlmdm'
cron_exists = os.path.exists(cron_file)
if cron_exists:
prompt = 'Do you want to repla... | #!/usr/bin/env python
import os
from tempfile import NamedTemporaryFile
from textwrap import dedent
import shutil
from qlmdm import top_dir
from qlmdm.prompts import get_bool
os.chdir(top_dir)
cron_file = '/etc/cron.d/qlmdm'
cron_exists = os.path.exists(cron_file)
if cron_exists:
prompt = 'Do you want to repla... | <commit_before>#!/usr/bin/env python
import os
from tempfile import NamedTemporaryFile
from textwrap import dedent
import shutil
from qlmdm import top_dir
from qlmdm.prompts import get_bool
os.chdir(top_dir)
cron_file = '/etc/cron.d/qlmdm'
cron_exists = os.path.exists(cron_file)
if cron_exists:
prompt = 'Do yo... |
2085cf0c103df44c500bae9bccdc2ce16cd8710f | amivapi/settings.py | amivapi/settings.py | """Default settings for all environments.
These settings will be extended by additional config files in ROOT/config.
Run `python manage.py create_config` to create such a config file.
"""
from os.path import abspath, dirname, join
# Custom
ROOT_DIR = abspath(join(dirname(__file__), ".."))
# Flask
DEBUG = False
TEST... | """Default settings for all environments.
These settings will be extended by additional config files in ROOT/config.
Run `python manage.py create_config` to create such a config file.
"""
from os.path import abspath, dirname, join
# Custom
ROOT_DIR = abspath(join(dirname(__file__), ".."))
# Flask
DEBUG = False
TEST... | Change DATE_FORMAT to be equivalent to datetime.isoformat() | Change DATE_FORMAT to be equivalent to datetime.isoformat()
| Python | agpl-3.0 | amiv-eth/amivapi,amiv-eth/amivapi,amiv-eth/amivapi | """Default settings for all environments.
These settings will be extended by additional config files in ROOT/config.
Run `python manage.py create_config` to create such a config file.
"""
from os.path import abspath, dirname, join
# Custom
ROOT_DIR = abspath(join(dirname(__file__), ".."))
# Flask
DEBUG = False
TEST... | """Default settings for all environments.
These settings will be extended by additional config files in ROOT/config.
Run `python manage.py create_config` to create such a config file.
"""
from os.path import abspath, dirname, join
# Custom
ROOT_DIR = abspath(join(dirname(__file__), ".."))
# Flask
DEBUG = False
TEST... | <commit_before>"""Default settings for all environments.
These settings will be extended by additional config files in ROOT/config.
Run `python manage.py create_config` to create such a config file.
"""
from os.path import abspath, dirname, join
# Custom
ROOT_DIR = abspath(join(dirname(__file__), ".."))
# Flask
DEB... | """Default settings for all environments.
These settings will be extended by additional config files in ROOT/config.
Run `python manage.py create_config` to create such a config file.
"""
from os.path import abspath, dirname, join
# Custom
ROOT_DIR = abspath(join(dirname(__file__), ".."))
# Flask
DEBUG = False
TEST... | """Default settings for all environments.
These settings will be extended by additional config files in ROOT/config.
Run `python manage.py create_config` to create such a config file.
"""
from os.path import abspath, dirname, join
# Custom
ROOT_DIR = abspath(join(dirname(__file__), ".."))
# Flask
DEBUG = False
TEST... | <commit_before>"""Default settings for all environments.
These settings will be extended by additional config files in ROOT/config.
Run `python manage.py create_config` to create such a config file.
"""
from os.path import abspath, dirname, join
# Custom
ROOT_DIR = abspath(join(dirname(__file__), ".."))
# Flask
DEB... |
c454e2ccafe0c8981ca0789edd2850cbde15c6a3 | wallace/environments.py | wallace/environments.py | from sqlalchemy import ForeignKey, Column, String, desc
from .models import Node, Info
from information import State
class Environment(Node):
"""Defines an environment node.
Environments are nodes that have a state and that receive a transmission
from anyone that observes them.
"""
__tablename_... | from sqlalchemy import ForeignKey, Column, String, desc
from .models import Node, Info
from information import State
class Environment(Node):
"""Defines an environment node.
Environments are nodes that have a state and that receive a transmission
from anyone that observes them.
"""
__tablename_... | Remove side effect where observing connects | Remove side effect where observing connects
| Python | mit | Dallinger/Dallinger,suchow/Wallace,berkeley-cocosci/Wallace,jcpeterson/Dallinger,Dallinger/Dallinger,berkeley-cocosci/Wallace,Dallinger/Dallinger,suchow/Wallace,jcpeterson/Dallinger,jcpeterson/Dallinger,jcpeterson/Dallinger,berkeley-cocosci/Wallace,Dallinger/Dallinger,jcpeterson/Dallinger,Dallinger/Dallinger,suchow/Wal... | from sqlalchemy import ForeignKey, Column, String, desc
from .models import Node, Info
from information import State
class Environment(Node):
"""Defines an environment node.
Environments are nodes that have a state and that receive a transmission
from anyone that observes them.
"""
__tablename_... | from sqlalchemy import ForeignKey, Column, String, desc
from .models import Node, Info
from information import State
class Environment(Node):
"""Defines an environment node.
Environments are nodes that have a state and that receive a transmission
from anyone that observes them.
"""
__tablename_... | <commit_before>from sqlalchemy import ForeignKey, Column, String, desc
from .models import Node, Info
from information import State
class Environment(Node):
"""Defines an environment node.
Environments are nodes that have a state and that receive a transmission
from anyone that observes them.
"""
... | from sqlalchemy import ForeignKey, Column, String, desc
from .models import Node, Info
from information import State
class Environment(Node):
"""Defines an environment node.
Environments are nodes that have a state and that receive a transmission
from anyone that observes them.
"""
__tablename_... | from sqlalchemy import ForeignKey, Column, String, desc
from .models import Node, Info
from information import State
class Environment(Node):
"""Defines an environment node.
Environments are nodes that have a state and that receive a transmission
from anyone that observes them.
"""
__tablename_... | <commit_before>from sqlalchemy import ForeignKey, Column, String, desc
from .models import Node, Info
from information import State
class Environment(Node):
"""Defines an environment node.
Environments are nodes that have a state and that receive a transmission
from anyone that observes them.
"""
... |
83efdc63bed6c280e62eae1fb3a741adc2ac730a | duralex/ForkReferenceVisitor.py | duralex/ForkReferenceVisitor.py | from AbstractVisitor import AbstractVisitor
from duralex.alinea_parser import *
import duralex.node_type
class ForkReferenceVisitor(AbstractVisitor):
def visit_node(self, node):
if duralex.tree.is_reference(node) and 'children' in node and len(node['children']) > 1:
ref_nodes = filter(lambda ... | from AbstractVisitor import AbstractVisitor
from duralex.alinea_parser import *
import duralex.tree
class ForkReferenceVisitor(AbstractVisitor):
def visit_node(self, node):
if duralex.tree.is_reference(node) and 'children' in node and len(node['children']) > 1:
ref_nodes = filter(lambda n: du... | Fix broken reference to node_type. | Fix broken reference to node_type.
| Python | mit | Legilibre/duralex | from AbstractVisitor import AbstractVisitor
from duralex.alinea_parser import *
import duralex.node_type
class ForkReferenceVisitor(AbstractVisitor):
def visit_node(self, node):
if duralex.tree.is_reference(node) and 'children' in node and len(node['children']) > 1:
ref_nodes = filter(lambda ... | from AbstractVisitor import AbstractVisitor
from duralex.alinea_parser import *
import duralex.tree
class ForkReferenceVisitor(AbstractVisitor):
def visit_node(self, node):
if duralex.tree.is_reference(node) and 'children' in node and len(node['children']) > 1:
ref_nodes = filter(lambda n: du... | <commit_before>from AbstractVisitor import AbstractVisitor
from duralex.alinea_parser import *
import duralex.node_type
class ForkReferenceVisitor(AbstractVisitor):
def visit_node(self, node):
if duralex.tree.is_reference(node) and 'children' in node and len(node['children']) > 1:
ref_nodes =... | from AbstractVisitor import AbstractVisitor
from duralex.alinea_parser import *
import duralex.tree
class ForkReferenceVisitor(AbstractVisitor):
def visit_node(self, node):
if duralex.tree.is_reference(node) and 'children' in node and len(node['children']) > 1:
ref_nodes = filter(lambda n: du... | from AbstractVisitor import AbstractVisitor
from duralex.alinea_parser import *
import duralex.node_type
class ForkReferenceVisitor(AbstractVisitor):
def visit_node(self, node):
if duralex.tree.is_reference(node) and 'children' in node and len(node['children']) > 1:
ref_nodes = filter(lambda ... | <commit_before>from AbstractVisitor import AbstractVisitor
from duralex.alinea_parser import *
import duralex.node_type
class ForkReferenceVisitor(AbstractVisitor):
def visit_node(self, node):
if duralex.tree.is_reference(node) and 'children' in node and len(node['children']) > 1:
ref_nodes =... |
2d13b639f17fd7430191c45ee14f6d200228fd5a | geoportal/geoportailv3_geoportal/views/luxthemes.py | geoportal/geoportailv3_geoportal/views/luxthemes.py | from pyramid.view import view_config
from c2cgeoportal_commons.models import DBSession
from c2cgeoportal_commons.models.main import Theme
import logging
log = logging.getLogger(__name__)
class LuxThemes(object):
def __init__(self, request):
self.request = request
@view_config(route_name='isthemepri... | import logging
import re
from c2cgeoportal_commons.models import DBSession, main
from c2cgeoportal_geoportal.lib.caching import get_region
from c2cgeoportal_geoportal.lib.wmstparsing import TimeInformation
from c2cgeoportal_geoportal.views.theme import Theme
from pyramid.view import view_config
from geoportailv3_geop... | Fix themes.json with internal WMS | Fix themes.json with internal WMS
| Python | mit | Geoportail-Luxembourg/geoportailv3,Geoportail-Luxembourg/geoportailv3,Geoportail-Luxembourg/geoportailv3,Geoportail-Luxembourg/geoportailv3,Geoportail-Luxembourg/geoportailv3 | from pyramid.view import view_config
from c2cgeoportal_commons.models import DBSession
from c2cgeoportal_commons.models.main import Theme
import logging
log = logging.getLogger(__name__)
class LuxThemes(object):
def __init__(self, request):
self.request = request
@view_config(route_name='isthemepri... | import logging
import re
from c2cgeoportal_commons.models import DBSession, main
from c2cgeoportal_geoportal.lib.caching import get_region
from c2cgeoportal_geoportal.lib.wmstparsing import TimeInformation
from c2cgeoportal_geoportal.views.theme import Theme
from pyramid.view import view_config
from geoportailv3_geop... | <commit_before>from pyramid.view import view_config
from c2cgeoportal_commons.models import DBSession
from c2cgeoportal_commons.models.main import Theme
import logging
log = logging.getLogger(__name__)
class LuxThemes(object):
def __init__(self, request):
self.request = request
@view_config(route_n... | import logging
import re
from c2cgeoportal_commons.models import DBSession, main
from c2cgeoportal_geoportal.lib.caching import get_region
from c2cgeoportal_geoportal.lib.wmstparsing import TimeInformation
from c2cgeoportal_geoportal.views.theme import Theme
from pyramid.view import view_config
from geoportailv3_geop... | from pyramid.view import view_config
from c2cgeoportal_commons.models import DBSession
from c2cgeoportal_commons.models.main import Theme
import logging
log = logging.getLogger(__name__)
class LuxThemes(object):
def __init__(self, request):
self.request = request
@view_config(route_name='isthemepri... | <commit_before>from pyramid.view import view_config
from c2cgeoportal_commons.models import DBSession
from c2cgeoportal_commons.models.main import Theme
import logging
log = logging.getLogger(__name__)
class LuxThemes(object):
def __init__(self, request):
self.request = request
@view_config(route_n... |
5d2858d740eebfe180ceef22ae5cc80b902a5ccf | books/views.py | books/views.py | from django.core.urlresolvers import reverse
from django.http.response import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.utils.translation import ugettext as _
from books.forms import BookForm
from shared.models import BookType
def index(request):
book_list = BookType.obje... | from django.core.urlresolvers import reverse
from django.http.response import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.utils.translation import ugettext as _
from books.forms import BookForm
from shared.models import BookType
def index(request):
book_list = BookType.obje... | Fix KeyError in alerts implementation | Fix KeyError in alerts implementation
- Fix for alert that wasn't dismissing after refreshing the page
| Python | agpl-3.0 | m4tx/egielda,m4tx/egielda,m4tx/egielda | from django.core.urlresolvers import reverse
from django.http.response import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.utils.translation import ugettext as _
from books.forms import BookForm
from shared.models import BookType
def index(request):
book_list = BookType.obje... | from django.core.urlresolvers import reverse
from django.http.response import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.utils.translation import ugettext as _
from books.forms import BookForm
from shared.models import BookType
def index(request):
book_list = BookType.obje... | <commit_before>from django.core.urlresolvers import reverse
from django.http.response import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.utils.translation import ugettext as _
from books.forms import BookForm
from shared.models import BookType
def index(request):
book_list ... | from django.core.urlresolvers import reverse
from django.http.response import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.utils.translation import ugettext as _
from books.forms import BookForm
from shared.models import BookType
def index(request):
book_list = BookType.obje... | from django.core.urlresolvers import reverse
from django.http.response import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.utils.translation import ugettext as _
from books.forms import BookForm
from shared.models import BookType
def index(request):
book_list = BookType.obje... | <commit_before>from django.core.urlresolvers import reverse
from django.http.response import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.utils.translation import ugettext as _
from books.forms import BookForm
from shared.models import BookType
def index(request):
book_list ... |
29c7e05a02366362db1801636e2b71e042ea6461 | authorizenet/conf.py | authorizenet/conf.py | """Application-specific settings for django-authorizenet"""
from django.conf import settings as django_settings
class Settings(object):
"""
Retrieves django.conf settings, using defaults from Default subclass
All usable settings are specified in settings attribute. Use an
``AUTHNET_`` prefix when ... | """Application-specific settings for django-authorizenet"""
from django.conf import settings as django_settings
class Settings(object):
"""
Retrieves django.conf settings, using defaults from Default subclass
All usable settings are specified in settings attribute. Use an
``AUTHNET_`` prefix when ... | Fix set notation for Python 2.6 | Fix set notation for Python 2.6
| Python | mit | zen4ever/django-authorizenet,zen4ever/django-authorizenet,zen4ever/django-authorizenet | """Application-specific settings for django-authorizenet"""
from django.conf import settings as django_settings
class Settings(object):
"""
Retrieves django.conf settings, using defaults from Default subclass
All usable settings are specified in settings attribute. Use an
``AUTHNET_`` prefix when ... | """Application-specific settings for django-authorizenet"""
from django.conf import settings as django_settings
class Settings(object):
"""
Retrieves django.conf settings, using defaults from Default subclass
All usable settings are specified in settings attribute. Use an
``AUTHNET_`` prefix when ... | <commit_before>"""Application-specific settings for django-authorizenet"""
from django.conf import settings as django_settings
class Settings(object):
"""
Retrieves django.conf settings, using defaults from Default subclass
All usable settings are specified in settings attribute. Use an
``AUTHNET_... | """Application-specific settings for django-authorizenet"""
from django.conf import settings as django_settings
class Settings(object):
"""
Retrieves django.conf settings, using defaults from Default subclass
All usable settings are specified in settings attribute. Use an
``AUTHNET_`` prefix when ... | """Application-specific settings for django-authorizenet"""
from django.conf import settings as django_settings
class Settings(object):
"""
Retrieves django.conf settings, using defaults from Default subclass
All usable settings are specified in settings attribute. Use an
``AUTHNET_`` prefix when ... | <commit_before>"""Application-specific settings for django-authorizenet"""
from django.conf import settings as django_settings
class Settings(object):
"""
Retrieves django.conf settings, using defaults from Default subclass
All usable settings are specified in settings attribute. Use an
``AUTHNET_... |
643b47b2b805a045d9344e11e85ae4334ea79056 | casia/conf/global_settings.py | casia/conf/global_settings.py | # -*- coding: utf-8 -*-
# This file is part of Casia - CAS server based on Django
# Copyright (C) 2013 Mateusz Małek
# Casia is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# L... | # -*- coding: utf-8 -*-
# This file is part of Casia - CAS server based on Django
# Copyright (C) 2013 Mateusz Małek
# Casia is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# L... | Remove middleware classes which are currently unnecessary | Remove middleware classes which are currently unnecessary
| Python | agpl-3.0 | mkwm/casia,mkwm/casia | # -*- coding: utf-8 -*-
# This file is part of Casia - CAS server based on Django
# Copyright (C) 2013 Mateusz Małek
# Casia is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# L... | # -*- coding: utf-8 -*-
# This file is part of Casia - CAS server based on Django
# Copyright (C) 2013 Mateusz Małek
# Casia is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# L... | <commit_before># -*- coding: utf-8 -*-
# This file is part of Casia - CAS server based on Django
# Copyright (C) 2013 Mateusz Małek
# Casia is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either versi... | # -*- coding: utf-8 -*-
# This file is part of Casia - CAS server based on Django
# Copyright (C) 2013 Mateusz Małek
# Casia is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# L... | # -*- coding: utf-8 -*-
# This file is part of Casia - CAS server based on Django
# Copyright (C) 2013 Mateusz Małek
# Casia is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# L... | <commit_before># -*- coding: utf-8 -*-
# This file is part of Casia - CAS server based on Django
# Copyright (C) 2013 Mateusz Małek
# Casia is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either versi... |
df37b65872bc1b5a21a1e74934b834472fc6ca7b | buffer/managers/updates.py | buffer/managers/updates.py | from buffer.models.update import Update
PATHS = {
'GET_PENDING': 'profiles/%s/updates/pending.json',
}
class Updates(list):
def __init__(self, api, profile_id):
self.api = api
self.profile_id = profile_id
@property
def pending(self):
url = PATHS['GET_PENDING'] % self.profile_id
response = s... | from buffer.models.update import Update
PATHS = {
'GET_PENDING': 'profiles/%s/updates/pending.json',
'GET_SENT': 'profiles/%s/updates/sent.json',
}
class Updates(list):
def __init__(self, api, profile_id):
self.api = api
self.profile_id = profile_id
self.__pending = []
self.__sent = []
@pro... | Improve proper using of property decorator and logic | Improve proper using of property decorator and logic
| Python | mit | vtemian/buffpy,bufferapp/buffer-python | from buffer.models.update import Update
PATHS = {
'GET_PENDING': 'profiles/%s/updates/pending.json',
}
class Updates(list):
def __init__(self, api, profile_id):
self.api = api
self.profile_id = profile_id
@property
def pending(self):
url = PATHS['GET_PENDING'] % self.profile_id
response = s... | from buffer.models.update import Update
PATHS = {
'GET_PENDING': 'profiles/%s/updates/pending.json',
'GET_SENT': 'profiles/%s/updates/sent.json',
}
class Updates(list):
def __init__(self, api, profile_id):
self.api = api
self.profile_id = profile_id
self.__pending = []
self.__sent = []
@pro... | <commit_before>from buffer.models.update import Update
PATHS = {
'GET_PENDING': 'profiles/%s/updates/pending.json',
}
class Updates(list):
def __init__(self, api, profile_id):
self.api = api
self.profile_id = profile_id
@property
def pending(self):
url = PATHS['GET_PENDING'] % self.profile_id
... | from buffer.models.update import Update
PATHS = {
'GET_PENDING': 'profiles/%s/updates/pending.json',
'GET_SENT': 'profiles/%s/updates/sent.json',
}
class Updates(list):
def __init__(self, api, profile_id):
self.api = api
self.profile_id = profile_id
self.__pending = []
self.__sent = []
@pro... | from buffer.models.update import Update
PATHS = {
'GET_PENDING': 'profiles/%s/updates/pending.json',
}
class Updates(list):
def __init__(self, api, profile_id):
self.api = api
self.profile_id = profile_id
@property
def pending(self):
url = PATHS['GET_PENDING'] % self.profile_id
response = s... | <commit_before>from buffer.models.update import Update
PATHS = {
'GET_PENDING': 'profiles/%s/updates/pending.json',
}
class Updates(list):
def __init__(self, api, profile_id):
self.api = api
self.profile_id = profile_id
@property
def pending(self):
url = PATHS['GET_PENDING'] % self.profile_id
... |
e45b1f417c535bb8fef1ed18c8736525bbd0acc6 | appengine_config.py | appengine_config.py | """Configuration."""
import logging
import os
import re
from google.appengine.ext.appstats import recording
logging.info('Loading %s from %s', __name__, __file__)
# Custom webapp middleware to add Appstats.
def webapp_add_wsgi_middleware(app):
app = recording.appstats_wsgi_middleware(app)
return app
# Appstats... | """Configuration."""
import logging
import os
import re
from google.appengine.ext.appstats import recording
logging.info('Loading %s from %s', __name__, __file__)
# Custom webapp middleware to add Appstats.
def webapp_add_wsgi_middleware(app):
app = recording.appstats_wsgi_middleware(app)
return app
# Appstats... | Switch Django version from 1.0 to 1.1 | Switch Django version from 1.0 to 1.1
| Python | apache-2.0 | fuzan/rietveld,ericmckean/rietveld,gavioto/rietveld,supriyantomaftuh/rietveld,gavioto/rietveld,nareshboddepalli/touchites-codereview,Koulio/rietveld,openlabs/cr.openlabs.co.in,nareshboddepalli/touchites-codereview,nbodepallictr/touchites-codereview,salomon1184/rietveld,openlabs/cr.openlabs.co.in,draem0507/rietveld,fool... | """Configuration."""
import logging
import os
import re
from google.appengine.ext.appstats import recording
logging.info('Loading %s from %s', __name__, __file__)
# Custom webapp middleware to add Appstats.
def webapp_add_wsgi_middleware(app):
app = recording.appstats_wsgi_middleware(app)
return app
# Appstats... | """Configuration."""
import logging
import os
import re
from google.appengine.ext.appstats import recording
logging.info('Loading %s from %s', __name__, __file__)
# Custom webapp middleware to add Appstats.
def webapp_add_wsgi_middleware(app):
app = recording.appstats_wsgi_middleware(app)
return app
# Appstats... | <commit_before>"""Configuration."""
import logging
import os
import re
from google.appengine.ext.appstats import recording
logging.info('Loading %s from %s', __name__, __file__)
# Custom webapp middleware to add Appstats.
def webapp_add_wsgi_middleware(app):
app = recording.appstats_wsgi_middleware(app)
return ... | """Configuration."""
import logging
import os
import re
from google.appengine.ext.appstats import recording
logging.info('Loading %s from %s', __name__, __file__)
# Custom webapp middleware to add Appstats.
def webapp_add_wsgi_middleware(app):
app = recording.appstats_wsgi_middleware(app)
return app
# Appstats... | """Configuration."""
import logging
import os
import re
from google.appengine.ext.appstats import recording
logging.info('Loading %s from %s', __name__, __file__)
# Custom webapp middleware to add Appstats.
def webapp_add_wsgi_middleware(app):
app = recording.appstats_wsgi_middleware(app)
return app
# Appstats... | <commit_before>"""Configuration."""
import logging
import os
import re
from google.appengine.ext.appstats import recording
logging.info('Loading %s from %s', __name__, __file__)
# Custom webapp middleware to add Appstats.
def webapp_add_wsgi_middleware(app):
app = recording.appstats_wsgi_middleware(app)
return ... |
a4375a6ec5ca54b887527885235317986011801c | guesser.py | guesser.py | from synt.utils.redis_manager import RedisManager
from synt.utils.extractors import best_word_feats
from synt.utils.text import sanitize_text
MANAGER = RedisManager()
DEFAULT_CLASSIFIER = MANAGER.load_classifier()
def guess(text, classifier=DEFAULT_CLASSIFIER):
"""Takes a blob of text and returns the sentiment an... | from synt.utils.redis_manager import RedisManager
from synt.utils.extractors import best_word_feats
from synt.utils.text import sanitize_text
MANAGER = RedisManager()
DEFAULT_CLASSIFIER = MANAGER.load_classifier()
def guess(text, classifier=DEFAULT_CLASSIFIER):
"""Takes a blob of text and returns the sentiment an... | Return a -1 .. 1 sentiment score. | Return a -1 .. 1 sentiment score.
| Python | agpl-3.0 | lrvick/synt | from synt.utils.redis_manager import RedisManager
from synt.utils.extractors import best_word_feats
from synt.utils.text import sanitize_text
MANAGER = RedisManager()
DEFAULT_CLASSIFIER = MANAGER.load_classifier()
def guess(text, classifier=DEFAULT_CLASSIFIER):
"""Takes a blob of text and returns the sentiment an... | from synt.utils.redis_manager import RedisManager
from synt.utils.extractors import best_word_feats
from synt.utils.text import sanitize_text
MANAGER = RedisManager()
DEFAULT_CLASSIFIER = MANAGER.load_classifier()
def guess(text, classifier=DEFAULT_CLASSIFIER):
"""Takes a blob of text and returns the sentiment an... | <commit_before>from synt.utils.redis_manager import RedisManager
from synt.utils.extractors import best_word_feats
from synt.utils.text import sanitize_text
MANAGER = RedisManager()
DEFAULT_CLASSIFIER = MANAGER.load_classifier()
def guess(text, classifier=DEFAULT_CLASSIFIER):
"""Takes a blob of text and returns t... | from synt.utils.redis_manager import RedisManager
from synt.utils.extractors import best_word_feats
from synt.utils.text import sanitize_text
MANAGER = RedisManager()
DEFAULT_CLASSIFIER = MANAGER.load_classifier()
def guess(text, classifier=DEFAULT_CLASSIFIER):
"""Takes a blob of text and returns the sentiment an... | from synt.utils.redis_manager import RedisManager
from synt.utils.extractors import best_word_feats
from synt.utils.text import sanitize_text
MANAGER = RedisManager()
DEFAULT_CLASSIFIER = MANAGER.load_classifier()
def guess(text, classifier=DEFAULT_CLASSIFIER):
"""Takes a blob of text and returns the sentiment an... | <commit_before>from synt.utils.redis_manager import RedisManager
from synt.utils.extractors import best_word_feats
from synt.utils.text import sanitize_text
MANAGER = RedisManager()
DEFAULT_CLASSIFIER = MANAGER.load_classifier()
def guess(text, classifier=DEFAULT_CLASSIFIER):
"""Takes a blob of text and returns t... |
e01e0d7b1f3bb5d54d428c8f237b72a3c5170b7d | number_to_words_test.py | number_to_words_test.py | import unittest
from number_to_words import NumberToWords
class TestNumberToWords(unittest.TestCase):
def setUp(self):
self.n2w = NumberToWords()
def tearDown(self):
self.n2w = None
if __name__ == '__main__':
unittest.main()
| import unittest
from number_to_words import NumberToWords
class TestNumberToWords(unittest.TestCase):
def setUp(self):
self.n2w = NumberToWords()
def tearDown(self):
self.n2w = None
def test_zero_and_single_digits(self):
NUMBERS = {
0: 'zero', 1: 'one', 2: 'two', 3: '... | Add tests for number 0 to 9 | Add tests for number 0 to 9 | Python | mit | ianfieldhouse/number_to_words | import unittest
from number_to_words import NumberToWords
class TestNumberToWords(unittest.TestCase):
def setUp(self):
self.n2w = NumberToWords()
def tearDown(self):
self.n2w = None
if __name__ == '__main__':
unittest.main()
Add tests for number 0 to 9 | import unittest
from number_to_words import NumberToWords
class TestNumberToWords(unittest.TestCase):
def setUp(self):
self.n2w = NumberToWords()
def tearDown(self):
self.n2w = None
def test_zero_and_single_digits(self):
NUMBERS = {
0: 'zero', 1: 'one', 2: 'two', 3: '... | <commit_before>import unittest
from number_to_words import NumberToWords
class TestNumberToWords(unittest.TestCase):
def setUp(self):
self.n2w = NumberToWords()
def tearDown(self):
self.n2w = None
if __name__ == '__main__':
unittest.main()
<commit_msg>Add tests for number 0 to 9<commit_a... | import unittest
from number_to_words import NumberToWords
class TestNumberToWords(unittest.TestCase):
def setUp(self):
self.n2w = NumberToWords()
def tearDown(self):
self.n2w = None
def test_zero_and_single_digits(self):
NUMBERS = {
0: 'zero', 1: 'one', 2: 'two', 3: '... | import unittest
from number_to_words import NumberToWords
class TestNumberToWords(unittest.TestCase):
def setUp(self):
self.n2w = NumberToWords()
def tearDown(self):
self.n2w = None
if __name__ == '__main__':
unittest.main()
Add tests for number 0 to 9import unittest
from number_to_words... | <commit_before>import unittest
from number_to_words import NumberToWords
class TestNumberToWords(unittest.TestCase):
def setUp(self):
self.n2w = NumberToWords()
def tearDown(self):
self.n2w = None
if __name__ == '__main__':
unittest.main()
<commit_msg>Add tests for number 0 to 9<commit_a... |
3b768fdc642471446092a08446ec8f2ab08281c3 | clean.py | clean.py | import GutterColor.settings as settings
class Clean:
"""Clean up the cache and generated icons"""
def __init__(self, view):
pass
| import GutterColor.settings as settings
from os import walk, remove, path, listdir
from shutil import rmtree
from threading import Thread
class Clean(Thread):
"""Clean up the cache and generated icons"""
def __init__(self, files):
Thread.__init__(self)
self.files = files
def run(self):
self.remove_... | Add Clean class to remove files/folders. | Add Clean class to remove files/folders.
| Python | mit | ggordan/GutterColor,ggordan/GutterColor | import GutterColor.settings as settings
class Clean:
"""Clean up the cache and generated icons"""
def __init__(self, view):
pass
Add Clean class to remove files/folders. | import GutterColor.settings as settings
from os import walk, remove, path, listdir
from shutil import rmtree
from threading import Thread
class Clean(Thread):
"""Clean up the cache and generated icons"""
def __init__(self, files):
Thread.__init__(self)
self.files = files
def run(self):
self.remove_... | <commit_before>import GutterColor.settings as settings
class Clean:
"""Clean up the cache and generated icons"""
def __init__(self, view):
pass
<commit_msg>Add Clean class to remove files/folders.<commit_after> | import GutterColor.settings as settings
from os import walk, remove, path, listdir
from shutil import rmtree
from threading import Thread
class Clean(Thread):
"""Clean up the cache and generated icons"""
def __init__(self, files):
Thread.__init__(self)
self.files = files
def run(self):
self.remove_... | import GutterColor.settings as settings
class Clean:
"""Clean up the cache and generated icons"""
def __init__(self, view):
pass
Add Clean class to remove files/folders.import GutterColor.settings as settings
from os import walk, remove, path, listdir
from shutil import rmtree
from threading import Thread
cl... | <commit_before>import GutterColor.settings as settings
class Clean:
"""Clean up the cache and generated icons"""
def __init__(self, view):
pass
<commit_msg>Add Clean class to remove files/folders.<commit_after>import GutterColor.settings as settings
from os import walk, remove, path, listdir
from shutil impor... |
88995b5e2bcd6f3e21d8810a97f3c38cc84e8189 | pulldb/subscriptions.py | pulldb/subscriptions.py | # Copyright 2013 Russell Heilling
from google.appengine.ext import ndb
class Subscription(ndb.Model):
'''Subscription object in datastore.
Holds subscription data. Parent should be User.
'''
start_date = ndb.DateProperty()
volume = ndb.KeyProperty(kind='Volume')
| # Copyright 2013 Russell Heilling
from google.appengine.ext import ndb
from pulldb.users import user_key
class Subscription(ndb.Model):
'''Subscription object in datastore.
Holds subscription data. Parent should be User.
'''
start_date = ndb.DateProperty()
volume = ndb.KeyProperty(kind='Volume')
def subs... | Add basic subscription fetcher / creator | Add basic subscription fetcher / creator
| Python | mit | xchewtoyx/pulldb | # Copyright 2013 Russell Heilling
from google.appengine.ext import ndb
class Subscription(ndb.Model):
'''Subscription object in datastore.
Holds subscription data. Parent should be User.
'''
start_date = ndb.DateProperty()
volume = ndb.KeyProperty(kind='Volume')
Add basic subscription fetcher / creator | # Copyright 2013 Russell Heilling
from google.appengine.ext import ndb
from pulldb.users import user_key
class Subscription(ndb.Model):
'''Subscription object in datastore.
Holds subscription data. Parent should be User.
'''
start_date = ndb.DateProperty()
volume = ndb.KeyProperty(kind='Volume')
def subs... | <commit_before># Copyright 2013 Russell Heilling
from google.appengine.ext import ndb
class Subscription(ndb.Model):
'''Subscription object in datastore.
Holds subscription data. Parent should be User.
'''
start_date = ndb.DateProperty()
volume = ndb.KeyProperty(kind='Volume')
<commit_msg>Add basic subscri... | # Copyright 2013 Russell Heilling
from google.appengine.ext import ndb
from pulldb.users import user_key
class Subscription(ndb.Model):
'''Subscription object in datastore.
Holds subscription data. Parent should be User.
'''
start_date = ndb.DateProperty()
volume = ndb.KeyProperty(kind='Volume')
def subs... | # Copyright 2013 Russell Heilling
from google.appengine.ext import ndb
class Subscription(ndb.Model):
'''Subscription object in datastore.
Holds subscription data. Parent should be User.
'''
start_date = ndb.DateProperty()
volume = ndb.KeyProperty(kind='Volume')
Add basic subscription fetcher / creator# Co... | <commit_before># Copyright 2013 Russell Heilling
from google.appengine.ext import ndb
class Subscription(ndb.Model):
'''Subscription object in datastore.
Holds subscription data. Parent should be User.
'''
start_date = ndb.DateProperty()
volume = ndb.KeyProperty(kind='Volume')
<commit_msg>Add basic subscri... |
6424d1998d10d4d5e1165e7c530d414e86e1067b | tests/example_project/tests/test_newman/helpers.py | tests/example_project/tests/test_newman/helpers.py | from djangosanetesting import SeleniumTestCase
class NewmanTestCase(SeleniumTestCase):
fixtures = ['newman_admin_user']
SUPERUSER_USERNAME = u"superman"
SUPERUSER_PASSWORD = u"xxx"
NEWMAN_URI = "/newman/"
def __init__(self):
super(NewmanTestCase, self).__init__()
self.elements = ... | from djangosanetesting import SeleniumTestCase
class NewmanTestCase(SeleniumTestCase):
fixtures = ['newman_admin_user']
SUPERUSER_USERNAME = u"superman"
SUPERUSER_PASSWORD = u"xxx"
NEWMAN_URI = "/newman/"
def __init__(self):
super(NewmanTestCase, self).__init__()
self.elements = ... | Use class for logout instead of href, to please IE8 | Use class for logout instead of href, to please IE8
| Python | bsd-3-clause | WhiskeyMedia/ella,MichalMaM/ella,petrlosa/ella,petrlosa/ella,WhiskeyMedia/ella,ella/ella,whalerock/ella,MichalMaM/ella,whalerock/ella,whalerock/ella | from djangosanetesting import SeleniumTestCase
class NewmanTestCase(SeleniumTestCase):
fixtures = ['newman_admin_user']
SUPERUSER_USERNAME = u"superman"
SUPERUSER_PASSWORD = u"xxx"
NEWMAN_URI = "/newman/"
def __init__(self):
super(NewmanTestCase, self).__init__()
self.elements = ... | from djangosanetesting import SeleniumTestCase
class NewmanTestCase(SeleniumTestCase):
fixtures = ['newman_admin_user']
SUPERUSER_USERNAME = u"superman"
SUPERUSER_PASSWORD = u"xxx"
NEWMAN_URI = "/newman/"
def __init__(self):
super(NewmanTestCase, self).__init__()
self.elements = ... | <commit_before>from djangosanetesting import SeleniumTestCase
class NewmanTestCase(SeleniumTestCase):
fixtures = ['newman_admin_user']
SUPERUSER_USERNAME = u"superman"
SUPERUSER_PASSWORD = u"xxx"
NEWMAN_URI = "/newman/"
def __init__(self):
super(NewmanTestCase, self).__init__()
s... | from djangosanetesting import SeleniumTestCase
class NewmanTestCase(SeleniumTestCase):
fixtures = ['newman_admin_user']
SUPERUSER_USERNAME = u"superman"
SUPERUSER_PASSWORD = u"xxx"
NEWMAN_URI = "/newman/"
def __init__(self):
super(NewmanTestCase, self).__init__()
self.elements = ... | from djangosanetesting import SeleniumTestCase
class NewmanTestCase(SeleniumTestCase):
fixtures = ['newman_admin_user']
SUPERUSER_USERNAME = u"superman"
SUPERUSER_PASSWORD = u"xxx"
NEWMAN_URI = "/newman/"
def __init__(self):
super(NewmanTestCase, self).__init__()
self.elements = ... | <commit_before>from djangosanetesting import SeleniumTestCase
class NewmanTestCase(SeleniumTestCase):
fixtures = ['newman_admin_user']
SUPERUSER_USERNAME = u"superman"
SUPERUSER_PASSWORD = u"xxx"
NEWMAN_URI = "/newman/"
def __init__(self):
super(NewmanTestCase, self).__init__()
s... |
bcbe9da43a5e6564a33ec3d78098393cb5ecb3d0 | tests/test_collector.py | tests/test_collector.py | """Tests of coverage/collector.py and other collectors."""
import re
import coverage
from coverage.backward import StringIO
from tests.coveragetest import CoverageTest
class CollectorTest(CoverageTest):
"""Test specific aspects of the collection process."""
def test_should_trace_cache(self):
# The... | """Tests of coverage/collector.py and other collectors."""
import re
import coverage
from coverage.backward import StringIO
from tests.coveragetest import CoverageTest
class CollectorTest(CoverageTest):
"""Test specific aspects of the collection process."""
def test_should_trace_cache(self):
# The... | Make the should_trace_cache test a little more bullet-proof. | Make the should_trace_cache test a little more bullet-proof.
| Python | apache-2.0 | larsbutler/coveragepy,blueyed/coveragepy,blueyed/coveragepy,jayhetee/coveragepy,hugovk/coveragepy,7WebPages/coveragepy,nedbat/coveragepy,blueyed/coveragepy,larsbutler/coveragepy,larsbutler/coveragepy,larsbutler/coveragepy,nedbat/coveragepy,hugovk/coveragepy,nedbat/coveragepy,jayhetee/coveragepy,7WebPages/coveragepy,7We... | """Tests of coverage/collector.py and other collectors."""
import re
import coverage
from coverage.backward import StringIO
from tests.coveragetest import CoverageTest
class CollectorTest(CoverageTest):
"""Test specific aspects of the collection process."""
def test_should_trace_cache(self):
# The... | """Tests of coverage/collector.py and other collectors."""
import re
import coverage
from coverage.backward import StringIO
from tests.coveragetest import CoverageTest
class CollectorTest(CoverageTest):
"""Test specific aspects of the collection process."""
def test_should_trace_cache(self):
# The... | <commit_before>"""Tests of coverage/collector.py and other collectors."""
import re
import coverage
from coverage.backward import StringIO
from tests.coveragetest import CoverageTest
class CollectorTest(CoverageTest):
"""Test specific aspects of the collection process."""
def test_should_trace_cache(self)... | """Tests of coverage/collector.py and other collectors."""
import re
import coverage
from coverage.backward import StringIO
from tests.coveragetest import CoverageTest
class CollectorTest(CoverageTest):
"""Test specific aspects of the collection process."""
def test_should_trace_cache(self):
# The... | """Tests of coverage/collector.py and other collectors."""
import re
import coverage
from coverage.backward import StringIO
from tests.coveragetest import CoverageTest
class CollectorTest(CoverageTest):
"""Test specific aspects of the collection process."""
def test_should_trace_cache(self):
# The... | <commit_before>"""Tests of coverage/collector.py and other collectors."""
import re
import coverage
from coverage.backward import StringIO
from tests.coveragetest import CoverageTest
class CollectorTest(CoverageTest):
"""Test specific aspects of the collection process."""
def test_should_trace_cache(self)... |
d5be5401a1666f6a4caa2604c9918345f6202b70 | tests/testapp/models.py | tests/testapp/models.py | from django.db import models
from django.utils.timezone import now
from towel import deletion
from towel.managers import SearchManager
from towel.modelview import ModelViewURLs
class PersonManager(SearchManager):
search_fields = ('family_name', 'given_name')
class Person(models.Model):
created = models.Dat... | from django.db import models
from django.utils.timezone import now
from towel import deletion
from towel.managers import SearchManager
from towel.modelview import ModelViewURLs
class PersonManager(SearchManager):
search_fields = ('family_name', 'given_name')
class Person(models.Model):
created = models.Dat... | Use the item access variant instead | Use the item access variant instead
| Python | bsd-3-clause | matthiask/towel,matthiask/towel,matthiask/towel,matthiask/towel | from django.db import models
from django.utils.timezone import now
from towel import deletion
from towel.managers import SearchManager
from towel.modelview import ModelViewURLs
class PersonManager(SearchManager):
search_fields = ('family_name', 'given_name')
class Person(models.Model):
created = models.Dat... | from django.db import models
from django.utils.timezone import now
from towel import deletion
from towel.managers import SearchManager
from towel.modelview import ModelViewURLs
class PersonManager(SearchManager):
search_fields = ('family_name', 'given_name')
class Person(models.Model):
created = models.Dat... | <commit_before>from django.db import models
from django.utils.timezone import now
from towel import deletion
from towel.managers import SearchManager
from towel.modelview import ModelViewURLs
class PersonManager(SearchManager):
search_fields = ('family_name', 'given_name')
class Person(models.Model):
creat... | from django.db import models
from django.utils.timezone import now
from towel import deletion
from towel.managers import SearchManager
from towel.modelview import ModelViewURLs
class PersonManager(SearchManager):
search_fields = ('family_name', 'given_name')
class Person(models.Model):
created = models.Dat... | from django.db import models
from django.utils.timezone import now
from towel import deletion
from towel.managers import SearchManager
from towel.modelview import ModelViewURLs
class PersonManager(SearchManager):
search_fields = ('family_name', 'given_name')
class Person(models.Model):
created = models.Dat... | <commit_before>from django.db import models
from django.utils.timezone import now
from towel import deletion
from towel.managers import SearchManager
from towel.modelview import ModelViewURLs
class PersonManager(SearchManager):
search_fields = ('family_name', 'given_name')
class Person(models.Model):
creat... |
115bb7cf36bad5d38ac3b0be9a0bab7823c3b003 | IATISimpleTester/lib/helpers.py | IATISimpleTester/lib/helpers.py | from collections import defaultdict
import re
from lxml import etree
from IATISimpleTester import app
# given an expression list and the name of an expression,
# select it,
def select_expression(expression_list, expression_name, default_expression_name=None):
expression_dicts = {x["id"]: x for x in expression_l... | from collections import defaultdict
import re
from lxml import etree
from IATISimpleTester import app
# given an expression list and the name of an expression,
# select it,
def select_expression(expression_list, expression_name, default_expression_name=None):
expression_dicts = {x["id"]: x for x in expression_l... | Remove this emboldening thing again | Remove this emboldening thing again
| Python | mit | pwyf/data-quality-tester,pwyf/data-quality-tester,pwyf/data-quality-tester,pwyf/data-quality-tester | from collections import defaultdict
import re
from lxml import etree
from IATISimpleTester import app
# given an expression list and the name of an expression,
# select it,
def select_expression(expression_list, expression_name, default_expression_name=None):
expression_dicts = {x["id"]: x for x in expression_l... | from collections import defaultdict
import re
from lxml import etree
from IATISimpleTester import app
# given an expression list and the name of an expression,
# select it,
def select_expression(expression_list, expression_name, default_expression_name=None):
expression_dicts = {x["id"]: x for x in expression_l... | <commit_before>from collections import defaultdict
import re
from lxml import etree
from IATISimpleTester import app
# given an expression list and the name of an expression,
# select it,
def select_expression(expression_list, expression_name, default_expression_name=None):
expression_dicts = {x["id"]: x for x ... | from collections import defaultdict
import re
from lxml import etree
from IATISimpleTester import app
# given an expression list and the name of an expression,
# select it,
def select_expression(expression_list, expression_name, default_expression_name=None):
expression_dicts = {x["id"]: x for x in expression_l... | from collections import defaultdict
import re
from lxml import etree
from IATISimpleTester import app
# given an expression list and the name of an expression,
# select it,
def select_expression(expression_list, expression_name, default_expression_name=None):
expression_dicts = {x["id"]: x for x in expression_l... | <commit_before>from collections import defaultdict
import re
from lxml import etree
from IATISimpleTester import app
# given an expression list and the name of an expression,
# select it,
def select_expression(expression_list, expression_name, default_expression_name=None):
expression_dicts = {x["id"]: x for x ... |
a9d3f47098bc7499d62d4866883fa45622f01b74 | app/main/errors.py | app/main/errors.py | # coding=utf-8
from flask import render_template, current_app, request
from . import main
from ..helpers.search_helpers import get_template_data
@main.app_errorhandler(404)
def page_not_found(e):
template_data = get_template_data(main, {})
return render_template("errors/404.html", **template_data), 404
@ma... | # coding=utf-8
from flask import render_template, current_app, request
from . import main
from ..helpers.search_helpers import get_template_data
from dmutils.apiclient import APIError
@main.app_errorhandler(APIError)
def api_error_handler(e):
return _render_error_page(e.status_code)
@main.app_errorhandler(404)... | Add API error handling similar to supplier app | Add API error handling similar to supplier app
Currently 404s returned by the API are resulting in 500s on the buyer
app for invalid supplier requests. This change takes the model used in
the supplier frontend to automatically handle uncaught APIErrors. It is
not identical to the supplier app version because the defau... | Python | mit | alphagov/digitalmarketplace-buyer-frontend,alphagov/digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend,alphagov/digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend,alphagov/digitalmarketplace-buyer-frontend,AusDTO/dto-di... | # coding=utf-8
from flask import render_template, current_app, request
from . import main
from ..helpers.search_helpers import get_template_data
@main.app_errorhandler(404)
def page_not_found(e):
template_data = get_template_data(main, {})
return render_template("errors/404.html", **template_data), 404
@ma... | # coding=utf-8
from flask import render_template, current_app, request
from . import main
from ..helpers.search_helpers import get_template_data
from dmutils.apiclient import APIError
@main.app_errorhandler(APIError)
def api_error_handler(e):
return _render_error_page(e.status_code)
@main.app_errorhandler(404)... | <commit_before># coding=utf-8
from flask import render_template, current_app, request
from . import main
from ..helpers.search_helpers import get_template_data
@main.app_errorhandler(404)
def page_not_found(e):
template_data = get_template_data(main, {})
return render_template("errors/404.html", **template_d... | # coding=utf-8
from flask import render_template, current_app, request
from . import main
from ..helpers.search_helpers import get_template_data
from dmutils.apiclient import APIError
@main.app_errorhandler(APIError)
def api_error_handler(e):
return _render_error_page(e.status_code)
@main.app_errorhandler(404)... | # coding=utf-8
from flask import render_template, current_app, request
from . import main
from ..helpers.search_helpers import get_template_data
@main.app_errorhandler(404)
def page_not_found(e):
template_data = get_template_data(main, {})
return render_template("errors/404.html", **template_data), 404
@ma... | <commit_before># coding=utf-8
from flask import render_template, current_app, request
from . import main
from ..helpers.search_helpers import get_template_data
@main.app_errorhandler(404)
def page_not_found(e):
template_data = get_template_data(main, {})
return render_template("errors/404.html", **template_d... |
e66e2f19611e4f7bca9be400b13238e249b1b3d2 | cadorsfeed/fetch.py | cadorsfeed/fetch.py | import mechanize
import re
def fetchLatest():
br = mechanize.Browser()
br.open("http://wwwapps.tc.gc.ca/Saf-Sec-Sur/2/cadors-screaq/nrpt.aspx?lang=eng")
br.select_form(name="pageForm")
latestDate = br["txt_ReportDate"]
return latestDate
def fetchReport(reportDate):
br = mechanize.Browser()
... | from werkzeug.exceptions import NotFound, InternalServerError
import mechanize
import re
def fetchLatest():
br = mechanize.Browser()
br.open("http://wwwapps.tc.gc.ca/Saf-Sec-Sur/2/cadors-screaq/nrpt.aspx?lang=eng")
br.select_form(name="pageForm")
latestDate = br["txt_ReportDate"]
return latestDate... | Raise exceptions for common errors rather than returning invalid data. | Raise exceptions for common errors rather than returning invalid data.
| Python | mit | kurtraschke/cadors-parse,kurtraschke/cadors-parse | import mechanize
import re
def fetchLatest():
br = mechanize.Browser()
br.open("http://wwwapps.tc.gc.ca/Saf-Sec-Sur/2/cadors-screaq/nrpt.aspx?lang=eng")
br.select_form(name="pageForm")
latestDate = br["txt_ReportDate"]
return latestDate
def fetchReport(reportDate):
br = mechanize.Browser()
... | from werkzeug.exceptions import NotFound, InternalServerError
import mechanize
import re
def fetchLatest():
br = mechanize.Browser()
br.open("http://wwwapps.tc.gc.ca/Saf-Sec-Sur/2/cadors-screaq/nrpt.aspx?lang=eng")
br.select_form(name="pageForm")
latestDate = br["txt_ReportDate"]
return latestDate... | <commit_before>import mechanize
import re
def fetchLatest():
br = mechanize.Browser()
br.open("http://wwwapps.tc.gc.ca/Saf-Sec-Sur/2/cadors-screaq/nrpt.aspx?lang=eng")
br.select_form(name="pageForm")
latestDate = br["txt_ReportDate"]
return latestDate
def fetchReport(reportDate):
br = mechan... | from werkzeug.exceptions import NotFound, InternalServerError
import mechanize
import re
def fetchLatest():
br = mechanize.Browser()
br.open("http://wwwapps.tc.gc.ca/Saf-Sec-Sur/2/cadors-screaq/nrpt.aspx?lang=eng")
br.select_form(name="pageForm")
latestDate = br["txt_ReportDate"]
return latestDate... | import mechanize
import re
def fetchLatest():
br = mechanize.Browser()
br.open("http://wwwapps.tc.gc.ca/Saf-Sec-Sur/2/cadors-screaq/nrpt.aspx?lang=eng")
br.select_form(name="pageForm")
latestDate = br["txt_ReportDate"]
return latestDate
def fetchReport(reportDate):
br = mechanize.Browser()
... | <commit_before>import mechanize
import re
def fetchLatest():
br = mechanize.Browser()
br.open("http://wwwapps.tc.gc.ca/Saf-Sec-Sur/2/cadors-screaq/nrpt.aspx?lang=eng")
br.select_form(name="pageForm")
latestDate = br["txt_ReportDate"]
return latestDate
def fetchReport(reportDate):
br = mechan... |
91d7e27882c4317199f2de99964da4ef3a2e3950 | edx_data_research/web_app/__init__.py | edx_data_research/web_app/__init__.py | from flask import Flask
from flask.ext.mail import Mail
from flask.ext.mongoengine import MongoEngine
from flask.ext.security import MongoEngineUserDatastore, Security
# Create app
app = Flask(__name__)
app.config.from_object('config')
# Create mail object
mail = Mail(app)
| from flask import Flask
from flask.ext.mail import Mail
from flask.ext.mongoengine import MongoEngine
from flask.ext.security import MongoEngineUserDatastore, Security
# Create app
app = Flask(__name__)
app.config.from_object('config')
# Create mail object
mail = Mail(app)
# Create database connection object
db = Mo... | Define flask security object for login stuff | Define flask security object for login stuff | Python | mit | McGillX/edx_data_research,McGillX/edx_data_research,McGillX/edx_data_research | from flask import Flask
from flask.ext.mail import Mail
from flask.ext.mongoengine import MongoEngine
from flask.ext.security import MongoEngineUserDatastore, Security
# Create app
app = Flask(__name__)
app.config.from_object('config')
# Create mail object
mail = Mail(app)
Define flask security object for login stuff | from flask import Flask
from flask.ext.mail import Mail
from flask.ext.mongoengine import MongoEngine
from flask.ext.security import MongoEngineUserDatastore, Security
# Create app
app = Flask(__name__)
app.config.from_object('config')
# Create mail object
mail = Mail(app)
# Create database connection object
db = Mo... | <commit_before>from flask import Flask
from flask.ext.mail import Mail
from flask.ext.mongoengine import MongoEngine
from flask.ext.security import MongoEngineUserDatastore, Security
# Create app
app = Flask(__name__)
app.config.from_object('config')
# Create mail object
mail = Mail(app)
<commit_msg>Define flask secu... | from flask import Flask
from flask.ext.mail import Mail
from flask.ext.mongoengine import MongoEngine
from flask.ext.security import MongoEngineUserDatastore, Security
# Create app
app = Flask(__name__)
app.config.from_object('config')
# Create mail object
mail = Mail(app)
# Create database connection object
db = Mo... | from flask import Flask
from flask.ext.mail import Mail
from flask.ext.mongoengine import MongoEngine
from flask.ext.security import MongoEngineUserDatastore, Security
# Create app
app = Flask(__name__)
app.config.from_object('config')
# Create mail object
mail = Mail(app)
Define flask security object for login stuff... | <commit_before>from flask import Flask
from flask.ext.mail import Mail
from flask.ext.mongoengine import MongoEngine
from flask.ext.security import MongoEngineUserDatastore, Security
# Create app
app = Flask(__name__)
app.config.from_object('config')
# Create mail object
mail = Mail(app)
<commit_msg>Define flask secu... |
3384d2d933b9038f88b9ac0ac1c41545fa7c65c8 | utils/swift_build_support/swift_build_support/debug.py | utils/swift_build_support/swift_build_support/debug.py | # swift_build_support/debug.py - Print information on the build -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.txt... | # swift_build_support/debug.py - Print information on the build -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.txt... | Make --show-sdks fail if calling `xcodebuild` failed | [build-script] Make --show-sdks fail if calling `xcodebuild` failed
| Python | apache-2.0 | airspeedswift/swift,stephentyrone/swift,xwu/swift,shahmishal/swift,frootloops/swift,lorentey/swift,huonw/swift,gottesmm/swift,rudkx/swift,hooman/swift,jtbandes/swift,tjw/swift,tjw/swift,Jnosh/swift,jckarter/swift,karwa/swift,ben-ng/swift,felix91gr/swift,kperryua/swift,karwa/swift,devincoughlin/swift,tkremenek/swift,man... | # swift_build_support/debug.py - Print information on the build -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.txt... | # swift_build_support/debug.py - Print information on the build -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.txt... | <commit_before># swift_build_support/debug.py - Print information on the build -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.... | # swift_build_support/debug.py - Print information on the build -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.txt... | # swift_build_support/debug.py - Print information on the build -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.txt... | <commit_before># swift_build_support/debug.py - Print information on the build -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.... |
e6e525746613505e5f6be49a92901bb95a4e2199 | k8s/models/pod_disruption_budget.py | k8s/models/pod_disruption_budget.py | #!/usr/bin/env python
# -*- coding: utf-8
from __future__ import absolute_import
import six
from .common import ObjectMeta
from ..base import Model
from ..fields import Field, ListField
class PodDisruptionBudgetMatchExpressions(Model):
key = Field(six.text_type)
operator = Field(six.text_type)
values = ... | #!/usr/bin/env python
# -*- coding: utf-8
from __future__ import absolute_import
import six
from .common import ObjectMeta
from ..base import Model
from ..fields import Field, ListField
class LabelSelectorRequirement(Model):
key = Field(six.text_type)
operator = Field(six.text_type)
values = ListField(s... | Fix issues with class naming | Fix issues with class naming
| Python | apache-2.0 | fiaas/k8s | #!/usr/bin/env python
# -*- coding: utf-8
from __future__ import absolute_import
import six
from .common import ObjectMeta
from ..base import Model
from ..fields import Field, ListField
class PodDisruptionBudgetMatchExpressions(Model):
key = Field(six.text_type)
operator = Field(six.text_type)
values = ... | #!/usr/bin/env python
# -*- coding: utf-8
from __future__ import absolute_import
import six
from .common import ObjectMeta
from ..base import Model
from ..fields import Field, ListField
class LabelSelectorRequirement(Model):
key = Field(six.text_type)
operator = Field(six.text_type)
values = ListField(s... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8
from __future__ import absolute_import
import six
from .common import ObjectMeta
from ..base import Model
from ..fields import Field, ListField
class PodDisruptionBudgetMatchExpressions(Model):
key = Field(six.text_type)
operator = Field(six.text_type... | #!/usr/bin/env python
# -*- coding: utf-8
from __future__ import absolute_import
import six
from .common import ObjectMeta
from ..base import Model
from ..fields import Field, ListField
class LabelSelectorRequirement(Model):
key = Field(six.text_type)
operator = Field(six.text_type)
values = ListField(s... | #!/usr/bin/env python
# -*- coding: utf-8
from __future__ import absolute_import
import six
from .common import ObjectMeta
from ..base import Model
from ..fields import Field, ListField
class PodDisruptionBudgetMatchExpressions(Model):
key = Field(six.text_type)
operator = Field(six.text_type)
values = ... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8
from __future__ import absolute_import
import six
from .common import ObjectMeta
from ..base import Model
from ..fields import Field, ListField
class PodDisruptionBudgetMatchExpressions(Model):
key = Field(six.text_type)
operator = Field(six.text_type... |
027f016c6168325cb0e8b66adb1c10461399e0e1 | katagawa/sql/__init__.py | katagawa/sql/__init__.py | """
SQL generators for Katagawa.
"""
import abc
import typing
class Token(abc.ABC):
"""
Base class for a token.
"""
__slots__ = ()
def __init__(self, subtokens: typing.List['Token']):
"""
:param subtokens: Any subtokens this token has.
"""
self.subtokens = subtoke... | """
SQL generators for Katagawa.
"""
import abc
import typing
class Token(abc.ABC):
"""
Base class for a token.
"""
__slots__ = ()
def __init__(self, subtokens: typing.List['Token']=None):
"""
:param subtokens: Any subtokens this token has.
"""
if subtokens is Non... | Add consume_tokens function to Token. | Add consume_tokens function to Token.
| Python | mit | SunDwarf/asyncqlio | """
SQL generators for Katagawa.
"""
import abc
import typing
class Token(abc.ABC):
"""
Base class for a token.
"""
__slots__ = ()
def __init__(self, subtokens: typing.List['Token']):
"""
:param subtokens: Any subtokens this token has.
"""
self.subtokens = subtoke... | """
SQL generators for Katagawa.
"""
import abc
import typing
class Token(abc.ABC):
"""
Base class for a token.
"""
__slots__ = ()
def __init__(self, subtokens: typing.List['Token']=None):
"""
:param subtokens: Any subtokens this token has.
"""
if subtokens is Non... | <commit_before>"""
SQL generators for Katagawa.
"""
import abc
import typing
class Token(abc.ABC):
"""
Base class for a token.
"""
__slots__ = ()
def __init__(self, subtokens: typing.List['Token']):
"""
:param subtokens: Any subtokens this token has.
"""
self.subt... | """
SQL generators for Katagawa.
"""
import abc
import typing
class Token(abc.ABC):
"""
Base class for a token.
"""
__slots__ = ()
def __init__(self, subtokens: typing.List['Token']=None):
"""
:param subtokens: Any subtokens this token has.
"""
if subtokens is Non... | """
SQL generators for Katagawa.
"""
import abc
import typing
class Token(abc.ABC):
"""
Base class for a token.
"""
__slots__ = ()
def __init__(self, subtokens: typing.List['Token']):
"""
:param subtokens: Any subtokens this token has.
"""
self.subtokens = subtoke... | <commit_before>"""
SQL generators for Katagawa.
"""
import abc
import typing
class Token(abc.ABC):
"""
Base class for a token.
"""
__slots__ = ()
def __init__(self, subtokens: typing.List['Token']):
"""
:param subtokens: Any subtokens this token has.
"""
self.subt... |
9c16b71ecbb38115f107c7baba56304fb9630ec5 | ocds/export/__init__.py | ocds/export/__init__.py | from .models import (
Release,
ReleasePackage,
Record,
RecordPackage
)
from .schema import Tender
from .helpers import (
mode_test,
get_ocid
)
def release_tender(tender, prefix):
""" returns Release object created from `tender` with ocid `prefix` """
date = tender.get('dateModified', '... | from .models import (
Release,
ReleasePackage,
Record,
RecordPackage
)
from .schema import Tender
from .helpers import (
mode_test,
get_ocid
)
def release_tender(tender, prefix):
""" returns Release object created from `tender` with ocid `prefix` """
date = tender.get('dateModified', '... | Update helpers for generating releases | Update helpers for generating releases
| Python | apache-2.0 | yshalenyk/openprocurement.ocds.export,yshalenyk/openprocurement.ocds.export,yshalenyk/ocds.export | from .models import (
Release,
ReleasePackage,
Record,
RecordPackage
)
from .schema import Tender
from .helpers import (
mode_test,
get_ocid
)
def release_tender(tender, prefix):
""" returns Release object created from `tender` with ocid `prefix` """
date = tender.get('dateModified', '... | from .models import (
Release,
ReleasePackage,
Record,
RecordPackage
)
from .schema import Tender
from .helpers import (
mode_test,
get_ocid
)
def release_tender(tender, prefix):
""" returns Release object created from `tender` with ocid `prefix` """
date = tender.get('dateModified', '... | <commit_before>from .models import (
Release,
ReleasePackage,
Record,
RecordPackage
)
from .schema import Tender
from .helpers import (
mode_test,
get_ocid
)
def release_tender(tender, prefix):
""" returns Release object created from `tender` with ocid `prefix` """
date = tender.get('d... | from .models import (
Release,
ReleasePackage,
Record,
RecordPackage
)
from .schema import Tender
from .helpers import (
mode_test,
get_ocid
)
def release_tender(tender, prefix):
""" returns Release object created from `tender` with ocid `prefix` """
date = tender.get('dateModified', '... | from .models import (
Release,
ReleasePackage,
Record,
RecordPackage
)
from .schema import Tender
from .helpers import (
mode_test,
get_ocid
)
def release_tender(tender, prefix):
""" returns Release object created from `tender` with ocid `prefix` """
date = tender.get('dateModified', '... | <commit_before>from .models import (
Release,
ReleasePackage,
Record,
RecordPackage
)
from .schema import Tender
from .helpers import (
mode_test,
get_ocid
)
def release_tender(tender, prefix):
""" returns Release object created from `tender` with ocid `prefix` """
date = tender.get('d... |
fb3abf0d1cf27d23c78dd8101dd0c54cf589c2ef | corehq/apps/locations/resources/v0_6.py | corehq/apps/locations/resources/v0_6.py | from corehq.apps.api.resources.auth import RequirePermissionAuthentication
from corehq.apps.locations.models import SQLLocation
from corehq.apps.users.models import HqPermissions
from corehq.apps.locations.resources import v0_5
class LocationResource(v0_5.LocationResource):
resource_name = 'location'
class ... | from corehq.apps.api.resources.auth import RequirePermissionAuthentication
from corehq.apps.locations.models import SQLLocation
from corehq.apps.users.models import HqPermissions
from corehq.apps.locations.resources import v0_5
class LocationResource(v0_5.LocationResource):
resource_name = 'location'
class ... | Use objects manager that automatically filters out archived forms | Use objects manager that automatically filters out archived forms
Co-authored-by: Ethan Soergel <c1732a0c832c5c8cbfae77286e6475129315f488@users.noreply.github.com> | Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | from corehq.apps.api.resources.auth import RequirePermissionAuthentication
from corehq.apps.locations.models import SQLLocation
from corehq.apps.users.models import HqPermissions
from corehq.apps.locations.resources import v0_5
class LocationResource(v0_5.LocationResource):
resource_name = 'location'
class ... | from corehq.apps.api.resources.auth import RequirePermissionAuthentication
from corehq.apps.locations.models import SQLLocation
from corehq.apps.users.models import HqPermissions
from corehq.apps.locations.resources import v0_5
class LocationResource(v0_5.LocationResource):
resource_name = 'location'
class ... | <commit_before>from corehq.apps.api.resources.auth import RequirePermissionAuthentication
from corehq.apps.locations.models import SQLLocation
from corehq.apps.users.models import HqPermissions
from corehq.apps.locations.resources import v0_5
class LocationResource(v0_5.LocationResource):
resource_name = 'locati... | from corehq.apps.api.resources.auth import RequirePermissionAuthentication
from corehq.apps.locations.models import SQLLocation
from corehq.apps.users.models import HqPermissions
from corehq.apps.locations.resources import v0_5
class LocationResource(v0_5.LocationResource):
resource_name = 'location'
class ... | from corehq.apps.api.resources.auth import RequirePermissionAuthentication
from corehq.apps.locations.models import SQLLocation
from corehq.apps.users.models import HqPermissions
from corehq.apps.locations.resources import v0_5
class LocationResource(v0_5.LocationResource):
resource_name = 'location'
class ... | <commit_before>from corehq.apps.api.resources.auth import RequirePermissionAuthentication
from corehq.apps.locations.models import SQLLocation
from corehq.apps.users.models import HqPermissions
from corehq.apps.locations.resources import v0_5
class LocationResource(v0_5.LocationResource):
resource_name = 'locati... |
8c6d68bcf9f3f6932ea22bbe0ce0944a3cd20662 | class4/exercise5.py | class4/exercise5.py | # Use Netmiko to enter into configuration mode on pynet-rtr2. Also use Netmiko to verify your state (i.e. that you are currently in configuration mode).
from getpass import getpass
import time
from netmiko import ConnectHandler
password = getpass()
pynet_rtr2 = {'device_type': 'cisco_ios', 'ip': '50.76.53.27', 'usern... | # Use Netmiko to enter into configuration mode on pynet-rtr2.
# Also use Netmiko to verify your state (i.e. that you are currently in configuration mode).
from getpass import getpass
import time
from netmiko import ConnectHandler
password = getpass()
pynet_rtr2 = {'device_type': 'cisco_ios', 'ip': '50.76.53.27', 'use... | Use Netmiko to enter into configuration mode on pynet-rtr2. Also use Netmiko to verify your state (i.e. that you are currently in configuration mode). | Use Netmiko to enter into configuration mode on pynet-rtr2. Also use Netmiko to verify your state (i.e. that you are currently in configuration mode).
| Python | apache-2.0 | linkdebian/pynet_course | # Use Netmiko to enter into configuration mode on pynet-rtr2. Also use Netmiko to verify your state (i.e. that you are currently in configuration mode).
from getpass import getpass
import time
from netmiko import ConnectHandler
password = getpass()
pynet_rtr2 = {'device_type': 'cisco_ios', 'ip': '50.76.53.27', 'usern... | # Use Netmiko to enter into configuration mode on pynet-rtr2.
# Also use Netmiko to verify your state (i.e. that you are currently in configuration mode).
from getpass import getpass
import time
from netmiko import ConnectHandler
password = getpass()
pynet_rtr2 = {'device_type': 'cisco_ios', 'ip': '50.76.53.27', 'use... | <commit_before># Use Netmiko to enter into configuration mode on pynet-rtr2. Also use Netmiko to verify your state (i.e. that you are currently in configuration mode).
from getpass import getpass
import time
from netmiko import ConnectHandler
password = getpass()
pynet_rtr2 = {'device_type': 'cisco_ios', 'ip': '50.76... | # Use Netmiko to enter into configuration mode on pynet-rtr2.
# Also use Netmiko to verify your state (i.e. that you are currently in configuration mode).
from getpass import getpass
import time
from netmiko import ConnectHandler
password = getpass()
pynet_rtr2 = {'device_type': 'cisco_ios', 'ip': '50.76.53.27', 'use... | # Use Netmiko to enter into configuration mode on pynet-rtr2. Also use Netmiko to verify your state (i.e. that you are currently in configuration mode).
from getpass import getpass
import time
from netmiko import ConnectHandler
password = getpass()
pynet_rtr2 = {'device_type': 'cisco_ios', 'ip': '50.76.53.27', 'usern... | <commit_before># Use Netmiko to enter into configuration mode on pynet-rtr2. Also use Netmiko to verify your state (i.e. that you are currently in configuration mode).
from getpass import getpass
import time
from netmiko import ConnectHandler
password = getpass()
pynet_rtr2 = {'device_type': 'cisco_ios', 'ip': '50.76... |
577e2a03c15e4e489d0df4c3c2a2bea8b9aa54b6 | fluent_utils/softdeps/any_urlfield.py | fluent_utils/softdeps/any_urlfield.py | """
Optional integration with django-any-urlfield
"""
from __future__ import absolute_import
from django.db import models
from fluent_utils.django_compat import is_installed
if is_installed('any_urlfield'):
from any_urlfield.models import AnyUrlField as BaseUrlField
else:
BaseUrlField = models.URLField
# s... | """
Optional integration with django-any-urlfield
"""
from __future__ import absolute_import
from django.db import models
from fluent_utils.django_compat import is_installed
if is_installed('any_urlfield'):
from any_urlfield.models import AnyUrlField as BaseUrlField
else:
BaseUrlField = models.URLField
# s... | Fix AnyUrlField migration issue on Django 1.11. | Fix AnyUrlField migration issue on Django 1.11.
| Python | apache-2.0 | edoburu/django-fluent-utils | """
Optional integration with django-any-urlfield
"""
from __future__ import absolute_import
from django.db import models
from fluent_utils.django_compat import is_installed
if is_installed('any_urlfield'):
from any_urlfield.models import AnyUrlField as BaseUrlField
else:
BaseUrlField = models.URLField
# s... | """
Optional integration with django-any-urlfield
"""
from __future__ import absolute_import
from django.db import models
from fluent_utils.django_compat import is_installed
if is_installed('any_urlfield'):
from any_urlfield.models import AnyUrlField as BaseUrlField
else:
BaseUrlField = models.URLField
# s... | <commit_before>"""
Optional integration with django-any-urlfield
"""
from __future__ import absolute_import
from django.db import models
from fluent_utils.django_compat import is_installed
if is_installed('any_urlfield'):
from any_urlfield.models import AnyUrlField as BaseUrlField
else:
BaseUrlField = models... | """
Optional integration with django-any-urlfield
"""
from __future__ import absolute_import
from django.db import models
from fluent_utils.django_compat import is_installed
if is_installed('any_urlfield'):
from any_urlfield.models import AnyUrlField as BaseUrlField
else:
BaseUrlField = models.URLField
# s... | """
Optional integration with django-any-urlfield
"""
from __future__ import absolute_import
from django.db import models
from fluent_utils.django_compat import is_installed
if is_installed('any_urlfield'):
from any_urlfield.models import AnyUrlField as BaseUrlField
else:
BaseUrlField = models.URLField
# s... | <commit_before>"""
Optional integration with django-any-urlfield
"""
from __future__ import absolute_import
from django.db import models
from fluent_utils.django_compat import is_installed
if is_installed('any_urlfield'):
from any_urlfield.models import AnyUrlField as BaseUrlField
else:
BaseUrlField = models... |
d981b34dc18236cf857d1249629b6437005e073f | openmc/capi/__init__.py | openmc/capi/__init__.py | """
This module provides bindings to C functions defined by OpenMC shared library.
When the :mod:`openmc` package is imported, the OpenMC shared library is
automatically loaded. Calls to the OpenMC library can then be via functions or
objects in the :mod:`openmc.capi` subpackage, for example:
.. code-block:: python
... | """
This module provides bindings to C functions defined by OpenMC shared library.
When the :mod:`openmc` package is imported, the OpenMC shared library is
automatically loaded. Calls to the OpenMC library can then be via functions or
objects in the :mod:`openmc.capi` subpackage, for example:
.. code-block:: python
... | Remove FutureWarning for capi import | Remove FutureWarning for capi import
| Python | mit | mit-crpg/openmc,shikhar413/openmc,smharper/openmc,amandalund/openmc,amandalund/openmc,wbinventor/openmc,walshjon/openmc,amandalund/openmc,paulromano/openmc,mit-crpg/openmc,walshjon/openmc,paulromano/openmc,liangjg/openmc,mit-crpg/openmc,johnnyliu27/openmc,amandalund/openmc,walshjon/openmc,shikhar413/openmc,shikhar413/o... | """
This module provides bindings to C functions defined by OpenMC shared library.
When the :mod:`openmc` package is imported, the OpenMC shared library is
automatically loaded. Calls to the OpenMC library can then be via functions or
objects in the :mod:`openmc.capi` subpackage, for example:
.. code-block:: python
... | """
This module provides bindings to C functions defined by OpenMC shared library.
When the :mod:`openmc` package is imported, the OpenMC shared library is
automatically loaded. Calls to the OpenMC library can then be via functions or
objects in the :mod:`openmc.capi` subpackage, for example:
.. code-block:: python
... | <commit_before>"""
This module provides bindings to C functions defined by OpenMC shared library.
When the :mod:`openmc` package is imported, the OpenMC shared library is
automatically loaded. Calls to the OpenMC library can then be via functions or
objects in the :mod:`openmc.capi` subpackage, for example:
.. code-bl... | """
This module provides bindings to C functions defined by OpenMC shared library.
When the :mod:`openmc` package is imported, the OpenMC shared library is
automatically loaded. Calls to the OpenMC library can then be via functions or
objects in the :mod:`openmc.capi` subpackage, for example:
.. code-block:: python
... | """
This module provides bindings to C functions defined by OpenMC shared library.
When the :mod:`openmc` package is imported, the OpenMC shared library is
automatically loaded. Calls to the OpenMC library can then be via functions or
objects in the :mod:`openmc.capi` subpackage, for example:
.. code-block:: python
... | <commit_before>"""
This module provides bindings to C functions defined by OpenMC shared library.
When the :mod:`openmc` package is imported, the OpenMC shared library is
automatically loaded. Calls to the OpenMC library can then be via functions or
objects in the :mod:`openmc.capi` subpackage, for example:
.. code-bl... |
56f27099a8f7be39a6d8848a9378af6ed48f528f | bongo/apps/frontend/tests/templatetags_tests.py | bongo/apps/frontend/tests/templatetags_tests.py | from django.test import TestCase
from django.conf import settings
from django.template import Context, Template
from bongo.apps.bongo.tests import factories
def render_template(string, context=None):
context = Context(context) if context else None
return Template(string).render(context)
class TemplateTagsTe... | from django.test import TestCase
from django.conf import settings
from django.utils.html import escape
from django.template import Context, Template
from bongo.apps.bongo.tests import factories
def render_template(string, context=None):
context = Context(context) if context else None
return Template(string).r... | Fix broken test (not the intermittent one, this was just a dumb thing) | Fix broken test (not the intermittent one, this was just a dumb thing)
| Python | mit | BowdoinOrient/bongo,BowdoinOrient/bongo,BowdoinOrient/bongo,BowdoinOrient/bongo | from django.test import TestCase
from django.conf import settings
from django.template import Context, Template
from bongo.apps.bongo.tests import factories
def render_template(string, context=None):
context = Context(context) if context else None
return Template(string).render(context)
class TemplateTagsTe... | from django.test import TestCase
from django.conf import settings
from django.utils.html import escape
from django.template import Context, Template
from bongo.apps.bongo.tests import factories
def render_template(string, context=None):
context = Context(context) if context else None
return Template(string).r... | <commit_before>from django.test import TestCase
from django.conf import settings
from django.template import Context, Template
from bongo.apps.bongo.tests import factories
def render_template(string, context=None):
context = Context(context) if context else None
return Template(string).render(context)
class... | from django.test import TestCase
from django.conf import settings
from django.utils.html import escape
from django.template import Context, Template
from bongo.apps.bongo.tests import factories
def render_template(string, context=None):
context = Context(context) if context else None
return Template(string).r... | from django.test import TestCase
from django.conf import settings
from django.template import Context, Template
from bongo.apps.bongo.tests import factories
def render_template(string, context=None):
context = Context(context) if context else None
return Template(string).render(context)
class TemplateTagsTe... | <commit_before>from django.test import TestCase
from django.conf import settings
from django.template import Context, Template
from bongo.apps.bongo.tests import factories
def render_template(string, context=None):
context = Context(context) if context else None
return Template(string).render(context)
class... |
347f4440deb7b0cce9fd0dcb6e26dbda340f437c | planetstack/openstack_observer/steps/sync_images.py | planetstack/openstack_observer/steps/sync_images.py | import os
import base64
from django.db.models import F, Q
from xos.config import Config
from observer.openstacksyncstep import OpenStackSyncStep
from core.models.image import Image
class SyncImages(OpenStackSyncStep):
provides=[Image]
requested_interval=0
observes=Image
def fetch_pending(self, deleted... | import os
import base64
from django.db.models import F, Q
from xos.config import Config
from observer.openstacksyncstep import OpenStackSyncStep
from core.models.image import Image
class SyncImages(OpenStackSyncStep):
provides=[Image]
requested_interval=0
observes=Image
def fetch_pending(self, deleted... | Check the existence of the images_path | Check the existence of the images_path
ERROR:planetstack.log:[Errno 2] No such file or directory: '/opt/xos/images' BEG TRACEBACK
Traceback (most recent call last):
File "/opt/xos/observer/event_loop.py", line 349, in sync
failed_objects = sync_step(failed=list(self.failed_step_objects), deletion=deletion)
Fil... | Python | apache-2.0 | jermowery/xos,cboling/xos,cboling/xos,xmaruto/mcord,jermowery/xos,cboling/xos,xmaruto/mcord,xmaruto/mcord,xmaruto/mcord,jermowery/xos,cboling/xos,jermowery/xos,cboling/xos | import os
import base64
from django.db.models import F, Q
from xos.config import Config
from observer.openstacksyncstep import OpenStackSyncStep
from core.models.image import Image
class SyncImages(OpenStackSyncStep):
provides=[Image]
requested_interval=0
observes=Image
def fetch_pending(self, deleted... | import os
import base64
from django.db.models import F, Q
from xos.config import Config
from observer.openstacksyncstep import OpenStackSyncStep
from core.models.image import Image
class SyncImages(OpenStackSyncStep):
provides=[Image]
requested_interval=0
observes=Image
def fetch_pending(self, deleted... | <commit_before>import os
import base64
from django.db.models import F, Q
from xos.config import Config
from observer.openstacksyncstep import OpenStackSyncStep
from core.models.image import Image
class SyncImages(OpenStackSyncStep):
provides=[Image]
requested_interval=0
observes=Image
def fetch_pendin... | import os
import base64
from django.db.models import F, Q
from xos.config import Config
from observer.openstacksyncstep import OpenStackSyncStep
from core.models.image import Image
class SyncImages(OpenStackSyncStep):
provides=[Image]
requested_interval=0
observes=Image
def fetch_pending(self, deleted... | import os
import base64
from django.db.models import F, Q
from xos.config import Config
from observer.openstacksyncstep import OpenStackSyncStep
from core.models.image import Image
class SyncImages(OpenStackSyncStep):
provides=[Image]
requested_interval=0
observes=Image
def fetch_pending(self, deleted... | <commit_before>import os
import base64
from django.db.models import F, Q
from xos.config import Config
from observer.openstacksyncstep import OpenStackSyncStep
from core.models.image import Image
class SyncImages(OpenStackSyncStep):
provides=[Image]
requested_interval=0
observes=Image
def fetch_pendin... |
7805f06446f31ac483ba219147f4053661e86647 | penchy/jobs/__init__.py | penchy/jobs/__init__.py | from job import *
from jvms import *
from tools import *
from filters import *
from workloads import *
# all job elements that are interesting for the user have to be enumerated here
__all__ = [
# job
'Job',
'JVMNodeConfiguration',
# jvm
'JVM',
'ValgrindJVM',
# filters
# workloads
... | from job import *
import jvms
import tools
import filters
import workloads
from dependency import Edge
JVM = jvms.JVM
# all job elements that are interesting for the user have to be enumerated here
__all__ = [
# job
'Job',
'JVMNodeConfiguration',
# dependencies
'Edge',
# jvms
'JVM',
#... | Restructure jobs interface to match job description docs. | Restructure jobs interface to match job description docs.
Signed-off-by: Michael Markert <5eb998b7ac86da375651a4cd767b88c9dad25896@googlemail.com>
| Python | mit | fhirschmann/penchy,fhirschmann/penchy | from job import *
from jvms import *
from tools import *
from filters import *
from workloads import *
# all job elements that are interesting for the user have to be enumerated here
__all__ = [
# job
'Job',
'JVMNodeConfiguration',
# jvm
'JVM',
'ValgrindJVM',
# filters
# workloads
... | from job import *
import jvms
import tools
import filters
import workloads
from dependency import Edge
JVM = jvms.JVM
# all job elements that are interesting for the user have to be enumerated here
__all__ = [
# job
'Job',
'JVMNodeConfiguration',
# dependencies
'Edge',
# jvms
'JVM',
#... | <commit_before>from job import *
from jvms import *
from tools import *
from filters import *
from workloads import *
# all job elements that are interesting for the user have to be enumerated here
__all__ = [
# job
'Job',
'JVMNodeConfiguration',
# jvm
'JVM',
'ValgrindJVM',
# filters
#... | from job import *
import jvms
import tools
import filters
import workloads
from dependency import Edge
JVM = jvms.JVM
# all job elements that are interesting for the user have to be enumerated here
__all__ = [
# job
'Job',
'JVMNodeConfiguration',
# dependencies
'Edge',
# jvms
'JVM',
#... | from job import *
from jvms import *
from tools import *
from filters import *
from workloads import *
# all job elements that are interesting for the user have to be enumerated here
__all__ = [
# job
'Job',
'JVMNodeConfiguration',
# jvm
'JVM',
'ValgrindJVM',
# filters
# workloads
... | <commit_before>from job import *
from jvms import *
from tools import *
from filters import *
from workloads import *
# all job elements that are interesting for the user have to be enumerated here
__all__ = [
# job
'Job',
'JVMNodeConfiguration',
# jvm
'JVM',
'ValgrindJVM',
# filters
#... |
e95d3b9a9075481f22938dd0c577606947900568 | jumpgate/common/aes.py | jumpgate/common/aes.py | import base64
from Crypto import Cipher
from jumpgate import config
BLOCK_SIZE = 32
PADDING = '#'
def pad(string):
return string + (BLOCK_SIZE - len(string) % BLOCK_SIZE) * PADDING
def create_cypher():
return Cipher.AES.new(pad(config.CONF['secret_key']))
def encode_aes(string):
cipher = create_cy... | import base64
from Crypto.Cipher import AES
from jumpgate import config
BLOCK_SIZE = 32
PADDING = '#'
def pad(string):
return string + (BLOCK_SIZE - len(string) % BLOCK_SIZE) * PADDING
def create_cypher():
return AES.new(pad(config.CONF['secret_key']))
def encode_aes(string):
cipher = create_cypher... | Adjust AES import a bit | Adjust AES import a bit
| Python | mit | softlayer/jumpgate,myxemhoho/mutil-cloud-manage-paltform,HOQTEC/MCP,wpf710/app-proxy,HOQTEC/MCP,softlayer/jumpgate,myxemhoho/mutil-cloud-manage-paltform,wpf710/app-proxy | import base64
from Crypto import Cipher
from jumpgate import config
BLOCK_SIZE = 32
PADDING = '#'
def pad(string):
return string + (BLOCK_SIZE - len(string) % BLOCK_SIZE) * PADDING
def create_cypher():
return Cipher.AES.new(pad(config.CONF['secret_key']))
def encode_aes(string):
cipher = create_cy... | import base64
from Crypto.Cipher import AES
from jumpgate import config
BLOCK_SIZE = 32
PADDING = '#'
def pad(string):
return string + (BLOCK_SIZE - len(string) % BLOCK_SIZE) * PADDING
def create_cypher():
return AES.new(pad(config.CONF['secret_key']))
def encode_aes(string):
cipher = create_cypher... | <commit_before>import base64
from Crypto import Cipher
from jumpgate import config
BLOCK_SIZE = 32
PADDING = '#'
def pad(string):
return string + (BLOCK_SIZE - len(string) % BLOCK_SIZE) * PADDING
def create_cypher():
return Cipher.AES.new(pad(config.CONF['secret_key']))
def encode_aes(string):
cip... | import base64
from Crypto.Cipher import AES
from jumpgate import config
BLOCK_SIZE = 32
PADDING = '#'
def pad(string):
return string + (BLOCK_SIZE - len(string) % BLOCK_SIZE) * PADDING
def create_cypher():
return AES.new(pad(config.CONF['secret_key']))
def encode_aes(string):
cipher = create_cypher... | import base64
from Crypto import Cipher
from jumpgate import config
BLOCK_SIZE = 32
PADDING = '#'
def pad(string):
return string + (BLOCK_SIZE - len(string) % BLOCK_SIZE) * PADDING
def create_cypher():
return Cipher.AES.new(pad(config.CONF['secret_key']))
def encode_aes(string):
cipher = create_cy... | <commit_before>import base64
from Crypto import Cipher
from jumpgate import config
BLOCK_SIZE = 32
PADDING = '#'
def pad(string):
return string + (BLOCK_SIZE - len(string) % BLOCK_SIZE) * PADDING
def create_cypher():
return Cipher.AES.new(pad(config.CONF['secret_key']))
def encode_aes(string):
cip... |
73f2c06ad1e94d8af34764640b89de5b3fba36c5 | cron_descriptor/GetText.py | cron_descriptor/GetText.py | # Copyright (C) 2016 Adam Schubert <adam.schubert@sg1-game.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Th... | # Copyright (C) 2016 Adam Schubert <adam.schubert@sg1-game.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Th... | Fix error on loading other languages | Fix error on loading other languages
| Python | mit | Salamek/cron-descriptor,Salamek/cron-descriptor | # Copyright (C) 2016 Adam Schubert <adam.schubert@sg1-game.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Th... | # Copyright (C) 2016 Adam Schubert <adam.schubert@sg1-game.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Th... | <commit_before># Copyright (C) 2016 Adam Schubert <adam.schubert@sg1-game.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ... | # Copyright (C) 2016 Adam Schubert <adam.schubert@sg1-game.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Th... | # Copyright (C) 2016 Adam Schubert <adam.schubert@sg1-game.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Th... | <commit_before># Copyright (C) 2016 Adam Schubert <adam.schubert@sg1-game.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ... |
4d2d940d672c6af14916cf4c4cecf2a5bb6de4ef | libqtile/layout/hybridlayoutdemo.py | libqtile/layout/hybridlayoutdemo.py | from base import SubLayout, Rect
from sublayouts import VerticalStack, Floating
from subtile import SubTile
class HybridLayoutDemo(SubLayout):
def _init_sublayouts(self):
class TopWindow(VerticalStack):
def filter_windows(self, windows):
windows = [w for w in windows if w.name ... | from base import SubLayout, Rect
from sublayouts import VerticalStack, Floating
from subtile import SubTile
class HybridLayoutDemo(SubLayout):
def _init_sublayouts(self):
class TopWindow(VerticalStack):
def filter_windows(self, windows):
windows = [w for w in windows if w.name ... | Add request_rectange to HybridLayoutDemo - no clue why this never was here, but it stops it actually working | Add request_rectange to HybridLayoutDemo - no clue why this never was here, but it stops it actually working
| Python | mit | dequis/qtile,farebord/qtile,de-vri-es/qtile,StephenBarnes/qtile,ramnes/qtile,ramnes/qtile,flacjacket/qtile,tych0/qtile,farebord/qtile,kseistrup/qtile,kopchik/qtile,aniruddhkanojia/qtile,kiniou/qtile,jdowner/qtile,kynikos/qtile,soulchainer/qtile,soulchainer/qtile,kynikos/qtile,andrewyoung1991/qtile,jdowner/qtile,apinsar... | from base import SubLayout, Rect
from sublayouts import VerticalStack, Floating
from subtile import SubTile
class HybridLayoutDemo(SubLayout):
def _init_sublayouts(self):
class TopWindow(VerticalStack):
def filter_windows(self, windows):
windows = [w for w in windows if w.name ... | from base import SubLayout, Rect
from sublayouts import VerticalStack, Floating
from subtile import SubTile
class HybridLayoutDemo(SubLayout):
def _init_sublayouts(self):
class TopWindow(VerticalStack):
def filter_windows(self, windows):
windows = [w for w in windows if w.name ... | <commit_before>from base import SubLayout, Rect
from sublayouts import VerticalStack, Floating
from subtile import SubTile
class HybridLayoutDemo(SubLayout):
def _init_sublayouts(self):
class TopWindow(VerticalStack):
def filter_windows(self, windows):
windows = [w for w in win... | from base import SubLayout, Rect
from sublayouts import VerticalStack, Floating
from subtile import SubTile
class HybridLayoutDemo(SubLayout):
def _init_sublayouts(self):
class TopWindow(VerticalStack):
def filter_windows(self, windows):
windows = [w for w in windows if w.name ... | from base import SubLayout, Rect
from sublayouts import VerticalStack, Floating
from subtile import SubTile
class HybridLayoutDemo(SubLayout):
def _init_sublayouts(self):
class TopWindow(VerticalStack):
def filter_windows(self, windows):
windows = [w for w in windows if w.name ... | <commit_before>from base import SubLayout, Rect
from sublayouts import VerticalStack, Floating
from subtile import SubTile
class HybridLayoutDemo(SubLayout):
def _init_sublayouts(self):
class TopWindow(VerticalStack):
def filter_windows(self, windows):
windows = [w for w in win... |
521ebf29990de4d997c90f4168ea300d75776cfc | components/utilities.py | components/utilities.py | """Utilities for general operations."""
def IsNumeric(num_str):
try:
val = int(num_str)
except ValueError:
return False
else:
return True
| """Utilities for general operations."""
def IsNumeric(num_str):
try:
val = int(num_str)
except ValueError:
return False
else:
return True
def GuaranteeUnicode(obj):
if type(obj) == unicode:
return obj
elif type(obj) == str:
return unicode(obj, "utf-8")
... | Add GuranteeUnicode function which always returns a unicode object | Add GuranteeUnicode function which always returns a unicode object
| Python | mit | lnishan/SQLGitHub | """Utilities for general operations."""
def IsNumeric(num_str):
try:
val = int(num_str)
except ValueError:
return False
else:
return True
Add GuranteeUnicode function which always returns a unicode object | """Utilities for general operations."""
def IsNumeric(num_str):
try:
val = int(num_str)
except ValueError:
return False
else:
return True
def GuaranteeUnicode(obj):
if type(obj) == unicode:
return obj
elif type(obj) == str:
return unicode(obj, "utf-8")
... | <commit_before>"""Utilities for general operations."""
def IsNumeric(num_str):
try:
val = int(num_str)
except ValueError:
return False
else:
return True
<commit_msg>Add GuranteeUnicode function which always returns a unicode object<commit_after> | """Utilities for general operations."""
def IsNumeric(num_str):
try:
val = int(num_str)
except ValueError:
return False
else:
return True
def GuaranteeUnicode(obj):
if type(obj) == unicode:
return obj
elif type(obj) == str:
return unicode(obj, "utf-8")
... | """Utilities for general operations."""
def IsNumeric(num_str):
try:
val = int(num_str)
except ValueError:
return False
else:
return True
Add GuranteeUnicode function which always returns a unicode object"""Utilities for general operations."""
def IsNumeric(num_str):
try:
... | <commit_before>"""Utilities for general operations."""
def IsNumeric(num_str):
try:
val = int(num_str)
except ValueError:
return False
else:
return True
<commit_msg>Add GuranteeUnicode function which always returns a unicode object<commit_after>"""Utilities for general operations."... |
fce5152e8d902821c9b521402667ac87f9e9a17b | checks.d/system_core.py | checks.d/system_core.py | import psutil
from checks import AgentCheck
class SystemCore(AgentCheck):
def check(self, instance):
cpu_times = psutil.cpu_times(percpu=True)
for i, cpu in enumerate(cpu_times):
for key, value in cpu._asdict().iteritems():
self.rate(
"system.core.{... | import psutil
from checks import AgentCheck
class SystemCore(AgentCheck):
def check(self, instance):
cpu_times = psutil.cpu_times(percpu=True)
self.gauge("system.core.count", len(cpu_times))
for i, cpu in enumerate(cpu_times):
for key, value in cpu._asdict().iteritems():
... | Send the core count as a metric | Send the core count as a metric
| Python | bsd-3-clause | truthbk/dd-agent,tebriel/dd-agent,indeedops/dd-agent,mderomph-coolblue/dd-agent,packetloop/dd-agent,PagerDuty/dd-agent,joelvanvelden/dd-agent,indeedops/dd-agent,jyogi/purvar-agent,manolama/dd-agent,tebriel/dd-agent,packetloop/dd-agent,amalakar/dd-agent,a20012251/dd-agent,jraede/dd-agent,AniruddhaSAtre/dd-agent,brettlan... | import psutil
from checks import AgentCheck
class SystemCore(AgentCheck):
def check(self, instance):
cpu_times = psutil.cpu_times(percpu=True)
for i, cpu in enumerate(cpu_times):
for key, value in cpu._asdict().iteritems():
self.rate(
"system.core.{... | import psutil
from checks import AgentCheck
class SystemCore(AgentCheck):
def check(self, instance):
cpu_times = psutil.cpu_times(percpu=True)
self.gauge("system.core.count", len(cpu_times))
for i, cpu in enumerate(cpu_times):
for key, value in cpu._asdict().iteritems():
... | <commit_before>import psutil
from checks import AgentCheck
class SystemCore(AgentCheck):
def check(self, instance):
cpu_times = psutil.cpu_times(percpu=True)
for i, cpu in enumerate(cpu_times):
for key, value in cpu._asdict().iteritems():
self.rate(
... | import psutil
from checks import AgentCheck
class SystemCore(AgentCheck):
def check(self, instance):
cpu_times = psutil.cpu_times(percpu=True)
self.gauge("system.core.count", len(cpu_times))
for i, cpu in enumerate(cpu_times):
for key, value in cpu._asdict().iteritems():
... | import psutil
from checks import AgentCheck
class SystemCore(AgentCheck):
def check(self, instance):
cpu_times = psutil.cpu_times(percpu=True)
for i, cpu in enumerate(cpu_times):
for key, value in cpu._asdict().iteritems():
self.rate(
"system.core.{... | <commit_before>import psutil
from checks import AgentCheck
class SystemCore(AgentCheck):
def check(self, instance):
cpu_times = psutil.cpu_times(percpu=True)
for i, cpu in enumerate(cpu_times):
for key, value in cpu._asdict().iteritems():
self.rate(
... |
f7d792d684e6c74f4a3e508bc29bbe2bacc458f0 | cms/templatetags/cms.py | cms/templatetags/cms.py | from django import template
from django.utils.dateformat import format
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter(is_safe=True)
def iso_time_tag(date):
""" Returns an ISO date, with the year tagged in a say-no-more span.
This allows the date representation t... | from django import template
from django.utils.dateformat import format
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter(is_safe=True)
def iso_time_tag(date):
""" Returns an ISO date, with the year tagged in a say-no-more span.
This allows the date representation t... | Fix order of date parts | Fix order of date parts | Python | apache-2.0 | willingc/pythondotorg,lebronhkh/pythondotorg,malemburg/pythondotorg,SujaySKumar/pythondotorg,python/pythondotorg,python/pythondotorg,willingc/pythondotorg,demvher/pythondotorg,SujaySKumar/pythondotorg,lsk112233/Clone-test-repo,Mariatta/pythondotorg,ahua/pythondotorg,malemburg/pythondotorg,lepture/pythondotorg,Mariatta/... | from django import template
from django.utils.dateformat import format
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter(is_safe=True)
def iso_time_tag(date):
""" Returns an ISO date, with the year tagged in a say-no-more span.
This allows the date representation t... | from django import template
from django.utils.dateformat import format
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter(is_safe=True)
def iso_time_tag(date):
""" Returns an ISO date, with the year tagged in a say-no-more span.
This allows the date representation t... | <commit_before>from django import template
from django.utils.dateformat import format
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter(is_safe=True)
def iso_time_tag(date):
""" Returns an ISO date, with the year tagged in a say-no-more span.
This allows the date r... | from django import template
from django.utils.dateformat import format
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter(is_safe=True)
def iso_time_tag(date):
""" Returns an ISO date, with the year tagged in a say-no-more span.
This allows the date representation t... | from django import template
from django.utils.dateformat import format
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter(is_safe=True)
def iso_time_tag(date):
""" Returns an ISO date, with the year tagged in a say-no-more span.
This allows the date representation t... | <commit_before>from django import template
from django.utils.dateformat import format
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter(is_safe=True)
def iso_time_tag(date):
""" Returns an ISO date, with the year tagged in a say-no-more span.
This allows the date r... |
5e2281a9d8f7585cb7c35d6fed2d4db5236a3ef2 | cmis_web/__openerp__.py | cmis_web/__openerp__.py | # -*- coding: utf-8 -*-
# Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': "CMIS Web interface",
'summary': """
Embeddable CMIS Web components""",
'author': 'ACSONE SA/NV',
'website': "http://alfodoo.org",
'catego... | # -*- coding: utf-8 -*-
# Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': "CMIS Web interface",
'summary': """
Embeddable CMIS Web components""",
'author': 'ACSONE SA/NV',
'website': "http://alfodoo.org",
'catego... | Fix dependency cmis_web -> cmis_field | Fix dependency cmis_web -> cmis_field
| Python | agpl-3.0 | acsone/alfodoo,acsone/alfodoo,acsone/alfodoo | # -*- coding: utf-8 -*-
# Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': "CMIS Web interface",
'summary': """
Embeddable CMIS Web components""",
'author': 'ACSONE SA/NV',
'website': "http://alfodoo.org",
'catego... | # -*- coding: utf-8 -*-
# Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': "CMIS Web interface",
'summary': """
Embeddable CMIS Web components""",
'author': 'ACSONE SA/NV',
'website': "http://alfodoo.org",
'catego... | <commit_before># -*- coding: utf-8 -*-
# Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': "CMIS Web interface",
'summary': """
Embeddable CMIS Web components""",
'author': 'ACSONE SA/NV',
'website': "http://alfodoo.or... | # -*- coding: utf-8 -*-
# Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': "CMIS Web interface",
'summary': """
Embeddable CMIS Web components""",
'author': 'ACSONE SA/NV',
'website': "http://alfodoo.org",
'catego... | # -*- coding: utf-8 -*-
# Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': "CMIS Web interface",
'summary': """
Embeddable CMIS Web components""",
'author': 'ACSONE SA/NV',
'website': "http://alfodoo.org",
'catego... | <commit_before># -*- coding: utf-8 -*-
# Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': "CMIS Web interface",
'summary': """
Embeddable CMIS Web components""",
'author': 'ACSONE SA/NV',
'website': "http://alfodoo.or... |
0b37e71972d067bd06bfab1d7a0c0f47badefb17 | scout/markers/models.py | scout/markers/models.py | from django.db import models
from model_utils import Choices
MARKER_COLOURS = Choices(
('blue', 'Blue'),
('red', 'Red')
)
class Marker(models.Model):
name = models.CharField(max_length=255)
address = models.TextField(blank=True)
lat = models.CharField(max_length=255, blank=True)
long = model... | from django.db import models
from model_utils import Choices
MARKER_COLOURS = Choices(
('blue', 'Blue'),
('red', 'Red')
)
class Marker(models.Model):
name = models.CharField(max_length=255)
address = models.TextField(blank=True)
lat = models.CharField(max_length=255, blank=True)
long = model... | Return the address from the marker. | Return the address from the marker.
| Python | mit | meizon/scout,meizon/scout,meizon/scout,meizon/scout | from django.db import models
from model_utils import Choices
MARKER_COLOURS = Choices(
('blue', 'Blue'),
('red', 'Red')
)
class Marker(models.Model):
name = models.CharField(max_length=255)
address = models.TextField(blank=True)
lat = models.CharField(max_length=255, blank=True)
long = model... | from django.db import models
from model_utils import Choices
MARKER_COLOURS = Choices(
('blue', 'Blue'),
('red', 'Red')
)
class Marker(models.Model):
name = models.CharField(max_length=255)
address = models.TextField(blank=True)
lat = models.CharField(max_length=255, blank=True)
long = model... | <commit_before>from django.db import models
from model_utils import Choices
MARKER_COLOURS = Choices(
('blue', 'Blue'),
('red', 'Red')
)
class Marker(models.Model):
name = models.CharField(max_length=255)
address = models.TextField(blank=True)
lat = models.CharField(max_length=255, blank=True)
... | from django.db import models
from model_utils import Choices
MARKER_COLOURS = Choices(
('blue', 'Blue'),
('red', 'Red')
)
class Marker(models.Model):
name = models.CharField(max_length=255)
address = models.TextField(blank=True)
lat = models.CharField(max_length=255, blank=True)
long = model... | from django.db import models
from model_utils import Choices
MARKER_COLOURS = Choices(
('blue', 'Blue'),
('red', 'Red')
)
class Marker(models.Model):
name = models.CharField(max_length=255)
address = models.TextField(blank=True)
lat = models.CharField(max_length=255, blank=True)
long = model... | <commit_before>from django.db import models
from model_utils import Choices
MARKER_COLOURS = Choices(
('blue', 'Blue'),
('red', 'Red')
)
class Marker(models.Model):
name = models.CharField(max_length=255)
address = models.TextField(blank=True)
lat = models.CharField(max_length=255, blank=True)
... |
ce77cbeb6fcb71b49c669188b38e43fb75e4d729 | pyinfra_cli/__main__.py | pyinfra_cli/__main__.py | # pyinfra
# File: pyinfra_cli/__main__.py
# Desc: bootstrap stuff for the pyinfra CLI and provide it's entry point
import signal
import sys
import click
from colorama import init as colorama_init
from .legacy import run_main_with_legacy_arguments
from .main import cli, main
# Init colorama for Windows ANSI color ... | # pyinfra
# File: pyinfra_cli/__main__.py
# Desc: bootstrap stuff for the pyinfra CLI and provide it's entry point
import signal
import sys
import click
import gevent
from colorama import init as colorama_init
from .legacy import run_main_with_legacy_arguments
from .main import cli, main
# Init colorama for Windo... | Kill all running greenlets when ctrl+c (works a charm in Python 3, not so much in 2). | Kill all running greenlets when ctrl+c (works a charm in Python 3, not so much in 2).
| Python | mit | Fizzadar/pyinfra,Fizzadar/pyinfra | # pyinfra
# File: pyinfra_cli/__main__.py
# Desc: bootstrap stuff for the pyinfra CLI and provide it's entry point
import signal
import sys
import click
from colorama import init as colorama_init
from .legacy import run_main_with_legacy_arguments
from .main import cli, main
# Init colorama for Windows ANSI color ... | # pyinfra
# File: pyinfra_cli/__main__.py
# Desc: bootstrap stuff for the pyinfra CLI and provide it's entry point
import signal
import sys
import click
import gevent
from colorama import init as colorama_init
from .legacy import run_main_with_legacy_arguments
from .main import cli, main
# Init colorama for Windo... | <commit_before># pyinfra
# File: pyinfra_cli/__main__.py
# Desc: bootstrap stuff for the pyinfra CLI and provide it's entry point
import signal
import sys
import click
from colorama import init as colorama_init
from .legacy import run_main_with_legacy_arguments
from .main import cli, main
# Init colorama for Wind... | # pyinfra
# File: pyinfra_cli/__main__.py
# Desc: bootstrap stuff for the pyinfra CLI and provide it's entry point
import signal
import sys
import click
import gevent
from colorama import init as colorama_init
from .legacy import run_main_with_legacy_arguments
from .main import cli, main
# Init colorama for Windo... | # pyinfra
# File: pyinfra_cli/__main__.py
# Desc: bootstrap stuff for the pyinfra CLI and provide it's entry point
import signal
import sys
import click
from colorama import init as colorama_init
from .legacy import run_main_with_legacy_arguments
from .main import cli, main
# Init colorama for Windows ANSI color ... | <commit_before># pyinfra
# File: pyinfra_cli/__main__.py
# Desc: bootstrap stuff for the pyinfra CLI and provide it's entry point
import signal
import sys
import click
from colorama import init as colorama_init
from .legacy import run_main_with_legacy_arguments
from .main import cli, main
# Init colorama for Wind... |
299aa432b3183e9db418f0735511330763c8141b | botbot/fileinfo.py | botbot/fileinfo.py | """File information"""
import os
import time
import pwd
import stat
import hashlib
from .config import CONFIG
def get_file_hash(path):
"""Get md5 hash of a file"""
def reader(fo):
"""Generator which feeds bytes to the md5 hasher"""
while True:
b = fo.read(128)
if len(b)... | """File information"""
import os
import pwd
import hashlib
from .config import CONFIG
def reader(fo):
"""Generator which feeds bytes to the md5 hasher"""
while True:
b = fo.read(128)
if len(b) > 0:
yield b
else:
raise StopIteration()
def get_file_hash(path):
... | Move reader() generator out of file hasher | Move reader() generator out of file hasher
| Python | mit | jackstanek/BotBot,jackstanek/BotBot | """File information"""
import os
import time
import pwd
import stat
import hashlib
from .config import CONFIG
def get_file_hash(path):
"""Get md5 hash of a file"""
def reader(fo):
"""Generator which feeds bytes to the md5 hasher"""
while True:
b = fo.read(128)
if len(b)... | """File information"""
import os
import pwd
import hashlib
from .config import CONFIG
def reader(fo):
"""Generator which feeds bytes to the md5 hasher"""
while True:
b = fo.read(128)
if len(b) > 0:
yield b
else:
raise StopIteration()
def get_file_hash(path):
... | <commit_before>"""File information"""
import os
import time
import pwd
import stat
import hashlib
from .config import CONFIG
def get_file_hash(path):
"""Get md5 hash of a file"""
def reader(fo):
"""Generator which feeds bytes to the md5 hasher"""
while True:
b = fo.read(128)
... | """File information"""
import os
import pwd
import hashlib
from .config import CONFIG
def reader(fo):
"""Generator which feeds bytes to the md5 hasher"""
while True:
b = fo.read(128)
if len(b) > 0:
yield b
else:
raise StopIteration()
def get_file_hash(path):
... | """File information"""
import os
import time
import pwd
import stat
import hashlib
from .config import CONFIG
def get_file_hash(path):
"""Get md5 hash of a file"""
def reader(fo):
"""Generator which feeds bytes to the md5 hasher"""
while True:
b = fo.read(128)
if len(b)... | <commit_before>"""File information"""
import os
import time
import pwd
import stat
import hashlib
from .config import CONFIG
def get_file_hash(path):
"""Get md5 hash of a file"""
def reader(fo):
"""Generator which feeds bytes to the md5 hasher"""
while True:
b = fo.read(128)
... |
405e34b7573e3af78051741feb32e7589e49dfb9 | controllers/main.py | controllers/main.py | # -*- coding: utf-8 -*-
import logging
import simplejson
import os
import base64
import openerp
from ..helpers.zebra import zebra
class PrintController(openerp.addons.web.http.Controller):
_cp_path = '/printer_proxy'
@openerp.addons.web.http.jsonrequest
def output(self, request, format="epl2", **kwargs):
... | # -*- coding: utf-8 -*-
import logging
import simplejson
import os
import base64
import openerp
from ..helpers.zebra import zebra
class PrintController(openerp.addons.web.http.Controller):
_cp_path = '/printer_proxy'
@openerp.addons.web.http.jsonrequest
def output(self, request, format="epl2", **kwargs):
... | Remove line that causes a form feed upon every call to PrintController.output_epl. | Remove line that causes a form feed upon every call to PrintController.output_epl.
| Python | agpl-3.0 | ryepdx/printer_proxy,ryepdx/printer_proxy | # -*- coding: utf-8 -*-
import logging
import simplejson
import os
import base64
import openerp
from ..helpers.zebra import zebra
class PrintController(openerp.addons.web.http.Controller):
_cp_path = '/printer_proxy'
@openerp.addons.web.http.jsonrequest
def output(self, request, format="epl2", **kwargs):
... | # -*- coding: utf-8 -*-
import logging
import simplejson
import os
import base64
import openerp
from ..helpers.zebra import zebra
class PrintController(openerp.addons.web.http.Controller):
_cp_path = '/printer_proxy'
@openerp.addons.web.http.jsonrequest
def output(self, request, format="epl2", **kwargs):
... | <commit_before># -*- coding: utf-8 -*-
import logging
import simplejson
import os
import base64
import openerp
from ..helpers.zebra import zebra
class PrintController(openerp.addons.web.http.Controller):
_cp_path = '/printer_proxy'
@openerp.addons.web.http.jsonrequest
def output(self, request, format="epl... | # -*- coding: utf-8 -*-
import logging
import simplejson
import os
import base64
import openerp
from ..helpers.zebra import zebra
class PrintController(openerp.addons.web.http.Controller):
_cp_path = '/printer_proxy'
@openerp.addons.web.http.jsonrequest
def output(self, request, format="epl2", **kwargs):
... | # -*- coding: utf-8 -*-
import logging
import simplejson
import os
import base64
import openerp
from ..helpers.zebra import zebra
class PrintController(openerp.addons.web.http.Controller):
_cp_path = '/printer_proxy'
@openerp.addons.web.http.jsonrequest
def output(self, request, format="epl2", **kwargs):
... | <commit_before># -*- coding: utf-8 -*-
import logging
import simplejson
import os
import base64
import openerp
from ..helpers.zebra import zebra
class PrintController(openerp.addons.web.http.Controller):
_cp_path = '/printer_proxy'
@openerp.addons.web.http.jsonrequest
def output(self, request, format="epl... |
6dbc6caf4af75610cae75d4473fef25f6b405232 | pymysql/tests/test_nextset.py | pymysql/tests/test_nextset.py | from pymysql.tests import base
from pymysql import util
try:
import unittest2 as unittest
except ImportError:
import unittest
class TestNextset(base.PyMySQLTestCase):
def setUp(self):
super(TestNextset, self).setUp()
self.con = self.connections[0]
def test_nextset(self):
cur... | from pymysql.tests import base
from pymysql import util
try:
import unittest2 as unittest
except ImportError:
import unittest
class TestNextset(base.PyMySQLTestCase):
def setUp(self):
super(TestNextset, self).setUp()
self.con = self.connections[0]
def test_nextset(self):
cur... | Add comment about SScursor and nextset. | Add comment about SScursor and nextset.
| Python | mit | nju520/PyMySQL,methane/PyMySQL,aio-libs/aiomysql,pymysql/pymysql,pulsar314/Tornado-MySQL,yeyinzhu3211/PyMySQL,wraziens/PyMySQL,wraziens/PyMySQL,jheld/PyMySQL,mosquito/Tornado-MySQL,lzedl/PyMySQL,Ting-y/PyMySQL,jwjohns/PyMySQL,PyMySQL/Tornado-MySQL,modulexcite/PyMySQL,xjzhou/PyMySQL,anson-tang/PyMySQL,Geoion/Tornado-MyS... | from pymysql.tests import base
from pymysql import util
try:
import unittest2 as unittest
except ImportError:
import unittest
class TestNextset(base.PyMySQLTestCase):
def setUp(self):
super(TestNextset, self).setUp()
self.con = self.connections[0]
def test_nextset(self):
cur... | from pymysql.tests import base
from pymysql import util
try:
import unittest2 as unittest
except ImportError:
import unittest
class TestNextset(base.PyMySQLTestCase):
def setUp(self):
super(TestNextset, self).setUp()
self.con = self.connections[0]
def test_nextset(self):
cur... | <commit_before>from pymysql.tests import base
from pymysql import util
try:
import unittest2 as unittest
except ImportError:
import unittest
class TestNextset(base.PyMySQLTestCase):
def setUp(self):
super(TestNextset, self).setUp()
self.con = self.connections[0]
def test_nextset(sel... | from pymysql.tests import base
from pymysql import util
try:
import unittest2 as unittest
except ImportError:
import unittest
class TestNextset(base.PyMySQLTestCase):
def setUp(self):
super(TestNextset, self).setUp()
self.con = self.connections[0]
def test_nextset(self):
cur... | from pymysql.tests import base
from pymysql import util
try:
import unittest2 as unittest
except ImportError:
import unittest
class TestNextset(base.PyMySQLTestCase):
def setUp(self):
super(TestNextset, self).setUp()
self.con = self.connections[0]
def test_nextset(self):
cur... | <commit_before>from pymysql.tests import base
from pymysql import util
try:
import unittest2 as unittest
except ImportError:
import unittest
class TestNextset(base.PyMySQLTestCase):
def setUp(self):
super(TestNextset, self).setUp()
self.con = self.connections[0]
def test_nextset(sel... |
465b34b2252a4a516aba8f8ea6adac13980ba39c | config/test/__init__.py | config/test/__init__.py | from SCons.Script import *
def run_tests(env):
import shlex
import subprocess
import sys
subprocess.call(shlex.split(env.get('TEST_COMMAND')))
sys.exit(0)
def generate(env):
import os
cmd = 'python tests/testHarness -C tests --diff-failed --view-failed ' \
'--view-unfiltered --... | from SCons.Script import *
def run_tests(env):
import shlex
import subprocess
import sys
sys.exit(subprocess.call(shlex.split(env.get('TEST_COMMAND'))))
def generate(env):
import os
cmd = 'python tests/testHarness -C tests --diff-failed --view-failed ' \
'--view-unfiltered --save-f... | Return exit code when running tests | Return exit code when running tests
| Python | lgpl-2.1 | CauldronDevelopmentLLC/cbang,CauldronDevelopmentLLC/cbang,CauldronDevelopmentLLC/cbang,CauldronDevelopmentLLC/cbang | from SCons.Script import *
def run_tests(env):
import shlex
import subprocess
import sys
subprocess.call(shlex.split(env.get('TEST_COMMAND')))
sys.exit(0)
def generate(env):
import os
cmd = 'python tests/testHarness -C tests --diff-failed --view-failed ' \
'--view-unfiltered --... | from SCons.Script import *
def run_tests(env):
import shlex
import subprocess
import sys
sys.exit(subprocess.call(shlex.split(env.get('TEST_COMMAND'))))
def generate(env):
import os
cmd = 'python tests/testHarness -C tests --diff-failed --view-failed ' \
'--view-unfiltered --save-f... | <commit_before>from SCons.Script import *
def run_tests(env):
import shlex
import subprocess
import sys
subprocess.call(shlex.split(env.get('TEST_COMMAND')))
sys.exit(0)
def generate(env):
import os
cmd = 'python tests/testHarness -C tests --diff-failed --view-failed ' \
'--vie... | from SCons.Script import *
def run_tests(env):
import shlex
import subprocess
import sys
sys.exit(subprocess.call(shlex.split(env.get('TEST_COMMAND'))))
def generate(env):
import os
cmd = 'python tests/testHarness -C tests --diff-failed --view-failed ' \
'--view-unfiltered --save-f... | from SCons.Script import *
def run_tests(env):
import shlex
import subprocess
import sys
subprocess.call(shlex.split(env.get('TEST_COMMAND')))
sys.exit(0)
def generate(env):
import os
cmd = 'python tests/testHarness -C tests --diff-failed --view-failed ' \
'--view-unfiltered --... | <commit_before>from SCons.Script import *
def run_tests(env):
import shlex
import subprocess
import sys
subprocess.call(shlex.split(env.get('TEST_COMMAND')))
sys.exit(0)
def generate(env):
import os
cmd = 'python tests/testHarness -C tests --diff-failed --view-failed ' \
'--vie... |
1b066f793c6c3f8f8b1e9df2659922e2a5dbaf3a | challenge_5/python/alexbotello/FindTheDifference.py | challenge_5/python/alexbotello/FindTheDifference.py | from collections import Counter
class Solution:
def findTheDifference(self, s, t):
s = dict(Counter(s))
t = dict(Counter(t))
for key in t.keys():
if key not in s.keys():
s[key] = 0
if s[key] - t[key] <= -1:
return key
if __name__ ... | from collections import Counter
class Solution:
def findTheDifference(self, s, t):
s = Counter(s)
t = Counter(t)
for key in t.keys():
if s[key] != t[key]:
return key
if __name__ == '__main__':
test_case = Solution()
s, t = [input() for _ in range(2)]
pr... | Refactor to remove nested for loop | Refactor to remove nested for loop
| Python | mit | mindm/2017Challenges,mindm/2017Challenges,mindm/2017Challenges,mindm/2017Challenges,mindm/2017Challenges,mindm/2017Challenges,mindm/2017Challenges,mindm/2017Challenges,mindm/2017Challenges,mindm/2017Challenges,mindm/2017Challenges,mindm/2017Challenges,mindm/2017Challenges,mindm/2017Challenges | from collections import Counter
class Solution:
def findTheDifference(self, s, t):
s = dict(Counter(s))
t = dict(Counter(t))
for key in t.keys():
if key not in s.keys():
s[key] = 0
if s[key] - t[key] <= -1:
return key
if __name__ ... | from collections import Counter
class Solution:
def findTheDifference(self, s, t):
s = Counter(s)
t = Counter(t)
for key in t.keys():
if s[key] != t[key]:
return key
if __name__ == '__main__':
test_case = Solution()
s, t = [input() for _ in range(2)]
pr... | <commit_before>from collections import Counter
class Solution:
def findTheDifference(self, s, t):
s = dict(Counter(s))
t = dict(Counter(t))
for key in t.keys():
if key not in s.keys():
s[key] = 0
if s[key] - t[key] <= -1:
return key... | from collections import Counter
class Solution:
def findTheDifference(self, s, t):
s = Counter(s)
t = Counter(t)
for key in t.keys():
if s[key] != t[key]:
return key
if __name__ == '__main__':
test_case = Solution()
s, t = [input() for _ in range(2)]
pr... | from collections import Counter
class Solution:
def findTheDifference(self, s, t):
s = dict(Counter(s))
t = dict(Counter(t))
for key in t.keys():
if key not in s.keys():
s[key] = 0
if s[key] - t[key] <= -1:
return key
if __name__ ... | <commit_before>from collections import Counter
class Solution:
def findTheDifference(self, s, t):
s = dict(Counter(s))
t = dict(Counter(t))
for key in t.keys():
if key not in s.keys():
s[key] = 0
if s[key] - t[key] <= -1:
return key... |
2b8869bb508f4fb67867385f3058372bde664ca5 | CheckProxy/CheckProxy.py | CheckProxy/CheckProxy.py | import discord
import requests
from discord.ext import commands
class checkproxy:
"""Cog for proxy checking"""
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True)
async def checkproxy(self, ctx, proxy):
"""Checks the provided proxy."""
p = proxy
... | import discord
import requests
from discord.ext import commands
class checkproxy:
"""Cog for proxy checking"""
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True)
async def checkproxy(self, ctx, proxy):
"""Checks the provided proxy."""
p = proxy
... | Add 5s timeout to checkproxy (in an effort to prevent bot hanging | Add 5s timeout to checkproxy (in an effort to prevent bot hanging
| Python | agpl-3.0 | FrostTheFox/RocketMap-cogs | import discord
import requests
from discord.ext import commands
class checkproxy:
"""Cog for proxy checking"""
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True)
async def checkproxy(self, ctx, proxy):
"""Checks the provided proxy."""
p = proxy
... | import discord
import requests
from discord.ext import commands
class checkproxy:
"""Cog for proxy checking"""
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True)
async def checkproxy(self, ctx, proxy):
"""Checks the provided proxy."""
p = proxy
... | <commit_before>import discord
import requests
from discord.ext import commands
class checkproxy:
"""Cog for proxy checking"""
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True)
async def checkproxy(self, ctx, proxy):
"""Checks the provided proxy."""
... | import discord
import requests
from discord.ext import commands
class checkproxy:
"""Cog for proxy checking"""
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True)
async def checkproxy(self, ctx, proxy):
"""Checks the provided proxy."""
p = proxy
... | import discord
import requests
from discord.ext import commands
class checkproxy:
"""Cog for proxy checking"""
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True)
async def checkproxy(self, ctx, proxy):
"""Checks the provided proxy."""
p = proxy
... | <commit_before>import discord
import requests
from discord.ext import commands
class checkproxy:
"""Cog for proxy checking"""
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True)
async def checkproxy(self, ctx, proxy):
"""Checks the provided proxy."""
... |
85fd83e57173aaf00e61169812e3929d5d946896 | health_check/contrib/celery/backends.py | health_check/contrib/celery/backends.py | from datetime import datetime, timedelta
from django.conf import settings
from health_check.backends import BaseHealthCheckBackend
from health_check.exceptions import (
ServiceReturnedUnexpectedResult, ServiceUnavailable
)
from .tasks import add
class CeleryHealthCheck(BaseHealthCheckBackend):
def check_st... | from datetime import timedelta
from django.conf import settings
from django.utils import timezone
from health_check.backends import BaseHealthCheckBackend
from health_check.exceptions import (
ServiceReturnedUnexpectedResult, ServiceUnavailable
)
from .tasks import add
class CeleryHealthCheck(BaseHealthCheckBa... | Send timezone-aware datetime for task expiry | Send timezone-aware datetime for task expiry
Needed because this task would consistantly fail if django is set to a
later-than-UTC timezone, due to celery thinking the task expired the instant
it's sent.
| Python | mit | KristianOellegaard/django-health-check,KristianOellegaard/django-health-check | from datetime import datetime, timedelta
from django.conf import settings
from health_check.backends import BaseHealthCheckBackend
from health_check.exceptions import (
ServiceReturnedUnexpectedResult, ServiceUnavailable
)
from .tasks import add
class CeleryHealthCheck(BaseHealthCheckBackend):
def check_st... | from datetime import timedelta
from django.conf import settings
from django.utils import timezone
from health_check.backends import BaseHealthCheckBackend
from health_check.exceptions import (
ServiceReturnedUnexpectedResult, ServiceUnavailable
)
from .tasks import add
class CeleryHealthCheck(BaseHealthCheckBa... | <commit_before>from datetime import datetime, timedelta
from django.conf import settings
from health_check.backends import BaseHealthCheckBackend
from health_check.exceptions import (
ServiceReturnedUnexpectedResult, ServiceUnavailable
)
from .tasks import add
class CeleryHealthCheck(BaseHealthCheckBackend):
... | from datetime import timedelta
from django.conf import settings
from django.utils import timezone
from health_check.backends import BaseHealthCheckBackend
from health_check.exceptions import (
ServiceReturnedUnexpectedResult, ServiceUnavailable
)
from .tasks import add
class CeleryHealthCheck(BaseHealthCheckBa... | from datetime import datetime, timedelta
from django.conf import settings
from health_check.backends import BaseHealthCheckBackend
from health_check.exceptions import (
ServiceReturnedUnexpectedResult, ServiceUnavailable
)
from .tasks import add
class CeleryHealthCheck(BaseHealthCheckBackend):
def check_st... | <commit_before>from datetime import datetime, timedelta
from django.conf import settings
from health_check.backends import BaseHealthCheckBackend
from health_check.exceptions import (
ServiceReturnedUnexpectedResult, ServiceUnavailable
)
from .tasks import add
class CeleryHealthCheck(BaseHealthCheckBackend):
... |
6bc4f24c8bdd2be0875fba7cb98a81ff86caa5c3 | tests/behave/environment.py | tests/behave/environment.py | # -*- coding: utf-8 -*-
u"""
Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
This file is part of Toolium.
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/lic... | # -*- coding: utf-8 -*-
u"""
Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
This file is part of Toolium.
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/lic... | Add before_all method to set configuration files | Add before_all method to set configuration files
| Python | apache-2.0 | Telefonica/toolium-examples | # -*- coding: utf-8 -*-
u"""
Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
This file is part of Toolium.
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/lic... | # -*- coding: utf-8 -*-
u"""
Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
This file is part of Toolium.
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/lic... | <commit_before># -*- coding: utf-8 -*-
u"""
Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
This file is part of Toolium.
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... | # -*- coding: utf-8 -*-
u"""
Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
This file is part of Toolium.
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/lic... | # -*- coding: utf-8 -*-
u"""
Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
This file is part of Toolium.
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/lic... | <commit_before># -*- coding: utf-8 -*-
u"""
Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
This file is part of Toolium.
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... |
3d04ab5df773be611bbbf790196e587d0da3c5e4 | colored_logging.py | colored_logging.py | """ Formatter for the logging module, coloring terminal output according to error criticity. """
import enum
import logging
import sys
Colors = enum.Enum("Colors", ("RED", "GREEN", "YELLOW", "BLUE"))
LEVEL_COLOR_MAPPING = {logging.WARNING: Colors.YELLOW,
logging.ERROR: Colors.RED,
... | """ Formatter for the logging module, coloring terminal output according to error criticity. """
import enum
import logging
import sys
Colors = enum.Enum("Colors", ("RED", "GREEN", "YELLOW", "BLUE"))
LEVEL_COLOR_MAPPING = {logging.WARNING: Colors.YELLOW,
logging.ERROR: Colors.RED,
... | Disable colored logging for Windows | Disable colored logging for Windows
| Python | mpl-2.0 | desbma/sacad,desbma/sacad | """ Formatter for the logging module, coloring terminal output according to error criticity. """
import enum
import logging
import sys
Colors = enum.Enum("Colors", ("RED", "GREEN", "YELLOW", "BLUE"))
LEVEL_COLOR_MAPPING = {logging.WARNING: Colors.YELLOW,
logging.ERROR: Colors.RED,
... | """ Formatter for the logging module, coloring terminal output according to error criticity. """
import enum
import logging
import sys
Colors = enum.Enum("Colors", ("RED", "GREEN", "YELLOW", "BLUE"))
LEVEL_COLOR_MAPPING = {logging.WARNING: Colors.YELLOW,
logging.ERROR: Colors.RED,
... | <commit_before>""" Formatter for the logging module, coloring terminal output according to error criticity. """
import enum
import logging
import sys
Colors = enum.Enum("Colors", ("RED", "GREEN", "YELLOW", "BLUE"))
LEVEL_COLOR_MAPPING = {logging.WARNING: Colors.YELLOW,
logging.ERROR: Colors.R... | """ Formatter for the logging module, coloring terminal output according to error criticity. """
import enum
import logging
import sys
Colors = enum.Enum("Colors", ("RED", "GREEN", "YELLOW", "BLUE"))
LEVEL_COLOR_MAPPING = {logging.WARNING: Colors.YELLOW,
logging.ERROR: Colors.RED,
... | """ Formatter for the logging module, coloring terminal output according to error criticity. """
import enum
import logging
import sys
Colors = enum.Enum("Colors", ("RED", "GREEN", "YELLOW", "BLUE"))
LEVEL_COLOR_MAPPING = {logging.WARNING: Colors.YELLOW,
logging.ERROR: Colors.RED,
... | <commit_before>""" Formatter for the logging module, coloring terminal output according to error criticity. """
import enum
import logging
import sys
Colors = enum.Enum("Colors", ("RED", "GREEN", "YELLOW", "BLUE"))
LEVEL_COLOR_MAPPING = {logging.WARNING: Colors.YELLOW,
logging.ERROR: Colors.R... |
5383572c1cb21ae83aec422eda5aede0ed073438 | lib/ansiblelint/rules/NoFormattingInWhenRule.py | lib/ansiblelint/rules/NoFormattingInWhenRule.py | from ansiblelint import AnsibleLintRule
try:
from types import StringTypes
except ImportError:
# Python3 removed types.StringTypes
StringTypes = str,
class NoFormattingInWhenRule(AnsibleLintRule):
id = 'CINCH0001'
shortdesc = 'No Jinja2 in when'
description = '"when" lines should not include J... | from ansiblelint import AnsibleLintRule
try:
from types import StringTypes
except ImportError:
# Python3 removed types.StringTypes
StringTypes = str,
class NoFormattingInWhenRule(AnsibleLintRule):
id = 'ANSIBLE0019'
shortdesc = 'No Jinja2 in when'
description = '"when" lines should not include... | Update ID to match others | Update ID to match others
| Python | mit | dataxu/ansible-lint,MatrixCrawler/ansible-lint,willthames/ansible-lint | from ansiblelint import AnsibleLintRule
try:
from types import StringTypes
except ImportError:
# Python3 removed types.StringTypes
StringTypes = str,
class NoFormattingInWhenRule(AnsibleLintRule):
id = 'CINCH0001'
shortdesc = 'No Jinja2 in when'
description = '"when" lines should not include J... | from ansiblelint import AnsibleLintRule
try:
from types import StringTypes
except ImportError:
# Python3 removed types.StringTypes
StringTypes = str,
class NoFormattingInWhenRule(AnsibleLintRule):
id = 'ANSIBLE0019'
shortdesc = 'No Jinja2 in when'
description = '"when" lines should not include... | <commit_before>from ansiblelint import AnsibleLintRule
try:
from types import StringTypes
except ImportError:
# Python3 removed types.StringTypes
StringTypes = str,
class NoFormattingInWhenRule(AnsibleLintRule):
id = 'CINCH0001'
shortdesc = 'No Jinja2 in when'
description = '"when" lines shoul... | from ansiblelint import AnsibleLintRule
try:
from types import StringTypes
except ImportError:
# Python3 removed types.StringTypes
StringTypes = str,
class NoFormattingInWhenRule(AnsibleLintRule):
id = 'ANSIBLE0019'
shortdesc = 'No Jinja2 in when'
description = '"when" lines should not include... | from ansiblelint import AnsibleLintRule
try:
from types import StringTypes
except ImportError:
# Python3 removed types.StringTypes
StringTypes = str,
class NoFormattingInWhenRule(AnsibleLintRule):
id = 'CINCH0001'
shortdesc = 'No Jinja2 in when'
description = '"when" lines should not include J... | <commit_before>from ansiblelint import AnsibleLintRule
try:
from types import StringTypes
except ImportError:
# Python3 removed types.StringTypes
StringTypes = str,
class NoFormattingInWhenRule(AnsibleLintRule):
id = 'CINCH0001'
shortdesc = 'No Jinja2 in when'
description = '"when" lines shoul... |
d0f022f393152a6850f6f33f3b1ad88cc2492b24 | dockwidgets.py | dockwidgets.py | from PyQt5.QtWidgets import QDockWidget, QTreeView
class WorkerDockWidget(QDockWidget):
def __init__(self, title="Dock Widget", parent=None, flags=None):
super().__init__(title)
self.workerTree = QTreeView(self)
| from PyQt5.QtWidgets import QDockWidget, QTreeWidget, QWidget, QGridLayout, QFormLayout, QPushButton, QComboBox, QSizePolicy, QFrame
from PyQt5.QtCore import Qt
class WorkerDockWidget(QDockWidget):
def __init__(self):
super().__init__("Workers")
#self.setSizePolicy(QSizePolicy.Preferred, QSizePol... | Add some UI and logic for handling workers | Add some UI and logic for handling workers
| Python | mit | DrLuke/gpnshader | from PyQt5.QtWidgets import QDockWidget, QTreeView
class WorkerDockWidget(QDockWidget):
def __init__(self, title="Dock Widget", parent=None, flags=None):
super().__init__(title)
self.workerTree = QTreeView(self)
Add some UI and logic for handling workers | from PyQt5.QtWidgets import QDockWidget, QTreeWidget, QWidget, QGridLayout, QFormLayout, QPushButton, QComboBox, QSizePolicy, QFrame
from PyQt5.QtCore import Qt
class WorkerDockWidget(QDockWidget):
def __init__(self):
super().__init__("Workers")
#self.setSizePolicy(QSizePolicy.Preferred, QSizePol... | <commit_before>from PyQt5.QtWidgets import QDockWidget, QTreeView
class WorkerDockWidget(QDockWidget):
def __init__(self, title="Dock Widget", parent=None, flags=None):
super().__init__(title)
self.workerTree = QTreeView(self)
<commit_msg>Add some UI and logic for handling workers<commit_after> | from PyQt5.QtWidgets import QDockWidget, QTreeWidget, QWidget, QGridLayout, QFormLayout, QPushButton, QComboBox, QSizePolicy, QFrame
from PyQt5.QtCore import Qt
class WorkerDockWidget(QDockWidget):
def __init__(self):
super().__init__("Workers")
#self.setSizePolicy(QSizePolicy.Preferred, QSizePol... | from PyQt5.QtWidgets import QDockWidget, QTreeView
class WorkerDockWidget(QDockWidget):
def __init__(self, title="Dock Widget", parent=None, flags=None):
super().__init__(title)
self.workerTree = QTreeView(self)
Add some UI and logic for handling workersfrom PyQt5.QtWidgets import QDockWidget, ... | <commit_before>from PyQt5.QtWidgets import QDockWidget, QTreeView
class WorkerDockWidget(QDockWidget):
def __init__(self, title="Dock Widget", parent=None, flags=None):
super().__init__(title)
self.workerTree = QTreeView(self)
<commit_msg>Add some UI and logic for handling workers<commit_after>... |
29110323469d20ff1e481ab2267812afd8e0a3a4 | more/chameleon/main.py | more/chameleon/main.py | import morepath
import chameleon
class ChameleonApp(morepath.App):
pass
@ChameleonApp.setting_section(section='chameleon')
def get_setting_section():
return {'auto_reload': False}
@ChameleonApp.template_engine(extension='.pt')
def get_chameleon_render(path, original_render, settings):
config = setting... | import os
import morepath
import chameleon
class ChameleonApp(morepath.App):
pass
@ChameleonApp.setting_section(section='chameleon')
def get_setting_section():
return {'auto_reload': False}
@ChameleonApp.template_engine(extension='.pt')
def get_chameleon_render(name, original_render, registry, search_path... | Adjust to modifications in Morepath. But now to enable real explicit file support. | Adjust to modifications in Morepath. But now to enable real
explicit file support.
| Python | bsd-3-clause | morepath/more.chameleon | import morepath
import chameleon
class ChameleonApp(morepath.App):
pass
@ChameleonApp.setting_section(section='chameleon')
def get_setting_section():
return {'auto_reload': False}
@ChameleonApp.template_engine(extension='.pt')
def get_chameleon_render(path, original_render, settings):
config = setting... | import os
import morepath
import chameleon
class ChameleonApp(morepath.App):
pass
@ChameleonApp.setting_section(section='chameleon')
def get_setting_section():
return {'auto_reload': False}
@ChameleonApp.template_engine(extension='.pt')
def get_chameleon_render(name, original_render, registry, search_path... | <commit_before>import morepath
import chameleon
class ChameleonApp(morepath.App):
pass
@ChameleonApp.setting_section(section='chameleon')
def get_setting_section():
return {'auto_reload': False}
@ChameleonApp.template_engine(extension='.pt')
def get_chameleon_render(path, original_render, settings):
c... | import os
import morepath
import chameleon
class ChameleonApp(morepath.App):
pass
@ChameleonApp.setting_section(section='chameleon')
def get_setting_section():
return {'auto_reload': False}
@ChameleonApp.template_engine(extension='.pt')
def get_chameleon_render(name, original_render, registry, search_path... | import morepath
import chameleon
class ChameleonApp(morepath.App):
pass
@ChameleonApp.setting_section(section='chameleon')
def get_setting_section():
return {'auto_reload': False}
@ChameleonApp.template_engine(extension='.pt')
def get_chameleon_render(path, original_render, settings):
config = setting... | <commit_before>import morepath
import chameleon
class ChameleonApp(morepath.App):
pass
@ChameleonApp.setting_section(section='chameleon')
def get_setting_section():
return {'auto_reload': False}
@ChameleonApp.template_engine(extension='.pt')
def get_chameleon_render(path, original_render, settings):
c... |
1cf5660d9661646b3d8731986d7581ad27582d77 | djclick/params.py | djclick/params.py | import click
from django.core.exceptions import ObjectDoesNotExist
class ModelInstance(click.ParamType):
def __init__(self, qs):
from django.db import models
if isinstance(qs, type) and issubclass(qs, models.Model):
qs = qs.objects.all()
self.qs = qs
self.name = '{}.{... | import click
from django.core.exceptions import ObjectDoesNotExist
class ModelInstance(click.ParamType):
def __init__(self, qs):
from django.db import models
if isinstance(qs, type) and issubclass(qs, models.Model):
qs = qs.objects.all()
self.qs = qs
self.name = '{}.{... | Fix failing test on Python 3 | Fix failing test on Python 3 | Python | mit | GaretJax/django-click | import click
from django.core.exceptions import ObjectDoesNotExist
class ModelInstance(click.ParamType):
def __init__(self, qs):
from django.db import models
if isinstance(qs, type) and issubclass(qs, models.Model):
qs = qs.objects.all()
self.qs = qs
self.name = '{}.{... | import click
from django.core.exceptions import ObjectDoesNotExist
class ModelInstance(click.ParamType):
def __init__(self, qs):
from django.db import models
if isinstance(qs, type) and issubclass(qs, models.Model):
qs = qs.objects.all()
self.qs = qs
self.name = '{}.{... | <commit_before>import click
from django.core.exceptions import ObjectDoesNotExist
class ModelInstance(click.ParamType):
def __init__(self, qs):
from django.db import models
if isinstance(qs, type) and issubclass(qs, models.Model):
qs = qs.objects.all()
self.qs = qs
se... | import click
from django.core.exceptions import ObjectDoesNotExist
class ModelInstance(click.ParamType):
def __init__(self, qs):
from django.db import models
if isinstance(qs, type) and issubclass(qs, models.Model):
qs = qs.objects.all()
self.qs = qs
self.name = '{}.{... | import click
from django.core.exceptions import ObjectDoesNotExist
class ModelInstance(click.ParamType):
def __init__(self, qs):
from django.db import models
if isinstance(qs, type) and issubclass(qs, models.Model):
qs = qs.objects.all()
self.qs = qs
self.name = '{}.{... | <commit_before>import click
from django.core.exceptions import ObjectDoesNotExist
class ModelInstance(click.ParamType):
def __init__(self, qs):
from django.db import models
if isinstance(qs, type) and issubclass(qs, models.Model):
qs = qs.objects.all()
self.qs = qs
se... |
20279983ce2817bf7e75490d85823126ca2c1aed | pande_gas/features/basic.py | pande_gas/features/basic.py | """
Basic molecular features.
"""
__author__ = "Steven Kearnes"
__copyright__ = "Copyright 2014, Stanford University"
__license__ = "BSD 3-clause"
from rdkit.Chem import Descriptors
from pande_gas.features import Featurizer
class MolecularWeight(Featurizer):
"""
Molecular weight.
"""
name = ['mw', ... | """
Basic molecular features.
"""
__author__ = "Steven Kearnes"
__copyright__ = "Copyright 2014, Stanford University"
__license__ = "BSD 3-clause"
from rdkit.Chem import Descriptors
from pande_gas.features import Featurizer
class MolecularWeight(Featurizer):
"""
Molecular weight.
"""
name = ['mw', ... | Rename descriptors -> rval to avoid confusion | Rename descriptors -> rval to avoid confusion
| Python | bsd-3-clause | rbharath/pande-gas,rbharath/pande-gas | """
Basic molecular features.
"""
__author__ = "Steven Kearnes"
__copyright__ = "Copyright 2014, Stanford University"
__license__ = "BSD 3-clause"
from rdkit.Chem import Descriptors
from pande_gas.features import Featurizer
class MolecularWeight(Featurizer):
"""
Molecular weight.
"""
name = ['mw', ... | """
Basic molecular features.
"""
__author__ = "Steven Kearnes"
__copyright__ = "Copyright 2014, Stanford University"
__license__ = "BSD 3-clause"
from rdkit.Chem import Descriptors
from pande_gas.features import Featurizer
class MolecularWeight(Featurizer):
"""
Molecular weight.
"""
name = ['mw', ... | <commit_before>"""
Basic molecular features.
"""
__author__ = "Steven Kearnes"
__copyright__ = "Copyright 2014, Stanford University"
__license__ = "BSD 3-clause"
from rdkit.Chem import Descriptors
from pande_gas.features import Featurizer
class MolecularWeight(Featurizer):
"""
Molecular weight.
"""
... | """
Basic molecular features.
"""
__author__ = "Steven Kearnes"
__copyright__ = "Copyright 2014, Stanford University"
__license__ = "BSD 3-clause"
from rdkit.Chem import Descriptors
from pande_gas.features import Featurizer
class MolecularWeight(Featurizer):
"""
Molecular weight.
"""
name = ['mw', ... | """
Basic molecular features.
"""
__author__ = "Steven Kearnes"
__copyright__ = "Copyright 2014, Stanford University"
__license__ = "BSD 3-clause"
from rdkit.Chem import Descriptors
from pande_gas.features import Featurizer
class MolecularWeight(Featurizer):
"""
Molecular weight.
"""
name = ['mw', ... | <commit_before>"""
Basic molecular features.
"""
__author__ = "Steven Kearnes"
__copyright__ = "Copyright 2014, Stanford University"
__license__ = "BSD 3-clause"
from rdkit.Chem import Descriptors
from pande_gas.features import Featurizer
class MolecularWeight(Featurizer):
"""
Molecular weight.
"""
... |
04efe96b9ee16b650970d7ddf0ce3a3dd82d55ea | forms.py | forms.py | from flask_wtf import Form
from wtforms.fields import StringField, HiddenField, BooleanField, DecimalField
from wtforms import validators
from flask import request
class DonateForm(Form):
first_name = StringField(u'First',
[validators.required(message="Your first name is required.")])
last_name = Str... | from flask_wtf import Form
from wtforms.fields import StringField, HiddenField, BooleanField, DecimalField
from wtforms import validators
from flask import request
class DonateForm(Form):
first_name = StringField(u'First',
[validators.required(message="Your first name is required.")])
last_name = Str... | Add minimal amount of 1 to form validation | Add minimal amount of 1 to form validation
| Python | mit | MinnPost/salesforce-stripe,texastribune/salesforce-stripe,MinnPost/salesforce-stripe,texastribune/salesforce-stripe,MinnPost/salesforce-stripe,texastribune/salesforce-stripe | from flask_wtf import Form
from wtforms.fields import StringField, HiddenField, BooleanField, DecimalField
from wtforms import validators
from flask import request
class DonateForm(Form):
first_name = StringField(u'First',
[validators.required(message="Your first name is required.")])
last_name = Str... | from flask_wtf import Form
from wtforms.fields import StringField, HiddenField, BooleanField, DecimalField
from wtforms import validators
from flask import request
class DonateForm(Form):
first_name = StringField(u'First',
[validators.required(message="Your first name is required.")])
last_name = Str... | <commit_before>from flask_wtf import Form
from wtforms.fields import StringField, HiddenField, BooleanField, DecimalField
from wtforms import validators
from flask import request
class DonateForm(Form):
first_name = StringField(u'First',
[validators.required(message="Your first name is required.")])
... | from flask_wtf import Form
from wtforms.fields import StringField, HiddenField, BooleanField, DecimalField
from wtforms import validators
from flask import request
class DonateForm(Form):
first_name = StringField(u'First',
[validators.required(message="Your first name is required.")])
last_name = Str... | from flask_wtf import Form
from wtforms.fields import StringField, HiddenField, BooleanField, DecimalField
from wtforms import validators
from flask import request
class DonateForm(Form):
first_name = StringField(u'First',
[validators.required(message="Your first name is required.")])
last_name = Str... | <commit_before>from flask_wtf import Form
from wtforms.fields import StringField, HiddenField, BooleanField, DecimalField
from wtforms import validators
from flask import request
class DonateForm(Form):
first_name = StringField(u'First',
[validators.required(message="Your first name is required.")])
... |
4d0b5d54ecfde43dc898da03d5481f19943a65e1 | renzongxian/0000/0000.py | renzongxian/0000/0000.py | # Source:https://github.com/Show-Me-the-Code/show-me-the-code
# Author:renzongxian
# Date:2014-11-30
# Python 3.4
"""
第 0000 题:将你的 QQ 头像(或者微博头像)右上角加上红色的数字,类似于微信未读信息数量那种提示效果
"""
from PIL import Image, ImageDraw, ImageFont
import sys
def add_num_to_img(file_path):
im = Image.open(file_path)
im_draw = ImageD... | # Source:https://github.com/Show-Me-the-Code/show-me-the-code
# Author:renzongxian
# Date:2014-11-30
# Python 3.4
"""
第 0000 题:将你的 QQ 头像(或者微博头像)右上角加上红色的数字,类似于微信未读信息数量那种提示效果
"""
from PIL import Image, ImageDraw, ImageFont
import sys
def add_num_to_img(file_path):
im = Image.open(file_path)
im_draw = ImageD... | Rename the result image to avoid overwriting the original image | Rename the result image to avoid overwriting the original image
| Python | mit | starlightme/python,haiyangd/python-show-me-the-code-,EricSekyere/python,ZSeaPeng/python,wangjun/python,yangzilong1986/python,ZuoGuocai/python,luoxufeiyan/python,agogear/python-1,sravaniaitha/python,dominjune/python,ZuoGuocai/python,luoxufeiyan/python,xchaoinfo/python,Ph0enixxx/python,sravaniaitha/python,karnikamit/pyth... | # Source:https://github.com/Show-Me-the-Code/show-me-the-code
# Author:renzongxian
# Date:2014-11-30
# Python 3.4
"""
第 0000 题:将你的 QQ 头像(或者微博头像)右上角加上红色的数字,类似于微信未读信息数量那种提示效果
"""
from PIL import Image, ImageDraw, ImageFont
import sys
def add_num_to_img(file_path):
im = Image.open(file_path)
im_draw = ImageD... | # Source:https://github.com/Show-Me-the-Code/show-me-the-code
# Author:renzongxian
# Date:2014-11-30
# Python 3.4
"""
第 0000 题:将你的 QQ 头像(或者微博头像)右上角加上红色的数字,类似于微信未读信息数量那种提示效果
"""
from PIL import Image, ImageDraw, ImageFont
import sys
def add_num_to_img(file_path):
im = Image.open(file_path)
im_draw = ImageD... | <commit_before># Source:https://github.com/Show-Me-the-Code/show-me-the-code
# Author:renzongxian
# Date:2014-11-30
# Python 3.4
"""
第 0000 题:将你的 QQ 头像(或者微博头像)右上角加上红色的数字,类似于微信未读信息数量那种提示效果
"""
from PIL import Image, ImageDraw, ImageFont
import sys
def add_num_to_img(file_path):
im = Image.open(file_path)
i... | # Source:https://github.com/Show-Me-the-Code/show-me-the-code
# Author:renzongxian
# Date:2014-11-30
# Python 3.4
"""
第 0000 题:将你的 QQ 头像(或者微博头像)右上角加上红色的数字,类似于微信未读信息数量那种提示效果
"""
from PIL import Image, ImageDraw, ImageFont
import sys
def add_num_to_img(file_path):
im = Image.open(file_path)
im_draw = ImageD... | # Source:https://github.com/Show-Me-the-Code/show-me-the-code
# Author:renzongxian
# Date:2014-11-30
# Python 3.4
"""
第 0000 题:将你的 QQ 头像(或者微博头像)右上角加上红色的数字,类似于微信未读信息数量那种提示效果
"""
from PIL import Image, ImageDraw, ImageFont
import sys
def add_num_to_img(file_path):
im = Image.open(file_path)
im_draw = ImageD... | <commit_before># Source:https://github.com/Show-Me-the-Code/show-me-the-code
# Author:renzongxian
# Date:2014-11-30
# Python 3.4
"""
第 0000 题:将你的 QQ 头像(或者微博头像)右上角加上红色的数字,类似于微信未读信息数量那种提示效果
"""
from PIL import Image, ImageDraw, ImageFont
import sys
def add_num_to_img(file_path):
im = Image.open(file_path)
i... |
dcea53c3ca7f64d7486283d717b92f2d09bea438 | project/settings_prod.py | project/settings_prod.py | from project.settings_common import *
DEBUG = False
TEMPLATE_DEBUG = DEBUG
# CACHE
from memcacheify import memcacheify
CACHES = memcacheify()
MIDDLEWARE_CLASSES += (
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
)
STATIC_ROOT = os.path.join(PROJECT_ROO... | from project.settings_common import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
# CACHE
from memcacheify import memcacheify
CACHES = memcacheify()
MIDDLEWARE_CLASSES += (
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
)
STATIC_ROOT = os.path.join(PROJECT_ROOT... | Remove static file serve url | Remove static file serve url
| Python | mit | AxisPhilly/lobbying.ph-django,AxisPhilly/lobbying.ph-django,AxisPhilly/lobbying.ph-django | from project.settings_common import *
DEBUG = False
TEMPLATE_DEBUG = DEBUG
# CACHE
from memcacheify import memcacheify
CACHES = memcacheify()
MIDDLEWARE_CLASSES += (
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
)
STATIC_ROOT = os.path.join(PROJECT_ROO... | from project.settings_common import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
# CACHE
from memcacheify import memcacheify
CACHES = memcacheify()
MIDDLEWARE_CLASSES += (
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
)
STATIC_ROOT = os.path.join(PROJECT_ROOT... | <commit_before>from project.settings_common import *
DEBUG = False
TEMPLATE_DEBUG = DEBUG
# CACHE
from memcacheify import memcacheify
CACHES = memcacheify()
MIDDLEWARE_CLASSES += (
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
)
STATIC_ROOT = os.path.j... | from project.settings_common import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
# CACHE
from memcacheify import memcacheify
CACHES = memcacheify()
MIDDLEWARE_CLASSES += (
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
)
STATIC_ROOT = os.path.join(PROJECT_ROOT... | from project.settings_common import *
DEBUG = False
TEMPLATE_DEBUG = DEBUG
# CACHE
from memcacheify import memcacheify
CACHES = memcacheify()
MIDDLEWARE_CLASSES += (
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
)
STATIC_ROOT = os.path.join(PROJECT_ROO... | <commit_before>from project.settings_common import *
DEBUG = False
TEMPLATE_DEBUG = DEBUG
# CACHE
from memcacheify import memcacheify
CACHES = memcacheify()
MIDDLEWARE_CLASSES += (
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
)
STATIC_ROOT = os.path.j... |
b82d85114c13f945cc1976606d4d36d5b4b2885a | phonenumber_field/formfields.py | phonenumber_field/formfields.py | #-*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from django.forms.fields import CharField
from django.core.exceptions import ValidationError
from phonenumber_field.validators import validate_international_phonenumber
from phonenumber_field.phonenumber import to_python
class PhoneNumberF... | #-*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from django.forms.fields import CharField
from django.core.exceptions import ValidationError
from phonenumber_field.validators import validate_international_phonenumber
from phonenumber_field.phonenumber import to_python
class PhoneNumberF... | Fix formfield to return an empty string if an empty value is given. This allows empty input for not null model fields with blank=True. | Fix formfield to return an empty string if an empty value is given. This allows empty input for not null model fields with blank=True.
| Python | mit | bramd/django-phonenumber-field,bramd/django-phonenumber-field | #-*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from django.forms.fields import CharField
from django.core.exceptions import ValidationError
from phonenumber_field.validators import validate_international_phonenumber
from phonenumber_field.phonenumber import to_python
class PhoneNumberF... | #-*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from django.forms.fields import CharField
from django.core.exceptions import ValidationError
from phonenumber_field.validators import validate_international_phonenumber
from phonenumber_field.phonenumber import to_python
class PhoneNumberF... | <commit_before>#-*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from django.forms.fields import CharField
from django.core.exceptions import ValidationError
from phonenumber_field.validators import validate_international_phonenumber
from phonenumber_field.phonenumber import to_python
cla... | #-*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from django.forms.fields import CharField
from django.core.exceptions import ValidationError
from phonenumber_field.validators import validate_international_phonenumber
from phonenumber_field.phonenumber import to_python
class PhoneNumberF... | #-*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from django.forms.fields import CharField
from django.core.exceptions import ValidationError
from phonenumber_field.validators import validate_international_phonenumber
from phonenumber_field.phonenumber import to_python
class PhoneNumberF... | <commit_before>#-*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from django.forms.fields import CharField
from django.core.exceptions import ValidationError
from phonenumber_field.validators import validate_international_phonenumber
from phonenumber_field.phonenumber import to_python
cla... |
2e6080f2d8c258700444129a9b989ca5db056a9d | elfi/examples/ma2.py | elfi/examples/ma2.py | import numpy as np
"""Example implementation of the MA2 model
"""
# TODO: add tests
def MA2(n_obs, t1, t2, n_sim=1, prng=None, latents=None):
if latents is None:
if prng is None:
prng = np.random.RandomState()
latents = prng.randn(n_sim, n_obs+2) # i.i.d. sequence ~ N(0,1)
u = np.... | import numpy as np
"""Example implementation of the MA2 model
"""
# TODO: add tests
def MA2(n_obs, t1, t2, n_sim=1, prng=None, latents=None):
if latents is None:
if prng is None:
prng = np.random.RandomState()
latents = prng.randn(n_sim, n_obs+2) # i.i.d. sequence ~ N(0,1)
u = np.... | Change autocorrelation to autocov. Variance infromation improves ABC results. | Change autocorrelation to autocov. Variance infromation improves ABC results.
| Python | bsd-3-clause | lintusj1/elfi,HIIT/elfi,lintusj1/elfi,elfi-dev/elfi,elfi-dev/elfi | import numpy as np
"""Example implementation of the MA2 model
"""
# TODO: add tests
def MA2(n_obs, t1, t2, n_sim=1, prng=None, latents=None):
if latents is None:
if prng is None:
prng = np.random.RandomState()
latents = prng.randn(n_sim, n_obs+2) # i.i.d. sequence ~ N(0,1)
u = np.... | import numpy as np
"""Example implementation of the MA2 model
"""
# TODO: add tests
def MA2(n_obs, t1, t2, n_sim=1, prng=None, latents=None):
if latents is None:
if prng is None:
prng = np.random.RandomState()
latents = prng.randn(n_sim, n_obs+2) # i.i.d. sequence ~ N(0,1)
u = np.... | <commit_before>import numpy as np
"""Example implementation of the MA2 model
"""
# TODO: add tests
def MA2(n_obs, t1, t2, n_sim=1, prng=None, latents=None):
if latents is None:
if prng is None:
prng = np.random.RandomState()
latents = prng.randn(n_sim, n_obs+2) # i.i.d. sequence ~ N(0... | import numpy as np
"""Example implementation of the MA2 model
"""
# TODO: add tests
def MA2(n_obs, t1, t2, n_sim=1, prng=None, latents=None):
if latents is None:
if prng is None:
prng = np.random.RandomState()
latents = prng.randn(n_sim, n_obs+2) # i.i.d. sequence ~ N(0,1)
u = np.... | import numpy as np
"""Example implementation of the MA2 model
"""
# TODO: add tests
def MA2(n_obs, t1, t2, n_sim=1, prng=None, latents=None):
if latents is None:
if prng is None:
prng = np.random.RandomState()
latents = prng.randn(n_sim, n_obs+2) # i.i.d. sequence ~ N(0,1)
u = np.... | <commit_before>import numpy as np
"""Example implementation of the MA2 model
"""
# TODO: add tests
def MA2(n_obs, t1, t2, n_sim=1, prng=None, latents=None):
if latents is None:
if prng is None:
prng = np.random.RandomState()
latents = prng.randn(n_sim, n_obs+2) # i.i.d. sequence ~ N(0... |
3480330cb042b08ff85bfa988a130c7fa391a0ee | flask_restler/__init__.py | flask_restler/__init__.py | import logging
__license__ = "MIT"
__project__ = "Flask-Restler"
__version__ = "1.6.2"
logger = logging.getLogger('flask-restler')
logger.addHandler(logging.NullHandler())
class APIError(Exception):
"""Store API exception's information."""
status_code = 400
def __init__(self, message, status_code=N... | import logging
__license__ = "MIT"
__project__ = "Flask-Restler"
__version__ = "1.6.2"
logger = logging.getLogger('flask-restler')
logger.addHandler(logging.NullHandler())
class APIError(Exception):
"""Store API exception's information."""
status_code = 400
def __init__(self, message, status_code=N... | Support endpoint name in route. | Support endpoint name in route.
| Python | mit | klen/flask-restler,klen/flask-restler | import logging
__license__ = "MIT"
__project__ = "Flask-Restler"
__version__ = "1.6.2"
logger = logging.getLogger('flask-restler')
logger.addHandler(logging.NullHandler())
class APIError(Exception):
"""Store API exception's information."""
status_code = 400
def __init__(self, message, status_code=N... | import logging
__license__ = "MIT"
__project__ = "Flask-Restler"
__version__ = "1.6.2"
logger = logging.getLogger('flask-restler')
logger.addHandler(logging.NullHandler())
class APIError(Exception):
"""Store API exception's information."""
status_code = 400
def __init__(self, message, status_code=N... | <commit_before>import logging
__license__ = "MIT"
__project__ = "Flask-Restler"
__version__ = "1.6.2"
logger = logging.getLogger('flask-restler')
logger.addHandler(logging.NullHandler())
class APIError(Exception):
"""Store API exception's information."""
status_code = 400
def __init__(self, message... | import logging
__license__ = "MIT"
__project__ = "Flask-Restler"
__version__ = "1.6.2"
logger = logging.getLogger('flask-restler')
logger.addHandler(logging.NullHandler())
class APIError(Exception):
"""Store API exception's information."""
status_code = 400
def __init__(self, message, status_code=N... | import logging
__license__ = "MIT"
__project__ = "Flask-Restler"
__version__ = "1.6.2"
logger = logging.getLogger('flask-restler')
logger.addHandler(logging.NullHandler())
class APIError(Exception):
"""Store API exception's information."""
status_code = 400
def __init__(self, message, status_code=N... | <commit_before>import logging
__license__ = "MIT"
__project__ = "Flask-Restler"
__version__ = "1.6.2"
logger = logging.getLogger('flask-restler')
logger.addHandler(logging.NullHandler())
class APIError(Exception):
"""Store API exception's information."""
status_code = 400
def __init__(self, message... |
373a172535db60e0b428500b1036decd97cf9504 | bookstore_app/urls.py | bookstore_app/urls.py | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^register/', views.register, name='register'),
url(r'^login/', views.login, name='login')
] | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^register/$', views.register, name='register'),
url(r'^login/$', views.login, name='login'),
url(r'^books/([a-zA-Z0-9]+)/$', views.book, name='book')
] | Add book url route matcher | Add book url route matcher
| Python | mit | siawyoung/bookstore,siawyoung/bookstore,siawyoung/bookstore | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^register/', views.register, name='register'),
url(r'^login/', views.login, name='login')
]Add book url route matcher | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^register/$', views.register, name='register'),
url(r'^login/$', views.login, name='login'),
url(r'^books/([a-zA-Z0-9]+)/$', views.book, name='book')
] | <commit_before>from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^register/', views.register, name='register'),
url(r'^login/', views.login, name='login')
]<commit_msg>Add book url route matcher<commit_after> | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^register/$', views.register, name='register'),
url(r'^login/$', views.login, name='login'),
url(r'^books/([a-zA-Z0-9]+)/$', views.book, name='book')
] | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^register/', views.register, name='register'),
url(r'^login/', views.login, name='login')
]Add book url route matcherfrom django.conf.urls import url
from . import views
urlpatterns = [
ur... | <commit_before>from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^register/', views.register, name='register'),
url(r'^login/', views.login, name='login')
]<commit_msg>Add book url route matcher<commit_after>from django.conf.urls import url
fr... |
5442d45689a567528753a0e705733f86eac37220 | buckets/test/views.py | buckets/test/views.py | from django.core.files.storage import default_storage
from django.views.decorators.http import require_POST
from django.http import HttpResponse
@require_POST
def fake_s3_upload(request):
key = request.POST.get('key')
file = request.FILES.get('file')
default_storage.save(key, file.read())
return Htt... | from django.core.files.storage import default_storage
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
from django.http import HttpResponse
@csrf_exempt
@require_POST
def fake_s3_upload(request):
key = request.POST.get('key')
file = request.FILES.get(... | Set fake_s3_upload view to be CSRF exempt | Set fake_s3_upload view to be CSRF exempt
| Python | agpl-3.0 | Cadasta/django-buckets,Cadasta/django-buckets,Cadasta/django-buckets | from django.core.files.storage import default_storage
from django.views.decorators.http import require_POST
from django.http import HttpResponse
@require_POST
def fake_s3_upload(request):
key = request.POST.get('key')
file = request.FILES.get('file')
default_storage.save(key, file.read())
return Htt... | from django.core.files.storage import default_storage
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
from django.http import HttpResponse
@csrf_exempt
@require_POST
def fake_s3_upload(request):
key = request.POST.get('key')
file = request.FILES.get(... | <commit_before>from django.core.files.storage import default_storage
from django.views.decorators.http import require_POST
from django.http import HttpResponse
@require_POST
def fake_s3_upload(request):
key = request.POST.get('key')
file = request.FILES.get('file')
default_storage.save(key, file.read())
... | from django.core.files.storage import default_storage
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
from django.http import HttpResponse
@csrf_exempt
@require_POST
def fake_s3_upload(request):
key = request.POST.get('key')
file = request.FILES.get(... | from django.core.files.storage import default_storage
from django.views.decorators.http import require_POST
from django.http import HttpResponse
@require_POST
def fake_s3_upload(request):
key = request.POST.get('key')
file = request.FILES.get('file')
default_storage.save(key, file.read())
return Htt... | <commit_before>from django.core.files.storage import default_storage
from django.views.decorators.http import require_POST
from django.http import HttpResponse
@require_POST
def fake_s3_upload(request):
key = request.POST.get('key')
file = request.FILES.get('file')
default_storage.save(key, file.read())
... |
7f05b622ab6cb1202d2d00ec1bcac2c5bbb326b7 | dthm4kaiako/config/__init__.py | dthm4kaiako/config/__init__.py | """Configuration for Django system."""
__version__ = "0.9.2"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| """Configuration for Django system."""
__version__ = "0.9.3"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| Increment version number to 0.9.3 | Increment version number to 0.9.3
| Python | mit | uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers | """Configuration for Django system."""
__version__ = "0.9.2"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
Increment version number to 0.9.3 | """Configuration for Django system."""
__version__ = "0.9.3"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| <commit_before>"""Configuration for Django system."""
__version__ = "0.9.2"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
<commit_msg>Increment version number to 0.9.3<commit_after> | """Configuration for Django system."""
__version__ = "0.9.3"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| """Configuration for Django system."""
__version__ = "0.9.2"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
Increment version number to 0.9.3"""Configuration for Django system."""
__version__ = "0.9.3"
__version_info__ ... | <commit_before>"""Configuration for Django system."""
__version__ = "0.9.2"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
<commit_msg>Increment version number to 0.9.3<commit_after>"""Configuration for Django system."""... |
c904654c481678675aabb655c082a3986efbbf27 | chrome/test/nacl_test_injection/buildbot_nacl_integration.py | chrome/test/nacl_test_injection/buildbot_nacl_integration.py | #!/usr/bin/python
# Copyright (c) 2011 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.
import os
import subprocess
import sys
def Main():
pwd = os.environ.get('PWD', '')
# TODO(ncbray): figure out why this is failing... | #!/usr/bin/python
# Copyright (c) 2011 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.
import os
import subprocess
import sys
def Main():
pwd = os.environ.get('PWD', '')
# TODO(ncbray): figure out why this is failing... | Whitelist nacl_integration tests to run on new nacl integration bot. | Whitelist nacl_integration tests to run on new nacl integration bot.
BUG= none
TEST= none
Review URL: http://codereview.chromium.org/7050026
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@86021 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | adobe/chromium,yitian134/chromium,yitian134/chromium,gavinp/chromium,ropik/chromium,adobe/chromium,adobe/chromium,ropik/chromium,yitian134/chromium,ropik/chromium,yitian134/chromium,ropik/chromium,gavinp/chromium,yitian134/chromium,adobe/chromium,adobe/chromium,adobe/chromium,adobe/chromium,adobe/chromium,gavinp/chromi... | #!/usr/bin/python
# Copyright (c) 2011 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.
import os
import subprocess
import sys
def Main():
pwd = os.environ.get('PWD', '')
# TODO(ncbray): figure out why this is failing... | #!/usr/bin/python
# Copyright (c) 2011 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.
import os
import subprocess
import sys
def Main():
pwd = os.environ.get('PWD', '')
# TODO(ncbray): figure out why this is failing... | <commit_before>#!/usr/bin/python
# Copyright (c) 2011 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.
import os
import subprocess
import sys
def Main():
pwd = os.environ.get('PWD', '')
# TODO(ncbray): figure out why ... | #!/usr/bin/python
# Copyright (c) 2011 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.
import os
import subprocess
import sys
def Main():
pwd = os.environ.get('PWD', '')
# TODO(ncbray): figure out why this is failing... | #!/usr/bin/python
# Copyright (c) 2011 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.
import os
import subprocess
import sys
def Main():
pwd = os.environ.get('PWD', '')
# TODO(ncbray): figure out why this is failing... | <commit_before>#!/usr/bin/python
# Copyright (c) 2011 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.
import os
import subprocess
import sys
def Main():
pwd = os.environ.get('PWD', '')
# TODO(ncbray): figure out why ... |
0069f3085167144e2d077f84c8061aff35305cec | docker_registry/wsgi.py | docker_registry/wsgi.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os
from . import app
if __name__ == '__main__':
# Bind to PORT if defined, otherwise default to 5000.
port = int(os.environ.get('PORT_WWW', 5000))
app.debug = True
app.run(host='0.0.0.0', port=port)
# Or you can run:
# gunic... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os
from .app import app
if __name__ == '__main__':
# Bind to PORT if defined, otherwise default to 5000.
port = int(os.environ.get('PORT_WWW', 5000))
app.debug = True
app.run(host='0.0.0.0', port=port)
# Or you can run:
# gu... | Fix import following namespace movement | Fix import following namespace movement
Docker-DCO-1.1-Signed-off-by: Mangled Deutz <olivier@webitup.fr> (github: dmp42)
| Python | apache-2.0 | Carrotzpc/docker-registry,dhiltgen/docker-registry,wakermahmud/docker-registry,mdshuai/docker-registry,ptisserand/docker-registry,dine1987/Docker,depay/docker-registry,liggitt/docker-registry,tangkun75/docker-registry,deis/docker-registry,ptisserand/docker-registry,liggitt/docker-registry,kireal/docker-registry,viljast... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os
from . import app
if __name__ == '__main__':
# Bind to PORT if defined, otherwise default to 5000.
port = int(os.environ.get('PORT_WWW', 5000))
app.debug = True
app.run(host='0.0.0.0', port=port)
# Or you can run:
# gunic... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os
from .app import app
if __name__ == '__main__':
# Bind to PORT if defined, otherwise default to 5000.
port = int(os.environ.get('PORT_WWW', 5000))
app.debug = True
app.run(host='0.0.0.0', port=port)
# Or you can run:
# gu... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os
from . import app
if __name__ == '__main__':
# Bind to PORT if defined, otherwise default to 5000.
port = int(os.environ.get('PORT_WWW', 5000))
app.debug = True
app.run(host='0.0.0.0', port=port)
# Or you can r... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os
from .app import app
if __name__ == '__main__':
# Bind to PORT if defined, otherwise default to 5000.
port = int(os.environ.get('PORT_WWW', 5000))
app.debug = True
app.run(host='0.0.0.0', port=port)
# Or you can run:
# gu... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os
from . import app
if __name__ == '__main__':
# Bind to PORT if defined, otherwise default to 5000.
port = int(os.environ.get('PORT_WWW', 5000))
app.debug = True
app.run(host='0.0.0.0', port=port)
# Or you can run:
# gunic... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os
from . import app
if __name__ == '__main__':
# Bind to PORT if defined, otherwise default to 5000.
port = int(os.environ.get('PORT_WWW', 5000))
app.debug = True
app.run(host='0.0.0.0', port=port)
# Or you can r... |
bcc44a366ab7afbdc448e038e7804cd6719590cc | NeuralNet/activations.py | NeuralNet/activations.py | import numpy as np
class Activator:
@staticmethod
def sigmoid(signal, deriv=False):
if deriv:
return np.multiply(signal, 1 - signal)
activation = 1 / (1 + np.exp(-signal))
return activation
@staticmethod
def tanh(signal, deriv=False):
if deriv:
... | import numpy as np
class Activator:
@staticmethod
def sigmoid(signal, deriv=False):
if deriv:
return np.multiply(signal, 1 - signal)
activation = 1 / (1 + np.exp(-signal))
return activation
@staticmethod
def tanh(signal, deriv=False):
if deriv:
... | Implement correct derivation of SoftMax | Implement correct derivation of SoftMax
| Python | mit | ZahidDev/NeuralNet | import numpy as np
class Activator:
@staticmethod
def sigmoid(signal, deriv=False):
if deriv:
return np.multiply(signal, 1 - signal)
activation = 1 / (1 + np.exp(-signal))
return activation
@staticmethod
def tanh(signal, deriv=False):
if deriv:
... | import numpy as np
class Activator:
@staticmethod
def sigmoid(signal, deriv=False):
if deriv:
return np.multiply(signal, 1 - signal)
activation = 1 / (1 + np.exp(-signal))
return activation
@staticmethod
def tanh(signal, deriv=False):
if deriv:
... | <commit_before>import numpy as np
class Activator:
@staticmethod
def sigmoid(signal, deriv=False):
if deriv:
return np.multiply(signal, 1 - signal)
activation = 1 / (1 + np.exp(-signal))
return activation
@staticmethod
def tanh(signal, deriv=False):
if deri... | import numpy as np
class Activator:
@staticmethod
def sigmoid(signal, deriv=False):
if deriv:
return np.multiply(signal, 1 - signal)
activation = 1 / (1 + np.exp(-signal))
return activation
@staticmethod
def tanh(signal, deriv=False):
if deriv:
... | import numpy as np
class Activator:
@staticmethod
def sigmoid(signal, deriv=False):
if deriv:
return np.multiply(signal, 1 - signal)
activation = 1 / (1 + np.exp(-signal))
return activation
@staticmethod
def tanh(signal, deriv=False):
if deriv:
... | <commit_before>import numpy as np
class Activator:
@staticmethod
def sigmoid(signal, deriv=False):
if deriv:
return np.multiply(signal, 1 - signal)
activation = 1 / (1 + np.exp(-signal))
return activation
@staticmethod
def tanh(signal, deriv=False):
if deri... |
572d924de7025eb6a41734e7f8df039210c930c1 | eventlet/__init__.py | eventlet/__init__.py | __version__ = '1.0.2'
try:
from eventlet import greenthread
from eventlet import greenpool
from eventlet import queue
from eventlet import timeout
from eventlet import patcher
from eventlet import convenience
import greenlet
sleep = greenthread.sleep
spawn = greenthread.spawn
s... | version_info = (1, 0, 3)
__version__ = ".".join(map(str, version_info))
try:
from eventlet import greenthread
from eventlet import greenpool
from eventlet import queue
from eventlet import timeout
from eventlet import patcher
from eventlet import convenience
import greenlet
sleep = gre... | Fix version info, and bump to 1.0.3 | Fix version info, and bump to 1.0.3
| Python | mit | Cue/eventlet,Cue/eventlet | __version__ = '1.0.2'
try:
from eventlet import greenthread
from eventlet import greenpool
from eventlet import queue
from eventlet import timeout
from eventlet import patcher
from eventlet import convenience
import greenlet
sleep = greenthread.sleep
spawn = greenthread.spawn
s... | version_info = (1, 0, 3)
__version__ = ".".join(map(str, version_info))
try:
from eventlet import greenthread
from eventlet import greenpool
from eventlet import queue
from eventlet import timeout
from eventlet import patcher
from eventlet import convenience
import greenlet
sleep = gre... | <commit_before>__version__ = '1.0.2'
try:
from eventlet import greenthread
from eventlet import greenpool
from eventlet import queue
from eventlet import timeout
from eventlet import patcher
from eventlet import convenience
import greenlet
sleep = greenthread.sleep
spawn = greenthr... | version_info = (1, 0, 3)
__version__ = ".".join(map(str, version_info))
try:
from eventlet import greenthread
from eventlet import greenpool
from eventlet import queue
from eventlet import timeout
from eventlet import patcher
from eventlet import convenience
import greenlet
sleep = gre... | __version__ = '1.0.2'
try:
from eventlet import greenthread
from eventlet import greenpool
from eventlet import queue
from eventlet import timeout
from eventlet import patcher
from eventlet import convenience
import greenlet
sleep = greenthread.sleep
spawn = greenthread.spawn
s... | <commit_before>__version__ = '1.0.2'
try:
from eventlet import greenthread
from eventlet import greenpool
from eventlet import queue
from eventlet import timeout
from eventlet import patcher
from eventlet import convenience
import greenlet
sleep = greenthread.sleep
spawn = greenthr... |
146832fe1eba0bc22125ade183f34621de5625fa | apps/bluebottle_utils/fields.py | apps/bluebottle_utils/fields.py | from decimal import Decimal
from django.db import models
class MoneyField(models.DecimalField):
def __init__(self, *args, **kwargs):
kwargs.setdefault('max_digits', 9)
kwargs.setdefault('decimal_places', 2)
super(MoneyField, self).__init__(*args, default=Decimal('0.00'), **kwargs)
| from decimal import Decimal
from django.db import models
class MoneyField(models.DecimalField):
def __init__(self, *args, **kwargs):
kwargs.setdefault('max_digits', 9)
kwargs.setdefault('decimal_places', 2)
kwargs.setdefault('default', Decimal('0.00'))
super(MoneyField, self).__ini... | Add south introspection rule for MoneyField. | Add south introspection rule for MoneyField.
| Python | bsd-3-clause | onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site | from decimal import Decimal
from django.db import models
class MoneyField(models.DecimalField):
def __init__(self, *args, **kwargs):
kwargs.setdefault('max_digits', 9)
kwargs.setdefault('decimal_places', 2)
super(MoneyField, self).__init__(*args, default=Decimal('0.00'), **kwargs)
Add sout... | from decimal import Decimal
from django.db import models
class MoneyField(models.DecimalField):
def __init__(self, *args, **kwargs):
kwargs.setdefault('max_digits', 9)
kwargs.setdefault('decimal_places', 2)
kwargs.setdefault('default', Decimal('0.00'))
super(MoneyField, self).__ini... | <commit_before>from decimal import Decimal
from django.db import models
class MoneyField(models.DecimalField):
def __init__(self, *args, **kwargs):
kwargs.setdefault('max_digits', 9)
kwargs.setdefault('decimal_places', 2)
super(MoneyField, self).__init__(*args, default=Decimal('0.00'), **k... | from decimal import Decimal
from django.db import models
class MoneyField(models.DecimalField):
def __init__(self, *args, **kwargs):
kwargs.setdefault('max_digits', 9)
kwargs.setdefault('decimal_places', 2)
kwargs.setdefault('default', Decimal('0.00'))
super(MoneyField, self).__ini... | from decimal import Decimal
from django.db import models
class MoneyField(models.DecimalField):
def __init__(self, *args, **kwargs):
kwargs.setdefault('max_digits', 9)
kwargs.setdefault('decimal_places', 2)
super(MoneyField, self).__init__(*args, default=Decimal('0.00'), **kwargs)
Add sout... | <commit_before>from decimal import Decimal
from django.db import models
class MoneyField(models.DecimalField):
def __init__(self, *args, **kwargs):
kwargs.setdefault('max_digits', 9)
kwargs.setdefault('decimal_places', 2)
super(MoneyField, self).__init__(*args, default=Decimal('0.00'), **k... |
1ef71bd1b1eabcbe3d2148d8eb5e3f5a890450d7 | idiokit/dns/_hostlookup.py | idiokit/dns/_hostlookup.py | from .. import idiokit
from ._iputils import parse_ip
from ._conf import hosts
from ._dns import DNSError, a, aaaa
def _filter_ips(potential_ips):
results = []
for ip in potential_ips:
try:
family, ip = parse_ip(ip)
except ValueError:
continue
else:
... | from .. import idiokit
from ._iputils import parse_ip
from ._conf import hosts
from ._dns import DNSError, a, aaaa
def _filter_ips(potential_ips):
results = []
for ip in potential_ips:
try:
family, ip = parse_ip(ip)
except ValueError:
continue
else:
... | Add configurable path to hosts file for HostLookup() | Add configurable path to hosts file for HostLookup()
Required for unit testing so that tests don't have to rely on
/etc/hosts file.
| Python | mit | abusesa/idiokit | from .. import idiokit
from ._iputils import parse_ip
from ._conf import hosts
from ._dns import DNSError, a, aaaa
def _filter_ips(potential_ips):
results = []
for ip in potential_ips:
try:
family, ip = parse_ip(ip)
except ValueError:
continue
else:
... | from .. import idiokit
from ._iputils import parse_ip
from ._conf import hosts
from ._dns import DNSError, a, aaaa
def _filter_ips(potential_ips):
results = []
for ip in potential_ips:
try:
family, ip = parse_ip(ip)
except ValueError:
continue
else:
... | <commit_before>from .. import idiokit
from ._iputils import parse_ip
from ._conf import hosts
from ._dns import DNSError, a, aaaa
def _filter_ips(potential_ips):
results = []
for ip in potential_ips:
try:
family, ip = parse_ip(ip)
except ValueError:
continue
els... | from .. import idiokit
from ._iputils import parse_ip
from ._conf import hosts
from ._dns import DNSError, a, aaaa
def _filter_ips(potential_ips):
results = []
for ip in potential_ips:
try:
family, ip = parse_ip(ip)
except ValueError:
continue
else:
... | from .. import idiokit
from ._iputils import parse_ip
from ._conf import hosts
from ._dns import DNSError, a, aaaa
def _filter_ips(potential_ips):
results = []
for ip in potential_ips:
try:
family, ip = parse_ip(ip)
except ValueError:
continue
else:
... | <commit_before>from .. import idiokit
from ._iputils import parse_ip
from ._conf import hosts
from ._dns import DNSError, a, aaaa
def _filter_ips(potential_ips):
results = []
for ip in potential_ips:
try:
family, ip = parse_ip(ip)
except ValueError:
continue
els... |
476b66510cd7b84233ad02ccfcde3ecd33604c57 | simple_es/event/domain_event.py | simple_es/event/domain_event.py | from simple_es.identifier.identifies import Identifies
class DomainEvent():
"""
Base class for all domain driven events
"""
identifier = None
def __init__(self, identifier=None):
if not isinstance(identifier, Identifies):
raise TypeError('Event identifier must be an instance o... | from simple_es.identifier.identifies import Identifies
class DomainEvent():
"""
Base class for all domain driven events
"""
identifier = None
_recorded = False
def __init__(self, identifier=None):
if not isinstance(identifier, Identifies):
raise TypeError('Event identifier... | Add a _recorded bool to events | Add a _recorded bool to events
| Python | apache-2.0 | OnShift/simple-es | from simple_es.identifier.identifies import Identifies
class DomainEvent():
"""
Base class for all domain driven events
"""
identifier = None
def __init__(self, identifier=None):
if not isinstance(identifier, Identifies):
raise TypeError('Event identifier must be an instance o... | from simple_es.identifier.identifies import Identifies
class DomainEvent():
"""
Base class for all domain driven events
"""
identifier = None
_recorded = False
def __init__(self, identifier=None):
if not isinstance(identifier, Identifies):
raise TypeError('Event identifier... | <commit_before>from simple_es.identifier.identifies import Identifies
class DomainEvent():
"""
Base class for all domain driven events
"""
identifier = None
def __init__(self, identifier=None):
if not isinstance(identifier, Identifies):
raise TypeError('Event identifier must b... | from simple_es.identifier.identifies import Identifies
class DomainEvent():
"""
Base class for all domain driven events
"""
identifier = None
_recorded = False
def __init__(self, identifier=None):
if not isinstance(identifier, Identifies):
raise TypeError('Event identifier... | from simple_es.identifier.identifies import Identifies
class DomainEvent():
"""
Base class for all domain driven events
"""
identifier = None
def __init__(self, identifier=None):
if not isinstance(identifier, Identifies):
raise TypeError('Event identifier must be an instance o... | <commit_before>from simple_es.identifier.identifies import Identifies
class DomainEvent():
"""
Base class for all domain driven events
"""
identifier = None
def __init__(self, identifier=None):
if not isinstance(identifier, Identifies):
raise TypeError('Event identifier must b... |
70049aa7b2f8dcede7d562def03b262f4c39816a | indra/sources/lincs/api.py | indra/sources/lincs/api.py | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
__all__ = []
import requests
DATASET_URL = 'http://lincs.hms.harvard.edu/db/datasets/20000/results'
def _get_lincs_drug_target_data():
resp = requests.get(DATASET_URL, params={'output_type': '.csv'})
ass... | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
__all__ = []
import csv
import requests
from indra.sources.lincs.processor import LincsProcessor
DATASET_URL = 'http://lincs.hms.harvard.edu/db/datasets/20000/results'
def process_from_web():
lincs_data = _... | Return a list of dicts for data. | Return a list of dicts for data.
| Python | bsd-2-clause | pvtodorov/indra,johnbachman/indra,sorgerlab/belpy,sorgerlab/belpy,sorgerlab/indra,bgyori/indra,sorgerlab/indra,johnbachman/belpy,johnbachman/belpy,pvtodorov/indra,sorgerlab/belpy,johnbachman/belpy,pvtodorov/indra,bgyori/indra,johnbachman/indra,bgyori/indra,sorgerlab/indra,pvtodorov/indra,johnbachman/indra | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
__all__ = []
import requests
DATASET_URL = 'http://lincs.hms.harvard.edu/db/datasets/20000/results'
def _get_lincs_drug_target_data():
resp = requests.get(DATASET_URL, params={'output_type': '.csv'})
ass... | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
__all__ = []
import csv
import requests
from indra.sources.lincs.processor import LincsProcessor
DATASET_URL = 'http://lincs.hms.harvard.edu/db/datasets/20000/results'
def process_from_web():
lincs_data = _... | <commit_before>from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
__all__ = []
import requests
DATASET_URL = 'http://lincs.hms.harvard.edu/db/datasets/20000/results'
def _get_lincs_drug_target_data():
resp = requests.get(DATASET_URL, params={'output_type': '... | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
__all__ = []
import csv
import requests
from indra.sources.lincs.processor import LincsProcessor
DATASET_URL = 'http://lincs.hms.harvard.edu/db/datasets/20000/results'
def process_from_web():
lincs_data = _... | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
__all__ = []
import requests
DATASET_URL = 'http://lincs.hms.harvard.edu/db/datasets/20000/results'
def _get_lincs_drug_target_data():
resp = requests.get(DATASET_URL, params={'output_type': '.csv'})
ass... | <commit_before>from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
__all__ = []
import requests
DATASET_URL = 'http://lincs.hms.harvard.edu/db/datasets/20000/results'
def _get_lincs_drug_target_data():
resp = requests.get(DATASET_URL, params={'output_type': '... |
581bc613ed00b99fc252e52953a9757ff580a510 | generateConfig.py | generateConfig.py | #!/bin/python3.5
import os
config = """
.VSBasePath = 'C:/Program Files (x86)/Microsoft Visual Studio/2017/Community'
.WindowsSDKBasePath10 = 'C:/Program Files (x86)/Windows Kits/10'
.WindowsSDKSubVersion = '10.0.15063.0'
#if __WINDOWS__
.FazEPath = 'CURRENT_DIRECTORY'
.FBuildCache = 'C:/temp/fazecache'
.VulkanSDK... | #!/bin/python3.5
import os
config = """
.WindowsSDKBasePath10 = 'C:/Program Files (x86)/Windows Kits/10'
.WindowsSDKSubVersion = '10.0.15063.0'
#if __WINDOWS__
.FazEPath = 'CURRENT_DIRECTORY'
.FBuildCache = 'C:/temp/fazecache'
.VulkanSDKBasePath = 'C:/VulkanSDK/1.0.54.0'
#endif
#if __LINUX__
.FazEPath = 'CURRENT_DIREC... | Use professional vs instead of community if found | Use professional vs instead of community if found
| Python | mit | jgavert/Faze,jgavert/Faze,jgavert/Faze,jgavert/Faze | #!/bin/python3.5
import os
config = """
.VSBasePath = 'C:/Program Files (x86)/Microsoft Visual Studio/2017/Community'
.WindowsSDKBasePath10 = 'C:/Program Files (x86)/Windows Kits/10'
.WindowsSDKSubVersion = '10.0.15063.0'
#if __WINDOWS__
.FazEPath = 'CURRENT_DIRECTORY'
.FBuildCache = 'C:/temp/fazecache'
.VulkanSDK... | #!/bin/python3.5
import os
config = """
.WindowsSDKBasePath10 = 'C:/Program Files (x86)/Windows Kits/10'
.WindowsSDKSubVersion = '10.0.15063.0'
#if __WINDOWS__
.FazEPath = 'CURRENT_DIRECTORY'
.FBuildCache = 'C:/temp/fazecache'
.VulkanSDKBasePath = 'C:/VulkanSDK/1.0.54.0'
#endif
#if __LINUX__
.FazEPath = 'CURRENT_DIREC... | <commit_before>#!/bin/python3.5
import os
config = """
.VSBasePath = 'C:/Program Files (x86)/Microsoft Visual Studio/2017/Community'
.WindowsSDKBasePath10 = 'C:/Program Files (x86)/Windows Kits/10'
.WindowsSDKSubVersion = '10.0.15063.0'
#if __WINDOWS__
.FazEPath = 'CURRENT_DIRECTORY'
.FBuildCache = 'C:/temp/fazeca... | #!/bin/python3.5
import os
config = """
.WindowsSDKBasePath10 = 'C:/Program Files (x86)/Windows Kits/10'
.WindowsSDKSubVersion = '10.0.15063.0'
#if __WINDOWS__
.FazEPath = 'CURRENT_DIRECTORY'
.FBuildCache = 'C:/temp/fazecache'
.VulkanSDKBasePath = 'C:/VulkanSDK/1.0.54.0'
#endif
#if __LINUX__
.FazEPath = 'CURRENT_DIREC... | #!/bin/python3.5
import os
config = """
.VSBasePath = 'C:/Program Files (x86)/Microsoft Visual Studio/2017/Community'
.WindowsSDKBasePath10 = 'C:/Program Files (x86)/Windows Kits/10'
.WindowsSDKSubVersion = '10.0.15063.0'
#if __WINDOWS__
.FazEPath = 'CURRENT_DIRECTORY'
.FBuildCache = 'C:/temp/fazecache'
.VulkanSDK... | <commit_before>#!/bin/python3.5
import os
config = """
.VSBasePath = 'C:/Program Files (x86)/Microsoft Visual Studio/2017/Community'
.WindowsSDKBasePath10 = 'C:/Program Files (x86)/Windows Kits/10'
.WindowsSDKSubVersion = '10.0.15063.0'
#if __WINDOWS__
.FazEPath = 'CURRENT_DIRECTORY'
.FBuildCache = 'C:/temp/fazeca... |
da510e3156b1a92bc9139263f9e27e793dd6316c | importlib_metadata/abc.py | importlib_metadata/abc.py | from __future__ import absolute_import
import abc
import sys
if sys.version_info >= (3,): # pragma: nocover
from importlib.abc import MetaPathFinder
else: # pragma: nocover
from abc import ABCMeta as MetaPathFinder
class DistributionFinder(MetaPathFinder):
"""
A MetaPathFinder capable of discover... | from __future__ import absolute_import
import abc
import sys
if sys.version_info >= (3,): # pragma: nocover
from importlib.abc import MetaPathFinder
else: # pragma: nocover
class MetaPathFinder(object):
__metaclass__ = abc.ABCMeta
class DistributionFinder(MetaPathFinder):
"""
A MetaPathFi... | Fix MetaPathFinder compatibility stub on Python 2.7 | Fix MetaPathFinder compatibility stub on Python 2.7
| Python | apache-2.0 | python/importlib_metadata | from __future__ import absolute_import
import abc
import sys
if sys.version_info >= (3,): # pragma: nocover
from importlib.abc import MetaPathFinder
else: # pragma: nocover
from abc import ABCMeta as MetaPathFinder
class DistributionFinder(MetaPathFinder):
"""
A MetaPathFinder capable of discover... | from __future__ import absolute_import
import abc
import sys
if sys.version_info >= (3,): # pragma: nocover
from importlib.abc import MetaPathFinder
else: # pragma: nocover
class MetaPathFinder(object):
__metaclass__ = abc.ABCMeta
class DistributionFinder(MetaPathFinder):
"""
A MetaPathFi... | <commit_before>from __future__ import absolute_import
import abc
import sys
if sys.version_info >= (3,): # pragma: nocover
from importlib.abc import MetaPathFinder
else: # pragma: nocover
from abc import ABCMeta as MetaPathFinder
class DistributionFinder(MetaPathFinder):
"""
A MetaPathFinder capa... | from __future__ import absolute_import
import abc
import sys
if sys.version_info >= (3,): # pragma: nocover
from importlib.abc import MetaPathFinder
else: # pragma: nocover
class MetaPathFinder(object):
__metaclass__ = abc.ABCMeta
class DistributionFinder(MetaPathFinder):
"""
A MetaPathFi... | from __future__ import absolute_import
import abc
import sys
if sys.version_info >= (3,): # pragma: nocover
from importlib.abc import MetaPathFinder
else: # pragma: nocover
from abc import ABCMeta as MetaPathFinder
class DistributionFinder(MetaPathFinder):
"""
A MetaPathFinder capable of discover... | <commit_before>from __future__ import absolute_import
import abc
import sys
if sys.version_info >= (3,): # pragma: nocover
from importlib.abc import MetaPathFinder
else: # pragma: nocover
from abc import ABCMeta as MetaPathFinder
class DistributionFinder(MetaPathFinder):
"""
A MetaPathFinder capa... |
5753ea19d7d83413cf64ecce6360a2f29ef920bf | docs/source/conf.py | docs/source/conf.py | import os
import sys
import sphinx_rtd_theme
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
sys.path.insert(0, os.path.abspath("../.."))
import django
django.setup()
project = "django-postgres-extra"
copyright = "2019, Sector Labs"
author = "Sector Labs"
extensions = [
"sphinx_rtd_theme",
"sphin... | import os
import sys
import sphinx_rtd_theme
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
sys.path.insert(0, os.path.abspath("../.."))
import django
django.setup()
project = "django-postgres-extra"
copyright = "2019, Sector Labs"
author = "Sector Labs"
extensions = [
"sphinx_rtd_theme",
"sphin... | Use 'stable' Django version for intersphinx | Use 'stable' Django version for intersphinx
This will ensure documentation references always point at the latest version. | Python | mit | SectorLabs/django-postgres-extra | import os
import sys
import sphinx_rtd_theme
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
sys.path.insert(0, os.path.abspath("../.."))
import django
django.setup()
project = "django-postgres-extra"
copyright = "2019, Sector Labs"
author = "Sector Labs"
extensions = [
"sphinx_rtd_theme",
"sphin... | import os
import sys
import sphinx_rtd_theme
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
sys.path.insert(0, os.path.abspath("../.."))
import django
django.setup()
project = "django-postgres-extra"
copyright = "2019, Sector Labs"
author = "Sector Labs"
extensions = [
"sphinx_rtd_theme",
"sphin... | <commit_before>import os
import sys
import sphinx_rtd_theme
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
sys.path.insert(0, os.path.abspath("../.."))
import django
django.setup()
project = "django-postgres-extra"
copyright = "2019, Sector Labs"
author = "Sector Labs"
extensions = [
"sphinx_rtd_the... | import os
import sys
import sphinx_rtd_theme
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
sys.path.insert(0, os.path.abspath("../.."))
import django
django.setup()
project = "django-postgres-extra"
copyright = "2019, Sector Labs"
author = "Sector Labs"
extensions = [
"sphinx_rtd_theme",
"sphin... | import os
import sys
import sphinx_rtd_theme
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
sys.path.insert(0, os.path.abspath("../.."))
import django
django.setup()
project = "django-postgres-extra"
copyright = "2019, Sector Labs"
author = "Sector Labs"
extensions = [
"sphinx_rtd_theme",
"sphin... | <commit_before>import os
import sys
import sphinx_rtd_theme
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
sys.path.insert(0, os.path.abspath("../.."))
import django
django.setup()
project = "django-postgres-extra"
copyright = "2019, Sector Labs"
author = "Sector Labs"
extensions = [
"sphinx_rtd_the... |
c3cb6a294fe83557d86d9415f8cdf8efb4f7e59f | elevator/message.py | elevator/message.py | import msgpack
import logging
class MessageFormatError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class Request(object):
"""Handler objects for frontend->backend objects messages"""
def __init__(self, raw_message, compressed=... | import msgpack
import logging
class MessageFormatError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class Request(object):
"""Handler objects for frontend->backend objects messages"""
def __init__(self, raw_message, compressed=... | Fix : response datas list should not be unicoded | Fix : response datas list should not be unicoded
| Python | mit | oleiade/Elevator | import msgpack
import logging
class MessageFormatError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class Request(object):
"""Handler objects for frontend->backend objects messages"""
def __init__(self, raw_message, compressed=... | import msgpack
import logging
class MessageFormatError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class Request(object):
"""Handler objects for frontend->backend objects messages"""
def __init__(self, raw_message, compressed=... | <commit_before>import msgpack
import logging
class MessageFormatError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class Request(object):
"""Handler objects for frontend->backend objects messages"""
def __init__(self, raw_messa... | import msgpack
import logging
class MessageFormatError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class Request(object):
"""Handler objects for frontend->backend objects messages"""
def __init__(self, raw_message, compressed=... | import msgpack
import logging
class MessageFormatError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class Request(object):
"""Handler objects for frontend->backend objects messages"""
def __init__(self, raw_message, compressed=... | <commit_before>import msgpack
import logging
class MessageFormatError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class Request(object):
"""Handler objects for frontend->backend objects messages"""
def __init__(self, raw_messa... |
51a9fe51f170132ab9da09fbf3aa73c59678aa03 | start.py | start.py | #!/usr/bin/env python2.7
"""
Run a local instance of Boulder for testing purposes.
This runs in non-monolithic mode and requires RabbitMQ on localhost.
Keeps servers alive until ^C or 100K seconds elapse. Exits non-zero if
any servers fail to start, or die before timer/^C.
"""
import os
import signal
import sys
impo... | #!/usr/bin/env python2.7
"""
Run a local instance of Boulder for testing purposes.
This runs in non-monolithic mode and requires RabbitMQ on localhost.
Keeps servers alive until ^C. Exit non-zero if any servers fail to
start, or die before ^C.
"""
import os
import sys
import time
sys.path.append('./test')
import st... | Remove 100K-second max runtime, just run until ^C or server crash. | Remove 100K-second max runtime, just run until ^C or server crash.
| Python | mpl-2.0 | letsencrypt/boulder,patf/boulder,lmcro/boulder,deserted/boulder,jgillula/boulder,mozmark/boulder,ZCloud-Firstserver/boulder,postfix/boulder,KyleChamberlin/boulder,kuba/boulder,modulexcite/boulder,ibukanov/boulder,hlandauf/boulder,mehmooda/boulder,julienschmidt/boulder,tomclegg/boulder,mommel/boulder,mozmark/boulder,jcj... | #!/usr/bin/env python2.7
"""
Run a local instance of Boulder for testing purposes.
This runs in non-monolithic mode and requires RabbitMQ on localhost.
Keeps servers alive until ^C or 100K seconds elapse. Exits non-zero if
any servers fail to start, or die before timer/^C.
"""
import os
import signal
import sys
impo... | #!/usr/bin/env python2.7
"""
Run a local instance of Boulder for testing purposes.
This runs in non-monolithic mode and requires RabbitMQ on localhost.
Keeps servers alive until ^C. Exit non-zero if any servers fail to
start, or die before ^C.
"""
import os
import sys
import time
sys.path.append('./test')
import st... | <commit_before>#!/usr/bin/env python2.7
"""
Run a local instance of Boulder for testing purposes.
This runs in non-monolithic mode and requires RabbitMQ on localhost.
Keeps servers alive until ^C or 100K seconds elapse. Exits non-zero if
any servers fail to start, or die before timer/^C.
"""
import os
import signal
... | #!/usr/bin/env python2.7
"""
Run a local instance of Boulder for testing purposes.
This runs in non-monolithic mode and requires RabbitMQ on localhost.
Keeps servers alive until ^C. Exit non-zero if any servers fail to
start, or die before ^C.
"""
import os
import sys
import time
sys.path.append('./test')
import st... | #!/usr/bin/env python2.7
"""
Run a local instance of Boulder for testing purposes.
This runs in non-monolithic mode and requires RabbitMQ on localhost.
Keeps servers alive until ^C or 100K seconds elapse. Exits non-zero if
any servers fail to start, or die before timer/^C.
"""
import os
import signal
import sys
impo... | <commit_before>#!/usr/bin/env python2.7
"""
Run a local instance of Boulder for testing purposes.
This runs in non-monolithic mode and requires RabbitMQ on localhost.
Keeps servers alive until ^C or 100K seconds elapse. Exits non-zero if
any servers fail to start, or die before timer/^C.
"""
import os
import signal
... |
3a0d81e62d8a6cd6807d0447b72cc35206e2c8fd | ecs-cleaner.py | ecs-cleaner.py | import boto3
def main(event, context):
client = boto3.client(u'ecs')
inspect_clusters = [u'staging1']
for cluster in inspect_clusters:
resp = client.list_container_instances(
cluster=cluster
)
instances = resp[u'containerInstanceArns']
try:
nxt_tok = resp[u'nextToken']
whil... | import boto3
def main(event, context):
ecs_client = boto3.client(u'ecs')
inspect_clusters = [u'staging1']
for cluster in inspect_clusters:
resp = ecs_client.list_container_instances(
cluster=cluster
)
instances = resp[u'containerInstanceArns']
try:
nxt_tok = resp[u'nextToken']
... | Add instance detach and terminate | Add instance detach and terminate
| Python | mit | silinternational/ecs-agent-monitor | import boto3
def main(event, context):
client = boto3.client(u'ecs')
inspect_clusters = [u'staging1']
for cluster in inspect_clusters:
resp = client.list_container_instances(
cluster=cluster
)
instances = resp[u'containerInstanceArns']
try:
nxt_tok = resp[u'nextToken']
whil... | import boto3
def main(event, context):
ecs_client = boto3.client(u'ecs')
inspect_clusters = [u'staging1']
for cluster in inspect_clusters:
resp = ecs_client.list_container_instances(
cluster=cluster
)
instances = resp[u'containerInstanceArns']
try:
nxt_tok = resp[u'nextToken']
... | <commit_before>import boto3
def main(event, context):
client = boto3.client(u'ecs')
inspect_clusters = [u'staging1']
for cluster in inspect_clusters:
resp = client.list_container_instances(
cluster=cluster
)
instances = resp[u'containerInstanceArns']
try:
nxt_tok = resp[u'nextToke... | import boto3
def main(event, context):
ecs_client = boto3.client(u'ecs')
inspect_clusters = [u'staging1']
for cluster in inspect_clusters:
resp = ecs_client.list_container_instances(
cluster=cluster
)
instances = resp[u'containerInstanceArns']
try:
nxt_tok = resp[u'nextToken']
... | import boto3
def main(event, context):
client = boto3.client(u'ecs')
inspect_clusters = [u'staging1']
for cluster in inspect_clusters:
resp = client.list_container_instances(
cluster=cluster
)
instances = resp[u'containerInstanceArns']
try:
nxt_tok = resp[u'nextToken']
whil... | <commit_before>import boto3
def main(event, context):
client = boto3.client(u'ecs')
inspect_clusters = [u'staging1']
for cluster in inspect_clusters:
resp = client.list_container_instances(
cluster=cluster
)
instances = resp[u'containerInstanceArns']
try:
nxt_tok = resp[u'nextToke... |
f5b9b755eaf7c5935a6b5c6b1014cc3df90323bc | scripts/get_bump_version.py | scripts/get_bump_version.py | from __future__ import print_function
import subprocess
def get_version_from_git():
cmd = ["git", "describe", "--tags", "--long", "--always"]
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
code = proc.wait()
if code != 0:
print("Failed to run: %s" % " ".join(cmd))
sys.exit(1)
... | from __future__ import print_function
import subprocess
def get_version_from_git():
cmd = ["git", "describe", "--tags", "--long", "--always"]
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
code = proc.wait()
if code != 0:
print("Failed to run: %s" % " ".join(cmd))
sys.exit(1)
... | Use dash to be compliant with XXX-devel pattern. | Use dash to be compliant with XXX-devel pattern.
| Python | bsd-3-clause | abele/bokeh,timothydmorton/bokeh,Karel-van-de-Plassche/bokeh,carlvlewis/bokeh,philippjfr/bokeh,bokeh/bokeh,stonebig/bokeh,khkaminska/bokeh,timothydmorton/bokeh,justacec/bokeh,khkaminska/bokeh,ahmadia/bokeh,laurent-george/bokeh,ericdill/bokeh,ericmjl/bokeh,paultcochrane/bokeh,maxalbert/bokeh,aiguofer/bokeh,CrazyGuo/boke... | from __future__ import print_function
import subprocess
def get_version_from_git():
cmd = ["git", "describe", "--tags", "--long", "--always"]
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
code = proc.wait()
if code != 0:
print("Failed to run: %s" % " ".join(cmd))
sys.exit(1)
... | from __future__ import print_function
import subprocess
def get_version_from_git():
cmd = ["git", "describe", "--tags", "--long", "--always"]
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
code = proc.wait()
if code != 0:
print("Failed to run: %s" % " ".join(cmd))
sys.exit(1)
... | <commit_before>from __future__ import print_function
import subprocess
def get_version_from_git():
cmd = ["git", "describe", "--tags", "--long", "--always"]
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
code = proc.wait()
if code != 0:
print("Failed to run: %s" % " ".join(cmd))
... | from __future__ import print_function
import subprocess
def get_version_from_git():
cmd = ["git", "describe", "--tags", "--long", "--always"]
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
code = proc.wait()
if code != 0:
print("Failed to run: %s" % " ".join(cmd))
sys.exit(1)
... | from __future__ import print_function
import subprocess
def get_version_from_git():
cmd = ["git", "describe", "--tags", "--long", "--always"]
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
code = proc.wait()
if code != 0:
print("Failed to run: %s" % " ".join(cmd))
sys.exit(1)
... | <commit_before>from __future__ import print_function
import subprocess
def get_version_from_git():
cmd = ["git", "describe", "--tags", "--long", "--always"]
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
code = proc.wait()
if code != 0:
print("Failed to run: %s" % " ".join(cmd))
... |
4b30b6dd4eb24c36cd32d37bf6555be79cdc80a8 | scripts/maf_split_by_src.py | scripts/maf_split_by_src.py | #!/usr/bin/env python2.3
"""
Read a MAF from stdin and break into a set of mafs containing
no more than a certain number of columns
"""
usage = "usage: %prog"
import sys, string
import bx.align.maf
from optparse import OptionParser
import psyco_full
INF="inf"
def __main__():
# Parse command line arguments
... | #!/usr/bin/env python2.3
"""
Read a MAF from stdin and break into a set of mafs containing
no more than a certain number of columns
"""
usage = "usage: %prog"
import sys, string
import bx.align.maf
from optparse import OptionParser
import psyco_full
INF="inf"
def __main__():
# Parse command line arguments
... | Allow splitting by a particular component (by index) | Allow splitting by a particular component (by index)
| Python | mit | uhjish/bx-python,uhjish/bx-python,uhjish/bx-python | #!/usr/bin/env python2.3
"""
Read a MAF from stdin and break into a set of mafs containing
no more than a certain number of columns
"""
usage = "usage: %prog"
import sys, string
import bx.align.maf
from optparse import OptionParser
import psyco_full
INF="inf"
def __main__():
# Parse command line arguments
... | #!/usr/bin/env python2.3
"""
Read a MAF from stdin and break into a set of mafs containing
no more than a certain number of columns
"""
usage = "usage: %prog"
import sys, string
import bx.align.maf
from optparse import OptionParser
import psyco_full
INF="inf"
def __main__():
# Parse command line arguments
... | <commit_before>#!/usr/bin/env python2.3
"""
Read a MAF from stdin and break into a set of mafs containing
no more than a certain number of columns
"""
usage = "usage: %prog"
import sys, string
import bx.align.maf
from optparse import OptionParser
import psyco_full
INF="inf"
def __main__():
# Parse command l... | #!/usr/bin/env python2.3
"""
Read a MAF from stdin and break into a set of mafs containing
no more than a certain number of columns
"""
usage = "usage: %prog"
import sys, string
import bx.align.maf
from optparse import OptionParser
import psyco_full
INF="inf"
def __main__():
# Parse command line arguments
... | #!/usr/bin/env python2.3
"""
Read a MAF from stdin and break into a set of mafs containing
no more than a certain number of columns
"""
usage = "usage: %prog"
import sys, string
import bx.align.maf
from optparse import OptionParser
import psyco_full
INF="inf"
def __main__():
# Parse command line arguments
... | <commit_before>#!/usr/bin/env python2.3
"""
Read a MAF from stdin and break into a set of mafs containing
no more than a certain number of columns
"""
usage = "usage: %prog"
import sys, string
import bx.align.maf
from optparse import OptionParser
import psyco_full
INF="inf"
def __main__():
# Parse command l... |
c02900e7fb8657316fa647f92c4f9ddbcedb2b7c | rma/helpers/formating.py | rma/helpers/formating.py | from math import floor
from collections import Counter
def floored_percentage(val, digits):
"""
Return string of floored value with given digits after period
:param val:
:param digits:
:return:
"""
val *= 10 ** (digits + 2)
return '{1:.{0}f}%'.format(digits, floor(val) / 10 ** digits)... | from math import floor
from collections import Counter
def floored_percentage(val, digits):
"""
Return string of floored value with given digits after period
:param val:
:param digits:
:return:
"""
val *= 10 ** (digits + 2)
return '{1:.{0}f}%'.format(digits, floor(val) / 10 ** digits)... | Add transforming function to pref_encodings | Add transforming function to pref_encodings
| Python | mit | gamenet/redis-memory-analyzer | from math import floor
from collections import Counter
def floored_percentage(val, digits):
"""
Return string of floored value with given digits after period
:param val:
:param digits:
:return:
"""
val *= 10 ** (digits + 2)
return '{1:.{0}f}%'.format(digits, floor(val) / 10 ** digits)... | from math import floor
from collections import Counter
def floored_percentage(val, digits):
"""
Return string of floored value with given digits after period
:param val:
:param digits:
:return:
"""
val *= 10 ** (digits + 2)
return '{1:.{0}f}%'.format(digits, floor(val) / 10 ** digits)... | <commit_before>from math import floor
from collections import Counter
def floored_percentage(val, digits):
"""
Return string of floored value with given digits after period
:param val:
:param digits:
:return:
"""
val *= 10 ** (digits + 2)
return '{1:.{0}f}%'.format(digits, floor(val) ... | from math import floor
from collections import Counter
def floored_percentage(val, digits):
"""
Return string of floored value with given digits after period
:param val:
:param digits:
:return:
"""
val *= 10 ** (digits + 2)
return '{1:.{0}f}%'.format(digits, floor(val) / 10 ** digits)... | from math import floor
from collections import Counter
def floored_percentage(val, digits):
"""
Return string of floored value with given digits after period
:param val:
:param digits:
:return:
"""
val *= 10 ** (digits + 2)
return '{1:.{0}f}%'.format(digits, floor(val) / 10 ** digits)... | <commit_before>from math import floor
from collections import Counter
def floored_percentage(val, digits):
"""
Return string of floored value with given digits after period
:param val:
:param digits:
:return:
"""
val *= 10 ** (digits + 2)
return '{1:.{0}f}%'.format(digits, floor(val) ... |
c0882e8096d1fecd5785a85e43a472d2e6d184db | error_proxy.py | error_proxy.py | #!/usr/bin/env python
import sys
import json
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
class ErrorHTTPRequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(420)
if sys.argv[1:]:
config_file = sys.argv[1:]
else:
config_file = "Proxyfile"
with open(config_... | #!/usr/bin/env python
import sys
import json
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
class ErrorHTTPRequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(self.config['get_response'])
if sys.argv[1:]:
config_file = sys.argv[1:]
else:
config_file = "Prox... | Configure GET response via Proxyfile | Configure GET response via Proxyfile
| Python | mit | pozorvlak/error_proxy | #!/usr/bin/env python
import sys
import json
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
class ErrorHTTPRequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(420)
if sys.argv[1:]:
config_file = sys.argv[1:]
else:
config_file = "Proxyfile"
with open(config_... | #!/usr/bin/env python
import sys
import json
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
class ErrorHTTPRequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(self.config['get_response'])
if sys.argv[1:]:
config_file = sys.argv[1:]
else:
config_file = "Prox... | <commit_before>#!/usr/bin/env python
import sys
import json
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
class ErrorHTTPRequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(420)
if sys.argv[1:]:
config_file = sys.argv[1:]
else:
config_file = "Proxyfile"
wi... | #!/usr/bin/env python
import sys
import json
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
class ErrorHTTPRequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(self.config['get_response'])
if sys.argv[1:]:
config_file = sys.argv[1:]
else:
config_file = "Prox... | #!/usr/bin/env python
import sys
import json
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
class ErrorHTTPRequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(420)
if sys.argv[1:]:
config_file = sys.argv[1:]
else:
config_file = "Proxyfile"
with open(config_... | <commit_before>#!/usr/bin/env python
import sys
import json
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
class ErrorHTTPRequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(420)
if sys.argv[1:]:
config_file = sys.argv[1:]
else:
config_file = "Proxyfile"
wi... |
cfe4148feac51a9be6ff74e978a22f1493adff8b | doajtest/unit/test_tasks_sitemap.py | doajtest/unit/test_tasks_sitemap.py | from doajtest.helpers import DoajTestCase
from portality.core import app
from portality.tasks import sitemap
from portality.background import BackgroundApi
import os, shutil, time
from portality.lib import paths
from portality.store import StoreFactory
class TestSitemap(DoajTestCase):
store_impl = None
@clas... | from doajtest.helpers import DoajTestCase
from portality.core import app
from portality.tasks import sitemap
from portality.background import BackgroundApi
import time
from portality.store import StoreFactory
class TestSitemap(DoajTestCase):
store_impl = None
@classmethod
def setUpClass(cls) -> None:
... | Increase timeout for slow test | Increase timeout for slow test
| Python | apache-2.0 | DOAJ/doaj,DOAJ/doaj,DOAJ/doaj,DOAJ/doaj | from doajtest.helpers import DoajTestCase
from portality.core import app
from portality.tasks import sitemap
from portality.background import BackgroundApi
import os, shutil, time
from portality.lib import paths
from portality.store import StoreFactory
class TestSitemap(DoajTestCase):
store_impl = None
@clas... | from doajtest.helpers import DoajTestCase
from portality.core import app
from portality.tasks import sitemap
from portality.background import BackgroundApi
import time
from portality.store import StoreFactory
class TestSitemap(DoajTestCase):
store_impl = None
@classmethod
def setUpClass(cls) -> None:
... | <commit_before>from doajtest.helpers import DoajTestCase
from portality.core import app
from portality.tasks import sitemap
from portality.background import BackgroundApi
import os, shutil, time
from portality.lib import paths
from portality.store import StoreFactory
class TestSitemap(DoajTestCase):
store_impl = ... | from doajtest.helpers import DoajTestCase
from portality.core import app
from portality.tasks import sitemap
from portality.background import BackgroundApi
import time
from portality.store import StoreFactory
class TestSitemap(DoajTestCase):
store_impl = None
@classmethod
def setUpClass(cls) -> None:
... | from doajtest.helpers import DoajTestCase
from portality.core import app
from portality.tasks import sitemap
from portality.background import BackgroundApi
import os, shutil, time
from portality.lib import paths
from portality.store import StoreFactory
class TestSitemap(DoajTestCase):
store_impl = None
@clas... | <commit_before>from doajtest.helpers import DoajTestCase
from portality.core import app
from portality.tasks import sitemap
from portality.background import BackgroundApi
import os, shutil, time
from portality.lib import paths
from portality.store import StoreFactory
class TestSitemap(DoajTestCase):
store_impl = ... |
611a00496834b610c2663f408c94fb73b8785980 | rpc_client/rpc_client.py | rpc_client/rpc_client.py | #!/usr/bin/python
import xmlrpclib, logging
from ConfigParser import SafeConfigParser
# Configure logging.
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%m/%d %H:%M:%S',
filename='/tmp/kts46_rpc... | #!/usr/bin/python
import xmlrpclib, logging
from ConfigParser import SafeConfigParser
def init():
# Configure logging.
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%m/%d %H:%M:%S',
... | Move initialization of logger and cfg parser to separate function. | Move initialization of logger and cfg parser to separate function.
| Python | apache-2.0 | anthony-kolesov/kts46,anthony-kolesov/kts46,anthony-kolesov/kts46,anthony-kolesov/kts46 | #!/usr/bin/python
import xmlrpclib, logging
from ConfigParser import SafeConfigParser
# Configure logging.
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%m/%d %H:%M:%S',
filename='/tmp/kts46_rpc... | #!/usr/bin/python
import xmlrpclib, logging
from ConfigParser import SafeConfigParser
def init():
# Configure logging.
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%m/%d %H:%M:%S',
... | <commit_before>#!/usr/bin/python
import xmlrpclib, logging
from ConfigParser import SafeConfigParser
# Configure logging.
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%m/%d %H:%M:%S',
filename=... | #!/usr/bin/python
import xmlrpclib, logging
from ConfigParser import SafeConfigParser
def init():
# Configure logging.
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%m/%d %H:%M:%S',
... | #!/usr/bin/python
import xmlrpclib, logging
from ConfigParser import SafeConfigParser
# Configure logging.
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%m/%d %H:%M:%S',
filename='/tmp/kts46_rpc... | <commit_before>#!/usr/bin/python
import xmlrpclib, logging
from ConfigParser import SafeConfigParser
# Configure logging.
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%m/%d %H:%M:%S',
filename=... |
fb07eabac3847a1d454bbe6d663deef6ec47fc9b | seo/escaped_fragment/app.py | seo/escaped_fragment/app.py | # Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
from subprocess import check_output, CalledProcessError
from urllib import unquote
def application(env, start_response):
status = "200 OK"
response = ""
qs = env.get("QUERY_STRING", None)
if not qs or not qs.startswith("_escap... | # Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
from subprocess import check_output, CalledProcessError
from urllib import unquote
def application(env, start_response):
status = "200 OK"
response = ""
qs = env.get("QUERY_STRING", None)
if not qs or not qs.startswith("_escap... | Fix broken content rendered by PhJS | Fix broken content rendered by PhJS
| Python | apache-2.0 | platformio/platformio-web,orgkhnargh/platformio-web,orgkhnargh/platformio-web,platformio/platformio-web,orgkhnargh/platformio-web | # Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
from subprocess import check_output, CalledProcessError
from urllib import unquote
def application(env, start_response):
status = "200 OK"
response = ""
qs = env.get("QUERY_STRING", None)
if not qs or not qs.startswith("_escap... | # Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
from subprocess import check_output, CalledProcessError
from urllib import unquote
def application(env, start_response):
status = "200 OK"
response = ""
qs = env.get("QUERY_STRING", None)
if not qs or not qs.startswith("_escap... | <commit_before># Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
from subprocess import check_output, CalledProcessError
from urllib import unquote
def application(env, start_response):
status = "200 OK"
response = ""
qs = env.get("QUERY_STRING", None)
if not qs or not qs.sta... | # Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
from subprocess import check_output, CalledProcessError
from urllib import unquote
def application(env, start_response):
status = "200 OK"
response = ""
qs = env.get("QUERY_STRING", None)
if not qs or not qs.startswith("_escap... | # Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
from subprocess import check_output, CalledProcessError
from urllib import unquote
def application(env, start_response):
status = "200 OK"
response = ""
qs = env.get("QUERY_STRING", None)
if not qs or not qs.startswith("_escap... | <commit_before># Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
from subprocess import check_output, CalledProcessError
from urllib import unquote
def application(env, start_response):
status = "200 OK"
response = ""
qs = env.get("QUERY_STRING", None)
if not qs or not qs.sta... |
632a655f8f1f5867069f1c4d381417fa567b79a6 | controlled_vocabularies/urls.py | controlled_vocabularies/urls.py | from django.urls import re_path
from controlled_vocabularies.views import (
vocabulary_list, verbose_vocabularies, about,
all_vocabularies, term_list, vocabulary_file
)
urlpatterns = [
# Search View
re_path(r'^$', vocabulary_list, name="vocabulary_list"),
re_path(r'^all-verbose/?$', verbose_vocabul... | from django.urls import path, re_path
from controlled_vocabularies.views import (
vocabulary_list, verbose_vocabularies, about,
all_vocabularies, term_list, vocabulary_file
)
urlpatterns = [
# Search View
path('', vocabulary_list, name="vocabulary_list"),
path('all-verbose/', verbose_vocabularies, ... | Replace re_path with path wherever possible | Replace re_path with path wherever possible
| Python | bsd-3-clause | unt-libraries/django-controlled-vocabularies,unt-libraries/django-controlled-vocabularies | from django.urls import re_path
from controlled_vocabularies.views import (
vocabulary_list, verbose_vocabularies, about,
all_vocabularies, term_list, vocabulary_file
)
urlpatterns = [
# Search View
re_path(r'^$', vocabulary_list, name="vocabulary_list"),
re_path(r'^all-verbose/?$', verbose_vocabul... | from django.urls import path, re_path
from controlled_vocabularies.views import (
vocabulary_list, verbose_vocabularies, about,
all_vocabularies, term_list, vocabulary_file
)
urlpatterns = [
# Search View
path('', vocabulary_list, name="vocabulary_list"),
path('all-verbose/', verbose_vocabularies, ... | <commit_before>from django.urls import re_path
from controlled_vocabularies.views import (
vocabulary_list, verbose_vocabularies, about,
all_vocabularies, term_list, vocabulary_file
)
urlpatterns = [
# Search View
re_path(r'^$', vocabulary_list, name="vocabulary_list"),
re_path(r'^all-verbose/?$', ... | from django.urls import path, re_path
from controlled_vocabularies.views import (
vocabulary_list, verbose_vocabularies, about,
all_vocabularies, term_list, vocabulary_file
)
urlpatterns = [
# Search View
path('', vocabulary_list, name="vocabulary_list"),
path('all-verbose/', verbose_vocabularies, ... | from django.urls import re_path
from controlled_vocabularies.views import (
vocabulary_list, verbose_vocabularies, about,
all_vocabularies, term_list, vocabulary_file
)
urlpatterns = [
# Search View
re_path(r'^$', vocabulary_list, name="vocabulary_list"),
re_path(r'^all-verbose/?$', verbose_vocabul... | <commit_before>from django.urls import re_path
from controlled_vocabularies.views import (
vocabulary_list, verbose_vocabularies, about,
all_vocabularies, term_list, vocabulary_file
)
urlpatterns = [
# Search View
re_path(r'^$', vocabulary_list, name="vocabulary_list"),
re_path(r'^all-verbose/?$', ... |
ebf9628a55a82daa489f2bd5e2d83f2218369f01 | controllers/accounts_manager.py | controllers/accounts_manager.py | from flask_restful import Resource
class AccountsManager(Resource):
"""docstring for AccountsManager."""
def get(self):
return {"route": "login"}
def post(self):
return {"route": "register"}
| from flask import jsonify, make_response
from flask_restful import Resource, reqparse
from app.models import User
from app.db_instance import save
from validator import validate
class AccountsManager(Resource):
"""docstring for AccountsManager."""
def __init__(self):
self.parser = reqparse.RequestPars... | Add Register resource to handle user registration and save user data to the database | Add Register resource to handle user registration and save user data to the database
| Python | mit | brayoh/bucket-list-api | from flask_restful import Resource
class AccountsManager(Resource):
"""docstring for AccountsManager."""
def get(self):
return {"route": "login"}
def post(self):
return {"route": "register"}
Add Register resource to handle user registration and save user data to the database | from flask import jsonify, make_response
from flask_restful import Resource, reqparse
from app.models import User
from app.db_instance import save
from validator import validate
class AccountsManager(Resource):
"""docstring for AccountsManager."""
def __init__(self):
self.parser = reqparse.RequestPars... | <commit_before>from flask_restful import Resource
class AccountsManager(Resource):
"""docstring for AccountsManager."""
def get(self):
return {"route": "login"}
def post(self):
return {"route": "register"}
<commit_msg>Add Register resource to handle user registration and save user data to... | from flask import jsonify, make_response
from flask_restful import Resource, reqparse
from app.models import User
from app.db_instance import save
from validator import validate
class AccountsManager(Resource):
"""docstring for AccountsManager."""
def __init__(self):
self.parser = reqparse.RequestPars... | from flask_restful import Resource
class AccountsManager(Resource):
"""docstring for AccountsManager."""
def get(self):
return {"route": "login"}
def post(self):
return {"route": "register"}
Add Register resource to handle user registration and save user data to the databasefrom flask imp... | <commit_before>from flask_restful import Resource
class AccountsManager(Resource):
"""docstring for AccountsManager."""
def get(self):
return {"route": "login"}
def post(self):
return {"route": "register"}
<commit_msg>Add Register resource to handle user registration and save user data to... |
45e180a6769584cad372399f9383dbb965e8ece8 | live_studio/build/views.py | live_studio/build/views.py | from django.http import HttpResponseRedirect
from django.contrib import messages
from django.shortcuts import get_object_or_404
from django.views.decorators.http import require_POST
@require_POST
def enqueue(request, config_id):
config = get_object_or_404(request.user.configs, pk=config_id)
config.builds.crea... | from django.http import HttpResponseRedirect
from django.contrib import messages
from django.shortcuts import get_object_or_404
from django.views.decorators.http import require_POST
@require_POST
def enqueue(request, config_id):
config = get_object_or_404(request.user.configs, pk=config_id)
config.builds.crea... | Make it clearer that you get an email when the build completes | Make it clearer that you get an email when the build completes
| Python | agpl-3.0 | debian-live/live-studio,debian-live/live-studio,debian-live/live-studio | from django.http import HttpResponseRedirect
from django.contrib import messages
from django.shortcuts import get_object_or_404
from django.views.decorators.http import require_POST
@require_POST
def enqueue(request, config_id):
config = get_object_or_404(request.user.configs, pk=config_id)
config.builds.crea... | from django.http import HttpResponseRedirect
from django.contrib import messages
from django.shortcuts import get_object_or_404
from django.views.decorators.http import require_POST
@require_POST
def enqueue(request, config_id):
config = get_object_or_404(request.user.configs, pk=config_id)
config.builds.crea... | <commit_before>from django.http import HttpResponseRedirect
from django.contrib import messages
from django.shortcuts import get_object_or_404
from django.views.decorators.http import require_POST
@require_POST
def enqueue(request, config_id):
config = get_object_or_404(request.user.configs, pk=config_id)
con... | from django.http import HttpResponseRedirect
from django.contrib import messages
from django.shortcuts import get_object_or_404
from django.views.decorators.http import require_POST
@require_POST
def enqueue(request, config_id):
config = get_object_or_404(request.user.configs, pk=config_id)
config.builds.crea... | from django.http import HttpResponseRedirect
from django.contrib import messages
from django.shortcuts import get_object_or_404
from django.views.decorators.http import require_POST
@require_POST
def enqueue(request, config_id):
config = get_object_or_404(request.user.configs, pk=config_id)
config.builds.crea... | <commit_before>from django.http import HttpResponseRedirect
from django.contrib import messages
from django.shortcuts import get_object_or_404
from django.views.decorators.http import require_POST
@require_POST
def enqueue(request, config_id):
config = get_object_or_404(request.user.configs, pk=config_id)
con... |
bff55b65cd08259c64171e0ad5fd836875ce3008 | example/search/views.py | example/search/views.py | from __future__ import absolute_import, unicode_literals
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.shortcuts import render
import wagtail
if wagtail.VERSION >= (2, 0):
from wagtail.core.models import Page
from wagtail.search.models import Query
else:
from wagtail... | from __future__ import absolute_import, unicode_literals
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.shortcuts import render
from wagtail.core.models import Page
from wagtail.search.models import Query
def search(request):
search_query = request.GET.get('query', None)
... | Drop wagtail 1.13 support from example | Drop wagtail 1.13 support from example
| Python | mit | Frojd/wagtail-geo-widget,Frojd/wagtail-geo-widget,Frojd/wagtail-geo-widget,Frojd/wagtail-geo-widget | from __future__ import absolute_import, unicode_literals
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.shortcuts import render
import wagtail
if wagtail.VERSION >= (2, 0):
from wagtail.core.models import Page
from wagtail.search.models import Query
else:
from wagtail... | from __future__ import absolute_import, unicode_literals
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.shortcuts import render
from wagtail.core.models import Page
from wagtail.search.models import Query
def search(request):
search_query = request.GET.get('query', None)
... | <commit_before>from __future__ import absolute_import, unicode_literals
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.shortcuts import render
import wagtail
if wagtail.VERSION >= (2, 0):
from wagtail.core.models import Page
from wagtail.search.models import Query
else:
... | from __future__ import absolute_import, unicode_literals
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.shortcuts import render
from wagtail.core.models import Page
from wagtail.search.models import Query
def search(request):
search_query = request.GET.get('query', None)
... | from __future__ import absolute_import, unicode_literals
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.shortcuts import render
import wagtail
if wagtail.VERSION >= (2, 0):
from wagtail.core.models import Page
from wagtail.search.models import Query
else:
from wagtail... | <commit_before>from __future__ import absolute_import, unicode_literals
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.shortcuts import render
import wagtail
if wagtail.VERSION >= (2, 0):
from wagtail.core.models import Page
from wagtail.search.models import Query
else:
... |
9080e9c967fa5e2af43c42a48de8b8ec3231a866 | src/tests/behave/agent/features/steps/common.py | src/tests/behave/agent/features/steps/common.py | from collections import defaultdict
from behave import given, then, when, step, use_step_matcher
use_step_matcher("parse")
@given('something with the agent')
def step_something_with_the_agent(context):
"""
:type context: behave.runner.Context
"""
pass
| from collections import defaultdict
from behave import given, then, when, step, use_step_matcher
use_step_matcher("parse")
@given('an agent is running on {ip}')
def step_an_agent_is_running_on_ip(context, ip):
"""
:type context: behave.runner.Context
:type ip: str
"""
pass
| Add ip argument to agent running step | Add ip argument to agent running step
| Python | apache-2.0 | jr0d/mercury,jr0d/mercury | from collections import defaultdict
from behave import given, then, when, step, use_step_matcher
use_step_matcher("parse")
@given('something with the agent')
def step_something_with_the_agent(context):
"""
:type context: behave.runner.Context
"""
pass
Add ip argument to agent running step | from collections import defaultdict
from behave import given, then, when, step, use_step_matcher
use_step_matcher("parse")
@given('an agent is running on {ip}')
def step_an_agent_is_running_on_ip(context, ip):
"""
:type context: behave.runner.Context
:type ip: str
"""
pass
| <commit_before>from collections import defaultdict
from behave import given, then, when, step, use_step_matcher
use_step_matcher("parse")
@given('something with the agent')
def step_something_with_the_agent(context):
"""
:type context: behave.runner.Context
"""
pass
<commit_msg>Add ip argument to a... | from collections import defaultdict
from behave import given, then, when, step, use_step_matcher
use_step_matcher("parse")
@given('an agent is running on {ip}')
def step_an_agent_is_running_on_ip(context, ip):
"""
:type context: behave.runner.Context
:type ip: str
"""
pass
| from collections import defaultdict
from behave import given, then, when, step, use_step_matcher
use_step_matcher("parse")
@given('something with the agent')
def step_something_with_the_agent(context):
"""
:type context: behave.runner.Context
"""
pass
Add ip argument to agent running stepfrom colle... | <commit_before>from collections import defaultdict
from behave import given, then, when, step, use_step_matcher
use_step_matcher("parse")
@given('something with the agent')
def step_something_with_the_agent(context):
"""
:type context: behave.runner.Context
"""
pass
<commit_msg>Add ip argument to a... |
a23061a7efb241186ddf59911d6f1513cdec61a7 | geotrek/core/urls.py | geotrek/core/urls.py | from django.conf import settings
from django.conf.urls import patterns, url
from mapentity import registry
from geotrek.altimetry.urls import AltimetryEntityOptions
from geotrek.core.models import Path, Trail
from geotrek.core.views import get_graph_json
if settings.TREKKING_TOPOLOGY_ENABLED:
urlpatterns = patt... | from django.conf import settings
from django.conf.urls import patterns, url
from mapentity import registry
from geotrek.altimetry.urls import AltimetryEntityOptions
from geotrek.core.models import Path, Trail
from geotrek.core.views import get_graph_json
urlpatterns = patterns('',
url(r'^api/graph.json$', get_g... | Fix URL error with Geotrek light | Fix URL error with Geotrek light
| Python | bsd-2-clause | johan--/Geotrek,GeotrekCE/Geotrek-admin,Anaethelion/Geotrek,mabhub/Geotrek,GeotrekCE/Geotrek-admin,johan--/Geotrek,makinacorpus/Geotrek,Anaethelion/Geotrek,Anaethelion/Geotrek,johan--/Geotrek,mabhub/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,Anaethelion/Geotrek,GeotrekCE/Geotrek-admin,johan--/Geotrek,makinaco... | from django.conf import settings
from django.conf.urls import patterns, url
from mapentity import registry
from geotrek.altimetry.urls import AltimetryEntityOptions
from geotrek.core.models import Path, Trail
from geotrek.core.views import get_graph_json
if settings.TREKKING_TOPOLOGY_ENABLED:
urlpatterns = patt... | from django.conf import settings
from django.conf.urls import patterns, url
from mapentity import registry
from geotrek.altimetry.urls import AltimetryEntityOptions
from geotrek.core.models import Path, Trail
from geotrek.core.views import get_graph_json
urlpatterns = patterns('',
url(r'^api/graph.json$', get_g... | <commit_before>from django.conf import settings
from django.conf.urls import patterns, url
from mapentity import registry
from geotrek.altimetry.urls import AltimetryEntityOptions
from geotrek.core.models import Path, Trail
from geotrek.core.views import get_graph_json
if settings.TREKKING_TOPOLOGY_ENABLED:
url... | from django.conf import settings
from django.conf.urls import patterns, url
from mapentity import registry
from geotrek.altimetry.urls import AltimetryEntityOptions
from geotrek.core.models import Path, Trail
from geotrek.core.views import get_graph_json
urlpatterns = patterns('',
url(r'^api/graph.json$', get_g... | from django.conf import settings
from django.conf.urls import patterns, url
from mapentity import registry
from geotrek.altimetry.urls import AltimetryEntityOptions
from geotrek.core.models import Path, Trail
from geotrek.core.views import get_graph_json
if settings.TREKKING_TOPOLOGY_ENABLED:
urlpatterns = patt... | <commit_before>from django.conf import settings
from django.conf.urls import patterns, url
from mapentity import registry
from geotrek.altimetry.urls import AltimetryEntityOptions
from geotrek.core.models import Path, Trail
from geotrek.core.views import get_graph_json
if settings.TREKKING_TOPOLOGY_ENABLED:
url... |
355b70412f8b725dcf6771967387cf4ba999c98b | fetch_configs/syzygy.py | fetch_configs/syzygy.py | # Copyright 2016 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.
import sys
import config_util # pylint: disable=import-error
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disable=no... | # Copyright 2016 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.
import sys
import config_util # pylint: disable=import-error
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disable=no... | Update fetch config with new Syzygy location. | Update fetch config with new Syzygy location.
Change-Id: Iacc2efd6974f1a161da6e33a0d25d6329fcaaf4f
Reviewed-on: https://chromium-review.googlesource.com/692697
Commit-Queue: Sébastien Marchand <b98658856fe44d267ccfa37efbb15fc831b08ae9@chromium.org>
Reviewed-by: Aaron Gable <bbed39beedae4cdb499af742d2fcd6c63934d93b@chr... | Python | bsd-3-clause | CoherentLabs/depot_tools,CoherentLabs/depot_tools | # Copyright 2016 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.
import sys
import config_util # pylint: disable=import-error
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disable=no... | # Copyright 2016 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.
import sys
import config_util # pylint: disable=import-error
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disable=no... | <commit_before># Copyright 2016 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.
import sys
import config_util # pylint: disable=import-error
# This class doesn't need an __init__ method, so we disable the warning
# pyl... | # Copyright 2016 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.
import sys
import config_util # pylint: disable=import-error
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disable=no... | # Copyright 2016 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.
import sys
import config_util # pylint: disable=import-error
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disable=no... | <commit_before># Copyright 2016 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.
import sys
import config_util # pylint: disable=import-error
# This class doesn't need an __init__ method, so we disable the warning
# pyl... |
d115c8902d51c37dacda96a10a7bd17a1e741f4e | ooni/tests/test_errors.py | ooni/tests/test_errors.py | from twisted.trial import unittest
import ooni.errors
class TestErrors(unittest.TestCase):
def test_catch_child_failures_before_parent_failures(self):
"""
Verify that more specific Failures are caught first by
handleAllFailures() and failureToString().
Fails if a subclass is list... | from twisted.trial import unittest
import ooni.errors
class TestErrors(unittest.TestCase):
def test_catch_child_failures_before_parent_failures(self):
"""
Verify that more specific Failures are caught first by
handleAllFailures() and failureToString().
Fails if a subclass is list... | Fix typo in docstring spotted by @armadev | Fix typo in docstring spotted by @armadev
| Python | bsd-2-clause | 0xPoly/ooni-probe,0xPoly/ooni-probe,0xPoly/ooni-probe,0xPoly/ooni-probe | from twisted.trial import unittest
import ooni.errors
class TestErrors(unittest.TestCase):
def test_catch_child_failures_before_parent_failures(self):
"""
Verify that more specific Failures are caught first by
handleAllFailures() and failureToString().
Fails if a subclass is list... | from twisted.trial import unittest
import ooni.errors
class TestErrors(unittest.TestCase):
def test_catch_child_failures_before_parent_failures(self):
"""
Verify that more specific Failures are caught first by
handleAllFailures() and failureToString().
Fails if a subclass is list... | <commit_before>from twisted.trial import unittest
import ooni.errors
class TestErrors(unittest.TestCase):
def test_catch_child_failures_before_parent_failures(self):
"""
Verify that more specific Failures are caught first by
handleAllFailures() and failureToString().
Fails if a s... | from twisted.trial import unittest
import ooni.errors
class TestErrors(unittest.TestCase):
def test_catch_child_failures_before_parent_failures(self):
"""
Verify that more specific Failures are caught first by
handleAllFailures() and failureToString().
Fails if a subclass is list... | from twisted.trial import unittest
import ooni.errors
class TestErrors(unittest.TestCase):
def test_catch_child_failures_before_parent_failures(self):
"""
Verify that more specific Failures are caught first by
handleAllFailures() and failureToString().
Fails if a subclass is list... | <commit_before>from twisted.trial import unittest
import ooni.errors
class TestErrors(unittest.TestCase):
def test_catch_child_failures_before_parent_failures(self):
"""
Verify that more specific Failures are caught first by
handleAllFailures() and failureToString().
Fails if a s... |
e0d8289c8ea3240f1c7cceb4e42470c814a81e61 | members/serializers.py | members/serializers.py | from rest_framework import serializers
from members.models import Band
from members.models import BandMember
class BandMemberSerializer(serializers.ModelSerializer):
class Meta:
model = BandMember
fields = ('id',
'account',
'section',
'instrument_number',
... | from rest_framework import serializers
from members.models import Band
from members.models import BandMember
class BandMemberSerializer(serializers.ModelSerializer):
class Meta:
model = BandMember
fields = ('id',
'account',
'section',
'instrument_number',
... | Add band members as unassigned to new bands | Add band members as unassigned to new bands
| Python | mit | KonichiwaKen/band-dashboard,KonichiwaKen/band-dashboard,KonichiwaKen/band-dashboard | from rest_framework import serializers
from members.models import Band
from members.models import BandMember
class BandMemberSerializer(serializers.ModelSerializer):
class Meta:
model = BandMember
fields = ('id',
'account',
'section',
'instrument_number',
... | from rest_framework import serializers
from members.models import Band
from members.models import BandMember
class BandMemberSerializer(serializers.ModelSerializer):
class Meta:
model = BandMember
fields = ('id',
'account',
'section',
'instrument_number',
... | <commit_before>from rest_framework import serializers
from members.models import Band
from members.models import BandMember
class BandMemberSerializer(serializers.ModelSerializer):
class Meta:
model = BandMember
fields = ('id',
'account',
'section',
'instrumen... | from rest_framework import serializers
from members.models import Band
from members.models import BandMember
class BandMemberSerializer(serializers.ModelSerializer):
class Meta:
model = BandMember
fields = ('id',
'account',
'section',
'instrument_number',
... | from rest_framework import serializers
from members.models import Band
from members.models import BandMember
class BandMemberSerializer(serializers.ModelSerializer):
class Meta:
model = BandMember
fields = ('id',
'account',
'section',
'instrument_number',
... | <commit_before>from rest_framework import serializers
from members.models import Band
from members.models import BandMember
class BandMemberSerializer(serializers.ModelSerializer):
class Meta:
model = BandMember
fields = ('id',
'account',
'section',
'instrumen... |
1cf14753174b6fdbd5999ac857ce0e55852194b6 | dmoj/executors/ruby_executor.py | dmoj/executors/ruby_executor.py | import os
from .base_executor import ScriptExecutor
class RubyExecutor(ScriptExecutor):
ext = '.rb'
name = 'RUBY'
address_grace = 65536
test_program = 'puts gets'
def get_cmdline(self):
return [self.get_command(), '--disable-gems', self._code]
@classmethod
def get_version_flags(... | import os
import re
from .base_executor import ScriptExecutor
class RubyExecutor(ScriptExecutor):
ext = '.rb'
name = 'RUBY'
address_grace = 65536
test_program = 'puts gets'
def get_fs(self):
fs = super(RubyExecutor, self).get_fs()
home = self.runtime_dict.get('%s_home' % self.get... | Make Ruby work on Travis | Make Ruby work on Travis
| Python | agpl-3.0 | DMOJ/judge,DMOJ/judge,DMOJ/judge | import os
from .base_executor import ScriptExecutor
class RubyExecutor(ScriptExecutor):
ext = '.rb'
name = 'RUBY'
address_grace = 65536
test_program = 'puts gets'
def get_cmdline(self):
return [self.get_command(), '--disable-gems', self._code]
@classmethod
def get_version_flags(... | import os
import re
from .base_executor import ScriptExecutor
class RubyExecutor(ScriptExecutor):
ext = '.rb'
name = 'RUBY'
address_grace = 65536
test_program = 'puts gets'
def get_fs(self):
fs = super(RubyExecutor, self).get_fs()
home = self.runtime_dict.get('%s_home' % self.get... | <commit_before>import os
from .base_executor import ScriptExecutor
class RubyExecutor(ScriptExecutor):
ext = '.rb'
name = 'RUBY'
address_grace = 65536
test_program = 'puts gets'
def get_cmdline(self):
return [self.get_command(), '--disable-gems', self._code]
@classmethod
def get... | import os
import re
from .base_executor import ScriptExecutor
class RubyExecutor(ScriptExecutor):
ext = '.rb'
name = 'RUBY'
address_grace = 65536
test_program = 'puts gets'
def get_fs(self):
fs = super(RubyExecutor, self).get_fs()
home = self.runtime_dict.get('%s_home' % self.get... | import os
from .base_executor import ScriptExecutor
class RubyExecutor(ScriptExecutor):
ext = '.rb'
name = 'RUBY'
address_grace = 65536
test_program = 'puts gets'
def get_cmdline(self):
return [self.get_command(), '--disable-gems', self._code]
@classmethod
def get_version_flags(... | <commit_before>import os
from .base_executor import ScriptExecutor
class RubyExecutor(ScriptExecutor):
ext = '.rb'
name = 'RUBY'
address_grace = 65536
test_program = 'puts gets'
def get_cmdline(self):
return [self.get_command(), '--disable-gems', self._code]
@classmethod
def get... |
a735ad28d1d8996ece647dd95f68d19e629a4d53 | frigg/worker/fetcher.py | frigg/worker/fetcher.py | # -*- coding: utf8 -*-
import json
import threading
import time
import logging
from frigg.worker import config
from frigg.worker.jobs import Build
logger = logging.getLogger(__name__)
def fetcher():
redis = config.redis_client()
while redis:
task = redis.rpop('frigg:queue')
if task:
... | # -*- coding: utf8 -*-
import sys
import json
import threading
import time
import logging
from frigg.worker import config
from frigg.worker.jobs import Build
logger = logging.getLogger(__name__)
def fetcher():
redis = config.redis_client()
while redis:
task = redis.rpop('frigg:queue')
if tas... | Make worker exit after a build | Make worker exit after a build
| Python | mit | frigg/frigg-worker | # -*- coding: utf8 -*-
import json
import threading
import time
import logging
from frigg.worker import config
from frigg.worker.jobs import Build
logger = logging.getLogger(__name__)
def fetcher():
redis = config.redis_client()
while redis:
task = redis.rpop('frigg:queue')
if task:
... | # -*- coding: utf8 -*-
import sys
import json
import threading
import time
import logging
from frigg.worker import config
from frigg.worker.jobs import Build
logger = logging.getLogger(__name__)
def fetcher():
redis = config.redis_client()
while redis:
task = redis.rpop('frigg:queue')
if tas... | <commit_before># -*- coding: utf8 -*-
import json
import threading
import time
import logging
from frigg.worker import config
from frigg.worker.jobs import Build
logger = logging.getLogger(__name__)
def fetcher():
redis = config.redis_client()
while redis:
task = redis.rpop('frigg:queue')
if... | # -*- coding: utf8 -*-
import sys
import json
import threading
import time
import logging
from frigg.worker import config
from frigg.worker.jobs import Build
logger = logging.getLogger(__name__)
def fetcher():
redis = config.redis_client()
while redis:
task = redis.rpop('frigg:queue')
if tas... | # -*- coding: utf8 -*-
import json
import threading
import time
import logging
from frigg.worker import config
from frigg.worker.jobs import Build
logger = logging.getLogger(__name__)
def fetcher():
redis = config.redis_client()
while redis:
task = redis.rpop('frigg:queue')
if task:
... | <commit_before># -*- coding: utf8 -*-
import json
import threading
import time
import logging
from frigg.worker import config
from frigg.worker.jobs import Build
logger = logging.getLogger(__name__)
def fetcher():
redis = config.redis_client()
while redis:
task = redis.rpop('frigg:queue')
if... |
c02cad5047ff397229e1139109df80208e7dd5b6 | fireant/__init__.py | fireant/__init__.py | # coding: utf-8
__version__ = '{major}.{minor}.{patch}'.format(major=0, minor=12, patch=0)
| # coding: utf-8
__version__ = '{major}.{minor}.{patch}'.format(major=0, minor=13, patch=0)
| Bump fireant version to 0.13.0 | Bump fireant version to 0.13.0
| Python | apache-2.0 | kayak/fireant,mikeengland/fireant | # coding: utf-8
__version__ = '{major}.{minor}.{patch}'.format(major=0, minor=12, patch=0)
Bump fireant version to 0.13.0 | # coding: utf-8
__version__ = '{major}.{minor}.{patch}'.format(major=0, minor=13, patch=0)
| <commit_before># coding: utf-8
__version__ = '{major}.{minor}.{patch}'.format(major=0, minor=12, patch=0)
<commit_msg>Bump fireant version to 0.13.0<commit_after> | # coding: utf-8
__version__ = '{major}.{minor}.{patch}'.format(major=0, minor=13, patch=0)
| # coding: utf-8
__version__ = '{major}.{minor}.{patch}'.format(major=0, minor=12, patch=0)
Bump fireant version to 0.13.0# coding: utf-8
__version__ = '{major}.{minor}.{patch}'.format(major=0, minor=13, patch=0)
| <commit_before># coding: utf-8
__version__ = '{major}.{minor}.{patch}'.format(major=0, minor=12, patch=0)
<commit_msg>Bump fireant version to 0.13.0<commit_after># coding: utf-8
__version__ = '{major}.{minor}.{patch}'.format(major=0, minor=13, patch=0)
|
f9b4f5857d3266a2c5661920144f33aad9ef8a3f | amy/autoemails/tests/base.py | amy/autoemails/tests/base.py | import django_rq
from fakeredis import FakeStrictRedis
from redis import Redis
from rq import Queue
class FakeRedisTestCaseMixin:
"""TestCase mixin that provides easy setup of FakeRedis connection to both
Django-RQ and RQ-Scheduler, as well as test-teardown with scheduled jobs
purging."""
def setUp(s... | import django_rq
from fakeredis import FakeStrictRedis
from redis import Redis
from rq import Queue
connection = FakeStrictRedis()
class FakeRedisTestCaseMixin:
"""TestCase mixin that provides easy setup of FakeRedis connection to both
Django-RQ and RQ-Scheduler, as well as test-teardown with scheduled jobs... | Switch tests to fake redis implementation | Switch tests to fake redis implementation
| Python | mit | swcarpentry/amy,swcarpentry/amy,swcarpentry/amy,pbanaszkiewicz/amy,pbanaszkiewicz/amy,pbanaszkiewicz/amy | import django_rq
from fakeredis import FakeStrictRedis
from redis import Redis
from rq import Queue
class FakeRedisTestCaseMixin:
"""TestCase mixin that provides easy setup of FakeRedis connection to both
Django-RQ and RQ-Scheduler, as well as test-teardown with scheduled jobs
purging."""
def setUp(s... | import django_rq
from fakeredis import FakeStrictRedis
from redis import Redis
from rq import Queue
connection = FakeStrictRedis()
class FakeRedisTestCaseMixin:
"""TestCase mixin that provides easy setup of FakeRedis connection to both
Django-RQ and RQ-Scheduler, as well as test-teardown with scheduled jobs... | <commit_before>import django_rq
from fakeredis import FakeStrictRedis
from redis import Redis
from rq import Queue
class FakeRedisTestCaseMixin:
"""TestCase mixin that provides easy setup of FakeRedis connection to both
Django-RQ and RQ-Scheduler, as well as test-teardown with scheduled jobs
purging."""
... | import django_rq
from fakeredis import FakeStrictRedis
from redis import Redis
from rq import Queue
connection = FakeStrictRedis()
class FakeRedisTestCaseMixin:
"""TestCase mixin that provides easy setup of FakeRedis connection to both
Django-RQ and RQ-Scheduler, as well as test-teardown with scheduled jobs... | import django_rq
from fakeredis import FakeStrictRedis
from redis import Redis
from rq import Queue
class FakeRedisTestCaseMixin:
"""TestCase mixin that provides easy setup of FakeRedis connection to both
Django-RQ and RQ-Scheduler, as well as test-teardown with scheduled jobs
purging."""
def setUp(s... | <commit_before>import django_rq
from fakeredis import FakeStrictRedis
from redis import Redis
from rq import Queue
class FakeRedisTestCaseMixin:
"""TestCase mixin that provides easy setup of FakeRedis connection to both
Django-RQ and RQ-Scheduler, as well as test-teardown with scheduled jobs
purging."""
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.