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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8774517714c8c8a7f7a2be9316a23497adfa9f59 | pi_gpio/urls.py | pi_gpio/urls.py | from pi_gpio import app, socketio
from flask.ext import restful
from flask import render_template
from handlers import PinList, PinDetail
api = restful.Api(app)
api.add_resource(PinList, '/api/v1/pin')
api.add_resource(PinDetail, '/api/v1/pin/<string:pin_num>')
import RPi.GPIO as GPIO
def event_callback(pin):
... | from pi_gpio import app, socketio
from flask.ext import restful
from flask import render_template
from handlers import PinList, PinDetail
from events import PinEventManager
api = restful.Api(app)
api.add_resource(PinList, '/api/v1/pin')
api.add_resource(PinDetail, '/api/v1/pin/<string:pin_num>')
@app.route('/', def... | Call event manager in index route | Call event manager in index route
| Python | mit | projectweekend/Pi-GPIO-Server,projectweekend/Pi-GPIO-Server,thijstriemstra/Pi-GPIO-Server,thijstriemstra/Pi-GPIO-Server,projectweekend/Pi-GPIO-Server,thijstriemstra/Pi-GPIO-Server,thijstriemstra/Pi-GPIO-Server,projectweekend/Pi-GPIO-Server | from pi_gpio import app, socketio
from flask.ext import restful
from flask import render_template
from handlers import PinList, PinDetail
api = restful.Api(app)
api.add_resource(PinList, '/api/v1/pin')
api.add_resource(PinDetail, '/api/v1/pin/<string:pin_num>')
import RPi.GPIO as GPIO
def event_callback(pin):
... | from pi_gpio import app, socketio
from flask.ext import restful
from flask import render_template
from handlers import PinList, PinDetail
from events import PinEventManager
api = restful.Api(app)
api.add_resource(PinList, '/api/v1/pin')
api.add_resource(PinDetail, '/api/v1/pin/<string:pin_num>')
@app.route('/', def... | <commit_before>from pi_gpio import app, socketio
from flask.ext import restful
from flask import render_template
from handlers import PinList, PinDetail
api = restful.Api(app)
api.add_resource(PinList, '/api/v1/pin')
api.add_resource(PinDetail, '/api/v1/pin/<string:pin_num>')
import RPi.GPIO as GPIO
def event_call... | from pi_gpio import app, socketio
from flask.ext import restful
from flask import render_template
from handlers import PinList, PinDetail
from events import PinEventManager
api = restful.Api(app)
api.add_resource(PinList, '/api/v1/pin')
api.add_resource(PinDetail, '/api/v1/pin/<string:pin_num>')
@app.route('/', def... | from pi_gpio import app, socketio
from flask.ext import restful
from flask import render_template
from handlers import PinList, PinDetail
api = restful.Api(app)
api.add_resource(PinList, '/api/v1/pin')
api.add_resource(PinDetail, '/api/v1/pin/<string:pin_num>')
import RPi.GPIO as GPIO
def event_callback(pin):
... | <commit_before>from pi_gpio import app, socketio
from flask.ext import restful
from flask import render_template
from handlers import PinList, PinDetail
api = restful.Api(app)
api.add_resource(PinList, '/api/v1/pin')
api.add_resource(PinDetail, '/api/v1/pin/<string:pin_num>')
import RPi.GPIO as GPIO
def event_call... |
5a36bfb8bb8eceab57203387072f3bf492b2a418 | src/onixcheck/exeptions.py | src/onixcheck/exeptions.py | # -*- coding: utf-8 -*-
class OnixError(Exception):
pass
| # -*- coding: utf-8 -*-
import logging
class OnixError(Exception):
pass
class NullHandler(logging.Handler):
"""Not in python 2.6 so we use our own"""
def emit(self, record):
pass
def get_logger(logger_name='onixcheck', add_null_handler=True):
logger = logging.getLogger(logger_name)
if... | Add NullHandler to silence errors when logging without configuration | Add NullHandler to silence errors when logging without configuration
| Python | bsd-2-clause | titusz/onixcheck | # -*- coding: utf-8 -*-
class OnixError(Exception):
pass
Add NullHandler to silence errors when logging without configuration | # -*- coding: utf-8 -*-
import logging
class OnixError(Exception):
pass
class NullHandler(logging.Handler):
"""Not in python 2.6 so we use our own"""
def emit(self, record):
pass
def get_logger(logger_name='onixcheck', add_null_handler=True):
logger = logging.getLogger(logger_name)
if... | <commit_before># -*- coding: utf-8 -*-
class OnixError(Exception):
pass
<commit_msg>Add NullHandler to silence errors when logging without configuration<commit_after> | # -*- coding: utf-8 -*-
import logging
class OnixError(Exception):
pass
class NullHandler(logging.Handler):
"""Not in python 2.6 so we use our own"""
def emit(self, record):
pass
def get_logger(logger_name='onixcheck', add_null_handler=True):
logger = logging.getLogger(logger_name)
if... | # -*- coding: utf-8 -*-
class OnixError(Exception):
pass
Add NullHandler to silence errors when logging without configuration# -*- coding: utf-8 -*-
import logging
class OnixError(Exception):
pass
class NullHandler(logging.Handler):
"""Not in python 2.6 so we use our own"""
def emit(self, record)... | <commit_before># -*- coding: utf-8 -*-
class OnixError(Exception):
pass
<commit_msg>Add NullHandler to silence errors when logging without configuration<commit_after># -*- coding: utf-8 -*-
import logging
class OnixError(Exception):
pass
class NullHandler(logging.Handler):
"""Not in python 2.6 so we u... |
8ab254490dac4f4ebfed1f43d615c321b5890e29 | xmlrpclib_to/__init__.py | xmlrpclib_to/__init__.py | try:
import xmlrpclib
from xmlrpclib import *
except ImportError:
# Python 3.0 portability fix...
import xmlrpc.client as xmlrpclib
from xmlrpc.client import *
import httplib
import socket
class ServerProxy(xmlrpclib.ServerProxy):
def __init__(self, uri, transport=None, encoding=None, verbos... | try:
import xmlrpclib
from xmlrpclib import *
except ImportError:
# Python 3.0 portability fix...
import xmlrpc.client as xmlrpclib
from xmlrpc.client import *
import httplib
import socket
class ServerProxy(xmlrpclib.ServerProxy):
def __init__(self, uri, transport=None, encoding=None, verbos... | FIX working with HTTPS correctly | FIX working with HTTPS correctly
| Python | mit | gisce/xmlrpclib-to | try:
import xmlrpclib
from xmlrpclib import *
except ImportError:
# Python 3.0 portability fix...
import xmlrpc.client as xmlrpclib
from xmlrpc.client import *
import httplib
import socket
class ServerProxy(xmlrpclib.ServerProxy):
def __init__(self, uri, transport=None, encoding=None, verbos... | try:
import xmlrpclib
from xmlrpclib import *
except ImportError:
# Python 3.0 portability fix...
import xmlrpc.client as xmlrpclib
from xmlrpc.client import *
import httplib
import socket
class ServerProxy(xmlrpclib.ServerProxy):
def __init__(self, uri, transport=None, encoding=None, verbos... | <commit_before>try:
import xmlrpclib
from xmlrpclib import *
except ImportError:
# Python 3.0 portability fix...
import xmlrpc.client as xmlrpclib
from xmlrpc.client import *
import httplib
import socket
class ServerProxy(xmlrpclib.ServerProxy):
def __init__(self, uri, transport=None, encodi... | try:
import xmlrpclib
from xmlrpclib import *
except ImportError:
# Python 3.0 portability fix...
import xmlrpc.client as xmlrpclib
from xmlrpc.client import *
import httplib
import socket
class ServerProxy(xmlrpclib.ServerProxy):
def __init__(self, uri, transport=None, encoding=None, verbos... | try:
import xmlrpclib
from xmlrpclib import *
except ImportError:
# Python 3.0 portability fix...
import xmlrpc.client as xmlrpclib
from xmlrpc.client import *
import httplib
import socket
class ServerProxy(xmlrpclib.ServerProxy):
def __init__(self, uri, transport=None, encoding=None, verbos... | <commit_before>try:
import xmlrpclib
from xmlrpclib import *
except ImportError:
# Python 3.0 portability fix...
import xmlrpc.client as xmlrpclib
from xmlrpc.client import *
import httplib
import socket
class ServerProxy(xmlrpclib.ServerProxy):
def __init__(self, uri, transport=None, encodi... |
4348927a9ed5bdcbf0284086103e927f45091e15 | saau/utils/header.py | saau/utils/header.py | import numpy as np
from lxml.etree import fromstring, XMLSyntaxError
def parse_lines(lines):
for line in lines:
try:
xml_line = fromstring(line.encode('utf-8'))
except XMLSyntaxError:
attrs = []
else:
attrs = [thing.tag for thing in xml_line.getiterator(... | import numpy as np
from lxml.etree import fromstring, XMLSyntaxError
def parse_lines(lines):
for line in lines:
try:
xml_line = fromstring(line.encode('utf-8'))
except XMLSyntaxError:
attrs = []
else:
attrs = [thing.tag for thing in xml_line.getiterator(... | Clean up y index generation | Clean up y index generation
| Python | mit | Mause/statistical_atlas_of_au | import numpy as np
from lxml.etree import fromstring, XMLSyntaxError
def parse_lines(lines):
for line in lines:
try:
xml_line = fromstring(line.encode('utf-8'))
except XMLSyntaxError:
attrs = []
else:
attrs = [thing.tag for thing in xml_line.getiterator(... | import numpy as np
from lxml.etree import fromstring, XMLSyntaxError
def parse_lines(lines):
for line in lines:
try:
xml_line = fromstring(line.encode('utf-8'))
except XMLSyntaxError:
attrs = []
else:
attrs = [thing.tag for thing in xml_line.getiterator(... | <commit_before>import numpy as np
from lxml.etree import fromstring, XMLSyntaxError
def parse_lines(lines):
for line in lines:
try:
xml_line = fromstring(line.encode('utf-8'))
except XMLSyntaxError:
attrs = []
else:
attrs = [thing.tag for thing in xml_li... | import numpy as np
from lxml.etree import fromstring, XMLSyntaxError
def parse_lines(lines):
for line in lines:
try:
xml_line = fromstring(line.encode('utf-8'))
except XMLSyntaxError:
attrs = []
else:
attrs = [thing.tag for thing in xml_line.getiterator(... | import numpy as np
from lxml.etree import fromstring, XMLSyntaxError
def parse_lines(lines):
for line in lines:
try:
xml_line = fromstring(line.encode('utf-8'))
except XMLSyntaxError:
attrs = []
else:
attrs = [thing.tag for thing in xml_line.getiterator(... | <commit_before>import numpy as np
from lxml.etree import fromstring, XMLSyntaxError
def parse_lines(lines):
for line in lines:
try:
xml_line = fromstring(line.encode('utf-8'))
except XMLSyntaxError:
attrs = []
else:
attrs = [thing.tag for thing in xml_li... |
ebd6d12ca16003e771a7015505be1b42d96483a3 | roles/gvl.commandline-utilities/templates/jupyterhub_config.py | roles/gvl.commandline-utilities/templates/jupyterhub_config.py | # Configuration file for jupyterhub.
#------------------------------------------------------------------------------
# Configurable configuration
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# JupyterHub... | # Configuration file for jupyterhub.
#------------------------------------------------------------------------------
# Configurable configuration
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# JupyterHub... | Set log level to 'WARN' | Set log level to 'WARN' | Python | mit | gvlproject/gvl_commandline_utilities,nuwang/gvl_commandline_utilities,claresloggett/gvl_commandline_utilities,nuwang/gvl_commandline_utilities,claresloggett/gvl_commandline_utilities,gvlproject/gvl_commandline_utilities | # Configuration file for jupyterhub.
#------------------------------------------------------------------------------
# Configurable configuration
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# JupyterHub... | # Configuration file for jupyterhub.
#------------------------------------------------------------------------------
# Configurable configuration
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# JupyterHub... | <commit_before># Configuration file for jupyterhub.
#------------------------------------------------------------------------------
# Configurable configuration
#------------------------------------------------------------------------------
#----------------------------------------------------------------------------... | # Configuration file for jupyterhub.
#------------------------------------------------------------------------------
# Configurable configuration
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# JupyterHub... | # Configuration file for jupyterhub.
#------------------------------------------------------------------------------
# Configurable configuration
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# JupyterHub... | <commit_before># Configuration file for jupyterhub.
#------------------------------------------------------------------------------
# Configurable configuration
#------------------------------------------------------------------------------
#----------------------------------------------------------------------------... |
9676024c92348ed52c78620f2a8b0b4cd104430d | location.py | location.py | # -*- coding: utf-8 -*-
"""
location.py
"""
from trytond.pool import PoolMeta
from trytond.model import fields
from trytond.pyson import Eval
__all__ = ['Location']
__metaclass__ = PoolMeta
class Location:
__name__ = "stock.location"
return_address = fields.Many2One(
"party.address", "Return Ad... | # -*- coding: utf-8 -*-
"""
location.py
"""
from trytond.pool import PoolMeta
from trytond.model import fields
from trytond.pyson import Eval
__all__ = ['Location']
__metaclass__ = PoolMeta
class Location:
__name__ = "stock.location"
return_address = fields.Many2One(
"party.address", "Return Ad... | Rename help text of return address field | Rename help text of return address field
| Python | bsd-3-clause | joeirimpan/trytond-shipping,trytonus/trytond-shipping,fulfilio/trytond-shipping,prakashpp/trytond-shipping,tarunbhardwaj/trytond-shipping | # -*- coding: utf-8 -*-
"""
location.py
"""
from trytond.pool import PoolMeta
from trytond.model import fields
from trytond.pyson import Eval
__all__ = ['Location']
__metaclass__ = PoolMeta
class Location:
__name__ = "stock.location"
return_address = fields.Many2One(
"party.address", "Return Ad... | # -*- coding: utf-8 -*-
"""
location.py
"""
from trytond.pool import PoolMeta
from trytond.model import fields
from trytond.pyson import Eval
__all__ = ['Location']
__metaclass__ = PoolMeta
class Location:
__name__ = "stock.location"
return_address = fields.Many2One(
"party.address", "Return Ad... | <commit_before># -*- coding: utf-8 -*-
"""
location.py
"""
from trytond.pool import PoolMeta
from trytond.model import fields
from trytond.pyson import Eval
__all__ = ['Location']
__metaclass__ = PoolMeta
class Location:
__name__ = "stock.location"
return_address = fields.Many2One(
"party.addre... | # -*- coding: utf-8 -*-
"""
location.py
"""
from trytond.pool import PoolMeta
from trytond.model import fields
from trytond.pyson import Eval
__all__ = ['Location']
__metaclass__ = PoolMeta
class Location:
__name__ = "stock.location"
return_address = fields.Many2One(
"party.address", "Return Ad... | # -*- coding: utf-8 -*-
"""
location.py
"""
from trytond.pool import PoolMeta
from trytond.model import fields
from trytond.pyson import Eval
__all__ = ['Location']
__metaclass__ = PoolMeta
class Location:
__name__ = "stock.location"
return_address = fields.Many2One(
"party.address", "Return Ad... | <commit_before># -*- coding: utf-8 -*-
"""
location.py
"""
from trytond.pool import PoolMeta
from trytond.model import fields
from trytond.pyson import Eval
__all__ = ['Location']
__metaclass__ = PoolMeta
class Location:
__name__ = "stock.location"
return_address = fields.Many2One(
"party.addre... |
1b58d032fc04b4791bae1448f031dde87bc4766e | flow/configuration/parser.py | flow/configuration/parser.py | import argparse
def create_parser(valid_command_names):
parser = argparse.ArgumentParser()
parser.add_argument('command', choices=valid_command_names)
return parser
def parse_arguments(command_class):
parser = create_parser([command_class._name])
command_class.annotate_parser(parser)
retu... | import argparse
def create_parser(valid_command_names):
parser = argparse.ArgumentParser()
parser.add_argument('command', choices=valid_command_names)
return parser
def parse_arguments(command_class):
parser = create_parser([command_class.name])
command_class.annotate_parser(parser)
retur... | Fix command_class _name to name | Fix command_class _name to name
| Python | agpl-3.0 | genome/flow-core,genome/flow-core,genome/flow-core | import argparse
def create_parser(valid_command_names):
parser = argparse.ArgumentParser()
parser.add_argument('command', choices=valid_command_names)
return parser
def parse_arguments(command_class):
parser = create_parser([command_class._name])
command_class.annotate_parser(parser)
retu... | import argparse
def create_parser(valid_command_names):
parser = argparse.ArgumentParser()
parser.add_argument('command', choices=valid_command_names)
return parser
def parse_arguments(command_class):
parser = create_parser([command_class.name])
command_class.annotate_parser(parser)
retur... | <commit_before>import argparse
def create_parser(valid_command_names):
parser = argparse.ArgumentParser()
parser.add_argument('command', choices=valid_command_names)
return parser
def parse_arguments(command_class):
parser = create_parser([command_class._name])
command_class.annotate_parser(pa... | import argparse
def create_parser(valid_command_names):
parser = argparse.ArgumentParser()
parser.add_argument('command', choices=valid_command_names)
return parser
def parse_arguments(command_class):
parser = create_parser([command_class.name])
command_class.annotate_parser(parser)
retur... | import argparse
def create_parser(valid_command_names):
parser = argparse.ArgumentParser()
parser.add_argument('command', choices=valid_command_names)
return parser
def parse_arguments(command_class):
parser = create_parser([command_class._name])
command_class.annotate_parser(parser)
retu... | <commit_before>import argparse
def create_parser(valid_command_names):
parser = argparse.ArgumentParser()
parser.add_argument('command', choices=valid_command_names)
return parser
def parse_arguments(command_class):
parser = create_parser([command_class._name])
command_class.annotate_parser(pa... |
783948e6d5ce9f4a8cbdbecd4731615381ca89c0 | scripts/set_alpha.py | scripts/set_alpha.py | #!/usr/bin/env python
import sys
alpha_deg = sys.argv[1]
with open("system/fvOptions", "w") as f:
with open("system/fvOptions.template") as template:
txt = template.read()
f.write(txt.format(alpha_deg=alpha_deg))
| #!/usr/bin/env python
import sys
if len(sys.argv) > 1:
alpha_deg = sys.argv[1]
else:
alpha_deg = 4.0
with open("system/fvOptions", "w") as f:
with open("system/fvOptions.template") as template:
txt = template.read()
f.write(txt.format(alpha_deg=alpha_deg))
| Add a default angle of attack | Add a default angle of attack
| Python | mit | petebachant/actuatorLine-2D-turbinesFoam,petebachant/actuatorLine-2D-turbinesFoam,petebachant/actuatorLine-2D-turbinesFoam | #!/usr/bin/env python
import sys
alpha_deg = sys.argv[1]
with open("system/fvOptions", "w") as f:
with open("system/fvOptions.template") as template:
txt = template.read()
f.write(txt.format(alpha_deg=alpha_deg))
Add a default angle of attack | #!/usr/bin/env python
import sys
if len(sys.argv) > 1:
alpha_deg = sys.argv[1]
else:
alpha_deg = 4.0
with open("system/fvOptions", "w") as f:
with open("system/fvOptions.template") as template:
txt = template.read()
f.write(txt.format(alpha_deg=alpha_deg))
| <commit_before>#!/usr/bin/env python
import sys
alpha_deg = sys.argv[1]
with open("system/fvOptions", "w") as f:
with open("system/fvOptions.template") as template:
txt = template.read()
f.write(txt.format(alpha_deg=alpha_deg))
<commit_msg>Add a default angle of attack<commit_after> | #!/usr/bin/env python
import sys
if len(sys.argv) > 1:
alpha_deg = sys.argv[1]
else:
alpha_deg = 4.0
with open("system/fvOptions", "w") as f:
with open("system/fvOptions.template") as template:
txt = template.read()
f.write(txt.format(alpha_deg=alpha_deg))
| #!/usr/bin/env python
import sys
alpha_deg = sys.argv[1]
with open("system/fvOptions", "w") as f:
with open("system/fvOptions.template") as template:
txt = template.read()
f.write(txt.format(alpha_deg=alpha_deg))
Add a default angle of attack#!/usr/bin/env python
import sys
if len(sys.argv) > 1:
... | <commit_before>#!/usr/bin/env python
import sys
alpha_deg = sys.argv[1]
with open("system/fvOptions", "w") as f:
with open("system/fvOptions.template") as template:
txt = template.read()
f.write(txt.format(alpha_deg=alpha_deg))
<commit_msg>Add a default angle of attack<commit_after>#!/usr/bin/env pyt... |
a7b92bdbb4c71a33896105022e70c69c3bc33861 | patterns/gradient.py | patterns/gradient.py | from blinkytape import color
class Gradient(object):
def __init__(self, pixel_count, start_color, end_color):
self._pixels = self._rgb_gradient(pixel_count, start_color, end_color)
@property
def pixels(self):
return list(self._pixels)
def _rgb_gradient(self, pixel_count, start_color, ... | from blinkytape import color
class Gradient(object):
# TBD: If this had a length it would also work as a streak; consider
def __init__(self, pixel_count, start_color, end_color):
self._pixels = self._rgb_gradient(pixel_count, start_color, end_color)
@property
def pixels(self):
return l... | Add another TBD for future reference | Add another TBD for future reference
| Python | mit | jonspeicher/blinkyfun | from blinkytape import color
class Gradient(object):
def __init__(self, pixel_count, start_color, end_color):
self._pixels = self._rgb_gradient(pixel_count, start_color, end_color)
@property
def pixels(self):
return list(self._pixels)
def _rgb_gradient(self, pixel_count, start_color, ... | from blinkytape import color
class Gradient(object):
# TBD: If this had a length it would also work as a streak; consider
def __init__(self, pixel_count, start_color, end_color):
self._pixels = self._rgb_gradient(pixel_count, start_color, end_color)
@property
def pixels(self):
return l... | <commit_before>from blinkytape import color
class Gradient(object):
def __init__(self, pixel_count, start_color, end_color):
self._pixels = self._rgb_gradient(pixel_count, start_color, end_color)
@property
def pixels(self):
return list(self._pixels)
def _rgb_gradient(self, pixel_count... | from blinkytape import color
class Gradient(object):
# TBD: If this had a length it would also work as a streak; consider
def __init__(self, pixel_count, start_color, end_color):
self._pixels = self._rgb_gradient(pixel_count, start_color, end_color)
@property
def pixels(self):
return l... | from blinkytape import color
class Gradient(object):
def __init__(self, pixel_count, start_color, end_color):
self._pixels = self._rgb_gradient(pixel_count, start_color, end_color)
@property
def pixels(self):
return list(self._pixels)
def _rgb_gradient(self, pixel_count, start_color, ... | <commit_before>from blinkytape import color
class Gradient(object):
def __init__(self, pixel_count, start_color, end_color):
self._pixels = self._rgb_gradient(pixel_count, start_color, end_color)
@property
def pixels(self):
return list(self._pixels)
def _rgb_gradient(self, pixel_count... |
d1a8f9c5423bf78ff59c6a439f21148d29da1caa | server/proxy_util.py | server/proxy_util.py | #!/usr/bin/env python
import datetime
import json
import logging
import urllib2
class HarManager(object):
def __init__(self, args):
self._logger = logging.getLogger('kcaa.proxy_util')
self.pageref = 1
proxy_root = 'http://{}/proxy/{}'.format(args.proxy_controller,
... | #!/usr/bin/env python
import datetime
import logging
import requests
class HarManager(object):
def __init__(self, args):
self._logger = logging.getLogger('kcaa.proxy_util')
self.pageref = 1
proxy_root = 'http://{}/proxy/{}'.format(args.proxy_controller,
... | Support creating a next page, retrieve only the current page, and delete the current page and move to the next one. Switch to requests library for PUT and DELETE methods. | Support creating a next page, retrieve only the current page, and delete
the current page and move to the next one.
Switch to requests library for PUT and DELETE methods.
| Python | apache-2.0 | kcaa/kcaa,kcaa/kcaa,kcaa/kcaa,kcaa/kcaa | #!/usr/bin/env python
import datetime
import json
import logging
import urllib2
class HarManager(object):
def __init__(self, args):
self._logger = logging.getLogger('kcaa.proxy_util')
self.pageref = 1
proxy_root = 'http://{}/proxy/{}'.format(args.proxy_controller,
... | #!/usr/bin/env python
import datetime
import logging
import requests
class HarManager(object):
def __init__(self, args):
self._logger = logging.getLogger('kcaa.proxy_util')
self.pageref = 1
proxy_root = 'http://{}/proxy/{}'.format(args.proxy_controller,
... | <commit_before>#!/usr/bin/env python
import datetime
import json
import logging
import urllib2
class HarManager(object):
def __init__(self, args):
self._logger = logging.getLogger('kcaa.proxy_util')
self.pageref = 1
proxy_root = 'http://{}/proxy/{}'.format(args.proxy_controller,
... | #!/usr/bin/env python
import datetime
import logging
import requests
class HarManager(object):
def __init__(self, args):
self._logger = logging.getLogger('kcaa.proxy_util')
self.pageref = 1
proxy_root = 'http://{}/proxy/{}'.format(args.proxy_controller,
... | #!/usr/bin/env python
import datetime
import json
import logging
import urllib2
class HarManager(object):
def __init__(self, args):
self._logger = logging.getLogger('kcaa.proxy_util')
self.pageref = 1
proxy_root = 'http://{}/proxy/{}'.format(args.proxy_controller,
... | <commit_before>#!/usr/bin/env python
import datetime
import json
import logging
import urllib2
class HarManager(object):
def __init__(self, args):
self._logger = logging.getLogger('kcaa.proxy_util')
self.pageref = 1
proxy_root = 'http://{}/proxy/{}'.format(args.proxy_controller,
... |
9e9910346f7bacdc2a4fc2e92ecb8237bf38275e | plumbium/environment.py | plumbium/environment.py | """
plumbium.environment
====================
Module containing the get_environment function.
"""
import os
try:
import pip
except ImportError:
pass
import socket
def get_environment():
"""Obtain information about the executing environment.
Captures:
* installed Python packages using pip (i... | """
plumbium.environment
====================
Module containing the get_environment function.
"""
import os
try:
import pip
except ImportError:
pass
import socket
def get_environment():
"""Obtain information about the executing environment.
Captures:
* installed Python packages using pip (i... | Stop pylint complaining about bare-except | Stop pylint complaining about bare-except
| Python | mit | jstutters/Plumbium | """
plumbium.environment
====================
Module containing the get_environment function.
"""
import os
try:
import pip
except ImportError:
pass
import socket
def get_environment():
"""Obtain information about the executing environment.
Captures:
* installed Python packages using pip (i... | """
plumbium.environment
====================
Module containing the get_environment function.
"""
import os
try:
import pip
except ImportError:
pass
import socket
def get_environment():
"""Obtain information about the executing environment.
Captures:
* installed Python packages using pip (i... | <commit_before>"""
plumbium.environment
====================
Module containing the get_environment function.
"""
import os
try:
import pip
except ImportError:
pass
import socket
def get_environment():
"""Obtain information about the executing environment.
Captures:
* installed Python packag... | """
plumbium.environment
====================
Module containing the get_environment function.
"""
import os
try:
import pip
except ImportError:
pass
import socket
def get_environment():
"""Obtain information about the executing environment.
Captures:
* installed Python packages using pip (i... | """
plumbium.environment
====================
Module containing the get_environment function.
"""
import os
try:
import pip
except ImportError:
pass
import socket
def get_environment():
"""Obtain information about the executing environment.
Captures:
* installed Python packages using pip (i... | <commit_before>"""
plumbium.environment
====================
Module containing the get_environment function.
"""
import os
try:
import pip
except ImportError:
pass
import socket
def get_environment():
"""Obtain information about the executing environment.
Captures:
* installed Python packag... |
ed5dcd72b661878913be224d641c5595c73ef049 | tests/test_auditory.py | tests/test_auditory.py | from __future__ import division, print_function
import pytest
import numpy as np
from pambox import auditory as aud
import scipy.io as sio
from numpy.testing import assert_allclose
def test_lowpass_filtering_of_envelope():
mat = sio.loadmat("./test_files/test_hilbert_env_and_lp_filtering_v1.mat",
... | from __future__ import division, print_function
import pytest
import numpy as np
from pambox import auditory as aud
import scipy.io as sio
from numpy.testing import assert_allclose
def test_lowpass_filtering_of_envelope():
mat = sio.loadmat("./test_files/test_hilbert_env_and_lp_filtering_v1.mat",
... | Test of the erb calculation | Test of the erb calculation
| Python | bsd-3-clause | achabotl/pambox | from __future__ import division, print_function
import pytest
import numpy as np
from pambox import auditory as aud
import scipy.io as sio
from numpy.testing import assert_allclose
def test_lowpass_filtering_of_envelope():
mat = sio.loadmat("./test_files/test_hilbert_env_and_lp_filtering_v1.mat",
... | from __future__ import division, print_function
import pytest
import numpy as np
from pambox import auditory as aud
import scipy.io as sio
from numpy.testing import assert_allclose
def test_lowpass_filtering_of_envelope():
mat = sio.loadmat("./test_files/test_hilbert_env_and_lp_filtering_v1.mat",
... | <commit_before>from __future__ import division, print_function
import pytest
import numpy as np
from pambox import auditory as aud
import scipy.io as sio
from numpy.testing import assert_allclose
def test_lowpass_filtering_of_envelope():
mat = sio.loadmat("./test_files/test_hilbert_env_and_lp_filtering_v1.mat",
... | from __future__ import division, print_function
import pytest
import numpy as np
from pambox import auditory as aud
import scipy.io as sio
from numpy.testing import assert_allclose
def test_lowpass_filtering_of_envelope():
mat = sio.loadmat("./test_files/test_hilbert_env_and_lp_filtering_v1.mat",
... | from __future__ import division, print_function
import pytest
import numpy as np
from pambox import auditory as aud
import scipy.io as sio
from numpy.testing import assert_allclose
def test_lowpass_filtering_of_envelope():
mat = sio.loadmat("./test_files/test_hilbert_env_and_lp_filtering_v1.mat",
... | <commit_before>from __future__ import division, print_function
import pytest
import numpy as np
from pambox import auditory as aud
import scipy.io as sio
from numpy.testing import assert_allclose
def test_lowpass_filtering_of_envelope():
mat = sio.loadmat("./test_files/test_hilbert_env_and_lp_filtering_v1.mat",
... |
721f18da4d38ac76171165596bc11e2572c60204 | algebra.py | algebra.py | """
Linear algebra is cool.
"""
import math
def rotation(point, axis, sign=1):
"""
Rotate a point (or vector) about the origin in 3D space.
"""
def Rx(x, y, z, theta):
return (int(x),
int(math.cos(theta) * y - math.sin(theta) * z),
int(math.sin(theta) * y + math... | """
Linear algebra is cool.
"""
import math
def rotation(point, axis, sign=1):
"""
Rotate a point (or vector) about the origin in 3D space.
"""
def Rx(x, y, z, theta):
return (round(x, 1),
round(math.cos(theta) * y - math.sin(theta) * z, 1),
round(math.sin(theta... | Fix bug where vector calculations returned Ints only | Fix bug where vector calculations returned Ints only
| Python | mit | supermitch/clipycube | """
Linear algebra is cool.
"""
import math
def rotation(point, axis, sign=1):
"""
Rotate a point (or vector) about the origin in 3D space.
"""
def Rx(x, y, z, theta):
return (int(x),
int(math.cos(theta) * y - math.sin(theta) * z),
int(math.sin(theta) * y + math... | """
Linear algebra is cool.
"""
import math
def rotation(point, axis, sign=1):
"""
Rotate a point (or vector) about the origin in 3D space.
"""
def Rx(x, y, z, theta):
return (round(x, 1),
round(math.cos(theta) * y - math.sin(theta) * z, 1),
round(math.sin(theta... | <commit_before>"""
Linear algebra is cool.
"""
import math
def rotation(point, axis, sign=1):
"""
Rotate a point (or vector) about the origin in 3D space.
"""
def Rx(x, y, z, theta):
return (int(x),
int(math.cos(theta) * y - math.sin(theta) * z),
int(math.sin(th... | """
Linear algebra is cool.
"""
import math
def rotation(point, axis, sign=1):
"""
Rotate a point (or vector) about the origin in 3D space.
"""
def Rx(x, y, z, theta):
return (round(x, 1),
round(math.cos(theta) * y - math.sin(theta) * z, 1),
round(math.sin(theta... | """
Linear algebra is cool.
"""
import math
def rotation(point, axis, sign=1):
"""
Rotate a point (or vector) about the origin in 3D space.
"""
def Rx(x, y, z, theta):
return (int(x),
int(math.cos(theta) * y - math.sin(theta) * z),
int(math.sin(theta) * y + math... | <commit_before>"""
Linear algebra is cool.
"""
import math
def rotation(point, axis, sign=1):
"""
Rotate a point (or vector) about the origin in 3D space.
"""
def Rx(x, y, z, theta):
return (int(x),
int(math.cos(theta) * y - math.sin(theta) * z),
int(math.sin(th... |
ec1474d9144ead23b335472d6c4623f5e712e88d | run.py | run.py | import os
from horus.apps import create_app
config_file = os.path.join(os.path.dirname(os.path.realpath(__file__))
, 'config.py')
app = create_app(config_file)
if __name__ == '__main__':
app.run(debug=True)
| import os
from horus.apps import create_app
config_file = os.path.join(os.path.dirname(os.path.realpath(__file__))
, 'config.py')
app = create_app(config_file)
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0')
| Set app host to 0.0.0.0 | Set app host to 0.0.0.0
| Python | mit | kxxoling/horus,kxxoling/horus,kxxoling/horus | import os
from horus.apps import create_app
config_file = os.path.join(os.path.dirname(os.path.realpath(__file__))
, 'config.py')
app = create_app(config_file)
if __name__ == '__main__':
app.run(debug=True)
Set app host to 0.0.0.0 | import os
from horus.apps import create_app
config_file = os.path.join(os.path.dirname(os.path.realpath(__file__))
, 'config.py')
app = create_app(config_file)
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0')
| <commit_before>import os
from horus.apps import create_app
config_file = os.path.join(os.path.dirname(os.path.realpath(__file__))
, 'config.py')
app = create_app(config_file)
if __name__ == '__main__':
app.run(debug=True)
<commit_msg>Set app host to 0.0.0.0<commit_after> | import os
from horus.apps import create_app
config_file = os.path.join(os.path.dirname(os.path.realpath(__file__))
, 'config.py')
app = create_app(config_file)
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0')
| import os
from horus.apps import create_app
config_file = os.path.join(os.path.dirname(os.path.realpath(__file__))
, 'config.py')
app = create_app(config_file)
if __name__ == '__main__':
app.run(debug=True)
Set app host to 0.0.0.0import os
from horus.apps import create_app
config_fi... | <commit_before>import os
from horus.apps import create_app
config_file = os.path.join(os.path.dirname(os.path.realpath(__file__))
, 'config.py')
app = create_app(config_file)
if __name__ == '__main__':
app.run(debug=True)
<commit_msg>Set app host to 0.0.0.0<commit_after>import os
from... |
9f82fe03a38d9eaf4ccd22f2ee6d13907bc3b42e | relay_api/api/server.py | relay_api/api/server.py | from flask import Flask, jsonify
server = Flask(__name__)
def get_relays(relays):
return jsonify({"relays": relays}), 200
def get_relay(relays, relay_name):
code = 200
try:
relay = relays[relay_name]
except KeyError:
code = 404
return "", code
return jsonify({"relay": r... | from flask import Flask, jsonify
# import json
server = Flask(__name__)
def __serialize_relay(relays):
if type(relays).__name__ == "relay":
return jsonify({"gpio": relays.gpio,
"NC": relays.nc,
"state": relays.state})
di = {}
for r in relays:
... | Change to get a dict with the relay instances | Change to get a dict with the relay instances
| Python | mit | pahumadad/raspi-relay-api | from flask import Flask, jsonify
server = Flask(__name__)
def get_relays(relays):
return jsonify({"relays": relays}), 200
def get_relay(relays, relay_name):
code = 200
try:
relay = relays[relay_name]
except KeyError:
code = 404
return "", code
return jsonify({"relay": r... | from flask import Flask, jsonify
# import json
server = Flask(__name__)
def __serialize_relay(relays):
if type(relays).__name__ == "relay":
return jsonify({"gpio": relays.gpio,
"NC": relays.nc,
"state": relays.state})
di = {}
for r in relays:
... | <commit_before>from flask import Flask, jsonify
server = Flask(__name__)
def get_relays(relays):
return jsonify({"relays": relays}), 200
def get_relay(relays, relay_name):
code = 200
try:
relay = relays[relay_name]
except KeyError:
code = 404
return "", code
return json... | from flask import Flask, jsonify
# import json
server = Flask(__name__)
def __serialize_relay(relays):
if type(relays).__name__ == "relay":
return jsonify({"gpio": relays.gpio,
"NC": relays.nc,
"state": relays.state})
di = {}
for r in relays:
... | from flask import Flask, jsonify
server = Flask(__name__)
def get_relays(relays):
return jsonify({"relays": relays}), 200
def get_relay(relays, relay_name):
code = 200
try:
relay = relays[relay_name]
except KeyError:
code = 404
return "", code
return jsonify({"relay": r... | <commit_before>from flask import Flask, jsonify
server = Flask(__name__)
def get_relays(relays):
return jsonify({"relays": relays}), 200
def get_relay(relays, relay_name):
code = 200
try:
relay = relays[relay_name]
except KeyError:
code = 404
return "", code
return json... |
967a82011c2a8e154c8386dfd0499dc5cea06da1 | sheldon/bot.py | sheldon/bot.py | # -*- coding: utf-8 -*-
"""
@author: Seva Zhidkov
@contact: zhidkovseva@gmail.com
@license: The MIT license
Copyright (C) 2015
"""
from sheldon.adapter import *
from sheldon.config import *
from sheldon.exceptions import *
from sheldon.manager import *
from sheldon.storage import *
class Sheldon:
"""
Main ... | # -*- coding: utf-8 -*-
"""
@author: Seva Zhidkov
@contact: zhidkovseva@gmail.com
@license: The MIT license
Copyright (C) 2015
"""
from sheldon.adapter import *
from sheldon.config import *
from sheldon.exceptions import *
from sheldon.manager import *
from sheldon.storage import *
from sheldon.utils import logger
... | Add load config function to Sheldon class | Add load config function to Sheldon class
| Python | mit | lises/sheldon | # -*- coding: utf-8 -*-
"""
@author: Seva Zhidkov
@contact: zhidkovseva@gmail.com
@license: The MIT license
Copyright (C) 2015
"""
from sheldon.adapter import *
from sheldon.config import *
from sheldon.exceptions import *
from sheldon.manager import *
from sheldon.storage import *
class Sheldon:
"""
Main ... | # -*- coding: utf-8 -*-
"""
@author: Seva Zhidkov
@contact: zhidkovseva@gmail.com
@license: The MIT license
Copyright (C) 2015
"""
from sheldon.adapter import *
from sheldon.config import *
from sheldon.exceptions import *
from sheldon.manager import *
from sheldon.storage import *
from sheldon.utils import logger
... | <commit_before># -*- coding: utf-8 -*-
"""
@author: Seva Zhidkov
@contact: zhidkovseva@gmail.com
@license: The MIT license
Copyright (C) 2015
"""
from sheldon.adapter import *
from sheldon.config import *
from sheldon.exceptions import *
from sheldon.manager import *
from sheldon.storage import *
class Sheldon:
... | # -*- coding: utf-8 -*-
"""
@author: Seva Zhidkov
@contact: zhidkovseva@gmail.com
@license: The MIT license
Copyright (C) 2015
"""
from sheldon.adapter import *
from sheldon.config import *
from sheldon.exceptions import *
from sheldon.manager import *
from sheldon.storage import *
from sheldon.utils import logger
... | # -*- coding: utf-8 -*-
"""
@author: Seva Zhidkov
@contact: zhidkovseva@gmail.com
@license: The MIT license
Copyright (C) 2015
"""
from sheldon.adapter import *
from sheldon.config import *
from sheldon.exceptions import *
from sheldon.manager import *
from sheldon.storage import *
class Sheldon:
"""
Main ... | <commit_before># -*- coding: utf-8 -*-
"""
@author: Seva Zhidkov
@contact: zhidkovseva@gmail.com
@license: The MIT license
Copyright (C) 2015
"""
from sheldon.adapter import *
from sheldon.config import *
from sheldon.exceptions import *
from sheldon.manager import *
from sheldon.storage import *
class Sheldon:
... |
b07f4997b72702023721786de425533db38b5867 | vsub/urls.py | vsub/urls.py | from django.conf.urls import patterns, include, url
from django.contrib import admin
# See: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#hooking-adminsite-instances-into-your-urlconf
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(... | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.generic import TemplateView
# See: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#hooking-adminsite-instances-into-your-urlconf
admin.auto... | Set the default URL to point to index.html. | Set the default URL to point to index.html.
| Python | mit | PrecisionMojo/pm-www,PrecisionMojo/pm-www | from django.conf.urls import patterns, include, url
from django.contrib import admin
# See: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#hooking-adminsite-instances-into-your-urlconf
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(... | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.generic import TemplateView
# See: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#hooking-adminsite-instances-into-your-urlconf
admin.auto... | <commit_before>from django.conf.urls import patterns, include, url
from django.contrib import admin
# See: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#hooking-adminsite-instances-into-your-urlconf
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/doc/', include('django.contrib.admindocs.ur... | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.generic import TemplateView
# See: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#hooking-adminsite-instances-into-your-urlconf
admin.auto... | from django.conf.urls import patterns, include, url
from django.contrib import admin
# See: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#hooking-adminsite-instances-into-your-urlconf
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(... | <commit_before>from django.conf.urls import patterns, include, url
from django.contrib import admin
# See: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#hooking-adminsite-instances-into-your-urlconf
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/doc/', include('django.contrib.admindocs.ur... |
b8796c355bc8a763dbd2a5b6c5ed88a61f91eab7 | tests/test_conditionals.py | tests/test_conditionals.py | import pytest
from thinglang.runner import run
def test_simple_conditionals():
assert run("""
thing Program
does start
if "dog" eq "dog"
Output.write("dog is dog")
if "dog" eq "cat"
Output.write("dog is cat")
""").output == """dog is dog""".strip()
def test_unc... | import pytest
from thinglang.runner import run
def test_simple_conditionals():
assert run("""
thing Program
does start
if "dog" eq "dog"
Output.write("dog is dog")
if "dog" eq "cat"
Output.write("dog is cat")
""").output == """dog is dog""".strip()
def test_unc... | Update conditional else branch tests | Update conditional else branch tests
| Python | mit | ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang | import pytest
from thinglang.runner import run
def test_simple_conditionals():
assert run("""
thing Program
does start
if "dog" eq "dog"
Output.write("dog is dog")
if "dog" eq "cat"
Output.write("dog is cat")
""").output == """dog is dog""".strip()
def test_unc... | import pytest
from thinglang.runner import run
def test_simple_conditionals():
assert run("""
thing Program
does start
if "dog" eq "dog"
Output.write("dog is dog")
if "dog" eq "cat"
Output.write("dog is cat")
""").output == """dog is dog""".strip()
def test_unc... | <commit_before>import pytest
from thinglang.runner import run
def test_simple_conditionals():
assert run("""
thing Program
does start
if "dog" eq "dog"
Output.write("dog is dog")
if "dog" eq "cat"
Output.write("dog is cat")
""").output == """dog is dog""".strip()... | import pytest
from thinglang.runner import run
def test_simple_conditionals():
assert run("""
thing Program
does start
if "dog" eq "dog"
Output.write("dog is dog")
if "dog" eq "cat"
Output.write("dog is cat")
""").output == """dog is dog""".strip()
def test_unc... | import pytest
from thinglang.runner import run
def test_simple_conditionals():
assert run("""
thing Program
does start
if "dog" eq "dog"
Output.write("dog is dog")
if "dog" eq "cat"
Output.write("dog is cat")
""").output == """dog is dog""".strip()
def test_unc... | <commit_before>import pytest
from thinglang.runner import run
def test_simple_conditionals():
assert run("""
thing Program
does start
if "dog" eq "dog"
Output.write("dog is dog")
if "dog" eq "cat"
Output.write("dog is cat")
""").output == """dog is dog""".strip()... |
cb1591a4c614d6ecbd4ad2cbed2a736fe14f2428 | mopidy_beets/actor.py | mopidy_beets/actor.py | from __future__ import unicode_literals
import logging
from mopidy import backend
import pykka
from .client import BeetsRemoteClient
from .library import BeetsLibraryProvider
logger = logging.getLogger(__name__)
class BeetsBackend(pykka.ThreadingActor, backend.Backend):
def __init__(self, config, audio):
... | from __future__ import unicode_literals
import logging
from mopidy import backend
import pykka
from .client import BeetsRemoteClient
from .library import BeetsLibraryProvider
logger = logging.getLogger(__name__)
class BeetsBackend(pykka.ThreadingActor, backend.Backend):
def __init__(self, config, audio):
... | Use translate_uri() instead of change_track() | playback: Use translate_uri() instead of change_track()
| Python | mit | mopidy/mopidy-beets | from __future__ import unicode_literals
import logging
from mopidy import backend
import pykka
from .client import BeetsRemoteClient
from .library import BeetsLibraryProvider
logger = logging.getLogger(__name__)
class BeetsBackend(pykka.ThreadingActor, backend.Backend):
def __init__(self, config, audio):
... | from __future__ import unicode_literals
import logging
from mopidy import backend
import pykka
from .client import BeetsRemoteClient
from .library import BeetsLibraryProvider
logger = logging.getLogger(__name__)
class BeetsBackend(pykka.ThreadingActor, backend.Backend):
def __init__(self, config, audio):
... | <commit_before>from __future__ import unicode_literals
import logging
from mopidy import backend
import pykka
from .client import BeetsRemoteClient
from .library import BeetsLibraryProvider
logger = logging.getLogger(__name__)
class BeetsBackend(pykka.ThreadingActor, backend.Backend):
def __init__(self, co... | from __future__ import unicode_literals
import logging
from mopidy import backend
import pykka
from .client import BeetsRemoteClient
from .library import BeetsLibraryProvider
logger = logging.getLogger(__name__)
class BeetsBackend(pykka.ThreadingActor, backend.Backend):
def __init__(self, config, audio):
... | from __future__ import unicode_literals
import logging
from mopidy import backend
import pykka
from .client import BeetsRemoteClient
from .library import BeetsLibraryProvider
logger = logging.getLogger(__name__)
class BeetsBackend(pykka.ThreadingActor, backend.Backend):
def __init__(self, config, audio):
... | <commit_before>from __future__ import unicode_literals
import logging
from mopidy import backend
import pykka
from .client import BeetsRemoteClient
from .library import BeetsLibraryProvider
logger = logging.getLogger(__name__)
class BeetsBackend(pykka.ThreadingActor, backend.Backend):
def __init__(self, co... |
d2444e557e097f375ee830ebf382d68b702b80da | src/ansible/forms.py | src/ansible/forms.py | from django import forms
from django.conf import settings
from django.forms import ModelForm
from ansible.models import Playbook
class AnsibleForm1(ModelForm):
class Meta:
model = Playbook
fields = ['repository', 'username']
class AnsibleForm2(ModelForm):
class Meta:
model = Playbook
... | from django import forms
from django.conf import settings
from django.forms import ModelForm
from ansible.models import Playbook
class AnsibleForm1(ModelForm):
class Meta:
model = Playbook
fields = ['repository', 'username']
class AnsibleForm2(ModelForm):
class Meta:
model = Playbook
... | Set Textarea width and height | Set Textarea width and height
| Python | bsd-3-clause | lozadaOmr/ansible-admin,lozadaOmr/ansible-admin,lozadaOmr/ansible-admin | from django import forms
from django.conf import settings
from django.forms import ModelForm
from ansible.models import Playbook
class AnsibleForm1(ModelForm):
class Meta:
model = Playbook
fields = ['repository', 'username']
class AnsibleForm2(ModelForm):
class Meta:
model = Playbook
... | from django import forms
from django.conf import settings
from django.forms import ModelForm
from ansible.models import Playbook
class AnsibleForm1(ModelForm):
class Meta:
model = Playbook
fields = ['repository', 'username']
class AnsibleForm2(ModelForm):
class Meta:
model = Playbook
... | <commit_before>from django import forms
from django.conf import settings
from django.forms import ModelForm
from ansible.models import Playbook
class AnsibleForm1(ModelForm):
class Meta:
model = Playbook
fields = ['repository', 'username']
class AnsibleForm2(ModelForm):
class Meta:
mo... | from django import forms
from django.conf import settings
from django.forms import ModelForm
from ansible.models import Playbook
class AnsibleForm1(ModelForm):
class Meta:
model = Playbook
fields = ['repository', 'username']
class AnsibleForm2(ModelForm):
class Meta:
model = Playbook
... | from django import forms
from django.conf import settings
from django.forms import ModelForm
from ansible.models import Playbook
class AnsibleForm1(ModelForm):
class Meta:
model = Playbook
fields = ['repository', 'username']
class AnsibleForm2(ModelForm):
class Meta:
model = Playbook
... | <commit_before>from django import forms
from django.conf import settings
from django.forms import ModelForm
from ansible.models import Playbook
class AnsibleForm1(ModelForm):
class Meta:
model = Playbook
fields = ['repository', 'username']
class AnsibleForm2(ModelForm):
class Meta:
mo... |
da1f251195baf20e7dd78a173f84c61e76c91c2a | docs/conf.py | docs/conf.py | import os
import maec
project = u'python-maec'
copyright = u'2014, The MITRE Corporation'
version = maec.__version__
release = version
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.ifconfig',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
]
i... | import os
import maec
project = u'python-maec'
copyright = u'2014, The MITRE Corporation'
version = maec.__version__
release = version
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
]
templates_path = ['_templates']... | Remove intersphinx extension from documentation. | Remove intersphinx extension from documentation.
| Python | bsd-3-clause | MAECProject/python-maec | import os
import maec
project = u'python-maec'
copyright = u'2014, The MITRE Corporation'
version = maec.__version__
release = version
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.ifconfig',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
]
i... | import os
import maec
project = u'python-maec'
copyright = u'2014, The MITRE Corporation'
version = maec.__version__
release = version
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
]
templates_path = ['_templates']... | <commit_before>import os
import maec
project = u'python-maec'
copyright = u'2014, The MITRE Corporation'
version = maec.__version__
release = version
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.ifconfig',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinx.ext.... | import os
import maec
project = u'python-maec'
copyright = u'2014, The MITRE Corporation'
version = maec.__version__
release = version
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
]
templates_path = ['_templates']... | import os
import maec
project = u'python-maec'
copyright = u'2014, The MITRE Corporation'
version = maec.__version__
release = version
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.ifconfig',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
]
i... | <commit_before>import os
import maec
project = u'python-maec'
copyright = u'2014, The MITRE Corporation'
version = maec.__version__
release = version
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.ifconfig',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinx.ext.... |
a4f09620d8939aa8141b39972fb49d82f5380875 | src/build/console.py | src/build/console.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import time
import datetime
start_time = 0
def start_timer():
global start_time
start_time = int(round(time.ti... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import time
import datetime
start_time = 0
def start_timer():
global start_time
start_time = int(round(time.ti... | Add colored time in output | Add colored time in output
| Python | mpl-2.0 | seleznev/firefox-complete-theme-build-system | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import time
import datetime
start_time = 0
def start_timer():
global start_time
start_time = int(round(time.ti... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import time
import datetime
start_time = 0
def start_timer():
global start_time
start_time = int(round(time.ti... | <commit_before># This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import time
import datetime
start_time = 0
def start_timer():
global start_time
start_time = in... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import time
import datetime
start_time = 0
def start_timer():
global start_time
start_time = int(round(time.ti... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import time
import datetime
start_time = 0
def start_timer():
global start_time
start_time = int(round(time.ti... | <commit_before># This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import time
import datetime
start_time = 0
def start_timer():
global start_time
start_time = in... |
9ceace60593f133b4f6dfdbd9b6f583362415294 | src/configuration.py | src/configuration.py | import ConfigParser
import os
def class ConfigDlstats(object):
"""Cross platform configuration file handler.
This class manages dlstats configuration files, providing
easy access to the options."""
def __init__(self)
"""Open the configuration files handler, choosing the right
path depending o... | import ConfigParser
import os
class ConfigDlstats(object):
"""Cross platform configuration file handler.
This class manages dlstats configuration files, providing
easy access to the options."""
def __init__(self):
"""Open the configuration files handler, choosing the right
path depend... | Fix a few syntax errors | Fix a few syntax errors
| Python | agpl-3.0 | MichelJuillard/dlstats,Widukind/dlstats,mmalter/dlstats,mmalter/dlstats,Widukind/dlstats,MichelJuillard/dlstats,mmalter/dlstats,MichelJuillard/dlstats | import ConfigParser
import os
def class ConfigDlstats(object):
"""Cross platform configuration file handler.
This class manages dlstats configuration files, providing
easy access to the options."""
def __init__(self)
"""Open the configuration files handler, choosing the right
path depending o... | import ConfigParser
import os
class ConfigDlstats(object):
"""Cross platform configuration file handler.
This class manages dlstats configuration files, providing
easy access to the options."""
def __init__(self):
"""Open the configuration files handler, choosing the right
path depend... | <commit_before>import ConfigParser
import os
def class ConfigDlstats(object):
"""Cross platform configuration file handler.
This class manages dlstats configuration files, providing
easy access to the options."""
def __init__(self)
"""Open the configuration files handler, choosing the right
p... | import ConfigParser
import os
class ConfigDlstats(object):
"""Cross platform configuration file handler.
This class manages dlstats configuration files, providing
easy access to the options."""
def __init__(self):
"""Open the configuration files handler, choosing the right
path depend... | import ConfigParser
import os
def class ConfigDlstats(object):
"""Cross platform configuration file handler.
This class manages dlstats configuration files, providing
easy access to the options."""
def __init__(self)
"""Open the configuration files handler, choosing the right
path depending o... | <commit_before>import ConfigParser
import os
def class ConfigDlstats(object):
"""Cross platform configuration file handler.
This class manages dlstats configuration files, providing
easy access to the options."""
def __init__(self)
"""Open the configuration files handler, choosing the right
p... |
4298e82a3dc4c6577b41b4acbb73ff7bb5795002 | src/django_registration/backends/one_step/views.py | src/django_registration/backends/one_step/views.py | """
A one-step (user signs up and is immediately active and logged in)
workflow.
"""
from django.contrib.auth import authenticate, get_user_model, login
from django.urls import reverse_lazy
from django_registration import signals
from django_registration.views import RegistrationView as BaseRegistrationView
User =... | """
A one-step (user signs up and is immediately active and logged in)
workflow.
"""
from django.contrib.auth import authenticate, get_user_model, login
from django.urls import reverse_lazy
from django_registration import signals
from django_registration.views import RegistrationView as BaseRegistrationView
User =... | Make the one-step backend a little more robust with custom users. | Make the one-step backend a little more robust with custom users.
| Python | bsd-3-clause | ubernostrum/django-registration | """
A one-step (user signs up and is immediately active and logged in)
workflow.
"""
from django.contrib.auth import authenticate, get_user_model, login
from django.urls import reverse_lazy
from django_registration import signals
from django_registration.views import RegistrationView as BaseRegistrationView
User =... | """
A one-step (user signs up and is immediately active and logged in)
workflow.
"""
from django.contrib.auth import authenticate, get_user_model, login
from django.urls import reverse_lazy
from django_registration import signals
from django_registration.views import RegistrationView as BaseRegistrationView
User =... | <commit_before>"""
A one-step (user signs up and is immediately active and logged in)
workflow.
"""
from django.contrib.auth import authenticate, get_user_model, login
from django.urls import reverse_lazy
from django_registration import signals
from django_registration.views import RegistrationView as BaseRegistrati... | """
A one-step (user signs up and is immediately active and logged in)
workflow.
"""
from django.contrib.auth import authenticate, get_user_model, login
from django.urls import reverse_lazy
from django_registration import signals
from django_registration.views import RegistrationView as BaseRegistrationView
User =... | """
A one-step (user signs up and is immediately active and logged in)
workflow.
"""
from django.contrib.auth import authenticate, get_user_model, login
from django.urls import reverse_lazy
from django_registration import signals
from django_registration.views import RegistrationView as BaseRegistrationView
User =... | <commit_before>"""
A one-step (user signs up and is immediately active and logged in)
workflow.
"""
from django.contrib.auth import authenticate, get_user_model, login
from django.urls import reverse_lazy
from django_registration import signals
from django_registration.views import RegistrationView as BaseRegistrati... |
76ed0bb6415209aa28350d4304e7b87715ba37f5 | qllr/templating.py | qllr/templating.py | import typing
from jinja2 import Undefined, contextfunction, escape
from starlette.templating import Jinja2Templates
def render_ql_nickname(nickname):
nickname = str(escape(nickname))
for i in range(8):
nickname = nickname.replace(
"^" + str(i), '</span><span class="qc' + str(i) + '">'
... | import typing
from urllib.parse import ParseResult, urlparse
from jinja2 import Undefined, contextfunction, escape
from starlette.templating import Jinja2Templates
def render_ql_nickname(nickname):
nickname = str(escape(nickname))
for i in range(8):
nickname = nickname.replace(
"^" + str(... | Make templates to return relative path | Make templates to return relative path
| Python | agpl-3.0 | em92/quakelive-local-ratings,em92/pickup-rating,em92/quakelive-local-ratings,em92/quakelive-local-ratings,em92/quakelive-local-ratings,em92/pickup-rating,em92/pickup-rating,em92/quakelive-local-ratings | import typing
from jinja2 import Undefined, contextfunction, escape
from starlette.templating import Jinja2Templates
def render_ql_nickname(nickname):
nickname = str(escape(nickname))
for i in range(8):
nickname = nickname.replace(
"^" + str(i), '</span><span class="qc' + str(i) + '">'
... | import typing
from urllib.parse import ParseResult, urlparse
from jinja2 import Undefined, contextfunction, escape
from starlette.templating import Jinja2Templates
def render_ql_nickname(nickname):
nickname = str(escape(nickname))
for i in range(8):
nickname = nickname.replace(
"^" + str(... | <commit_before>import typing
from jinja2 import Undefined, contextfunction, escape
from starlette.templating import Jinja2Templates
def render_ql_nickname(nickname):
nickname = str(escape(nickname))
for i in range(8):
nickname = nickname.replace(
"^" + str(i), '</span><span class="qc' + s... | import typing
from urllib.parse import ParseResult, urlparse
from jinja2 import Undefined, contextfunction, escape
from starlette.templating import Jinja2Templates
def render_ql_nickname(nickname):
nickname = str(escape(nickname))
for i in range(8):
nickname = nickname.replace(
"^" + str(... | import typing
from jinja2 import Undefined, contextfunction, escape
from starlette.templating import Jinja2Templates
def render_ql_nickname(nickname):
nickname = str(escape(nickname))
for i in range(8):
nickname = nickname.replace(
"^" + str(i), '</span><span class="qc' + str(i) + '">'
... | <commit_before>import typing
from jinja2 import Undefined, contextfunction, escape
from starlette.templating import Jinja2Templates
def render_ql_nickname(nickname):
nickname = str(escape(nickname))
for i in range(8):
nickname = nickname.replace(
"^" + str(i), '</span><span class="qc' + s... |
18d04567570d0b5e9156c720d1648338aba58369 | readux/__init__.py | readux/__init__.py | __version_info__ = (1, 5, 1, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environm... | __version_info__ = (1, 6, 0, 'dev')
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environ... | Bump dev version to 1.6 after releasing 1.5 | Bump dev version to 1.6 after releasing 1.5
| Python | apache-2.0 | emory-libraries/readux,emory-libraries/readux,emory-libraries/readux | __version_info__ = (1, 5, 1, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environm... | __version_info__ = (1, 6, 0, 'dev')
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environ... | <commit_before>__version_info__ = (1, 5, 1, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the te... | __version_info__ = (1, 6, 0, 'dev')
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environ... | __version_info__ = (1, 5, 1, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environm... | <commit_before>__version_info__ = (1, 5, 1, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the te... |
240d4d33dc6570c957ce568a952a1a282dc50736 | opps/article/views.py | opps/article/views.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from opps.article.models import Post
class OppsList(ListView):
context_object_name = "context"
@property
def template_name(self):
long_slug = self.kwa... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from opps.article.models import Post
class OppsList(ListView):
context_object_name = "context"
@property
def template_name(self):
long_slug = self.kwa... | Fix template name on entry home page (/) on detail page | Fix template name on entry home page (/) on detail page
| Python | mit | williamroot/opps,YACOWS/opps,jeanmask/opps,jeanmask/opps,williamroot/opps,opps/opps,opps/opps,williamroot/opps,williamroot/opps,YACOWS/opps,opps/opps,YACOWS/opps,jeanmask/opps,jeanmask/opps,YACOWS/opps,opps/opps | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from opps.article.models import Post
class OppsList(ListView):
context_object_name = "context"
@property
def template_name(self):
long_slug = self.kwa... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from opps.article.models import Post
class OppsList(ListView):
context_object_name = "context"
@property
def template_name(self):
long_slug = self.kwa... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from opps.article.models import Post
class OppsList(ListView):
context_object_name = "context"
@property
def template_name(self):
long_... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from opps.article.models import Post
class OppsList(ListView):
context_object_name = "context"
@property
def template_name(self):
long_slug = self.kwa... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from opps.article.models import Post
class OppsList(ListView):
context_object_name = "context"
@property
def template_name(self):
long_slug = self.kwa... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from opps.article.models import Post
class OppsList(ListView):
context_object_name = "context"
@property
def template_name(self):
long_... |
e68b0f10cd2dcbeade127ca3c2a30408595e9ecb | ownership/__init__.py | ownership/__init__.py | from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
import os
from .health import Health
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
def health(self):
try:
with self.engine.connect() as c:
c.execute('select 1=1').fetchall()
return True... | from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
import os
from .health import Health
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
from werkzeug.contrib.fixers import ProxyFix
app.wsgi_app = ProxyFix(app.wsgi_app)
def health(self):
try:
with self.engine.con... | Add proxy fix as in lr this will run with reverse proxy | Add proxy fix as in lr this will run with reverse proxy
| Python | mit | LandRegistry/ownership-alpha,LandRegistry/ownership-alpha,LandRegistry/ownership-alpha | from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
import os
from .health import Health
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
def health(self):
try:
with self.engine.connect() as c:
c.execute('select 1=1').fetchall()
return True... | from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
import os
from .health import Health
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
from werkzeug.contrib.fixers import ProxyFix
app.wsgi_app = ProxyFix(app.wsgi_app)
def health(self):
try:
with self.engine.con... | <commit_before>from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
import os
from .health import Health
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
def health(self):
try:
with self.engine.connect() as c:
c.execute('select 1=1').fetchall()
... | from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
import os
from .health import Health
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
from werkzeug.contrib.fixers import ProxyFix
app.wsgi_app = ProxyFix(app.wsgi_app)
def health(self):
try:
with self.engine.con... | from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
import os
from .health import Health
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
def health(self):
try:
with self.engine.connect() as c:
c.execute('select 1=1').fetchall()
return True... | <commit_before>from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
import os
from .health import Health
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
def health(self):
try:
with self.engine.connect() as c:
c.execute('select 1=1').fetchall()
... |
6947a38fd99447809870d82a425abd4db9d884fe | test/htmltoreadable.py | test/htmltoreadable.py | # -*- coding: utf-8 -*-
import codecs
import os
import grab
from src import htmltoreadable as hr
def test():
g = grab.Grab()
g.go('http://habrahabr.ru/post/266293/')
root_node = g.css('.post_show')
text = hr.html_to_readable(root_node)
path = 'out'
if not os.path.exists(path):
os.mkd... | # -*- coding: utf-8 -*-
import codecs
import os
import grab
from src import htmltoreadable as hr
def test():
g = grab.Grab()
g.go('http://habrahabr.ru/post/266293/')
root_node = g.doc.tree.cssselect('.post_show')[0]
text = hr.html_to_readable(root_node)
path = 'out'
if not os.path.exists(pat... | Delete using deprecated fnc in test | Delete using deprecated fnc in test
| Python | mit | shigarus/NewsParser | # -*- coding: utf-8 -*-
import codecs
import os
import grab
from src import htmltoreadable as hr
def test():
g = grab.Grab()
g.go('http://habrahabr.ru/post/266293/')
root_node = g.css('.post_show')
text = hr.html_to_readable(root_node)
path = 'out'
if not os.path.exists(path):
os.mkd... | # -*- coding: utf-8 -*-
import codecs
import os
import grab
from src import htmltoreadable as hr
def test():
g = grab.Grab()
g.go('http://habrahabr.ru/post/266293/')
root_node = g.doc.tree.cssselect('.post_show')[0]
text = hr.html_to_readable(root_node)
path = 'out'
if not os.path.exists(pat... | <commit_before># -*- coding: utf-8 -*-
import codecs
import os
import grab
from src import htmltoreadable as hr
def test():
g = grab.Grab()
g.go('http://habrahabr.ru/post/266293/')
root_node = g.css('.post_show')
text = hr.html_to_readable(root_node)
path = 'out'
if not os.path.exists(path):... | # -*- coding: utf-8 -*-
import codecs
import os
import grab
from src import htmltoreadable as hr
def test():
g = grab.Grab()
g.go('http://habrahabr.ru/post/266293/')
root_node = g.doc.tree.cssselect('.post_show')[0]
text = hr.html_to_readable(root_node)
path = 'out'
if not os.path.exists(pat... | # -*- coding: utf-8 -*-
import codecs
import os
import grab
from src import htmltoreadable as hr
def test():
g = grab.Grab()
g.go('http://habrahabr.ru/post/266293/')
root_node = g.css('.post_show')
text = hr.html_to_readable(root_node)
path = 'out'
if not os.path.exists(path):
os.mkd... | <commit_before># -*- coding: utf-8 -*-
import codecs
import os
import grab
from src import htmltoreadable as hr
def test():
g = grab.Grab()
g.go('http://habrahabr.ru/post/266293/')
root_node = g.css('.post_show')
text = hr.html_to_readable(root_node)
path = 'out'
if not os.path.exists(path):... |
2dad35a7fb6f4daa80b7f760889013fd8eb54753 | examples/drawing/random_geometric_graph.py | examples/drawing/random_geometric_graph.py | import networkx as nx
import matplotlib.pyplot as plt
G=nx.random_geometric_graph(200,0.125)
pos=G.pos # position is stored as member data for random_geometric_graph
# find node near center (0.5,0.5)
dmin=1
ncenter=0
for n in pos:
x,y=pos[n]
d=(x-0.5)**2+(y-0.5)**2
if d<dmin:
ncenter=n
dmi... | import networkx as nx
import matplotlib.pyplot as plt
G=nx.random_geometric_graph(200,0.125)
# position is stored as node attribute data for random_geometric_graph
pos=nx.get_node_attributes(G,'pos')
# find node near center (0.5,0.5)
dmin=1
ncenter=0
for n in pos:
x,y=pos[n]
d=(x-0.5)**2+(y-0.5)**2
if d<d... | Update exmple for node position in new RGG interface. | Update exmple for node position in new RGG interface.
| Python | bsd-3-clause | blublud/networkx,nathania/networkx,jni/networkx,ghdk/networkx,RMKD/networkx,ionanrozenfeld/networkx,kai5263499/networkx,bzero/networkx,dmoliveira/networkx,kernc/networkx,SanketDG/networkx,RMKD/networkx,jni/networkx,debsankha/networkx,jakevdp/networkx,kai5263499/networkx,wasade/networkx,chrisnatali/networkx,yashu-seth/n... | import networkx as nx
import matplotlib.pyplot as plt
G=nx.random_geometric_graph(200,0.125)
pos=G.pos # position is stored as member data for random_geometric_graph
# find node near center (0.5,0.5)
dmin=1
ncenter=0
for n in pos:
x,y=pos[n]
d=(x-0.5)**2+(y-0.5)**2
if d<dmin:
ncenter=n
dmi... | import networkx as nx
import matplotlib.pyplot as plt
G=nx.random_geometric_graph(200,0.125)
# position is stored as node attribute data for random_geometric_graph
pos=nx.get_node_attributes(G,'pos')
# find node near center (0.5,0.5)
dmin=1
ncenter=0
for n in pos:
x,y=pos[n]
d=(x-0.5)**2+(y-0.5)**2
if d<d... | <commit_before>import networkx as nx
import matplotlib.pyplot as plt
G=nx.random_geometric_graph(200,0.125)
pos=G.pos # position is stored as member data for random_geometric_graph
# find node near center (0.5,0.5)
dmin=1
ncenter=0
for n in pos:
x,y=pos[n]
d=(x-0.5)**2+(y-0.5)**2
if d<dmin:
ncente... | import networkx as nx
import matplotlib.pyplot as plt
G=nx.random_geometric_graph(200,0.125)
# position is stored as node attribute data for random_geometric_graph
pos=nx.get_node_attributes(G,'pos')
# find node near center (0.5,0.5)
dmin=1
ncenter=0
for n in pos:
x,y=pos[n]
d=(x-0.5)**2+(y-0.5)**2
if d<d... | import networkx as nx
import matplotlib.pyplot as plt
G=nx.random_geometric_graph(200,0.125)
pos=G.pos # position is stored as member data for random_geometric_graph
# find node near center (0.5,0.5)
dmin=1
ncenter=0
for n in pos:
x,y=pos[n]
d=(x-0.5)**2+(y-0.5)**2
if d<dmin:
ncenter=n
dmi... | <commit_before>import networkx as nx
import matplotlib.pyplot as plt
G=nx.random_geometric_graph(200,0.125)
pos=G.pos # position is stored as member data for random_geometric_graph
# find node near center (0.5,0.5)
dmin=1
ncenter=0
for n in pos:
x,y=pos[n]
d=(x-0.5)**2+(y-0.5)**2
if d<dmin:
ncente... |
3f025b5400c0855472a772487de8930bac9b5eef | numpy/setupscons.py | numpy/setupscons.py | #!/usr/bin/env python
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('numpy',parent_package,top_path, setup_name = 'setupscons.py')
config.add_subpackage('distutils')
config.add_subpackage('testing')
config.add_subpacka... | #!/usr/bin/env python
from os.path import join as pjoin
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.misc_util import scons_generate_config_py
pkgname = 'numpy'
config = Configuration(pkgname,parent_package,top_path, setup... | Handle inplace generation of __config__. | Handle inplace generation of __config__.
| Python | bsd-3-clause | rhythmsosad/numpy,numpy/numpy,grlee77/numpy,ViralLeadership/numpy,mattip/numpy,chiffa/numpy,numpy/numpy-refactor,numpy/numpy-refactor,bmorris3/numpy,joferkington/numpy,ekalosak/numpy,mindw/numpy,madphysicist/numpy,matthew-brett/numpy,BMJHayward/numpy,stefanv/numpy,WillieMaddox/numpy,solarjoe/numpy,rajathkumarmp/numpy,m... | #!/usr/bin/env python
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('numpy',parent_package,top_path, setup_name = 'setupscons.py')
config.add_subpackage('distutils')
config.add_subpackage('testing')
config.add_subpacka... | #!/usr/bin/env python
from os.path import join as pjoin
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.misc_util import scons_generate_config_py
pkgname = 'numpy'
config = Configuration(pkgname,parent_package,top_path, setup... | <commit_before>#!/usr/bin/env python
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('numpy',parent_package,top_path, setup_name = 'setupscons.py')
config.add_subpackage('distutils')
config.add_subpackage('testing')
conf... | #!/usr/bin/env python
from os.path import join as pjoin
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.misc_util import scons_generate_config_py
pkgname = 'numpy'
config = Configuration(pkgname,parent_package,top_path, setup... | #!/usr/bin/env python
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('numpy',parent_package,top_path, setup_name = 'setupscons.py')
config.add_subpackage('distutils')
config.add_subpackage('testing')
config.add_subpacka... | <commit_before>#!/usr/bin/env python
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('numpy',parent_package,top_path, setup_name = 'setupscons.py')
config.add_subpackage('distutils')
config.add_subpackage('testing')
conf... |
e84d8834359d90f291035008ed91af19be869bfa | sourcestats/settings.py | sourcestats/settings.py | # Source Server Stats
# File: sourcestats/settings.py
# Desc: settings for the Flask server
DEBUG = True
# Number of servers to collect from in parallel
PARALLEL = 4000
# Loop intervals (+time to execute!)
COLLECT_INTERVAL = 30
FIND_INTERVAL = 300
# Timeout for reading addresses via UDP from Valve
MASTER_TIMEOUT = ... | # Source Server Stats
# File: sourcestats/settings.py
# Desc: settings for the Flask server
DEBUG = True
# Number of servers to collect from in parallel
PARALLEL = 1000
# Loop intervals (+time to execute!)
COLLECT_INTERVAL = 30
FIND_INTERVAL = 300
# Timeout for reading addresses via UDP from Valve
MASTER_TIMEOUT = ... | Set parallel to 1000 because supervisor + ulimit = fail | Set parallel to 1000 because supervisor + ulimit = fail
| Python | mit | Fizzadar/SourceServerStats,Fizzadar/SourceServerStats,Fizzadar/SourceServerStats | # Source Server Stats
# File: sourcestats/settings.py
# Desc: settings for the Flask server
DEBUG = True
# Number of servers to collect from in parallel
PARALLEL = 4000
# Loop intervals (+time to execute!)
COLLECT_INTERVAL = 30
FIND_INTERVAL = 300
# Timeout for reading addresses via UDP from Valve
MASTER_TIMEOUT = ... | # Source Server Stats
# File: sourcestats/settings.py
# Desc: settings for the Flask server
DEBUG = True
# Number of servers to collect from in parallel
PARALLEL = 1000
# Loop intervals (+time to execute!)
COLLECT_INTERVAL = 30
FIND_INTERVAL = 300
# Timeout for reading addresses via UDP from Valve
MASTER_TIMEOUT = ... | <commit_before># Source Server Stats
# File: sourcestats/settings.py
# Desc: settings for the Flask server
DEBUG = True
# Number of servers to collect from in parallel
PARALLEL = 4000
# Loop intervals (+time to execute!)
COLLECT_INTERVAL = 30
FIND_INTERVAL = 300
# Timeout for reading addresses via UDP from Valve
MA... | # Source Server Stats
# File: sourcestats/settings.py
# Desc: settings for the Flask server
DEBUG = True
# Number of servers to collect from in parallel
PARALLEL = 1000
# Loop intervals (+time to execute!)
COLLECT_INTERVAL = 30
FIND_INTERVAL = 300
# Timeout for reading addresses via UDP from Valve
MASTER_TIMEOUT = ... | # Source Server Stats
# File: sourcestats/settings.py
# Desc: settings for the Flask server
DEBUG = True
# Number of servers to collect from in parallel
PARALLEL = 4000
# Loop intervals (+time to execute!)
COLLECT_INTERVAL = 30
FIND_INTERVAL = 300
# Timeout for reading addresses via UDP from Valve
MASTER_TIMEOUT = ... | <commit_before># Source Server Stats
# File: sourcestats/settings.py
# Desc: settings for the Flask server
DEBUG = True
# Number of servers to collect from in parallel
PARALLEL = 4000
# Loop intervals (+time to execute!)
COLLECT_INTERVAL = 30
FIND_INTERVAL = 300
# Timeout for reading addresses via UDP from Valve
MA... |
1c1d2b1dfba2fbf02a642da516119a1e280a4bc3 | account_invoice_merge/__openerp__.py | account_invoice_merge/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2010-2011 Elico Corp. All Rights Reserved.
# Author: Ian Li <ian.li@elico-corp.com>
#
# This program is free software: you can redistribute it a... | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2010-2011 Elico Corp. All Rights Reserved.
# Author: Ian Li <ian.li@elico-corp.com>
#
# This program is free software: you can redistribute it a... | Add OCA as author of OCA addons | Add OCA as author of OCA addons
In order to get visibility on https://www.odoo.com/apps the OCA board has
decided to add the OCA as author of all the addons maintained as part of the
association.
| Python | agpl-3.0 | OCA/account-invoicing,OCA/account-invoicing | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2010-2011 Elico Corp. All Rights Reserved.
# Author: Ian Li <ian.li@elico-corp.com>
#
# This program is free software: you can redistribute it a... | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2010-2011 Elico Corp. All Rights Reserved.
# Author: Ian Li <ian.li@elico-corp.com>
#
# This program is free software: you can redistribute it a... | <commit_before># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2010-2011 Elico Corp. All Rights Reserved.
# Author: Ian Li <ian.li@elico-corp.com>
#
# This program is free software: you can re... | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2010-2011 Elico Corp. All Rights Reserved.
# Author: Ian Li <ian.li@elico-corp.com>
#
# This program is free software: you can redistribute it a... | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2010-2011 Elico Corp. All Rights Reserved.
# Author: Ian Li <ian.li@elico-corp.com>
#
# This program is free software: you can redistribute it a... | <commit_before># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2010-2011 Elico Corp. All Rights Reserved.
# Author: Ian Li <ian.li@elico-corp.com>
#
# This program is free software: you can re... |
66cc5b8ecae568c3a20948718ef2d4f162cfd786 | test/test_pycompile.py | test/test_pycompile.py | """
Test the high-level compile function
"""
import unittest
from six import StringIO
from lesscpy import compile
class TestCompileFunction(unittest.TestCase):
"""
Unit tests for compile
"""
def test_compile(self):
"""
It can compile input from a file-like object
"""
... | """
Test the high-level compile function
"""
import unittest
from six import StringIO
from lesscpy import compile
class TestCompileFunction(unittest.TestCase):
"""
Unit tests for compile
"""
def test_compile(self):
"""
It can compile input from a file-like object
"""
... | Add test if compile() raises an CompilationError | Add test if compile() raises an CompilationError
| Python | mit | lesscpy/lesscpy,fivethreeo/lesscpy,joequery/lesscpy | """
Test the high-level compile function
"""
import unittest
from six import StringIO
from lesscpy import compile
class TestCompileFunction(unittest.TestCase):
"""
Unit tests for compile
"""
def test_compile(self):
"""
It can compile input from a file-like object
"""
... | """
Test the high-level compile function
"""
import unittest
from six import StringIO
from lesscpy import compile
class TestCompileFunction(unittest.TestCase):
"""
Unit tests for compile
"""
def test_compile(self):
"""
It can compile input from a file-like object
"""
... | <commit_before>"""
Test the high-level compile function
"""
import unittest
from six import StringIO
from lesscpy import compile
class TestCompileFunction(unittest.TestCase):
"""
Unit tests for compile
"""
def test_compile(self):
"""
It can compile input from a file-like object
... | """
Test the high-level compile function
"""
import unittest
from six import StringIO
from lesscpy import compile
class TestCompileFunction(unittest.TestCase):
"""
Unit tests for compile
"""
def test_compile(self):
"""
It can compile input from a file-like object
"""
... | """
Test the high-level compile function
"""
import unittest
from six import StringIO
from lesscpy import compile
class TestCompileFunction(unittest.TestCase):
"""
Unit tests for compile
"""
def test_compile(self):
"""
It can compile input from a file-like object
"""
... | <commit_before>"""
Test the high-level compile function
"""
import unittest
from six import StringIO
from lesscpy import compile
class TestCompileFunction(unittest.TestCase):
"""
Unit tests for compile
"""
def test_compile(self):
"""
It can compile input from a file-like object
... |
3febcda544f372af01e9d2138c131f103ed45455 | app/soc/mapreduce/delete_gci_data.py | app/soc/mapreduce/delete_gci_data.py | # Copyright 2013 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | # Copyright 2013 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | Update the docstring for the mapper to reflect what it does correctly. | Update the docstring for the mapper to reflect what it does correctly.
| Python | apache-2.0 | rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son | # Copyright 2013 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | # Copyright 2013 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | <commit_before># Copyright 2013 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | # Copyright 2013 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | # Copyright 2013 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | <commit_before># Copyright 2013 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
873fd7db56eadfb0aa4b135c01d0a16f8f240c8a | v2/setup.py | v2/setup.py | #!/usr/bin/env python
import sys
from ansible import __version__
try:
from setuptools import setup, find_packages
except ImportError:
print("Ansible now needs setuptools in order to build. Install it using"
" your package manager (usually python-setuptools) or via pip (pip"
" install s... | #!/usr/bin/env python
import sys
from ansible import __version__
try:
from setuptools import setup, find_packages
except ImportError:
print("Ansible now needs setuptools in order to build. Install it using"
" your package manager (usually python-setuptools) or via pip (pip"
" install s... | Add a requires on python-six 1.4.0 ( for add_metaclass ) | Add a requires on python-six 1.4.0 ( for add_metaclass )
This also mean that this doesn't run on RHEL 7 as of today.
| Python | mit | thaim/ansible,thaim/ansible | #!/usr/bin/env python
import sys
from ansible import __version__
try:
from setuptools import setup, find_packages
except ImportError:
print("Ansible now needs setuptools in order to build. Install it using"
" your package manager (usually python-setuptools) or via pip (pip"
" install s... | #!/usr/bin/env python
import sys
from ansible import __version__
try:
from setuptools import setup, find_packages
except ImportError:
print("Ansible now needs setuptools in order to build. Install it using"
" your package manager (usually python-setuptools) or via pip (pip"
" install s... | <commit_before>#!/usr/bin/env python
import sys
from ansible import __version__
try:
from setuptools import setup, find_packages
except ImportError:
print("Ansible now needs setuptools in order to build. Install it using"
" your package manager (usually python-setuptools) or via pip (pip"
... | #!/usr/bin/env python
import sys
from ansible import __version__
try:
from setuptools import setup, find_packages
except ImportError:
print("Ansible now needs setuptools in order to build. Install it using"
" your package manager (usually python-setuptools) or via pip (pip"
" install s... | #!/usr/bin/env python
import sys
from ansible import __version__
try:
from setuptools import setup, find_packages
except ImportError:
print("Ansible now needs setuptools in order to build. Install it using"
" your package manager (usually python-setuptools) or via pip (pip"
" install s... | <commit_before>#!/usr/bin/env python
import sys
from ansible import __version__
try:
from setuptools import setup, find_packages
except ImportError:
print("Ansible now needs setuptools in order to build. Install it using"
" your package manager (usually python-setuptools) or via pip (pip"
... |
d98a2f8944c9b1ba6ef587b496987316c33488e5 | sample-settings.py | sample-settings.py | SECRET_KEY = 'Set the secret_key to something unique and secret.'
CLIENT_ID = 'xxxxxxx'
CLIENT_SECRET = 'yyyyyyyyyyyyyyyyyy'
| SECRET_KEY = 'Set the secret_key to something unique and secret.'
CLIENT_ID = 'xxxxxxx'
CLIENT_SECRET = 'yyyyyyyyyyyyyyyyyy'
LOG_FILENAME = 'dump'
| Add log filename to sample settings for tests. | Add log filename to sample settings for tests.
| Python | mit | punchagan/statiki,punchagan/statiki | SECRET_KEY = 'Set the secret_key to something unique and secret.'
CLIENT_ID = 'xxxxxxx'
CLIENT_SECRET = 'yyyyyyyyyyyyyyyyyy'
Add log filename to sample settings for tests. | SECRET_KEY = 'Set the secret_key to something unique and secret.'
CLIENT_ID = 'xxxxxxx'
CLIENT_SECRET = 'yyyyyyyyyyyyyyyyyy'
LOG_FILENAME = 'dump'
| <commit_before>SECRET_KEY = 'Set the secret_key to something unique and secret.'
CLIENT_ID = 'xxxxxxx'
CLIENT_SECRET = 'yyyyyyyyyyyyyyyyyy'
<commit_msg>Add log filename to sample settings for tests.<commit_after> | SECRET_KEY = 'Set the secret_key to something unique and secret.'
CLIENT_ID = 'xxxxxxx'
CLIENT_SECRET = 'yyyyyyyyyyyyyyyyyy'
LOG_FILENAME = 'dump'
| SECRET_KEY = 'Set the secret_key to something unique and secret.'
CLIENT_ID = 'xxxxxxx'
CLIENT_SECRET = 'yyyyyyyyyyyyyyyyyy'
Add log filename to sample settings for tests.SECRET_KEY = 'Set the secret_key to something unique and secret.'
CLIENT_ID = 'xxxxxxx'
CLIENT_SECRET = 'yyyyyyyyyyyyyyyyyy'
LOG_FILENAME = 'dump'
| <commit_before>SECRET_KEY = 'Set the secret_key to something unique and secret.'
CLIENT_ID = 'xxxxxxx'
CLIENT_SECRET = 'yyyyyyyyyyyyyyyyyy'
<commit_msg>Add log filename to sample settings for tests.<commit_after>SECRET_KEY = 'Set the secret_key to something unique and secret.'
CLIENT_ID = 'xxxxxxx'
CLIENT_SECRET = 'yyy... |
27035d6abba16fb06c8fa548385b33ab08bf787a | test/proper_noun_test.py | test/proper_noun_test.py |
from jargonprofiler.util import tag_proper_nouns
from jargonprofiler.munroe import munroe_score
def test_proper_noun_in_sentance():
assert tag_proper_nouns("My name is Eilis.") == set(["Eilis"])
def test_proper_noun_begins_sentance():
assert tag_proper_nouns("Eilis is a girl") == set(["Eilis"])
def test_... |
from jargonprofiler.util import tag_proper_nouns
from jargonprofiler.munroe import munroe_score
def test_proper_noun_in_sentence():
assert tag_proper_nouns("My name is Eilis.") == set(["Eilis"])
def test_proper_noun_begins_sentence():
assert tag_proper_nouns("Eilis is a girl") == set(["Eilis"])
def test_... | Add some more proper noun tests | Add some more proper noun tests
Fixes #35.
| Python | mit | ejh243/MunroeJargonProfiler,ejh243/MunroeJargonProfiler |
from jargonprofiler.util import tag_proper_nouns
from jargonprofiler.munroe import munroe_score
def test_proper_noun_in_sentance():
assert tag_proper_nouns("My name is Eilis.") == set(["Eilis"])
def test_proper_noun_begins_sentance():
assert tag_proper_nouns("Eilis is a girl") == set(["Eilis"])
def test_... |
from jargonprofiler.util import tag_proper_nouns
from jargonprofiler.munroe import munroe_score
def test_proper_noun_in_sentence():
assert tag_proper_nouns("My name is Eilis.") == set(["Eilis"])
def test_proper_noun_begins_sentence():
assert tag_proper_nouns("Eilis is a girl") == set(["Eilis"])
def test_... | <commit_before>
from jargonprofiler.util import tag_proper_nouns
from jargonprofiler.munroe import munroe_score
def test_proper_noun_in_sentance():
assert tag_proper_nouns("My name is Eilis.") == set(["Eilis"])
def test_proper_noun_begins_sentance():
assert tag_proper_nouns("Eilis is a girl") == set(["Eilis... |
from jargonprofiler.util import tag_proper_nouns
from jargonprofiler.munroe import munroe_score
def test_proper_noun_in_sentence():
assert tag_proper_nouns("My name is Eilis.") == set(["Eilis"])
def test_proper_noun_begins_sentence():
assert tag_proper_nouns("Eilis is a girl") == set(["Eilis"])
def test_... |
from jargonprofiler.util import tag_proper_nouns
from jargonprofiler.munroe import munroe_score
def test_proper_noun_in_sentance():
assert tag_proper_nouns("My name is Eilis.") == set(["Eilis"])
def test_proper_noun_begins_sentance():
assert tag_proper_nouns("Eilis is a girl") == set(["Eilis"])
def test_... | <commit_before>
from jargonprofiler.util import tag_proper_nouns
from jargonprofiler.munroe import munroe_score
def test_proper_noun_in_sentance():
assert tag_proper_nouns("My name is Eilis.") == set(["Eilis"])
def test_proper_noun_begins_sentance():
assert tag_proper_nouns("Eilis is a girl") == set(["Eilis... |
19ee722aca0fd68d798776d763175aa45e53df48 | whylog/client/searchers.py | whylog/client/searchers.py | from abc import ABCMeta, abstractmethod
class Searcher(object):
__metaclass__ = ABCMeta
class IndexSearcher(Searcher):
pass
class DataBaseSearcher(Searcher):
pass
class BacktrackSearcher(Searcher):
def __init__(self, file_path):
self._file_path = file_path
def _reverse_from_offset(self, offset, buf_size=8... | from abc import ABCMeta, abstractmethod
class Searcher(object):
__metaclass__ = ABCMeta
class IndexSearcher(Searcher):
pass
class DataBaseSearcher(Searcher):
pass
class BacktrackSearcher(Searcher):
def __init__(self, file_path):
self._file_path = file_path
def _reverse_from_offset(self, offset, buf_size=8... | Change variable name 'buffer' -> 'buffer_' to avoid conflict with python keyword | Change variable name 'buffer' -> 'buffer_' to avoid conflict with python keyword
| Python | bsd-3-clause | kgromadzki/whylog,epawlowska/whylog,andrzejgorski/whylog,epawlowska/whylog,konefalg/whylog,kgromadzki/whylog,9livesdata/whylog,andrzejgorski/whylog,konefalg/whylog,9livesdata/whylog | from abc import ABCMeta, abstractmethod
class Searcher(object):
__metaclass__ = ABCMeta
class IndexSearcher(Searcher):
pass
class DataBaseSearcher(Searcher):
pass
class BacktrackSearcher(Searcher):
def __init__(self, file_path):
self._file_path = file_path
def _reverse_from_offset(self, offset, buf_size=8... | from abc import ABCMeta, abstractmethod
class Searcher(object):
__metaclass__ = ABCMeta
class IndexSearcher(Searcher):
pass
class DataBaseSearcher(Searcher):
pass
class BacktrackSearcher(Searcher):
def __init__(self, file_path):
self._file_path = file_path
def _reverse_from_offset(self, offset, buf_size=8... | <commit_before>from abc import ABCMeta, abstractmethod
class Searcher(object):
__metaclass__ = ABCMeta
class IndexSearcher(Searcher):
pass
class DataBaseSearcher(Searcher):
pass
class BacktrackSearcher(Searcher):
def __init__(self, file_path):
self._file_path = file_path
def _reverse_from_offset(self, off... | from abc import ABCMeta, abstractmethod
class Searcher(object):
__metaclass__ = ABCMeta
class IndexSearcher(Searcher):
pass
class DataBaseSearcher(Searcher):
pass
class BacktrackSearcher(Searcher):
def __init__(self, file_path):
self._file_path = file_path
def _reverse_from_offset(self, offset, buf_size=8... | from abc import ABCMeta, abstractmethod
class Searcher(object):
__metaclass__ = ABCMeta
class IndexSearcher(Searcher):
pass
class DataBaseSearcher(Searcher):
pass
class BacktrackSearcher(Searcher):
def __init__(self, file_path):
self._file_path = file_path
def _reverse_from_offset(self, offset, buf_size=8... | <commit_before>from abc import ABCMeta, abstractmethod
class Searcher(object):
__metaclass__ = ABCMeta
class IndexSearcher(Searcher):
pass
class DataBaseSearcher(Searcher):
pass
class BacktrackSearcher(Searcher):
def __init__(self, file_path):
self._file_path = file_path
def _reverse_from_offset(self, off... |
8e362baea40a6b11140a93c13fc60c4c0d1ba577 | scuole/core/utils.py | scuole/core/utils.py | # -*- coding: utf-8 -*-
import re
def string_replace(text, key_dict):
"""
A function to convert text in a string to another string if
it matches any of the keys in the provided pattern dictionary.
"""
rx = re.compile('|'.join(map(re.escape, key_dict)))
def one_xlat(match):
return key... | # -*- coding: utf-8 -*-
import re
def string_replace(text, key_dict):
"""
A function to convert text in a string to another string if
it matches any of the keys in the provided pattern dictionary.
Usage:
from core.utils import string_replace
KEY_DICT = {
'Isd': 'ISD',
}
s =... | Add usage section to docstring for string_replace | Add usage section to docstring for string_replace
| Python | mit | texastribune/scuole,texastribune/scuole,texastribune/scuole,texastribune/scuole | # -*- coding: utf-8 -*-
import re
def string_replace(text, key_dict):
"""
A function to convert text in a string to another string if
it matches any of the keys in the provided pattern dictionary.
"""
rx = re.compile('|'.join(map(re.escape, key_dict)))
def one_xlat(match):
return key... | # -*- coding: utf-8 -*-
import re
def string_replace(text, key_dict):
"""
A function to convert text in a string to another string if
it matches any of the keys in the provided pattern dictionary.
Usage:
from core.utils import string_replace
KEY_DICT = {
'Isd': 'ISD',
}
s =... | <commit_before># -*- coding: utf-8 -*-
import re
def string_replace(text, key_dict):
"""
A function to convert text in a string to another string if
it matches any of the keys in the provided pattern dictionary.
"""
rx = re.compile('|'.join(map(re.escape, key_dict)))
def one_xlat(match):
... | # -*- coding: utf-8 -*-
import re
def string_replace(text, key_dict):
"""
A function to convert text in a string to another string if
it matches any of the keys in the provided pattern dictionary.
Usage:
from core.utils import string_replace
KEY_DICT = {
'Isd': 'ISD',
}
s =... | # -*- coding: utf-8 -*-
import re
def string_replace(text, key_dict):
"""
A function to convert text in a string to another string if
it matches any of the keys in the provided pattern dictionary.
"""
rx = re.compile('|'.join(map(re.escape, key_dict)))
def one_xlat(match):
return key... | <commit_before># -*- coding: utf-8 -*-
import re
def string_replace(text, key_dict):
"""
A function to convert text in a string to another string if
it matches any of the keys in the provided pattern dictionary.
"""
rx = re.compile('|'.join(map(re.escape, key_dict)))
def one_xlat(match):
... |
72538db91eb722240bc23defd688f11356c54c25 | scripts/balance.py | scripts/balance.py | #!/usr/bin/env python
from __future__ import division, print_function
from multiprocessing import Pool
import numpy as np
import h5py
import cooler
import cooler.ice
N_CPUS = 5
if __name__ == '__main__':
# Compute a genome-wide balancing/bias/normalization vector
# *** assumes uniform binning ***
chunks... | #!/usr/bin/env python
from __future__ import division, print_function
from multiprocessing import Pool
import argparse
import numpy as np
import h5py
import cooler
import cooler.ice
N_CPUS = 5
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description="Compute a genome-wide balancing/bias/... | Add arg parser to balancing script | Add arg parser to balancing script
| Python | bsd-3-clause | mirnylab/cooler | #!/usr/bin/env python
from __future__ import division, print_function
from multiprocessing import Pool
import numpy as np
import h5py
import cooler
import cooler.ice
N_CPUS = 5
if __name__ == '__main__':
# Compute a genome-wide balancing/bias/normalization vector
# *** assumes uniform binning ***
chunks... | #!/usr/bin/env python
from __future__ import division, print_function
from multiprocessing import Pool
import argparse
import numpy as np
import h5py
import cooler
import cooler.ice
N_CPUS = 5
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description="Compute a genome-wide balancing/bias/... | <commit_before>#!/usr/bin/env python
from __future__ import division, print_function
from multiprocessing import Pool
import numpy as np
import h5py
import cooler
import cooler.ice
N_CPUS = 5
if __name__ == '__main__':
# Compute a genome-wide balancing/bias/normalization vector
# *** assumes uniform binning... | #!/usr/bin/env python
from __future__ import division, print_function
from multiprocessing import Pool
import argparse
import numpy as np
import h5py
import cooler
import cooler.ice
N_CPUS = 5
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description="Compute a genome-wide balancing/bias/... | #!/usr/bin/env python
from __future__ import division, print_function
from multiprocessing import Pool
import numpy as np
import h5py
import cooler
import cooler.ice
N_CPUS = 5
if __name__ == '__main__':
# Compute a genome-wide balancing/bias/normalization vector
# *** assumes uniform binning ***
chunks... | <commit_before>#!/usr/bin/env python
from __future__ import division, print_function
from multiprocessing import Pool
import numpy as np
import h5py
import cooler
import cooler.ice
N_CPUS = 5
if __name__ == '__main__':
# Compute a genome-wide balancing/bias/normalization vector
# *** assumes uniform binning... |
f4b0d6855a56270435f3fff65d4652abc2da518a | casepro/settings_production_momza.py | casepro/settings_production_momza.py | from __future__ import unicode_literals
import os
# import our default settings
from settings_production import * # noqa
PODS[0]['contact_id_fieldname'] = os.environ.get( # noqa: F405
'REGISTRATION_CONTACT_ID_FIELDNAME',
'registrant_id',
)
PODS[0]['field_mapping'] = [ # noqa: F405
{"field": "faccode",... | from __future__ import unicode_literals
import os
# import our default settings
from settings_production import * # noqa
LOGGING['loggers']['casepro.backend.junebug'] = {
'handlers': ['console'],
'level': 'INFO',
}
PODS[0]['contact_id_fieldname'] = os.environ.get( # noqa: F405
'REGISTRATION_CONTACT_ID... | Add logger for junebug backend | Add logger for junebug backend
| Python | bsd-3-clause | praekelt/casepro,praekelt/casepro,praekelt/casepro | from __future__ import unicode_literals
import os
# import our default settings
from settings_production import * # noqa
PODS[0]['contact_id_fieldname'] = os.environ.get( # noqa: F405
'REGISTRATION_CONTACT_ID_FIELDNAME',
'registrant_id',
)
PODS[0]['field_mapping'] = [ # noqa: F405
{"field": "faccode",... | from __future__ import unicode_literals
import os
# import our default settings
from settings_production import * # noqa
LOGGING['loggers']['casepro.backend.junebug'] = {
'handlers': ['console'],
'level': 'INFO',
}
PODS[0]['contact_id_fieldname'] = os.environ.get( # noqa: F405
'REGISTRATION_CONTACT_ID... | <commit_before>from __future__ import unicode_literals
import os
# import our default settings
from settings_production import * # noqa
PODS[0]['contact_id_fieldname'] = os.environ.get( # noqa: F405
'REGISTRATION_CONTACT_ID_FIELDNAME',
'registrant_id',
)
PODS[0]['field_mapping'] = [ # noqa: F405
{"fie... | from __future__ import unicode_literals
import os
# import our default settings
from settings_production import * # noqa
LOGGING['loggers']['casepro.backend.junebug'] = {
'handlers': ['console'],
'level': 'INFO',
}
PODS[0]['contact_id_fieldname'] = os.environ.get( # noqa: F405
'REGISTRATION_CONTACT_ID... | from __future__ import unicode_literals
import os
# import our default settings
from settings_production import * # noqa
PODS[0]['contact_id_fieldname'] = os.environ.get( # noqa: F405
'REGISTRATION_CONTACT_ID_FIELDNAME',
'registrant_id',
)
PODS[0]['field_mapping'] = [ # noqa: F405
{"field": "faccode",... | <commit_before>from __future__ import unicode_literals
import os
# import our default settings
from settings_production import * # noqa
PODS[0]['contact_id_fieldname'] = os.environ.get( # noqa: F405
'REGISTRATION_CONTACT_ID_FIELDNAME',
'registrant_id',
)
PODS[0]['field_mapping'] = [ # noqa: F405
{"fie... |
27e38309648c3c54dd8dd5dca1d1d19ff9d7381f | private_media/urls.py | private_media/urls.py | from django.conf.urls import url
from django.conf import settings
from views import serve_private_file
urlpatterns = [
url(r'^{0}(?P<path>.*)$'.format(settings.PRIVATE_MEDIA_URL.lstrip('/')), serve_private_file),
]
| from django.conf.urls import url
from django.conf import settings
from .views import serve_private_file
urlpatterns = [
url(r'^{0}(?P<path>.*)$'.format(settings.PRIVATE_MEDIA_URL.lstrip('/')), serve_private_file),
]
| Use local import for local files. | Use local import for local files. | Python | bsd-3-clause | sha-red/django-private-media | from django.conf.urls import url
from django.conf import settings
from views import serve_private_file
urlpatterns = [
url(r'^{0}(?P<path>.*)$'.format(settings.PRIVATE_MEDIA_URL.lstrip('/')), serve_private_file),
]
Use local import for local files. | from django.conf.urls import url
from django.conf import settings
from .views import serve_private_file
urlpatterns = [
url(r'^{0}(?P<path>.*)$'.format(settings.PRIVATE_MEDIA_URL.lstrip('/')), serve_private_file),
]
| <commit_before>from django.conf.urls import url
from django.conf import settings
from views import serve_private_file
urlpatterns = [
url(r'^{0}(?P<path>.*)$'.format(settings.PRIVATE_MEDIA_URL.lstrip('/')), serve_private_file),
]
<commit_msg>Use local import for local files.<commit_after> | from django.conf.urls import url
from django.conf import settings
from .views import serve_private_file
urlpatterns = [
url(r'^{0}(?P<path>.*)$'.format(settings.PRIVATE_MEDIA_URL.lstrip('/')), serve_private_file),
]
| from django.conf.urls import url
from django.conf import settings
from views import serve_private_file
urlpatterns = [
url(r'^{0}(?P<path>.*)$'.format(settings.PRIVATE_MEDIA_URL.lstrip('/')), serve_private_file),
]
Use local import for local files.from django.conf.urls import url
from django.conf import settings
... | <commit_before>from django.conf.urls import url
from django.conf import settings
from views import serve_private_file
urlpatterns = [
url(r'^{0}(?P<path>.*)$'.format(settings.PRIVATE_MEDIA_URL.lstrip('/')), serve_private_file),
]
<commit_msg>Use local import for local files.<commit_after>from django.conf.urls imp... |
e53715c6ee7896d459a46c810480b12dc7a6b5ad | tg/dottednames/jinja_lookup.py | tg/dottednames/jinja_lookup.py | """Genshi template loader that supports dotted names."""
from os.path import exists, getmtime
from jinja2.exceptions import TemplateNotFound
from jinja2.loaders import FileSystemLoader
from tg import config
class JinjaTemplateLoader(FileSystemLoader):
"""Jinja template loader supporting dotted filenames. Based... | """Genshi template loader that supports dotted names."""
from os.path import exists, getmtime
from jinja2.exceptions import TemplateNotFound
from jinja2.loaders import FileSystemLoader
from tg import config
class JinjaTemplateLoader(FileSystemLoader):
"""Jinja template loader supporting dotted filenames. Based... | Fix jinja loader on Py3 | Fix jinja loader on Py3
| Python | mit | lucius-feng/tg2,lucius-feng/tg2 | """Genshi template loader that supports dotted names."""
from os.path import exists, getmtime
from jinja2.exceptions import TemplateNotFound
from jinja2.loaders import FileSystemLoader
from tg import config
class JinjaTemplateLoader(FileSystemLoader):
"""Jinja template loader supporting dotted filenames. Based... | """Genshi template loader that supports dotted names."""
from os.path import exists, getmtime
from jinja2.exceptions import TemplateNotFound
from jinja2.loaders import FileSystemLoader
from tg import config
class JinjaTemplateLoader(FileSystemLoader):
"""Jinja template loader supporting dotted filenames. Based... | <commit_before>"""Genshi template loader that supports dotted names."""
from os.path import exists, getmtime
from jinja2.exceptions import TemplateNotFound
from jinja2.loaders import FileSystemLoader
from tg import config
class JinjaTemplateLoader(FileSystemLoader):
"""Jinja template loader supporting dotted f... | """Genshi template loader that supports dotted names."""
from os.path import exists, getmtime
from jinja2.exceptions import TemplateNotFound
from jinja2.loaders import FileSystemLoader
from tg import config
class JinjaTemplateLoader(FileSystemLoader):
"""Jinja template loader supporting dotted filenames. Based... | """Genshi template loader that supports dotted names."""
from os.path import exists, getmtime
from jinja2.exceptions import TemplateNotFound
from jinja2.loaders import FileSystemLoader
from tg import config
class JinjaTemplateLoader(FileSystemLoader):
"""Jinja template loader supporting dotted filenames. Based... | <commit_before>"""Genshi template loader that supports dotted names."""
from os.path import exists, getmtime
from jinja2.exceptions import TemplateNotFound
from jinja2.loaders import FileSystemLoader
from tg import config
class JinjaTemplateLoader(FileSystemLoader):
"""Jinja template loader supporting dotted f... |
2a83a1606ffb7e761592a5b0a73e31d9b8b1fe08 | bin/example_game_programmatic.py | bin/example_game_programmatic.py | from vengeance.game import Direction
from vengeance.game import Game
from vengeance.game import Location
go_up = Direction('up')
go_down = Direction('down')
go_up.opposite = go_down
go_in = Direction('in')
go_out = Direction('out')
go_in.opposite = go_out
go_west = Direction('west')
go_east = Direction('east')
go_we... | from vengeance.game import Direction
from vengeance.game import Game
from vengeance.game import Location
go_up = Direction('up')
go_down = Direction('down')
go_up.opposite = go_down
go_in = Direction('in')
go_out = Direction('out')
go_in.opposite = go_out
go_west = Direction('west')
go_east = Direction('east')
go_we... | Add Game.process_input use to example code | Add Game.process_input use to example code
| Python | unlicense | mmurdoch/Vengeance,mmurdoch/Vengeance | from vengeance.game import Direction
from vengeance.game import Game
from vengeance.game import Location
go_up = Direction('up')
go_down = Direction('down')
go_up.opposite = go_down
go_in = Direction('in')
go_out = Direction('out')
go_in.opposite = go_out
go_west = Direction('west')
go_east = Direction('east')
go_we... | from vengeance.game import Direction
from vengeance.game import Game
from vengeance.game import Location
go_up = Direction('up')
go_down = Direction('down')
go_up.opposite = go_down
go_in = Direction('in')
go_out = Direction('out')
go_in.opposite = go_out
go_west = Direction('west')
go_east = Direction('east')
go_we... | <commit_before>from vengeance.game import Direction
from vengeance.game import Game
from vengeance.game import Location
go_up = Direction('up')
go_down = Direction('down')
go_up.opposite = go_down
go_in = Direction('in')
go_out = Direction('out')
go_in.opposite = go_out
go_west = Direction('west')
go_east = Directio... | from vengeance.game import Direction
from vengeance.game import Game
from vengeance.game import Location
go_up = Direction('up')
go_down = Direction('down')
go_up.opposite = go_down
go_in = Direction('in')
go_out = Direction('out')
go_in.opposite = go_out
go_west = Direction('west')
go_east = Direction('east')
go_we... | from vengeance.game import Direction
from vengeance.game import Game
from vengeance.game import Location
go_up = Direction('up')
go_down = Direction('down')
go_up.opposite = go_down
go_in = Direction('in')
go_out = Direction('out')
go_in.opposite = go_out
go_west = Direction('west')
go_east = Direction('east')
go_we... | <commit_before>from vengeance.game import Direction
from vengeance.game import Game
from vengeance.game import Location
go_up = Direction('up')
go_down = Direction('down')
go_up.opposite = go_down
go_in = Direction('in')
go_out = Direction('out')
go_in.opposite = go_out
go_west = Direction('west')
go_east = Directio... |
23b54e836a94a2d1ebdb919a30d19ca4523d45b5 | project_template.py | project_template.py | import sublime
import sublime_plugin
class ProjectTemplateCommand(sublime_plugin.WindowCommand):
SETTINGS_FILE_NAME = 'ProjectTemplate.sublime-settings'
TEMPLATES_KEY = 'templates'
def run(self):
# Check whether the folder is open only one in the current window.
folders = self.window.fol... | import sublime
import sublime_plugin
class ProjectTemplateCommand(sublime_plugin.WindowCommand):
SETTINGS_FILE_NAME = 'ProjectTemplate.sublime-settings'
TEMPLATES_KEY = 'templates'
def run(self):
# Check whether the folder is open only one in the current window.
folders = self.window.fol... | Implement selecting template by quick panel | Implement selecting template by quick panel
| Python | mit | autopp/SublimeProjectTemplate,autopp/SublimeProjectTemplate | import sublime
import sublime_plugin
class ProjectTemplateCommand(sublime_plugin.WindowCommand):
SETTINGS_FILE_NAME = 'ProjectTemplate.sublime-settings'
TEMPLATES_KEY = 'templates'
def run(self):
# Check whether the folder is open only one in the current window.
folders = self.window.fol... | import sublime
import sublime_plugin
class ProjectTemplateCommand(sublime_plugin.WindowCommand):
SETTINGS_FILE_NAME = 'ProjectTemplate.sublime-settings'
TEMPLATES_KEY = 'templates'
def run(self):
# Check whether the folder is open only one in the current window.
folders = self.window.fol... | <commit_before>import sublime
import sublime_plugin
class ProjectTemplateCommand(sublime_plugin.WindowCommand):
SETTINGS_FILE_NAME = 'ProjectTemplate.sublime-settings'
TEMPLATES_KEY = 'templates'
def run(self):
# Check whether the folder is open only one in the current window.
folders = ... | import sublime
import sublime_plugin
class ProjectTemplateCommand(sublime_plugin.WindowCommand):
SETTINGS_FILE_NAME = 'ProjectTemplate.sublime-settings'
TEMPLATES_KEY = 'templates'
def run(self):
# Check whether the folder is open only one in the current window.
folders = self.window.fol... | import sublime
import sublime_plugin
class ProjectTemplateCommand(sublime_plugin.WindowCommand):
SETTINGS_FILE_NAME = 'ProjectTemplate.sublime-settings'
TEMPLATES_KEY = 'templates'
def run(self):
# Check whether the folder is open only one in the current window.
folders = self.window.fol... | <commit_before>import sublime
import sublime_plugin
class ProjectTemplateCommand(sublime_plugin.WindowCommand):
SETTINGS_FILE_NAME = 'ProjectTemplate.sublime-settings'
TEMPLATES_KEY = 'templates'
def run(self):
# Check whether the folder is open only one in the current window.
folders = ... |
9f71fd2df043bc6eedbd945100633d3184356c89 | tools/pyhande/pyhande/utils.py | tools/pyhande/pyhande/utils.py | '''Utility procedures for manipulating HANDE data.'''
import numpy as np
def groupby_beta_loops(data):
'''Group a HANDE DMQMC data table by beta loop.
Parameters
----------
data : :class:`pandas.DataFrame`
DMQMC data table (e.g. obtained by :func:`pyhande.extract.extract_data`.
Returns
-------
grouped : :cl... | '''Utility procedures for manipulating HANDE data.'''
import numpy as np
def groupby_beta_loops(data, name='iterations'):
'''Group a HANDE DMQMC data table by beta loop.
Parameters
----------
data : :class:`pandas.DataFrame`
DMQMC data table (e.g. obtained by :func:`pyhande.extract.extract_data`.
Returns
--... | Correct location of bracket so that grouping by beta loops is done correctly. | Correct location of bracket so that grouping by beta loops is done correctly.
| Python | lgpl-2.1 | hande-qmc/hande,hande-qmc/hande,hande-qmc/hande,ruthfranklin/hande,hande-qmc/hande,hande-qmc/hande | '''Utility procedures for manipulating HANDE data.'''
import numpy as np
def groupby_beta_loops(data):
'''Group a HANDE DMQMC data table by beta loop.
Parameters
----------
data : :class:`pandas.DataFrame`
DMQMC data table (e.g. obtained by :func:`pyhande.extract.extract_data`.
Returns
-------
grouped : :cl... | '''Utility procedures for manipulating HANDE data.'''
import numpy as np
def groupby_beta_loops(data, name='iterations'):
'''Group a HANDE DMQMC data table by beta loop.
Parameters
----------
data : :class:`pandas.DataFrame`
DMQMC data table (e.g. obtained by :func:`pyhande.extract.extract_data`.
Returns
--... | <commit_before>'''Utility procedures for manipulating HANDE data.'''
import numpy as np
def groupby_beta_loops(data):
'''Group a HANDE DMQMC data table by beta loop.
Parameters
----------
data : :class:`pandas.DataFrame`
DMQMC data table (e.g. obtained by :func:`pyhande.extract.extract_data`.
Returns
------... | '''Utility procedures for manipulating HANDE data.'''
import numpy as np
def groupby_beta_loops(data, name='iterations'):
'''Group a HANDE DMQMC data table by beta loop.
Parameters
----------
data : :class:`pandas.DataFrame`
DMQMC data table (e.g. obtained by :func:`pyhande.extract.extract_data`.
Returns
--... | '''Utility procedures for manipulating HANDE data.'''
import numpy as np
def groupby_beta_loops(data):
'''Group a HANDE DMQMC data table by beta loop.
Parameters
----------
data : :class:`pandas.DataFrame`
DMQMC data table (e.g. obtained by :func:`pyhande.extract.extract_data`.
Returns
-------
grouped : :cl... | <commit_before>'''Utility procedures for manipulating HANDE data.'''
import numpy as np
def groupby_beta_loops(data):
'''Group a HANDE DMQMC data table by beta loop.
Parameters
----------
data : :class:`pandas.DataFrame`
DMQMC data table (e.g. obtained by :func:`pyhande.extract.extract_data`.
Returns
------... |
7a8a2556bbeb255c991aa5a39aa04b4fed238a7b | kolibri/plugins/setup_wizard/middleware.py | kolibri/plugins/setup_wizard/middleware.py | from django.core.urlresolvers import reverse
from django.shortcuts import redirect
from kolibri.auth.models import DeviceOwner
ALLOWED_PATH_LIST = [
"facility-list",
"deviceowner-list",
"kolibri:setupwizardplugin:setupwizard",
"task-localdrive",
"task-startremoteimport",
"task-list",
]
class... | from django.core.urlresolvers import reverse
from django.shortcuts import redirect
from kolibri.auth.models import DeviceOwner
ALLOWED_PATH_LIST = [
"facility-list",
"deviceowner-list",
"kolibri:setupwizardplugin:setupwizard",
"task-localdrive",
"task-startremoteimport",
"task-list",
"sess... | Add 'session-list' to constants list. | Add 'session-list' to constants list.
| Python | mit | DXCanas/kolibri,christianmemije/kolibri,learningequality/kolibri,jonboiser/kolibri,jonboiser/kolibri,rtibbles/kolibri,aronasorman/kolibri,learningequality/kolibri,rtibbles/kolibri,christianmemije/kolibri,jayoshih/kolibri,jayoshih/kolibri,jayoshih/kolibri,learningequality/kolibri,christianmemije/kolibri,DXCanas/kolibri,... | from django.core.urlresolvers import reverse
from django.shortcuts import redirect
from kolibri.auth.models import DeviceOwner
ALLOWED_PATH_LIST = [
"facility-list",
"deviceowner-list",
"kolibri:setupwizardplugin:setupwizard",
"task-localdrive",
"task-startremoteimport",
"task-list",
]
class... | from django.core.urlresolvers import reverse
from django.shortcuts import redirect
from kolibri.auth.models import DeviceOwner
ALLOWED_PATH_LIST = [
"facility-list",
"deviceowner-list",
"kolibri:setupwizardplugin:setupwizard",
"task-localdrive",
"task-startremoteimport",
"task-list",
"sess... | <commit_before>from django.core.urlresolvers import reverse
from django.shortcuts import redirect
from kolibri.auth.models import DeviceOwner
ALLOWED_PATH_LIST = [
"facility-list",
"deviceowner-list",
"kolibri:setupwizardplugin:setupwizard",
"task-localdrive",
"task-startremoteimport",
"task-l... | from django.core.urlresolvers import reverse
from django.shortcuts import redirect
from kolibri.auth.models import DeviceOwner
ALLOWED_PATH_LIST = [
"facility-list",
"deviceowner-list",
"kolibri:setupwizardplugin:setupwizard",
"task-localdrive",
"task-startremoteimport",
"task-list",
"sess... | from django.core.urlresolvers import reverse
from django.shortcuts import redirect
from kolibri.auth.models import DeviceOwner
ALLOWED_PATH_LIST = [
"facility-list",
"deviceowner-list",
"kolibri:setupwizardplugin:setupwizard",
"task-localdrive",
"task-startremoteimport",
"task-list",
]
class... | <commit_before>from django.core.urlresolvers import reverse
from django.shortcuts import redirect
from kolibri.auth.models import DeviceOwner
ALLOWED_PATH_LIST = [
"facility-list",
"deviceowner-list",
"kolibri:setupwizardplugin:setupwizard",
"task-localdrive",
"task-startremoteimport",
"task-l... |
d3f63e13499af783fe63f86ffbd23e30b7bed518 | tests/settings/common.py | tests/settings/common.py | SECRET_KEY = 'p&grn73^$c!ae=o)igek_rn2t#(_sb9g1kqwxcpv16-ie__1=1'
DEBUG = True
TEMPLATE_DEBUG = True
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django... | SECRET_KEY = 'p&grn73^$c!ae=o)igek_rn2t#(_sb9g1kqwxcpv16-ie__1=1'
DEBUG = True
TEMPLATE_DEBUG = True
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django... | Add the tests app to the INSTALLED_APPS. | Add the tests app to the INSTALLED_APPS.
| Python | bsd-3-clause | unt-libraries/django-premis-event-service,unt-libraries/django-premis-event-service,unt-libraries/django-premis-event-service | SECRET_KEY = 'p&grn73^$c!ae=o)igek_rn2t#(_sb9g1kqwxcpv16-ie__1=1'
DEBUG = True
TEMPLATE_DEBUG = True
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django... | SECRET_KEY = 'p&grn73^$c!ae=o)igek_rn2t#(_sb9g1kqwxcpv16-ie__1=1'
DEBUG = True
TEMPLATE_DEBUG = True
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django... | <commit_before>SECRET_KEY = 'p&grn73^$c!ae=o)igek_rn2t#(_sb9g1kqwxcpv16-ie__1=1'
DEBUG = True
TEMPLATE_DEBUG = True
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfile... | SECRET_KEY = 'p&grn73^$c!ae=o)igek_rn2t#(_sb9g1kqwxcpv16-ie__1=1'
DEBUG = True
TEMPLATE_DEBUG = True
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django... | SECRET_KEY = 'p&grn73^$c!ae=o)igek_rn2t#(_sb9g1kqwxcpv16-ie__1=1'
DEBUG = True
TEMPLATE_DEBUG = True
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django... | <commit_before>SECRET_KEY = 'p&grn73^$c!ae=o)igek_rn2t#(_sb9g1kqwxcpv16-ie__1=1'
DEBUG = True
TEMPLATE_DEBUG = True
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfile... |
46c0543306d11551f9c818922dc2b2b4bf3d3b4d | byceps/services/email/service.py | byceps/services/email/service.py | """
byceps.services.email.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2017 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from typing import List, Optional
from ... import email
from ...typing import BrandID
from .models import EmailConfig
def find_sender_address_for_brand(br... | """
byceps.services.email.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2017 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from typing import List, Optional
from ... import email
from ...typing import BrandID
from ...util.jobqueue import enqueue
from .models import EmailConfig
... | Add function to enqueue e-mails to be sent asynchronously rather than blocking/sending synchronously | Add function to enqueue e-mails to be sent asynchronously rather than blocking/sending synchronously
| Python | bsd-3-clause | homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps | """
byceps.services.email.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2017 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from typing import List, Optional
from ... import email
from ...typing import BrandID
from .models import EmailConfig
def find_sender_address_for_brand(br... | """
byceps.services.email.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2017 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from typing import List, Optional
from ... import email
from ...typing import BrandID
from ...util.jobqueue import enqueue
from .models import EmailConfig
... | <commit_before>"""
byceps.services.email.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2017 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from typing import List, Optional
from ... import email
from ...typing import BrandID
from .models import EmailConfig
def find_sender_addre... | """
byceps.services.email.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2017 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from typing import List, Optional
from ... import email
from ...typing import BrandID
from ...util.jobqueue import enqueue
from .models import EmailConfig
... | """
byceps.services.email.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2017 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from typing import List, Optional
from ... import email
from ...typing import BrandID
from .models import EmailConfig
def find_sender_address_for_brand(br... | <commit_before>"""
byceps.services.email.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2017 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from typing import List, Optional
from ... import email
from ...typing import BrandID
from .models import EmailConfig
def find_sender_addre... |
77ac03544f85e95603507e1dc0cec2189e0d5a03 | get_ip.py | get_ip.py | #!/usr/bin/python
#
# Get private IPv4s for a given instance name.
#
import boto
import boto.ec2
import getopt
import sys
#
# Get the profile
#
def connect(region):
profile = metadata['iam']['info']['InstanceProfileArn']
profile = profile[profile.find('/') + 1:]
conn = boto.ec2.connection.EC2Connection(
... | #!/usr/bin/python
#
# Get private IPv4s for a given instance name.
#
import boto
import boto.ec2
import getopt
import sys
#
# Get the profile
#
def connect():
metadata = boto.utils.get_instance_metadata()
region = metadata['placement']['availability-zone'][:-1]
profile = metadata['iam']['info']['InstanceP... | Add python script for IPs discovery | Add python script for IPs discovery
| Python | bsd-3-clause | GetStream/Stream-Framework-Bench,GetStream/Stream-Framework-Bench | #!/usr/bin/python
#
# Get private IPv4s for a given instance name.
#
import boto
import boto.ec2
import getopt
import sys
#
# Get the profile
#
def connect(region):
profile = metadata['iam']['info']['InstanceProfileArn']
profile = profile[profile.find('/') + 1:]
conn = boto.ec2.connection.EC2Connection(
... | #!/usr/bin/python
#
# Get private IPv4s for a given instance name.
#
import boto
import boto.ec2
import getopt
import sys
#
# Get the profile
#
def connect():
metadata = boto.utils.get_instance_metadata()
region = metadata['placement']['availability-zone'][:-1]
profile = metadata['iam']['info']['InstanceP... | <commit_before>#!/usr/bin/python
#
# Get private IPv4s for a given instance name.
#
import boto
import boto.ec2
import getopt
import sys
#
# Get the profile
#
def connect(region):
profile = metadata['iam']['info']['InstanceProfileArn']
profile = profile[profile.find('/') + 1:]
conn = boto.ec2.connection.... | #!/usr/bin/python
#
# Get private IPv4s for a given instance name.
#
import boto
import boto.ec2
import getopt
import sys
#
# Get the profile
#
def connect():
metadata = boto.utils.get_instance_metadata()
region = metadata['placement']['availability-zone'][:-1]
profile = metadata['iam']['info']['InstanceP... | #!/usr/bin/python
#
# Get private IPv4s for a given instance name.
#
import boto
import boto.ec2
import getopt
import sys
#
# Get the profile
#
def connect(region):
profile = metadata['iam']['info']['InstanceProfileArn']
profile = profile[profile.find('/') + 1:]
conn = boto.ec2.connection.EC2Connection(
... | <commit_before>#!/usr/bin/python
#
# Get private IPv4s for a given instance name.
#
import boto
import boto.ec2
import getopt
import sys
#
# Get the profile
#
def connect(region):
profile = metadata['iam']['info']['InstanceProfileArn']
profile = profile[profile.find('/') + 1:]
conn = boto.ec2.connection.... |
7fabf481ed788350aa0c94eec7c71d6cfb75c14a | store/forms.py | store/forms.py | from django import forms
from .models import Review
class ReviewForm(forms.models.ModelForm):
name = forms.CharField(
max_length=30,
widget=forms.TextInput(
attrs={
'placeholder': 'Your Name',
'class': 'form-control',
}),
)
... | from django import forms
from .models import Review
class ReviewForm(forms.models.ModelForm):
name = forms.CharField(
max_length=30,
widget=forms.TextInput(
attrs={
'placeholder': 'Your Name',
'class': 'form-control',
}),
)
... | Add product field to ReviewForm | Add product field to ReviewForm
| Python | bsd-3-clause | kevgathuku/compshop,kevgathuku/compshop,andela-kndungu/compshop,kevgathuku/compshop,andela-kndungu/compshop,andela-kndungu/compshop,kevgathuku/compshop,andela-kndungu/compshop | from django import forms
from .models import Review
class ReviewForm(forms.models.ModelForm):
name = forms.CharField(
max_length=30,
widget=forms.TextInput(
attrs={
'placeholder': 'Your Name',
'class': 'form-control',
}),
)
... | from django import forms
from .models import Review
class ReviewForm(forms.models.ModelForm):
name = forms.CharField(
max_length=30,
widget=forms.TextInput(
attrs={
'placeholder': 'Your Name',
'class': 'form-control',
}),
)
... | <commit_before>from django import forms
from .models import Review
class ReviewForm(forms.models.ModelForm):
name = forms.CharField(
max_length=30,
widget=forms.TextInput(
attrs={
'placeholder': 'Your Name',
'class': 'form-control',
}),
... | from django import forms
from .models import Review
class ReviewForm(forms.models.ModelForm):
name = forms.CharField(
max_length=30,
widget=forms.TextInput(
attrs={
'placeholder': 'Your Name',
'class': 'form-control',
}),
)
... | from django import forms
from .models import Review
class ReviewForm(forms.models.ModelForm):
name = forms.CharField(
max_length=30,
widget=forms.TextInput(
attrs={
'placeholder': 'Your Name',
'class': 'form-control',
}),
)
... | <commit_before>from django import forms
from .models import Review
class ReviewForm(forms.models.ModelForm):
name = forms.CharField(
max_length=30,
widget=forms.TextInput(
attrs={
'placeholder': 'Your Name',
'class': 'form-control',
}),
... |
4561586f3f1de1a7a86213bec3ddd6273c223cdd | runtests.py | runtests.py | """
Standalone test runner for wardrounds plugin
"""
import os
import sys
from opal.core import application
class Application(application.OpalApplication):
pass
from django.conf import settings
settings.configure(DEBUG=True,
DATABASES={
'default': {
... | """
Standalone test runner for wardrounds plugin
"""
import sys
from opal.core import application
class Application(application.OpalApplication):
pass
from django.conf import settings
settings.configure(DEBUG=True,
DATABASES={
'default': {
'ENG... | Kill an Unused import - thanks to @landscapeio | Kill an Unused import - thanks to @landscapeio
| Python | agpl-3.0 | openhealthcare/opal-referral,openhealthcare/opal-referral,openhealthcare/opal-referral,openhealthcare/opal-referral | """
Standalone test runner for wardrounds plugin
"""
import os
import sys
from opal.core import application
class Application(application.OpalApplication):
pass
from django.conf import settings
settings.configure(DEBUG=True,
DATABASES={
'default': {
... | """
Standalone test runner for wardrounds plugin
"""
import sys
from opal.core import application
class Application(application.OpalApplication):
pass
from django.conf import settings
settings.configure(DEBUG=True,
DATABASES={
'default': {
'ENG... | <commit_before>"""
Standalone test runner for wardrounds plugin
"""
import os
import sys
from opal.core import application
class Application(application.OpalApplication):
pass
from django.conf import settings
settings.configure(DEBUG=True,
DATABASES={
'default': {
... | """
Standalone test runner for wardrounds plugin
"""
import sys
from opal.core import application
class Application(application.OpalApplication):
pass
from django.conf import settings
settings.configure(DEBUG=True,
DATABASES={
'default': {
'ENG... | """
Standalone test runner for wardrounds plugin
"""
import os
import sys
from opal.core import application
class Application(application.OpalApplication):
pass
from django.conf import settings
settings.configure(DEBUG=True,
DATABASES={
'default': {
... | <commit_before>"""
Standalone test runner for wardrounds plugin
"""
import os
import sys
from opal.core import application
class Application(application.OpalApplication):
pass
from django.conf import settings
settings.configure(DEBUG=True,
DATABASES={
'default': {
... |
ea1189cbba231d68e82ec0fe25f33402d0ea956c | common/lib/chem/setup.py | common/lib/chem/setup.py | from setuptools import setup
setup(
name="chem",
version="0.1.1",
packages=["chem"],
install_requires=[
"pyparsing==2.0.1",
"numpy==1.6.2",
"scipy==0.14.0"
"nltk==2.0.5",
],
)
| from setuptools import setup
setup(
name="chem",
version="0.1.1",
packages=["chem"],
install_requires=[
"pyparsing==2.0.1",
"numpy==1.6.2",
"scipy==0.14.0",
"nltk==2.0.5",
],
)
| Fix syntax of previous commit | Fix syntax of previous commit
| Python | agpl-3.0 | marcore/edx-platform,marcore/edx-platform,marcore/edx-platform,marcore/edx-platform | from setuptools import setup
setup(
name="chem",
version="0.1.1",
packages=["chem"],
install_requires=[
"pyparsing==2.0.1",
"numpy==1.6.2",
"scipy==0.14.0"
"nltk==2.0.5",
],
)
Fix syntax of previous commit | from setuptools import setup
setup(
name="chem",
version="0.1.1",
packages=["chem"],
install_requires=[
"pyparsing==2.0.1",
"numpy==1.6.2",
"scipy==0.14.0",
"nltk==2.0.5",
],
)
| <commit_before>from setuptools import setup
setup(
name="chem",
version="0.1.1",
packages=["chem"],
install_requires=[
"pyparsing==2.0.1",
"numpy==1.6.2",
"scipy==0.14.0"
"nltk==2.0.5",
],
)
<commit_msg>Fix syntax of previous commit<commit_after> | from setuptools import setup
setup(
name="chem",
version="0.1.1",
packages=["chem"],
install_requires=[
"pyparsing==2.0.1",
"numpy==1.6.2",
"scipy==0.14.0",
"nltk==2.0.5",
],
)
| from setuptools import setup
setup(
name="chem",
version="0.1.1",
packages=["chem"],
install_requires=[
"pyparsing==2.0.1",
"numpy==1.6.2",
"scipy==0.14.0"
"nltk==2.0.5",
],
)
Fix syntax of previous commitfrom setuptools import setup
setup(
name="chem",
vers... | <commit_before>from setuptools import setup
setup(
name="chem",
version="0.1.1",
packages=["chem"],
install_requires=[
"pyparsing==2.0.1",
"numpy==1.6.2",
"scipy==0.14.0"
"nltk==2.0.5",
],
)
<commit_msg>Fix syntax of previous commit<commit_after>from setuptools impor... |
4aea3f18b68150f1bff7ca40d22ce69ce2be64e0 | mfr/extensions/tabular/libs/ezodf_tools.py | mfr/extensions/tabular/libs/ezodf_tools.py | """ This library works for some ods files but not others. Because it doesn't
work consistently, we have disabled this for the moment."""
import ezodf
from ..utilities import data_population, header_population
def ods_ezodf(fp):
"""Read and convert a ods file to JSON format using the ezodf library
:param fp: ... | """ This library works for some ods files but not others. Because it doesn't
work consistently, we have disabled this for the moment."""
import ezodf
from ..utilities import data_population, header_population
def ods_ezodf(fp):
"""Read and convert a ods file to JSON format using the ezodf library
:param fp: ... | Return sheets, not header, data | Return sheets, not header, data
| Python | apache-2.0 | felliott/modular-file-renderer,Johnetordoff/modular-file-renderer,TomBaxter/modular-file-renderer,rdhyee/modular-file-renderer,CenterForOpenScience/modular-file-renderer,AddisonSchiller/modular-file-renderer,AddisonSchiller/modular-file-renderer,rdhyee/modular-file-renderer,TomBaxter/modular-file-renderer,CenterForOpen... | """ This library works for some ods files but not others. Because it doesn't
work consistently, we have disabled this for the moment."""
import ezodf
from ..utilities import data_population, header_population
def ods_ezodf(fp):
"""Read and convert a ods file to JSON format using the ezodf library
:param fp: ... | """ This library works for some ods files but not others. Because it doesn't
work consistently, we have disabled this for the moment."""
import ezodf
from ..utilities import data_population, header_population
def ods_ezodf(fp):
"""Read and convert a ods file to JSON format using the ezodf library
:param fp: ... | <commit_before>""" This library works for some ods files but not others. Because it doesn't
work consistently, we have disabled this for the moment."""
import ezodf
from ..utilities import data_population, header_population
def ods_ezodf(fp):
"""Read and convert a ods file to JSON format using the ezodf library
... | """ This library works for some ods files but not others. Because it doesn't
work consistently, we have disabled this for the moment."""
import ezodf
from ..utilities import data_population, header_population
def ods_ezodf(fp):
"""Read and convert a ods file to JSON format using the ezodf library
:param fp: ... | """ This library works for some ods files but not others. Because it doesn't
work consistently, we have disabled this for the moment."""
import ezodf
from ..utilities import data_population, header_population
def ods_ezodf(fp):
"""Read and convert a ods file to JSON format using the ezodf library
:param fp: ... | <commit_before>""" This library works for some ods files but not others. Because it doesn't
work consistently, we have disabled this for the moment."""
import ezodf
from ..utilities import data_population, header_population
def ods_ezodf(fp):
"""Read and convert a ods file to JSON format using the ezodf library
... |
8a6015610bba2dcdc0a2cb031b2f58606328841f | src/fastpb/generator.py | src/fastpb/generator.py | #!/usr/bin/env python
import plugin_pb2
from jinja2 import Template
from pkg_resources import resource_string
import os.path
import sys
import tempfile
def main():
log = sys.stderr
request = plugin_pb2.CodeGeneratorRequest()
request.ParseFromString(sys.stdin.read())
path = tempfile.mkdtemp()
generateF... | #!/usr/bin/env python
import plugin_pb2
from jinja2 import Template
from pkg_resources import resource_string
import os.path
import sys
import tempfile
def main():
request = plugin_pb2.CodeGeneratorRequest()
request.ParseFromString(sys.stdin.read())
response = plugin_pb2.CodeGeneratorResponse()
generateF... | Use protoc for file output | Use protoc for file output
| Python | apache-2.0 | Cue/fast-python-pb | #!/usr/bin/env python
import plugin_pb2
from jinja2 import Template
from pkg_resources import resource_string
import os.path
import sys
import tempfile
def main():
log = sys.stderr
request = plugin_pb2.CodeGeneratorRequest()
request.ParseFromString(sys.stdin.read())
path = tempfile.mkdtemp()
generateF... | #!/usr/bin/env python
import plugin_pb2
from jinja2 import Template
from pkg_resources import resource_string
import os.path
import sys
import tempfile
def main():
request = plugin_pb2.CodeGeneratorRequest()
request.ParseFromString(sys.stdin.read())
response = plugin_pb2.CodeGeneratorResponse()
generateF... | <commit_before>#!/usr/bin/env python
import plugin_pb2
from jinja2 import Template
from pkg_resources import resource_string
import os.path
import sys
import tempfile
def main():
log = sys.stderr
request = plugin_pb2.CodeGeneratorRequest()
request.ParseFromString(sys.stdin.read())
path = tempfile.mkdtemp... | #!/usr/bin/env python
import plugin_pb2
from jinja2 import Template
from pkg_resources import resource_string
import os.path
import sys
import tempfile
def main():
request = plugin_pb2.CodeGeneratorRequest()
request.ParseFromString(sys.stdin.read())
response = plugin_pb2.CodeGeneratorResponse()
generateF... | #!/usr/bin/env python
import plugin_pb2
from jinja2 import Template
from pkg_resources import resource_string
import os.path
import sys
import tempfile
def main():
log = sys.stderr
request = plugin_pb2.CodeGeneratorRequest()
request.ParseFromString(sys.stdin.read())
path = tempfile.mkdtemp()
generateF... | <commit_before>#!/usr/bin/env python
import plugin_pb2
from jinja2 import Template
from pkg_resources import resource_string
import os.path
import sys
import tempfile
def main():
log = sys.stderr
request = plugin_pb2.CodeGeneratorRequest()
request.ParseFromString(sys.stdin.read())
path = tempfile.mkdtemp... |
fae5db20daa1e7bcb1b915ce7f3ca84ae8bd4a1f | client/scripts/install-plugin.py | client/scripts/install-plugin.py | import argparse, shutil, os
import ue4util
def install_plugin(project_file, plugin_folder):
project_folder = os.path.dirname(project_file)
install_folder = os.path.join(project_folder, 'Plugins', 'unrealcv')
if os.path.isdir(install_folder):
shutil.rmtree(install_folder) # Complete remove old versio... | import argparse, shutil, os
import ue4util
def install_plugin(project_file, plugin_folder):
project_folder = os.path.dirname(project_file)
install_folder = os.path.join(project_folder, 'Plugins', 'unrealcv')
if os.path.isdir(install_folder):
shutil.rmtree(install_folder) # Complete remove old versio... | Update relative path with respect to __file__ | Update relative path with respect to __file__
| Python | mit | qiuwch/unrealcv,qiuwch/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv,qiuwch/unrealcv,unrealcv/unrealcv,qiuwch/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv | import argparse, shutil, os
import ue4util
def install_plugin(project_file, plugin_folder):
project_folder = os.path.dirname(project_file)
install_folder = os.path.join(project_folder, 'Plugins', 'unrealcv')
if os.path.isdir(install_folder):
shutil.rmtree(install_folder) # Complete remove old versio... | import argparse, shutil, os
import ue4util
def install_plugin(project_file, plugin_folder):
project_folder = os.path.dirname(project_file)
install_folder = os.path.join(project_folder, 'Plugins', 'unrealcv')
if os.path.isdir(install_folder):
shutil.rmtree(install_folder) # Complete remove old versio... | <commit_before>import argparse, shutil, os
import ue4util
def install_plugin(project_file, plugin_folder):
project_folder = os.path.dirname(project_file)
install_folder = os.path.join(project_folder, 'Plugins', 'unrealcv')
if os.path.isdir(install_folder):
shutil.rmtree(install_folder) # Complete re... | import argparse, shutil, os
import ue4util
def install_plugin(project_file, plugin_folder):
project_folder = os.path.dirname(project_file)
install_folder = os.path.join(project_folder, 'Plugins', 'unrealcv')
if os.path.isdir(install_folder):
shutil.rmtree(install_folder) # Complete remove old versio... | import argparse, shutil, os
import ue4util
def install_plugin(project_file, plugin_folder):
project_folder = os.path.dirname(project_file)
install_folder = os.path.join(project_folder, 'Plugins', 'unrealcv')
if os.path.isdir(install_folder):
shutil.rmtree(install_folder) # Complete remove old versio... | <commit_before>import argparse, shutil, os
import ue4util
def install_plugin(project_file, plugin_folder):
project_folder = os.path.dirname(project_file)
install_folder = os.path.join(project_folder, 'Plugins', 'unrealcv')
if os.path.isdir(install_folder):
shutil.rmtree(install_folder) # Complete re... |
12c4b11c6ef49e1a3adcb67217fc2feb8dbc9e4c | scenario/_consts.py | scenario/_consts.py | from collections import OrderedDict
ACTORS = list('NRAIOVF')
FILE_COMMANDS = ['copy', 'compare']
VERBOSITY = OrderedDict(
[ ('RETURN_CODE', 0),
('RESULT' , 1),
('ERROR' , 2),
('EXECUTION' , 3),
('DEBUG' , 4),
])
VERBOSITY_DEFAULT... | from collections import OrderedDict
ACTORS = list('NRAIOVF')
FILE_COMMANDS = ['copy', 'compare']
VERBOSITY = OrderedDict(
[ ('RETURN_CODE', 0),
('RESULT' , 1),
('ERROR' , 2),
('EXECUTION' , 3),
('DEBUG' , 4),
])
VERBOSITY_DEFAULT... | Revert "Update timeout to 10 seconds" | Revert "Update timeout to 10 seconds"
This reverts commit e7cb98a1006d292a96670a11c807d0bbf9075ebd.
| Python | mit | shlomihod/scenario,shlomihod/scenario,shlomihod/scenario | from collections import OrderedDict
ACTORS = list('NRAIOVF')
FILE_COMMANDS = ['copy', 'compare']
VERBOSITY = OrderedDict(
[ ('RETURN_CODE', 0),
('RESULT' , 1),
('ERROR' , 2),
('EXECUTION' , 3),
('DEBUG' , 4),
])
VERBOSITY_DEFAULT... | from collections import OrderedDict
ACTORS = list('NRAIOVF')
FILE_COMMANDS = ['copy', 'compare']
VERBOSITY = OrderedDict(
[ ('RETURN_CODE', 0),
('RESULT' , 1),
('ERROR' , 2),
('EXECUTION' , 3),
('DEBUG' , 4),
])
VERBOSITY_DEFAULT... | <commit_before>from collections import OrderedDict
ACTORS = list('NRAIOVF')
FILE_COMMANDS = ['copy', 'compare']
VERBOSITY = OrderedDict(
[ ('RETURN_CODE', 0),
('RESULT' , 1),
('ERROR' , 2),
('EXECUTION' , 3),
('DEBUG' , 4),
])
VE... | from collections import OrderedDict
ACTORS = list('NRAIOVF')
FILE_COMMANDS = ['copy', 'compare']
VERBOSITY = OrderedDict(
[ ('RETURN_CODE', 0),
('RESULT' , 1),
('ERROR' , 2),
('EXECUTION' , 3),
('DEBUG' , 4),
])
VERBOSITY_DEFAULT... | from collections import OrderedDict
ACTORS = list('NRAIOVF')
FILE_COMMANDS = ['copy', 'compare']
VERBOSITY = OrderedDict(
[ ('RETURN_CODE', 0),
('RESULT' , 1),
('ERROR' , 2),
('EXECUTION' , 3),
('DEBUG' , 4),
])
VERBOSITY_DEFAULT... | <commit_before>from collections import OrderedDict
ACTORS = list('NRAIOVF')
FILE_COMMANDS = ['copy', 'compare']
VERBOSITY = OrderedDict(
[ ('RETURN_CODE', 0),
('RESULT' , 1),
('ERROR' , 2),
('EXECUTION' , 3),
('DEBUG' , 4),
])
VE... |
1d1e8fb72fe578adb871d22accdde60bedff48c6 | housemarket/housesales/management/commands/fillsalesdb.py | housemarket/housesales/management/commands/fillsalesdb.py | from django.core.management.base import BaseCommand
class Command(BaseCommand):
args = ''
help = ('Load house sales data from a CSV and save it into DB')
def handle(self, *args, **options):
pass
| from django.core.management.base import BaseCommand
from django.db import transaction
from housesales.models import HouseSales
import csv
from datetime import datetime
class Command(BaseCommand):
help = ('Load house sales data from a CSV and save it into DB')
def add_arguments(self, parser):
parser... | Improve performance of db import utility | Improve performance of db import utility
| Python | mit | andreagrandi/sold-house-prices | from django.core.management.base import BaseCommand
class Command(BaseCommand):
args = ''
help = ('Load house sales data from a CSV and save it into DB')
def handle(self, *args, **options):
pass
Improve performance of db import utility | from django.core.management.base import BaseCommand
from django.db import transaction
from housesales.models import HouseSales
import csv
from datetime import datetime
class Command(BaseCommand):
help = ('Load house sales data from a CSV and save it into DB')
def add_arguments(self, parser):
parser... | <commit_before>from django.core.management.base import BaseCommand
class Command(BaseCommand):
args = ''
help = ('Load house sales data from a CSV and save it into DB')
def handle(self, *args, **options):
pass
<commit_msg>Improve performance of db import utility<commit_after> | from django.core.management.base import BaseCommand
from django.db import transaction
from housesales.models import HouseSales
import csv
from datetime import datetime
class Command(BaseCommand):
help = ('Load house sales data from a CSV and save it into DB')
def add_arguments(self, parser):
parser... | from django.core.management.base import BaseCommand
class Command(BaseCommand):
args = ''
help = ('Load house sales data from a CSV and save it into DB')
def handle(self, *args, **options):
pass
Improve performance of db import utilityfrom django.core.management.base import BaseCommand
from djang... | <commit_before>from django.core.management.base import BaseCommand
class Command(BaseCommand):
args = ''
help = ('Load house sales data from a CSV and save it into DB')
def handle(self, *args, **options):
pass
<commit_msg>Improve performance of db import utility<commit_after>from django.core.mana... |
eccb17bb69384a5f9c95b1290600e8483487d6f7 | django/contrib/comments/feeds.py | django/contrib/comments/feeds.py | from django.conf import settings
from django.contrib.syndication.feeds import Feed
from django.contrib.sites.models import Site
from django.contrib import comments
class LatestCommentFeed(Feed):
"""Feed of latest comments on the current site."""
def title(self):
if not hasattr(self, '_site'):
... | from django.conf import settings
from django.contrib.syndication.feeds import Feed
from django.contrib.sites.models import Site
from django.contrib import comments
class LatestCommentFeed(Feed):
"""Feed of latest comments on the current site."""
def title(self):
if not hasattr(self, '_site'):
... | Use correct m2m join table name in LatestCommentsFeed | Use correct m2m join table name in LatestCommentsFeed
git-svn-id: 4f9f921b081c523744c7bf24d959a0db39629563@9089 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| Python | bsd-3-clause | aparo/django-nonrel,aparo/django-nonrel,FlaPer87/django-nonrel,FlaPer87/django-nonrel,FlaPer87/django-nonrel,aparo/django-nonrel | from django.conf import settings
from django.contrib.syndication.feeds import Feed
from django.contrib.sites.models import Site
from django.contrib import comments
class LatestCommentFeed(Feed):
"""Feed of latest comments on the current site."""
def title(self):
if not hasattr(self, '_site'):
... | from django.conf import settings
from django.contrib.syndication.feeds import Feed
from django.contrib.sites.models import Site
from django.contrib import comments
class LatestCommentFeed(Feed):
"""Feed of latest comments on the current site."""
def title(self):
if not hasattr(self, '_site'):
... | <commit_before>from django.conf import settings
from django.contrib.syndication.feeds import Feed
from django.contrib.sites.models import Site
from django.contrib import comments
class LatestCommentFeed(Feed):
"""Feed of latest comments on the current site."""
def title(self):
if not hasattr(self, '_s... | from django.conf import settings
from django.contrib.syndication.feeds import Feed
from django.contrib.sites.models import Site
from django.contrib import comments
class LatestCommentFeed(Feed):
"""Feed of latest comments on the current site."""
def title(self):
if not hasattr(self, '_site'):
... | from django.conf import settings
from django.contrib.syndication.feeds import Feed
from django.contrib.sites.models import Site
from django.contrib import comments
class LatestCommentFeed(Feed):
"""Feed of latest comments on the current site."""
def title(self):
if not hasattr(self, '_site'):
... | <commit_before>from django.conf import settings
from django.contrib.syndication.feeds import Feed
from django.contrib.sites.models import Site
from django.contrib import comments
class LatestCommentFeed(Feed):
"""Feed of latest comments on the current site."""
def title(self):
if not hasattr(self, '_s... |
025b356ad4bbaa81ef98467d3c3abd3c8fba98b8 | skbio/format/sequences/tests/test_fastq.py | skbio/format/sequences/tests/test_fastq.py | #!/usr/bin/env python
import numpy as np
from unittest import TestCase, main
from skbio.format.sequences.fastq import (format_fastq_record,
_phred_to_ascii33,
_phred_to_ascii64)
class FASTQFormatTests(TestCase):
def test_format_f... | #!/usr/bin/env python
import numpy as np
from unittest import TestCase, main
from skbio.format.sequences.fastq import (format_fastq_record,
_phred_to_ascii33,
_phred_to_ascii64)
class FASTQFormatTests(TestCase):
def setUp(self):
... | Add tests for different types of phred offsets | Add tests for different types of phred offsets
| Python | bsd-3-clause | corburn/scikit-bio,anderspitman/scikit-bio,johnchase/scikit-bio,SamStudio8/scikit-bio,anderspitman/scikit-bio,averagehat/scikit-bio,wdwvt1/scikit-bio,kdmurray91/scikit-bio,demis001/scikit-bio,SamStudio8/scikit-bio,jdrudolph/scikit-bio,gregcaporaso/scikit-bio,corburn/scikit-bio,johnchase/scikit-bio,jairideout/scikit-bio... | #!/usr/bin/env python
import numpy as np
from unittest import TestCase, main
from skbio.format.sequences.fastq import (format_fastq_record,
_phred_to_ascii33,
_phred_to_ascii64)
class FASTQFormatTests(TestCase):
def test_format_f... | #!/usr/bin/env python
import numpy as np
from unittest import TestCase, main
from skbio.format.sequences.fastq import (format_fastq_record,
_phred_to_ascii33,
_phred_to_ascii64)
class FASTQFormatTests(TestCase):
def setUp(self):
... | <commit_before>#!/usr/bin/env python
import numpy as np
from unittest import TestCase, main
from skbio.format.sequences.fastq import (format_fastq_record,
_phred_to_ascii33,
_phred_to_ascii64)
class FASTQFormatTests(TestCase):
de... | #!/usr/bin/env python
import numpy as np
from unittest import TestCase, main
from skbio.format.sequences.fastq import (format_fastq_record,
_phred_to_ascii33,
_phred_to_ascii64)
class FASTQFormatTests(TestCase):
def setUp(self):
... | #!/usr/bin/env python
import numpy as np
from unittest import TestCase, main
from skbio.format.sequences.fastq import (format_fastq_record,
_phred_to_ascii33,
_phred_to_ascii64)
class FASTQFormatTests(TestCase):
def test_format_f... | <commit_before>#!/usr/bin/env python
import numpy as np
from unittest import TestCase, main
from skbio.format.sequences.fastq import (format_fastq_record,
_phred_to_ascii33,
_phred_to_ascii64)
class FASTQFormatTests(TestCase):
de... |
fd2691c8971fd327bf6e4a437df6bbcfd1514bdf | IPython/utils/pyfile.py | IPython/utils/pyfile.py | """Utilities for working with Python source files.
Exposes various functions from recent Python standard libraries, along with
equivalents for older Python versions.
"""
import os.path
try: # Python 3.2
from imp import source_from_cache, cache_from_source
except ImportError:
# Python <= 3.1: .pyc files go ... | """Utilities for working with Python source files.
Exposes various functions from recent Python standard libraries, along with
equivalents for older Python versions.
"""
import os.path
try: # Python 3.2
from imp import source_from_cache, cache_from_source
except ImportError:
# Python <= 3.1: .pyc files go ... | Fix syntax for Python 2.6 - no set literals. | Fix syntax for Python 2.6 - no set literals.
| Python | bsd-3-clause | ipython/ipython,ipython/ipython | """Utilities for working with Python source files.
Exposes various functions from recent Python standard libraries, along with
equivalents for older Python versions.
"""
import os.path
try: # Python 3.2
from imp import source_from_cache, cache_from_source
except ImportError:
# Python <= 3.1: .pyc files go ... | """Utilities for working with Python source files.
Exposes various functions from recent Python standard libraries, along with
equivalents for older Python versions.
"""
import os.path
try: # Python 3.2
from imp import source_from_cache, cache_from_source
except ImportError:
# Python <= 3.1: .pyc files go ... | <commit_before>"""Utilities for working with Python source files.
Exposes various functions from recent Python standard libraries, along with
equivalents for older Python versions.
"""
import os.path
try: # Python 3.2
from imp import source_from_cache, cache_from_source
except ImportError:
# Python <= 3.1:... | """Utilities for working with Python source files.
Exposes various functions from recent Python standard libraries, along with
equivalents for older Python versions.
"""
import os.path
try: # Python 3.2
from imp import source_from_cache, cache_from_source
except ImportError:
# Python <= 3.1: .pyc files go ... | """Utilities for working with Python source files.
Exposes various functions from recent Python standard libraries, along with
equivalents for older Python versions.
"""
import os.path
try: # Python 3.2
from imp import source_from_cache, cache_from_source
except ImportError:
# Python <= 3.1: .pyc files go ... | <commit_before>"""Utilities for working with Python source files.
Exposes various functions from recent Python standard libraries, along with
equivalents for older Python versions.
"""
import os.path
try: # Python 3.2
from imp import source_from_cache, cache_from_source
except ImportError:
# Python <= 3.1:... |
89796f6cc61a2e5de18c372468ac1e91b4790085 | test/test_get_new.py | test/test_get_new.py | from __future__ import absolute_import, print_function
from ..pyautoupdate.launcher import Launcher
from .pytest_skipif import needinternet
from .pytest_makevers import fixture_update_dir, create_update_dir
import os
@needinternet
def test_check_get_new(fixture_update_dir, create_update_dir):
"""Test that gets n... | from __future__ import absolute_import, print_function
from ..pyautoupdate.launcher import Launcher
from .pytest_skipif import needinternet
from .pytest_makevers import fixture_update_dir, create_update_dir
import os
@needinternet
def test_check_get_new(fixture_update_dir, create_update_dir):
"""Test that gets n... | Update test for changed filename | Update test for changed filename
| Python | lgpl-2.1 | rlee287/pyautoupdate,rlee287/pyautoupdate | from __future__ import absolute_import, print_function
from ..pyautoupdate.launcher import Launcher
from .pytest_skipif import needinternet
from .pytest_makevers import fixture_update_dir, create_update_dir
import os
@needinternet
def test_check_get_new(fixture_update_dir, create_update_dir):
"""Test that gets n... | from __future__ import absolute_import, print_function
from ..pyautoupdate.launcher import Launcher
from .pytest_skipif import needinternet
from .pytest_makevers import fixture_update_dir, create_update_dir
import os
@needinternet
def test_check_get_new(fixture_update_dir, create_update_dir):
"""Test that gets n... | <commit_before>from __future__ import absolute_import, print_function
from ..pyautoupdate.launcher import Launcher
from .pytest_skipif import needinternet
from .pytest_makevers import fixture_update_dir, create_update_dir
import os
@needinternet
def test_check_get_new(fixture_update_dir, create_update_dir):
"""T... | from __future__ import absolute_import, print_function
from ..pyautoupdate.launcher import Launcher
from .pytest_skipif import needinternet
from .pytest_makevers import fixture_update_dir, create_update_dir
import os
@needinternet
def test_check_get_new(fixture_update_dir, create_update_dir):
"""Test that gets n... | from __future__ import absolute_import, print_function
from ..pyautoupdate.launcher import Launcher
from .pytest_skipif import needinternet
from .pytest_makevers import fixture_update_dir, create_update_dir
import os
@needinternet
def test_check_get_new(fixture_update_dir, create_update_dir):
"""Test that gets n... | <commit_before>from __future__ import absolute_import, print_function
from ..pyautoupdate.launcher import Launcher
from .pytest_skipif import needinternet
from .pytest_makevers import fixture_update_dir, create_update_dir
import os
@needinternet
def test_check_get_new(fixture_update_dir, create_update_dir):
"""T... |
96a5388fcb8f1164db4612f4049d41a72e81ea09 | zerver/lib/mandrill_client.py | zerver/lib/mandrill_client.py | import mandrill
from django.conf import settings
MAIL_CLIENT = None
from typing import Optional
def get_mandrill_client():
# type: () -> Optional[mandrill.Mandrill]
if settings.MANDRILL_API_KEY == '' or settings.DEVELOPMENT or settings.VOYAGER:
return None
global MAIL_CLIENT
if not MAIL_CLIE... | import mandrill
from django.conf import settings
MAIL_CLIENT = None
from typing import Optional
def get_mandrill_client():
# type: () -> Optional[mandrill.Mandrill]
if settings.MANDRILL_API_KEY == '' or settings.DEVELOPMENT:
return None
global MAIL_CLIENT
if not MAIL_CLIENT:
MAIL_CLI... | Fix hardcoded check for settings.VOYAGER. | mandrill: Fix hardcoded check for settings.VOYAGER.
Since this delayed sending feature is the only thing
settings.MANDRILL_API_KEY is used for, it seems reasonable for that to
be the gate as to whether we actually use Mandrill.
| Python | apache-2.0 | jainayush975/zulip,tommyip/zulip,ahmadassaf/zulip,kou/zulip,SmartPeople/zulip,dawran6/zulip,sonali0901/zulip,arpith/zulip,dhcrzf/zulip,ahmadassaf/zulip,arpith/zulip,aakash-cr7/zulip,kou/zulip,sup95/zulip,sharmaeklavya2/zulip,jrowan/zulip,grave-w-grave/zulip,SmartPeople/zulip,aakash-cr7/zulip,jainayush975/zulip,eeshanga... | import mandrill
from django.conf import settings
MAIL_CLIENT = None
from typing import Optional
def get_mandrill_client():
# type: () -> Optional[mandrill.Mandrill]
if settings.MANDRILL_API_KEY == '' or settings.DEVELOPMENT or settings.VOYAGER:
return None
global MAIL_CLIENT
if not MAIL_CLIE... | import mandrill
from django.conf import settings
MAIL_CLIENT = None
from typing import Optional
def get_mandrill_client():
# type: () -> Optional[mandrill.Mandrill]
if settings.MANDRILL_API_KEY == '' or settings.DEVELOPMENT:
return None
global MAIL_CLIENT
if not MAIL_CLIENT:
MAIL_CLI... | <commit_before>import mandrill
from django.conf import settings
MAIL_CLIENT = None
from typing import Optional
def get_mandrill_client():
# type: () -> Optional[mandrill.Mandrill]
if settings.MANDRILL_API_KEY == '' or settings.DEVELOPMENT or settings.VOYAGER:
return None
global MAIL_CLIENT
i... | import mandrill
from django.conf import settings
MAIL_CLIENT = None
from typing import Optional
def get_mandrill_client():
# type: () -> Optional[mandrill.Mandrill]
if settings.MANDRILL_API_KEY == '' or settings.DEVELOPMENT:
return None
global MAIL_CLIENT
if not MAIL_CLIENT:
MAIL_CLI... | import mandrill
from django.conf import settings
MAIL_CLIENT = None
from typing import Optional
def get_mandrill_client():
# type: () -> Optional[mandrill.Mandrill]
if settings.MANDRILL_API_KEY == '' or settings.DEVELOPMENT or settings.VOYAGER:
return None
global MAIL_CLIENT
if not MAIL_CLIE... | <commit_before>import mandrill
from django.conf import settings
MAIL_CLIENT = None
from typing import Optional
def get_mandrill_client():
# type: () -> Optional[mandrill.Mandrill]
if settings.MANDRILL_API_KEY == '' or settings.DEVELOPMENT or settings.VOYAGER:
return None
global MAIL_CLIENT
i... |
02854d24db2418fbbd7be399d0abcb10a691810f | test_bert_trainer.py | test_bert_trainer.py | import unittest
import time
import pandas as pd
from bert_trainer import BERTTrainer
from utils import *
class TestBERT(unittest.TestCase):
def test_init(self):
trainer = BERTTrainer()
def test_train(self):
output_dir = 'test_{}'.format(str(int(time.time())))
trainer = BERTTrainer(out... | import unittest
import time
import pandas as pd
from bert_trainer import BERTTrainer
from utils import *
class TestBERT(unittest.TestCase):
def test_init(self):
trainer = BERTTrainer()
def test_train(self):
output_dir = 'test_{}'.format(str(int(time.time())))
trainer = BERTTrainer(out... | Fix merge conflict and also check for equal eval loss | Fix merge conflict and also check for equal eval loss
| Python | apache-2.0 | googleinterns/smart-news-query-embeddings,googleinterns/smart-news-query-embeddings | import unittest
import time
import pandas as pd
from bert_trainer import BERTTrainer
from utils import *
class TestBERT(unittest.TestCase):
def test_init(self):
trainer = BERTTrainer()
def test_train(self):
output_dir = 'test_{}'.format(str(int(time.time())))
trainer = BERTTrainer(out... | import unittest
import time
import pandas as pd
from bert_trainer import BERTTrainer
from utils import *
class TestBERT(unittest.TestCase):
def test_init(self):
trainer = BERTTrainer()
def test_train(self):
output_dir = 'test_{}'.format(str(int(time.time())))
trainer = BERTTrainer(out... | <commit_before>import unittest
import time
import pandas as pd
from bert_trainer import BERTTrainer
from utils import *
class TestBERT(unittest.TestCase):
def test_init(self):
trainer = BERTTrainer()
def test_train(self):
output_dir = 'test_{}'.format(str(int(time.time())))
trainer = ... | import unittest
import time
import pandas as pd
from bert_trainer import BERTTrainer
from utils import *
class TestBERT(unittest.TestCase):
def test_init(self):
trainer = BERTTrainer()
def test_train(self):
output_dir = 'test_{}'.format(str(int(time.time())))
trainer = BERTTrainer(out... | import unittest
import time
import pandas as pd
from bert_trainer import BERTTrainer
from utils import *
class TestBERT(unittest.TestCase):
def test_init(self):
trainer = BERTTrainer()
def test_train(self):
output_dir = 'test_{}'.format(str(int(time.time())))
trainer = BERTTrainer(out... | <commit_before>import unittest
import time
import pandas as pd
from bert_trainer import BERTTrainer
from utils import *
class TestBERT(unittest.TestCase):
def test_init(self):
trainer = BERTTrainer()
def test_train(self):
output_dir = 'test_{}'.format(str(int(time.time())))
trainer = ... |
8bbd35e4efb308246961a7f4b55061be95c713f3 | tests/common/base.py | tests/common/base.py | import os
from build_pack_utils import BuildPack
from common.integration import DirectoryHelper
from common.integration import OptionsHelper
class BaseCompileApp(object):
def setUp(self):
self.dh = DirectoryHelper()
(self.build_dir,
self.cache_dir,
self.temp_dir) = self.dh.create... | import os
from build_pack_utils import BuildPack
from common.integration import DirectoryHelper
from common.integration import OptionsHelper
class BaseCompileApp(object):
def setUp(self):
self.dh = DirectoryHelper()
(self.build_dir,
self.cache_dir,
self.temp_dir) = self.dh.create... | Set CF_STACK environment variable in compile tests | Set CF_STACK environment variable in compile tests
| Python | apache-2.0 | cf-identity/php-buildpack,cf-identity/php-buildpack,nsharma283/php-new,apawar2/php-buildpack,lloydbadger/test,svrc-pivotal/php-buildpack,jsloyer/php-buildpack,hjooyang/php-buildpack,svrc-pivotal/php-buildpack,jan-randis/php-db2-mysql-buildpack,svrc-pivotal/php-buildpack,ashish17das/cf-php-build,hjooyang/php-buildpack,L... | import os
from build_pack_utils import BuildPack
from common.integration import DirectoryHelper
from common.integration import OptionsHelper
class BaseCompileApp(object):
def setUp(self):
self.dh = DirectoryHelper()
(self.build_dir,
self.cache_dir,
self.temp_dir) = self.dh.create... | import os
from build_pack_utils import BuildPack
from common.integration import DirectoryHelper
from common.integration import OptionsHelper
class BaseCompileApp(object):
def setUp(self):
self.dh = DirectoryHelper()
(self.build_dir,
self.cache_dir,
self.temp_dir) = self.dh.create... | <commit_before>import os
from build_pack_utils import BuildPack
from common.integration import DirectoryHelper
from common.integration import OptionsHelper
class BaseCompileApp(object):
def setUp(self):
self.dh = DirectoryHelper()
(self.build_dir,
self.cache_dir,
self.temp_dir) =... | import os
from build_pack_utils import BuildPack
from common.integration import DirectoryHelper
from common.integration import OptionsHelper
class BaseCompileApp(object):
def setUp(self):
self.dh = DirectoryHelper()
(self.build_dir,
self.cache_dir,
self.temp_dir) = self.dh.create... | import os
from build_pack_utils import BuildPack
from common.integration import DirectoryHelper
from common.integration import OptionsHelper
class BaseCompileApp(object):
def setUp(self):
self.dh = DirectoryHelper()
(self.build_dir,
self.cache_dir,
self.temp_dir) = self.dh.create... | <commit_before>import os
from build_pack_utils import BuildPack
from common.integration import DirectoryHelper
from common.integration import OptionsHelper
class BaseCompileApp(object):
def setUp(self):
self.dh = DirectoryHelper()
(self.build_dir,
self.cache_dir,
self.temp_dir) =... |
f1d9c010b58d69cdcf8f55a3e5937cbdf58c10e6 | tools/corintick_dump.py | tools/corintick_dump.py | #!/usr/bin/env python
import argparse
import glob
from pytrthree import TRTHIterator
from corintick import Corintick, ValidationError
def main(args):
db = Corintick(args.config)
files = glob.glob(args.files)
for ric, df in TRTHIterator(files):
cols = args.columns if args.columns else df.columns
... | #!/usr/bin/env python
import argparse
import glob
import os
from pytrthree import TRTHIterator
from corintick import Corintick, ValidationError
def main(args):
db = Corintick(args.config)
files = glob.glob(os.path.expanduser(args.files))
for ric, df in TRTHIterator(files):
cols = args.columns if ... | Fix help docstring and glob parsing | Fix help docstring and glob parsing
| Python | mit | plugaai/pytrthree | #!/usr/bin/env python
import argparse
import glob
from pytrthree import TRTHIterator
from corintick import Corintick, ValidationError
def main(args):
db = Corintick(args.config)
files = glob.glob(args.files)
for ric, df in TRTHIterator(files):
cols = args.columns if args.columns else df.columns
... | #!/usr/bin/env python
import argparse
import glob
import os
from pytrthree import TRTHIterator
from corintick import Corintick, ValidationError
def main(args):
db = Corintick(args.config)
files = glob.glob(os.path.expanduser(args.files))
for ric, df in TRTHIterator(files):
cols = args.columns if ... | <commit_before>#!/usr/bin/env python
import argparse
import glob
from pytrthree import TRTHIterator
from corintick import Corintick, ValidationError
def main(args):
db = Corintick(args.config)
files = glob.glob(args.files)
for ric, df in TRTHIterator(files):
cols = args.columns if args.columns el... | #!/usr/bin/env python
import argparse
import glob
import os
from pytrthree import TRTHIterator
from corintick import Corintick, ValidationError
def main(args):
db = Corintick(args.config)
files = glob.glob(os.path.expanduser(args.files))
for ric, df in TRTHIterator(files):
cols = args.columns if ... | #!/usr/bin/env python
import argparse
import glob
from pytrthree import TRTHIterator
from corintick import Corintick, ValidationError
def main(args):
db = Corintick(args.config)
files = glob.glob(args.files)
for ric, df in TRTHIterator(files):
cols = args.columns if args.columns else df.columns
... | <commit_before>#!/usr/bin/env python
import argparse
import glob
from pytrthree import TRTHIterator
from corintick import Corintick, ValidationError
def main(args):
db = Corintick(args.config)
files = glob.glob(args.files)
for ric, df in TRTHIterator(files):
cols = args.columns if args.columns el... |
c111410ad8feb6347e1e493c19b32ff9e8230306 | zmon_aws_agent/common.py | zmon_aws_agent/common.py | import time
import logging
from botocore.exceptions import ClientError
from zmon_aws_agent import __version__
MAX_RETRIES = 10
TIME_OUT = 0.5
logger = logging.getLogger(__name__)
def get_user_agent():
return 'zmon-aws-agent/{}'.format(__version__)
def get_sleep_duration(retries):
return 2 ** retries * ... | import time
import logging
from botocore.exceptions import ClientError
from zmon_aws_agent import __version__
MAX_RETRIES = 10
TIME_OUT = 0.5
logger = logging.getLogger(__name__)
def get_user_agent():
return 'zmon-aws-agent/{}'.format(__version__)
def get_sleep_duration(retries):
return 2 ** retries * ... | Handle RequestLimitExceeded the same way as Throttling response | Handle RequestLimitExceeded the same way as Throttling response
| Python | apache-2.0 | zalando/zmon-aws-agent,zalando/zmon-aws-agent | import time
import logging
from botocore.exceptions import ClientError
from zmon_aws_agent import __version__
MAX_RETRIES = 10
TIME_OUT = 0.5
logger = logging.getLogger(__name__)
def get_user_agent():
return 'zmon-aws-agent/{}'.format(__version__)
def get_sleep_duration(retries):
return 2 ** retries * ... | import time
import logging
from botocore.exceptions import ClientError
from zmon_aws_agent import __version__
MAX_RETRIES = 10
TIME_OUT = 0.5
logger = logging.getLogger(__name__)
def get_user_agent():
return 'zmon-aws-agent/{}'.format(__version__)
def get_sleep_duration(retries):
return 2 ** retries * ... | <commit_before>import time
import logging
from botocore.exceptions import ClientError
from zmon_aws_agent import __version__
MAX_RETRIES = 10
TIME_OUT = 0.5
logger = logging.getLogger(__name__)
def get_user_agent():
return 'zmon-aws-agent/{}'.format(__version__)
def get_sleep_duration(retries):
return ... | import time
import logging
from botocore.exceptions import ClientError
from zmon_aws_agent import __version__
MAX_RETRIES = 10
TIME_OUT = 0.5
logger = logging.getLogger(__name__)
def get_user_agent():
return 'zmon-aws-agent/{}'.format(__version__)
def get_sleep_duration(retries):
return 2 ** retries * ... | import time
import logging
from botocore.exceptions import ClientError
from zmon_aws_agent import __version__
MAX_RETRIES = 10
TIME_OUT = 0.5
logger = logging.getLogger(__name__)
def get_user_agent():
return 'zmon-aws-agent/{}'.format(__version__)
def get_sleep_duration(retries):
return 2 ** retries * ... | <commit_before>import time
import logging
from botocore.exceptions import ClientError
from zmon_aws_agent import __version__
MAX_RETRIES = 10
TIME_OUT = 0.5
logger = logging.getLogger(__name__)
def get_user_agent():
return 'zmon-aws-agent/{}'.format(__version__)
def get_sleep_duration(retries):
return ... |
9adb52b4a3295afcaaa4c830835d42ce0bbbb03e | udemy/missingelement.py | udemy/missingelement.py | import collections
# Problem:
# Consider an array of non-negative integers. A second array is formed
# by shuffling the elements of the first array and deleting a random element.
# Given these two arrays, find which element is missing in the second array.
#
# Assume there will always be one missing element in t... | import collections
# Problem:
# Consider an array of non-negative integers. A second array is formed
# by shuffling the elements of the first array and deleting a random element.
# Given these two arrays, find which element is missing in the second array.
#
# Assume there will always be one missing element in t... | Add XOR approach for finding missing element | Add XOR approach for finding missing element
Add approach for finding the missing element in the second list by performing a series of XOR operations. | Python | mit | chinhtle/python_fun | import collections
# Problem:
# Consider an array of non-negative integers. A second array is formed
# by shuffling the elements of the first array and deleting a random element.
# Given these two arrays, find which element is missing in the second array.
#
# Assume there will always be one missing element in t... | import collections
# Problem:
# Consider an array of non-negative integers. A second array is formed
# by shuffling the elements of the first array and deleting a random element.
# Given these two arrays, find which element is missing in the second array.
#
# Assume there will always be one missing element in t... | <commit_before>import collections
# Problem:
# Consider an array of non-negative integers. A second array is formed
# by shuffling the elements of the first array and deleting a random element.
# Given these two arrays, find which element is missing in the second array.
#
# Assume there will always be one missi... | import collections
# Problem:
# Consider an array of non-negative integers. A second array is formed
# by shuffling the elements of the first array and deleting a random element.
# Given these two arrays, find which element is missing in the second array.
#
# Assume there will always be one missing element in t... | import collections
# Problem:
# Consider an array of non-negative integers. A second array is formed
# by shuffling the elements of the first array and deleting a random element.
# Given these two arrays, find which element is missing in the second array.
#
# Assume there will always be one missing element in t... | <commit_before>import collections
# Problem:
# Consider an array of non-negative integers. A second array is formed
# by shuffling the elements of the first array and deleting a random element.
# Given these two arrays, find which element is missing in the second array.
#
# Assume there will always be one missi... |
30aa7dce0561e1fd8beeec94098a5d6a6f447a65 | src/test.py | src/test.py | #!/usr/bin/env python
from __future__ import division
import numpy as np
from matplotlib import pyplot as plt
def main():
koeffs = [.3, 1.2, .1, 7]
p = np.poly1d(koeffs)
x = np.linspace(-2, 2, 100)
y = p(x) + 2 * np.random.randn(100) - 1
# fit
fit = np.polyfit(x, y, 3)
p_fit = np.poly1... | #!/usr/bin/env python
from __future__ import division
import numpy as np
from matplotlib import pyplot as plt
def main():
koeffs = [.3, 1.2, .1, 7]
p = np.poly1d(koeffs)
x = np.linspace(-2, 2, 100)
y = p(x) + 2 * np.random.randn(100) - 1
# fit
fit = np.polyfit(x, y, 3)
p_fit = np.poly1... | Print real and fitted coeffs | Print real and fitted coeffs
| Python | mit | bbci/playground | #!/usr/bin/env python
from __future__ import division
import numpy as np
from matplotlib import pyplot as plt
def main():
koeffs = [.3, 1.2, .1, 7]
p = np.poly1d(koeffs)
x = np.linspace(-2, 2, 100)
y = p(x) + 2 * np.random.randn(100) - 1
# fit
fit = np.polyfit(x, y, 3)
p_fit = np.poly1... | #!/usr/bin/env python
from __future__ import division
import numpy as np
from matplotlib import pyplot as plt
def main():
koeffs = [.3, 1.2, .1, 7]
p = np.poly1d(koeffs)
x = np.linspace(-2, 2, 100)
y = p(x) + 2 * np.random.randn(100) - 1
# fit
fit = np.polyfit(x, y, 3)
p_fit = np.poly1... | <commit_before>#!/usr/bin/env python
from __future__ import division
import numpy as np
from matplotlib import pyplot as plt
def main():
koeffs = [.3, 1.2, .1, 7]
p = np.poly1d(koeffs)
x = np.linspace(-2, 2, 100)
y = p(x) + 2 * np.random.randn(100) - 1
# fit
fit = np.polyfit(x, y, 3)
p... | #!/usr/bin/env python
from __future__ import division
import numpy as np
from matplotlib import pyplot as plt
def main():
koeffs = [.3, 1.2, .1, 7]
p = np.poly1d(koeffs)
x = np.linspace(-2, 2, 100)
y = p(x) + 2 * np.random.randn(100) - 1
# fit
fit = np.polyfit(x, y, 3)
p_fit = np.poly1... | #!/usr/bin/env python
from __future__ import division
import numpy as np
from matplotlib import pyplot as plt
def main():
koeffs = [.3, 1.2, .1, 7]
p = np.poly1d(koeffs)
x = np.linspace(-2, 2, 100)
y = p(x) + 2 * np.random.randn(100) - 1
# fit
fit = np.polyfit(x, y, 3)
p_fit = np.poly1... | <commit_before>#!/usr/bin/env python
from __future__ import division
import numpy as np
from matplotlib import pyplot as plt
def main():
koeffs = [.3, 1.2, .1, 7]
p = np.poly1d(koeffs)
x = np.linspace(-2, 2, 100)
y = p(x) + 2 * np.random.randn(100) - 1
# fit
fit = np.polyfit(x, y, 3)
p... |
efed9e50dccea80cb536f106044265f8f1e2a32b | models.py | models.py | import peewee
db = peewee.PostgresqlDatabase('ivle_bot_test', user='postgres')
class IBModel(peewee.Model):
class Meta:
database = db
class User(IBModel):
user_id = peewee.CharField(max_length=128, primary_key=True)
auth_token = peewee.TextField()
class Module(IBModel):
module_id = peewee.Te... | import os
import peewee
class IBModel(peewee.Model):
class Meta:
database = db
class User(IBModel):
user_id = peewee.CharField(max_length=128, primary_key=True)
auth_token = peewee.TextField()
class Module(IBModel):
module_id = peewee.TextField()
module_code = peewee.CharField(max_length=... | Set up database according to environment | Set up database according to environment
| Python | mit | karen/ivle-bot,karenang/ivle-bot | import peewee
db = peewee.PostgresqlDatabase('ivle_bot_test', user='postgres')
class IBModel(peewee.Model):
class Meta:
database = db
class User(IBModel):
user_id = peewee.CharField(max_length=128, primary_key=True)
auth_token = peewee.TextField()
class Module(IBModel):
module_id = peewee.Te... | import os
import peewee
class IBModel(peewee.Model):
class Meta:
database = db
class User(IBModel):
user_id = peewee.CharField(max_length=128, primary_key=True)
auth_token = peewee.TextField()
class Module(IBModel):
module_id = peewee.TextField()
module_code = peewee.CharField(max_length=... | <commit_before>import peewee
db = peewee.PostgresqlDatabase('ivle_bot_test', user='postgres')
class IBModel(peewee.Model):
class Meta:
database = db
class User(IBModel):
user_id = peewee.CharField(max_length=128, primary_key=True)
auth_token = peewee.TextField()
class Module(IBModel):
module... | import os
import peewee
class IBModel(peewee.Model):
class Meta:
database = db
class User(IBModel):
user_id = peewee.CharField(max_length=128, primary_key=True)
auth_token = peewee.TextField()
class Module(IBModel):
module_id = peewee.TextField()
module_code = peewee.CharField(max_length=... | import peewee
db = peewee.PostgresqlDatabase('ivle_bot_test', user='postgres')
class IBModel(peewee.Model):
class Meta:
database = db
class User(IBModel):
user_id = peewee.CharField(max_length=128, primary_key=True)
auth_token = peewee.TextField()
class Module(IBModel):
module_id = peewee.Te... | <commit_before>import peewee
db = peewee.PostgresqlDatabase('ivle_bot_test', user='postgres')
class IBModel(peewee.Model):
class Meta:
database = db
class User(IBModel):
user_id = peewee.CharField(max_length=128, primary_key=True)
auth_token = peewee.TextField()
class Module(IBModel):
module... |
32587292baab9ed1d994fc1643d4bc004832a575 | viper/parser/grammar.py | viper/parser/grammar.py | from .languages import SPPF, make_sppf
from .linguify_grammar import linguify_grammar_file
from viper.lexer import Lexeme
from os.path import join, dirname
from typing import List
class Grammar:
def __init__(self, grammar_filename: str):
self.file = grammar_filename
self.rules = linguify_grammar... | from .ast import ASTNode
from .languages import ParseTreeChar, make_sppf
from .linguify_grammar import linguify_grammar_file
from viper.lexer import Lexeme
from os.path import join, dirname
from typing import List
class Grammar:
def __init__(self, grammar_filename: str):
self.file = grammar_filename
... | Revise top-level parse function to return ASTNode | Revise top-level parse function to return ASTNode
| Python | apache-2.0 | pdarragh/Viper | from .languages import SPPF, make_sppf
from .linguify_grammar import linguify_grammar_file
from viper.lexer import Lexeme
from os.path import join, dirname
from typing import List
class Grammar:
def __init__(self, grammar_filename: str):
self.file = grammar_filename
self.rules = linguify_grammar... | from .ast import ASTNode
from .languages import ParseTreeChar, make_sppf
from .linguify_grammar import linguify_grammar_file
from viper.lexer import Lexeme
from os.path import join, dirname
from typing import List
class Grammar:
def __init__(self, grammar_filename: str):
self.file = grammar_filename
... | <commit_before>from .languages import SPPF, make_sppf
from .linguify_grammar import linguify_grammar_file
from viper.lexer import Lexeme
from os.path import join, dirname
from typing import List
class Grammar:
def __init__(self, grammar_filename: str):
self.file = grammar_filename
self.rules = l... | from .ast import ASTNode
from .languages import ParseTreeChar, make_sppf
from .linguify_grammar import linguify_grammar_file
from viper.lexer import Lexeme
from os.path import join, dirname
from typing import List
class Grammar:
def __init__(self, grammar_filename: str):
self.file = grammar_filename
... | from .languages import SPPF, make_sppf
from .linguify_grammar import linguify_grammar_file
from viper.lexer import Lexeme
from os.path import join, dirname
from typing import List
class Grammar:
def __init__(self, grammar_filename: str):
self.file = grammar_filename
self.rules = linguify_grammar... | <commit_before>from .languages import SPPF, make_sppf
from .linguify_grammar import linguify_grammar_file
from viper.lexer import Lexeme
from os.path import join, dirname
from typing import List
class Grammar:
def __init__(self, grammar_filename: str):
self.file = grammar_filename
self.rules = l... |
bef1e44e027284e193be889b5ca273c906ae8325 | snippets/__main__.py | snippets/__main__.py | import argparse
import sys
from .generator import Generator
from .repository import Repository
def run(args=sys.argv[1:]):
parser = argparse.ArgumentParser()
parser.add_argument('path')
parser.add_argument('-o', '--output', default='output')
parser.add_argument('-t', '--theme')
args = parser.pars... | import argparse
import sys
from .generator import Generator
from .repository import Repository
def run(args=sys.argv[1:]):
parser = argparse.ArgumentParser()
parser.add_argument('-s', '--source', default='snippets')
parser.add_argument('-o', '--output', default='output')
parser.add_argument('-t', '--... | Make repository source optional in cli | Make repository source optional in cli
| Python | isc | trilan/snippets,trilan/snippets | import argparse
import sys
from .generator import Generator
from .repository import Repository
def run(args=sys.argv[1:]):
parser = argparse.ArgumentParser()
parser.add_argument('path')
parser.add_argument('-o', '--output', default='output')
parser.add_argument('-t', '--theme')
args = parser.pars... | import argparse
import sys
from .generator import Generator
from .repository import Repository
def run(args=sys.argv[1:]):
parser = argparse.ArgumentParser()
parser.add_argument('-s', '--source', default='snippets')
parser.add_argument('-o', '--output', default='output')
parser.add_argument('-t', '--... | <commit_before>import argparse
import sys
from .generator import Generator
from .repository import Repository
def run(args=sys.argv[1:]):
parser = argparse.ArgumentParser()
parser.add_argument('path')
parser.add_argument('-o', '--output', default='output')
parser.add_argument('-t', '--theme')
arg... | import argparse
import sys
from .generator import Generator
from .repository import Repository
def run(args=sys.argv[1:]):
parser = argparse.ArgumentParser()
parser.add_argument('-s', '--source', default='snippets')
parser.add_argument('-o', '--output', default='output')
parser.add_argument('-t', '--... | import argparse
import sys
from .generator import Generator
from .repository import Repository
def run(args=sys.argv[1:]):
parser = argparse.ArgumentParser()
parser.add_argument('path')
parser.add_argument('-o', '--output', default='output')
parser.add_argument('-t', '--theme')
args = parser.pars... | <commit_before>import argparse
import sys
from .generator import Generator
from .repository import Repository
def run(args=sys.argv[1:]):
parser = argparse.ArgumentParser()
parser.add_argument('path')
parser.add_argument('-o', '--output', default='output')
parser.add_argument('-t', '--theme')
arg... |
8f03f4fc5b4b321303225ec60879eb4b6a2c14f5 | cli/cli.py | cli/cli.py | import argparse
parser = argparse.ArgumentParser(prog='moocx', description='EdX MOOC Data Anaylysis')
parser.add_argument('-v', '--version', action='version', version='0.1.0')
subparsers = parser.add_subparsers(help='commands')
# A list command
list_parser = subparsers.add_parser('list', help='List commands')
list_p... | import argparse
parser = argparse.ArgumentParser(prog='moocx', description='EdX MOOC Data Anaylysis')
parser.add_argument('-v', '--version', action='version', version='0.1.0')
subparsers = parser.add_subparsers(help='commands')
# A list command
list_parser = subparsers.add_parser('list', help='List commands')
list_p... | Add subparser for run analytics commands | Add subparser for run analytics commands
| Python | mit | McGillX/edx_data_research,McGillX/edx_data_research,McGillX/edx_data_research | import argparse
parser = argparse.ArgumentParser(prog='moocx', description='EdX MOOC Data Anaylysis')
parser.add_argument('-v', '--version', action='version', version='0.1.0')
subparsers = parser.add_subparsers(help='commands')
# A list command
list_parser = subparsers.add_parser('list', help='List commands')
list_p... | import argparse
parser = argparse.ArgumentParser(prog='moocx', description='EdX MOOC Data Anaylysis')
parser.add_argument('-v', '--version', action='version', version='0.1.0')
subparsers = parser.add_subparsers(help='commands')
# A list command
list_parser = subparsers.add_parser('list', help='List commands')
list_p... | <commit_before>import argparse
parser = argparse.ArgumentParser(prog='moocx', description='EdX MOOC Data Anaylysis')
parser.add_argument('-v', '--version', action='version', version='0.1.0')
subparsers = parser.add_subparsers(help='commands')
# A list command
list_parser = subparsers.add_parser('list', help='List co... | import argparse
parser = argparse.ArgumentParser(prog='moocx', description='EdX MOOC Data Anaylysis')
parser.add_argument('-v', '--version', action='version', version='0.1.0')
subparsers = parser.add_subparsers(help='commands')
# A list command
list_parser = subparsers.add_parser('list', help='List commands')
list_p... | import argparse
parser = argparse.ArgumentParser(prog='moocx', description='EdX MOOC Data Anaylysis')
parser.add_argument('-v', '--version', action='version', version='0.1.0')
subparsers = parser.add_subparsers(help='commands')
# A list command
list_parser = subparsers.add_parser('list', help='List commands')
list_p... | <commit_before>import argparse
parser = argparse.ArgumentParser(prog='moocx', description='EdX MOOC Data Anaylysis')
parser.add_argument('-v', '--version', action='version', version='0.1.0')
subparsers = parser.add_subparsers(help='commands')
# A list command
list_parser = subparsers.add_parser('list', help='List co... |
1101fd3855c90ece679e4b9af37c5f3f5dc343eb | spacy/en/__init__.py | spacy/en/__init__.py | # coding: utf8
from __future__ import unicode_literals, print_function
from os import path
from ..language import Language
from ..lemmatizer import Lemmatizer
from ..vocab import Vocab
from ..tokenizer import Tokenizer
from ..attrs import LANG
from ..deprecated import fix_glove_vectors_loading
from .language_data imp... | # coding: utf8
from __future__ import unicode_literals
from ..language import Language
from ..lemmatizer import Lemmatizer
from ..vocab import Vocab
from ..tokenizer import Tokenizer
from ..attrs import LANG
from ..deprecated import fix_glove_vectors_loading
from .language_data import *
try:
basestring
except N... | Fix formatting and remove unused imports | Fix formatting and remove unused imports
| Python | mit | recognai/spaCy,raphael0202/spaCy,explosion/spaCy,explosion/spaCy,spacy-io/spaCy,recognai/spaCy,raphael0202/spaCy,aikramer2/spaCy,explosion/spaCy,recognai/spaCy,recognai/spaCy,Gregory-Howard/spaCy,aikramer2/spaCy,Gregory-Howard/spaCy,Gregory-Howard/spaCy,Gregory-Howard/spaCy,aikramer2/spaCy,explosion/spaCy,spacy-io/spaC... | # coding: utf8
from __future__ import unicode_literals, print_function
from os import path
from ..language import Language
from ..lemmatizer import Lemmatizer
from ..vocab import Vocab
from ..tokenizer import Tokenizer
from ..attrs import LANG
from ..deprecated import fix_glove_vectors_loading
from .language_data imp... | # coding: utf8
from __future__ import unicode_literals
from ..language import Language
from ..lemmatizer import Lemmatizer
from ..vocab import Vocab
from ..tokenizer import Tokenizer
from ..attrs import LANG
from ..deprecated import fix_glove_vectors_loading
from .language_data import *
try:
basestring
except N... | <commit_before># coding: utf8
from __future__ import unicode_literals, print_function
from os import path
from ..language import Language
from ..lemmatizer import Lemmatizer
from ..vocab import Vocab
from ..tokenizer import Tokenizer
from ..attrs import LANG
from ..deprecated import fix_glove_vectors_loading
from .la... | # coding: utf8
from __future__ import unicode_literals
from ..language import Language
from ..lemmatizer import Lemmatizer
from ..vocab import Vocab
from ..tokenizer import Tokenizer
from ..attrs import LANG
from ..deprecated import fix_glove_vectors_loading
from .language_data import *
try:
basestring
except N... | # coding: utf8
from __future__ import unicode_literals, print_function
from os import path
from ..language import Language
from ..lemmatizer import Lemmatizer
from ..vocab import Vocab
from ..tokenizer import Tokenizer
from ..attrs import LANG
from ..deprecated import fix_glove_vectors_loading
from .language_data imp... | <commit_before># coding: utf8
from __future__ import unicode_literals, print_function
from os import path
from ..language import Language
from ..lemmatizer import Lemmatizer
from ..vocab import Vocab
from ..tokenizer import Tokenizer
from ..attrs import LANG
from ..deprecated import fix_glove_vectors_loading
from .la... |
572207d26c51038b679832b24b2e8381209e6f87 | collect.py | collect.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
from collector.acled_africa import generate_urls
from collector.parser import parse
from collector.register import create_datasets, create_resources, create_gallery_items
def main():
'''
Wrapper.
'''
server = 'http://test-data.hdx.rwlabs.org'
o... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
from collector.acled_africa import generate_urls
from collector.parser import parse
from collector.register import create_datasets, create_resources, create_gallery_items
def main():
'''
Wrapper.
'''
firstrun = False
server = 'http://test-data.... | Make subsequent runs only update resources | Make subsequent runs only update resources
| Python | mit | mcarans/hdxscraper-acled-africa,mcarans/hdxscraper-acled-africa | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
from collector.acled_africa import generate_urls
from collector.parser import parse
from collector.register import create_datasets, create_resources, create_gallery_items
def main():
'''
Wrapper.
'''
server = 'http://test-data.hdx.rwlabs.org'
o... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
from collector.acled_africa import generate_urls
from collector.parser import parse
from collector.register import create_datasets, create_resources, create_gallery_items
def main():
'''
Wrapper.
'''
firstrun = False
server = 'http://test-data.... | <commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
from collector.acled_africa import generate_urls
from collector.parser import parse
from collector.register import create_datasets, create_resources, create_gallery_items
def main():
'''
Wrapper.
'''
server = 'http://test-data.hdx.rw... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
from collector.acled_africa import generate_urls
from collector.parser import parse
from collector.register import create_datasets, create_resources, create_gallery_items
def main():
'''
Wrapper.
'''
firstrun = False
server = 'http://test-data.... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
from collector.acled_africa import generate_urls
from collector.parser import parse
from collector.register import create_datasets, create_resources, create_gallery_items
def main():
'''
Wrapper.
'''
server = 'http://test-data.hdx.rwlabs.org'
o... | <commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
from collector.acled_africa import generate_urls
from collector.parser import parse
from collector.register import create_datasets, create_resources, create_gallery_items
def main():
'''
Wrapper.
'''
server = 'http://test-data.hdx.rw... |
1ef70820acb57c54f1212777e60b32db9b47c8a5 | examples/python/test_axis_precision.py | examples/python/test_axis_precision.py | #!/usr/bin/env python
# Append to effective python path so that can find plplot modules.
from plplot_python_start import *
import sys
from plplot import *
from numpy import *
# Parse and process command line arguments
plparseopts(sys.argv, PL_PARSE_FULL)
# Initialize plplot
plinit()
plsyax(10000, 0)
pladv(0)
plvpor... | #!/usr/bin/env python
# Append to effective python path so that can find plplot modules.
from plplot_python_start import *
import sys
from plplot import *
from numpy import *
# Parse and process command line arguments
plparseopts(sys.argv, PL_PARSE_FULL)
# Initialize plplot
plinit()
# Choose 5 here so there is room... | Use less ridiculous value of ydigmax specified via plsyax. This works well (i.e., gives non-exponential notation for the Y axis) with the recent pldprec change in pldtik.c which removes the ceiling on digfix and simply sets it to digmax. | Use less ridiculous value of ydigmax specified via plsyax. This works
well (i.e., gives non-exponential notation for the Y axis) with the
recent pldprec change in pldtik.c which removes the ceiling on digfix and
simply sets it to digmax.
svn path=/trunk/; revision=10608
| Python | lgpl-2.1 | FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot | #!/usr/bin/env python
# Append to effective python path so that can find plplot modules.
from plplot_python_start import *
import sys
from plplot import *
from numpy import *
# Parse and process command line arguments
plparseopts(sys.argv, PL_PARSE_FULL)
# Initialize plplot
plinit()
plsyax(10000, 0)
pladv(0)
plvpor... | #!/usr/bin/env python
# Append to effective python path so that can find plplot modules.
from plplot_python_start import *
import sys
from plplot import *
from numpy import *
# Parse and process command line arguments
plparseopts(sys.argv, PL_PARSE_FULL)
# Initialize plplot
plinit()
# Choose 5 here so there is room... | <commit_before>#!/usr/bin/env python
# Append to effective python path so that can find plplot modules.
from plplot_python_start import *
import sys
from plplot import *
from numpy import *
# Parse and process command line arguments
plparseopts(sys.argv, PL_PARSE_FULL)
# Initialize plplot
plinit()
plsyax(10000, 0)
... | #!/usr/bin/env python
# Append to effective python path so that can find plplot modules.
from plplot_python_start import *
import sys
from plplot import *
from numpy import *
# Parse and process command line arguments
plparseopts(sys.argv, PL_PARSE_FULL)
# Initialize plplot
plinit()
# Choose 5 here so there is room... | #!/usr/bin/env python
# Append to effective python path so that can find plplot modules.
from plplot_python_start import *
import sys
from plplot import *
from numpy import *
# Parse and process command line arguments
plparseopts(sys.argv, PL_PARSE_FULL)
# Initialize plplot
plinit()
plsyax(10000, 0)
pladv(0)
plvpor... | <commit_before>#!/usr/bin/env python
# Append to effective python path so that can find plplot modules.
from plplot_python_start import *
import sys
from plplot import *
from numpy import *
# Parse and process command line arguments
plparseopts(sys.argv, PL_PARSE_FULL)
# Initialize plplot
plinit()
plsyax(10000, 0)
... |
e144820c974548a549d0428a3b439fc0688bd2b2 | tests/test_pathutils.py | tests/test_pathutils.py | from os.path import join
import sublime
import sys
from unittest import TestCase
from unittest.mock import patch
version = sublime.version()
try:
from libsass import pathutils
except ImportError:
from sublime_libsass.libsass import pathutils
class TestPathutils(TestCase):
def test_subpaths(self):
... | from os.path import join
import sublime
import sys
from unittest import TestCase
from unittest.mock import patch
version = sublime.version()
try:
from libsass import pathutils
except ImportError:
from sublime_libsass.libsass import pathutils
class TestPathutils(TestCase):
def test_subpaths(self):
... | Use patch.object for python 2 compat | Use patch.object for python 2 compat
| Python | mit | blitzrk/sublime_libsass,blitzrk/sublime_libsass | from os.path import join
import sublime
import sys
from unittest import TestCase
from unittest.mock import patch
version = sublime.version()
try:
from libsass import pathutils
except ImportError:
from sublime_libsass.libsass import pathutils
class TestPathutils(TestCase):
def test_subpaths(self):
... | from os.path import join
import sublime
import sys
from unittest import TestCase
from unittest.mock import patch
version = sublime.version()
try:
from libsass import pathutils
except ImportError:
from sublime_libsass.libsass import pathutils
class TestPathutils(TestCase):
def test_subpaths(self):
... | <commit_before>from os.path import join
import sublime
import sys
from unittest import TestCase
from unittest.mock import patch
version = sublime.version()
try:
from libsass import pathutils
except ImportError:
from sublime_libsass.libsass import pathutils
class TestPathutils(TestCase):
def test_subpath... | from os.path import join
import sublime
import sys
from unittest import TestCase
from unittest.mock import patch
version = sublime.version()
try:
from libsass import pathutils
except ImportError:
from sublime_libsass.libsass import pathutils
class TestPathutils(TestCase):
def test_subpaths(self):
... | from os.path import join
import sublime
import sys
from unittest import TestCase
from unittest.mock import patch
version = sublime.version()
try:
from libsass import pathutils
except ImportError:
from sublime_libsass.libsass import pathutils
class TestPathutils(TestCase):
def test_subpaths(self):
... | <commit_before>from os.path import join
import sublime
import sys
from unittest import TestCase
from unittest.mock import patch
version = sublime.version()
try:
from libsass import pathutils
except ImportError:
from sublime_libsass.libsass import pathutils
class TestPathutils(TestCase):
def test_subpath... |
894d62b6e32e3433f77ad01d41efa3e4bc81f13c | tempest/services/volume/json/admin/volume_hosts_client.py | tempest/services/volume/json/admin/volume_hosts_client.py | # Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | # Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | Make argument params of list methods consistent | Make argument params of list methods consistent
The argument type "params" is not consistent between list methods of
compute service clients. This patch makes them consistent.
Partially implements blueprint consistent-service-method-names
Change-Id: I9c7c3034b5273de5adb87b6623b3615689a9b2d0
| Python | apache-2.0 | Juniper/tempest,bigswitch/tempest,LIS/lis-tempest,Juniper/tempest,Tesora/tesora-tempest,vedujoshi/tempest,zsoltdudas/lis-tempest,cisco-openstack/tempest,vedujoshi/tempest,sebrandon1/tempest,zsoltdudas/lis-tempest,sebrandon1/tempest,LIS/lis-tempest,openstack/tempest,Tesora/tesora-tempest,openstack/tempest,cisco-openstac... | # Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | # Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | <commit_before># Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | # Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | # Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | <commit_before># Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... |
595dfa67764a525bcff864e1ddc513496f1376df | microcosm_postgres/temporary/copy.py | microcosm_postgres/temporary/copy.py | """
Copy a table.
"""
from sqlalchemy import Table
def copy_table(from_table, name):
"""
Copy a table.
Based on `Table.tometadata`, but simplified to remove constraints and indexes.
"""
metadata = from_table.metadata
if name in metadata.tables:
return metadata.tables[name]
sch... | """
Copy a table.
"""
from sqlalchemy import Table
from microcosm_postgres.types import Serial
def copy_column(column, schema):
"""
Safely create a copy of a column.
"""
return column.copy(schema=schema)
def should_copy(column):
"""
Determine if a column should be copied.
"""
if ... | Handle serial values on temporary table creation | Handle serial values on temporary table creation
Do not copy serial columns because they will be generated automatically
if and only they are omitted from the insert().select_from().
| Python | apache-2.0 | globality-corp/microcosm-postgres,globality-corp/microcosm-postgres | """
Copy a table.
"""
from sqlalchemy import Table
def copy_table(from_table, name):
"""
Copy a table.
Based on `Table.tometadata`, but simplified to remove constraints and indexes.
"""
metadata = from_table.metadata
if name in metadata.tables:
return metadata.tables[name]
sch... | """
Copy a table.
"""
from sqlalchemy import Table
from microcosm_postgres.types import Serial
def copy_column(column, schema):
"""
Safely create a copy of a column.
"""
return column.copy(schema=schema)
def should_copy(column):
"""
Determine if a column should be copied.
"""
if ... | <commit_before>"""
Copy a table.
"""
from sqlalchemy import Table
def copy_table(from_table, name):
"""
Copy a table.
Based on `Table.tometadata`, but simplified to remove constraints and indexes.
"""
metadata = from_table.metadata
if name in metadata.tables:
return metadata.tables... | """
Copy a table.
"""
from sqlalchemy import Table
from microcosm_postgres.types import Serial
def copy_column(column, schema):
"""
Safely create a copy of a column.
"""
return column.copy(schema=schema)
def should_copy(column):
"""
Determine if a column should be copied.
"""
if ... | """
Copy a table.
"""
from sqlalchemy import Table
def copy_table(from_table, name):
"""
Copy a table.
Based on `Table.tometadata`, but simplified to remove constraints and indexes.
"""
metadata = from_table.metadata
if name in metadata.tables:
return metadata.tables[name]
sch... | <commit_before>"""
Copy a table.
"""
from sqlalchemy import Table
def copy_table(from_table, name):
"""
Copy a table.
Based on `Table.tometadata`, but simplified to remove constraints and indexes.
"""
metadata = from_table.metadata
if name in metadata.tables:
return metadata.tables... |
a78f67fcf1a692633427cf0677c43f7efc760c8c | day-2-2.py | day-2-2.py | import re
# box_list will contain tuples in the format: (length, width, height)
box_list = []
regex = re.compile(r'^(\d+)x(\d+)x(\d+)$')
with open('day-2-input.txt', 'r') as f:
for line in f:
match = regex.match(line)
box_list.append((
int(match.group(1)),
int(match.group... | Complete day 2 part 2 | Complete day 2 part 2
| Python | mit | foxscotch/advent-of-code,foxscotch/advent-of-code | Complete day 2 part 2 | import re
# box_list will contain tuples in the format: (length, width, height)
box_list = []
regex = re.compile(r'^(\d+)x(\d+)x(\d+)$')
with open('day-2-input.txt', 'r') as f:
for line in f:
match = regex.match(line)
box_list.append((
int(match.group(1)),
int(match.group... | <commit_before><commit_msg>Complete day 2 part 2<commit_after> | import re
# box_list will contain tuples in the format: (length, width, height)
box_list = []
regex = re.compile(r'^(\d+)x(\d+)x(\d+)$')
with open('day-2-input.txt', 'r') as f:
for line in f:
match = regex.match(line)
box_list.append((
int(match.group(1)),
int(match.group... | Complete day 2 part 2import re
# box_list will contain tuples in the format: (length, width, height)
box_list = []
regex = re.compile(r'^(\d+)x(\d+)x(\d+)$')
with open('day-2-input.txt', 'r') as f:
for line in f:
match = regex.match(line)
box_list.append((
int(match.group(1)),
... | <commit_before><commit_msg>Complete day 2 part 2<commit_after>import re
# box_list will contain tuples in the format: (length, width, height)
box_list = []
regex = re.compile(r'^(\d+)x(\d+)x(\d+)$')
with open('day-2-input.txt', 'r') as f:
for line in f:
match = regex.match(line)
box_list.append(... | |
064c0161e91e24217d712cb80656a2d0dad8c3b6 | pretty.py | pretty.py | from termcolor import colored
def section(msg):
print(colored("\n::", "blue", attrs=["bold"]), colored(msg, attrs=["bold"]))
def task(msg):
print(colored("==>", "green", attrs=["bold"]), colored(msg, attrs=["bold"]))
def subtask(msg):
print(colored(" ->", "blue", attrs=["bold"]), colored(msg, attrs=["bold"... | from termcolor import colored
import datetime
def section(msg):
print(colored("\n::", "blue", attrs=["bold"]), colored(msg, attrs=["bold"]))
def task(msg):
print(colored("==>", "green", attrs=["bold"]), colored(msg, attrs=["bold"]))
def subtask(msg):
print(colored(" ->", "blue", attrs=["bold"]), colored(ms... | Fix progress bar to be 80-col-friendly. | Fix progress bar to be 80-col-friendly.
| Python | mit | jonhoo/periscope,jonhoo/periscope | from termcolor import colored
def section(msg):
print(colored("\n::", "blue", attrs=["bold"]), colored(msg, attrs=["bold"]))
def task(msg):
print(colored("==>", "green", attrs=["bold"]), colored(msg, attrs=["bold"]))
def subtask(msg):
print(colored(" ->", "blue", attrs=["bold"]), colored(msg, attrs=["bold"... | from termcolor import colored
import datetime
def section(msg):
print(colored("\n::", "blue", attrs=["bold"]), colored(msg, attrs=["bold"]))
def task(msg):
print(colored("==>", "green", attrs=["bold"]), colored(msg, attrs=["bold"]))
def subtask(msg):
print(colored(" ->", "blue", attrs=["bold"]), colored(ms... | <commit_before>from termcolor import colored
def section(msg):
print(colored("\n::", "blue", attrs=["bold"]), colored(msg, attrs=["bold"]))
def task(msg):
print(colored("==>", "green", attrs=["bold"]), colored(msg, attrs=["bold"]))
def subtask(msg):
print(colored(" ->", "blue", attrs=["bold"]), colored(msg... | from termcolor import colored
import datetime
def section(msg):
print(colored("\n::", "blue", attrs=["bold"]), colored(msg, attrs=["bold"]))
def task(msg):
print(colored("==>", "green", attrs=["bold"]), colored(msg, attrs=["bold"]))
def subtask(msg):
print(colored(" ->", "blue", attrs=["bold"]), colored(ms... | from termcolor import colored
def section(msg):
print(colored("\n::", "blue", attrs=["bold"]), colored(msg, attrs=["bold"]))
def task(msg):
print(colored("==>", "green", attrs=["bold"]), colored(msg, attrs=["bold"]))
def subtask(msg):
print(colored(" ->", "blue", attrs=["bold"]), colored(msg, attrs=["bold"... | <commit_before>from termcolor import colored
def section(msg):
print(colored("\n::", "blue", attrs=["bold"]), colored(msg, attrs=["bold"]))
def task(msg):
print(colored("==>", "green", attrs=["bold"]), colored(msg, attrs=["bold"]))
def subtask(msg):
print(colored(" ->", "blue", attrs=["bold"]), colored(msg... |
42755823774f4a57849c54d5812e885dfbeee34c | camelot/roundtable/migrations/0002_add_knight_data.py | camelot/roundtable/migrations/0002_add_knight_data.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('roundtable', '0001_initial'),
]
operations = [
]
| # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def add_knight_data(apps, schema_editor):
pass
def remove_knight_data(apps, schema_editor):
pass
class Migration(migrations.Migration):
dependencies = [
('roundtable', '0001_initial'),
... | Use RunPython operation to perform data migration. | Use RunPython operation to perform data migration.
| Python | bsd-2-clause | jambonrose/djangocon2014-updj17 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('roundtable', '0001_initial'),
]
operations = [
]
Use RunPython operation to perform data migration. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def add_knight_data(apps, schema_editor):
pass
def remove_knight_data(apps, schema_editor):
pass
class Migration(migrations.Migration):
dependencies = [
('roundtable', '0001_initial'),
... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('roundtable', '0001_initial'),
]
operations = [
]
<commit_msg>Use RunPython operation to perform data migration.<c... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def add_knight_data(apps, schema_editor):
pass
def remove_knight_data(apps, schema_editor):
pass
class Migration(migrations.Migration):
dependencies = [
('roundtable', '0001_initial'),
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('roundtable', '0001_initial'),
]
operations = [
]
Use RunPython operation to perform data migration.# -*- coding: utf-8 -*-
from ... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('roundtable', '0001_initial'),
]
operations = [
]
<commit_msg>Use RunPython operation to perform data migration.<c... |
658a1298e8d3c1645ed4b483e75d0a1b684fd162 | app.py | app.py | """ app.py """
from flask import Flask, render_template
import requests
app = Flask(__name__)
def get_time():
try:
response = requests.get('http://localhost:3001/time', timeout=3.0)
except (requests.exceptions.ConnectionError,
requests.exceptions.Timeout):
return 'Unavailable'
... | """ app.py """
from flask import Flask, render_template
import pybreaker
import requests
app = Flask(__name__)
time_breaker = pybreaker.CircuitBreaker(fail_max=3, reset_timeout=30)
@time_breaker
def _get_time():
try:
response = requests.get('http://localhost:3001/time', timeout=3.0)
except (request... | Update get_time to use a circuit breaker. | Update get_time to use a circuit breaker.
| Python | mit | danriti/short-circuit,danriti/short-circuit | """ app.py """
from flask import Flask, render_template
import requests
app = Flask(__name__)
def get_time():
try:
response = requests.get('http://localhost:3001/time', timeout=3.0)
except (requests.exceptions.ConnectionError,
requests.exceptions.Timeout):
return 'Unavailable'
... | """ app.py """
from flask import Flask, render_template
import pybreaker
import requests
app = Flask(__name__)
time_breaker = pybreaker.CircuitBreaker(fail_max=3, reset_timeout=30)
@time_breaker
def _get_time():
try:
response = requests.get('http://localhost:3001/time', timeout=3.0)
except (request... | <commit_before>""" app.py """
from flask import Flask, render_template
import requests
app = Flask(__name__)
def get_time():
try:
response = requests.get('http://localhost:3001/time', timeout=3.0)
except (requests.exceptions.ConnectionError,
requests.exceptions.Timeout):
return ... | """ app.py """
from flask import Flask, render_template
import pybreaker
import requests
app = Flask(__name__)
time_breaker = pybreaker.CircuitBreaker(fail_max=3, reset_timeout=30)
@time_breaker
def _get_time():
try:
response = requests.get('http://localhost:3001/time', timeout=3.0)
except (request... | """ app.py """
from flask import Flask, render_template
import requests
app = Flask(__name__)
def get_time():
try:
response = requests.get('http://localhost:3001/time', timeout=3.0)
except (requests.exceptions.ConnectionError,
requests.exceptions.Timeout):
return 'Unavailable'
... | <commit_before>""" app.py """
from flask import Flask, render_template
import requests
app = Flask(__name__)
def get_time():
try:
response = requests.get('http://localhost:3001/time', timeout=3.0)
except (requests.exceptions.ConnectionError,
requests.exceptions.Timeout):
return ... |
c8b9c302421f0f49f00db381954e7fc7cc657f52 | application/__init__.py | application/__init__.py | import os
import logging
from flask import Flask
from flask.ext.basicauth import BasicAuth
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
db = SQLAlchemy(app)
# auth
if os.environ.get('BASIC_AUTH_USERNAME'):
app.config['BASIC_AUTH_FORCE'] = ... | import os
import logging
from flask import Flask
from flask.ext.basicauth import BasicAuth
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
from werkzeug.contrib.fixers import ProxyFix
app.wsgi_app = ProxyFix(app.wsgi_app)
db = SQLAlchemy(app)
# a... | Add proxy fix as in lr this will run with reverse proxy | Add proxy fix as in lr this will run with reverse proxy
| Python | mit | LandRegistry/historian-alpha,LandRegistry/historian-alpha,LandRegistry/historian-alpha | import os
import logging
from flask import Flask
from flask.ext.basicauth import BasicAuth
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
db = SQLAlchemy(app)
# auth
if os.environ.get('BASIC_AUTH_USERNAME'):
app.config['BASIC_AUTH_FORCE'] = ... | import os
import logging
from flask import Flask
from flask.ext.basicauth import BasicAuth
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
from werkzeug.contrib.fixers import ProxyFix
app.wsgi_app = ProxyFix(app.wsgi_app)
db = SQLAlchemy(app)
# a... | <commit_before>import os
import logging
from flask import Flask
from flask.ext.basicauth import BasicAuth
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
db = SQLAlchemy(app)
# auth
if os.environ.get('BASIC_AUTH_USERNAME'):
app.config['BASIC_... | import os
import logging
from flask import Flask
from flask.ext.basicauth import BasicAuth
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
from werkzeug.contrib.fixers import ProxyFix
app.wsgi_app = ProxyFix(app.wsgi_app)
db = SQLAlchemy(app)
# a... | import os
import logging
from flask import Flask
from flask.ext.basicauth import BasicAuth
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
db = SQLAlchemy(app)
# auth
if os.environ.get('BASIC_AUTH_USERNAME'):
app.config['BASIC_AUTH_FORCE'] = ... | <commit_before>import os
import logging
from flask import Flask
from flask.ext.basicauth import BasicAuth
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
db = SQLAlchemy(app)
# auth
if os.environ.get('BASIC_AUTH_USERNAME'):
app.config['BASIC_... |
2250180ea7cc0eb91c8b1cdc7d565397326f480b | UM/Scene/SceneNodeDecorator.py | UM/Scene/SceneNodeDecorator.py | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
class SceneNodeDecorator():
def __init__(self):
super().__init__()
self._node = None
def setNode(self, node):
self._node = node | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
class SceneNodeDecorator():
def __init__(self):
super().__init__()
self._node = None
def setNode(self, node):
self._node = node
def getNode(self):
return self._node
| Add a getter for a Decorator's Scene Node | Add a getter for a Decorator's Scene Node
| Python | agpl-3.0 | onitake/Uranium,onitake/Uranium | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
class SceneNodeDecorator():
def __init__(self):
super().__init__()
self._node = None
def setNode(self, node):
self._node = nodeAdd a getter for a Decorator's Scene Node | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
class SceneNodeDecorator():
def __init__(self):
super().__init__()
self._node = None
def setNode(self, node):
self._node = node
def getNode(self):
return self._node
| <commit_before># Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
class SceneNodeDecorator():
def __init__(self):
super().__init__()
self._node = None
def setNode(self, node):
self._node = node<commit_msg>Add a getter for a Decora... | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
class SceneNodeDecorator():
def __init__(self):
super().__init__()
self._node = None
def setNode(self, node):
self._node = node
def getNode(self):
return self._node
| # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
class SceneNodeDecorator():
def __init__(self):
super().__init__()
self._node = None
def setNode(self, node):
self._node = nodeAdd a getter for a Decorator's Scene Node# Copyright... | <commit_before># Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
class SceneNodeDecorator():
def __init__(self):
super().__init__()
self._node = None
def setNode(self, node):
self._node = node<commit_msg>Add a getter for a Decora... |
2301b0bfdb216f31428e6c9ca0bf6b2951a5e64b | symposion/forms.py | symposion/forms.py | from django import forms
import account.forms
class SignupForm(account.forms.SignupForm):
first_name = forms.CharField()
last_name = forms.CharField()
email_confirm = forms.EmailField(label="Confirm Email")
def __init__(self, *args, **kwargs):
super(SignupForm, self).__init__(*args, **kwarg... | try:
from collections import OrderedDict
except ImportError:
OrderedDict = None
import account.forms
from django import forms
from django.utils.translation import ugettext_lazy as _
class SignupForm(account.forms.SignupForm):
first_name = forms.CharField(label=_("First name"))
last_name = forms.Char... | Fix order fields in signup form | Fix order fields in signup form
| Python | bsd-3-clause | toulibre/symposion,toulibre/symposion | from django import forms
import account.forms
class SignupForm(account.forms.SignupForm):
first_name = forms.CharField()
last_name = forms.CharField()
email_confirm = forms.EmailField(label="Confirm Email")
def __init__(self, *args, **kwargs):
super(SignupForm, self).__init__(*args, **kwarg... | try:
from collections import OrderedDict
except ImportError:
OrderedDict = None
import account.forms
from django import forms
from django.utils.translation import ugettext_lazy as _
class SignupForm(account.forms.SignupForm):
first_name = forms.CharField(label=_("First name"))
last_name = forms.Char... | <commit_before>from django import forms
import account.forms
class SignupForm(account.forms.SignupForm):
first_name = forms.CharField()
last_name = forms.CharField()
email_confirm = forms.EmailField(label="Confirm Email")
def __init__(self, *args, **kwargs):
super(SignupForm, self).__init__... | try:
from collections import OrderedDict
except ImportError:
OrderedDict = None
import account.forms
from django import forms
from django.utils.translation import ugettext_lazy as _
class SignupForm(account.forms.SignupForm):
first_name = forms.CharField(label=_("First name"))
last_name = forms.Char... | from django import forms
import account.forms
class SignupForm(account.forms.SignupForm):
first_name = forms.CharField()
last_name = forms.CharField()
email_confirm = forms.EmailField(label="Confirm Email")
def __init__(self, *args, **kwargs):
super(SignupForm, self).__init__(*args, **kwarg... | <commit_before>from django import forms
import account.forms
class SignupForm(account.forms.SignupForm):
first_name = forms.CharField()
last_name = forms.CharField()
email_confirm = forms.EmailField(label="Confirm Email")
def __init__(self, *args, **kwargs):
super(SignupForm, self).__init__... |
bece33fc211f436facd1d1b4c713a46ebaad372c | examples/miniapps/fastapi/giphynavigator/endpoints.py | examples/miniapps/fastapi/giphynavigator/endpoints.py | """Endpoints module."""
from dependency_injector.wiring import Provide
from .containers import Container
async def index(
query: str = Provide[Container.config.default.query],
limit: int = Provide[Container.config.default.limit.as_int()],
search_service = Provide[Container.search_service],
)... | """Endpoints module."""
from dependency_injector.wiring import Provide
from .containers import Container
async def index(
query: str = Provide[Container.config.default.query],
limit: int = Provide[Container.config.default.limit.as_int()],
search_service=Provide[Container.search_service],
):
... | Fix fastapi example flake8 error | Fix fastapi example flake8 error
| Python | bsd-3-clause | ets-labs/dependency_injector,ets-labs/python-dependency-injector,rmk135/dependency_injector,rmk135/objects | """Endpoints module."""
from dependency_injector.wiring import Provide
from .containers import Container
async def index(
query: str = Provide[Container.config.default.query],
limit: int = Provide[Container.config.default.limit.as_int()],
search_service = Provide[Container.search_service],
)... | """Endpoints module."""
from dependency_injector.wiring import Provide
from .containers import Container
async def index(
query: str = Provide[Container.config.default.query],
limit: int = Provide[Container.config.default.limit.as_int()],
search_service=Provide[Container.search_service],
):
... | <commit_before>"""Endpoints module."""
from dependency_injector.wiring import Provide
from .containers import Container
async def index(
query: str = Provide[Container.config.default.query],
limit: int = Provide[Container.config.default.limit.as_int()],
search_service = Provide[Container.sea... | """Endpoints module."""
from dependency_injector.wiring import Provide
from .containers import Container
async def index(
query: str = Provide[Container.config.default.query],
limit: int = Provide[Container.config.default.limit.as_int()],
search_service=Provide[Container.search_service],
):
... | """Endpoints module."""
from dependency_injector.wiring import Provide
from .containers import Container
async def index(
query: str = Provide[Container.config.default.query],
limit: int = Provide[Container.config.default.limit.as_int()],
search_service = Provide[Container.search_service],
)... | <commit_before>"""Endpoints module."""
from dependency_injector.wiring import Provide
from .containers import Container
async def index(
query: str = Provide[Container.config.default.query],
limit: int = Provide[Container.config.default.limit.as_int()],
search_service = Provide[Container.sea... |
18d973d71255d389369cc4450f721512a13ad6cb | src/impl/geocoder.py | src/impl/geocoder.py | import geopy
from rate_limiter import RateLimiter
class Geocoder(object):
def __init__(self, api_key=None, client_id=None, secret_key=None):
if api_key:
self._geolocator = geopy.GoogleV3(api_key=api_key)
elif client_id and secret_key:
self._geolocator = geopy.GoogleV3(clie... | from Geohash import geohash
import geopy
from rate_limiter import RateLimiter
class Geocoder(object):
def __init__(self, api_key=None, client_id=None, secret_key=None, reverse_cache_geohash=9):
if api_key:
self._geolocator = geopy.GoogleV3(api_key=api_key)
elif client_id and secret_ke... | Add in-memory geohash cache for reverse geocoding. | Add in-memory geohash cache for reverse geocoding.
| Python | mit | cbigler/jackrabbit-googlev3-geocoder | import geopy
from rate_limiter import RateLimiter
class Geocoder(object):
def __init__(self, api_key=None, client_id=None, secret_key=None):
if api_key:
self._geolocator = geopy.GoogleV3(api_key=api_key)
elif client_id and secret_key:
self._geolocator = geopy.GoogleV3(clie... | from Geohash import geohash
import geopy
from rate_limiter import RateLimiter
class Geocoder(object):
def __init__(self, api_key=None, client_id=None, secret_key=None, reverse_cache_geohash=9):
if api_key:
self._geolocator = geopy.GoogleV3(api_key=api_key)
elif client_id and secret_ke... | <commit_before>import geopy
from rate_limiter import RateLimiter
class Geocoder(object):
def __init__(self, api_key=None, client_id=None, secret_key=None):
if api_key:
self._geolocator = geopy.GoogleV3(api_key=api_key)
elif client_id and secret_key:
self._geolocator = geop... | from Geohash import geohash
import geopy
from rate_limiter import RateLimiter
class Geocoder(object):
def __init__(self, api_key=None, client_id=None, secret_key=None, reverse_cache_geohash=9):
if api_key:
self._geolocator = geopy.GoogleV3(api_key=api_key)
elif client_id and secret_ke... | import geopy
from rate_limiter import RateLimiter
class Geocoder(object):
def __init__(self, api_key=None, client_id=None, secret_key=None):
if api_key:
self._geolocator = geopy.GoogleV3(api_key=api_key)
elif client_id and secret_key:
self._geolocator = geopy.GoogleV3(clie... | <commit_before>import geopy
from rate_limiter import RateLimiter
class Geocoder(object):
def __init__(self, api_key=None, client_id=None, secret_key=None):
if api_key:
self._geolocator = geopy.GoogleV3(api_key=api_key)
elif client_id and secret_key:
self._geolocator = geop... |
08a95f7793d496d36cc0a753694c2975b2f30c68 | accelerator/migrations/0074_update_url_to_community.py | accelerator/migrations/0074_update_url_to_community.py | # Generated by Django 2.2.10 on 2021-11-05 12:29
from django.db import migrations
from django.db.models.query_utils import Q
def update_url_to_community(apps, schema_editor):
people_url = "/people"
mentor_url = "/directory"
community_url = "/community"
SiteRedirectPage = apps.get_model('accelerator',... | # Generated by Django 2.2.10 on 2021-11-05 12:29
from django.db import migrations
from django.db.models.query_utils import Q
def update_url_to_community(apps, schema_editor):
people_url = ["/people", "/people"]
mentor_url = "/directory"
mentor_refinement_url = "/directory/?refinementList%5Bhome_program_f... | Add another constraint for the url | [AC-9046] Add another constraint for the url
| Python | mit | masschallenge/django-accelerator,masschallenge/django-accelerator | # Generated by Django 2.2.10 on 2021-11-05 12:29
from django.db import migrations
from django.db.models.query_utils import Q
def update_url_to_community(apps, schema_editor):
people_url = "/people"
mentor_url = "/directory"
community_url = "/community"
SiteRedirectPage = apps.get_model('accelerator',... | # Generated by Django 2.2.10 on 2021-11-05 12:29
from django.db import migrations
from django.db.models.query_utils import Q
def update_url_to_community(apps, schema_editor):
people_url = ["/people", "/people"]
mentor_url = "/directory"
mentor_refinement_url = "/directory/?refinementList%5Bhome_program_f... | <commit_before># Generated by Django 2.2.10 on 2021-11-05 12:29
from django.db import migrations
from django.db.models.query_utils import Q
def update_url_to_community(apps, schema_editor):
people_url = "/people"
mentor_url = "/directory"
community_url = "/community"
SiteRedirectPage = apps.get_model... | # Generated by Django 2.2.10 on 2021-11-05 12:29
from django.db import migrations
from django.db.models.query_utils import Q
def update_url_to_community(apps, schema_editor):
people_url = ["/people", "/people"]
mentor_url = "/directory"
mentor_refinement_url = "/directory/?refinementList%5Bhome_program_f... | # Generated by Django 2.2.10 on 2021-11-05 12:29
from django.db import migrations
from django.db.models.query_utils import Q
def update_url_to_community(apps, schema_editor):
people_url = "/people"
mentor_url = "/directory"
community_url = "/community"
SiteRedirectPage = apps.get_model('accelerator',... | <commit_before># Generated by Django 2.2.10 on 2021-11-05 12:29
from django.db import migrations
from django.db.models.query_utils import Q
def update_url_to_community(apps, schema_editor):
people_url = "/people"
mentor_url = "/directory"
community_url = "/community"
SiteRedirectPage = apps.get_model... |
d9b00cbaf794ba4e10cd264e8d0e722f9f21fa26 | pastas/version.py | pastas/version.py | # This is the only location where the version will be written and changed.
# Based on https://packaging.python.org/single_source_version/
__version__ = '0.17.1'
| # This is the only location where the version will be written and changed.
# Based on https://packaging.python.org/single_source_version/
__version__ = '0.18.0b'
| Update Dev back to v0.18.0b | Update Dev back to v0.18.0b
| Python | mit | pastas/pasta,pastas/pastas | # This is the only location where the version will be written and changed.
# Based on https://packaging.python.org/single_source_version/
__version__ = '0.17.1'
Update Dev back to v0.18.0b | # This is the only location where the version will be written and changed.
# Based on https://packaging.python.org/single_source_version/
__version__ = '0.18.0b'
| <commit_before># This is the only location where the version will be written and changed.
# Based on https://packaging.python.org/single_source_version/
__version__ = '0.17.1'
<commit_msg>Update Dev back to v0.18.0b<commit_after> | # This is the only location where the version will be written and changed.
# Based on https://packaging.python.org/single_source_version/
__version__ = '0.18.0b'
| # This is the only location where the version will be written and changed.
# Based on https://packaging.python.org/single_source_version/
__version__ = '0.17.1'
Update Dev back to v0.18.0b# This is the only location where the version will be written and changed.
# Based on https://packaging.python.org/single_source_ver... | <commit_before># This is the only location where the version will be written and changed.
# Based on https://packaging.python.org/single_source_version/
__version__ = '0.17.1'
<commit_msg>Update Dev back to v0.18.0b<commit_after># This is the only location where the version will be written and changed.
# Based on https... |
a460713d36e8310a9f975d13d49579e77d83dfe7 | examples/with-shapely.py | examples/with-shapely.py |
import logging
import sys
from shapely.geometry import mapping, shape
from fiona import collection
logging.basicConfig(stream=sys.stderr, level=logging.INFO)
with collection("docs/data/test_uk.shp", "r") as input:
schema = input.schema.copy()
with collection(
"with-shapely.shp", "w",... |
import logging
import sys
from shapely.geometry import mapping, shape
from fiona import collection
logging.basicConfig(stream=sys.stderr, level=logging.INFO)
with collection("docs/data/test_uk.shp", "r") as input:
schema = input.schema.copy()
with collection(
"with-shapely.shp", "w",... | Fix validity assertion and add another. | Fix validity assertion and add another.
| Python | bsd-3-clause | johanvdw/Fiona,Toblerity/Fiona,rbuffat/Fiona,Toblerity/Fiona,perrygeo/Fiona,perrygeo/Fiona,sgillies/Fiona,rbuffat/Fiona |
import logging
import sys
from shapely.geometry import mapping, shape
from fiona import collection
logging.basicConfig(stream=sys.stderr, level=logging.INFO)
with collection("docs/data/test_uk.shp", "r") as input:
schema = input.schema.copy()
with collection(
"with-shapely.shp", "w",... |
import logging
import sys
from shapely.geometry import mapping, shape
from fiona import collection
logging.basicConfig(stream=sys.stderr, level=logging.INFO)
with collection("docs/data/test_uk.shp", "r") as input:
schema = input.schema.copy()
with collection(
"with-shapely.shp", "w",... | <commit_before>
import logging
import sys
from shapely.geometry import mapping, shape
from fiona import collection
logging.basicConfig(stream=sys.stderr, level=logging.INFO)
with collection("docs/data/test_uk.shp", "r") as input:
schema = input.schema.copy()
with collection(
"with-sha... |
import logging
import sys
from shapely.geometry import mapping, shape
from fiona import collection
logging.basicConfig(stream=sys.stderr, level=logging.INFO)
with collection("docs/data/test_uk.shp", "r") as input:
schema = input.schema.copy()
with collection(
"with-shapely.shp", "w",... |
import logging
import sys
from shapely.geometry import mapping, shape
from fiona import collection
logging.basicConfig(stream=sys.stderr, level=logging.INFO)
with collection("docs/data/test_uk.shp", "r") as input:
schema = input.schema.copy()
with collection(
"with-shapely.shp", "w",... | <commit_before>
import logging
import sys
from shapely.geometry import mapping, shape
from fiona import collection
logging.basicConfig(stream=sys.stderr, level=logging.INFO)
with collection("docs/data/test_uk.shp", "r") as input:
schema = input.schema.copy()
with collection(
"with-sha... |
6fa919ae5ef0755ec3c84e11aad9aa98a016fad4 | wafw00f/plugins/ptaf.py | wafw00f/plugins/ptaf.py | #!/usr/bin/env python
'''
Copyright (C) 2020, WAFW00F Developers.
See the LICENSE file for copying permission.
'''
NAME = 'PT Application Firewall (Positive Technologies)'
def is_waf(self):
schemes = [
self.matchContent(r'<h1.{0,10}?Forbidden'),
self.matchContent(r'<pre>Request.ID:.{0,10}?\d{4}\-... | #!/usr/bin/env python
'''
Copyright (C) 2020, WAFW00F Developers.
See the LICENSE file for copying permission.
'''
NAME = 'PT Application Firewall (Positive Technologies)'
def is_waf(self):
schemes = [
self.matchContent(r'<h1.{0,10}?Forbidden'),
self.matchContent(r'<pre>Request.ID:.{0,10}?\d{4}\-... | Fix error in Request ID regex | Fix error in Request ID regex
Fix error in Request ID regex that breaks correct WAF identification.
Changed 15 to 35, because 15 symbols between date and 'pre>' is not enough for this signature.
Sample of WAF block response:
<h1>Forbidden</h1><pre>Request ID: 2017-07-31-13-59-56-72BCA33A11EC3784</pre> | Python | bsd-3-clause | EnableSecurity/wafw00f | #!/usr/bin/env python
'''
Copyright (C) 2020, WAFW00F Developers.
See the LICENSE file for copying permission.
'''
NAME = 'PT Application Firewall (Positive Technologies)'
def is_waf(self):
schemes = [
self.matchContent(r'<h1.{0,10}?Forbidden'),
self.matchContent(r'<pre>Request.ID:.{0,10}?\d{4}\-... | #!/usr/bin/env python
'''
Copyright (C) 2020, WAFW00F Developers.
See the LICENSE file for copying permission.
'''
NAME = 'PT Application Firewall (Positive Technologies)'
def is_waf(self):
schemes = [
self.matchContent(r'<h1.{0,10}?Forbidden'),
self.matchContent(r'<pre>Request.ID:.{0,10}?\d{4}\-... | <commit_before>#!/usr/bin/env python
'''
Copyright (C) 2020, WAFW00F Developers.
See the LICENSE file for copying permission.
'''
NAME = 'PT Application Firewall (Positive Technologies)'
def is_waf(self):
schemes = [
self.matchContent(r'<h1.{0,10}?Forbidden'),
self.matchContent(r'<pre>Request.ID:... | #!/usr/bin/env python
'''
Copyright (C) 2020, WAFW00F Developers.
See the LICENSE file for copying permission.
'''
NAME = 'PT Application Firewall (Positive Technologies)'
def is_waf(self):
schemes = [
self.matchContent(r'<h1.{0,10}?Forbidden'),
self.matchContent(r'<pre>Request.ID:.{0,10}?\d{4}\-... | #!/usr/bin/env python
'''
Copyright (C) 2020, WAFW00F Developers.
See the LICENSE file for copying permission.
'''
NAME = 'PT Application Firewall (Positive Technologies)'
def is_waf(self):
schemes = [
self.matchContent(r'<h1.{0,10}?Forbidden'),
self.matchContent(r'<pre>Request.ID:.{0,10}?\d{4}\-... | <commit_before>#!/usr/bin/env python
'''
Copyright (C) 2020, WAFW00F Developers.
See the LICENSE file for copying permission.
'''
NAME = 'PT Application Firewall (Positive Technologies)'
def is_waf(self):
schemes = [
self.matchContent(r'<h1.{0,10}?Forbidden'),
self.matchContent(r'<pre>Request.ID:... |
33794ea942fe7110eccddcd3ed397fefea77f7b2 | kokki/cookbooks/aws/recipes/default.py | kokki/cookbooks/aws/recipes/default.py |
import os
from kokki import *
# Package("python-boto")
Execute("pip install git+http://github.com/boto/boto.git#egg=boto",
not_if = 'python -c "import boto"')
Execute("mv /usr/lib/pymodules/python2.6/boto /tmp/boto.orig",
only_if = os.path.exists("/usr/lib/pymodules/python2.6/boto"))
# Mount volumes and form... |
import os
from kokki import *
# Package("python-boto")
Execute("pip install git+http://github.com/boto/boto.git#egg=boto",
not_if = 'python -c "import boto"')
Execute("mv /usr/lib/pymodules/python2.6/boto /tmp/boto.orig",
only_if = lambda:os.path.exists("/usr/lib/pymodules/python2.6/boto"))
# Mount volumes a... | Install github verison of boto in aws cookbook (for now) | Install github verison of boto in aws cookbook (for now)
| Python | bsd-3-clause | samuel/kokki |
import os
from kokki import *
# Package("python-boto")
Execute("pip install git+http://github.com/boto/boto.git#egg=boto",
not_if = 'python -c "import boto"')
Execute("mv /usr/lib/pymodules/python2.6/boto /tmp/boto.orig",
only_if = os.path.exists("/usr/lib/pymodules/python2.6/boto"))
# Mount volumes and form... |
import os
from kokki import *
# Package("python-boto")
Execute("pip install git+http://github.com/boto/boto.git#egg=boto",
not_if = 'python -c "import boto"')
Execute("mv /usr/lib/pymodules/python2.6/boto /tmp/boto.orig",
only_if = lambda:os.path.exists("/usr/lib/pymodules/python2.6/boto"))
# Mount volumes a... | <commit_before>
import os
from kokki import *
# Package("python-boto")
Execute("pip install git+http://github.com/boto/boto.git#egg=boto",
not_if = 'python -c "import boto"')
Execute("mv /usr/lib/pymodules/python2.6/boto /tmp/boto.orig",
only_if = os.path.exists("/usr/lib/pymodules/python2.6/boto"))
# Mount v... |
import os
from kokki import *
# Package("python-boto")
Execute("pip install git+http://github.com/boto/boto.git#egg=boto",
not_if = 'python -c "import boto"')
Execute("mv /usr/lib/pymodules/python2.6/boto /tmp/boto.orig",
only_if = lambda:os.path.exists("/usr/lib/pymodules/python2.6/boto"))
# Mount volumes a... |
import os
from kokki import *
# Package("python-boto")
Execute("pip install git+http://github.com/boto/boto.git#egg=boto",
not_if = 'python -c "import boto"')
Execute("mv /usr/lib/pymodules/python2.6/boto /tmp/boto.orig",
only_if = os.path.exists("/usr/lib/pymodules/python2.6/boto"))
# Mount volumes and form... | <commit_before>
import os
from kokki import *
# Package("python-boto")
Execute("pip install git+http://github.com/boto/boto.git#egg=boto",
not_if = 'python -c "import boto"')
Execute("mv /usr/lib/pymodules/python2.6/boto /tmp/boto.orig",
only_if = os.path.exists("/usr/lib/pymodules/python2.6/boto"))
# Mount v... |
d7f078dca52afbd081760262498200990c318e95 | allaccess/tests/__init__.py | allaccess/tests/__init__.py | from .test_backends import AuthBackendTestCase
from .test_clients import OAuthClientTestCase, OAuth2ClientTestCase
from .test_context_processors import AvailableProvidersTestCase
from .test_models import ProviderTestCase, AccountAccessTestCase
from .test_views import OAuthRedirectTestCase, OAuthCallbackTestCase
| from .test_backends import AuthBackendTestCase
from .test_clients import OAuthClientTestCase, OAuth2ClientTestCase
from .test_commands import MigrateProvidersTestCase
from .test_context_processors import AvailableProvidersTestCase
from .test_models import ProviderTestCase, AccountAccessTestCase
from .test_views import ... | Add import for test discovery prior to Django 1.6 | Add import for test discovery prior to Django 1.6
| Python | bsd-2-clause | mlavin/django-all-access,vyscond/django-all-access,iXioN/django-all-access,dpoirier/django-all-access,mlavin/django-all-access,vyscond/django-all-access,dpoirier/django-all-access,iXioN/django-all-access | from .test_backends import AuthBackendTestCase
from .test_clients import OAuthClientTestCase, OAuth2ClientTestCase
from .test_context_processors import AvailableProvidersTestCase
from .test_models import ProviderTestCase, AccountAccessTestCase
from .test_views import OAuthRedirectTestCase, OAuthCallbackTestCase
Add imp... | from .test_backends import AuthBackendTestCase
from .test_clients import OAuthClientTestCase, OAuth2ClientTestCase
from .test_commands import MigrateProvidersTestCase
from .test_context_processors import AvailableProvidersTestCase
from .test_models import ProviderTestCase, AccountAccessTestCase
from .test_views import ... | <commit_before>from .test_backends import AuthBackendTestCase
from .test_clients import OAuthClientTestCase, OAuth2ClientTestCase
from .test_context_processors import AvailableProvidersTestCase
from .test_models import ProviderTestCase, AccountAccessTestCase
from .test_views import OAuthRedirectTestCase, OAuthCallbackT... | from .test_backends import AuthBackendTestCase
from .test_clients import OAuthClientTestCase, OAuth2ClientTestCase
from .test_commands import MigrateProvidersTestCase
from .test_context_processors import AvailableProvidersTestCase
from .test_models import ProviderTestCase, AccountAccessTestCase
from .test_views import ... | from .test_backends import AuthBackendTestCase
from .test_clients import OAuthClientTestCase, OAuth2ClientTestCase
from .test_context_processors import AvailableProvidersTestCase
from .test_models import ProviderTestCase, AccountAccessTestCase
from .test_views import OAuthRedirectTestCase, OAuthCallbackTestCase
Add imp... | <commit_before>from .test_backends import AuthBackendTestCase
from .test_clients import OAuthClientTestCase, OAuth2ClientTestCase
from .test_context_processors import AvailableProvidersTestCase
from .test_models import ProviderTestCase, AccountAccessTestCase
from .test_views import OAuthRedirectTestCase, OAuthCallbackT... |
0ae9fcccb1c67a8d9337e4ef2887fb7ea2e01d51 | mpltools/io/core.py | mpltools/io/core.py | import os
import matplotlib.pyplot as plt
def save_all_figs(directory='./', fmt=None, default_name='untitled%i'):
"""Save all open figures.
Each figure is saved with the title of the plot, if possible.
Parameters
------------
directory : str
Path where figures are saved.
fmt : str, l... | import os
import matplotlib.pyplot as plt
def save_all_figs(directory='./', fmt=None, default_name='untitled%i'):
"""Save all open figures.
Each figure is saved with the title of the plot, if possible.
Parameters
------------
directory : str
Path where figures are saved.
fmt : str, l... | Refactor formatting of save name. | Refactor formatting of save name.
| Python | bsd-3-clause | tonysyu/mpltools,matteoicardi/mpltools | import os
import matplotlib.pyplot as plt
def save_all_figs(directory='./', fmt=None, default_name='untitled%i'):
"""Save all open figures.
Each figure is saved with the title of the plot, if possible.
Parameters
------------
directory : str
Path where figures are saved.
fmt : str, l... | import os
import matplotlib.pyplot as plt
def save_all_figs(directory='./', fmt=None, default_name='untitled%i'):
"""Save all open figures.
Each figure is saved with the title of the plot, if possible.
Parameters
------------
directory : str
Path where figures are saved.
fmt : str, l... | <commit_before>import os
import matplotlib.pyplot as plt
def save_all_figs(directory='./', fmt=None, default_name='untitled%i'):
"""Save all open figures.
Each figure is saved with the title of the plot, if possible.
Parameters
------------
directory : str
Path where figures are saved.
... | import os
import matplotlib.pyplot as plt
def save_all_figs(directory='./', fmt=None, default_name='untitled%i'):
"""Save all open figures.
Each figure is saved with the title of the plot, if possible.
Parameters
------------
directory : str
Path where figures are saved.
fmt : str, l... | import os
import matplotlib.pyplot as plt
def save_all_figs(directory='./', fmt=None, default_name='untitled%i'):
"""Save all open figures.
Each figure is saved with the title of the plot, if possible.
Parameters
------------
directory : str
Path where figures are saved.
fmt : str, l... | <commit_before>import os
import matplotlib.pyplot as plt
def save_all_figs(directory='./', fmt=None, default_name='untitled%i'):
"""Save all open figures.
Each figure is saved with the title of the plot, if possible.
Parameters
------------
directory : str
Path where figures are saved.
... |
2e28cf549bd7de29143c317871008b3115e44975 | tests/vstb-example-html5/tests/rotate.py | tests/vstb-example-html5/tests/rotate.py | # pylint: disable=F0401
from stbt import press, wait_for_match
def wait_for_vstb_startup():
wait_for_match('stb-tester-350px.png')
def test_that_image_is_rotated_by_arrows():
press("KEY_LEFT")
wait_for_match('stb-tester-left.png')
press("KEY_RIGHT")
wait_for_match('stb-tester-right.png')
pre... | # pylint: disable=F0401
from stbt import press, wait_for_match
def wait_for_vstb_startup():
wait_for_match('stb-tester-350px.png', timeout_secs=20)
def test_that_image_is_rotated_by_arrows():
press("KEY_LEFT")
wait_for_match('stb-tester-left.png')
press("KEY_RIGHT")
wait_for_match('stb-tester-ri... | Fix virtual-stb intermittant test-failure on Travis | Fix virtual-stb intermittant test-failure on Travis
test_that_virtual_stb_configures_stb_tester_for_testing_virtual_stbs fails
intermittently on Travis because sometimes chrome takes longer than 10s to
start-up. This causes the test to fail with:
> MatchTimeout: Didn't find match for '.../stb-tester-350px.png' withi... | Python | lgpl-2.1 | LewisHaley/stb-tester,LewisHaley/stb-tester,martynjarvis/stb-tester,martynjarvis/stb-tester,LewisHaley/stb-tester,LewisHaley/stb-tester,LewisHaley/stb-tester,stb-tester/stb-tester,stb-tester/stb-tester,LewisHaley/stb-tester,LewisHaley/stb-tester,stb-tester/stb-tester,martynjarvis/stb-tester,stb-tester/stb-tester,martyn... | # pylint: disable=F0401
from stbt import press, wait_for_match
def wait_for_vstb_startup():
wait_for_match('stb-tester-350px.png')
def test_that_image_is_rotated_by_arrows():
press("KEY_LEFT")
wait_for_match('stb-tester-left.png')
press("KEY_RIGHT")
wait_for_match('stb-tester-right.png')
pre... | # pylint: disable=F0401
from stbt import press, wait_for_match
def wait_for_vstb_startup():
wait_for_match('stb-tester-350px.png', timeout_secs=20)
def test_that_image_is_rotated_by_arrows():
press("KEY_LEFT")
wait_for_match('stb-tester-left.png')
press("KEY_RIGHT")
wait_for_match('stb-tester-ri... | <commit_before># pylint: disable=F0401
from stbt import press, wait_for_match
def wait_for_vstb_startup():
wait_for_match('stb-tester-350px.png')
def test_that_image_is_rotated_by_arrows():
press("KEY_LEFT")
wait_for_match('stb-tester-left.png')
press("KEY_RIGHT")
wait_for_match('stb-tester-righ... | # pylint: disable=F0401
from stbt import press, wait_for_match
def wait_for_vstb_startup():
wait_for_match('stb-tester-350px.png', timeout_secs=20)
def test_that_image_is_rotated_by_arrows():
press("KEY_LEFT")
wait_for_match('stb-tester-left.png')
press("KEY_RIGHT")
wait_for_match('stb-tester-ri... | # pylint: disable=F0401
from stbt import press, wait_for_match
def wait_for_vstb_startup():
wait_for_match('stb-tester-350px.png')
def test_that_image_is_rotated_by_arrows():
press("KEY_LEFT")
wait_for_match('stb-tester-left.png')
press("KEY_RIGHT")
wait_for_match('stb-tester-right.png')
pre... | <commit_before># pylint: disable=F0401
from stbt import press, wait_for_match
def wait_for_vstb_startup():
wait_for_match('stb-tester-350px.png')
def test_that_image_is_rotated_by_arrows():
press("KEY_LEFT")
wait_for_match('stb-tester-left.png')
press("KEY_RIGHT")
wait_for_match('stb-tester-righ... |
5f9ce264d8b2d16cf951a52f05dc251358783638 | run.py | run.py | #!venv/bin/python
from app import app
if __name__ == '__main__':
app.run()
| #!venv/bin/python
from app import app
if __name__ == '__main__':
app.run(host='0.0.0.0')
| Make dev server visible across internal network | Make dev server visible across internal network
| Python | mit | CapitalD/taplist,CapitalD/taplist,CapitalD/taplist | #!venv/bin/python
from app import app
if __name__ == '__main__':
app.run()
Make dev server visible across internal network | #!venv/bin/python
from app import app
if __name__ == '__main__':
app.run(host='0.0.0.0')
| <commit_before>#!venv/bin/python
from app import app
if __name__ == '__main__':
app.run()
<commit_msg>Make dev server visible across internal network<commit_after> | #!venv/bin/python
from app import app
if __name__ == '__main__':
app.run(host='0.0.0.0')
| #!venv/bin/python
from app import app
if __name__ == '__main__':
app.run()
Make dev server visible across internal network#!venv/bin/python
from app import app
if __name__ == '__main__':
app.run(host='0.0.0.0')
| <commit_before>#!venv/bin/python
from app import app
if __name__ == '__main__':
app.run()
<commit_msg>Make dev server visible across internal network<commit_after>#!venv/bin/python
from app import app
if __name__ == '__main__':
app.run(host='0.0.0.0')
|
8f1536ce63e276964648e2938a8200c1fb1dd3a7 | api/utils/custom_serializers.py | api/utils/custom_serializers.py | import time
from rest_framework import serializers
class TimeStampField(serializers.Field):
def to_internal_value(self, data):
pass
def to_representation(self, value):
return int(time.mktime(value.timetuple()))
| import time
from rest_framework import serializers
class TimeStampField(serializers.Field):
def to_internal_value(self, data):
pass
def to_representation(self, value):
try:
return int(time.mktime(value.timetuple()))
except OverflowError:
return 0
| Fix exception on dates older then 1970 | Fix exception on dates older then 1970
| Python | apache-2.0 | ItsCalebJones/SpaceLaunchNow-Server,ItsCalebJones/SpaceLaunchNow-Server,ItsCalebJones/SpaceLaunchNow-Server | import time
from rest_framework import serializers
class TimeStampField(serializers.Field):
def to_internal_value(self, data):
pass
def to_representation(self, value):
return int(time.mktime(value.timetuple()))
Fix exception on dates older then 1970 | import time
from rest_framework import serializers
class TimeStampField(serializers.Field):
def to_internal_value(self, data):
pass
def to_representation(self, value):
try:
return int(time.mktime(value.timetuple()))
except OverflowError:
return 0
| <commit_before>import time
from rest_framework import serializers
class TimeStampField(serializers.Field):
def to_internal_value(self, data):
pass
def to_representation(self, value):
return int(time.mktime(value.timetuple()))
<commit_msg>Fix exception on dates older then 1970<commit_after> | import time
from rest_framework import serializers
class TimeStampField(serializers.Field):
def to_internal_value(self, data):
pass
def to_representation(self, value):
try:
return int(time.mktime(value.timetuple()))
except OverflowError:
return 0
| import time
from rest_framework import serializers
class TimeStampField(serializers.Field):
def to_internal_value(self, data):
pass
def to_representation(self, value):
return int(time.mktime(value.timetuple()))
Fix exception on dates older then 1970import time
from rest_framework import seria... | <commit_before>import time
from rest_framework import serializers
class TimeStampField(serializers.Field):
def to_internal_value(self, data):
pass
def to_representation(self, value):
return int(time.mktime(value.timetuple()))
<commit_msg>Fix exception on dates older then 1970<commit_after>imp... |
c8ad376bbb44bcae317fc09cee43cfc31dc70ded | src/hades/config/base.py | src/hades/config/base.py | class OptionMeta(type):
"""Metaclass for options. Classes that derive from options are registered
in a global dict"""
options = {}
def __new__(mcs, name, bases, attributes):
if name in mcs.options:
raise TypeError("An option named {} is already defined."
... | class OptionMeta(type):
"""
Metaclass for options.
Classes with this metaclass, which are named not declared abstract by
setting the abstract keyword argument are added to the :attr:`.options`
dictionary.
"""
options = {}
def __new__(mcs, name, bases, attributes, abstract=False):
... | Add ability to define abstract options classes | Add ability to define abstract options classes
Only actual options should be added to the options dict of OptionMeta. This
patch adds a abstract kwarg to the OptionMeta class, that allows declare, if an
option is abstract and should therefore not be added.
| Python | mit | agdsn/hades,agdsn/hades,agdsn/hades,agdsn/hades,agdsn/hades | class OptionMeta(type):
"""Metaclass for options. Classes that derive from options are registered
in a global dict"""
options = {}
def __new__(mcs, name, bases, attributes):
if name in mcs.options:
raise TypeError("An option named {} is already defined."
... | class OptionMeta(type):
"""
Metaclass for options.
Classes with this metaclass, which are named not declared abstract by
setting the abstract keyword argument are added to the :attr:`.options`
dictionary.
"""
options = {}
def __new__(mcs, name, bases, attributes, abstract=False):
... | <commit_before>class OptionMeta(type):
"""Metaclass for options. Classes that derive from options are registered
in a global dict"""
options = {}
def __new__(mcs, name, bases, attributes):
if name in mcs.options:
raise TypeError("An option named {} is already defined."
... | class OptionMeta(type):
"""
Metaclass for options.
Classes with this metaclass, which are named not declared abstract by
setting the abstract keyword argument are added to the :attr:`.options`
dictionary.
"""
options = {}
def __new__(mcs, name, bases, attributes, abstract=False):
... | class OptionMeta(type):
"""Metaclass for options. Classes that derive from options are registered
in a global dict"""
options = {}
def __new__(mcs, name, bases, attributes):
if name in mcs.options:
raise TypeError("An option named {} is already defined."
... | <commit_before>class OptionMeta(type):
"""Metaclass for options. Classes that derive from options are registered
in a global dict"""
options = {}
def __new__(mcs, name, bases, attributes):
if name in mcs.options:
raise TypeError("An option named {} is already defined."
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.