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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5545bd1df34e6d3bb600b78b92d757ea12e3861b | printer/PlatformPhysicsOperation.py | printer/PlatformPhysicsOperation.py | from UM.Operations.Operation import Operation
from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation
from UM.Operations.TranslateOperation import TranslateOperation
## A specialised operation designed specifically to modify the previous operation.
class PlatformPhysicsOperation(Operation):
def __in... | from UM.Operations.Operation import Operation
from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation
from UM.Operations.TranslateOperation import TranslateOperation
from UM.Operations.GroupedOperation import GroupedOperation
## A specialised operation designed specifically to modify the previous operat... | Use GroupedOperation for merging PlatformPhyisicsOperation | Use GroupedOperation for merging PlatformPhyisicsOperation
| Python | agpl-3.0 | onitake/Uranium,onitake/Uranium | from UM.Operations.Operation import Operation
from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation
from UM.Operations.TranslateOperation import TranslateOperation
## A specialised operation designed specifically to modify the previous operation.
class PlatformPhysicsOperation(Operation):
def __in... | from UM.Operations.Operation import Operation
from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation
from UM.Operations.TranslateOperation import TranslateOperation
from UM.Operations.GroupedOperation import GroupedOperation
## A specialised operation designed specifically to modify the previous operat... | <commit_before>from UM.Operations.Operation import Operation
from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation
from UM.Operations.TranslateOperation import TranslateOperation
## A specialised operation designed specifically to modify the previous operation.
class PlatformPhysicsOperation(Operation... | from UM.Operations.Operation import Operation
from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation
from UM.Operations.TranslateOperation import TranslateOperation
from UM.Operations.GroupedOperation import GroupedOperation
## A specialised operation designed specifically to modify the previous operat... | from UM.Operations.Operation import Operation
from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation
from UM.Operations.TranslateOperation import TranslateOperation
## A specialised operation designed specifically to modify the previous operation.
class PlatformPhysicsOperation(Operation):
def __in... | <commit_before>from UM.Operations.Operation import Operation
from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation
from UM.Operations.TranslateOperation import TranslateOperation
## A specialised operation designed specifically to modify the previous operation.
class PlatformPhysicsOperation(Operation... |
f733300f622a4ffc1f0179c90590d543dc37113e | weber_utils/pagination.py | weber_utils/pagination.py | import functools
from flask import jsonify, request
from flask.ext.sqlalchemy import Pagination
from .request_utils import dictify_model, error_abort
def paginate_query(query, default_page_size=100, renderer=dictify_model):
try:
page_size = int(request.args.get("page_size", default_page_size))
pag... | import functools
from flask import jsonify, request
from flask.ext.sqlalchemy import Pagination
from .request_utils import dictify_model, error_abort
def paginate_query(query, default_page_size=100, renderer=dictify_model):
try:
page_size = int(request.args.get("page_size", default_page_size))
pag... | Allow renderer argument to paginated_view decorator | Allow renderer argument to paginated_view decorator
| Python | bsd-3-clause | vmalloc/weber-utils | import functools
from flask import jsonify, request
from flask.ext.sqlalchemy import Pagination
from .request_utils import dictify_model, error_abort
def paginate_query(query, default_page_size=100, renderer=dictify_model):
try:
page_size = int(request.args.get("page_size", default_page_size))
pag... | import functools
from flask import jsonify, request
from flask.ext.sqlalchemy import Pagination
from .request_utils import dictify_model, error_abort
def paginate_query(query, default_page_size=100, renderer=dictify_model):
try:
page_size = int(request.args.get("page_size", default_page_size))
pag... | <commit_before>import functools
from flask import jsonify, request
from flask.ext.sqlalchemy import Pagination
from .request_utils import dictify_model, error_abort
def paginate_query(query, default_page_size=100, renderer=dictify_model):
try:
page_size = int(request.args.get("page_size", default_page_siz... | import functools
from flask import jsonify, request
from flask.ext.sqlalchemy import Pagination
from .request_utils import dictify_model, error_abort
def paginate_query(query, default_page_size=100, renderer=dictify_model):
try:
page_size = int(request.args.get("page_size", default_page_size))
pag... | import functools
from flask import jsonify, request
from flask.ext.sqlalchemy import Pagination
from .request_utils import dictify_model, error_abort
def paginate_query(query, default_page_size=100, renderer=dictify_model):
try:
page_size = int(request.args.get("page_size", default_page_size))
pag... | <commit_before>import functools
from flask import jsonify, request
from flask.ext.sqlalchemy import Pagination
from .request_utils import dictify_model, error_abort
def paginate_query(query, default_page_size=100, renderer=dictify_model):
try:
page_size = int(request.args.get("page_size", default_page_siz... |
574b4d95a48f4df676ed5f23f0c83a9df2bc241d | pydux/log_middleware.py | pydux/log_middleware.py | """
logging middleware example
"""
def log_middleware(store):
"""log all actions to console as they are dispatched"""
def wrapper(next_):
def log_dispatch(action):
print('Dispatch Action:', action)
return next_(action)
return log_dispatch
return wrapper
| from __future__ import print_function
"""
logging middleware example
"""
def log_middleware(store):
"""log all actions to console as they are dispatched"""
def wrapper(next_):
def log_dispatch(action):
print('Dispatch Action:', action)
return next_(action)
return log_dis... | Use from __future__ import for print function | Use from __future__ import for print function | Python | mit | usrlocalben/pydux | """
logging middleware example
"""
def log_middleware(store):
"""log all actions to console as they are dispatched"""
def wrapper(next_):
def log_dispatch(action):
print('Dispatch Action:', action)
return next_(action)
return log_dispatch
return wrapper
Use from __f... | from __future__ import print_function
"""
logging middleware example
"""
def log_middleware(store):
"""log all actions to console as they are dispatched"""
def wrapper(next_):
def log_dispatch(action):
print('Dispatch Action:', action)
return next_(action)
return log_dis... | <commit_before>"""
logging middleware example
"""
def log_middleware(store):
"""log all actions to console as they are dispatched"""
def wrapper(next_):
def log_dispatch(action):
print('Dispatch Action:', action)
return next_(action)
return log_dispatch
return wrapp... | from __future__ import print_function
"""
logging middleware example
"""
def log_middleware(store):
"""log all actions to console as they are dispatched"""
def wrapper(next_):
def log_dispatch(action):
print('Dispatch Action:', action)
return next_(action)
return log_dis... | """
logging middleware example
"""
def log_middleware(store):
"""log all actions to console as they are dispatched"""
def wrapper(next_):
def log_dispatch(action):
print('Dispatch Action:', action)
return next_(action)
return log_dispatch
return wrapper
Use from __f... | <commit_before>"""
logging middleware example
"""
def log_middleware(store):
"""log all actions to console as they are dispatched"""
def wrapper(next_):
def log_dispatch(action):
print('Dispatch Action:', action)
return next_(action)
return log_dispatch
return wrapp... |
d80ee56ea6259265a534231a52146f9fd04c9689 | taskflow/engines/__init__.py | taskflow/engines/__init__.py | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | Use oslo_utils eventletutils to warn about eventlet patching | Use oslo_utils eventletutils to warn about eventlet patching
Change-Id: I86ba0de51b5c5789efae187ebc1c46ae32ff8b8b
| Python | apache-2.0 | jimbobhickville/taskflow,openstack/taskflow,jimbobhickville/taskflow,openstack/taskflow,junneyang/taskflow,pombredanne/taskflow-1,junneyang/taskflow,pombredanne/taskflow-1 | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | <commit_before># -*- coding: utf-8 -*-
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/lic... | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | <commit_before># -*- coding: utf-8 -*-
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/lic... |
20ad5bf3b814b57035ed92358e7a8cad25e5a7ee | gcm/api.py | gcm/api.py | import urllib2
import json
def send_gcm_message(api_key, regs_id, data, collapse_key=None):
"""
Send a GCM message for one or more devices, using json data
api_key: The API_KEY from your console (https://code.google.com/apis/console, locate Key for Server Apps in
Google Cloud Messaging for Android... | import requests
import json
def send_gcm_message(api_key, regs_id, data, collapse_key=None):
"""
Send a GCM message for one or more devices, using json data
api_key: The API_KEY from your console (https://code.google.com/apis/console, locate Key for Server Apps in
Google Cloud Messaging for Androi... | Use requests package instead of urllib2 | Use requests package instead of urllib2
| Python | bsd-2-clause | johnofkorea/django-gcm,johnofkorea/django-gcm,bogdal/django-gcm,bogdal/django-gcm | import urllib2
import json
def send_gcm_message(api_key, regs_id, data, collapse_key=None):
"""
Send a GCM message for one or more devices, using json data
api_key: The API_KEY from your console (https://code.google.com/apis/console, locate Key for Server Apps in
Google Cloud Messaging for Android... | import requests
import json
def send_gcm_message(api_key, regs_id, data, collapse_key=None):
"""
Send a GCM message for one or more devices, using json data
api_key: The API_KEY from your console (https://code.google.com/apis/console, locate Key for Server Apps in
Google Cloud Messaging for Androi... | <commit_before>import urllib2
import json
def send_gcm_message(api_key, regs_id, data, collapse_key=None):
"""
Send a GCM message for one or more devices, using json data
api_key: The API_KEY from your console (https://code.google.com/apis/console, locate Key for Server Apps in
Google Cloud Messag... | import requests
import json
def send_gcm_message(api_key, regs_id, data, collapse_key=None):
"""
Send a GCM message for one or more devices, using json data
api_key: The API_KEY from your console (https://code.google.com/apis/console, locate Key for Server Apps in
Google Cloud Messaging for Androi... | import urllib2
import json
def send_gcm_message(api_key, regs_id, data, collapse_key=None):
"""
Send a GCM message for one or more devices, using json data
api_key: The API_KEY from your console (https://code.google.com/apis/console, locate Key for Server Apps in
Google Cloud Messaging for Android... | <commit_before>import urllib2
import json
def send_gcm_message(api_key, regs_id, data, collapse_key=None):
"""
Send a GCM message for one or more devices, using json data
api_key: The API_KEY from your console (https://code.google.com/apis/console, locate Key for Server Apps in
Google Cloud Messag... |
dd9f5980ded9b10210ea524169ef769a6eff3993 | utils/paginate.py | utils/paginate.py | import discord
import asyncio
from typing import List, Tuple
from discord.ext.commands import Context
EMOJI_MAP = {"back": "⬅️", "forward": "➡️"}
async def paginate(ctx: Context, embeds: List[discord.Embed], timeout=30.0) -> None:
msg = ctx.message
emojis = EMOJI_MAP.values()
for reaction in emojis:
... | import discord
import asyncio
from typing import List
from discord.ext.commands import Context
EMOJI_MAP = {"back": "⬅️", "forward": "➡️"}
async def paginate(ctx: Context, embeds: List[discord.Embed], timeout=30.0) -> None:
msg = ctx.message
emojis = EMOJI_MAP.values()
for emoji in emojis:
await... | Fix pagination logic & typo | Fix pagination logic & typo
| Python | mit | Naught0/qtbot | import discord
import asyncio
from typing import List, Tuple
from discord.ext.commands import Context
EMOJI_MAP = {"back": "⬅️", "forward": "➡️"}
async def paginate(ctx: Context, embeds: List[discord.Embed], timeout=30.0) -> None:
msg = ctx.message
emojis = EMOJI_MAP.values()
for reaction in emojis:
... | import discord
import asyncio
from typing import List
from discord.ext.commands import Context
EMOJI_MAP = {"back": "⬅️", "forward": "➡️"}
async def paginate(ctx: Context, embeds: List[discord.Embed], timeout=30.0) -> None:
msg = ctx.message
emojis = EMOJI_MAP.values()
for emoji in emojis:
await... | <commit_before>import discord
import asyncio
from typing import List, Tuple
from discord.ext.commands import Context
EMOJI_MAP = {"back": "⬅️", "forward": "➡️"}
async def paginate(ctx: Context, embeds: List[discord.Embed], timeout=30.0) -> None:
msg = ctx.message
emojis = EMOJI_MAP.values()
for reaction i... | import discord
import asyncio
from typing import List
from discord.ext.commands import Context
EMOJI_MAP = {"back": "⬅️", "forward": "➡️"}
async def paginate(ctx: Context, embeds: List[discord.Embed], timeout=30.0) -> None:
msg = ctx.message
emojis = EMOJI_MAP.values()
for emoji in emojis:
await... | import discord
import asyncio
from typing import List, Tuple
from discord.ext.commands import Context
EMOJI_MAP = {"back": "⬅️", "forward": "➡️"}
async def paginate(ctx: Context, embeds: List[discord.Embed], timeout=30.0) -> None:
msg = ctx.message
emojis = EMOJI_MAP.values()
for reaction in emojis:
... | <commit_before>import discord
import asyncio
from typing import List, Tuple
from discord.ext.commands import Context
EMOJI_MAP = {"back": "⬅️", "forward": "➡️"}
async def paginate(ctx: Context, embeds: List[discord.Embed], timeout=30.0) -> None:
msg = ctx.message
emojis = EMOJI_MAP.values()
for reaction i... |
7fd7e2e8c9472a9dadf7d33991d11de6a68a2736 | refmanage/refmanage.py | refmanage/refmanage.py | # -*- coding: utf-8 -*-
import os
import argparse
import fs_utils
from pybtex.database.input import bibtex
def main():
"""
Command-line interface
"""
parser = argparse.ArgumentParser(description="Manage BibTeX files")
parser.add_argument("-t", "--test",
action="store_true",
help="... | # -*- coding: utf-8 -*-
import os
import argparse
import fs_utils
from pybtex.database.input import bibtex
def main():
"""
Command-line interface
"""
parser = argparse.ArgumentParser(description="Manage BibTeX files")
parser.add_argument("-t", "--test",
action="store_true",
help="... | Add functionality to print list of parseable files | Add functionality to print list of parseable files
| Python | mit | jrsmith3/refmanage | # -*- coding: utf-8 -*-
import os
import argparse
import fs_utils
from pybtex.database.input import bibtex
def main():
"""
Command-line interface
"""
parser = argparse.ArgumentParser(description="Manage BibTeX files")
parser.add_argument("-t", "--test",
action="store_true",
help="... | # -*- coding: utf-8 -*-
import os
import argparse
import fs_utils
from pybtex.database.input import bibtex
def main():
"""
Command-line interface
"""
parser = argparse.ArgumentParser(description="Manage BibTeX files")
parser.add_argument("-t", "--test",
action="store_true",
help="... | <commit_before># -*- coding: utf-8 -*-
import os
import argparse
import fs_utils
from pybtex.database.input import bibtex
def main():
"""
Command-line interface
"""
parser = argparse.ArgumentParser(description="Manage BibTeX files")
parser.add_argument("-t", "--test",
action="store_true",... | # -*- coding: utf-8 -*-
import os
import argparse
import fs_utils
from pybtex.database.input import bibtex
def main():
"""
Command-line interface
"""
parser = argparse.ArgumentParser(description="Manage BibTeX files")
parser.add_argument("-t", "--test",
action="store_true",
help="... | # -*- coding: utf-8 -*-
import os
import argparse
import fs_utils
from pybtex.database.input import bibtex
def main():
"""
Command-line interface
"""
parser = argparse.ArgumentParser(description="Manage BibTeX files")
parser.add_argument("-t", "--test",
action="store_true",
help="... | <commit_before># -*- coding: utf-8 -*-
import os
import argparse
import fs_utils
from pybtex.database.input import bibtex
def main():
"""
Command-line interface
"""
parser = argparse.ArgumentParser(description="Manage BibTeX files")
parser.add_argument("-t", "--test",
action="store_true",... |
22ab67a2c5a3bf3f7d1696a35b5fe029b848d63e | virtool/models.py | virtool/models.py | from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, String
Base = declarative_base()
class Label(Base):
__tablename__ = 'labels'
id = Column(String, primary_key=True)
name = Column(String, unique=True)
color = Column(String)
description = Column(String)
de... | from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, String, Sequence, Integer
Base = declarative_base()
class Label(Base):
__tablename__ = 'labels'
id = Column(Integer, Sequence('labels_id_seq'), primary_key=True)
name = Column(String, unique=True)
color = Column(S... | Use serial integer IDs for SQL records | Use serial integer IDs for SQL records
| Python | mit | virtool/virtool,igboyes/virtool,virtool/virtool,igboyes/virtool | from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, String
Base = declarative_base()
class Label(Base):
__tablename__ = 'labels'
id = Column(String, primary_key=True)
name = Column(String, unique=True)
color = Column(String)
description = Column(String)
de... | from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, String, Sequence, Integer
Base = declarative_base()
class Label(Base):
__tablename__ = 'labels'
id = Column(Integer, Sequence('labels_id_seq'), primary_key=True)
name = Column(String, unique=True)
color = Column(S... | <commit_before>from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, String
Base = declarative_base()
class Label(Base):
__tablename__ = 'labels'
id = Column(String, primary_key=True)
name = Column(String, unique=True)
color = Column(String)
description = Column(... | from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, String, Sequence, Integer
Base = declarative_base()
class Label(Base):
__tablename__ = 'labels'
id = Column(Integer, Sequence('labels_id_seq'), primary_key=True)
name = Column(String, unique=True)
color = Column(S... | from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, String
Base = declarative_base()
class Label(Base):
__tablename__ = 'labels'
id = Column(String, primary_key=True)
name = Column(String, unique=True)
color = Column(String)
description = Column(String)
de... | <commit_before>from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, String
Base = declarative_base()
class Label(Base):
__tablename__ = 'labels'
id = Column(String, primary_key=True)
name = Column(String, unique=True)
color = Column(String)
description = Column(... |
8a63a1c2464a63f1a52c32b5179b9dacfe5d4332 | framework/sessions/model.py | framework/sessions/model.py | # -*- coding: utf-8 -*-
from bson import ObjectId
from modularodm import fields
from framework.mongo import StoredObject
class Session(StoredObject):
_id = fields.StringField(primary=True, default=lambda: str(ObjectId()))
date_created = fields.DateTimeField(auto_now_add=True)
date_modified = fields.Dat... | # -*- coding: utf-8 -*-
from bson import ObjectId
from modularodm import fields
from framework.mongo import StoredObject
class Session(StoredObject):
_id = fields.StringField(primary=True, default=lambda: str(ObjectId()))
date_created = fields.DateTimeField(auto_now_add=True)
date_modified = fields.Dat... | Add missing newline for flake8 | Add missing newline for flake8
| Python | apache-2.0 | zachjanicki/osf.io,lyndsysimon/osf.io,aaxelb/osf.io,caneruguz/osf.io,leb2dg/osf.io,MerlinZhang/osf.io,Johnetordoff/osf.io,chrisseto/osf.io,sbt9uc/osf.io,arpitar/osf.io,jmcarp/osf.io,petermalcolm/osf.io,Nesiehr/osf.io,acshi/osf.io,DanielSBrown/osf.io,crcresearch/osf.io,MerlinZhang/osf.io,samanehsan/osf.io,mattclark/osf.... | # -*- coding: utf-8 -*-
from bson import ObjectId
from modularodm import fields
from framework.mongo import StoredObject
class Session(StoredObject):
_id = fields.StringField(primary=True, default=lambda: str(ObjectId()))
date_created = fields.DateTimeField(auto_now_add=True)
date_modified = fields.Dat... | # -*- coding: utf-8 -*-
from bson import ObjectId
from modularodm import fields
from framework.mongo import StoredObject
class Session(StoredObject):
_id = fields.StringField(primary=True, default=lambda: str(ObjectId()))
date_created = fields.DateTimeField(auto_now_add=True)
date_modified = fields.Dat... | <commit_before># -*- coding: utf-8 -*-
from bson import ObjectId
from modularodm import fields
from framework.mongo import StoredObject
class Session(StoredObject):
_id = fields.StringField(primary=True, default=lambda: str(ObjectId()))
date_created = fields.DateTimeField(auto_now_add=True)
date_modifi... | # -*- coding: utf-8 -*-
from bson import ObjectId
from modularodm import fields
from framework.mongo import StoredObject
class Session(StoredObject):
_id = fields.StringField(primary=True, default=lambda: str(ObjectId()))
date_created = fields.DateTimeField(auto_now_add=True)
date_modified = fields.Dat... | # -*- coding: utf-8 -*-
from bson import ObjectId
from modularodm import fields
from framework.mongo import StoredObject
class Session(StoredObject):
_id = fields.StringField(primary=True, default=lambda: str(ObjectId()))
date_created = fields.DateTimeField(auto_now_add=True)
date_modified = fields.Dat... | <commit_before># -*- coding: utf-8 -*-
from bson import ObjectId
from modularodm import fields
from framework.mongo import StoredObject
class Session(StoredObject):
_id = fields.StringField(primary=True, default=lambda: str(ObjectId()))
date_created = fields.DateTimeField(auto_now_add=True)
date_modifi... |
64d599d6f7ca0aae6d95bf753a8421c7978276a2 | subliminal/__init__.py | subliminal/__init__.py | # -*- coding: utf-8 -*-
__title__ = 'subliminal'
__version__ = '1.0.dev0'
__author__ = 'Antoine Bertin'
__license__ = 'MIT'
__copyright__ = 'Copyright 2015, Antoine Bertin'
import logging
from .api import (ProviderPool, check_video, provider_manager, download_best_subtitles, download_subtitles,
list... | # -*- coding: utf-8 -*-
__title__ = 'subliminal'
__version__ = '1.0.dev0'
__author__ = 'Antoine Bertin'
__license__ = 'MIT'
__copyright__ = 'Copyright 2015, Antoine Bertin'
import logging
from .api import (ProviderPool, check_video, provider_manager, download_best_subtitles, download_subtitles,
list... | Add compute_score to subliminal namespace | Add compute_score to subliminal namespace
| Python | mit | juanmhidalgo/subliminal,h3llrais3r/subliminal,getzze/subliminal,hpsbranco/subliminal,kbkailashbagaria/subliminal,oxan/subliminal,ratoaq2/subliminal,ofir123/subliminal,SickRage/subliminal,pums974/subliminal,Elettronik/subliminal,goll/subliminal,bogdal/subliminal,fernandog/subliminal,Diaoul/subliminal,neo1691/subliminal,... | # -*- coding: utf-8 -*-
__title__ = 'subliminal'
__version__ = '1.0.dev0'
__author__ = 'Antoine Bertin'
__license__ = 'MIT'
__copyright__ = 'Copyright 2015, Antoine Bertin'
import logging
from .api import (ProviderPool, check_video, provider_manager, download_best_subtitles, download_subtitles,
list... | # -*- coding: utf-8 -*-
__title__ = 'subliminal'
__version__ = '1.0.dev0'
__author__ = 'Antoine Bertin'
__license__ = 'MIT'
__copyright__ = 'Copyright 2015, Antoine Bertin'
import logging
from .api import (ProviderPool, check_video, provider_manager, download_best_subtitles, download_subtitles,
list... | <commit_before># -*- coding: utf-8 -*-
__title__ = 'subliminal'
__version__ = '1.0.dev0'
__author__ = 'Antoine Bertin'
__license__ = 'MIT'
__copyright__ = 'Copyright 2015, Antoine Bertin'
import logging
from .api import (ProviderPool, check_video, provider_manager, download_best_subtitles, download_subtitles,
... | # -*- coding: utf-8 -*-
__title__ = 'subliminal'
__version__ = '1.0.dev0'
__author__ = 'Antoine Bertin'
__license__ = 'MIT'
__copyright__ = 'Copyright 2015, Antoine Bertin'
import logging
from .api import (ProviderPool, check_video, provider_manager, download_best_subtitles, download_subtitles,
list... | # -*- coding: utf-8 -*-
__title__ = 'subliminal'
__version__ = '1.0.dev0'
__author__ = 'Antoine Bertin'
__license__ = 'MIT'
__copyright__ = 'Copyright 2015, Antoine Bertin'
import logging
from .api import (ProviderPool, check_video, provider_manager, download_best_subtitles, download_subtitles,
list... | <commit_before># -*- coding: utf-8 -*-
__title__ = 'subliminal'
__version__ = '1.0.dev0'
__author__ = 'Antoine Bertin'
__license__ = 'MIT'
__copyright__ = 'Copyright 2015, Antoine Bertin'
import logging
from .api import (ProviderPool, check_video, provider_manager, download_best_subtitles, download_subtitles,
... |
7f8a2e8e3b2721111c2de506d2d3bdea415e9b2d | markups/common.py | markups/common.py | # This file is part of python-markups module
# License: BSD
# Copyright: (C) Dmitry Shachnev, 2012-2015
import os.path
# Some common constants and functions
(LANGUAGE_HOME_PAGE, MODULE_HOME_PAGE, SYNTAX_DOCUMENTATION) = range(3)
CONFIGURATION_DIR = (os.environ.get('XDG_CONFIG_HOME') or
os.path.expanduser('~/.config'... | # This file is part of python-markups module
# License: BSD
# Copyright: (C) Dmitry Shachnev, 2012-2015
import os.path
# Some common constants and functions
(LANGUAGE_HOME_PAGE, MODULE_HOME_PAGE, SYNTAX_DOCUMENTATION) = range(3)
CONFIGURATION_DIR = (os.getenv('XDG_CONFIG_HOME') or os.getenv('APPDATA') or
os.path.exp... | Use %APPDATA% for CONFIGURATION_DIR on Windows | Use %APPDATA% for CONFIGURATION_DIR on Windows
References retext-project/retext#156.
| Python | bsd-3-clause | retext-project/pymarkups,mitya57/pymarkups | # This file is part of python-markups module
# License: BSD
# Copyright: (C) Dmitry Shachnev, 2012-2015
import os.path
# Some common constants and functions
(LANGUAGE_HOME_PAGE, MODULE_HOME_PAGE, SYNTAX_DOCUMENTATION) = range(3)
CONFIGURATION_DIR = (os.environ.get('XDG_CONFIG_HOME') or
os.path.expanduser('~/.config'... | # This file is part of python-markups module
# License: BSD
# Copyright: (C) Dmitry Shachnev, 2012-2015
import os.path
# Some common constants and functions
(LANGUAGE_HOME_PAGE, MODULE_HOME_PAGE, SYNTAX_DOCUMENTATION) = range(3)
CONFIGURATION_DIR = (os.getenv('XDG_CONFIG_HOME') or os.getenv('APPDATA') or
os.path.exp... | <commit_before># This file is part of python-markups module
# License: BSD
# Copyright: (C) Dmitry Shachnev, 2012-2015
import os.path
# Some common constants and functions
(LANGUAGE_HOME_PAGE, MODULE_HOME_PAGE, SYNTAX_DOCUMENTATION) = range(3)
CONFIGURATION_DIR = (os.environ.get('XDG_CONFIG_HOME') or
os.path.expandu... | # This file is part of python-markups module
# License: BSD
# Copyright: (C) Dmitry Shachnev, 2012-2015
import os.path
# Some common constants and functions
(LANGUAGE_HOME_PAGE, MODULE_HOME_PAGE, SYNTAX_DOCUMENTATION) = range(3)
CONFIGURATION_DIR = (os.getenv('XDG_CONFIG_HOME') or os.getenv('APPDATA') or
os.path.exp... | # This file is part of python-markups module
# License: BSD
# Copyright: (C) Dmitry Shachnev, 2012-2015
import os.path
# Some common constants and functions
(LANGUAGE_HOME_PAGE, MODULE_HOME_PAGE, SYNTAX_DOCUMENTATION) = range(3)
CONFIGURATION_DIR = (os.environ.get('XDG_CONFIG_HOME') or
os.path.expanduser('~/.config'... | <commit_before># This file is part of python-markups module
# License: BSD
# Copyright: (C) Dmitry Shachnev, 2012-2015
import os.path
# Some common constants and functions
(LANGUAGE_HOME_PAGE, MODULE_HOME_PAGE, SYNTAX_DOCUMENTATION) = range(3)
CONFIGURATION_DIR = (os.environ.get('XDG_CONFIG_HOME') or
os.path.expandu... |
7a179eefb73c5a1aebb4417f1e1adba0c6615f2b | csunplugged/general/views.py | csunplugged/general/views.py | """Views for the general application."""
from django.views.generic import TemplateView
from django.http import HttpResponse
class GeneralIndexView(TemplateView):
"""View for the homepage that renders from a template."""
template_name = 'general/index.html'
class GeneralAboutView(TemplateView):
"""View... | """Views for the general application."""
from django.views.generic import TemplateView
from django.http import HttpResponse
class GeneralIndexView(TemplateView):
"""View for the homepage that renders from a template."""
template_name = 'general/index.html'
class GeneralAboutView(TemplateView):
"""View... | Break PEP8 and Pydocstring to check Travis | Break PEP8 and Pydocstring to check Travis
| Python | mit | uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged | """Views for the general application."""
from django.views.generic import TemplateView
from django.http import HttpResponse
class GeneralIndexView(TemplateView):
"""View for the homepage that renders from a template."""
template_name = 'general/index.html'
class GeneralAboutView(TemplateView):
"""View... | """Views for the general application."""
from django.views.generic import TemplateView
from django.http import HttpResponse
class GeneralIndexView(TemplateView):
"""View for the homepage that renders from a template."""
template_name = 'general/index.html'
class GeneralAboutView(TemplateView):
"""View... | <commit_before>"""Views for the general application."""
from django.views.generic import TemplateView
from django.http import HttpResponse
class GeneralIndexView(TemplateView):
"""View for the homepage that renders from a template."""
template_name = 'general/index.html'
class GeneralAboutView(TemplateVie... | """Views for the general application."""
from django.views.generic import TemplateView
from django.http import HttpResponse
class GeneralIndexView(TemplateView):
"""View for the homepage that renders from a template."""
template_name = 'general/index.html'
class GeneralAboutView(TemplateView):
"""View... | """Views for the general application."""
from django.views.generic import TemplateView
from django.http import HttpResponse
class GeneralIndexView(TemplateView):
"""View for the homepage that renders from a template."""
template_name = 'general/index.html'
class GeneralAboutView(TemplateView):
"""View... | <commit_before>"""Views for the general application."""
from django.views.generic import TemplateView
from django.http import HttpResponse
class GeneralIndexView(TemplateView):
"""View for the homepage that renders from a template."""
template_name = 'general/index.html'
class GeneralAboutView(TemplateVie... |
90abb9f68ed32fd5affe8200dfd3bb4836f1c69e | test/os_win7.py | test/os_win7.py | #!/usr/bin/env python
"""
mbed SDK
Copyright (c) 2011-2015 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable ... | #!/usr/bin/env python
"""
mbed SDK
Copyright (c) 2011-2015 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable ... | Revert "Add test for mbed parsing" | Revert "Add test for mbed parsing"
This reverts commit d37dc009f1c4f6e8855657dd6dbf17df9332f765.
| Python | apache-2.0 | mtmtech/mbed-ls,mtmtech/mbed-ls,mazimkhan/mbed-ls,jupe/mbed-ls,mazimkhan/mbed-ls,jupe/mbed-ls | #!/usr/bin/env python
"""
mbed SDK
Copyright (c) 2011-2015 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable ... | #!/usr/bin/env python
"""
mbed SDK
Copyright (c) 2011-2015 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable ... | <commit_before>#!/usr/bin/env python
"""
mbed SDK
Copyright (c) 2011-2015 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required... | #!/usr/bin/env python
"""
mbed SDK
Copyright (c) 2011-2015 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable ... | #!/usr/bin/env python
"""
mbed SDK
Copyright (c) 2011-2015 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable ... | <commit_before>#!/usr/bin/env python
"""
mbed SDK
Copyright (c) 2011-2015 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required... |
175c72d97d073a64714cebef05bd37f0221f94fa | test_octave_kernel.py | test_octave_kernel.py | """Example use of jupyter_kernel_test, with tests for IPython."""
import sys
import unittest
import jupyter_kernel_test as jkt
class OctaveKernelTests(jkt.KernelTests):
kernel_name = "octave"
language_name = "octave"
code_hello_world = "disp('hello, world')"
code_display_data = [
{'code': ... | """Example use of jupyter_kernel_test, with tests for IPython."""
import sys
import unittest
import jupyter_kernel_test as jkt
class OctaveKernelTests(jkt.KernelTests):
kernel_name = "octave"
language_name = "octave"
code_hello_world = "disp('hello, world')"
code_display_data = [
{'code': ... | Fix tests with Octave 5. | Fix tests with Octave 5.
| Python | bsd-3-clause | Calysto/octave_kernel,Calysto/octave_kernel | """Example use of jupyter_kernel_test, with tests for IPython."""
import sys
import unittest
import jupyter_kernel_test as jkt
class OctaveKernelTests(jkt.KernelTests):
kernel_name = "octave"
language_name = "octave"
code_hello_world = "disp('hello, world')"
code_display_data = [
{'code': ... | """Example use of jupyter_kernel_test, with tests for IPython."""
import sys
import unittest
import jupyter_kernel_test as jkt
class OctaveKernelTests(jkt.KernelTests):
kernel_name = "octave"
language_name = "octave"
code_hello_world = "disp('hello, world')"
code_display_data = [
{'code': ... | <commit_before>"""Example use of jupyter_kernel_test, with tests for IPython."""
import sys
import unittest
import jupyter_kernel_test as jkt
class OctaveKernelTests(jkt.KernelTests):
kernel_name = "octave"
language_name = "octave"
code_hello_world = "disp('hello, world')"
code_display_data = [
... | """Example use of jupyter_kernel_test, with tests for IPython."""
import sys
import unittest
import jupyter_kernel_test as jkt
class OctaveKernelTests(jkt.KernelTests):
kernel_name = "octave"
language_name = "octave"
code_hello_world = "disp('hello, world')"
code_display_data = [
{'code': ... | """Example use of jupyter_kernel_test, with tests for IPython."""
import sys
import unittest
import jupyter_kernel_test as jkt
class OctaveKernelTests(jkt.KernelTests):
kernel_name = "octave"
language_name = "octave"
code_hello_world = "disp('hello, world')"
code_display_data = [
{'code': ... | <commit_before>"""Example use of jupyter_kernel_test, with tests for IPython."""
import sys
import unittest
import jupyter_kernel_test as jkt
class OctaveKernelTests(jkt.KernelTests):
kernel_name = "octave"
language_name = "octave"
code_hello_world = "disp('hello, world')"
code_display_data = [
... |
826e5cffbfc7ac3e3b3a138f290f3fcc50e2a187 | scripts/insert_demo.py | scripts/insert_demo.py | """Insert the demo into the codemirror site."""
import os
import fileinput
import shutil
proselint_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
code_mirror_path = os.path.join(
proselint_path,
"plugins",
"webeditor")
code_mirror_demo_path = os.path.join(code_mirror_path, "index.ht... | """Insert the demo into the codemirror site."""
import os
import fileinput
import shutil
proselint_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
code_mirror_path = os.path.join(
proselint_path,
"plugins",
"webeditor")
code_mirror_demo_path = os.path.join(code_mirror_path, "index.ht... | Replace the placeholder in the live demo | Replace the placeholder in the live demo
| Python | bsd-3-clause | jstewmon/proselint,amperser/proselint,jstewmon/proselint,amperser/proselint,amperser/proselint,amperser/proselint,amperser/proselint,jstewmon/proselint | """Insert the demo into the codemirror site."""
import os
import fileinput
import shutil
proselint_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
code_mirror_path = os.path.join(
proselint_path,
"plugins",
"webeditor")
code_mirror_demo_path = os.path.join(code_mirror_path, "index.ht... | """Insert the demo into the codemirror site."""
import os
import fileinput
import shutil
proselint_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
code_mirror_path = os.path.join(
proselint_path,
"plugins",
"webeditor")
code_mirror_demo_path = os.path.join(code_mirror_path, "index.ht... | <commit_before>"""Insert the demo into the codemirror site."""
import os
import fileinput
import shutil
proselint_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
code_mirror_path = os.path.join(
proselint_path,
"plugins",
"webeditor")
code_mirror_demo_path = os.path.join(code_mirror_... | """Insert the demo into the codemirror site."""
import os
import fileinput
import shutil
proselint_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
code_mirror_path = os.path.join(
proselint_path,
"plugins",
"webeditor")
code_mirror_demo_path = os.path.join(code_mirror_path, "index.ht... | """Insert the demo into the codemirror site."""
import os
import fileinput
import shutil
proselint_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
code_mirror_path = os.path.join(
proselint_path,
"plugins",
"webeditor")
code_mirror_demo_path = os.path.join(code_mirror_path, "index.ht... | <commit_before>"""Insert the demo into the codemirror site."""
import os
import fileinput
import shutil
proselint_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
code_mirror_path = os.path.join(
proselint_path,
"plugins",
"webeditor")
code_mirror_demo_path = os.path.join(code_mirror_... |
39eea826a1f29c2bd77d5f4f5bead7011b47f0bb | sed/engine/__init__.py | sed/engine/__init__.py | from sed.engine.StreamEditor import StreamEditor
from sed.engine.sed_file_util import call_main
from sed.engine.match_engine import ACCEPT, REJECT, NEXT, REPEAT, CUT
from sed.engine.sed_regex import ANY
__all__ = [
"StreamEditor",
"call_main",
"ACCEPT", "REJECT", "NEXT", "REPEAT",
"ANY",
]
| """
Interface to sed engine
- defines objects exported from this module
"""
from sed.engine.StreamEditor import StreamEditor
from sed.engine.sed_file_util import call_main
from sed.engine.match_engine import (
ACCEPT,
REJECT,
NEXT,
REPEAT,
CUT,
)
from sed.engine.sed_regex import ANY
__all__ = [
... | Add CUT to list of externally visible objects | Add CUT to list of externally visible objects
| Python | mit | hughdbrown/sed,hughdbrown/sed | from sed.engine.StreamEditor import StreamEditor
from sed.engine.sed_file_util import call_main
from sed.engine.match_engine import ACCEPT, REJECT, NEXT, REPEAT, CUT
from sed.engine.sed_regex import ANY
__all__ = [
"StreamEditor",
"call_main",
"ACCEPT", "REJECT", "NEXT", "REPEAT",
"ANY",
]
Add CUT to ... | """
Interface to sed engine
- defines objects exported from this module
"""
from sed.engine.StreamEditor import StreamEditor
from sed.engine.sed_file_util import call_main
from sed.engine.match_engine import (
ACCEPT,
REJECT,
NEXT,
REPEAT,
CUT,
)
from sed.engine.sed_regex import ANY
__all__ = [
... | <commit_before>from sed.engine.StreamEditor import StreamEditor
from sed.engine.sed_file_util import call_main
from sed.engine.match_engine import ACCEPT, REJECT, NEXT, REPEAT, CUT
from sed.engine.sed_regex import ANY
__all__ = [
"StreamEditor",
"call_main",
"ACCEPT", "REJECT", "NEXT", "REPEAT",
"ANY"... | """
Interface to sed engine
- defines objects exported from this module
"""
from sed.engine.StreamEditor import StreamEditor
from sed.engine.sed_file_util import call_main
from sed.engine.match_engine import (
ACCEPT,
REJECT,
NEXT,
REPEAT,
CUT,
)
from sed.engine.sed_regex import ANY
__all__ = [
... | from sed.engine.StreamEditor import StreamEditor
from sed.engine.sed_file_util import call_main
from sed.engine.match_engine import ACCEPT, REJECT, NEXT, REPEAT, CUT
from sed.engine.sed_regex import ANY
__all__ = [
"StreamEditor",
"call_main",
"ACCEPT", "REJECT", "NEXT", "REPEAT",
"ANY",
]
Add CUT to ... | <commit_before>from sed.engine.StreamEditor import StreamEditor
from sed.engine.sed_file_util import call_main
from sed.engine.match_engine import ACCEPT, REJECT, NEXT, REPEAT, CUT
from sed.engine.sed_regex import ANY
__all__ = [
"StreamEditor",
"call_main",
"ACCEPT", "REJECT", "NEXT", "REPEAT",
"ANY"... |
2785c24a730b01678d3683becc5e41f4f27a3760 | tests/database/conftest.py | tests/database/conftest.py | import pytest
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy_utils import create_database, database_exists, drop_database
from gold_digger.database.db_model import Base
@pytest.fixture(scope="module")
def db_connection(db_connection_string):
"""
C... | import pytest
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy_utils import create_database, database_exists, drop_database
from gold_digger.database.db_model import Base
@pytest.fixture(scope="module")
def db_connection(db_connection_string):
"""
C... | Use SQLA Session directly in tests | Use SQLA Session directly in tests
| Python | apache-2.0 | business-factory/gold-digger | import pytest
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy_utils import create_database, database_exists, drop_database
from gold_digger.database.db_model import Base
@pytest.fixture(scope="module")
def db_connection(db_connection_string):
"""
C... | import pytest
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy_utils import create_database, database_exists, drop_database
from gold_digger.database.db_model import Base
@pytest.fixture(scope="module")
def db_connection(db_connection_string):
"""
C... | <commit_before>import pytest
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy_utils import create_database, database_exists, drop_database
from gold_digger.database.db_model import Base
@pytest.fixture(scope="module")
def db_connection(db_connection_string)... | import pytest
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy_utils import create_database, database_exists, drop_database
from gold_digger.database.db_model import Base
@pytest.fixture(scope="module")
def db_connection(db_connection_string):
"""
C... | import pytest
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy_utils import create_database, database_exists, drop_database
from gold_digger.database.db_model import Base
@pytest.fixture(scope="module")
def db_connection(db_connection_string):
"""
C... | <commit_before>import pytest
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy_utils import create_database, database_exists, drop_database
from gold_digger.database.db_model import Base
@pytest.fixture(scope="module")
def db_connection(db_connection_string)... |
8b3a5bd9c28ba15e82215d4410b2952bcc81b917 | tests/conftest.py | tests/conftest.py | # -*- coding: utf-8 -*-
import pytest
@pytest.yield_fixture
def tmpfile(request, tmpdir):
yield tmpdir.join('file.tmp').ensure().strpath
| # -*- coding: utf-8 -*-
import pytest
from blox.file import File
@pytest.yield_fixture
def tmpfile(request, tmpdir):
filename = tmpdir.join('file.tmp').ensure().strpath
File(filename, 'w').close()
yield filename
| Create a valid blox file in tmpfile fixture | Create a valid blox file in tmpfile fixture
| Python | mit | aldanor/blox | # -*- coding: utf-8 -*-
import pytest
@pytest.yield_fixture
def tmpfile(request, tmpdir):
yield tmpdir.join('file.tmp').ensure().strpath
Create a valid blox file in tmpfile fixture | # -*- coding: utf-8 -*-
import pytest
from blox.file import File
@pytest.yield_fixture
def tmpfile(request, tmpdir):
filename = tmpdir.join('file.tmp').ensure().strpath
File(filename, 'w').close()
yield filename
| <commit_before># -*- coding: utf-8 -*-
import pytest
@pytest.yield_fixture
def tmpfile(request, tmpdir):
yield tmpdir.join('file.tmp').ensure().strpath
<commit_msg>Create a valid blox file in tmpfile fixture<commit_after> | # -*- coding: utf-8 -*-
import pytest
from blox.file import File
@pytest.yield_fixture
def tmpfile(request, tmpdir):
filename = tmpdir.join('file.tmp').ensure().strpath
File(filename, 'w').close()
yield filename
| # -*- coding: utf-8 -*-
import pytest
@pytest.yield_fixture
def tmpfile(request, tmpdir):
yield tmpdir.join('file.tmp').ensure().strpath
Create a valid blox file in tmpfile fixture# -*- coding: utf-8 -*-
import pytest
from blox.file import File
@pytest.yield_fixture
def tmpfile(request, tmpdir):
filename... | <commit_before># -*- coding: utf-8 -*-
import pytest
@pytest.yield_fixture
def tmpfile(request, tmpdir):
yield tmpdir.join('file.tmp').ensure().strpath
<commit_msg>Create a valid blox file in tmpfile fixture<commit_after># -*- coding: utf-8 -*-
import pytest
from blox.file import File
@pytest.yield_fixture
d... |
1e8f2c38cd83d23ad86ca898da9f6c7f7012da55 | tests/get_data.py | tests/get_data.py | #!/usr/bin/env python
#
# PyUSBtmc
# get_data.py
#
# Copyright (c) 2011 Mike Hadmack
# This code is distributed under the MIT license
import numpy
import sys
import os
from matplotlib import pyplot
sys.path.append(os.path.expanduser('~/Source'))
sys.path.append(os.path.expanduser('~/src'))
sys.path.append('/var/local/s... | #!/usr/bin/env python
#
# PyUSBtmc
# get_data.py
#
# Copyright (c) 2011 Mike Hadmack
# This code is distributed under the MIT license
import numpy
import sys
import os
from matplotlib import pyplot
sys.path.append(os.path.expanduser('.'))
from oscope import RigolScope
from oscope import Waverunner
from oscope import ma... | Adjust paths and module name | Adjust paths and module name
| Python | mit | niun/pyoscope,pklaus/pyoscope | #!/usr/bin/env python
#
# PyUSBtmc
# get_data.py
#
# Copyright (c) 2011 Mike Hadmack
# This code is distributed under the MIT license
import numpy
import sys
import os
from matplotlib import pyplot
sys.path.append(os.path.expanduser('~/Source'))
sys.path.append(os.path.expanduser('~/src'))
sys.path.append('/var/local/s... | #!/usr/bin/env python
#
# PyUSBtmc
# get_data.py
#
# Copyright (c) 2011 Mike Hadmack
# This code is distributed under the MIT license
import numpy
import sys
import os
from matplotlib import pyplot
sys.path.append(os.path.expanduser('.'))
from oscope import RigolScope
from oscope import Waverunner
from oscope import ma... | <commit_before>#!/usr/bin/env python
#
# PyUSBtmc
# get_data.py
#
# Copyright (c) 2011 Mike Hadmack
# This code is distributed under the MIT license
import numpy
import sys
import os
from matplotlib import pyplot
sys.path.append(os.path.expanduser('~/Source'))
sys.path.append(os.path.expanduser('~/src'))
sys.path.appen... | #!/usr/bin/env python
#
# PyUSBtmc
# get_data.py
#
# Copyright (c) 2011 Mike Hadmack
# This code is distributed under the MIT license
import numpy
import sys
import os
from matplotlib import pyplot
sys.path.append(os.path.expanduser('.'))
from oscope import RigolScope
from oscope import Waverunner
from oscope import ma... | #!/usr/bin/env python
#
# PyUSBtmc
# get_data.py
#
# Copyright (c) 2011 Mike Hadmack
# This code is distributed under the MIT license
import numpy
import sys
import os
from matplotlib import pyplot
sys.path.append(os.path.expanduser('~/Source'))
sys.path.append(os.path.expanduser('~/src'))
sys.path.append('/var/local/s... | <commit_before>#!/usr/bin/env python
#
# PyUSBtmc
# get_data.py
#
# Copyright (c) 2011 Mike Hadmack
# This code is distributed under the MIT license
import numpy
import sys
import os
from matplotlib import pyplot
sys.path.append(os.path.expanduser('~/Source'))
sys.path.append(os.path.expanduser('~/src'))
sys.path.appen... |
bf4717f39aaf3cf70bf99648afd38cd8dd5c8ad3 | src/main/python/systemml/__init__.py | src/main/python/systemml/__init__.py | # -------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you unde... | # -------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you unde... | Allow access to classloaders methods | [MINOR] Allow access to classloaders methods
| Python | apache-2.0 | apache/incubator-systemml,niketanpansare/incubator-systemml,apache/incubator-systemml,apache/incubator-systemml,apache/incubator-systemml,niketanpansare/incubator-systemml,niketanpansare/systemml,niketanpansare/incubator-systemml,apache/incubator-systemml,niketanpansare/systemml,apache/incubator-systemml,niketanpansare... | # -------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you unde... | # -------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you unde... | <commit_before># -------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this fil... | # -------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you unde... | # -------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you unde... | <commit_before># -------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this fil... |
71251ba62843b4842055783941929884df38267d | tests/helper.py | tests/helper.py | import sublime
from unittest import TestCase
class TestHelper(TestCase):
def setUp(self):
self.view = sublime.active_window().new_file()
def tearDown(self):
if self.view:
self.view.set_scratch(True)
self.view.window().run_command('close_file')
def set_text(self, lines):
for line in line... | import sublime
from unittest import TestCase
class TestHelper(TestCase):
def setUp(self):
self.view = sublime.active_window().new_file()
self.view.settings().set("tab_size", 2)
def tearDown(self):
if self.view:
self.view.set_scratch(True)
self.view.window().run_command('close_file')
def... | Fix tests failing from different tab_size | Fix tests failing from different tab_size
| Python | mit | mwean/sublime_jump_along_indent | import sublime
from unittest import TestCase
class TestHelper(TestCase):
def setUp(self):
self.view = sublime.active_window().new_file()
def tearDown(self):
if self.view:
self.view.set_scratch(True)
self.view.window().run_command('close_file')
def set_text(self, lines):
for line in line... | import sublime
from unittest import TestCase
class TestHelper(TestCase):
def setUp(self):
self.view = sublime.active_window().new_file()
self.view.settings().set("tab_size", 2)
def tearDown(self):
if self.view:
self.view.set_scratch(True)
self.view.window().run_command('close_file')
def... | <commit_before>import sublime
from unittest import TestCase
class TestHelper(TestCase):
def setUp(self):
self.view = sublime.active_window().new_file()
def tearDown(self):
if self.view:
self.view.set_scratch(True)
self.view.window().run_command('close_file')
def set_text(self, lines):
f... | import sublime
from unittest import TestCase
class TestHelper(TestCase):
def setUp(self):
self.view = sublime.active_window().new_file()
self.view.settings().set("tab_size", 2)
def tearDown(self):
if self.view:
self.view.set_scratch(True)
self.view.window().run_command('close_file')
def... | import sublime
from unittest import TestCase
class TestHelper(TestCase):
def setUp(self):
self.view = sublime.active_window().new_file()
def tearDown(self):
if self.view:
self.view.set_scratch(True)
self.view.window().run_command('close_file')
def set_text(self, lines):
for line in line... | <commit_before>import sublime
from unittest import TestCase
class TestHelper(TestCase):
def setUp(self):
self.view = sublime.active_window().new_file()
def tearDown(self):
if self.view:
self.view.set_scratch(True)
self.view.window().run_command('close_file')
def set_text(self, lines):
f... |
9ef9724a21382d8c93bebfb8dc6e551b58e0a57c | py/testdir_multi_jvm/test_rf_200x4_fvec.py | py/testdir_multi_jvm/test_rf_200x4_fvec.py | import unittest, time, sys, os
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_hosts, h2o_import as h2i
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
localhost = h2o.decide_if_localhost()
if (localhost... | import unittest, time, sys, os
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_hosts, h2o_import as h2i
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
localhost = h2o.decide_if_localhost()
if (localhost... | Increase timeout from 400 to 800 seconds. | Increase timeout from 400 to 800 seconds.
| Python | apache-2.0 | h2oai/h2o-2,100star/h2o,h2oai/h2o,h2oai/h2o,vbelakov/h2o,elkingtonmcb/h2o-2,calvingit21/h2o-2,h2oai/h2o,rowhit/h2o-2,h2oai/h2o-2,h2oai/h2o-2,elkingtonmcb/h2o-2,h2oai/h2o,calvingit21/h2o-2,h2oai/h2o-2,rowhit/h2o-2,rowhit/h2o-2,vbelakov/h2o,eg-zhang/h2o-2,h2oai/h2o,calvingit21/h2o-2,h2oai/h2o,vbelakov/h2o,100star/h2o,cal... | import unittest, time, sys, os
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_hosts, h2o_import as h2i
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
localhost = h2o.decide_if_localhost()
if (localhost... | import unittest, time, sys, os
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_hosts, h2o_import as h2i
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
localhost = h2o.decide_if_localhost()
if (localhost... | <commit_before>import unittest, time, sys, os
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_hosts, h2o_import as h2i
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
localhost = h2o.decide_if_localhost()
... | import unittest, time, sys, os
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_hosts, h2o_import as h2i
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
localhost = h2o.decide_if_localhost()
if (localhost... | import unittest, time, sys, os
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_hosts, h2o_import as h2i
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
localhost = h2o.decide_if_localhost()
if (localhost... | <commit_before>import unittest, time, sys, os
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_hosts, h2o_import as h2i
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
localhost = h2o.decide_if_localhost()
... |
89a001a1c4b5f8726c710c0dd4046ceb8df1fe5b | tests/test_fields_virtual.py | tests/test_fields_virtual.py | # -*- coding: utf-8 -*-
import pytest
import odin
class MultiPartResource(odin.Resource):
id = odin.IntegerField()
code = odin.StringField()
two_parts = odin.MultiPartField(('id', 'code'), separator=':')
class TestFields(object):
def test_multipartfield__get_value(self):
target = MultiPartRe... | # -*- coding: utf-8 -*-
import pytest
import odin
class MultiPartResource(odin.Resource):
id = odin.IntegerField()
code = odin.StringField()
two_parts = odin.MultiPartField(('id', 'code'), separator=':')
class TestFields(object):
def test_multipartfield__get_value(self):
target = MultiPartRe... | Fix test for python 3 | Fix test for python 3
| Python | bsd-3-clause | python-odin/odin | # -*- coding: utf-8 -*-
import pytest
import odin
class MultiPartResource(odin.Resource):
id = odin.IntegerField()
code = odin.StringField()
two_parts = odin.MultiPartField(('id', 'code'), separator=':')
class TestFields(object):
def test_multipartfield__get_value(self):
target = MultiPartRe... | # -*- coding: utf-8 -*-
import pytest
import odin
class MultiPartResource(odin.Resource):
id = odin.IntegerField()
code = odin.StringField()
two_parts = odin.MultiPartField(('id', 'code'), separator=':')
class TestFields(object):
def test_multipartfield__get_value(self):
target = MultiPartRe... | <commit_before># -*- coding: utf-8 -*-
import pytest
import odin
class MultiPartResource(odin.Resource):
id = odin.IntegerField()
code = odin.StringField()
two_parts = odin.MultiPartField(('id', 'code'), separator=':')
class TestFields(object):
def test_multipartfield__get_value(self):
targe... | # -*- coding: utf-8 -*-
import pytest
import odin
class MultiPartResource(odin.Resource):
id = odin.IntegerField()
code = odin.StringField()
two_parts = odin.MultiPartField(('id', 'code'), separator=':')
class TestFields(object):
def test_multipartfield__get_value(self):
target = MultiPartRe... | # -*- coding: utf-8 -*-
import pytest
import odin
class MultiPartResource(odin.Resource):
id = odin.IntegerField()
code = odin.StringField()
two_parts = odin.MultiPartField(('id', 'code'), separator=':')
class TestFields(object):
def test_multipartfield__get_value(self):
target = MultiPartRe... | <commit_before># -*- coding: utf-8 -*-
import pytest
import odin
class MultiPartResource(odin.Resource):
id = odin.IntegerField()
code = odin.StringField()
two_parts = odin.MultiPartField(('id', 'code'), separator=':')
class TestFields(object):
def test_multipartfield__get_value(self):
targe... |
92216b0f09ee7de1d43ef54f9a1c7072faedabb5 | tests/test_tracker_stores.py | tests/test_tracker_stores.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from rasa_core.channels import UserMessage
from rasa_core.domain import TemplateDomain
from rasa_core.events import SlotSet
from rasa_core.tracker_store import InMemoryTr... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from rasa_core.channels import UserMessage
from rasa_core.domain import TemplateDomain
from rasa_core.events import SlotSet
from rasa_core.tracker_store import InMemoryTr... | Update tracker store test for 0.7.5 | Update tracker store test for 0.7.5
| Python | apache-2.0 | RasaHQ/rasa_nlu,RasaHQ/rasa_core,RasaHQ/rasa_nlu,RasaHQ/rasa_nlu,RasaHQ/rasa_core,RasaHQ/rasa_core | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from rasa_core.channels import UserMessage
from rasa_core.domain import TemplateDomain
from rasa_core.events import SlotSet
from rasa_core.tracker_store import InMemoryTr... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from rasa_core.channels import UserMessage
from rasa_core.domain import TemplateDomain
from rasa_core.events import SlotSet
from rasa_core.tracker_store import InMemoryTr... | <commit_before>from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from rasa_core.channels import UserMessage
from rasa_core.domain import TemplateDomain
from rasa_core.events import SlotSet
from rasa_core.tracker_store im... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from rasa_core.channels import UserMessage
from rasa_core.domain import TemplateDomain
from rasa_core.events import SlotSet
from rasa_core.tracker_store import InMemoryTr... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from rasa_core.channels import UserMessage
from rasa_core.domain import TemplateDomain
from rasa_core.events import SlotSet
from rasa_core.tracker_store import InMemoryTr... | <commit_before>from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from rasa_core.channels import UserMessage
from rasa_core.domain import TemplateDomain
from rasa_core.events import SlotSet
from rasa_core.tracker_store im... |
74fde273d79248d4ad1c0cfd47d2861c83b50cbd | kolibri/auth/migrations/0007_auto_20171226_1125.py | kolibri/auth/migrations/0007_auto_20171226_1125.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-12-26 19:25
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('kolibriauth', '0006_auto_20171206_1207'),
]
operations = [
migrations.Alter... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-12-26 19:25
from __future__ import unicode_literals
from django.db import migrations, models
# This is necessary because:
# 1. The list generator has an unpredictable order, and when items swap places
# then this would be picked up as a change in Django ... | Fix for dynamic value of FacilityDataset.preset.choices causing migration inconsistencies | Fix for dynamic value of FacilityDataset.preset.choices causing migration inconsistencies
| Python | mit | christianmemije/kolibri,christianmemije/kolibri,indirectlylit/kolibri,benjaoming/kolibri,lyw07/kolibri,learningequality/kolibri,mrpau/kolibri,mrpau/kolibri,lyw07/kolibri,indirectlylit/kolibri,christianmemije/kolibri,jonboiser/kolibri,jonboiser/kolibri,DXCanas/kolibri,lyw07/kolibri,mrpau/kolibri,mrpau/kolibri,benjaoming... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-12-26 19:25
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('kolibriauth', '0006_auto_20171206_1207'),
]
operations = [
migrations.Alter... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-12-26 19:25
from __future__ import unicode_literals
from django.db import migrations, models
# This is necessary because:
# 1. The list generator has an unpredictable order, and when items swap places
# then this would be picked up as a change in Django ... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-12-26 19:25
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('kolibriauth', '0006_auto_20171206_1207'),
]
operations = [
m... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-12-26 19:25
from __future__ import unicode_literals
from django.db import migrations, models
# This is necessary because:
# 1. The list generator has an unpredictable order, and when items swap places
# then this would be picked up as a change in Django ... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-12-26 19:25
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('kolibriauth', '0006_auto_20171206_1207'),
]
operations = [
migrations.Alter... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-12-26 19:25
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('kolibriauth', '0006_auto_20171206_1207'),
]
operations = [
m... |
2320dd29d23d03562319cfbb5cdf46e46795d79b | trex/views/project.py | trex/views/project.py | # -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com>
#
# See LICENSE comming with the source of 'trex' for details.
#
from rest_framework import generics
from trex.models.project import Project, Entry
from trex.serializers import (
ProjectSerializer, ProjectDetailSerializer, EntryDetailSeria... | # -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com>
#
# See LICENSE comming with the source of 'trex' for details.
#
from rest_framework import generics, status
from rest_framework.response import Response
from trex.models.project import Project, Entry
from trex.parsers import PlainTextParser
f... | Add view to add Zeiterfassung entries from a plain text submission | Add view to add Zeiterfassung entries from a plain text submission
| Python | mit | bjoernricks/trex,bjoernricks/trex | # -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com>
#
# See LICENSE comming with the source of 'trex' for details.
#
from rest_framework import generics
from trex.models.project import Project, Entry
from trex.serializers import (
ProjectSerializer, ProjectDetailSerializer, EntryDetailSeria... | # -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com>
#
# See LICENSE comming with the source of 'trex' for details.
#
from rest_framework import generics, status
from rest_framework.response import Response
from trex.models.project import Project, Entry
from trex.parsers import PlainTextParser
f... | <commit_before># -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com>
#
# See LICENSE comming with the source of 'trex' for details.
#
from rest_framework import generics
from trex.models.project import Project, Entry
from trex.serializers import (
ProjectSerializer, ProjectDetailSerializer, E... | # -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com>
#
# See LICENSE comming with the source of 'trex' for details.
#
from rest_framework import generics, status
from rest_framework.response import Response
from trex.models.project import Project, Entry
from trex.parsers import PlainTextParser
f... | # -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com>
#
# See LICENSE comming with the source of 'trex' for details.
#
from rest_framework import generics
from trex.models.project import Project, Entry
from trex.serializers import (
ProjectSerializer, ProjectDetailSerializer, EntryDetailSeria... | <commit_before># -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com>
#
# See LICENSE comming with the source of 'trex' for details.
#
from rest_framework import generics
from trex.models.project import Project, Entry
from trex.serializers import (
ProjectSerializer, ProjectDetailSerializer, E... |
a5ac21234cd8970112be12b1209886dd1208ad9c | troposphere/cloud9.py | troposphere/cloud9.py | # Copyright (c) 2012-2017, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
from .validators import integer
class Repository(AWSProperty):
props = {
"PathComponent": (str, True),
"RepositoryUrl": (str, True),
}
clas... | # Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 35.0.0
from troposphere import Tags
from . import AWSObject, AWSProperty
from .validators import integer
class ... | Update Cloud9 per 2021-04-01 changes | Update Cloud9 per 2021-04-01 changes
| Python | bsd-2-clause | cloudtools/troposphere,cloudtools/troposphere | # Copyright (c) 2012-2017, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
from .validators import integer
class Repository(AWSProperty):
props = {
"PathComponent": (str, True),
"RepositoryUrl": (str, True),
}
clas... | # Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 35.0.0
from troposphere import Tags
from . import AWSObject, AWSProperty
from .validators import integer
class ... | <commit_before># Copyright (c) 2012-2017, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
from .validators import integer
class Repository(AWSProperty):
props = {
"PathComponent": (str, True),
"RepositoryUrl": (str, True... | # Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 35.0.0
from troposphere import Tags
from . import AWSObject, AWSProperty
from .validators import integer
class ... | # Copyright (c) 2012-2017, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
from .validators import integer
class Repository(AWSProperty):
props = {
"PathComponent": (str, True),
"RepositoryUrl": (str, True),
}
clas... | <commit_before># Copyright (c) 2012-2017, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
from .validators import integer
class Repository(AWSProperty):
props = {
"PathComponent": (str, True),
"RepositoryUrl": (str, True... |
ca8349a897c233d72ea74128dabdd1311f00c13c | tests/unittest.py | tests/unittest.py | # -*- coding: utf-8 -*-
# Copyright 2014 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | # -*- coding: utf-8 -*-
# Copyright 2014 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | Allow a TestCase to set a 'loglevel' attribute, which overrides the logging level while that testcase runs | Allow a TestCase to set a 'loglevel' attribute, which overrides the logging level while that testcase runs
| Python | apache-2.0 | illicitonion/synapse,TribeMedia/synapse,howethomas/synapse,iot-factory/synapse,howethomas/synapse,TribeMedia/synapse,rzr/synapse,rzr/synapse,illicitonion/synapse,illicitonion/synapse,illicitonion/synapse,TribeMedia/synapse,TribeMedia/synapse,iot-factory/synapse,rzr/synapse,rzr/synapse,matrix-org/synapse,iot-factory/syn... | # -*- coding: utf-8 -*-
# Copyright 2014 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | # -*- coding: utf-8 -*-
# Copyright 2014 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | <commit_before># -*- coding: utf-8 -*-
# Copyright 2014 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | # -*- coding: utf-8 -*-
# Copyright 2014 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | # -*- coding: utf-8 -*-
# Copyright 2014 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | <commit_before># -*- coding: utf-8 -*-
# Copyright 2014 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
ab84c37195feb7ea19be810a7d1a899e5e53ee78 | tests/test_pdfbuild.py | tests/test_pdfbuild.py | from latex import build_pdf
def test_generates_something():
min_latex = r"""
\documentclass{article}
\begin{document}
Hello, world!
\end{document}
"""
pdf = build_pdf(min_latex)
assert pdf
| from latex import build_pdf
from latex.exc import LatexBuildError
import pytest
def test_generates_something():
min_latex = r"""
\documentclass{article}
\begin{document}
Hello, world!
\end{document}
"""
pdf = build_pdf(min_latex)
assert pdf
def test_raises_correct_exception_on_fail():
broken_late... | Test whether or not the right exception is thrown. | Test whether or not the right exception is thrown.
| Python | bsd-3-clause | mbr/latex | from latex import build_pdf
def test_generates_something():
min_latex = r"""
\documentclass{article}
\begin{document}
Hello, world!
\end{document}
"""
pdf = build_pdf(min_latex)
assert pdf
Test whether or not the right exception is thrown. | from latex import build_pdf
from latex.exc import LatexBuildError
import pytest
def test_generates_something():
min_latex = r"""
\documentclass{article}
\begin{document}
Hello, world!
\end{document}
"""
pdf = build_pdf(min_latex)
assert pdf
def test_raises_correct_exception_on_fail():
broken_late... | <commit_before>from latex import build_pdf
def test_generates_something():
min_latex = r"""
\documentclass{article}
\begin{document}
Hello, world!
\end{document}
"""
pdf = build_pdf(min_latex)
assert pdf
<commit_msg>Test whether or not the right exception is thrown.<commit_after> | from latex import build_pdf
from latex.exc import LatexBuildError
import pytest
def test_generates_something():
min_latex = r"""
\documentclass{article}
\begin{document}
Hello, world!
\end{document}
"""
pdf = build_pdf(min_latex)
assert pdf
def test_raises_correct_exception_on_fail():
broken_late... | from latex import build_pdf
def test_generates_something():
min_latex = r"""
\documentclass{article}
\begin{document}
Hello, world!
\end{document}
"""
pdf = build_pdf(min_latex)
assert pdf
Test whether or not the right exception is thrown.from latex import build_pdf
from latex.exc import LatexBuildError... | <commit_before>from latex import build_pdf
def test_generates_something():
min_latex = r"""
\documentclass{article}
\begin{document}
Hello, world!
\end{document}
"""
pdf = build_pdf(min_latex)
assert pdf
<commit_msg>Test whether or not the right exception is thrown.<commit_after>from latex import build_... |
edd92253a7f37f63021e8dff15372bbbbce63089 | tfgraphviz/__init__.py | tfgraphviz/__init__.py | #!/usr/bin/env python
# coding: utf-8
from graphviz_wrapper import board
__author__ = 'akimacho'
__version__ = '0.0.1'
__license__ = 'MIT' | #!/usr/bin/env python
# coding: utf-8
from .graphviz_wrapper import board
__author__ = 'akimacho'
__version__ = '0.0.1'
__license__ = 'MIT' | Change IMPLICIT relative imports (not allowed in Python3k) to EXPLICIT relative imports (allowed in both Python2k/3k). | Change IMPLICIT relative imports (not allowed in Python3k) to EXPLICIT relative imports (allowed in both Python2k/3k).
| Python | mit | akimach/tfgraphviz | #!/usr/bin/env python
# coding: utf-8
from graphviz_wrapper import board
__author__ = 'akimacho'
__version__ = '0.0.1'
__license__ = 'MIT'Change IMPLICIT relative imports (not allowed in Python3k) to EXPLICIT relative imports (allowed in both Python2k/3k). | #!/usr/bin/env python
# coding: utf-8
from .graphviz_wrapper import board
__author__ = 'akimacho'
__version__ = '0.0.1'
__license__ = 'MIT' | <commit_before>#!/usr/bin/env python
# coding: utf-8
from graphviz_wrapper import board
__author__ = 'akimacho'
__version__ = '0.0.1'
__license__ = 'MIT'<commit_msg>Change IMPLICIT relative imports (not allowed in Python3k) to EXPLICIT relative imports (allowed in both Python2k/3k).<commit_after> | #!/usr/bin/env python
# coding: utf-8
from .graphviz_wrapper import board
__author__ = 'akimacho'
__version__ = '0.0.1'
__license__ = 'MIT' | #!/usr/bin/env python
# coding: utf-8
from graphviz_wrapper import board
__author__ = 'akimacho'
__version__ = '0.0.1'
__license__ = 'MIT'Change IMPLICIT relative imports (not allowed in Python3k) to EXPLICIT relative imports (allowed in both Python2k/3k).#!/usr/bin/env python
# coding: utf-8
from .graphviz_wrapper... | <commit_before>#!/usr/bin/env python
# coding: utf-8
from graphviz_wrapper import board
__author__ = 'akimacho'
__version__ = '0.0.1'
__license__ = 'MIT'<commit_msg>Change IMPLICIT relative imports (not allowed in Python3k) to EXPLICIT relative imports (allowed in both Python2k/3k).<commit_after>#!/usr/bin/env pytho... |
98c7f3afb2276012f22ad50e77fef60d7d71ee5f | qtpy/QtSvg.py | qtpy/QtSvg.py | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright © 2009- The Spyder Development Team
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# -----------------------------------------------------------------------------
"""Provi... | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright © 2009- The Spyder Development Team
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# -----------------------------------------------------------------------------
"""Provi... | Use star imports again instead of direct ones | QtSvG: Use star imports again instead of direct ones
| Python | mit | goanpeca/qtpy,davvid/qtpy,spyder-ide/qtpy,goanpeca/qtpy,davvid/qtpy | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright © 2009- The Spyder Development Team
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# -----------------------------------------------------------------------------
"""Provi... | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright © 2009- The Spyder Development Team
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# -----------------------------------------------------------------------------
"""Provi... | <commit_before># -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright © 2009- The Spyder Development Team
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# -----------------------------------------------------------------------... | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright © 2009- The Spyder Development Team
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# -----------------------------------------------------------------------------
"""Provi... | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright © 2009- The Spyder Development Team
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# -----------------------------------------------------------------------------
"""Provi... | <commit_before># -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright © 2009- The Spyder Development Team
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# -----------------------------------------------------------------------... |
4ebdd73bab19e83d52e03ac4afb7e1b3f78004f5 | drftutorial/catalog/views.py | drftutorial/catalog/views.py | from django.http import HttpResponse
from django.http import Http404
from rest_framework import generics
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework import status
from .permissions import IsAdminOrReadOnly
from .models import Product
from .serializers import... | from rest_framework import generics
from .permissions import IsAdminOrReadOnly
from .models import Product
from .serializers import ProductSerializer
class ProductList(generics.ListCreateAPIView):
queryset = Product.objects.all()
serializer_class = ProductSerializer
permission_classes = (IsAdminOrReadOnly... | Implement ProductDetail with a generic RetrieveUpdateDestroyAPIView class | Implement ProductDetail with a generic RetrieveUpdateDestroyAPIView class
| Python | mit | andreagrandi/drf-tutorial | from django.http import HttpResponse
from django.http import Http404
from rest_framework import generics
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework import status
from .permissions import IsAdminOrReadOnly
from .models import Product
from .serializers import... | from rest_framework import generics
from .permissions import IsAdminOrReadOnly
from .models import Product
from .serializers import ProductSerializer
class ProductList(generics.ListCreateAPIView):
queryset = Product.objects.all()
serializer_class = ProductSerializer
permission_classes = (IsAdminOrReadOnly... | <commit_before>from django.http import HttpResponse
from django.http import Http404
from rest_framework import generics
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework import status
from .permissions import IsAdminOrReadOnly
from .models import Product
from .ser... | from rest_framework import generics
from .permissions import IsAdminOrReadOnly
from .models import Product
from .serializers import ProductSerializer
class ProductList(generics.ListCreateAPIView):
queryset = Product.objects.all()
serializer_class = ProductSerializer
permission_classes = (IsAdminOrReadOnly... | from django.http import HttpResponse
from django.http import Http404
from rest_framework import generics
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework import status
from .permissions import IsAdminOrReadOnly
from .models import Product
from .serializers import... | <commit_before>from django.http import HttpResponse
from django.http import Http404
from rest_framework import generics
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework import status
from .permissions import IsAdminOrReadOnly
from .models import Product
from .ser... |
b3670094a44fc0fb07a91e1dc0ffb1a17001f855 | botcommands/vimtips.py | botcommands/vimtips.py | # coding: utf-8
import requests
from redis_wrap import get_hash
from rq.decorators import job
def vimtips(msg=None):
try:
existing_tips = get_hash('vimtips')
_len = len(existing_tips)
if _len > 0:
_index = randint(0, _len - 1)
_k = existing_tips.keys()[_index]
... | # coding: utf-8
from random import randint
import requests
from redis_wrap import get_hash, SYSTEMS
from rq.decorators import job
def vimtips(msg=None):
try:
existing_tips = get_hash('vimtips')
_len = len(existing_tips)
if _len > 0:
_index = randint(0, _len - 1)
_k ... | Fix import and use queue the right way | Fix import and use queue the right way
| Python | bsd-2-clause | JokerQyou/bot | # coding: utf-8
import requests
from redis_wrap import get_hash
from rq.decorators import job
def vimtips(msg=None):
try:
existing_tips = get_hash('vimtips')
_len = len(existing_tips)
if _len > 0:
_index = randint(0, _len - 1)
_k = existing_tips.keys()[_index]
... | # coding: utf-8
from random import randint
import requests
from redis_wrap import get_hash, SYSTEMS
from rq.decorators import job
def vimtips(msg=None):
try:
existing_tips = get_hash('vimtips')
_len = len(existing_tips)
if _len > 0:
_index = randint(0, _len - 1)
_k ... | <commit_before># coding: utf-8
import requests
from redis_wrap import get_hash
from rq.decorators import job
def vimtips(msg=None):
try:
existing_tips = get_hash('vimtips')
_len = len(existing_tips)
if _len > 0:
_index = randint(0, _len - 1)
_k = existing_tips.keys()... | # coding: utf-8
from random import randint
import requests
from redis_wrap import get_hash, SYSTEMS
from rq.decorators import job
def vimtips(msg=None):
try:
existing_tips = get_hash('vimtips')
_len = len(existing_tips)
if _len > 0:
_index = randint(0, _len - 1)
_k ... | # coding: utf-8
import requests
from redis_wrap import get_hash
from rq.decorators import job
def vimtips(msg=None):
try:
existing_tips = get_hash('vimtips')
_len = len(existing_tips)
if _len > 0:
_index = randint(0, _len - 1)
_k = existing_tips.keys()[_index]
... | <commit_before># coding: utf-8
import requests
from redis_wrap import get_hash
from rq.decorators import job
def vimtips(msg=None):
try:
existing_tips = get_hash('vimtips')
_len = len(existing_tips)
if _len > 0:
_index = randint(0, _len - 1)
_k = existing_tips.keys()... |
0ad0004d6460908d8b882d7da1086fc77e6c9635 | src/reversion/middleware.py | src/reversion/middleware.py | """Middleware used by Reversion."""
from __future__ import unicode_literals
from reversion.revisions import revision_context_manager
REVISION_MIDDLEWARE_FLAG = "reversion.revision_middleware_active"
class RevisionMiddleware(object):
"""Wraps the entire request in a revision."""
def process_reque... | """Middleware used by Reversion."""
from __future__ import unicode_literals
from reversion.revisions import revision_context_manager
REVISION_MIDDLEWARE_FLAG = "reversion.revision_middleware_active"
class RevisionMiddleware(object):
"""Wraps the entire request in a revision."""
def process_reque... | Fix bug handling exceptions in RevisionMiddleware | Fix bug handling exceptions in RevisionMiddleware
Recently the RevisionMiddleware was modified to avoid accessing
request.user unncessarily for caching purposes. This works well
except in some cases it can obscure errors generated elsewhere in a
project.
The RevisionContextManager has "active" and "inactive" states.... | Python | bsd-3-clause | ixc/django-reversion,etianen/django-reversion,etianen/django-reversion,adonm/django-reversion,MikeAmy/django-reversion,ixc/django-reversion,Beauhurst/django-reversion,MikeAmy/django-reversion,mkebri/django-reversion,adonm/django-reversion,blag/django-reversion,talpor/django-reversion,Govexec/django-reversion,mkebri/dja... | """Middleware used by Reversion."""
from __future__ import unicode_literals
from reversion.revisions import revision_context_manager
REVISION_MIDDLEWARE_FLAG = "reversion.revision_middleware_active"
class RevisionMiddleware(object):
"""Wraps the entire request in a revision."""
def process_reque... | """Middleware used by Reversion."""
from __future__ import unicode_literals
from reversion.revisions import revision_context_manager
REVISION_MIDDLEWARE_FLAG = "reversion.revision_middleware_active"
class RevisionMiddleware(object):
"""Wraps the entire request in a revision."""
def process_reque... | <commit_before>"""Middleware used by Reversion."""
from __future__ import unicode_literals
from reversion.revisions import revision_context_manager
REVISION_MIDDLEWARE_FLAG = "reversion.revision_middleware_active"
class RevisionMiddleware(object):
"""Wraps the entire request in a revision."""
de... | """Middleware used by Reversion."""
from __future__ import unicode_literals
from reversion.revisions import revision_context_manager
REVISION_MIDDLEWARE_FLAG = "reversion.revision_middleware_active"
class RevisionMiddleware(object):
"""Wraps the entire request in a revision."""
def process_reque... | """Middleware used by Reversion."""
from __future__ import unicode_literals
from reversion.revisions import revision_context_manager
REVISION_MIDDLEWARE_FLAG = "reversion.revision_middleware_active"
class RevisionMiddleware(object):
"""Wraps the entire request in a revision."""
def process_reque... | <commit_before>"""Middleware used by Reversion."""
from __future__ import unicode_literals
from reversion.revisions import revision_context_manager
REVISION_MIDDLEWARE_FLAG = "reversion.revision_middleware_active"
class RevisionMiddleware(object):
"""Wraps the entire request in a revision."""
de... |
bd4b122f72ad09245ba57acbd717e7e6d1126b88 | src/calc_perplexity.py | src/calc_perplexity.py | #! /usr/bin/python2
from __future__ import division
import numpy
# JAKE
def calc_perplexity(test_counts_dict, trigram_probs_dict):
'''
# Calculates perplexity of contents of file_string
# according to probabilities in trigram_probs_dict.
'''
test_probs = []
for trigram, count in test_count... | #! /usr/bin/python2
from __future__ import division
import numpy
# JAKE
def calc_perplexity(test_counts_dict, trigram_probs_dict):
'''
# Calculates perplexity of contents of file_string
# according to probabilities in trigram_probs_dict.
'''
test_probs = []
for trigram, count in test_count... | Use log2 instead of log10. | Use log2 instead of log10.
| Python | unlicense | jvasilakes/language_detector,jvasilakes/language_detector | #! /usr/bin/python2
from __future__ import division
import numpy
# JAKE
def calc_perplexity(test_counts_dict, trigram_probs_dict):
'''
# Calculates perplexity of contents of file_string
# according to probabilities in trigram_probs_dict.
'''
test_probs = []
for trigram, count in test_count... | #! /usr/bin/python2
from __future__ import division
import numpy
# JAKE
def calc_perplexity(test_counts_dict, trigram_probs_dict):
'''
# Calculates perplexity of contents of file_string
# according to probabilities in trigram_probs_dict.
'''
test_probs = []
for trigram, count in test_count... | <commit_before>#! /usr/bin/python2
from __future__ import division
import numpy
# JAKE
def calc_perplexity(test_counts_dict, trigram_probs_dict):
'''
# Calculates perplexity of contents of file_string
# according to probabilities in trigram_probs_dict.
'''
test_probs = []
for trigram, coun... | #! /usr/bin/python2
from __future__ import division
import numpy
# JAKE
def calc_perplexity(test_counts_dict, trigram_probs_dict):
'''
# Calculates perplexity of contents of file_string
# according to probabilities in trigram_probs_dict.
'''
test_probs = []
for trigram, count in test_count... | #! /usr/bin/python2
from __future__ import division
import numpy
# JAKE
def calc_perplexity(test_counts_dict, trigram_probs_dict):
'''
# Calculates perplexity of contents of file_string
# according to probabilities in trigram_probs_dict.
'''
test_probs = []
for trigram, count in test_count... | <commit_before>#! /usr/bin/python2
from __future__ import division
import numpy
# JAKE
def calc_perplexity(test_counts_dict, trigram_probs_dict):
'''
# Calculates perplexity of contents of file_string
# according to probabilities in trigram_probs_dict.
'''
test_probs = []
for trigram, coun... |
12b8cd254bad5c2cb15de3f0c3e69ab78083fc48 | server/app.py | server/app.py | """This module contains basic functions to instantiate the BigchainDB API.
The application is implemented in Flask and runs using Gunicorn.
"""
import os
from flask import Flask
from flask.ext.cors import CORS
from server.lib.api.views import api_views
def create_app(debug):
"""Return an instance of the Flask ... | """This module contains basic functions to instantiate the BigchainDB API.
The application is implemented in Flask and runs using Gunicorn.
"""
import os
from flask import Flask
from flask.ext.cors import CORS
from server.lib.api.views import api_views
def create_app(debug):
"""Return an instance of the Flask ... | Fix CORS when running the api server with Docker | Fix CORS when running the api server with Docker
| Python | apache-2.0 | bigchaindb/bigchaindb-examples,bigchaindb/bigchaindb-examples,bigchaindb/bigchaindb-examples | """This module contains basic functions to instantiate the BigchainDB API.
The application is implemented in Flask and runs using Gunicorn.
"""
import os
from flask import Flask
from flask.ext.cors import CORS
from server.lib.api.views import api_views
def create_app(debug):
"""Return an instance of the Flask ... | """This module contains basic functions to instantiate the BigchainDB API.
The application is implemented in Flask and runs using Gunicorn.
"""
import os
from flask import Flask
from flask.ext.cors import CORS
from server.lib.api.views import api_views
def create_app(debug):
"""Return an instance of the Flask ... | <commit_before>"""This module contains basic functions to instantiate the BigchainDB API.
The application is implemented in Flask and runs using Gunicorn.
"""
import os
from flask import Flask
from flask.ext.cors import CORS
from server.lib.api.views import api_views
def create_app(debug):
"""Return an instanc... | """This module contains basic functions to instantiate the BigchainDB API.
The application is implemented in Flask and runs using Gunicorn.
"""
import os
from flask import Flask
from flask.ext.cors import CORS
from server.lib.api.views import api_views
def create_app(debug):
"""Return an instance of the Flask ... | """This module contains basic functions to instantiate the BigchainDB API.
The application is implemented in Flask and runs using Gunicorn.
"""
import os
from flask import Flask
from flask.ext.cors import CORS
from server.lib.api.views import api_views
def create_app(debug):
"""Return an instance of the Flask ... | <commit_before>"""This module contains basic functions to instantiate the BigchainDB API.
The application is implemented in Flask and runs using Gunicorn.
"""
import os
from flask import Flask
from flask.ext.cors import CORS
from server.lib.api.views import api_views
def create_app(debug):
"""Return an instanc... |
b98d7312019d041415d3d10d003267f03dddbf38 | eva/layers/residual_block.py | eva/layers/residual_block.py | from keras.layers import Convolution2D, Merge
from keras.layers.advanced_activations import PReLU
from eva.layers.masked_convolution2d import MaskedConvolution2D
def ResidualBlock(model, filters):
# 2h -> h
block = PReLU()(model)
block = MaskedConvolution2D(filters//2, 1, 1)(block)
# h 3x3 -> h
b... | from keras.layers import Convolution2D, Merge
from keras.layers.advanced_activations import PReLU
from eva.layers.masked_convolution2d import MaskedConvolution2D
class ResidualBlock(object):
def __init__(self, filters):
self.filters = filters
def __call__(self, model):
# 2h -> h
block... | Rewrite residual block as class rather than method | Rewrite residual block as class rather than method
| Python | apache-2.0 | israelg99/eva | from keras.layers import Convolution2D, Merge
from keras.layers.advanced_activations import PReLU
from eva.layers.masked_convolution2d import MaskedConvolution2D
def ResidualBlock(model, filters):
# 2h -> h
block = PReLU()(model)
block = MaskedConvolution2D(filters//2, 1, 1)(block)
# h 3x3 -> h
b... | from keras.layers import Convolution2D, Merge
from keras.layers.advanced_activations import PReLU
from eva.layers.masked_convolution2d import MaskedConvolution2D
class ResidualBlock(object):
def __init__(self, filters):
self.filters = filters
def __call__(self, model):
# 2h -> h
block... | <commit_before>from keras.layers import Convolution2D, Merge
from keras.layers.advanced_activations import PReLU
from eva.layers.masked_convolution2d import MaskedConvolution2D
def ResidualBlock(model, filters):
# 2h -> h
block = PReLU()(model)
block = MaskedConvolution2D(filters//2, 1, 1)(block)
# h... | from keras.layers import Convolution2D, Merge
from keras.layers.advanced_activations import PReLU
from eva.layers.masked_convolution2d import MaskedConvolution2D
class ResidualBlock(object):
def __init__(self, filters):
self.filters = filters
def __call__(self, model):
# 2h -> h
block... | from keras.layers import Convolution2D, Merge
from keras.layers.advanced_activations import PReLU
from eva.layers.masked_convolution2d import MaskedConvolution2D
def ResidualBlock(model, filters):
# 2h -> h
block = PReLU()(model)
block = MaskedConvolution2D(filters//2, 1, 1)(block)
# h 3x3 -> h
b... | <commit_before>from keras.layers import Convolution2D, Merge
from keras.layers.advanced_activations import PReLU
from eva.layers.masked_convolution2d import MaskedConvolution2D
def ResidualBlock(model, filters):
# 2h -> h
block = PReLU()(model)
block = MaskedConvolution2D(filters//2, 1, 1)(block)
# h... |
f2ab04ec2eb870e661223fd397d7c5a23935a233 | src/apps/employees/schema/types.py | src/apps/employees/schema/types.py | import graphene
from graphene_django.types import DjangoObjectType, ObjectType
from graphene_django_extras import (
DjangoFilterPaginateListField, LimitOffsetGraphqlPagination
)
from apps.employees import models
class EmployeeType(DjangoObjectType):
class Meta:
model = models.Employee
filte... | import graphene
from graphene_django.types import DjangoObjectType, ObjectType
from graphene_django_extras import (
DjangoFilterPaginateListField, LimitOffsetGraphqlPagination
)
from apps.employees import models
class EmployeeType(DjangoObjectType):
class Meta:
model = models.Employee
filte... | Remove Node interfaces (use origin id for objects) | Remove Node interfaces (use origin id for objects)
| Python | mit | wis-software/office-manager | import graphene
from graphene_django.types import DjangoObjectType, ObjectType
from graphene_django_extras import (
DjangoFilterPaginateListField, LimitOffsetGraphqlPagination
)
from apps.employees import models
class EmployeeType(DjangoObjectType):
class Meta:
model = models.Employee
filte... | import graphene
from graphene_django.types import DjangoObjectType, ObjectType
from graphene_django_extras import (
DjangoFilterPaginateListField, LimitOffsetGraphqlPagination
)
from apps.employees import models
class EmployeeType(DjangoObjectType):
class Meta:
model = models.Employee
filte... | <commit_before>import graphene
from graphene_django.types import DjangoObjectType, ObjectType
from graphene_django_extras import (
DjangoFilterPaginateListField, LimitOffsetGraphqlPagination
)
from apps.employees import models
class EmployeeType(DjangoObjectType):
class Meta:
model = models.Employee... | import graphene
from graphene_django.types import DjangoObjectType, ObjectType
from graphene_django_extras import (
DjangoFilterPaginateListField, LimitOffsetGraphqlPagination
)
from apps.employees import models
class EmployeeType(DjangoObjectType):
class Meta:
model = models.Employee
filte... | import graphene
from graphene_django.types import DjangoObjectType, ObjectType
from graphene_django_extras import (
DjangoFilterPaginateListField, LimitOffsetGraphqlPagination
)
from apps.employees import models
class EmployeeType(DjangoObjectType):
class Meta:
model = models.Employee
filte... | <commit_before>import graphene
from graphene_django.types import DjangoObjectType, ObjectType
from graphene_django_extras import (
DjangoFilterPaginateListField, LimitOffsetGraphqlPagination
)
from apps.employees import models
class EmployeeType(DjangoObjectType):
class Meta:
model = models.Employee... |
866af848f8468966ea7d9a020d46e88d7d780b2d | pytac/cs.py | pytac/cs.py | """
Template module to define control systems.
"""
class ControlSystem(object):
""" Define a control system to be used with a device.
It uses channel access to comunicate over the network with
the hardware.
"""
def __init__(self):
raise NotImplementedError()
def get(self, pv):
... | """
Template module to define control systems.
"""
class ControlSystem(object):
""" Define a control system to be used with a device.
It uses channel access to comunicate over the network with
the hardware.
"""
def __init__(self):
raise NotImplementedError()
def get(self, pv):
... | Remove the null control system | Remove the null control system
| Python | apache-2.0 | willrogers/pytac,willrogers/pytac | """
Template module to define control systems.
"""
class ControlSystem(object):
""" Define a control system to be used with a device.
It uses channel access to comunicate over the network with
the hardware.
"""
def __init__(self):
raise NotImplementedError()
def get(self, pv):
... | """
Template module to define control systems.
"""
class ControlSystem(object):
""" Define a control system to be used with a device.
It uses channel access to comunicate over the network with
the hardware.
"""
def __init__(self):
raise NotImplementedError()
def get(self, pv):
... | <commit_before>"""
Template module to define control systems.
"""
class ControlSystem(object):
""" Define a control system to be used with a device.
It uses channel access to comunicate over the network with
the hardware.
"""
def __init__(self):
raise NotImplementedError()
def get(se... | """
Template module to define control systems.
"""
class ControlSystem(object):
""" Define a control system to be used with a device.
It uses channel access to comunicate over the network with
the hardware.
"""
def __init__(self):
raise NotImplementedError()
def get(self, pv):
... | """
Template module to define control systems.
"""
class ControlSystem(object):
""" Define a control system to be used with a device.
It uses channel access to comunicate over the network with
the hardware.
"""
def __init__(self):
raise NotImplementedError()
def get(self, pv):
... | <commit_before>"""
Template module to define control systems.
"""
class ControlSystem(object):
""" Define a control system to be used with a device.
It uses channel access to comunicate over the network with
the hardware.
"""
def __init__(self):
raise NotImplementedError()
def get(se... |
3977b36760afa2407c5e98926a6c3c1f926f5493 | x64/expand.py | x64/expand.py | import sys
def expand(filename):
for dir in ('.', '../common', '../anstests/'):
try:
f = open(dir + "/" + filename)
except IOError:
continue
for line in f:
line = line.replace('\r', '')
if line.strip().startswith('#bye'):
sys.e... | import sys
def expand(filename):
for dir in ('.', '../common', '../anstests/'):
try:
f = open(dir + "/" + filename)
except IOError:
continue
for line in f:
line = line.replace('\r', '')
if line.strip().startswith('#bye'):
sys.e... | Fix missing newlines with Python3 | Fix missing newlines with Python3
| Python | bsd-3-clause | jamesbowman/swapforth,zuloloxi/swapforth,jamesbowman/swapforth,zuloloxi/swapforth,zuloloxi/swapforth,zuloloxi/swapforth,RGD2/swapforth,jamesbowman/swapforth,RGD2/swapforth,jamesbowman/swapforth,RGD2/swapforth,RGD2/swapforth | import sys
def expand(filename):
for dir in ('.', '../common', '../anstests/'):
try:
f = open(dir + "/" + filename)
except IOError:
continue
for line in f:
line = line.replace('\r', '')
if line.strip().startswith('#bye'):
sys.e... | import sys
def expand(filename):
for dir in ('.', '../common', '../anstests/'):
try:
f = open(dir + "/" + filename)
except IOError:
continue
for line in f:
line = line.replace('\r', '')
if line.strip().startswith('#bye'):
sys.e... | <commit_before>import sys
def expand(filename):
for dir in ('.', '../common', '../anstests/'):
try:
f = open(dir + "/" + filename)
except IOError:
continue
for line in f:
line = line.replace('\r', '')
if line.strip().startswith('#bye'):
... | import sys
def expand(filename):
for dir in ('.', '../common', '../anstests/'):
try:
f = open(dir + "/" + filename)
except IOError:
continue
for line in f:
line = line.replace('\r', '')
if line.strip().startswith('#bye'):
sys.e... | import sys
def expand(filename):
for dir in ('.', '../common', '../anstests/'):
try:
f = open(dir + "/" + filename)
except IOError:
continue
for line in f:
line = line.replace('\r', '')
if line.strip().startswith('#bye'):
sys.e... | <commit_before>import sys
def expand(filename):
for dir in ('.', '../common', '../anstests/'):
try:
f = open(dir + "/" + filename)
except IOError:
continue
for line in f:
line = line.replace('\r', '')
if line.strip().startswith('#bye'):
... |
d8d9b16e7264a6b2936b4920ca97f4dd923f29a3 | crankycoin/services/queue.py | crankycoin/services/queue.py | import zmq
from crankycoin import config, logger
class Queue(object):
QUEUE_BIND_IN = config['user']['queue_bind_in']
QUEUE_BIND_OUT = config['user']['queue_bind_out']
QUEUE_PROCESSING_WORKERS = config['user']['queue_processing_workers']
@classmethod
def start_queue(cls):
try:
... | import sys
import zmq
from crankycoin import config, logger
WIN32 = 'win32' in sys.platform
class Queue(object):
QUEUE_BIND_IN = config['user']['queue_bind_in'] if not WIN32 else config['user']['win_queue_bind_in']
QUEUE_BIND_OUT = config['user']['queue_bind_out'] if not WIN32 else config['user']['win_queue_... | Fix `protocol not supported` on Windows | Fix `protocol not supported` on Windows | Python | mit | cranklin/crankycoin | import zmq
from crankycoin import config, logger
class Queue(object):
QUEUE_BIND_IN = config['user']['queue_bind_in']
QUEUE_BIND_OUT = config['user']['queue_bind_out']
QUEUE_PROCESSING_WORKERS = config['user']['queue_processing_workers']
@classmethod
def start_queue(cls):
try:
... | import sys
import zmq
from crankycoin import config, logger
WIN32 = 'win32' in sys.platform
class Queue(object):
QUEUE_BIND_IN = config['user']['queue_bind_in'] if not WIN32 else config['user']['win_queue_bind_in']
QUEUE_BIND_OUT = config['user']['queue_bind_out'] if not WIN32 else config['user']['win_queue_... | <commit_before>import zmq
from crankycoin import config, logger
class Queue(object):
QUEUE_BIND_IN = config['user']['queue_bind_in']
QUEUE_BIND_OUT = config['user']['queue_bind_out']
QUEUE_PROCESSING_WORKERS = config['user']['queue_processing_workers']
@classmethod
def start_queue(cls):
... | import sys
import zmq
from crankycoin import config, logger
WIN32 = 'win32' in sys.platform
class Queue(object):
QUEUE_BIND_IN = config['user']['queue_bind_in'] if not WIN32 else config['user']['win_queue_bind_in']
QUEUE_BIND_OUT = config['user']['queue_bind_out'] if not WIN32 else config['user']['win_queue_... | import zmq
from crankycoin import config, logger
class Queue(object):
QUEUE_BIND_IN = config['user']['queue_bind_in']
QUEUE_BIND_OUT = config['user']['queue_bind_out']
QUEUE_PROCESSING_WORKERS = config['user']['queue_processing_workers']
@classmethod
def start_queue(cls):
try:
... | <commit_before>import zmq
from crankycoin import config, logger
class Queue(object):
QUEUE_BIND_IN = config['user']['queue_bind_in']
QUEUE_BIND_OUT = config['user']['queue_bind_out']
QUEUE_PROCESSING_WORKERS = config['user']['queue_processing_workers']
@classmethod
def start_queue(cls):
... |
0b845f6beaec8f7ce8e4cd473ed50fe1202b5139 | seabird/qc.py | seabird/qc.py | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import logging
from cotede.qc import ProfileQC
from . import fCNV
from .exceptions import CNVError
class fProfileQC(ProfileQC):
""" Apply ProfileQC from CoTeDe straight from a file.
"""
def __init__(self, inputfile, ... | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import logging
from os.path import basename
from cotede.qc import ProfileQC
from . import fCNV
from .exceptions import CNVError
class fProfileQC(ProfileQC):
""" Apply ProfileQC from CoTeDe straight from a file.
"""
d... | Add filename in attrs if fails to load it. | Add filename in attrs if fails to load it.
Filename in attrs helps to debug.
| Python | bsd-3-clause | castelao/seabird | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import logging
from cotede.qc import ProfileQC
from . import fCNV
from .exceptions import CNVError
class fProfileQC(ProfileQC):
""" Apply ProfileQC from CoTeDe straight from a file.
"""
def __init__(self, inputfile, ... | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import logging
from os.path import basename
from cotede.qc import ProfileQC
from . import fCNV
from .exceptions import CNVError
class fProfileQC(ProfileQC):
""" Apply ProfileQC from CoTeDe straight from a file.
"""
d... | <commit_before># -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import logging
from cotede.qc import ProfileQC
from . import fCNV
from .exceptions import CNVError
class fProfileQC(ProfileQC):
""" Apply ProfileQC from CoTeDe straight from a file.
"""
def __init__(se... | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import logging
from os.path import basename
from cotede.qc import ProfileQC
from . import fCNV
from .exceptions import CNVError
class fProfileQC(ProfileQC):
""" Apply ProfileQC from CoTeDe straight from a file.
"""
d... | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import logging
from cotede.qc import ProfileQC
from . import fCNV
from .exceptions import CNVError
class fProfileQC(ProfileQC):
""" Apply ProfileQC from CoTeDe straight from a file.
"""
def __init__(self, inputfile, ... | <commit_before># -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import logging
from cotede.qc import ProfileQC
from . import fCNV
from .exceptions import CNVError
class fProfileQC(ProfileQC):
""" Apply ProfileQC from CoTeDe straight from a file.
"""
def __init__(se... |
e8cf948ec22312e61548f5cb96bea3669a64f33c | id/migrations/0012_delete_externaldatabase.py | id/migrations/0012_delete_externaldatabase.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
import django.db
class Migration(migrations.Migration):
dependencies = [
('id', '0011_auto_20150916_1546'),
]
database_operations = [
migrations.AlterModelTable('ExternalDatabase', 'databases_... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('id', '0011_auto_20150916_1546'),
]
database_operations = [
migrations.AlterModelTable('ExternalDatabase', 'databases_externaldatabase'... | Revoke earlier change: This migration has already been applied. | Revoke earlier change: This migration has already been applied.
| Python | mit | occrp/id-backend | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
import django.db
class Migration(migrations.Migration):
dependencies = [
('id', '0011_auto_20150916_1546'),
]
database_operations = [
migrations.AlterModelTable('ExternalDatabase', 'databases_... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('id', '0011_auto_20150916_1546'),
]
database_operations = [
migrations.AlterModelTable('ExternalDatabase', 'databases_externaldatabase'... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
import django.db
class Migration(migrations.Migration):
dependencies = [
('id', '0011_auto_20150916_1546'),
]
database_operations = [
migrations.AlterModelTable('ExternalDatabas... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('id', '0011_auto_20150916_1546'),
]
database_operations = [
migrations.AlterModelTable('ExternalDatabase', 'databases_externaldatabase'... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
import django.db
class Migration(migrations.Migration):
dependencies = [
('id', '0011_auto_20150916_1546'),
]
database_operations = [
migrations.AlterModelTable('ExternalDatabase', 'databases_... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
import django.db
class Migration(migrations.Migration):
dependencies = [
('id', '0011_auto_20150916_1546'),
]
database_operations = [
migrations.AlterModelTable('ExternalDatabas... |
573055a80ef19f2b743ef3bfc08c40e8738c5bb1 | libtree/utils.py | libtree/utils.py | # Copyright (c) 2016 Fabian Kochem
import collections
from copy import deepcopy
def recursive_dict_merge(left, right, first_run=True):
"""
Merge ``right`` into ``left`` and return a new dictionary.
"""
if first_run is True:
left = deepcopy(left)
for key in right:
if key in left:... | # Copyright (c) 2016 Fabian Kochem
import collections
from copy import deepcopy
def recursive_dict_merge(left, right, create_copy=True):
"""
Merge ``right`` into ``left`` and return a new dictionary.
"""
if create_copy is True:
left = deepcopy(left)
for key in right:
if key in l... | Rename 'first_run' -> 'create_copy' in recursive_dict_merge() | Rename 'first_run' -> 'create_copy' in recursive_dict_merge()
| Python | mit | conceptsandtraining/libtree | # Copyright (c) 2016 Fabian Kochem
import collections
from copy import deepcopy
def recursive_dict_merge(left, right, first_run=True):
"""
Merge ``right`` into ``left`` and return a new dictionary.
"""
if first_run is True:
left = deepcopy(left)
for key in right:
if key in left:... | # Copyright (c) 2016 Fabian Kochem
import collections
from copy import deepcopy
def recursive_dict_merge(left, right, create_copy=True):
"""
Merge ``right`` into ``left`` and return a new dictionary.
"""
if create_copy is True:
left = deepcopy(left)
for key in right:
if key in l... | <commit_before># Copyright (c) 2016 Fabian Kochem
import collections
from copy import deepcopy
def recursive_dict_merge(left, right, first_run=True):
"""
Merge ``right`` into ``left`` and return a new dictionary.
"""
if first_run is True:
left = deepcopy(left)
for key in right:
... | # Copyright (c) 2016 Fabian Kochem
import collections
from copy import deepcopy
def recursive_dict_merge(left, right, create_copy=True):
"""
Merge ``right`` into ``left`` and return a new dictionary.
"""
if create_copy is True:
left = deepcopy(left)
for key in right:
if key in l... | # Copyright (c) 2016 Fabian Kochem
import collections
from copy import deepcopy
def recursive_dict_merge(left, right, first_run=True):
"""
Merge ``right`` into ``left`` and return a new dictionary.
"""
if first_run is True:
left = deepcopy(left)
for key in right:
if key in left:... | <commit_before># Copyright (c) 2016 Fabian Kochem
import collections
from copy import deepcopy
def recursive_dict_merge(left, right, first_run=True):
"""
Merge ``right`` into ``left`` and return a new dictionary.
"""
if first_run is True:
left = deepcopy(left)
for key in right:
... |
19733452008845419aea36e13d68494d931e44e6 | settings.py | settings.py | """settings.py - settings and configuration used over all modules :
Copyright (c) 2018 Heinrich Widmann (DKRZ)
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN N... | """settings.py - settings and configuration used over all modules :
Copyright (c) 2018 Heinrich Widmann (DKRZ)
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN N... | Set the right CKAN organization | Set the right CKAN organization
| Python | mit | EUDAT-Training/B2FIND-Training | """settings.py - settings and configuration used over all modules :
Copyright (c) 2018 Heinrich Widmann (DKRZ)
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN N... | """settings.py - settings and configuration used over all modules :
Copyright (c) 2018 Heinrich Widmann (DKRZ)
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN N... | <commit_before>"""settings.py - settings and configuration used over all modules :
Copyright (c) 2018 Heinrich Widmann (DKRZ)
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINF... | """settings.py - settings and configuration used over all modules :
Copyright (c) 2018 Heinrich Widmann (DKRZ)
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN N... | """settings.py - settings and configuration used over all modules :
Copyright (c) 2018 Heinrich Widmann (DKRZ)
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN N... | <commit_before>"""settings.py - settings and configuration used over all modules :
Copyright (c) 2018 Heinrich Widmann (DKRZ)
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINF... |
72b9aebb3cddf999bfaea0b3452cfa670b9ed269 | utils/config.py | utils/config.py | import yaml
def from_config(config):
config = dict(config) # shallow copy
return config.pop('class').from_config(config)
def from_yaml(yaml_string):
config = yaml.load(yaml_string)
return from_config(config)
class ConfigObject:
def get_config(self):
return dict(class_name=self.__class... | import yaml
def from_config(config):
config = dict(config) # shallow copy
return config.pop('class').from_config(config)
def from_yaml(yaml_string):
config = yaml.load(yaml_string)
return from_config(config)
class ConfigObject:
def get_config(self):
return {'class': self.__class__}
... | Fix ConfigObject to use class instead of class_name. Pass infinite width when dumping to yaml. | Fix ConfigObject to use class instead of class_name. Pass infinite width when dumping to yaml.
| Python | mit | alexlee-gk/visual_dynamics | import yaml
def from_config(config):
config = dict(config) # shallow copy
return config.pop('class').from_config(config)
def from_yaml(yaml_string):
config = yaml.load(yaml_string)
return from_config(config)
class ConfigObject:
def get_config(self):
return dict(class_name=self.__class... | import yaml
def from_config(config):
config = dict(config) # shallow copy
return config.pop('class').from_config(config)
def from_yaml(yaml_string):
config = yaml.load(yaml_string)
return from_config(config)
class ConfigObject:
def get_config(self):
return {'class': self.__class__}
... | <commit_before>import yaml
def from_config(config):
config = dict(config) # shallow copy
return config.pop('class').from_config(config)
def from_yaml(yaml_string):
config = yaml.load(yaml_string)
return from_config(config)
class ConfigObject:
def get_config(self):
return dict(class_na... | import yaml
def from_config(config):
config = dict(config) # shallow copy
return config.pop('class').from_config(config)
def from_yaml(yaml_string):
config = yaml.load(yaml_string)
return from_config(config)
class ConfigObject:
def get_config(self):
return {'class': self.__class__}
... | import yaml
def from_config(config):
config = dict(config) # shallow copy
return config.pop('class').from_config(config)
def from_yaml(yaml_string):
config = yaml.load(yaml_string)
return from_config(config)
class ConfigObject:
def get_config(self):
return dict(class_name=self.__class... | <commit_before>import yaml
def from_config(config):
config = dict(config) # shallow copy
return config.pop('class').from_config(config)
def from_yaml(yaml_string):
config = yaml.load(yaml_string)
return from_config(config)
class ConfigObject:
def get_config(self):
return dict(class_na... |
56ca0dce01ad76934ae850ea20ab25adbcc751d1 | conf_site/proposals/admin.py | conf_site/proposals/admin.py | from django.contrib import admin
from .models import Proposal, ProposalKeyword
@admin.register(ProposalKeyword)
class KeywordAdmin(admin.ModelAdmin):
list_display = ("name", "slug", "official",)
list_filter = ("official",)
@admin.register(Proposal)
class ProposalAdmin(admin.ModelAdmin):
exclude = (
... | from django.contrib import admin
from .models import Proposal, ProposalKeyword
@admin.register(ProposalKeyword)
class KeywordAdmin(admin.ModelAdmin):
list_display = ("name", "slug", "official",)
list_filter = ("official",)
@admin.register(Proposal)
class ProposalAdmin(admin.ModelAdmin):
exclude = (
... | Remove speaker email field from proposal listing. | Remove speaker email field from proposal listing.
Save space in admin proposal listing by removing the speaker email
field.
| Python | mit | pydata/conf_site,pydata/conf_site,pydata/conf_site | from django.contrib import admin
from .models import Proposal, ProposalKeyword
@admin.register(ProposalKeyword)
class KeywordAdmin(admin.ModelAdmin):
list_display = ("name", "slug", "official",)
list_filter = ("official",)
@admin.register(Proposal)
class ProposalAdmin(admin.ModelAdmin):
exclude = (
... | from django.contrib import admin
from .models import Proposal, ProposalKeyword
@admin.register(ProposalKeyword)
class KeywordAdmin(admin.ModelAdmin):
list_display = ("name", "slug", "official",)
list_filter = ("official",)
@admin.register(Proposal)
class ProposalAdmin(admin.ModelAdmin):
exclude = (
... | <commit_before>from django.contrib import admin
from .models import Proposal, ProposalKeyword
@admin.register(ProposalKeyword)
class KeywordAdmin(admin.ModelAdmin):
list_display = ("name", "slug", "official",)
list_filter = ("official",)
@admin.register(Proposal)
class ProposalAdmin(admin.ModelAdmin):
... | from django.contrib import admin
from .models import Proposal, ProposalKeyword
@admin.register(ProposalKeyword)
class KeywordAdmin(admin.ModelAdmin):
list_display = ("name", "slug", "official",)
list_filter = ("official",)
@admin.register(Proposal)
class ProposalAdmin(admin.ModelAdmin):
exclude = (
... | from django.contrib import admin
from .models import Proposal, ProposalKeyword
@admin.register(ProposalKeyword)
class KeywordAdmin(admin.ModelAdmin):
list_display = ("name", "slug", "official",)
list_filter = ("official",)
@admin.register(Proposal)
class ProposalAdmin(admin.ModelAdmin):
exclude = (
... | <commit_before>from django.contrib import admin
from .models import Proposal, ProposalKeyword
@admin.register(ProposalKeyword)
class KeywordAdmin(admin.ModelAdmin):
list_display = ("name", "slug", "official",)
list_filter = ("official",)
@admin.register(Proposal)
class ProposalAdmin(admin.ModelAdmin):
... |
d76b7525e60767c0fc73c67ebe458329a3ae2426 | tests/parser/test_parse_inreach.py | tests/parser/test_parse_inreach.py | import unittest
from ogn.parser.aprs_comment.inreach_parser import InreachParser
class TestStringMethods(unittest.TestCase):
def test_position_comment(self):
message = InreachParser().parse_position("id300434060496190 inReac True")
self.assertEqual(message['address'], "300434060496190")
sel... | import unittest
from ogn.parser.aprs_comment.inreach_parser import InreachParser
class TestStringMethods(unittest.TestCase):
def test_position_comment(self):
message = InreachParser().parse_position("id300434060496190 inReac True")
self.assertEqual(message['address'], "300434060496190")
se... | Add a blank line in the test case for CI? | Add a blank line in the test case for CI?
| Python | agpl-3.0 | glidernet/python-ogn-client | import unittest
from ogn.parser.aprs_comment.inreach_parser import InreachParser
class TestStringMethods(unittest.TestCase):
def test_position_comment(self):
message = InreachParser().parse_position("id300434060496190 inReac True")
self.assertEqual(message['address'], "300434060496190")
sel... | import unittest
from ogn.parser.aprs_comment.inreach_parser import InreachParser
class TestStringMethods(unittest.TestCase):
def test_position_comment(self):
message = InreachParser().parse_position("id300434060496190 inReac True")
self.assertEqual(message['address'], "300434060496190")
se... | <commit_before>import unittest
from ogn.parser.aprs_comment.inreach_parser import InreachParser
class TestStringMethods(unittest.TestCase):
def test_position_comment(self):
message = InreachParser().parse_position("id300434060496190 inReac True")
self.assertEqual(message['address'], "30043406049619... | import unittest
from ogn.parser.aprs_comment.inreach_parser import InreachParser
class TestStringMethods(unittest.TestCase):
def test_position_comment(self):
message = InreachParser().parse_position("id300434060496190 inReac True")
self.assertEqual(message['address'], "300434060496190")
se... | import unittest
from ogn.parser.aprs_comment.inreach_parser import InreachParser
class TestStringMethods(unittest.TestCase):
def test_position_comment(self):
message = InreachParser().parse_position("id300434060496190 inReac True")
self.assertEqual(message['address'], "300434060496190")
sel... | <commit_before>import unittest
from ogn.parser.aprs_comment.inreach_parser import InreachParser
class TestStringMethods(unittest.TestCase):
def test_position_comment(self):
message = InreachParser().parse_position("id300434060496190 inReac True")
self.assertEqual(message['address'], "30043406049619... |
f81ddc6297b1372cdba3a5161b4f30d0a42d2f58 | src/factor.py | src/factor.py | from collections import Counter
from functools import (
lru_cache,
reduce,
)
from itertools import combinations
from prime import Prime
@lru_cache(maxsize=None)
def get_prime_factors(n):
""" Returns the counts of each prime factor of n
"""
if n == 1:
return Counter()
divisor = 2
wh... | from collections import Counter
from functools import (
lru_cache,
reduce,
)
from itertools import combinations
from prime import Prime
@lru_cache(maxsize=None)
def get_prime_factors(n):
""" Returns the counts of each prime factor of n
"""
if n < 1:
raise ValueError
if n == 1:
... | Raise ValueError if n < 1 | Raise ValueError if n < 1
| Python | mit | mackorone/euler | from collections import Counter
from functools import (
lru_cache,
reduce,
)
from itertools import combinations
from prime import Prime
@lru_cache(maxsize=None)
def get_prime_factors(n):
""" Returns the counts of each prime factor of n
"""
if n == 1:
return Counter()
divisor = 2
wh... | from collections import Counter
from functools import (
lru_cache,
reduce,
)
from itertools import combinations
from prime import Prime
@lru_cache(maxsize=None)
def get_prime_factors(n):
""" Returns the counts of each prime factor of n
"""
if n < 1:
raise ValueError
if n == 1:
... | <commit_before>from collections import Counter
from functools import (
lru_cache,
reduce,
)
from itertools import combinations
from prime import Prime
@lru_cache(maxsize=None)
def get_prime_factors(n):
""" Returns the counts of each prime factor of n
"""
if n == 1:
return Counter()
div... | from collections import Counter
from functools import (
lru_cache,
reduce,
)
from itertools import combinations
from prime import Prime
@lru_cache(maxsize=None)
def get_prime_factors(n):
""" Returns the counts of each prime factor of n
"""
if n < 1:
raise ValueError
if n == 1:
... | from collections import Counter
from functools import (
lru_cache,
reduce,
)
from itertools import combinations
from prime import Prime
@lru_cache(maxsize=None)
def get_prime_factors(n):
""" Returns the counts of each prime factor of n
"""
if n == 1:
return Counter()
divisor = 2
wh... | <commit_before>from collections import Counter
from functools import (
lru_cache,
reduce,
)
from itertools import combinations
from prime import Prime
@lru_cache(maxsize=None)
def get_prime_factors(n):
""" Returns the counts of each prime factor of n
"""
if n == 1:
return Counter()
div... |
caf48c98f0cb176c2cd0302d1667d2272a192c91 | WebSphere/checkAppStatus.py | WebSphere/checkAppStatus.py | # Author: Christoph Stoettner
# E-Mail: christoph.stoettner@stoeps.de
# Blog: http://www.stoeps.de
# Check if applications are running
print "Getting application status of all installed applications..."
applications = AdminApp.list().splitlines();
for application in applications:
applName = AdminControl.complete... | # Author: Christoph Stoettner
# E-Mail: christoph.stoettner@stoeps.de
# Blog: http://www.stoeps.de
# Check if applications are running
print "Getting application status of all installed applications..."
applications = AdminApp.list().splitlines();
runningApps = []
stoppedApps = []
for application in applications:
... | Print running and stopped Applications | Print running and stopped Applications | Python | apache-2.0 | stoeps13/ibmcnxscripting,stoeps13/ibmcnxscripting,stoeps13/ibmcnxscripting | # Author: Christoph Stoettner
# E-Mail: christoph.stoettner@stoeps.de
# Blog: http://www.stoeps.de
# Check if applications are running
print "Getting application status of all installed applications..."
applications = AdminApp.list().splitlines();
for application in applications:
applName = AdminControl.complete... | # Author: Christoph Stoettner
# E-Mail: christoph.stoettner@stoeps.de
# Blog: http://www.stoeps.de
# Check if applications are running
print "Getting application status of all installed applications..."
applications = AdminApp.list().splitlines();
runningApps = []
stoppedApps = []
for application in applications:
... | <commit_before># Author: Christoph Stoettner
# E-Mail: christoph.stoettner@stoeps.de
# Blog: http://www.stoeps.de
# Check if applications are running
print "Getting application status of all installed applications..."
applications = AdminApp.list().splitlines();
for application in applications:
applName = AdminC... | # Author: Christoph Stoettner
# E-Mail: christoph.stoettner@stoeps.de
# Blog: http://www.stoeps.de
# Check if applications are running
print "Getting application status of all installed applications..."
applications = AdminApp.list().splitlines();
runningApps = []
stoppedApps = []
for application in applications:
... | # Author: Christoph Stoettner
# E-Mail: christoph.stoettner@stoeps.de
# Blog: http://www.stoeps.de
# Check if applications are running
print "Getting application status of all installed applications..."
applications = AdminApp.list().splitlines();
for application in applications:
applName = AdminControl.complete... | <commit_before># Author: Christoph Stoettner
# E-Mail: christoph.stoettner@stoeps.de
# Blog: http://www.stoeps.de
# Check if applications are running
print "Getting application status of all installed applications..."
applications = AdminApp.list().splitlines();
for application in applications:
applName = AdminC... |
420153447bdd069153cf58c36d6b6cb51259ca14 | tba_config.py | tba_config.py | import json
import os
DEBUG = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')
# For choosing what the main landing page displays
KICKOFF = 1
BUILDSEASON = 2
COMPETITIONSEASON = 3
OFFSEASON = 4
# The CONFIG variables should have exactly the same structure between environments
# Eventually a test environment s... | import json
import os
DEBUG = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')
# For choosing what the main landing page displays
KICKOFF = 1
BUILDSEASON = 2
COMPETITIONSEASON = 3
OFFSEASON = 4
# The CONFIG variables should have exactly the same structure between environments
# Eventually a test environment s... | Increment static resources for Firebase. | Increment static resources for Firebase.
| Python | mit | 1fish2/the-blue-alliance,tsteward/the-blue-alliance,nwalters512/the-blue-alliance,verycumbersome/the-blue-alliance,bvisness/the-blue-alliance,josephbisch/the-blue-alliance,phil-lopreiato/the-blue-alliance,the-blue-alliance/the-blue-alliance,synth3tk/the-blue-alliance,synth3tk/the-blue-alliance,synth3tk/the-blue-allianc... | import json
import os
DEBUG = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')
# For choosing what the main landing page displays
KICKOFF = 1
BUILDSEASON = 2
COMPETITIONSEASON = 3
OFFSEASON = 4
# The CONFIG variables should have exactly the same structure between environments
# Eventually a test environment s... | import json
import os
DEBUG = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')
# For choosing what the main landing page displays
KICKOFF = 1
BUILDSEASON = 2
COMPETITIONSEASON = 3
OFFSEASON = 4
# The CONFIG variables should have exactly the same structure between environments
# Eventually a test environment s... | <commit_before>import json
import os
DEBUG = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')
# For choosing what the main landing page displays
KICKOFF = 1
BUILDSEASON = 2
COMPETITIONSEASON = 3
OFFSEASON = 4
# The CONFIG variables should have exactly the same structure between environments
# Eventually a tes... | import json
import os
DEBUG = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')
# For choosing what the main landing page displays
KICKOFF = 1
BUILDSEASON = 2
COMPETITIONSEASON = 3
OFFSEASON = 4
# The CONFIG variables should have exactly the same structure between environments
# Eventually a test environment s... | import json
import os
DEBUG = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')
# For choosing what the main landing page displays
KICKOFF = 1
BUILDSEASON = 2
COMPETITIONSEASON = 3
OFFSEASON = 4
# The CONFIG variables should have exactly the same structure between environments
# Eventually a test environment s... | <commit_before>import json
import os
DEBUG = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')
# For choosing what the main landing page displays
KICKOFF = 1
BUILDSEASON = 2
COMPETITIONSEASON = 3
OFFSEASON = 4
# The CONFIG variables should have exactly the same structure between environments
# Eventually a tes... |
2fec68d8cf1bf2726488730c369aad7b8b96b167 | openacademy/wizard/openacademy_wizard.py | openacademy/wizard/openacademy_wizard.py | # -*- coding: utf-8 -*-
from openerp import fields, models, api
"""
This module create model of Wizard
"""
class Wizard(models.TransientModel):
""""
This class create model of Wizard
"""
_name = 'openacademy.wizard'
def _default_sessions(self):
return self.env['openacademy.session'].brow... | # -*- coding: utf-8 -*-
"""
This module create model of Wizard
"""
from openerp import fields, models, api
class Wizard(models.TransientModel):
""""
This class create model of Wizard
"""
_name = 'openacademy.wizard'
def _default_sessions(self):
return self.env['openacademy.session'].bro... | Fix error String statement has no effect | [FIX] pylint: Fix error String statement has no effect
| Python | apache-2.0 | JesusZapata/openacademy | # -*- coding: utf-8 -*-
from openerp import fields, models, api
"""
This module create model of Wizard
"""
class Wizard(models.TransientModel):
""""
This class create model of Wizard
"""
_name = 'openacademy.wizard'
def _default_sessions(self):
return self.env['openacademy.session'].brow... | # -*- coding: utf-8 -*-
"""
This module create model of Wizard
"""
from openerp import fields, models, api
class Wizard(models.TransientModel):
""""
This class create model of Wizard
"""
_name = 'openacademy.wizard'
def _default_sessions(self):
return self.env['openacademy.session'].bro... | <commit_before># -*- coding: utf-8 -*-
from openerp import fields, models, api
"""
This module create model of Wizard
"""
class Wizard(models.TransientModel):
""""
This class create model of Wizard
"""
_name = 'openacademy.wizard'
def _default_sessions(self):
return self.env['openacademy... | # -*- coding: utf-8 -*-
"""
This module create model of Wizard
"""
from openerp import fields, models, api
class Wizard(models.TransientModel):
""""
This class create model of Wizard
"""
_name = 'openacademy.wizard'
def _default_sessions(self):
return self.env['openacademy.session'].bro... | # -*- coding: utf-8 -*-
from openerp import fields, models, api
"""
This module create model of Wizard
"""
class Wizard(models.TransientModel):
""""
This class create model of Wizard
"""
_name = 'openacademy.wizard'
def _default_sessions(self):
return self.env['openacademy.session'].brow... | <commit_before># -*- coding: utf-8 -*-
from openerp import fields, models, api
"""
This module create model of Wizard
"""
class Wizard(models.TransientModel):
""""
This class create model of Wizard
"""
_name = 'openacademy.wizard'
def _default_sessions(self):
return self.env['openacademy... |
f00cb6c748e2eda022a7f9f739b60b98a0308eb7 | github3/search/repository.py | github3/search/repository.py | # -*- coding: utf-8 -*-
from github3.models import GitHubCore
from github3.repos import Repository
class RepositorySearchResult(GitHubCore):
def __init__(self, data, session=None):
result = data.copy()
#: Score of the result
self.score = result.pop('score')
#: Text matches
... | # -*- coding: utf-8 -*-
from github3.models import GitHubCore
from github3.repos import Repository
class RepositorySearchResult(GitHubCore):
def __init__(self, data, session=None):
result = data.copy()
#: Score of the result
self.score = result.pop('score')
#: Text matches
... | Add a __repr__ for RepositorySearchResult | Add a __repr__ for RepositorySearchResult
| Python | bsd-3-clause | ueg1990/github3.py,icio/github3.py,christophelec/github3.py,jim-minter/github3.py,agamdua/github3.py,krxsky/github3.py,itsmemattchung/github3.py,sigmavirus24/github3.py,h4ck3rm1k3/github3.py,balloob/github3.py,wbrefvem/github3.py,degustaf/github3.py | # -*- coding: utf-8 -*-
from github3.models import GitHubCore
from github3.repos import Repository
class RepositorySearchResult(GitHubCore):
def __init__(self, data, session=None):
result = data.copy()
#: Score of the result
self.score = result.pop('score')
#: Text matches
... | # -*- coding: utf-8 -*-
from github3.models import GitHubCore
from github3.repos import Repository
class RepositorySearchResult(GitHubCore):
def __init__(self, data, session=None):
result = data.copy()
#: Score of the result
self.score = result.pop('score')
#: Text matches
... | <commit_before># -*- coding: utf-8 -*-
from github3.models import GitHubCore
from github3.repos import Repository
class RepositorySearchResult(GitHubCore):
def __init__(self, data, session=None):
result = data.copy()
#: Score of the result
self.score = result.pop('score')
#: Text m... | # -*- coding: utf-8 -*-
from github3.models import GitHubCore
from github3.repos import Repository
class RepositorySearchResult(GitHubCore):
def __init__(self, data, session=None):
result = data.copy()
#: Score of the result
self.score = result.pop('score')
#: Text matches
... | # -*- coding: utf-8 -*-
from github3.models import GitHubCore
from github3.repos import Repository
class RepositorySearchResult(GitHubCore):
def __init__(self, data, session=None):
result = data.copy()
#: Score of the result
self.score = result.pop('score')
#: Text matches
... | <commit_before># -*- coding: utf-8 -*-
from github3.models import GitHubCore
from github3.repos import Repository
class RepositorySearchResult(GitHubCore):
def __init__(self, data, session=None):
result = data.copy()
#: Score of the result
self.score = result.pop('score')
#: Text m... |
e66bd19fc4baae27f40b1b63bdc0a3280d8d25e9 | src/heap.py | src/heap.py | # -*- coding: utf-8 -*-
class Heap(object):
"""Implements a heap data structure in Python.
The underlying data structure used to hold the data is an array.
"""
__heap = []
def __init__(self, initial=[]):
"""Creates a new heap.
Args:
initial: (Optional): A continguous array containing the d... | # -*- coding: utf-8 -*-
class Heap(object):
"""Implements a heap data structure in Python.
The underlying data structure used to hold the data is an array.
"""
__heap = []
def __init__(self, initial=None):
"""Creates a new heap.
Args:
initial: (Optional): A continguous array containing the... | Fix massive bug in initialization | Fix massive bug in initialization
| Python | mit | DasAllFolks/PyAlgo | # -*- coding: utf-8 -*-
class Heap(object):
"""Implements a heap data structure in Python.
The underlying data structure used to hold the data is an array.
"""
__heap = []
def __init__(self, initial=[]):
"""Creates a new heap.
Args:
initial: (Optional): A continguous array containing the d... | # -*- coding: utf-8 -*-
class Heap(object):
"""Implements a heap data structure in Python.
The underlying data structure used to hold the data is an array.
"""
__heap = []
def __init__(self, initial=None):
"""Creates a new heap.
Args:
initial: (Optional): A continguous array containing the... | <commit_before># -*- coding: utf-8 -*-
class Heap(object):
"""Implements a heap data structure in Python.
The underlying data structure used to hold the data is an array.
"""
__heap = []
def __init__(self, initial=[]):
"""Creates a new heap.
Args:
initial: (Optional): A continguous array c... | # -*- coding: utf-8 -*-
class Heap(object):
"""Implements a heap data structure in Python.
The underlying data structure used to hold the data is an array.
"""
__heap = []
def __init__(self, initial=None):
"""Creates a new heap.
Args:
initial: (Optional): A continguous array containing the... | # -*- coding: utf-8 -*-
class Heap(object):
"""Implements a heap data structure in Python.
The underlying data structure used to hold the data is an array.
"""
__heap = []
def __init__(self, initial=[]):
"""Creates a new heap.
Args:
initial: (Optional): A continguous array containing the d... | <commit_before># -*- coding: utf-8 -*-
class Heap(object):
"""Implements a heap data structure in Python.
The underlying data structure used to hold the data is an array.
"""
__heap = []
def __init__(self, initial=[]):
"""Creates a new heap.
Args:
initial: (Optional): A continguous array c... |
54d5db67523deea7e34f784df667ffb705f3bb16 | TWLight/resources/admin.py | TWLight/resources/admin.py | from django.contrib import admin
from .models import Partner, Stream, Contact, Language
class LanguageAdmin(admin.ModelAdmin):
search_fields = ('language',)
list_display = ('language',)
admin.site.register(Language, LanguageAdmin)
class PartnerAdmin(admin.ModelAdmin):
search_fields = ('company_name',)... | from django import forms
from django.contrib import admin
from TWLight.users.groups import get_coordinators
from .models import Partner, Stream, Contact, Language
class LanguageAdmin(admin.ModelAdmin):
search_fields = ('language',)
list_display = ('language',)
admin.site.register(Language, LanguageAdmin)
... | Improve usability of coordinator designation interaction | Improve usability of coordinator designation interaction
I'm limiting the dropdown to actual coordinators so that admins don't
have to scroll through a giant list. I don't want to enforce/validate
this on the database level, though, as people may proceed through the
coordinator designation process in different orders,... | Python | mit | WikipediaLibrary/TWLight,WikipediaLibrary/TWLight,WikipediaLibrary/TWLight,WikipediaLibrary/TWLight,WikipediaLibrary/TWLight | from django.contrib import admin
from .models import Partner, Stream, Contact, Language
class LanguageAdmin(admin.ModelAdmin):
search_fields = ('language',)
list_display = ('language',)
admin.site.register(Language, LanguageAdmin)
class PartnerAdmin(admin.ModelAdmin):
search_fields = ('company_name',)... | from django import forms
from django.contrib import admin
from TWLight.users.groups import get_coordinators
from .models import Partner, Stream, Contact, Language
class LanguageAdmin(admin.ModelAdmin):
search_fields = ('language',)
list_display = ('language',)
admin.site.register(Language, LanguageAdmin)
... | <commit_before>from django.contrib import admin
from .models import Partner, Stream, Contact, Language
class LanguageAdmin(admin.ModelAdmin):
search_fields = ('language',)
list_display = ('language',)
admin.site.register(Language, LanguageAdmin)
class PartnerAdmin(admin.ModelAdmin):
search_fields = ('... | from django import forms
from django.contrib import admin
from TWLight.users.groups import get_coordinators
from .models import Partner, Stream, Contact, Language
class LanguageAdmin(admin.ModelAdmin):
search_fields = ('language',)
list_display = ('language',)
admin.site.register(Language, LanguageAdmin)
... | from django.contrib import admin
from .models import Partner, Stream, Contact, Language
class LanguageAdmin(admin.ModelAdmin):
search_fields = ('language',)
list_display = ('language',)
admin.site.register(Language, LanguageAdmin)
class PartnerAdmin(admin.ModelAdmin):
search_fields = ('company_name',)... | <commit_before>from django.contrib import admin
from .models import Partner, Stream, Contact, Language
class LanguageAdmin(admin.ModelAdmin):
search_fields = ('language',)
list_display = ('language',)
admin.site.register(Language, LanguageAdmin)
class PartnerAdmin(admin.ModelAdmin):
search_fields = ('... |
f1cb71f6647a843f519606da4a8f652fd3f8a172 | yithlibraryserver/config.py | yithlibraryserver/config.py | import os
def read_setting_from_env(settings, key, default=None):
env_variable = key.upper()
if env_variable in os.environ:
return os.environ[env_variable]
else:
return settings.get(key, default)
| import logging
import os
log = logging.getLogger(__name__)
def read_setting_from_env(settings, key, default=None):
env_variable = key.upper()
if env_variable in os.environ:
log.debug('Setting %s found in the environment: %s' %
(key, os.environ[env_variable]))
return os.envi... | Add some logging calls to the setting reading | Add some logging calls to the setting reading
| Python | agpl-3.0 | lorenzogil/yith-library-server,Yaco-Sistemas/yith-library-server,lorenzogil/yith-library-server,Yaco-Sistemas/yith-library-server,Yaco-Sistemas/yith-library-server,lorenzogil/yith-library-server | import os
def read_setting_from_env(settings, key, default=None):
env_variable = key.upper()
if env_variable in os.environ:
return os.environ[env_variable]
else:
return settings.get(key, default)
Add some logging calls to the setting reading | import logging
import os
log = logging.getLogger(__name__)
def read_setting_from_env(settings, key, default=None):
env_variable = key.upper()
if env_variable in os.environ:
log.debug('Setting %s found in the environment: %s' %
(key, os.environ[env_variable]))
return os.envi... | <commit_before>import os
def read_setting_from_env(settings, key, default=None):
env_variable = key.upper()
if env_variable in os.environ:
return os.environ[env_variable]
else:
return settings.get(key, default)
<commit_msg>Add some logging calls to the setting reading<commit_after> | import logging
import os
log = logging.getLogger(__name__)
def read_setting_from_env(settings, key, default=None):
env_variable = key.upper()
if env_variable in os.environ:
log.debug('Setting %s found in the environment: %s' %
(key, os.environ[env_variable]))
return os.envi... | import os
def read_setting_from_env(settings, key, default=None):
env_variable = key.upper()
if env_variable in os.environ:
return os.environ[env_variable]
else:
return settings.get(key, default)
Add some logging calls to the setting readingimport logging
import os
log = logging.getLogge... | <commit_before>import os
def read_setting_from_env(settings, key, default=None):
env_variable = key.upper()
if env_variable in os.environ:
return os.environ[env_variable]
else:
return settings.get(key, default)
<commit_msg>Add some logging calls to the setting reading<commit_after>import l... |
35b965a645955bbb757f4e6854edc7744a42e3bc | tests/test_settings.py | tests/test_settings.py | SECRET_KEY = 'dog'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}
CHANNEL_LAYERS = {
'default': {
'BACKEND': 'asgiref.inmemory.ChannelLayer',
'ROUTING': [],
},
}
MIDDLEWARE_CLASSES = []
INSTALLED_APPS = ('tests', )
| SECRET_KEY = 'dog'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}
CHANNEL_LAYERS = {
'default': {
'BACKEND': 'asgiref.inmemory.ChannelLayer',
'ROUTING': [],
},
}
MIDDLEWARE_CLASSES = []
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.... | Add contrib.auth to test settings | Add contrib.auth to test settings
| Python | mit | linuxlewis/channels-api,linuxlewis/channels-api | SECRET_KEY = 'dog'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}
CHANNEL_LAYERS = {
'default': {
'BACKEND': 'asgiref.inmemory.ChannelLayer',
'ROUTING': [],
},
}
MIDDLEWARE_CLASSES = []
INSTALLED_APPS = ('tests', )
Add contrib.auth to test settings | SECRET_KEY = 'dog'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}
CHANNEL_LAYERS = {
'default': {
'BACKEND': 'asgiref.inmemory.ChannelLayer',
'ROUTING': [],
},
}
MIDDLEWARE_CLASSES = []
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.... | <commit_before>SECRET_KEY = 'dog'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}
CHANNEL_LAYERS = {
'default': {
'BACKEND': 'asgiref.inmemory.ChannelLayer',
'ROUTING': [],
},
}
MIDDLEWARE_CLASSES = []
INSTALLED_APPS = ('tests', )
<commit_msg>Add contri... | SECRET_KEY = 'dog'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}
CHANNEL_LAYERS = {
'default': {
'BACKEND': 'asgiref.inmemory.ChannelLayer',
'ROUTING': [],
},
}
MIDDLEWARE_CLASSES = []
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.... | SECRET_KEY = 'dog'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}
CHANNEL_LAYERS = {
'default': {
'BACKEND': 'asgiref.inmemory.ChannelLayer',
'ROUTING': [],
},
}
MIDDLEWARE_CLASSES = []
INSTALLED_APPS = ('tests', )
Add contrib.auth to test settingsSECR... | <commit_before>SECRET_KEY = 'dog'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}
CHANNEL_LAYERS = {
'default': {
'BACKEND': 'asgiref.inmemory.ChannelLayer',
'ROUTING': [],
},
}
MIDDLEWARE_CLASSES = []
INSTALLED_APPS = ('tests', )
<commit_msg>Add contri... |
0471c689bbe4e5b1116c25a6ccea58588c09d4d7 | jasmin_notifications/urls.py | jasmin_notifications/urls.py | """
URL configuration for the JASMIN notifications app.
"""
__author__ = "Matt Pryor"
__copyright__ = "Copyright 2015 UK Science and Technology Facilities Council"
from django.conf.urls import url, include
from . import views
app_name = 'jasmin_notifications'
urlpatterns = [
url(r'^(?P<uuid>[a-zA-Z0-9-]+)/$', v... | """
URL configuration for the JASMIN notifications app.
"""
__author__ = "Matt Pryor"
__copyright__ = "Copyright 2015 UK Science and Technology Facilities Council"
from django.conf.urls import url, include
from . import views
app_name = 'jasmin_notifications'
urlpatterns = [
url(
r'^(?P<uuid>[0-9a-f]{8}... | Update regex to match only UUIDs | Update regex to match only UUIDs
| Python | mit | cedadev/jasmin-notifications,cedadev/jasmin-notifications | """
URL configuration for the JASMIN notifications app.
"""
__author__ = "Matt Pryor"
__copyright__ = "Copyright 2015 UK Science and Technology Facilities Council"
from django.conf.urls import url, include
from . import views
app_name = 'jasmin_notifications'
urlpatterns = [
url(r'^(?P<uuid>[a-zA-Z0-9-]+)/$', v... | """
URL configuration for the JASMIN notifications app.
"""
__author__ = "Matt Pryor"
__copyright__ = "Copyright 2015 UK Science and Technology Facilities Council"
from django.conf.urls import url, include
from . import views
app_name = 'jasmin_notifications'
urlpatterns = [
url(
r'^(?P<uuid>[0-9a-f]{8}... | <commit_before>"""
URL configuration for the JASMIN notifications app.
"""
__author__ = "Matt Pryor"
__copyright__ = "Copyright 2015 UK Science and Technology Facilities Council"
from django.conf.urls import url, include
from . import views
app_name = 'jasmin_notifications'
urlpatterns = [
url(r'^(?P<uuid>[a-zA... | """
URL configuration for the JASMIN notifications app.
"""
__author__ = "Matt Pryor"
__copyright__ = "Copyright 2015 UK Science and Technology Facilities Council"
from django.conf.urls import url, include
from . import views
app_name = 'jasmin_notifications'
urlpatterns = [
url(
r'^(?P<uuid>[0-9a-f]{8}... | """
URL configuration for the JASMIN notifications app.
"""
__author__ = "Matt Pryor"
__copyright__ = "Copyright 2015 UK Science and Technology Facilities Council"
from django.conf.urls import url, include
from . import views
app_name = 'jasmin_notifications'
urlpatterns = [
url(r'^(?P<uuid>[a-zA-Z0-9-]+)/$', v... | <commit_before>"""
URL configuration for the JASMIN notifications app.
"""
__author__ = "Matt Pryor"
__copyright__ = "Copyright 2015 UK Science and Technology Facilities Council"
from django.conf.urls import url, include
from . import views
app_name = 'jasmin_notifications'
urlpatterns = [
url(r'^(?P<uuid>[a-zA... |
2e3119b5f45a65f585e34b1239764d73b41c65fd | misp_modules/modules/expansion/__init__.py | misp_modules/modules/expansion/__init__.py | from . import _vmray
__all__ = ['vmray_submit', 'asn_history', 'circl_passivedns', 'circl_passivessl', 'countrycode', 'cve', 'dns',
'eupi', 'ipasn', 'passivetotal', 'sourcecache', 'virustotal', 'whois', 'shodan', 'reversedns', 'wiki']
| from . import _vmray
__all__ = ['vmray_submit', 'asn_history', 'circl_passivedns', 'circl_passivessl',
'countrycode', 'cve', 'dns', 'domaintools', 'eupi', 'ipasn', 'passivetotal', 'sourcecache',
'virustotal', 'whois', 'shodan', 'reversedns', 'wiki']
| Add domaintools to the import list | Add domaintools to the import list
| Python | agpl-3.0 | Rafiot/misp-modules,MISP/misp-modules,Rafiot/misp-modules,amuehlem/misp-modules,Rafiot/misp-modules,amuehlem/misp-modules,VirusTotal/misp-modules,VirusTotal/misp-modules,MISP/misp-modules,amuehlem/misp-modules,VirusTotal/misp-modules,MISP/misp-modules | from . import _vmray
__all__ = ['vmray_submit', 'asn_history', 'circl_passivedns', 'circl_passivessl', 'countrycode', 'cve', 'dns',
'eupi', 'ipasn', 'passivetotal', 'sourcecache', 'virustotal', 'whois', 'shodan', 'reversedns', 'wiki']
Add domaintools to the import list | from . import _vmray
__all__ = ['vmray_submit', 'asn_history', 'circl_passivedns', 'circl_passivessl',
'countrycode', 'cve', 'dns', 'domaintools', 'eupi', 'ipasn', 'passivetotal', 'sourcecache',
'virustotal', 'whois', 'shodan', 'reversedns', 'wiki']
| <commit_before>from . import _vmray
__all__ = ['vmray_submit', 'asn_history', 'circl_passivedns', 'circl_passivessl', 'countrycode', 'cve', 'dns',
'eupi', 'ipasn', 'passivetotal', 'sourcecache', 'virustotal', 'whois', 'shodan', 'reversedns', 'wiki']
<commit_msg>Add domaintools to the import list<commit_afte... | from . import _vmray
__all__ = ['vmray_submit', 'asn_history', 'circl_passivedns', 'circl_passivessl',
'countrycode', 'cve', 'dns', 'domaintools', 'eupi', 'ipasn', 'passivetotal', 'sourcecache',
'virustotal', 'whois', 'shodan', 'reversedns', 'wiki']
| from . import _vmray
__all__ = ['vmray_submit', 'asn_history', 'circl_passivedns', 'circl_passivessl', 'countrycode', 'cve', 'dns',
'eupi', 'ipasn', 'passivetotal', 'sourcecache', 'virustotal', 'whois', 'shodan', 'reversedns', 'wiki']
Add domaintools to the import listfrom . import _vmray
__all__ = ['vmray... | <commit_before>from . import _vmray
__all__ = ['vmray_submit', 'asn_history', 'circl_passivedns', 'circl_passivessl', 'countrycode', 'cve', 'dns',
'eupi', 'ipasn', 'passivetotal', 'sourcecache', 'virustotal', 'whois', 'shodan', 'reversedns', 'wiki']
<commit_msg>Add domaintools to the import list<commit_afte... |
a4a8e3a8ed6753c5d4a51c90c5f68f76e7372f2a | selvbetjening/sadmin2/tests/ui/common.py | selvbetjening/sadmin2/tests/ui/common.py |
from splinter import Browser
import urlparse
from django.core.urlresolvers import reverse
from django.test import LiveServerTestCase
class UITestCase(LiveServerTestCase):
@classmethod
def setUpClass(cls):
cls.wd = Browser()
super(UITestCase, cls).setUpClass()
@classmethod
def tearD... | from selenium.common.exceptions import WebDriverException
from splinter import Browser
import urlparse
from django.core.urlresolvers import reverse
from django.test import LiveServerTestCase
class UITestCase(LiveServerTestCase):
@classmethod
def setUpClass(cls):
try:
cls.wd = Browser('ph... | Switch to headless UI testing by default | Switch to headless UI testing by default
| Python | mit | animekita/selvbetjening,animekita/selvbetjening,animekita/selvbetjening,animekita/selvbetjening |
from splinter import Browser
import urlparse
from django.core.urlresolvers import reverse
from django.test import LiveServerTestCase
class UITestCase(LiveServerTestCase):
@classmethod
def setUpClass(cls):
cls.wd = Browser()
super(UITestCase, cls).setUpClass()
@classmethod
def tearD... | from selenium.common.exceptions import WebDriverException
from splinter import Browser
import urlparse
from django.core.urlresolvers import reverse
from django.test import LiveServerTestCase
class UITestCase(LiveServerTestCase):
@classmethod
def setUpClass(cls):
try:
cls.wd = Browser('ph... | <commit_before>
from splinter import Browser
import urlparse
from django.core.urlresolvers import reverse
from django.test import LiveServerTestCase
class UITestCase(LiveServerTestCase):
@classmethod
def setUpClass(cls):
cls.wd = Browser()
super(UITestCase, cls).setUpClass()
@classmetho... | from selenium.common.exceptions import WebDriverException
from splinter import Browser
import urlparse
from django.core.urlresolvers import reverse
from django.test import LiveServerTestCase
class UITestCase(LiveServerTestCase):
@classmethod
def setUpClass(cls):
try:
cls.wd = Browser('ph... |
from splinter import Browser
import urlparse
from django.core.urlresolvers import reverse
from django.test import LiveServerTestCase
class UITestCase(LiveServerTestCase):
@classmethod
def setUpClass(cls):
cls.wd = Browser()
super(UITestCase, cls).setUpClass()
@classmethod
def tearD... | <commit_before>
from splinter import Browser
import urlparse
from django.core.urlresolvers import reverse
from django.test import LiveServerTestCase
class UITestCase(LiveServerTestCase):
@classmethod
def setUpClass(cls):
cls.wd = Browser()
super(UITestCase, cls).setUpClass()
@classmetho... |
9c348c88771acb49f820cbb2fa16ce318068b777 | groundstation/peer_socket.py | groundstation/peer_socket.py | from sockets.socket_closed_exception import SocketClosedException
from sockets.stream_socket import StreamSocket
import socket.error
from groundstation import settings
import groundstation.logger
log = groundstation.logger.getLogger(__name__)
class PeerSocket(StreamSocket):
"""Wrapper for a peer who just connect... | from sockets.socket_closed_exception import SocketClosedException
from sockets.stream_socket import StreamSocket
import socket
from groundstation import settings
import groundstation.logger
log = groundstation.logger.getLogger(__name__)
class PeerSocket(StreamSocket):
"""Wrapper for a peer who just connected, or ... | Fix broken import of socket errors | Fix broken import of socket errors
| Python | mit | richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation | from sockets.socket_closed_exception import SocketClosedException
from sockets.stream_socket import StreamSocket
import socket.error
from groundstation import settings
import groundstation.logger
log = groundstation.logger.getLogger(__name__)
class PeerSocket(StreamSocket):
"""Wrapper for a peer who just connect... | from sockets.socket_closed_exception import SocketClosedException
from sockets.stream_socket import StreamSocket
import socket
from groundstation import settings
import groundstation.logger
log = groundstation.logger.getLogger(__name__)
class PeerSocket(StreamSocket):
"""Wrapper for a peer who just connected, or ... | <commit_before>from sockets.socket_closed_exception import SocketClosedException
from sockets.stream_socket import StreamSocket
import socket.error
from groundstation import settings
import groundstation.logger
log = groundstation.logger.getLogger(__name__)
class PeerSocket(StreamSocket):
"""Wrapper for a peer w... | from sockets.socket_closed_exception import SocketClosedException
from sockets.stream_socket import StreamSocket
import socket
from groundstation import settings
import groundstation.logger
log = groundstation.logger.getLogger(__name__)
class PeerSocket(StreamSocket):
"""Wrapper for a peer who just connected, or ... | from sockets.socket_closed_exception import SocketClosedException
from sockets.stream_socket import StreamSocket
import socket.error
from groundstation import settings
import groundstation.logger
log = groundstation.logger.getLogger(__name__)
class PeerSocket(StreamSocket):
"""Wrapper for a peer who just connect... | <commit_before>from sockets.socket_closed_exception import SocketClosedException
from sockets.stream_socket import StreamSocket
import socket.error
from groundstation import settings
import groundstation.logger
log = groundstation.logger.getLogger(__name__)
class PeerSocket(StreamSocket):
"""Wrapper for a peer w... |
f2426c54a07f4492bfc23936fe4b1970315c6890 | MessageClient.py | MessageClient.py |
import time
from twilio.rest import TwilioRestClient
import smtplib
from email.mime.text import MIMEText
from Environ import config
class MessageClient(object):
def __init__(self):
self.twilioClient = TwilioRestClient(config["twilioAccount"], config["twilioToken"])
pass
def alertSMS(self, s... |
import time
from twilio.rest import TwilioRestClient
import smtplib
from email.mime.text import MIMEText
from Environ import config
class MessageClient(object):
def __init__(self):
self.twilioClient = TwilioRestClient(config["twilioAccount"], config["twilioToken"])
pass
def alertSMS(self, s... | Comment email and activated SMS | Comment email and activated SMS
| Python | apache-2.0 | johnfelixc/CriticalMonitor,johnfelixc/CriticalMonitor,johnfelixc/CriticalMonitor |
import time
from twilio.rest import TwilioRestClient
import smtplib
from email.mime.text import MIMEText
from Environ import config
class MessageClient(object):
def __init__(self):
self.twilioClient = TwilioRestClient(config["twilioAccount"], config["twilioToken"])
pass
def alertSMS(self, s... |
import time
from twilio.rest import TwilioRestClient
import smtplib
from email.mime.text import MIMEText
from Environ import config
class MessageClient(object):
def __init__(self):
self.twilioClient = TwilioRestClient(config["twilioAccount"], config["twilioToken"])
pass
def alertSMS(self, s... | <commit_before>
import time
from twilio.rest import TwilioRestClient
import smtplib
from email.mime.text import MIMEText
from Environ import config
class MessageClient(object):
def __init__(self):
self.twilioClient = TwilioRestClient(config["twilioAccount"], config["twilioToken"])
pass
def a... |
import time
from twilio.rest import TwilioRestClient
import smtplib
from email.mime.text import MIMEText
from Environ import config
class MessageClient(object):
def __init__(self):
self.twilioClient = TwilioRestClient(config["twilioAccount"], config["twilioToken"])
pass
def alertSMS(self, s... |
import time
from twilio.rest import TwilioRestClient
import smtplib
from email.mime.text import MIMEText
from Environ import config
class MessageClient(object):
def __init__(self):
self.twilioClient = TwilioRestClient(config["twilioAccount"], config["twilioToken"])
pass
def alertSMS(self, s... | <commit_before>
import time
from twilio.rest import TwilioRestClient
import smtplib
from email.mime.text import MIMEText
from Environ import config
class MessageClient(object):
def __init__(self):
self.twilioClient = TwilioRestClient(config["twilioAccount"], config["twilioToken"])
pass
def a... |
de66fe28d2bd3e118a468257601d2bdfcc4341ed | niche_vlaanderen/__init__.py | niche_vlaanderen/__init__.py | from .acidity import Acidity # noqa
from .niche import Niche, NicheDelta # noqa
from .nutrient_level import NutrientLevel # noqa
from .vegetation import Vegetation # noqa
from .version import __version__ # noqa
| from .acidity import Acidity # noqa
from .niche import Niche, NicheDelta # noqa
from .nutrient_level import NutrientLevel # noqa
from .vegetation import Vegetation # noqa
from .version import __version__ # noqa
from .floodplain import FloodPlain | Add FloodPlain class to module namespace | Add FloodPlain class to module namespace
| Python | mit | johanvdw/niche_vlaanderen | from .acidity import Acidity # noqa
from .niche import Niche, NicheDelta # noqa
from .nutrient_level import NutrientLevel # noqa
from .vegetation import Vegetation # noqa
from .version import __version__ # noqa
Add FloodPlain class to module namespace | from .acidity import Acidity # noqa
from .niche import Niche, NicheDelta # noqa
from .nutrient_level import NutrientLevel # noqa
from .vegetation import Vegetation # noqa
from .version import __version__ # noqa
from .floodplain import FloodPlain | <commit_before>from .acidity import Acidity # noqa
from .niche import Niche, NicheDelta # noqa
from .nutrient_level import NutrientLevel # noqa
from .vegetation import Vegetation # noqa
from .version import __version__ # noqa
<commit_msg>Add FloodPlain class to module namespace<commit_after> | from .acidity import Acidity # noqa
from .niche import Niche, NicheDelta # noqa
from .nutrient_level import NutrientLevel # noqa
from .vegetation import Vegetation # noqa
from .version import __version__ # noqa
from .floodplain import FloodPlain | from .acidity import Acidity # noqa
from .niche import Niche, NicheDelta # noqa
from .nutrient_level import NutrientLevel # noqa
from .vegetation import Vegetation # noqa
from .version import __version__ # noqa
Add FloodPlain class to module namespacefrom .acidity import Acidity # noqa
from .niche import Niche, NicheDe... | <commit_before>from .acidity import Acidity # noqa
from .niche import Niche, NicheDelta # noqa
from .nutrient_level import NutrientLevel # noqa
from .vegetation import Vegetation # noqa
from .version import __version__ # noqa
<commit_msg>Add FloodPlain class to module namespace<commit_after>from .acidity import Acidity... |
b1c67321e5eec29b9fd91d728bd8e63382dc063a | src/keybar/conf/test.py | src/keybar/conf/test.py | from keybar.conf.base import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'keybar_test',
}
}
certificates_dir = os.path.join(BASE_DIR, 'tests', 'resources', 'certificates')
KEYBAR_SERVER_CERTIFICATE = os.path.join(certificates_dir, 'KEYBAR-intermed... | from keybar.conf.base import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'keybar_test',
}
}
certificates_dir = os.path.join(BASE_DIR, 'tests', 'resources', 'certificates')
KEYBAR_SERVER_CERTIFICATE = os.path.join(certificates_dir, 'KEYBAR-intermed... | Remove duplicate keybar host value | Remove duplicate keybar host value
| Python | bsd-3-clause | keybar/keybar | from keybar.conf.base import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'keybar_test',
}
}
certificates_dir = os.path.join(BASE_DIR, 'tests', 'resources', 'certificates')
KEYBAR_SERVER_CERTIFICATE = os.path.join(certificates_dir, 'KEYBAR-intermed... | from keybar.conf.base import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'keybar_test',
}
}
certificates_dir = os.path.join(BASE_DIR, 'tests', 'resources', 'certificates')
KEYBAR_SERVER_CERTIFICATE = os.path.join(certificates_dir, 'KEYBAR-intermed... | <commit_before>from keybar.conf.base import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'keybar_test',
}
}
certificates_dir = os.path.join(BASE_DIR, 'tests', 'resources', 'certificates')
KEYBAR_SERVER_CERTIFICATE = os.path.join(certificates_dir, '... | from keybar.conf.base import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'keybar_test',
}
}
certificates_dir = os.path.join(BASE_DIR, 'tests', 'resources', 'certificates')
KEYBAR_SERVER_CERTIFICATE = os.path.join(certificates_dir, 'KEYBAR-intermed... | from keybar.conf.base import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'keybar_test',
}
}
certificates_dir = os.path.join(BASE_DIR, 'tests', 'resources', 'certificates')
KEYBAR_SERVER_CERTIFICATE = os.path.join(certificates_dir, 'KEYBAR-intermed... | <commit_before>from keybar.conf.base import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'keybar_test',
}
}
certificates_dir = os.path.join(BASE_DIR, 'tests', 'resources', 'certificates')
KEYBAR_SERVER_CERTIFICATE = os.path.join(certificates_dir, '... |
7f0ab3d1db2257a630df44ad92b4f094f6a61894 | application.py | application.py | import os
import sentry_sdk
from flask import Flask
from sentry_sdk.integrations.flask import FlaskIntegration
from sentry_sdk.integrations.redis import RedisIntegration
from sentry_sdk.integrations import logging
from app import create_app
sentry_sdk.init(
dsn=os.environ['SENTRY_DSN'],
integrations=[FlaskIn... | import os
import sentry_sdk
from flask import Flask
from sentry_sdk.integrations.flask import FlaskIntegration
from sentry_sdk.integrations.redis import RedisIntegration
from sentry_sdk.integrations import logging
from app import create_app
if 'SENTRY_DSN' in os.environ:
sentry_sdk.init(
dsn=os.environ['... | Tweak Sentry config to work in development | Tweak Sentry config to work in development
This makes a couple of changes:
- Most importantly, it wraps the setup code in a conditional so that
developers don't need to have a DSN set to start the app locally.
- Secondly, it removes the redundant call to "set_level". Originally
I thought the integration was sending ... | Python | mit | alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin | import os
import sentry_sdk
from flask import Flask
from sentry_sdk.integrations.flask import FlaskIntegration
from sentry_sdk.integrations.redis import RedisIntegration
from sentry_sdk.integrations import logging
from app import create_app
sentry_sdk.init(
dsn=os.environ['SENTRY_DSN'],
integrations=[FlaskIn... | import os
import sentry_sdk
from flask import Flask
from sentry_sdk.integrations.flask import FlaskIntegration
from sentry_sdk.integrations.redis import RedisIntegration
from sentry_sdk.integrations import logging
from app import create_app
if 'SENTRY_DSN' in os.environ:
sentry_sdk.init(
dsn=os.environ['... | <commit_before>import os
import sentry_sdk
from flask import Flask
from sentry_sdk.integrations.flask import FlaskIntegration
from sentry_sdk.integrations.redis import RedisIntegration
from sentry_sdk.integrations import logging
from app import create_app
sentry_sdk.init(
dsn=os.environ['SENTRY_DSN'],
integr... | import os
import sentry_sdk
from flask import Flask
from sentry_sdk.integrations.flask import FlaskIntegration
from sentry_sdk.integrations.redis import RedisIntegration
from sentry_sdk.integrations import logging
from app import create_app
if 'SENTRY_DSN' in os.environ:
sentry_sdk.init(
dsn=os.environ['... | import os
import sentry_sdk
from flask import Flask
from sentry_sdk.integrations.flask import FlaskIntegration
from sentry_sdk.integrations.redis import RedisIntegration
from sentry_sdk.integrations import logging
from app import create_app
sentry_sdk.init(
dsn=os.environ['SENTRY_DSN'],
integrations=[FlaskIn... | <commit_before>import os
import sentry_sdk
from flask import Flask
from sentry_sdk.integrations.flask import FlaskIntegration
from sentry_sdk.integrations.redis import RedisIntegration
from sentry_sdk.integrations import logging
from app import create_app
sentry_sdk.init(
dsn=os.environ['SENTRY_DSN'],
integr... |
d945090bda715d1d3b8c610f4017542eed06e73e | src/runtime/pcode_io.py | src/runtime/pcode_io.py | # pcode_io.py 19/01/2016 D.J.Whale
# simplest possible implementation. Only really works well
# for small files.
def readline(filename, lineno):
f = open(filename)
lines = f.readlines()
f.close()
return lines[lineno-1] # runtime error if does not exist
def writeline(filename, lineno, data):
# r... | # pcode_io.py 19/01/2016 D.J.Whale
# simplest possible implementation. Only really works well
# for small files. Poor efficiency on large files.
def readline(filename, lineno):
f = open(filename)
lines = f.readlines()
f.close()
return lines[lineno-1] # runtime error if does not exist
def writeline(... | Test cases specified for io | Test cases specified for io
| Python | mit | whaleygeek/pc_parser,whaleygeek/pc_parser | # pcode_io.py 19/01/2016 D.J.Whale
# simplest possible implementation. Only really works well
# for small files.
def readline(filename, lineno):
f = open(filename)
lines = f.readlines()
f.close()
return lines[lineno-1] # runtime error if does not exist
def writeline(filename, lineno, data):
# r... | # pcode_io.py 19/01/2016 D.J.Whale
# simplest possible implementation. Only really works well
# for small files. Poor efficiency on large files.
def readline(filename, lineno):
f = open(filename)
lines = f.readlines()
f.close()
return lines[lineno-1] # runtime error if does not exist
def writeline(... | <commit_before># pcode_io.py 19/01/2016 D.J.Whale
# simplest possible implementation. Only really works well
# for small files.
def readline(filename, lineno):
f = open(filename)
lines = f.readlines()
f.close()
return lines[lineno-1] # runtime error if does not exist
def writeline(filename, lineno,... | # pcode_io.py 19/01/2016 D.J.Whale
# simplest possible implementation. Only really works well
# for small files. Poor efficiency on large files.
def readline(filename, lineno):
f = open(filename)
lines = f.readlines()
f.close()
return lines[lineno-1] # runtime error if does not exist
def writeline(... | # pcode_io.py 19/01/2016 D.J.Whale
# simplest possible implementation. Only really works well
# for small files.
def readline(filename, lineno):
f = open(filename)
lines = f.readlines()
f.close()
return lines[lineno-1] # runtime error if does not exist
def writeline(filename, lineno, data):
# r... | <commit_before># pcode_io.py 19/01/2016 D.J.Whale
# simplest possible implementation. Only really works well
# for small files.
def readline(filename, lineno):
f = open(filename)
lines = f.readlines()
f.close()
return lines[lineno-1] # runtime error if does not exist
def writeline(filename, lineno,... |
539f4baccb968d9d222f2f62573da34d85699f91 | comment_parser/parsers/common.py | comment_parser/parsers/common.py | #!/usr/bin/python
"""This module provides constructs common to all comment parsers."""
class Error(Exception):
"""Base Error class for all comment parsers."""
pass
class FileError(Error):
"""Raised if there is an issue reading a given file."""
pass
class UnterminatedCommentError(Error):
"""Rai... | #!/usr/bin/python
"""This module provides constructs common to all comment parsers."""
class Error(Exception):
"""Base Error class for all comment parsers."""
pass
class FileError(Error):
"""Raised if there is an issue reading a given file."""
pass
class UnterminatedCommentError(Error):
"""Rai... | Add __repr__ to Comment class. | comment_parser: Add __repr__ to Comment class.
| Python | mit | jeanralphaviles/comment_parser | #!/usr/bin/python
"""This module provides constructs common to all comment parsers."""
class Error(Exception):
"""Base Error class for all comment parsers."""
pass
class FileError(Error):
"""Raised if there is an issue reading a given file."""
pass
class UnterminatedCommentError(Error):
"""Rai... | #!/usr/bin/python
"""This module provides constructs common to all comment parsers."""
class Error(Exception):
"""Base Error class for all comment parsers."""
pass
class FileError(Error):
"""Raised if there is an issue reading a given file."""
pass
class UnterminatedCommentError(Error):
"""Rai... | <commit_before>#!/usr/bin/python
"""This module provides constructs common to all comment parsers."""
class Error(Exception):
"""Base Error class for all comment parsers."""
pass
class FileError(Error):
"""Raised if there is an issue reading a given file."""
pass
class UnterminatedCommentError(Err... | #!/usr/bin/python
"""This module provides constructs common to all comment parsers."""
class Error(Exception):
"""Base Error class for all comment parsers."""
pass
class FileError(Error):
"""Raised if there is an issue reading a given file."""
pass
class UnterminatedCommentError(Error):
"""Rai... | #!/usr/bin/python
"""This module provides constructs common to all comment parsers."""
class Error(Exception):
"""Base Error class for all comment parsers."""
pass
class FileError(Error):
"""Raised if there is an issue reading a given file."""
pass
class UnterminatedCommentError(Error):
"""Rai... | <commit_before>#!/usr/bin/python
"""This module provides constructs common to all comment parsers."""
class Error(Exception):
"""Base Error class for all comment parsers."""
pass
class FileError(Error):
"""Raised if there is an issue reading a given file."""
pass
class UnterminatedCommentError(Err... |
1290bc59774aac7756658c3480d6a5293c7a3467 | planner/models.py | planner/models.py | from django.db import models
# Route model
# Start and end locations with additional stop-overs
class Route(models.Model):
origin = models.CharField(max_length=63)
destination = models.CharField(max_length=63)
def __unicode__(self):
return "{} to {}".format(
self.origin,
s... | from django.db import models
# Route model
# Start and end locations with additional stop-overs
class Route(models.Model):
start = models.CharField(max_length=63)
end = models.CharField(max_length=63)
def __unicode__(self):
return "{} to {}".format(
self.start,
self.end
... | Rename Route model's start and end fields to be consistent with front end identification | Rename Route model's start and end fields to be consistent with front end identification
| Python | apache-2.0 | jwarren116/RoadTrip,jwarren116/RoadTrip,jwarren116/RoadTrip | from django.db import models
# Route model
# Start and end locations with additional stop-overs
class Route(models.Model):
origin = models.CharField(max_length=63)
destination = models.CharField(max_length=63)
def __unicode__(self):
return "{} to {}".format(
self.origin,
s... | from django.db import models
# Route model
# Start and end locations with additional stop-overs
class Route(models.Model):
start = models.CharField(max_length=63)
end = models.CharField(max_length=63)
def __unicode__(self):
return "{} to {}".format(
self.start,
self.end
... | <commit_before>from django.db import models
# Route model
# Start and end locations with additional stop-overs
class Route(models.Model):
origin = models.CharField(max_length=63)
destination = models.CharField(max_length=63)
def __unicode__(self):
return "{} to {}".format(
self.origin... | from django.db import models
# Route model
# Start and end locations with additional stop-overs
class Route(models.Model):
start = models.CharField(max_length=63)
end = models.CharField(max_length=63)
def __unicode__(self):
return "{} to {}".format(
self.start,
self.end
... | from django.db import models
# Route model
# Start and end locations with additional stop-overs
class Route(models.Model):
origin = models.CharField(max_length=63)
destination = models.CharField(max_length=63)
def __unicode__(self):
return "{} to {}".format(
self.origin,
s... | <commit_before>from django.db import models
# Route model
# Start and end locations with additional stop-overs
class Route(models.Model):
origin = models.CharField(max_length=63)
destination = models.CharField(max_length=63)
def __unicode__(self):
return "{} to {}".format(
self.origin... |
42402aa72fdaf3bd5430505a1ceb86631aea97b8 | scripts/slave/chromium/dart_buildbot_run.py | scripts/slave/chromium/dart_buildbot_run.py | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Entry point for the dartium buildbots.
This script is called from buildbot and reports results using the buildbot
annotation sc... | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Entry point for the dartium buildbots.
This script is called from buildbot and reports results using the buildbot
annotation sc... | Move hackish clobbering to the script that calls the dartium annotated steps | Move hackish clobbering to the script that calls the dartium annotated steps
Also clean it up, we don't have any builders that starts with release
I will remove this functionality from the dartium annotated step since it does not work correctly. This change allow us to use the normal chromium_utils function which we ... | Python | bsd-3-clause | eunchong/build,eunchong/build,eunchong/build,eunchong/build | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Entry point for the dartium buildbots.
This script is called from buildbot and reports results using the buildbot
annotation sc... | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Entry point for the dartium buildbots.
This script is called from buildbot and reports results using the buildbot
annotation sc... | <commit_before>#!/usr/bin/env python
# Copyright (c) 2012 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.
"""Entry point for the dartium buildbots.
This script is called from buildbot and reports results using the buildbo... | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Entry point for the dartium buildbots.
This script is called from buildbot and reports results using the buildbot
annotation sc... | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Entry point for the dartium buildbots.
This script is called from buildbot and reports results using the buildbot
annotation sc... | <commit_before>#!/usr/bin/env python
# Copyright (c) 2012 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.
"""Entry point for the dartium buildbots.
This script is called from buildbot and reports results using the buildbo... |
9d4647dca6f5e356f807d6885019d41a4b6d4847 | skimage/measure/__init__.py | skimage/measure/__init__.py | from .find_contours import find_contours
from ._regionprops import regionprops, perimeter
from ._structural_similarity import structural_similarity
from ._polygon import approximate_polygon, subdivide_polygon | from .find_contours import find_contours
from ._regionprops import regionprops, perimeter
from ._structural_similarity import structural_similarity
from ._polygon import approximate_polygon, subdivide_polygon
__all__ = ['find_contours',
'regionprops',
'perimeter',
'structural_similarit... | Add __all__ to measure package | Add __all__ to measure package
| Python | bsd-3-clause | robintw/scikit-image,ClinicalGraphics/scikit-image,vighneshbirodkar/scikit-image,newville/scikit-image,bennlich/scikit-image,paalge/scikit-image,chriscrosscutler/scikit-image,michaelaye/scikit-image,rjeli/scikit-image,rjeli/scikit-image,keflavich/scikit-image,pratapvardhan/scikit-image,oew1v07/scikit-image,bennlich/sci... | from .find_contours import find_contours
from ._regionprops import regionprops, perimeter
from ._structural_similarity import structural_similarity
from ._polygon import approximate_polygon, subdivide_polygonAdd __all__ to measure package | from .find_contours import find_contours
from ._regionprops import regionprops, perimeter
from ._structural_similarity import structural_similarity
from ._polygon import approximate_polygon, subdivide_polygon
__all__ = ['find_contours',
'regionprops',
'perimeter',
'structural_similarit... | <commit_before>from .find_contours import find_contours
from ._regionprops import regionprops, perimeter
from ._structural_similarity import structural_similarity
from ._polygon import approximate_polygon, subdivide_polygon<commit_msg>Add __all__ to measure package<commit_after> | from .find_contours import find_contours
from ._regionprops import regionprops, perimeter
from ._structural_similarity import structural_similarity
from ._polygon import approximate_polygon, subdivide_polygon
__all__ = ['find_contours',
'regionprops',
'perimeter',
'structural_similarit... | from .find_contours import find_contours
from ._regionprops import regionprops, perimeter
from ._structural_similarity import structural_similarity
from ._polygon import approximate_polygon, subdivide_polygonAdd __all__ to measure packagefrom .find_contours import find_contours
from ._regionprops import regionprops, pe... | <commit_before>from .find_contours import find_contours
from ._regionprops import regionprops, perimeter
from ._structural_similarity import structural_similarity
from ._polygon import approximate_polygon, subdivide_polygon<commit_msg>Add __all__ to measure package<commit_after>from .find_contours import find_contours
... |
42d0edb5fcd71634dccf030cf3daa54e606de0f8 | pombola/south_africa/urls.py | pombola/south_africa/urls.py | from django.conf.urls import patterns, include, url
from pombola.south_africa.views import LatLonDetailView, SAPlaceDetailSub, SAOrganisationDetailView
from pombola.core.urls import organisation_patterns
# Override the organisation url so we can vary it depending on the organisation type.
for index, pattern in enumer... | from django.conf.urls import patterns, include, url
from pombola.south_africa.views import LatLonDetailView, SAPlaceDetailSub, SAOrganisationDetailView
from pombola.core.urls import organisation_patterns
# Override the organisation url so we can vary it depending on the organisation type.
for index, pattern in enumer... | Handle a '+' in organisation slugs | Handle a '+' in organisation slugs
| Python | agpl-3.0 | hzj123/56th,patricmutwiri/pombola,ken-muturi/pombola,ken-muturi/pombola,ken-muturi/pombola,patricmutwiri/pombola,hzj123/56th,patricmutwiri/pombola,geoffkilpin/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola,patricmutwiri/pombola,geoffkilpin/pombola,geoffkilpin/pombola,hzj123/56th,mysociety/pombola,patricm... | from django.conf.urls import patterns, include, url
from pombola.south_africa.views import LatLonDetailView, SAPlaceDetailSub, SAOrganisationDetailView
from pombola.core.urls import organisation_patterns
# Override the organisation url so we can vary it depending on the organisation type.
for index, pattern in enumer... | from django.conf.urls import patterns, include, url
from pombola.south_africa.views import LatLonDetailView, SAPlaceDetailSub, SAOrganisationDetailView
from pombola.core.urls import organisation_patterns
# Override the organisation url so we can vary it depending on the organisation type.
for index, pattern in enumer... | <commit_before>from django.conf.urls import patterns, include, url
from pombola.south_africa.views import LatLonDetailView, SAPlaceDetailSub, SAOrganisationDetailView
from pombola.core.urls import organisation_patterns
# Override the organisation url so we can vary it depending on the organisation type.
for index, pa... | from django.conf.urls import patterns, include, url
from pombola.south_africa.views import LatLonDetailView, SAPlaceDetailSub, SAOrganisationDetailView
from pombola.core.urls import organisation_patterns
# Override the organisation url so we can vary it depending on the organisation type.
for index, pattern in enumer... | from django.conf.urls import patterns, include, url
from pombola.south_africa.views import LatLonDetailView, SAPlaceDetailSub, SAOrganisationDetailView
from pombola.core.urls import organisation_patterns
# Override the organisation url so we can vary it depending on the organisation type.
for index, pattern in enumer... | <commit_before>from django.conf.urls import patterns, include, url
from pombola.south_africa.views import LatLonDetailView, SAPlaceDetailSub, SAOrganisationDetailView
from pombola.core.urls import organisation_patterns
# Override the organisation url so we can vary it depending on the organisation type.
for index, pa... |
26bb10e96072fd901cb13b326f525bdcd7045337 | byceps/blueprints/news_admin/forms.py | byceps/blueprints/news_admin/forms.py | """
byceps.blueprints.news_admin.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import re
from wtforms import StringField, TextAreaField
from wtforms.validators import InputRequired, Length, Optional, Regexp
from ...util.l10n ... | """
byceps.blueprints.news_admin.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import re
from wtforms import StringField, TextAreaField
from wtforms.validators import InputRequired, Length, Optional, Regexp
from ...util.l10n ... | Increase form length limits for news item's slug, title, and image URL path | Increase form length limits for news item's slug, title, and image URL path
| Python | bsd-3-clause | homeworkprod/byceps,homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps,m-ober/byceps,m-ober/byceps | """
byceps.blueprints.news_admin.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import re
from wtforms import StringField, TextAreaField
from wtforms.validators import InputRequired, Length, Optional, Regexp
from ...util.l10n ... | """
byceps.blueprints.news_admin.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import re
from wtforms import StringField, TextAreaField
from wtforms.validators import InputRequired, Length, Optional, Regexp
from ...util.l10n ... | <commit_before>"""
byceps.blueprints.news_admin.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import re
from wtforms import StringField, TextAreaField
from wtforms.validators import InputRequired, Length, Optional, Regexp
fro... | """
byceps.blueprints.news_admin.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import re
from wtforms import StringField, TextAreaField
from wtforms.validators import InputRequired, Length, Optional, Regexp
from ...util.l10n ... | """
byceps.blueprints.news_admin.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import re
from wtforms import StringField, TextAreaField
from wtforms.validators import InputRequired, Length, Optional, Regexp
from ...util.l10n ... | <commit_before>"""
byceps.blueprints.news_admin.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import re
from wtforms import StringField, TextAreaField
from wtforms.validators import InputRequired, Length, Optional, Regexp
fro... |
2dfd70a064162fe9a1392e5870dd45dac001bca4 | varify/conf/settings.py | varify/conf/settings.py | import os
from global_settings import *
try:
from local_settings import *
except ImportError:
import warnings
warnings.warn('Local settings have not been found (src.conf.local_settings)')
# FORCE_SCRIPT_NAME overrides the interpreted 'SCRIPT_NAME' provided by the
# web server. since the URLs below are use... | import os
from global_settings import *
try:
from local_settings import *
except ImportError:
import warnings
warnings.warn('Local settings have not been found (varify.conf.local_settings)')
# FORCE_SCRIPT_NAME overrides the interpreted 'SCRIPT_NAME' provided by the
# web server. since the URLs below are ... | Fix warning message to use 'varify' package instead of 'src' | Fix warning message to use 'varify' package instead of 'src'
| Python | bsd-2-clause | chop-dbhi/varify,chop-dbhi/varify,chop-dbhi/varify,chop-dbhi/varify | import os
from global_settings import *
try:
from local_settings import *
except ImportError:
import warnings
warnings.warn('Local settings have not been found (src.conf.local_settings)')
# FORCE_SCRIPT_NAME overrides the interpreted 'SCRIPT_NAME' provided by the
# web server. since the URLs below are use... | import os
from global_settings import *
try:
from local_settings import *
except ImportError:
import warnings
warnings.warn('Local settings have not been found (varify.conf.local_settings)')
# FORCE_SCRIPT_NAME overrides the interpreted 'SCRIPT_NAME' provided by the
# web server. since the URLs below are ... | <commit_before>import os
from global_settings import *
try:
from local_settings import *
except ImportError:
import warnings
warnings.warn('Local settings have not been found (src.conf.local_settings)')
# FORCE_SCRIPT_NAME overrides the interpreted 'SCRIPT_NAME' provided by the
# web server. since the URL... | import os
from global_settings import *
try:
from local_settings import *
except ImportError:
import warnings
warnings.warn('Local settings have not been found (varify.conf.local_settings)')
# FORCE_SCRIPT_NAME overrides the interpreted 'SCRIPT_NAME' provided by the
# web server. since the URLs below are ... | import os
from global_settings import *
try:
from local_settings import *
except ImportError:
import warnings
warnings.warn('Local settings have not been found (src.conf.local_settings)')
# FORCE_SCRIPT_NAME overrides the interpreted 'SCRIPT_NAME' provided by the
# web server. since the URLs below are use... | <commit_before>import os
from global_settings import *
try:
from local_settings import *
except ImportError:
import warnings
warnings.warn('Local settings have not been found (src.conf.local_settings)')
# FORCE_SCRIPT_NAME overrides the interpreted 'SCRIPT_NAME' provided by the
# web server. since the URL... |
1aa75af659daac62fdef423beac16aef1f057afb | test/testCore.py | test/testCore.py | import pyfits
import sys
def test_with_statement():
if sys.hexversion >= 0x02050000:
exec("""from __future__ import with_statement
with pyfits.open("ascii.fits") as f: pass""")
def test_naxisj_check():
hdulist = pyfits.open("o4sp040b0_raw.fits")
hdulist[1].header.update("NAXIS3", 500)
assert... | import pyfits
import numpy as np
import sys
def test_with_statement():
if sys.hexversion >= 0x02050000:
exec("""from __future__ import with_statement
with pyfits.open("ascii.fits") as f: pass""")
def test_naxisj_check():
hdulist = pyfits.open("o4sp040b0_raw.fits")
hdulist[1].header.update("NAXIS3... | Add test for byteswapping bug resolved in r514. | Add test for byteswapping bug resolved in r514.
git-svn-id: 5305e2c1a78737cf7dd5f8f44e9bbbd00348fde7@543 ed100bfc-0583-0410-97f2-c26b58777a21
| Python | bsd-3-clause | embray/PyFITS,spacetelescope/PyFITS,embray/PyFITS,embray/PyFITS,spacetelescope/PyFITS,embray/PyFITS | import pyfits
import sys
def test_with_statement():
if sys.hexversion >= 0x02050000:
exec("""from __future__ import with_statement
with pyfits.open("ascii.fits") as f: pass""")
def test_naxisj_check():
hdulist = pyfits.open("o4sp040b0_raw.fits")
hdulist[1].header.update("NAXIS3", 500)
assert... | import pyfits
import numpy as np
import sys
def test_with_statement():
if sys.hexversion >= 0x02050000:
exec("""from __future__ import with_statement
with pyfits.open("ascii.fits") as f: pass""")
def test_naxisj_check():
hdulist = pyfits.open("o4sp040b0_raw.fits")
hdulist[1].header.update("NAXIS3... | <commit_before>import pyfits
import sys
def test_with_statement():
if sys.hexversion >= 0x02050000:
exec("""from __future__ import with_statement
with pyfits.open("ascii.fits") as f: pass""")
def test_naxisj_check():
hdulist = pyfits.open("o4sp040b0_raw.fits")
hdulist[1].header.update("NAXIS3", 5... | import pyfits
import numpy as np
import sys
def test_with_statement():
if sys.hexversion >= 0x02050000:
exec("""from __future__ import with_statement
with pyfits.open("ascii.fits") as f: pass""")
def test_naxisj_check():
hdulist = pyfits.open("o4sp040b0_raw.fits")
hdulist[1].header.update("NAXIS3... | import pyfits
import sys
def test_with_statement():
if sys.hexversion >= 0x02050000:
exec("""from __future__ import with_statement
with pyfits.open("ascii.fits") as f: pass""")
def test_naxisj_check():
hdulist = pyfits.open("o4sp040b0_raw.fits")
hdulist[1].header.update("NAXIS3", 500)
assert... | <commit_before>import pyfits
import sys
def test_with_statement():
if sys.hexversion >= 0x02050000:
exec("""from __future__ import with_statement
with pyfits.open("ascii.fits") as f: pass""")
def test_naxisj_check():
hdulist = pyfits.open("o4sp040b0_raw.fits")
hdulist[1].header.update("NAXIS3", 5... |
fbc42057c647e4e42825b0b4e33d69e5967901f0 | cid/locals/thread_local.py | cid/locals/thread_local.py | from threading import local
from django.conf import settings
from .base import build_cid
_thread_locals = local()
def set_cid(cid):
"""Set the correlation id for the current request."""
setattr(_thread_locals, 'CID', cid)
def get_cid():
"""Return the currently set correlation id (if any).
If no... | from threading import local
from django.conf import settings
from .base import build_cid
_thread_locals = local()
def set_cid(cid):
"""Set the correlation id for the current request."""
setattr(_thread_locals, 'CID', cid)
def get_cid():
"""Return the currently set correlation id (if any).
If no... | Remove ancient FIXME in `get_cid()` | Remove ancient FIXME in `get_cid()`
Maybe I had a great idea in mind when I wrote the comment. Or maybe it
was just a vague thought. I guess we'll never know.
| Python | bsd-3-clause | snowball-one/cid | from threading import local
from django.conf import settings
from .base import build_cid
_thread_locals = local()
def set_cid(cid):
"""Set the correlation id for the current request."""
setattr(_thread_locals, 'CID', cid)
def get_cid():
"""Return the currently set correlation id (if any).
If no... | from threading import local
from django.conf import settings
from .base import build_cid
_thread_locals = local()
def set_cid(cid):
"""Set the correlation id for the current request."""
setattr(_thread_locals, 'CID', cid)
def get_cid():
"""Return the currently set correlation id (if any).
If no... | <commit_before>from threading import local
from django.conf import settings
from .base import build_cid
_thread_locals = local()
def set_cid(cid):
"""Set the correlation id for the current request."""
setattr(_thread_locals, 'CID', cid)
def get_cid():
"""Return the currently set correlation id (if a... | from threading import local
from django.conf import settings
from .base import build_cid
_thread_locals = local()
def set_cid(cid):
"""Set the correlation id for the current request."""
setattr(_thread_locals, 'CID', cid)
def get_cid():
"""Return the currently set correlation id (if any).
If no... | from threading import local
from django.conf import settings
from .base import build_cid
_thread_locals = local()
def set_cid(cid):
"""Set the correlation id for the current request."""
setattr(_thread_locals, 'CID', cid)
def get_cid():
"""Return the currently set correlation id (if any).
If no... | <commit_before>from threading import local
from django.conf import settings
from .base import build_cid
_thread_locals = local()
def set_cid(cid):
"""Set the correlation id for the current request."""
setattr(_thread_locals, 'CID', cid)
def get_cid():
"""Return the currently set correlation id (if a... |
370507fc48636417a10e4075917783169f3653c3 | test_edelbaum.py | test_edelbaum.py | from astropy import units as u
from numpy.testing import assert_almost_equal
from poliastro.bodies import Earth
from edelbaum import extra_quantities
def test_leo_geo_time_and_delta_v():
a_0 = 7000.0 # km
a_f = 42166.0 # km
i_f = 0.0 # deg
i_0 = 28.5 # deg
f = 3.5e-7 # km / s2
k = Ear... | from astropy import units as u
from numpy.testing import assert_almost_equal
from poliastro.bodies import Earth
from edelbaum import extra_quantities
def test_leo_geo_time_and_delta_v():
a_0 = 7000.0 # km
a_f = 42166.0 # km
i_f = 0.0 # rad
i_0 = (28.5 * u.deg).to(u.rad).value # rad
f = 3.5e... | Fix unit error, improve precision | Fix unit error, improve precision
| Python | mit | Juanlu001/pfc-uc3m | from astropy import units as u
from numpy.testing import assert_almost_equal
from poliastro.bodies import Earth
from edelbaum import extra_quantities
def test_leo_geo_time_and_delta_v():
a_0 = 7000.0 # km
a_f = 42166.0 # km
i_f = 0.0 # deg
i_0 = 28.5 # deg
f = 3.5e-7 # km / s2
k = Ear... | from astropy import units as u
from numpy.testing import assert_almost_equal
from poliastro.bodies import Earth
from edelbaum import extra_quantities
def test_leo_geo_time_and_delta_v():
a_0 = 7000.0 # km
a_f = 42166.0 # km
i_f = 0.0 # rad
i_0 = (28.5 * u.deg).to(u.rad).value # rad
f = 3.5e... | <commit_before>from astropy import units as u
from numpy.testing import assert_almost_equal
from poliastro.bodies import Earth
from edelbaum import extra_quantities
def test_leo_geo_time_and_delta_v():
a_0 = 7000.0 # km
a_f = 42166.0 # km
i_f = 0.0 # deg
i_0 = 28.5 # deg
f = 3.5e-7 # km / ... | from astropy import units as u
from numpy.testing import assert_almost_equal
from poliastro.bodies import Earth
from edelbaum import extra_quantities
def test_leo_geo_time_and_delta_v():
a_0 = 7000.0 # km
a_f = 42166.0 # km
i_f = 0.0 # rad
i_0 = (28.5 * u.deg).to(u.rad).value # rad
f = 3.5e... | from astropy import units as u
from numpy.testing import assert_almost_equal
from poliastro.bodies import Earth
from edelbaum import extra_quantities
def test_leo_geo_time_and_delta_v():
a_0 = 7000.0 # km
a_f = 42166.0 # km
i_f = 0.0 # deg
i_0 = 28.5 # deg
f = 3.5e-7 # km / s2
k = Ear... | <commit_before>from astropy import units as u
from numpy.testing import assert_almost_equal
from poliastro.bodies import Earth
from edelbaum import extra_quantities
def test_leo_geo_time_and_delta_v():
a_0 = 7000.0 # km
a_f = 42166.0 # km
i_f = 0.0 # deg
i_0 = 28.5 # deg
f = 3.5e-7 # km / ... |
2b70b4d2ca40cfbf36265a650ca04855999c5a03 | elm_open_in_browser.py | elm_open_in_browser.py | import sublime
import os.path as fs
if int(sublime.version()) < 3000:
from elm_project import ElmProject
from ViewInBrowserCommand import ViewInBrowserCommand
else:
from .elm_project import ElmProject
ViewInBrowserCommand = __import__('View In Browser').ViewInBrowserCommand.ViewInBrowserCommand
class ... | import sublime
import os.path as fs
if int(sublime.version()) < 3000:
from elm_project import ElmProject
from ViewInBrowserCommand import ViewInBrowserCommand as OpenInBrowserCommand
else:
from .elm_project import ElmProject
try:
from SideBarEnhancements.SideBar import SideBarOpenInBrowserComma... | Add alternative support for open in browser | Add alternative support for open in browser
Integrate SideBarEnhancements for ST3 for poplarity and browser detection
| Python | mit | deadfoxygrandpa/Elm.tmLanguage,deadfoxygrandpa/Elm.tmLanguage,rtfeldman/Elm.tmLanguage,rtfeldman/Elm.tmLanguage,sekjun9878/Elm.tmLanguage,sekjun9878/Elm.tmLanguage | import sublime
import os.path as fs
if int(sublime.version()) < 3000:
from elm_project import ElmProject
from ViewInBrowserCommand import ViewInBrowserCommand
else:
from .elm_project import ElmProject
ViewInBrowserCommand = __import__('View In Browser').ViewInBrowserCommand.ViewInBrowserCommand
class ... | import sublime
import os.path as fs
if int(sublime.version()) < 3000:
from elm_project import ElmProject
from ViewInBrowserCommand import ViewInBrowserCommand as OpenInBrowserCommand
else:
from .elm_project import ElmProject
try:
from SideBarEnhancements.SideBar import SideBarOpenInBrowserComma... | <commit_before>import sublime
import os.path as fs
if int(sublime.version()) < 3000:
from elm_project import ElmProject
from ViewInBrowserCommand import ViewInBrowserCommand
else:
from .elm_project import ElmProject
ViewInBrowserCommand = __import__('View In Browser').ViewInBrowserCommand.ViewInBrowser... | import sublime
import os.path as fs
if int(sublime.version()) < 3000:
from elm_project import ElmProject
from ViewInBrowserCommand import ViewInBrowserCommand as OpenInBrowserCommand
else:
from .elm_project import ElmProject
try:
from SideBarEnhancements.SideBar import SideBarOpenInBrowserComma... | import sublime
import os.path as fs
if int(sublime.version()) < 3000:
from elm_project import ElmProject
from ViewInBrowserCommand import ViewInBrowserCommand
else:
from .elm_project import ElmProject
ViewInBrowserCommand = __import__('View In Browser').ViewInBrowserCommand.ViewInBrowserCommand
class ... | <commit_before>import sublime
import os.path as fs
if int(sublime.version()) < 3000:
from elm_project import ElmProject
from ViewInBrowserCommand import ViewInBrowserCommand
else:
from .elm_project import ElmProject
ViewInBrowserCommand = __import__('View In Browser').ViewInBrowserCommand.ViewInBrowser... |
65529690d8fecbf81087c6f43316f054288785ec | twenty3.py | twenty3.py | from pync import Notifier
from time import sleep
import argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--min', type=int, help="Minutes before break", default="20")
args = parser.parse_args()
if not args.min:
raise ValueError("Invalid minutes")
while True:
... | from pync import Notifier
from time import sleep
import argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--min', type=int, help="Timeout before sending alert (minutes)", default="20")
parser.add_argument('--duration', type=int, help="Duration of break (seconds)", default="20")
... | Add break duration argument and sleep timeout. Add notification when it is time to get back to work | Add break duration argument and sleep timeout. Add notification when it is time to get back to work
| Python | mit | mgalang/twenty3 | from pync import Notifier
from time import sleep
import argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--min', type=int, help="Minutes before break", default="20")
args = parser.parse_args()
if not args.min:
raise ValueError("Invalid minutes")
while True:
... | from pync import Notifier
from time import sleep
import argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--min', type=int, help="Timeout before sending alert (minutes)", default="20")
parser.add_argument('--duration', type=int, help="Duration of break (seconds)", default="20")
... | <commit_before>from pync import Notifier
from time import sleep
import argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--min', type=int, help="Minutes before break", default="20")
args = parser.parse_args()
if not args.min:
raise ValueError("Invalid minutes")
... | from pync import Notifier
from time import sleep
import argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--min', type=int, help="Timeout before sending alert (minutes)", default="20")
parser.add_argument('--duration', type=int, help="Duration of break (seconds)", default="20")
... | from pync import Notifier
from time import sleep
import argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--min', type=int, help="Minutes before break", default="20")
args = parser.parse_args()
if not args.min:
raise ValueError("Invalid minutes")
while True:
... | <commit_before>from pync import Notifier
from time import sleep
import argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--min', type=int, help="Minutes before break", default="20")
args = parser.parse_args()
if not args.min:
raise ValueError("Invalid minutes")
... |
2ad4dd2fe877248b33aefa4465352710f95d953a | djlotrek/decorators.py | djlotrek/decorators.py | from functools import wraps
from django.conf import settings
import requests
def check_recaptcha(view_func):
@wraps(view_func)
def _wrapped_view(request, *args, **kwargs):
request.recaptcha_is_valid = None
if request.method == 'POST':
recaptcha_response = request.POST.get('g-recap... | from functools import wraps
from django.conf import settings
import requests
def check_recaptcha(view_func):
"""Chech that the entered recaptcha data is correct"""
@wraps(view_func)
def _wrapped_view(request, *args, **kwargs):
request.recaptcha_is_valid = None
if request.method == 'POST':... | Add docstring to recaptcha check | Add docstring to recaptcha check | Python | mit | lotrekagency/djlotrek,lotrekagency/djlotrek | from functools import wraps
from django.conf import settings
import requests
def check_recaptcha(view_func):
@wraps(view_func)
def _wrapped_view(request, *args, **kwargs):
request.recaptcha_is_valid = None
if request.method == 'POST':
recaptcha_response = request.POST.get('g-recap... | from functools import wraps
from django.conf import settings
import requests
def check_recaptcha(view_func):
"""Chech that the entered recaptcha data is correct"""
@wraps(view_func)
def _wrapped_view(request, *args, **kwargs):
request.recaptcha_is_valid = None
if request.method == 'POST':... | <commit_before>from functools import wraps
from django.conf import settings
import requests
def check_recaptcha(view_func):
@wraps(view_func)
def _wrapped_view(request, *args, **kwargs):
request.recaptcha_is_valid = None
if request.method == 'POST':
recaptcha_response = request.PO... | from functools import wraps
from django.conf import settings
import requests
def check_recaptcha(view_func):
"""Chech that the entered recaptcha data is correct"""
@wraps(view_func)
def _wrapped_view(request, *args, **kwargs):
request.recaptcha_is_valid = None
if request.method == 'POST':... | from functools import wraps
from django.conf import settings
import requests
def check_recaptcha(view_func):
@wraps(view_func)
def _wrapped_view(request, *args, **kwargs):
request.recaptcha_is_valid = None
if request.method == 'POST':
recaptcha_response = request.POST.get('g-recap... | <commit_before>from functools import wraps
from django.conf import settings
import requests
def check_recaptcha(view_func):
@wraps(view_func)
def _wrapped_view(request, *args, **kwargs):
request.recaptcha_is_valid = None
if request.method == 'POST':
recaptcha_response = request.PO... |
d3734c7d8d006ba91c04f6cf03e6725bb966c439 | version.py | version.py | major = 0
minor=0
patch=28
branch="master"
timestamp=1376705489.59 | major = 0
minor=0
patch=29
branch="master"
timestamp=1376800912.72 | Tag commit for v0.0.29-master generated by gitmake.py | Tag commit for v0.0.29-master generated by gitmake.py
| Python | mit | ryansturmer/gitmake | major = 0
minor=0
patch=28
branch="master"
timestamp=1376705489.59Tag commit for v0.0.29-master generated by gitmake.py | major = 0
minor=0
patch=29
branch="master"
timestamp=1376800912.72 | <commit_before>major = 0
minor=0
patch=28
branch="master"
timestamp=1376705489.59<commit_msg>Tag commit for v0.0.29-master generated by gitmake.py<commit_after> | major = 0
minor=0
patch=29
branch="master"
timestamp=1376800912.72 | major = 0
minor=0
patch=28
branch="master"
timestamp=1376705489.59Tag commit for v0.0.29-master generated by gitmake.pymajor = 0
minor=0
patch=29
branch="master"
timestamp=1376800912.72 | <commit_before>major = 0
minor=0
patch=28
branch="master"
timestamp=1376705489.59<commit_msg>Tag commit for v0.0.29-master generated by gitmake.py<commit_after>major = 0
minor=0
patch=29
branch="master"
timestamp=1376800912.72 |
ad9ad98b27c1640c5c5a336e62b9e8c3c805259f | api/serializers.py | api/serializers.py | from django.contrib.auth.models import User
from rest_framework import serializers
from api.models import UserPreferences, HelpLink
class HelpLinkSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = HelpLink
fields = (
'link_key',
'topic',
'h... | from django.contrib.auth.models import User
from rest_framework import serializers
from api.models import UserPreferences, HelpLink
class HelpLinkSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = HelpLink
fields = (
'link_key',
'href'
)
clas... | Reduce response data for HelpLink | Reduce response data for HelpLink
| Python | apache-2.0 | CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend | from django.contrib.auth.models import User
from rest_framework import serializers
from api.models import UserPreferences, HelpLink
class HelpLinkSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = HelpLink
fields = (
'link_key',
'topic',
'h... | from django.contrib.auth.models import User
from rest_framework import serializers
from api.models import UserPreferences, HelpLink
class HelpLinkSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = HelpLink
fields = (
'link_key',
'href'
)
clas... | <commit_before>from django.contrib.auth.models import User
from rest_framework import serializers
from api.models import UserPreferences, HelpLink
class HelpLinkSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = HelpLink
fields = (
'link_key',
'topic',... | from django.contrib.auth.models import User
from rest_framework import serializers
from api.models import UserPreferences, HelpLink
class HelpLinkSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = HelpLink
fields = (
'link_key',
'href'
)
clas... | from django.contrib.auth.models import User
from rest_framework import serializers
from api.models import UserPreferences, HelpLink
class HelpLinkSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = HelpLink
fields = (
'link_key',
'topic',
'h... | <commit_before>from django.contrib.auth.models import User
from rest_framework import serializers
from api.models import UserPreferences, HelpLink
class HelpLinkSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = HelpLink
fields = (
'link_key',
'topic',... |
63f42d18a2771b6057ae96c80d25f605e353fee6 | app/main/errors.py | app/main/errors.py | # coding=utf-8
from flask import render_template
from . import main
from dmapiclient import APIError
@main.app_errorhandler(APIError)
def api_error_handler(e):
return _render_error_page(e.status_code)
@main.app_errorhandler(404)
def page_not_found(e):
return _render_error_page(404)
@main.app_errorhandler... | # coding=utf-8
from flask import render_template
from . import main
from ..api_client.error import APIError
@main.app_errorhandler(APIError)
def api_error_handler(e):
return _render_error_page(e.status_code)
@main.app_errorhandler(404)
def page_not_found(e):
return _render_error_page(404)
@main.app_error... | Change app-level error handler to use api_client.error exceptions | Change app-level error handler to use api_client.error exceptions
| Python | mit | AusDTO/dto-digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend | # coding=utf-8
from flask import render_template
from . import main
from dmapiclient import APIError
@main.app_errorhandler(APIError)
def api_error_handler(e):
return _render_error_page(e.status_code)
@main.app_errorhandler(404)
def page_not_found(e):
return _render_error_page(404)
@main.app_errorhandler... | # coding=utf-8
from flask import render_template
from . import main
from ..api_client.error import APIError
@main.app_errorhandler(APIError)
def api_error_handler(e):
return _render_error_page(e.status_code)
@main.app_errorhandler(404)
def page_not_found(e):
return _render_error_page(404)
@main.app_error... | <commit_before># coding=utf-8
from flask import render_template
from . import main
from dmapiclient import APIError
@main.app_errorhandler(APIError)
def api_error_handler(e):
return _render_error_page(e.status_code)
@main.app_errorhandler(404)
def page_not_found(e):
return _render_error_page(404)
@main.a... | # coding=utf-8
from flask import render_template
from . import main
from ..api_client.error import APIError
@main.app_errorhandler(APIError)
def api_error_handler(e):
return _render_error_page(e.status_code)
@main.app_errorhandler(404)
def page_not_found(e):
return _render_error_page(404)
@main.app_error... | # coding=utf-8
from flask import render_template
from . import main
from dmapiclient import APIError
@main.app_errorhandler(APIError)
def api_error_handler(e):
return _render_error_page(e.status_code)
@main.app_errorhandler(404)
def page_not_found(e):
return _render_error_page(404)
@main.app_errorhandler... | <commit_before># coding=utf-8
from flask import render_template
from . import main
from dmapiclient import APIError
@main.app_errorhandler(APIError)
def api_error_handler(e):
return _render_error_page(e.status_code)
@main.app_errorhandler(404)
def page_not_found(e):
return _render_error_page(404)
@main.a... |
da5269713a444c8a506535cd88f21fea8f1ffc83 | antxetamedia/multimedia/handlers.py | antxetamedia/multimedia/handlers.py | from boto.s3.connection import S3Connection
from boto.s3.bucket import Bucket
from boto.exception import S3CreateError
from django.conf import settings
def upload(user, passwd, bucket, metadata, key, fd):
conn = S3Connection(user, passwd, host=settings.S3_HOST, is_secure=False)
bucket.strip('-')
try:
... | from __future__ import unicode_literals
from boto.s3.connection import S3Connection
from boto.s3.bucket import Bucket
from boto.exception import S3CreateError
from django.conf import settings
def upload(user, passwd, bucket, metadata, key, fd):
conn = S3Connection(user, passwd, host=settings.S3_HOST, is_secure=... | Prepend S3 account username to buckets | Prepend S3 account username to buckets
| Python | agpl-3.0 | GISAElkartea/antxetamedia,GISAElkartea/antxetamedia,GISAElkartea/antxetamedia | from boto.s3.connection import S3Connection
from boto.s3.bucket import Bucket
from boto.exception import S3CreateError
from django.conf import settings
def upload(user, passwd, bucket, metadata, key, fd):
conn = S3Connection(user, passwd, host=settings.S3_HOST, is_secure=False)
bucket.strip('-')
try:
... | from __future__ import unicode_literals
from boto.s3.connection import S3Connection
from boto.s3.bucket import Bucket
from boto.exception import S3CreateError
from django.conf import settings
def upload(user, passwd, bucket, metadata, key, fd):
conn = S3Connection(user, passwd, host=settings.S3_HOST, is_secure=... | <commit_before>from boto.s3.connection import S3Connection
from boto.s3.bucket import Bucket
from boto.exception import S3CreateError
from django.conf import settings
def upload(user, passwd, bucket, metadata, key, fd):
conn = S3Connection(user, passwd, host=settings.S3_HOST, is_secure=False)
bucket.strip('... | from __future__ import unicode_literals
from boto.s3.connection import S3Connection
from boto.s3.bucket import Bucket
from boto.exception import S3CreateError
from django.conf import settings
def upload(user, passwd, bucket, metadata, key, fd):
conn = S3Connection(user, passwd, host=settings.S3_HOST, is_secure=... | from boto.s3.connection import S3Connection
from boto.s3.bucket import Bucket
from boto.exception import S3CreateError
from django.conf import settings
def upload(user, passwd, bucket, metadata, key, fd):
conn = S3Connection(user, passwd, host=settings.S3_HOST, is_secure=False)
bucket.strip('-')
try:
... | <commit_before>from boto.s3.connection import S3Connection
from boto.s3.bucket import Bucket
from boto.exception import S3CreateError
from django.conf import settings
def upload(user, passwd, bucket, metadata, key, fd):
conn = S3Connection(user, passwd, host=settings.S3_HOST, is_secure=False)
bucket.strip('... |
ceb88623b55cd572d4ef45ec2fb7d81639e07878 | fancypages/__init__.py | fancypages/__init__.py | __version__ = (0, 0, 1, 'alpha', 1)
| import os
__version__ = (0, 0, 1, 'alpha', 1)
FP_MAIN_TEMPLATE_DIR = os.path.join(
os.path.dirname(os.path.abspath(__file__))
)
| Add setting for fancypages base template dir | Add setting for fancypages base template dir
| Python | bsd-3-clause | socradev/django-fancypages,tangentlabs/django-fancypages,socradev/django-fancypages,tangentlabs/django-fancypages,socradev/django-fancypages,tangentlabs/django-fancypages | __version__ = (0, 0, 1, 'alpha', 1)
Add setting for fancypages base template dir | import os
__version__ = (0, 0, 1, 'alpha', 1)
FP_MAIN_TEMPLATE_DIR = os.path.join(
os.path.dirname(os.path.abspath(__file__))
)
| <commit_before>__version__ = (0, 0, 1, 'alpha', 1)
<commit_msg>Add setting for fancypages base template dir<commit_after> | import os
__version__ = (0, 0, 1, 'alpha', 1)
FP_MAIN_TEMPLATE_DIR = os.path.join(
os.path.dirname(os.path.abspath(__file__))
)
| __version__ = (0, 0, 1, 'alpha', 1)
Add setting for fancypages base template dirimport os
__version__ = (0, 0, 1, 'alpha', 1)
FP_MAIN_TEMPLATE_DIR = os.path.join(
os.path.dirname(os.path.abspath(__file__))
)
| <commit_before>__version__ = (0, 0, 1, 'alpha', 1)
<commit_msg>Add setting for fancypages base template dir<commit_after>import os
__version__ = (0, 0, 1, 'alpha', 1)
FP_MAIN_TEMPLATE_DIR = os.path.join(
os.path.dirname(os.path.abspath(__file__))
)
|
3036adf880473741188d2c7c4f9adc4e433b3d3e | webkit/tools/layout_tests/run_webkit_tests.py | webkit/tools/layout_tests/run_webkit_tests.py | #!/usr/bin/env python
# Copyright (c) 2010 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.
"""Wrapper around
third_party/WebKit/Tools/Scripts/run-webkit-tests"""
import os
import subprocess
import sys
def main():
c... | #!/usr/bin/env python
# Copyright (c) 2010 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.
"""Wrapper around
third_party/WebKit/Tools/Scripts/new-run-webkit-tests"""
import os
import subprocess
import sys
def main():
... | Revert 193850 "Remove references to new-run-webkit-tests" | Revert 193850 "Remove references to new-run-webkit-tests"
Tries to execute the perl script "run-webkit-tests" using "cmd" which is python.
> Remove references to new-run-webkit-tests
>
> We are going to rename it to run-webkit-tests soon.
>
> BUG=
>
> Review URL: https://chromiumcodereview.appspot.com/13980005
TB... | Python | bsd-3-clause | M4sse/chromium.src,anirudhSK/chromium,jaruba/chromium.src,anirudhSK/chromium,anirudhSK/chromium,hujiajie/pa-chromium,ondra-novak/chromium.src,ChromiumWebApps/chromium,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,hujiajie/pa-chromium,crosswalk-project/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,dedn... | #!/usr/bin/env python
# Copyright (c) 2010 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.
"""Wrapper around
third_party/WebKit/Tools/Scripts/run-webkit-tests"""
import os
import subprocess
import sys
def main():
c... | #!/usr/bin/env python
# Copyright (c) 2010 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.
"""Wrapper around
third_party/WebKit/Tools/Scripts/new-run-webkit-tests"""
import os
import subprocess
import sys
def main():
... | <commit_before>#!/usr/bin/env python
# Copyright (c) 2010 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.
"""Wrapper around
third_party/WebKit/Tools/Scripts/run-webkit-tests"""
import os
import subprocess
import sys
de... | #!/usr/bin/env python
# Copyright (c) 2010 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.
"""Wrapper around
third_party/WebKit/Tools/Scripts/new-run-webkit-tests"""
import os
import subprocess
import sys
def main():
... | #!/usr/bin/env python
# Copyright (c) 2010 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.
"""Wrapper around
third_party/WebKit/Tools/Scripts/run-webkit-tests"""
import os
import subprocess
import sys
def main():
c... | <commit_before>#!/usr/bin/env python
# Copyright (c) 2010 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.
"""Wrapper around
third_party/WebKit/Tools/Scripts/run-webkit-tests"""
import os
import subprocess
import sys
de... |
12a02b479daf8f3a5541e38ff13d8221480842ba | base/__init__.py | base/__init__.py | from __future__ import absolute_import
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery import app as celery_app # NOQA
| Make sure Celery is always loaded when Django is. | Make sure Celery is always loaded when Django is.
| Python | apache-2.0 | hello-base/web,hello-base/web,hello-base/web,hello-base/web | Make sure Celery is always loaded when Django is. | from __future__ import absolute_import
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery import app as celery_app # NOQA
| <commit_before><commit_msg>Make sure Celery is always loaded when Django is.<commit_after> | from __future__ import absolute_import
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery import app as celery_app # NOQA
| Make sure Celery is always loaded when Django is.from __future__ import absolute_import
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery import app as celery_app # NOQA
| <commit_before><commit_msg>Make sure Celery is always loaded when Django is.<commit_after>from __future__ import absolute_import
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery import app as celery_app # NOQA
| |
72655f0b0c7edfd3f51fe0ea847d45f9acd5ba42 | hoomd/triggers.py | hoomd/triggers.py | # Copyright (c) 2009-2019 The Regents of the University of Michigan
# This file is part of the HOOMD-blue project, released under the BSD 3-Clause
# License.
from hoomd import _hoomd
class Trigger(_hoomd.Trigger):
pass
class PeriodicTrigger(_hoomd.PeriodicTrigger):
def __init__(self, period, phase=0):
... | # Copyright (c) 2009-2019 The Regents of the University of Michigan
# This file is part of the HOOMD-blue project, released under the BSD 3-Clause
# License.
from hoomd import _hoomd
class Trigger(_hoomd.Trigger):
pass
class PeriodicTrigger(_hoomd.PeriodicTrigger, Trigger):
def __init__(self, period, phase... | Make ``PeriodicTrigger`` inherent from ``Trigger`` | Make ``PeriodicTrigger`` inherent from ``Trigger``
Fixes bug in checking state and preprocessing ``Triggers`` for duck
typing.
| Python | bsd-3-clause | joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue | # Copyright (c) 2009-2019 The Regents of the University of Michigan
# This file is part of the HOOMD-blue project, released under the BSD 3-Clause
# License.
from hoomd import _hoomd
class Trigger(_hoomd.Trigger):
pass
class PeriodicTrigger(_hoomd.PeriodicTrigger):
def __init__(self, period, phase=0):
... | # Copyright (c) 2009-2019 The Regents of the University of Michigan
# This file is part of the HOOMD-blue project, released under the BSD 3-Clause
# License.
from hoomd import _hoomd
class Trigger(_hoomd.Trigger):
pass
class PeriodicTrigger(_hoomd.PeriodicTrigger, Trigger):
def __init__(self, period, phase... | <commit_before># Copyright (c) 2009-2019 The Regents of the University of Michigan
# This file is part of the HOOMD-blue project, released under the BSD 3-Clause
# License.
from hoomd import _hoomd
class Trigger(_hoomd.Trigger):
pass
class PeriodicTrigger(_hoomd.PeriodicTrigger):
def __init__(self, period, p... | # Copyright (c) 2009-2019 The Regents of the University of Michigan
# This file is part of the HOOMD-blue project, released under the BSD 3-Clause
# License.
from hoomd import _hoomd
class Trigger(_hoomd.Trigger):
pass
class PeriodicTrigger(_hoomd.PeriodicTrigger, Trigger):
def __init__(self, period, phase... | # Copyright (c) 2009-2019 The Regents of the University of Michigan
# This file is part of the HOOMD-blue project, released under the BSD 3-Clause
# License.
from hoomd import _hoomd
class Trigger(_hoomd.Trigger):
pass
class PeriodicTrigger(_hoomd.PeriodicTrigger):
def __init__(self, period, phase=0):
... | <commit_before># Copyright (c) 2009-2019 The Regents of the University of Michigan
# This file is part of the HOOMD-blue project, released under the BSD 3-Clause
# License.
from hoomd import _hoomd
class Trigger(_hoomd.Trigger):
pass
class PeriodicTrigger(_hoomd.PeriodicTrigger):
def __init__(self, period, p... |
990e33af851172ea3d79e591bde52af554d0eb50 | common/util.py | common/util.py | #!/usr/bin/python
"""
common.py
"""
import sys
def log(msg, *args):
if args:
msg = msg % args
print >>sys.stderr, 'webpipe:', msg
| """
util.py
"""
import os
import sys
basename = os.path.basename(sys.argv[0])
prefix, _ = os.path.splitext(basename)
def log(msg, *args):
if args:
msg = msg % args
print >>sys.stderr, prefix + ': ' + msg
| Use the program name as the prefix. | Use the program name as the prefix.
| Python | bsd-3-clause | andychu/webpipe,andychu/webpipe,andychu/webpipe,andychu/webpipe,andychu/webpipe | #!/usr/bin/python
"""
common.py
"""
import sys
def log(msg, *args):
if args:
msg = msg % args
print >>sys.stderr, 'webpipe:', msg
Use the program name as the prefix. | """
util.py
"""
import os
import sys
basename = os.path.basename(sys.argv[0])
prefix, _ = os.path.splitext(basename)
def log(msg, *args):
if args:
msg = msg % args
print >>sys.stderr, prefix + ': ' + msg
| <commit_before>#!/usr/bin/python
"""
common.py
"""
import sys
def log(msg, *args):
if args:
msg = msg % args
print >>sys.stderr, 'webpipe:', msg
<commit_msg>Use the program name as the prefix.<commit_after> | """
util.py
"""
import os
import sys
basename = os.path.basename(sys.argv[0])
prefix, _ = os.path.splitext(basename)
def log(msg, *args):
if args:
msg = msg % args
print >>sys.stderr, prefix + ': ' + msg
| #!/usr/bin/python
"""
common.py
"""
import sys
def log(msg, *args):
if args:
msg = msg % args
print >>sys.stderr, 'webpipe:', msg
Use the program name as the prefix."""
util.py
"""
import os
import sys
basename = os.path.basename(sys.argv[0])
prefix, _ = os.path.splitext(basename)
def log(msg, *args):
... | <commit_before>#!/usr/bin/python
"""
common.py
"""
import sys
def log(msg, *args):
if args:
msg = msg % args
print >>sys.stderr, 'webpipe:', msg
<commit_msg>Use the program name as the prefix.<commit_after>"""
util.py
"""
import os
import sys
basename = os.path.basename(sys.argv[0])
prefix, _ = os.path.s... |
befa44a98797542fe2e50b82c0cfbed815cfc6d1 | duralex/AddGitHubIssueVisitor.py | duralex/AddGitHubIssueVisitor.py | # -*- coding: utf-8 -*-
from AbstractVisitor import AbstractVisitor
from duralex.alinea_parser import *
from github import Github
class AddGitHubIssueVisitor(AbstractVisitor):
def __init__(self, args):
self.github = Github(args.github_token)
self.repo = self.github.get_repo(args.github_repositor... | # -*- coding: utf-8 -*-
from AbstractVisitor import AbstractVisitor
from duralex.alinea_parser import *
from github import Github
class AddGitHubIssueVisitor(AbstractVisitor):
def __init__(self, args):
self.github = Github(args.github_token)
self.repo = self.github.get_repo(args.github_repositor... | Set the githubIssue field to the actual GitHub URL fo the issue instead of the issue number. | Set the githubIssue field to the actual GitHub URL fo the issue instead of the issue number.
| Python | mit | Legilibre/duralex | # -*- coding: utf-8 -*-
from AbstractVisitor import AbstractVisitor
from duralex.alinea_parser import *
from github import Github
class AddGitHubIssueVisitor(AbstractVisitor):
def __init__(self, args):
self.github = Github(args.github_token)
self.repo = self.github.get_repo(args.github_repositor... | # -*- coding: utf-8 -*-
from AbstractVisitor import AbstractVisitor
from duralex.alinea_parser import *
from github import Github
class AddGitHubIssueVisitor(AbstractVisitor):
def __init__(self, args):
self.github = Github(args.github_token)
self.repo = self.github.get_repo(args.github_repositor... | <commit_before># -*- coding: utf-8 -*-
from AbstractVisitor import AbstractVisitor
from duralex.alinea_parser import *
from github import Github
class AddGitHubIssueVisitor(AbstractVisitor):
def __init__(self, args):
self.github = Github(args.github_token)
self.repo = self.github.get_repo(args.g... | # -*- coding: utf-8 -*-
from AbstractVisitor import AbstractVisitor
from duralex.alinea_parser import *
from github import Github
class AddGitHubIssueVisitor(AbstractVisitor):
def __init__(self, args):
self.github = Github(args.github_token)
self.repo = self.github.get_repo(args.github_repositor... | # -*- coding: utf-8 -*-
from AbstractVisitor import AbstractVisitor
from duralex.alinea_parser import *
from github import Github
class AddGitHubIssueVisitor(AbstractVisitor):
def __init__(self, args):
self.github = Github(args.github_token)
self.repo = self.github.get_repo(args.github_repositor... | <commit_before># -*- coding: utf-8 -*-
from AbstractVisitor import AbstractVisitor
from duralex.alinea_parser import *
from github import Github
class AddGitHubIssueVisitor(AbstractVisitor):
def __init__(self, args):
self.github = Github(args.github_token)
self.repo = self.github.get_repo(args.g... |
5997e30e05d51996345e3154c5495683e3229410 | app/taskqueue/celeryconfig.py | app/taskqueue/celeryconfig.py | # Copyright (C) 2014 Linaro Ltd.
#
# This program 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
# License, or (at your option) any later version.
#
# This program is distribute... | # Copyright (C) 2014 Linaro Ltd.
#
# This program 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
# License, or (at your option) any later version.
#
# This program is distribute... | Increase ack on broker to 4 hours. | Increase ack on broker to 4 hours.
Change-Id: I4a1f0fc6d1c07014896ef6b34336396d4b30bfdd
| Python | lgpl-2.1 | kernelci/kernelci-backend,joyxu/kernelci-backend,joyxu/kernelci-backend,joyxu/kernelci-backend,kernelci/kernelci-backend | # Copyright (C) 2014 Linaro Ltd.
#
# This program 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
# License, or (at your option) any later version.
#
# This program is distribute... | # Copyright (C) 2014 Linaro Ltd.
#
# This program 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
# License, or (at your option) any later version.
#
# This program is distribute... | <commit_before># Copyright (C) 2014 Linaro Ltd.
#
# This program 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
# License, or (at your option) any later version.
#
# This progra... | # Copyright (C) 2014 Linaro Ltd.
#
# This program 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
# License, or (at your option) any later version.
#
# This program is distribute... | # Copyright (C) 2014 Linaro Ltd.
#
# This program 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
# License, or (at your option) any later version.
#
# This program is distribute... | <commit_before># Copyright (C) 2014 Linaro Ltd.
#
# This program 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
# License, or (at your option) any later version.
#
# This progra... |
af4c24dc7ac5b05ea509b5b6d95d22395aa2d409 | dist/gae/standalone_main.py | dist/gae/standalone_main.py | import werkzeug.serving
import standalone_app
werkzeug.serving.run_simple('localhost', 8080, standalone_app.app, use_reloader=True)
| import werkzeug.serving
import standalone_app
werkzeug.serving.run_simple('0.0.0.0', 8080, standalone_app.app, use_reloader=True)
| Make the dev server advertise on your local ip as well as localhost (for easier testing on mobile) | Make the dev server advertise on your local ip as well as localhost (for easier testing on mobile)
| Python | bsd-3-clause | abortz/saycbridge,eseidel/saycbridge,abortz/saycbridge,eseidel/saycbridge,abortz/saycbridge,abortz/saycbridge,eseidel/saycbridge,abortz/saycbridge | import werkzeug.serving
import standalone_app
werkzeug.serving.run_simple('localhost', 8080, standalone_app.app, use_reloader=True)
Make the dev server advertise on your local ip as well as localhost (for easier testing on mobile) | import werkzeug.serving
import standalone_app
werkzeug.serving.run_simple('0.0.0.0', 8080, standalone_app.app, use_reloader=True)
| <commit_before>import werkzeug.serving
import standalone_app
werkzeug.serving.run_simple('localhost', 8080, standalone_app.app, use_reloader=True)
<commit_msg>Make the dev server advertise on your local ip as well as localhost (for easier testing on mobile)<commit_after> | import werkzeug.serving
import standalone_app
werkzeug.serving.run_simple('0.0.0.0', 8080, standalone_app.app, use_reloader=True)
| import werkzeug.serving
import standalone_app
werkzeug.serving.run_simple('localhost', 8080, standalone_app.app, use_reloader=True)
Make the dev server advertise on your local ip as well as localhost (for easier testing on mobile)import werkzeug.serving
import standalone_app
werkzeug.serving.run_simple('0.0.0.0', 808... | <commit_before>import werkzeug.serving
import standalone_app
werkzeug.serving.run_simple('localhost', 8080, standalone_app.app, use_reloader=True)
<commit_msg>Make the dev server advertise on your local ip as well as localhost (for easier testing on mobile)<commit_after>import werkzeug.serving
import standalone_app
w... |
0e376d987dd8d513354a840da6bee6d5a2752f89 | django_countries/widgets.py | django_countries/widgets.py | from django.conf import settings
from django.forms import widgets
from django.utils.safestring import mark_safe
COUNTRY_CHANGE_HANDLER = """
this.nextSibling.src = this.nextSibling.src.replace(/[a-z_]*\.gif/, (this.value.toLowerCase() || '__') + '.gif');
"""
FLAG_IMAGE = """<img style="margin: 6px 4px; position: abso... | from django.conf import settings
from django.forms import widgets
from django.utils.safestring import mark_safe
COUNTRY_CHANGE_HANDLER = """
this.nextSibling.src = this.nextSibling.src.replace(/[a-z_]{2}(\.[a-zA-Z]*)$/, (this.value.toLowerCase() || '__') + '$1');
"""
FLAG_IMAGE = """<img style="margin: 6px 4px; posit... | Make the regular expression not require a gif image. | Make the regular expression not require a gif image.
| Python | mit | SmileyChris/django-countries,schinckel/django-countries,rahimnathwani/django-countries,jrfernandes/django-countries,velfimov/django-countries,fladi/django-countries,pimlie/django-countries | from django.conf import settings
from django.forms import widgets
from django.utils.safestring import mark_safe
COUNTRY_CHANGE_HANDLER = """
this.nextSibling.src = this.nextSibling.src.replace(/[a-z_]*\.gif/, (this.value.toLowerCase() || '__') + '.gif');
"""
FLAG_IMAGE = """<img style="margin: 6px 4px; position: abso... | from django.conf import settings
from django.forms import widgets
from django.utils.safestring import mark_safe
COUNTRY_CHANGE_HANDLER = """
this.nextSibling.src = this.nextSibling.src.replace(/[a-z_]{2}(\.[a-zA-Z]*)$/, (this.value.toLowerCase() || '__') + '$1');
"""
FLAG_IMAGE = """<img style="margin: 6px 4px; posit... | <commit_before>from django.conf import settings
from django.forms import widgets
from django.utils.safestring import mark_safe
COUNTRY_CHANGE_HANDLER = """
this.nextSibling.src = this.nextSibling.src.replace(/[a-z_]*\.gif/, (this.value.toLowerCase() || '__') + '.gif');
"""
FLAG_IMAGE = """<img style="margin: 6px 4px;... | from django.conf import settings
from django.forms import widgets
from django.utils.safestring import mark_safe
COUNTRY_CHANGE_HANDLER = """
this.nextSibling.src = this.nextSibling.src.replace(/[a-z_]{2}(\.[a-zA-Z]*)$/, (this.value.toLowerCase() || '__') + '$1');
"""
FLAG_IMAGE = """<img style="margin: 6px 4px; posit... | from django.conf import settings
from django.forms import widgets
from django.utils.safestring import mark_safe
COUNTRY_CHANGE_HANDLER = """
this.nextSibling.src = this.nextSibling.src.replace(/[a-z_]*\.gif/, (this.value.toLowerCase() || '__') + '.gif');
"""
FLAG_IMAGE = """<img style="margin: 6px 4px; position: abso... | <commit_before>from django.conf import settings
from django.forms import widgets
from django.utils.safestring import mark_safe
COUNTRY_CHANGE_HANDLER = """
this.nextSibling.src = this.nextSibling.src.replace(/[a-z_]*\.gif/, (this.value.toLowerCase() || '__') + '.gif');
"""
FLAG_IMAGE = """<img style="margin: 6px 4px;... |
6664f77b8193343fe840b2542a84cc2bf585108a | check_version.py | check_version.py | import re
import sys
changes_file = open('CHANGES.txt', 'r')
changes_first_line = changes_file.readline()
changes_version = re.match(r'v(\d\.\d\.\d).*', changes_first_line).group(1)
setup_file = open('setup.py', 'r')
setup_content = setup_file.read()
setup_version = re.search(r'version=\'(\d\.\d\.\d)\'', setup_conten... | import re
import sys
changes_file = open('CHANGES.txt', 'r')
changes_first_line = changes_file.readline()
changes_version = re.match(r'v(\d\.\d\.\d).*',
changes_first_line).group(1)
setup_file = open('setup.py', 'r')
setup_content = setup_file.read()
setup_version = re.search(r'version=\'(\... | Update release version checking to include documentation | Update release version checking to include documentation
| Python | unlicense | mmurdoch/Vengeance,mmurdoch/Vengeance | import re
import sys
changes_file = open('CHANGES.txt', 'r')
changes_first_line = changes_file.readline()
changes_version = re.match(r'v(\d\.\d\.\d).*', changes_first_line).group(1)
setup_file = open('setup.py', 'r')
setup_content = setup_file.read()
setup_version = re.search(r'version=\'(\d\.\d\.\d)\'', setup_conten... | import re
import sys
changes_file = open('CHANGES.txt', 'r')
changes_first_line = changes_file.readline()
changes_version = re.match(r'v(\d\.\d\.\d).*',
changes_first_line).group(1)
setup_file = open('setup.py', 'r')
setup_content = setup_file.read()
setup_version = re.search(r'version=\'(\... | <commit_before>import re
import sys
changes_file = open('CHANGES.txt', 'r')
changes_first_line = changes_file.readline()
changes_version = re.match(r'v(\d\.\d\.\d).*', changes_first_line).group(1)
setup_file = open('setup.py', 'r')
setup_content = setup_file.read()
setup_version = re.search(r'version=\'(\d\.\d\.\d)\'... | import re
import sys
changes_file = open('CHANGES.txt', 'r')
changes_first_line = changes_file.readline()
changes_version = re.match(r'v(\d\.\d\.\d).*',
changes_first_line).group(1)
setup_file = open('setup.py', 'r')
setup_content = setup_file.read()
setup_version = re.search(r'version=\'(\... | import re
import sys
changes_file = open('CHANGES.txt', 'r')
changes_first_line = changes_file.readline()
changes_version = re.match(r'v(\d\.\d\.\d).*', changes_first_line).group(1)
setup_file = open('setup.py', 'r')
setup_content = setup_file.read()
setup_version = re.search(r'version=\'(\d\.\d\.\d)\'', setup_conten... | <commit_before>import re
import sys
changes_file = open('CHANGES.txt', 'r')
changes_first_line = changes_file.readline()
changes_version = re.match(r'v(\d\.\d\.\d).*', changes_first_line).group(1)
setup_file = open('setup.py', 'r')
setup_content = setup_file.read()
setup_version = re.search(r'version=\'(\d\.\d\.\d)\'... |
b0bfbe3bcab7f55dd2ed742d945d0f950bca0a2b | ckeditor/urls.py | ckeditor/urls.py | from django.conf.urls.defaults import patterns, url
from django.contrib import admin
from ckeditor import views
urlpatterns = patterns(
'',
url(r'^upload/', admin.site.admin_view(views.upload), name='ckeditor_upload'),
url(r'^browse/', admin.site.admin_view(views.browse), name='ckeditor_browse'),
)
| try:
from django.conf.urls import patterns, url
except ImportError: # django < 1.4
from django.conf.urls.defaults import patterns, url
from django.contrib import admin
from ckeditor import views
urlpatterns = patterns(
'',
url(r'^upload/', admin.site.admin_view(views.upload), name='ckeditor_upload'),
... | Fix the file url for Django 1.6 | Fix the file url for Django 1.6
| Python | bsd-3-clause | gian88/django-ckeditor-amazon-s3,gian88/django-ckeditor-amazon-s3,gian88/django-ckeditor-amazon-s3,gian88/django-ckeditor-amazon-s3,gian88/django-ckeditor-amazon-s3,gian88/django-ckeditor-amazon-s3 | from django.conf.urls.defaults import patterns, url
from django.contrib import admin
from ckeditor import views
urlpatterns = patterns(
'',
url(r'^upload/', admin.site.admin_view(views.upload), name='ckeditor_upload'),
url(r'^browse/', admin.site.admin_view(views.browse), name='ckeditor_browse'),
)
Fix the... | try:
from django.conf.urls import patterns, url
except ImportError: # django < 1.4
from django.conf.urls.defaults import patterns, url
from django.contrib import admin
from ckeditor import views
urlpatterns = patterns(
'',
url(r'^upload/', admin.site.admin_view(views.upload), name='ckeditor_upload'),
... | <commit_before>from django.conf.urls.defaults import patterns, url
from django.contrib import admin
from ckeditor import views
urlpatterns = patterns(
'',
url(r'^upload/', admin.site.admin_view(views.upload), name='ckeditor_upload'),
url(r'^browse/', admin.site.admin_view(views.browse), name='ckeditor_brow... | try:
from django.conf.urls import patterns, url
except ImportError: # django < 1.4
from django.conf.urls.defaults import patterns, url
from django.contrib import admin
from ckeditor import views
urlpatterns = patterns(
'',
url(r'^upload/', admin.site.admin_view(views.upload), name='ckeditor_upload'),
... | from django.conf.urls.defaults import patterns, url
from django.contrib import admin
from ckeditor import views
urlpatterns = patterns(
'',
url(r'^upload/', admin.site.admin_view(views.upload), name='ckeditor_upload'),
url(r'^browse/', admin.site.admin_view(views.browse), name='ckeditor_browse'),
)
Fix the... | <commit_before>from django.conf.urls.defaults import patterns, url
from django.contrib import admin
from ckeditor import views
urlpatterns = patterns(
'',
url(r'^upload/', admin.site.admin_view(views.upload), name='ckeditor_upload'),
url(r'^browse/', admin.site.admin_view(views.browse), name='ckeditor_brow... |
2758c1086e06a77f9676d678a3d41a53a352ec01 | testfixtures/seating.py | testfixtures/seating.py | # -*- coding: utf-8 -*-
"""
testfixtures.seating
~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from byceps.services.seating.models.seat_group import SeatGroup
def create_seat_group(party_id, seat_category, title, *, seat_quantity=4):
return... | # -*- coding: utf-8 -*-
"""
testfixtures.seating
~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from byceps.services.seating.models.category import Category
from byceps.services.seating.models.seat_group import SeatGroup
def create_seat_category... | Add function to create a seat category test fixture | Add function to create a seat category test fixture
| Python | bsd-3-clause | m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps,m-ober/byceps,m-ober/byceps | # -*- coding: utf-8 -*-
"""
testfixtures.seating
~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from byceps.services.seating.models.seat_group import SeatGroup
def create_seat_group(party_id, seat_category, title, *, seat_quantity=4):
return... | # -*- coding: utf-8 -*-
"""
testfixtures.seating
~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from byceps.services.seating.models.category import Category
from byceps.services.seating.models.seat_group import SeatGroup
def create_seat_category... | <commit_before># -*- coding: utf-8 -*-
"""
testfixtures.seating
~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from byceps.services.seating.models.seat_group import SeatGroup
def create_seat_group(party_id, seat_category, title, *, seat_quantity... | # -*- coding: utf-8 -*-
"""
testfixtures.seating
~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from byceps.services.seating.models.category import Category
from byceps.services.seating.models.seat_group import SeatGroup
def create_seat_category... | # -*- coding: utf-8 -*-
"""
testfixtures.seating
~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from byceps.services.seating.models.seat_group import SeatGroup
def create_seat_group(party_id, seat_category, title, *, seat_quantity=4):
return... | <commit_before># -*- coding: utf-8 -*-
"""
testfixtures.seating
~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from byceps.services.seating.models.seat_group import SeatGroup
def create_seat_group(party_id, seat_category, title, *, seat_quantity... |
b3c2a47b049f97de0367f012fb35d247f2f1510b | oscar/apps/offer/managers.py | oscar/apps/offer/managers.py | from django.utils.timezone import now
from django.db import models
class ActiveOfferManager(models.Manager):
"""
For searching/creating offers within their date range
"""
def get_query_set(self):
cutoff = now()
return super(ActiveOfferManager, self).get_query_set().filter(
... | from django.utils.timezone import now
from django.db import models
class ActiveOfferManager(models.Manager):
"""
For searching/creating offers within their date range
"""
def get_query_set(self):
cutoff = now()
return super(ActiveOfferManager, self).get_query_set().filter(
... | Fix bug in offer manager with new datetimes | Fix bug in offer manager with new datetimes
| Python | bsd-3-clause | rocopartners/django-oscar,WadeYuChen/django-oscar,sonofatailor/django-oscar,josesanch/django-oscar,mexeniz/django-oscar,faratro/django-oscar,michaelkuty/django-oscar,anentropic/django-oscar,jinnykoo/wuyisj,MatthewWilkes/django-oscar,sasha0/django-oscar,jlmadurga/django-oscar,Idematica/django-oscar,okfish/django-oscar,b... | from django.utils.timezone import now
from django.db import models
class ActiveOfferManager(models.Manager):
"""
For searching/creating offers within their date range
"""
def get_query_set(self):
cutoff = now()
return super(ActiveOfferManager, self).get_query_set().filter(
... | from django.utils.timezone import now
from django.db import models
class ActiveOfferManager(models.Manager):
"""
For searching/creating offers within their date range
"""
def get_query_set(self):
cutoff = now()
return super(ActiveOfferManager, self).get_query_set().filter(
... | <commit_before>from django.utils.timezone import now
from django.db import models
class ActiveOfferManager(models.Manager):
"""
For searching/creating offers within their date range
"""
def get_query_set(self):
cutoff = now()
return super(ActiveOfferManager, self).get_query_set().filt... | from django.utils.timezone import now
from django.db import models
class ActiveOfferManager(models.Manager):
"""
For searching/creating offers within their date range
"""
def get_query_set(self):
cutoff = now()
return super(ActiveOfferManager, self).get_query_set().filter(
... | from django.utils.timezone import now
from django.db import models
class ActiveOfferManager(models.Manager):
"""
For searching/creating offers within their date range
"""
def get_query_set(self):
cutoff = now()
return super(ActiveOfferManager, self).get_query_set().filter(
... | <commit_before>from django.utils.timezone import now
from django.db import models
class ActiveOfferManager(models.Manager):
"""
For searching/creating offers within their date range
"""
def get_query_set(self):
cutoff = now()
return super(ActiveOfferManager, self).get_query_set().filt... |
fded6c2f393efb4f8e10afaf450664aa63d87a27 | imbox/query.py | imbox/query.py | import datetime
# TODO - Validate query arguments
IMAP_MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
def format_date(date):
return "%s-%s-%s" % (date.day, IMAP_MONTHS[date.month - 1], date.year)
def build_search_query(**kwargs):
# Parse keyw... | import datetime
# TODO - Validate query arguments
IMAP_MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
def format_date(date):
return "%s-%s-%s" % (date.day, IMAP_MONTHS[date.month - 1], date.year)
def build_search_query(**kwargs):
# Parse keyw... | Add support for searching subject | Add support for searching subject
| Python | mit | martinrusev/imbox,eliangcs/imbox,doismellburning/imbox,amuzhou/imbox,johnbaldwin/imbox | import datetime
# TODO - Validate query arguments
IMAP_MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
def format_date(date):
return "%s-%s-%s" % (date.day, IMAP_MONTHS[date.month - 1], date.year)
def build_search_query(**kwargs):
# Parse keyw... | import datetime
# TODO - Validate query arguments
IMAP_MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
def format_date(date):
return "%s-%s-%s" % (date.day, IMAP_MONTHS[date.month - 1], date.year)
def build_search_query(**kwargs):
# Parse keyw... | <commit_before>import datetime
# TODO - Validate query arguments
IMAP_MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
def format_date(date):
return "%s-%s-%s" % (date.day, IMAP_MONTHS[date.month - 1], date.year)
def build_search_query(**kwargs):
... | import datetime
# TODO - Validate query arguments
IMAP_MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
def format_date(date):
return "%s-%s-%s" % (date.day, IMAP_MONTHS[date.month - 1], date.year)
def build_search_query(**kwargs):
# Parse keyw... | import datetime
# TODO - Validate query arguments
IMAP_MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
def format_date(date):
return "%s-%s-%s" % (date.day, IMAP_MONTHS[date.month - 1], date.year)
def build_search_query(**kwargs):
# Parse keyw... | <commit_before>import datetime
# TODO - Validate query arguments
IMAP_MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
def format_date(date):
return "%s-%s-%s" % (date.day, IMAP_MONTHS[date.month - 1], date.year)
def build_search_query(**kwargs):
... |
74816d4af07808009b89163060f97014b1a20ceb | tests/test_arguments.py | tests/test_arguments.py | import unittest
from mock import MagicMock, Mock
from nose.tools import *
from gargoyle.inputs.arguments import *
class BaseArgument(object):
def setUp(self):
self.argument = self.klass(self.valid_comparison_value)
@property
def interface_functions(self):
return ['__lt__', '__le__', '__e... | import unittest
from mock import MagicMock, Mock
from nose.tools import *
from gargoyle.inputs.arguments import *
class BaseArgument(object):
def setUp(self):
self.argument = self.klass(self.valid_comparison_value)
@property
def interface_functions(self):
return ['__lt__', '__le__', '__e... | Enforce that arguments must implement non-zero methods. | Enforce that arguments must implement non-zero methods. | Python | apache-2.0 | disqus/gutter,disqus/gutter,kalail/gutter,kalail/gutter,kalail/gutter | import unittest
from mock import MagicMock, Mock
from nose.tools import *
from gargoyle.inputs.arguments import *
class BaseArgument(object):
def setUp(self):
self.argument = self.klass(self.valid_comparison_value)
@property
def interface_functions(self):
return ['__lt__', '__le__', '__e... | import unittest
from mock import MagicMock, Mock
from nose.tools import *
from gargoyle.inputs.arguments import *
class BaseArgument(object):
def setUp(self):
self.argument = self.klass(self.valid_comparison_value)
@property
def interface_functions(self):
return ['__lt__', '__le__', '__e... | <commit_before>import unittest
from mock import MagicMock, Mock
from nose.tools import *
from gargoyle.inputs.arguments import *
class BaseArgument(object):
def setUp(self):
self.argument = self.klass(self.valid_comparison_value)
@property
def interface_functions(self):
return ['__lt__',... | import unittest
from mock import MagicMock, Mock
from nose.tools import *
from gargoyle.inputs.arguments import *
class BaseArgument(object):
def setUp(self):
self.argument = self.klass(self.valid_comparison_value)
@property
def interface_functions(self):
return ['__lt__', '__le__', '__e... | import unittest
from mock import MagicMock, Mock
from nose.tools import *
from gargoyle.inputs.arguments import *
class BaseArgument(object):
def setUp(self):
self.argument = self.klass(self.valid_comparison_value)
@property
def interface_functions(self):
return ['__lt__', '__le__', '__e... | <commit_before>import unittest
from mock import MagicMock, Mock
from nose.tools import *
from gargoyle.inputs.arguments import *
class BaseArgument(object):
def setUp(self):
self.argument = self.klass(self.valid_comparison_value)
@property
def interface_functions(self):
return ['__lt__',... |
15013c51f602786265b59c1d4a7e894eae090d90 | tests/test_normalize.py | tests/test_normalize.py | from hypothesis import assume, given
from utils import isclose, vectors
@given(v=vectors())
def test_normalize_length(v):
"""v.normalize().length == 1 and v == v.length * v.normalize()"""
assume(v)
assert isclose(v.normalize().length, 1)
assert v.isclose(v.length * v.normalize())
| from hypothesis import assume, given
from utils import isclose, vectors
@given(v=vectors())
def test_normalize_length(v):
"""v.normalize().length == 1 and v == v.length * v.normalize()"""
assume(v)
assert isclose(v.normalize().length, 1)
assert v.isclose(v.length * v.normalize())
@given(v=vectors()... | Test that direction is preserved | tests/normalize: Test that direction is preserved
| Python | artistic-2.0 | ppb/ppb-vector,ppb/ppb-vector | from hypothesis import assume, given
from utils import isclose, vectors
@given(v=vectors())
def test_normalize_length(v):
"""v.normalize().length == 1 and v == v.length * v.normalize()"""
assume(v)
assert isclose(v.normalize().length, 1)
assert v.isclose(v.length * v.normalize())
tests/normalize: Tes... | from hypothesis import assume, given
from utils import isclose, vectors
@given(v=vectors())
def test_normalize_length(v):
"""v.normalize().length == 1 and v == v.length * v.normalize()"""
assume(v)
assert isclose(v.normalize().length, 1)
assert v.isclose(v.length * v.normalize())
@given(v=vectors()... | <commit_before>from hypothesis import assume, given
from utils import isclose, vectors
@given(v=vectors())
def test_normalize_length(v):
"""v.normalize().length == 1 and v == v.length * v.normalize()"""
assume(v)
assert isclose(v.normalize().length, 1)
assert v.isclose(v.length * v.normalize())
<comm... | from hypothesis import assume, given
from utils import isclose, vectors
@given(v=vectors())
def test_normalize_length(v):
"""v.normalize().length == 1 and v == v.length * v.normalize()"""
assume(v)
assert isclose(v.normalize().length, 1)
assert v.isclose(v.length * v.normalize())
@given(v=vectors()... | from hypothesis import assume, given
from utils import isclose, vectors
@given(v=vectors())
def test_normalize_length(v):
"""v.normalize().length == 1 and v == v.length * v.normalize()"""
assume(v)
assert isclose(v.normalize().length, 1)
assert v.isclose(v.length * v.normalize())
tests/normalize: Tes... | <commit_before>from hypothesis import assume, given
from utils import isclose, vectors
@given(v=vectors())
def test_normalize_length(v):
"""v.normalize().length == 1 and v == v.length * v.normalize()"""
assume(v)
assert isclose(v.normalize().length, 1)
assert v.isclose(v.length * v.normalize())
<comm... |
311b32f3c324d026181aa1718a7dd8c099d2e4b4 | tests/test_resultset.py | tests/test_resultset.py | from .config import TweepyTestCase
from tweepy.models import ResultSet
class NoIdItem: pass
class IdItem:
def __init__(self, id):
self.id = id
ids_fixture = [1, 10, 8, 50, 2, 100, 5]
class TweepyResultSetTests(TweepyTestCase):
def setUp(self):
self.results = ResultSet()
for i in ids... | from .config import TweepyTestCase
from tweepy.models import ResultSet
class NoIdItem:
pass
class IdItem:
def __init__(self, id):
self.id = id
ids_fixture = [1, 10, 8, 50, 2, 100, 5]
class TweepyResultSetTests(TweepyTestCase):
def setUp(self):
self.results = ResultSet()
for i in... | Improve formatting for NoIdItem in ResultSet tests | Improve formatting for NoIdItem in ResultSet tests
| Python | mit | tweepy/tweepy,svven/tweepy | from .config import TweepyTestCase
from tweepy.models import ResultSet
class NoIdItem: pass
class IdItem:
def __init__(self, id):
self.id = id
ids_fixture = [1, 10, 8, 50, 2, 100, 5]
class TweepyResultSetTests(TweepyTestCase):
def setUp(self):
self.results = ResultSet()
for i in ids... | from .config import TweepyTestCase
from tweepy.models import ResultSet
class NoIdItem:
pass
class IdItem:
def __init__(self, id):
self.id = id
ids_fixture = [1, 10, 8, 50, 2, 100, 5]
class TweepyResultSetTests(TweepyTestCase):
def setUp(self):
self.results = ResultSet()
for i in... | <commit_before>from .config import TweepyTestCase
from tweepy.models import ResultSet
class NoIdItem: pass
class IdItem:
def __init__(self, id):
self.id = id
ids_fixture = [1, 10, 8, 50, 2, 100, 5]
class TweepyResultSetTests(TweepyTestCase):
def setUp(self):
self.results = ResultSet()
... | from .config import TweepyTestCase
from tweepy.models import ResultSet
class NoIdItem:
pass
class IdItem:
def __init__(self, id):
self.id = id
ids_fixture = [1, 10, 8, 50, 2, 100, 5]
class TweepyResultSetTests(TweepyTestCase):
def setUp(self):
self.results = ResultSet()
for i in... | from .config import TweepyTestCase
from tweepy.models import ResultSet
class NoIdItem: pass
class IdItem:
def __init__(self, id):
self.id = id
ids_fixture = [1, 10, 8, 50, 2, 100, 5]
class TweepyResultSetTests(TweepyTestCase):
def setUp(self):
self.results = ResultSet()
for i in ids... | <commit_before>from .config import TweepyTestCase
from tweepy.models import ResultSet
class NoIdItem: pass
class IdItem:
def __init__(self, id):
self.id = id
ids_fixture = [1, 10, 8, 50, 2, 100, 5]
class TweepyResultSetTests(TweepyTestCase):
def setUp(self):
self.results = ResultSet()
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.