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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5125bbfcf96ff0d3f2690198b43ed96059eb6745 | common/parsableText.py | common/parsableText.py | from docutils import core
class ParsableText:
"""Allow to parse a string with different parsers"""
def __init__(self,content,mode="rst"):
"""Init the object. Content is the string to be parsed. Mode is the parser to be used. Currently, only rst(reStructuredText) and HTML are supported"""
... | from docutils import core
class ParsableText:
"""Allow to parse a string with different parsers"""
def __init__(self,content,mode="rst"):
"""Init the object. Content is the string to be parsed. Mode is the parser to be used. Currently, only rst(reStructuredText) and HTML are supported"""
... | Fix unicode in parsable text | Fix unicode in parsable text
| Python | agpl-3.0 | GuillaumeDerval/INGInious,GuillaumeDerval/INGInious,layus/INGInious,layus/INGInious,layus/INGInious,GuillaumeDerval/INGInious,GuillaumeDerval/INGInious,layus/INGInious | from docutils import core
class ParsableText:
"""Allow to parse a string with different parsers"""
def __init__(self,content,mode="rst"):
"""Init the object. Content is the string to be parsed. Mode is the parser to be used. Currently, only rst(reStructuredText) and HTML are supported"""
... | from docutils import core
class ParsableText:
"""Allow to parse a string with different parsers"""
def __init__(self,content,mode="rst"):
"""Init the object. Content is the string to be parsed. Mode is the parser to be used. Currently, only rst(reStructuredText) and HTML are supported"""
... | <commit_before>from docutils import core
class ParsableText:
"""Allow to parse a string with different parsers"""
def __init__(self,content,mode="rst"):
"""Init the object. Content is the string to be parsed. Mode is the parser to be used. Currently, only rst(reStructuredText) and HTML are suppor... | from docutils import core
class ParsableText:
"""Allow to parse a string with different parsers"""
def __init__(self,content,mode="rst"):
"""Init the object. Content is the string to be parsed. Mode is the parser to be used. Currently, only rst(reStructuredText) and HTML are supported"""
... | from docutils import core
class ParsableText:
"""Allow to parse a string with different parsers"""
def __init__(self,content,mode="rst"):
"""Init the object. Content is the string to be parsed. Mode is the parser to be used. Currently, only rst(reStructuredText) and HTML are supported"""
... | <commit_before>from docutils import core
class ParsableText:
"""Allow to parse a string with different parsers"""
def __init__(self,content,mode="rst"):
"""Init the object. Content is the string to be parsed. Mode is the parser to be used. Currently, only rst(reStructuredText) and HTML are suppor... |
acd376d854693cacf8ca20a9971dcd2653a22429 | rlpy/Agents/__init__.py | rlpy/Agents/__init__.py | from .TDControlAgent import Q_Learning, SARSA
# for compatibility of old scripts
Q_LEARNING = Q_Learning
from .Greedy_GQ import Greedy_GQ
from .LSPI import LSPI
from .LSPI_SARSA import LSPI_SARSA
from .NaturalActorCritic import NaturalActorCritic
| from .TDControlAgent import Q_Learning, SARSA
# for compatibility of old scripts
Q_LEARNING = Q_Learning
from .Greedy_GQ import Greedy_GQ
from .LSPI import LSPI
from .LSPI_SARSA import LSPI_SARSA
from .NaturalActorCritic import NaturalActorCritic
from .PosteriorSampling import PosteriorSampling
from .UCRL import UCRL
| Add new agents to init file | Add new agents to init file
| Python | bsd-3-clause | imanolarrieta/RL,imanolarrieta/RL,imanolarrieta/RL | from .TDControlAgent import Q_Learning, SARSA
# for compatibility of old scripts
Q_LEARNING = Q_Learning
from .Greedy_GQ import Greedy_GQ
from .LSPI import LSPI
from .LSPI_SARSA import LSPI_SARSA
from .NaturalActorCritic import NaturalActorCritic
Add new agents to init file | from .TDControlAgent import Q_Learning, SARSA
# for compatibility of old scripts
Q_LEARNING = Q_Learning
from .Greedy_GQ import Greedy_GQ
from .LSPI import LSPI
from .LSPI_SARSA import LSPI_SARSA
from .NaturalActorCritic import NaturalActorCritic
from .PosteriorSampling import PosteriorSampling
from .UCRL import UCRL
| <commit_before>from .TDControlAgent import Q_Learning, SARSA
# for compatibility of old scripts
Q_LEARNING = Q_Learning
from .Greedy_GQ import Greedy_GQ
from .LSPI import LSPI
from .LSPI_SARSA import LSPI_SARSA
from .NaturalActorCritic import NaturalActorCritic
<commit_msg>Add new agents to init file<commit_after> | from .TDControlAgent import Q_Learning, SARSA
# for compatibility of old scripts
Q_LEARNING = Q_Learning
from .Greedy_GQ import Greedy_GQ
from .LSPI import LSPI
from .LSPI_SARSA import LSPI_SARSA
from .NaturalActorCritic import NaturalActorCritic
from .PosteriorSampling import PosteriorSampling
from .UCRL import UCRL
| from .TDControlAgent import Q_Learning, SARSA
# for compatibility of old scripts
Q_LEARNING = Q_Learning
from .Greedy_GQ import Greedy_GQ
from .LSPI import LSPI
from .LSPI_SARSA import LSPI_SARSA
from .NaturalActorCritic import NaturalActorCritic
Add new agents to init filefrom .TDControlAgent import Q_Learning, SARSA
... | <commit_before>from .TDControlAgent import Q_Learning, SARSA
# for compatibility of old scripts
Q_LEARNING = Q_Learning
from .Greedy_GQ import Greedy_GQ
from .LSPI import LSPI
from .LSPI_SARSA import LSPI_SARSA
from .NaturalActorCritic import NaturalActorCritic
<commit_msg>Add new agents to init file<commit_after>from ... |
48bc050c59d60037fa719542db8f6a0c68752ed1 | config/flask_config.py | config/flask_config.py | # flake8: noqa: E501
import config.options
# Flask-SQLAlchemy
SQLALCHEMY_DATABASE_URI = 'mysql://{database_user}:{database_password}@{database_host}/{database_name}'.format(
database_user=config.options.DATABASE_USER,
database_password=config.options.DATABASE_PASSWORD,
database_host=config.options.DATABA... | # flake8: noqa: E501
import config.options
# Flask-SQLAlchemy
SQLALCHEMY_DATABASE_URI = 'mysql://{database_user}:{database_password}@{database_host}/{database_name}'.format(
database_user=config.options.DATABASE_USER,
database_password=config.options.DATABASE_PASSWORD,
database_host=config.options.DATABA... | Use Linkr-unique session cookie name | Use Linkr-unique session cookie name
| Python | mit | LINKIWI/linkr,LINKIWI/linkr,LINKIWI/linkr | # flake8: noqa: E501
import config.options
# Flask-SQLAlchemy
SQLALCHEMY_DATABASE_URI = 'mysql://{database_user}:{database_password}@{database_host}/{database_name}'.format(
database_user=config.options.DATABASE_USER,
database_password=config.options.DATABASE_PASSWORD,
database_host=config.options.DATABA... | # flake8: noqa: E501
import config.options
# Flask-SQLAlchemy
SQLALCHEMY_DATABASE_URI = 'mysql://{database_user}:{database_password}@{database_host}/{database_name}'.format(
database_user=config.options.DATABASE_USER,
database_password=config.options.DATABASE_PASSWORD,
database_host=config.options.DATABA... | <commit_before># flake8: noqa: E501
import config.options
# Flask-SQLAlchemy
SQLALCHEMY_DATABASE_URI = 'mysql://{database_user}:{database_password}@{database_host}/{database_name}'.format(
database_user=config.options.DATABASE_USER,
database_password=config.options.DATABASE_PASSWORD,
database_host=config... | # flake8: noqa: E501
import config.options
# Flask-SQLAlchemy
SQLALCHEMY_DATABASE_URI = 'mysql://{database_user}:{database_password}@{database_host}/{database_name}'.format(
database_user=config.options.DATABASE_USER,
database_password=config.options.DATABASE_PASSWORD,
database_host=config.options.DATABA... | # flake8: noqa: E501
import config.options
# Flask-SQLAlchemy
SQLALCHEMY_DATABASE_URI = 'mysql://{database_user}:{database_password}@{database_host}/{database_name}'.format(
database_user=config.options.DATABASE_USER,
database_password=config.options.DATABASE_PASSWORD,
database_host=config.options.DATABA... | <commit_before># flake8: noqa: E501
import config.options
# Flask-SQLAlchemy
SQLALCHEMY_DATABASE_URI = 'mysql://{database_user}:{database_password}@{database_host}/{database_name}'.format(
database_user=config.options.DATABASE_USER,
database_password=config.options.DATABASE_PASSWORD,
database_host=config... |
3ed02baa8ad7fcd1f6ca5cccc4f67799ec79e272 | kimi.py | kimi.py | # Kimi language interpreter in Python 3
# Anjana Vakil
# http://www.github.com/vakila/kimi
import sys
def tokenize(program):
'''Take a Kimi program as a string, return the tokenized program as a list of strings.
>>> tokenize("(+ 1 2)")
['(', '+', '1', '2', ')']
>>> tokenize("(define square (lambda x... | # Kimi language interpreter in Python 3
# Anjana Vakil
# http://www.github.com/vakila/kimi
import sys
def tokenize(string):
'''Take a Kimi program as a string, return the tokenized program as a list of strings.
>>> tokenize("(+ 1 2)")
['(', '+', '1', '2', ')']
>>> tokenize("(define square (lambda x ... | Rename program to string in tokenize | Rename program to string in tokenize
| Python | mit | vakila/kimi | # Kimi language interpreter in Python 3
# Anjana Vakil
# http://www.github.com/vakila/kimi
import sys
def tokenize(program):
'''Take a Kimi program as a string, return the tokenized program as a list of strings.
>>> tokenize("(+ 1 2)")
['(', '+', '1', '2', ')']
>>> tokenize("(define square (lambda x... | # Kimi language interpreter in Python 3
# Anjana Vakil
# http://www.github.com/vakila/kimi
import sys
def tokenize(string):
'''Take a Kimi program as a string, return the tokenized program as a list of strings.
>>> tokenize("(+ 1 2)")
['(', '+', '1', '2', ')']
>>> tokenize("(define square (lambda x ... | <commit_before># Kimi language interpreter in Python 3
# Anjana Vakil
# http://www.github.com/vakila/kimi
import sys
def tokenize(program):
'''Take a Kimi program as a string, return the tokenized program as a list of strings.
>>> tokenize("(+ 1 2)")
['(', '+', '1', '2', ')']
>>> tokenize("(define s... | # Kimi language interpreter in Python 3
# Anjana Vakil
# http://www.github.com/vakila/kimi
import sys
def tokenize(string):
'''Take a Kimi program as a string, return the tokenized program as a list of strings.
>>> tokenize("(+ 1 2)")
['(', '+', '1', '2', ')']
>>> tokenize("(define square (lambda x ... | # Kimi language interpreter in Python 3
# Anjana Vakil
# http://www.github.com/vakila/kimi
import sys
def tokenize(program):
'''Take a Kimi program as a string, return the tokenized program as a list of strings.
>>> tokenize("(+ 1 2)")
['(', '+', '1', '2', ')']
>>> tokenize("(define square (lambda x... | <commit_before># Kimi language interpreter in Python 3
# Anjana Vakil
# http://www.github.com/vakila/kimi
import sys
def tokenize(program):
'''Take a Kimi program as a string, return the tokenized program as a list of strings.
>>> tokenize("(+ 1 2)")
['(', '+', '1', '2', ')']
>>> tokenize("(define s... |
592105b9ee6a9c6f3d9bd7358bc5ab18f8ded0c8 | jfr_playoff/remote.py | jfr_playoff/remote.py | import re
import requests
from bs4 import BeautifulSoup as bs
from jfr_playoff.logger import PlayoffLogger
class RemoteUrl:
url_cache = {}
@classmethod
def fetch_raw(cls, url):
PlayoffLogger.get('remote').info(
'fetching content for: %s', url)
if url not in cls.url_cache:
... | import re
import requests
from bs4 import BeautifulSoup as bs
from jfr_playoff.logger import PlayoffLogger
class RemoteUrl:
url_cache = {}
@classmethod
def fetch_raw(cls, url):
PlayoffLogger.get('remote').info(
'fetching content for: %s', url)
if url not in cls.url_cache:
... | Print detected content encoding info only if it's actually been detected | Print detected content encoding info only if it's actually been detected
| Python | bsd-2-clause | emkael/jfrteamy-playoff,emkael/jfrteamy-playoff | import re
import requests
from bs4 import BeautifulSoup as bs
from jfr_playoff.logger import PlayoffLogger
class RemoteUrl:
url_cache = {}
@classmethod
def fetch_raw(cls, url):
PlayoffLogger.get('remote').info(
'fetching content for: %s', url)
if url not in cls.url_cache:
... | import re
import requests
from bs4 import BeautifulSoup as bs
from jfr_playoff.logger import PlayoffLogger
class RemoteUrl:
url_cache = {}
@classmethod
def fetch_raw(cls, url):
PlayoffLogger.get('remote').info(
'fetching content for: %s', url)
if url not in cls.url_cache:
... | <commit_before>import re
import requests
from bs4 import BeautifulSoup as bs
from jfr_playoff.logger import PlayoffLogger
class RemoteUrl:
url_cache = {}
@classmethod
def fetch_raw(cls, url):
PlayoffLogger.get('remote').info(
'fetching content for: %s', url)
if url not in cl... | import re
import requests
from bs4 import BeautifulSoup as bs
from jfr_playoff.logger import PlayoffLogger
class RemoteUrl:
url_cache = {}
@classmethod
def fetch_raw(cls, url):
PlayoffLogger.get('remote').info(
'fetching content for: %s', url)
if url not in cls.url_cache:
... | import re
import requests
from bs4 import BeautifulSoup as bs
from jfr_playoff.logger import PlayoffLogger
class RemoteUrl:
url_cache = {}
@classmethod
def fetch_raw(cls, url):
PlayoffLogger.get('remote').info(
'fetching content for: %s', url)
if url not in cls.url_cache:
... | <commit_before>import re
import requests
from bs4 import BeautifulSoup as bs
from jfr_playoff.logger import PlayoffLogger
class RemoteUrl:
url_cache = {}
@classmethod
def fetch_raw(cls, url):
PlayoffLogger.get('remote').info(
'fetching content for: %s', url)
if url not in cl... |
a7c40b43d90f32d0da4de1389d859865ae283180 | seleniumbase/config/proxy_list.py | seleniumbase/config/proxy_list.py | """
Proxy Server "Phone Book".
Simplify running browser tests through a proxy server
by adding your frequently-used proxies here.
Now you can do something like this on the command line:
"pytest SOME_TEST.py --proxy=proxy1"
Format of PROXY_LIST server entries:
* "ip_address:port" OR "username:password@ip_address:po... | """
Proxy Server "Phone Book".
Simplify running browser tests through a proxy server
by adding your frequently-used proxies here.
Now you can do something like this on the command line:
"pytest SOME_TEST.py --proxy=proxy1"
Format of PROXY_LIST server entries:
* "ip_address:port" OR "username:password@ip_address:po... | Update the proxy list examples | Update the proxy list examples
| Python | mit | mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase | """
Proxy Server "Phone Book".
Simplify running browser tests through a proxy server
by adding your frequently-used proxies here.
Now you can do something like this on the command line:
"pytest SOME_TEST.py --proxy=proxy1"
Format of PROXY_LIST server entries:
* "ip_address:port" OR "username:password@ip_address:po... | """
Proxy Server "Phone Book".
Simplify running browser tests through a proxy server
by adding your frequently-used proxies here.
Now you can do something like this on the command line:
"pytest SOME_TEST.py --proxy=proxy1"
Format of PROXY_LIST server entries:
* "ip_address:port" OR "username:password@ip_address:po... | <commit_before>"""
Proxy Server "Phone Book".
Simplify running browser tests through a proxy server
by adding your frequently-used proxies here.
Now you can do something like this on the command line:
"pytest SOME_TEST.py --proxy=proxy1"
Format of PROXY_LIST server entries:
* "ip_address:port" OR "username:passwor... | """
Proxy Server "Phone Book".
Simplify running browser tests through a proxy server
by adding your frequently-used proxies here.
Now you can do something like this on the command line:
"pytest SOME_TEST.py --proxy=proxy1"
Format of PROXY_LIST server entries:
* "ip_address:port" OR "username:password@ip_address:po... | """
Proxy Server "Phone Book".
Simplify running browser tests through a proxy server
by adding your frequently-used proxies here.
Now you can do something like this on the command line:
"pytest SOME_TEST.py --proxy=proxy1"
Format of PROXY_LIST server entries:
* "ip_address:port" OR "username:password@ip_address:po... | <commit_before>"""
Proxy Server "Phone Book".
Simplify running browser tests through a proxy server
by adding your frequently-used proxies here.
Now you can do something like this on the command line:
"pytest SOME_TEST.py --proxy=proxy1"
Format of PROXY_LIST server entries:
* "ip_address:port" OR "username:passwor... |
b158e65839b9b662d56bd43dfd362ad26da70184 | __init__.py | __init__.py | #Shoopdawoop
from . import CuraEngineBackend
from UM.Preferences import Preferences
def getMetaData():
return { "name": "CuraEngine Backend", "type": "Backend" }
def register(app):
Preferences.addPreference("BackendLocation","../PinkUnicornEngine/CuraEngine")
engine = CuraEngineBackend.CuraEngineBackend(... | #Shoopdawoop
from . import CuraEngineBackend
from UM.Preferences import Preferences
def getMetaData():
return { "name": "CuraEngine Backend", "type": "Backend" }
def register(app):
Preferences.addPreference("BackendLocation","../PinkUnicornEngine/CuraEngine")
return CuraEngineBackend.CuraEngineBackend()
... | Update plugin's register functions to return the object instance instead of performing the registration themselves | Update plugin's register functions to return the object instance instead of performing the registration themselves
| Python | agpl-3.0 | Curahelper/Cura,Curahelper/Cura,bq/Ultimaker-Cura,DeskboxBrazil/Cura,lo0ol/Ultimaker-Cura,quillford/Cura,fxtentacle/Cura,totalretribution/Cura,DeskboxBrazil/Cura,hmflash/Cura,ynotstartups/Wanhao,markwal/Cura,ad1217/Cura,ynotstartups/Wanhao,derekhe/Cura,lo0ol/Ultimaker-Cura,senttech/Cura,totalretribution/Cura,bq/Ultimak... | #Shoopdawoop
from . import CuraEngineBackend
from UM.Preferences import Preferences
def getMetaData():
return { "name": "CuraEngine Backend", "type": "Backend" }
def register(app):
Preferences.addPreference("BackendLocation","../PinkUnicornEngine/CuraEngine")
engine = CuraEngineBackend.CuraEngineBackend(... | #Shoopdawoop
from . import CuraEngineBackend
from UM.Preferences import Preferences
def getMetaData():
return { "name": "CuraEngine Backend", "type": "Backend" }
def register(app):
Preferences.addPreference("BackendLocation","../PinkUnicornEngine/CuraEngine")
return CuraEngineBackend.CuraEngineBackend()
... | <commit_before>#Shoopdawoop
from . import CuraEngineBackend
from UM.Preferences import Preferences
def getMetaData():
return { "name": "CuraEngine Backend", "type": "Backend" }
def register(app):
Preferences.addPreference("BackendLocation","../PinkUnicornEngine/CuraEngine")
engine = CuraEngineBackend.Cur... | #Shoopdawoop
from . import CuraEngineBackend
from UM.Preferences import Preferences
def getMetaData():
return { "name": "CuraEngine Backend", "type": "Backend" }
def register(app):
Preferences.addPreference("BackendLocation","../PinkUnicornEngine/CuraEngine")
return CuraEngineBackend.CuraEngineBackend()
... | #Shoopdawoop
from . import CuraEngineBackend
from UM.Preferences import Preferences
def getMetaData():
return { "name": "CuraEngine Backend", "type": "Backend" }
def register(app):
Preferences.addPreference("BackendLocation","../PinkUnicornEngine/CuraEngine")
engine = CuraEngineBackend.CuraEngineBackend(... | <commit_before>#Shoopdawoop
from . import CuraEngineBackend
from UM.Preferences import Preferences
def getMetaData():
return { "name": "CuraEngine Backend", "type": "Backend" }
def register(app):
Preferences.addPreference("BackendLocation","../PinkUnicornEngine/CuraEngine")
engine = CuraEngineBackend.Cur... |
c612b92847dc89bb4cd4b63502c43a7a9f63c52f | tx_salaries/utils/transformers/mixins.py | tx_salaries/utils/transformers/mixins.py | class OrganizationMixin(object):
@property
def organization(self):
return {
'name': self.ORGANIZATION_NAME,
'children': [{
'name': unicode(self.department),
}],
}
| class OrganizationMixin(object):
"""
Adds a generic ``organization`` property to the class
This requires that the class mixing it in adds an
``ORGANIZATION_NAME`` property of the main level agency or
department.
"""
@property
def organization(self):
return {
'name': ... | Add a docblock for this mixin | Add a docblock for this mixin
| Python | apache-2.0 | texastribune/tx_salaries,texastribune/tx_salaries | class OrganizationMixin(object):
@property
def organization(self):
return {
'name': self.ORGANIZATION_NAME,
'children': [{
'name': unicode(self.department),
}],
}
Add a docblock for this mixin | class OrganizationMixin(object):
"""
Adds a generic ``organization`` property to the class
This requires that the class mixing it in adds an
``ORGANIZATION_NAME`` property of the main level agency or
department.
"""
@property
def organization(self):
return {
'name': ... | <commit_before>class OrganizationMixin(object):
@property
def organization(self):
return {
'name': self.ORGANIZATION_NAME,
'children': [{
'name': unicode(self.department),
}],
}
<commit_msg>Add a docblock for this mixin<commit_after> | class OrganizationMixin(object):
"""
Adds a generic ``organization`` property to the class
This requires that the class mixing it in adds an
``ORGANIZATION_NAME`` property of the main level agency or
department.
"""
@property
def organization(self):
return {
'name': ... | class OrganizationMixin(object):
@property
def organization(self):
return {
'name': self.ORGANIZATION_NAME,
'children': [{
'name': unicode(self.department),
}],
}
Add a docblock for this mixinclass OrganizationMixin(object):
"""
Adds a... | <commit_before>class OrganizationMixin(object):
@property
def organization(self):
return {
'name': self.ORGANIZATION_NAME,
'children': [{
'name': unicode(self.department),
}],
}
<commit_msg>Add a docblock for this mixin<commit_after>class Orga... |
a08005a03ccce63a541e8e41b0d98e9c7c30cc67 | vispy/visuals/graphs/layouts/circular.py | vispy/visuals/graphs/layouts/circular.py | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Circular Layout
===============
This module contains several graph layouts which rely heavily on circles.
"""
import numpy as np
from ..util import _straight_line_vertic... | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Circular Layout
===============
This module contains several graph layouts which rely heavily on circles.
"""
import numpy as np
from ..util import _straight_line_vertic... | Use the more obvious linspace instead of arange | Use the more obvious linspace instead of arange
| Python | bsd-3-clause | michaelaye/vispy,Eric89GXL/vispy,drufat/vispy,drufat/vispy,drufat/vispy,michaelaye/vispy,ghisvail/vispy,ghisvail/vispy,Eric89GXL/vispy,ghisvail/vispy,michaelaye/vispy,Eric89GXL/vispy | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Circular Layout
===============
This module contains several graph layouts which rely heavily on circles.
"""
import numpy as np
from ..util import _straight_line_vertic... | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Circular Layout
===============
This module contains several graph layouts which rely heavily on circles.
"""
import numpy as np
from ..util import _straight_line_vertic... | <commit_before># -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Circular Layout
===============
This module contains several graph layouts which rely heavily on circles.
"""
import numpy as np
from ..util import _strai... | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Circular Layout
===============
This module contains several graph layouts which rely heavily on circles.
"""
import numpy as np
from ..util import _straight_line_vertic... | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Circular Layout
===============
This module contains several graph layouts which rely heavily on circles.
"""
import numpy as np
from ..util import _straight_line_vertic... | <commit_before># -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Circular Layout
===============
This module contains several graph layouts which rely heavily on circles.
"""
import numpy as np
from ..util import _strai... |
76b0c364b8bfbc553d3eedc97e4805299b8d9974 | extensions/ExtGameController.py | extensions/ExtGameController.py | from python_cowbull_game.GameController import GameController
from python_cowbull_game.GameMode import GameMode
class ExtGameController(GameController):
"""
TBC
"""
#
# Example of defining additional game modes:
# ==========================================
#
# Replace:
# ---------... | from python_cowbull_game.GameController import GameController
from python_cowbull_game.GameMode import GameMode
class ExtGameController(GameController):
"""
TBC
"""
#
# Example of defining additional game modes:
# ==========================================
#
# Replace:
# ---------... | Update to include instruction and help texts in GET response. | Update to include instruction and help texts in GET response.
| Python | apache-2.0 | dsandersAzure/python_cowbull_server,dsandersAzure/python_cowbull_server | from python_cowbull_game.GameController import GameController
from python_cowbull_game.GameMode import GameMode
class ExtGameController(GameController):
"""
TBC
"""
#
# Example of defining additional game modes:
# ==========================================
#
# Replace:
# ---------... | from python_cowbull_game.GameController import GameController
from python_cowbull_game.GameMode import GameMode
class ExtGameController(GameController):
"""
TBC
"""
#
# Example of defining additional game modes:
# ==========================================
#
# Replace:
# ---------... | <commit_before>from python_cowbull_game.GameController import GameController
from python_cowbull_game.GameMode import GameMode
class ExtGameController(GameController):
"""
TBC
"""
#
# Example of defining additional game modes:
# ==========================================
#
# Replace:
... | from python_cowbull_game.GameController import GameController
from python_cowbull_game.GameMode import GameMode
class ExtGameController(GameController):
"""
TBC
"""
#
# Example of defining additional game modes:
# ==========================================
#
# Replace:
# ---------... | from python_cowbull_game.GameController import GameController
from python_cowbull_game.GameMode import GameMode
class ExtGameController(GameController):
"""
TBC
"""
#
# Example of defining additional game modes:
# ==========================================
#
# Replace:
# ---------... | <commit_before>from python_cowbull_game.GameController import GameController
from python_cowbull_game.GameMode import GameMode
class ExtGameController(GameController):
"""
TBC
"""
#
# Example of defining additional game modes:
# ==========================================
#
# Replace:
... |
19fcd893b88fd2ac9891904af93baf76b49fd5c0 | plasmapy/_metadata.py | plasmapy/_metadata.py | ##
# Package metadata
##
import ah_bootstrap
from astropy_helpers.git_helpers import get_git_devstr
# Name
name = 'plasmapy'
# PlasmaPy uses Semantic Versioning of the form: MAJOR.MINOR.PATCH
#
# - The MAJOR version changes when there are backwards incompatible changes
# - The MINOR version changes when backwards... | ##
# Package metadata
##
import ah_bootstrap
from astropy_helpers.git_helpers import get_git_devstr
# Name
name = 'plasmapy'
# PlasmaPy uses Semantic Versioning of the form: MAJOR.MINOR.PATCH
#
# - The MAJOR version changes when there are backwards incompatible changes
# - The MINOR version changes when backwards... | Change version from 0.1.dev* to 0.1.0.dev* | Change version from 0.1.dev* to 0.1.0.dev*
The semantic versioning specification requires that the major, minor,
and patch numbers always be present.
| Python | bsd-3-clause | StanczakDominik/PlasmaPy | ##
# Package metadata
##
import ah_bootstrap
from astropy_helpers.git_helpers import get_git_devstr
# Name
name = 'plasmapy'
# PlasmaPy uses Semantic Versioning of the form: MAJOR.MINOR.PATCH
#
# - The MAJOR version changes when there are backwards incompatible changes
# - The MINOR version changes when backwards... | ##
# Package metadata
##
import ah_bootstrap
from astropy_helpers.git_helpers import get_git_devstr
# Name
name = 'plasmapy'
# PlasmaPy uses Semantic Versioning of the form: MAJOR.MINOR.PATCH
#
# - The MAJOR version changes when there are backwards incompatible changes
# - The MINOR version changes when backwards... | <commit_before>##
# Package metadata
##
import ah_bootstrap
from astropy_helpers.git_helpers import get_git_devstr
# Name
name = 'plasmapy'
# PlasmaPy uses Semantic Versioning of the form: MAJOR.MINOR.PATCH
#
# - The MAJOR version changes when there are backwards incompatible changes
# - The MINOR version changes... | ##
# Package metadata
##
import ah_bootstrap
from astropy_helpers.git_helpers import get_git_devstr
# Name
name = 'plasmapy'
# PlasmaPy uses Semantic Versioning of the form: MAJOR.MINOR.PATCH
#
# - The MAJOR version changes when there are backwards incompatible changes
# - The MINOR version changes when backwards... | ##
# Package metadata
##
import ah_bootstrap
from astropy_helpers.git_helpers import get_git_devstr
# Name
name = 'plasmapy'
# PlasmaPy uses Semantic Versioning of the form: MAJOR.MINOR.PATCH
#
# - The MAJOR version changes when there are backwards incompatible changes
# - The MINOR version changes when backwards... | <commit_before>##
# Package metadata
##
import ah_bootstrap
from astropy_helpers.git_helpers import get_git_devstr
# Name
name = 'plasmapy'
# PlasmaPy uses Semantic Versioning of the form: MAJOR.MINOR.PATCH
#
# - The MAJOR version changes when there are backwards incompatible changes
# - The MINOR version changes... |
2eac437b9d907fb60d53522633dd278aa277ea08 | test/user_tests/test_models.py | test/user_tests/test_models.py | # coding: utf-8
import unittest
from test.factories import UserFactory
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from users.models import create_user_profile, Users
class UserTest(unittest.TestCase):
'''User-specific tests'''
def setUp(self):
self.us... | # coding: utf-8
import unittest
from test.factories import UserFactory
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from users.models import create_new_user, Users
class UserTest(unittest.TestCase):
'''User-specific tests'''
def setUp(self):
self.user =... | Test for create user in model. Remove test profile creation | Test for create user in model. Remove test profile creation
| Python | mit | sarutobi/ritmserdtsa,sarutobi/Rynda,sarutobi/Rynda,sarutobi/flowofkindness,sarutobi/ritmserdtsa,sarutobi/ritmserdtsa,sarutobi/flowofkindness,sarutobi/Rynda,sarutobi/Rynda,sarutobi/flowofkindness,sarutobi/flowofkindness,sarutobi/ritmserdtsa | # coding: utf-8
import unittest
from test.factories import UserFactory
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from users.models import create_user_profile, Users
class UserTest(unittest.TestCase):
'''User-specific tests'''
def setUp(self):
self.us... | # coding: utf-8
import unittest
from test.factories import UserFactory
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from users.models import create_new_user, Users
class UserTest(unittest.TestCase):
'''User-specific tests'''
def setUp(self):
self.user =... | <commit_before># coding: utf-8
import unittest
from test.factories import UserFactory
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from users.models import create_user_profile, Users
class UserTest(unittest.TestCase):
'''User-specific tests'''
def setUp(self):
... | # coding: utf-8
import unittest
from test.factories import UserFactory
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from users.models import create_new_user, Users
class UserTest(unittest.TestCase):
'''User-specific tests'''
def setUp(self):
self.user =... | # coding: utf-8
import unittest
from test.factories import UserFactory
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from users.models import create_user_profile, Users
class UserTest(unittest.TestCase):
'''User-specific tests'''
def setUp(self):
self.us... | <commit_before># coding: utf-8
import unittest
from test.factories import UserFactory
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from users.models import create_user_profile, Users
class UserTest(unittest.TestCase):
'''User-specific tests'''
def setUp(self):
... |
fc01acc869969e5c0666de1065f149b3caec851d | core/wait_ssh_ready.py | core/wait_ssh_ready.py | from __future__ import print_function
import time
import sys
import socket
import logging
def wait_ssh_ready(host, tries=40, delay=3, port=22):
# Wait until the SSH is actually up
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
logging.info('Waiting for SSH at %s to be ready to connect' % host, end... | from __future__ import print_function
import time
import sys
import socket
import logging
def wait_ssh_ready(host, tries=40, delay=3, port=22):
# Wait until the SSH is actually up
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print('Waiting for SSH at %s to be ready to connect' % host, end='')
... | Fix incorrect call to logging module | Fix incorrect call to logging module
| Python | agpl-3.0 | andresriancho/nimbostratus-target | from __future__ import print_function
import time
import sys
import socket
import logging
def wait_ssh_ready(host, tries=40, delay=3, port=22):
# Wait until the SSH is actually up
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
logging.info('Waiting for SSH at %s to be ready to connect' % host, end... | from __future__ import print_function
import time
import sys
import socket
import logging
def wait_ssh_ready(host, tries=40, delay=3, port=22):
# Wait until the SSH is actually up
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print('Waiting for SSH at %s to be ready to connect' % host, end='')
... | <commit_before>from __future__ import print_function
import time
import sys
import socket
import logging
def wait_ssh_ready(host, tries=40, delay=3, port=22):
# Wait until the SSH is actually up
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
logging.info('Waiting for SSH at %s to be ready to conne... | from __future__ import print_function
import time
import sys
import socket
import logging
def wait_ssh_ready(host, tries=40, delay=3, port=22):
# Wait until the SSH is actually up
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print('Waiting for SSH at %s to be ready to connect' % host, end='')
... | from __future__ import print_function
import time
import sys
import socket
import logging
def wait_ssh_ready(host, tries=40, delay=3, port=22):
# Wait until the SSH is actually up
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
logging.info('Waiting for SSH at %s to be ready to connect' % host, end... | <commit_before>from __future__ import print_function
import time
import sys
import socket
import logging
def wait_ssh_ready(host, tries=40, delay=3, port=22):
# Wait until the SSH is actually up
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
logging.info('Waiting for SSH at %s to be ready to conne... |
afbcda104f9903bda2d82e34a6fdc63b6e2b52a9 | mbio/Application/__init__.py | mbio/Application/__init__.py | __author__ = 'Wenzhi Mao'
__all__ = []
def _Startup():
'''Get _path__ and compile files.'''
from os import path
from mbio import _ABSpath
global _path__
_path__ = _ABSpath()
_Startup()
from . import sort
from .sort import *
__all__.extend(sort.__all__)
from . import cluster
# from .cluster i... | __author__ = 'Wenzhi Mao'
__all__ = []
def _Startup():
'''Get _path__ and compile files.'''
from os import path
from mbio import _ABSpath
global _path__
_path__ = _ABSpath()
_Startup()
from . import sort
from .sort import *
__all__.extend(sort.__all__)
# from . import cluster
# from .cluster... | Remove the cluster and job_organization. | Remove the cluster and job_organization.
| Python | mit | wzmao/mbio,wzmao/mbio,wzmao/mbio | __author__ = 'Wenzhi Mao'
__all__ = []
def _Startup():
'''Get _path__ and compile files.'''
from os import path
from mbio import _ABSpath
global _path__
_path__ = _ABSpath()
_Startup()
from . import sort
from .sort import *
__all__.extend(sort.__all__)
from . import cluster
# from .cluster i... | __author__ = 'Wenzhi Mao'
__all__ = []
def _Startup():
'''Get _path__ and compile files.'''
from os import path
from mbio import _ABSpath
global _path__
_path__ = _ABSpath()
_Startup()
from . import sort
from .sort import *
__all__.extend(sort.__all__)
# from . import cluster
# from .cluster... | <commit_before>__author__ = 'Wenzhi Mao'
__all__ = []
def _Startup():
'''Get _path__ and compile files.'''
from os import path
from mbio import _ABSpath
global _path__
_path__ = _ABSpath()
_Startup()
from . import sort
from .sort import *
__all__.extend(sort.__all__)
from . import cluster
# ... | __author__ = 'Wenzhi Mao'
__all__ = []
def _Startup():
'''Get _path__ and compile files.'''
from os import path
from mbio import _ABSpath
global _path__
_path__ = _ABSpath()
_Startup()
from . import sort
from .sort import *
__all__.extend(sort.__all__)
# from . import cluster
# from .cluster... | __author__ = 'Wenzhi Mao'
__all__ = []
def _Startup():
'''Get _path__ and compile files.'''
from os import path
from mbio import _ABSpath
global _path__
_path__ = _ABSpath()
_Startup()
from . import sort
from .sort import *
__all__.extend(sort.__all__)
from . import cluster
# from .cluster i... | <commit_before>__author__ = 'Wenzhi Mao'
__all__ = []
def _Startup():
'''Get _path__ and compile files.'''
from os import path
from mbio import _ABSpath
global _path__
_path__ = _ABSpath()
_Startup()
from . import sort
from .sort import *
__all__.extend(sort.__all__)
from . import cluster
# ... |
020e8db7ed28c3c6e6968d2d107b23e1fa8eb284 | pcapfile/test/__main__.py | pcapfile/test/__main__.py | #!/usr/bin/env python
"""
This is the front end to the pcapfile test SUITE.
"""
import unittest
from pcapfile.test.linklayer_test import TestCase as LinklayerTest
from pcapfile.test.savefile_test import TestCase as SavefileTest
from pcapfile.test.protocols_linklayer_ethernet import TestCase as EthernetTest
from pcap... | #!/usr/bin/env python
"""
This is the front end to the pcapfile test SUITE.
"""
import unittest
import sys
from pcapfile.test.linklayer_test import TestCase as LinklayerTest
from pcapfile.test.savefile_test import TestCase as SavefileTest
from pcapfile.test.protocols_linklayer_ethernet import TestCase as EthernetTes... | Return -1 when tests fail | Return -1 when tests fail
| Python | isc | kisom/pypcapfile | #!/usr/bin/env python
"""
This is the front end to the pcapfile test SUITE.
"""
import unittest
from pcapfile.test.linklayer_test import TestCase as LinklayerTest
from pcapfile.test.savefile_test import TestCase as SavefileTest
from pcapfile.test.protocols_linklayer_ethernet import TestCase as EthernetTest
from pcap... | #!/usr/bin/env python
"""
This is the front end to the pcapfile test SUITE.
"""
import unittest
import sys
from pcapfile.test.linklayer_test import TestCase as LinklayerTest
from pcapfile.test.savefile_test import TestCase as SavefileTest
from pcapfile.test.protocols_linklayer_ethernet import TestCase as EthernetTes... | <commit_before>#!/usr/bin/env python
"""
This is the front end to the pcapfile test SUITE.
"""
import unittest
from pcapfile.test.linklayer_test import TestCase as LinklayerTest
from pcapfile.test.savefile_test import TestCase as SavefileTest
from pcapfile.test.protocols_linklayer_ethernet import TestCase as Etherne... | #!/usr/bin/env python
"""
This is the front end to the pcapfile test SUITE.
"""
import unittest
import sys
from pcapfile.test.linklayer_test import TestCase as LinklayerTest
from pcapfile.test.savefile_test import TestCase as SavefileTest
from pcapfile.test.protocols_linklayer_ethernet import TestCase as EthernetTes... | #!/usr/bin/env python
"""
This is the front end to the pcapfile test SUITE.
"""
import unittest
from pcapfile.test.linklayer_test import TestCase as LinklayerTest
from pcapfile.test.savefile_test import TestCase as SavefileTest
from pcapfile.test.protocols_linklayer_ethernet import TestCase as EthernetTest
from pcap... | <commit_before>#!/usr/bin/env python
"""
This is the front end to the pcapfile test SUITE.
"""
import unittest
from pcapfile.test.linklayer_test import TestCase as LinklayerTest
from pcapfile.test.savefile_test import TestCase as SavefileTest
from pcapfile.test.protocols_linklayer_ethernet import TestCase as Etherne... |
d474edcdbe1d9966ad09609b87d119c60c2a38d4 | datapusher/main.py | datapusher/main.py | import os
import six
import ckanserviceprovider.web as web
from . import jobs
# check whether jobs have been imported properly
assert(jobs.push_to_datastore)
def serve():
web.init()
web.app.run(web.app.config.get('HOST'), web.app.config.get('PORT'))
def serve_test():
web.init()
return web.app.test... | import os
import six
import ckanserviceprovider.web as web
from datapusher import jobs
# check whether jobs have been imported properly
assert(jobs.push_to_datastore)
def serve():
web.init()
web.app.run(web.app.config.get('HOST'), web.app.config.get('PORT'))
def serve_test():
web.init()
return web... | Fix Import Error for relative Import | [x]: Fix Import Error for relative Import
| Python | agpl-3.0 | ckan/datapusher | import os
import six
import ckanserviceprovider.web as web
from . import jobs
# check whether jobs have been imported properly
assert(jobs.push_to_datastore)
def serve():
web.init()
web.app.run(web.app.config.get('HOST'), web.app.config.get('PORT'))
def serve_test():
web.init()
return web.app.test... | import os
import six
import ckanserviceprovider.web as web
from datapusher import jobs
# check whether jobs have been imported properly
assert(jobs.push_to_datastore)
def serve():
web.init()
web.app.run(web.app.config.get('HOST'), web.app.config.get('PORT'))
def serve_test():
web.init()
return web... | <commit_before>import os
import six
import ckanserviceprovider.web as web
from . import jobs
# check whether jobs have been imported properly
assert(jobs.push_to_datastore)
def serve():
web.init()
web.app.run(web.app.config.get('HOST'), web.app.config.get('PORT'))
def serve_test():
web.init()
retu... | import os
import six
import ckanserviceprovider.web as web
from datapusher import jobs
# check whether jobs have been imported properly
assert(jobs.push_to_datastore)
def serve():
web.init()
web.app.run(web.app.config.get('HOST'), web.app.config.get('PORT'))
def serve_test():
web.init()
return web... | import os
import six
import ckanserviceprovider.web as web
from . import jobs
# check whether jobs have been imported properly
assert(jobs.push_to_datastore)
def serve():
web.init()
web.app.run(web.app.config.get('HOST'), web.app.config.get('PORT'))
def serve_test():
web.init()
return web.app.test... | <commit_before>import os
import six
import ckanserviceprovider.web as web
from . import jobs
# check whether jobs have been imported properly
assert(jobs.push_to_datastore)
def serve():
web.init()
web.app.run(web.app.config.get('HOST'), web.app.config.get('PORT'))
def serve_test():
web.init()
retu... |
946a2bcd57ac33cca0f48d29350a8f75b2fee2cf | sparqllib/tests/test_formatter.py | sparqllib/tests/test_formatter.py |
import unittest
import sparqllib
class TestBasicFormatter(unittest.TestCase):
def setUp(self):
self.formatter = sparqllib.formatter.BasicFormatter()
def test_newlines(self):
self.assertEqual(self.formatter.format("{}"), "{\n}")
def test_indentation(self):
self.assertEqual(self.fo... |
import unittest
import sparqllib
class TestBasicFormatter(unittest.TestCase):
def setUp(self):
self.formatter = sparqllib.formatter.BasicFormatter()
def test_newlines(self):
self.assertEqual(self.formatter.format("{}"), "{\n}")
self.assertEqual(self.formatter.format("{\n}"), "{\n}")
... | Add test to verify single newline is not stripped | Add test to verify single newline is not stripped
| Python | mit | ALSchwalm/sparqllib |
import unittest
import sparqllib
class TestBasicFormatter(unittest.TestCase):
def setUp(self):
self.formatter = sparqllib.formatter.BasicFormatter()
def test_newlines(self):
self.assertEqual(self.formatter.format("{}"), "{\n}")
def test_indentation(self):
self.assertEqual(self.fo... |
import unittest
import sparqllib
class TestBasicFormatter(unittest.TestCase):
def setUp(self):
self.formatter = sparqllib.formatter.BasicFormatter()
def test_newlines(self):
self.assertEqual(self.formatter.format("{}"), "{\n}")
self.assertEqual(self.formatter.format("{\n}"), "{\n}")
... | <commit_before>
import unittest
import sparqllib
class TestBasicFormatter(unittest.TestCase):
def setUp(self):
self.formatter = sparqllib.formatter.BasicFormatter()
def test_newlines(self):
self.assertEqual(self.formatter.format("{}"), "{\n}")
def test_indentation(self):
self.asse... |
import unittest
import sparqllib
class TestBasicFormatter(unittest.TestCase):
def setUp(self):
self.formatter = sparqllib.formatter.BasicFormatter()
def test_newlines(self):
self.assertEqual(self.formatter.format("{}"), "{\n}")
self.assertEqual(self.formatter.format("{\n}"), "{\n}")
... |
import unittest
import sparqllib
class TestBasicFormatter(unittest.TestCase):
def setUp(self):
self.formatter = sparqllib.formatter.BasicFormatter()
def test_newlines(self):
self.assertEqual(self.formatter.format("{}"), "{\n}")
def test_indentation(self):
self.assertEqual(self.fo... | <commit_before>
import unittest
import sparqllib
class TestBasicFormatter(unittest.TestCase):
def setUp(self):
self.formatter = sparqllib.formatter.BasicFormatter()
def test_newlines(self):
self.assertEqual(self.formatter.format("{}"), "{\n}")
def test_indentation(self):
self.asse... |
a7083c3c70142f744ace0055c537d9217ed9cbfe | paypal/base.py | paypal/base.py | import urlparse
from django.db import models
class ResponseModel(models.Model):
# Debug information
raw_request = models.TextField(max_length=512)
raw_response = models.TextField(max_length=512)
response_time = models.FloatField(help_text="Response time in milliseconds")
date_created = models.... | import urlparse
from django.db import models
class ResponseModel(models.Model):
# Debug information
raw_request = models.TextField(max_length=512)
raw_response = models.TextField(max_length=512)
response_time = models.FloatField(help_text="Response time in milliseconds")
date_created = models.... | Fix a bad issue when PAYPAL returning utf8 encoded chars | Fix a bad issue when PAYPAL returning utf8 encoded chars
| Python | bsd-3-clause | bharling/django-oscar-worldpay,embedded1/django-oscar-paypal,FedeDR/django-oscar-paypal,django-oscar/django-oscar-paypal,evonove/django-oscar-paypal,st8st8/django-oscar-paypal,nfletton/django-oscar-paypal,britco/django-oscar-paypal,britco/django-oscar-paypal,st8st8/django-oscar-paypal,ZachGoldberg/django-oscar-paypal,e... | import urlparse
from django.db import models
class ResponseModel(models.Model):
# Debug information
raw_request = models.TextField(max_length=512)
raw_response = models.TextField(max_length=512)
response_time = models.FloatField(help_text="Response time in milliseconds")
date_created = models.... | import urlparse
from django.db import models
class ResponseModel(models.Model):
# Debug information
raw_request = models.TextField(max_length=512)
raw_response = models.TextField(max_length=512)
response_time = models.FloatField(help_text="Response time in milliseconds")
date_created = models.... | <commit_before>import urlparse
from django.db import models
class ResponseModel(models.Model):
# Debug information
raw_request = models.TextField(max_length=512)
raw_response = models.TextField(max_length=512)
response_time = models.FloatField(help_text="Response time in milliseconds")
date_cr... | import urlparse
from django.db import models
class ResponseModel(models.Model):
# Debug information
raw_request = models.TextField(max_length=512)
raw_response = models.TextField(max_length=512)
response_time = models.FloatField(help_text="Response time in milliseconds")
date_created = models.... | import urlparse
from django.db import models
class ResponseModel(models.Model):
# Debug information
raw_request = models.TextField(max_length=512)
raw_response = models.TextField(max_length=512)
response_time = models.FloatField(help_text="Response time in milliseconds")
date_created = models.... | <commit_before>import urlparse
from django.db import models
class ResponseModel(models.Model):
# Debug information
raw_request = models.TextField(max_length=512)
raw_response = models.TextField(max_length=512)
response_time = models.FloatField(help_text="Response time in milliseconds")
date_cr... |
233d52247d89bb39ccc9ada3a591296baae9cff5 | notification/backends/web.py | notification/backends/web.py | from notification.backends.base import NotificationBackend
class WebBackend(NotificationBackend):
slug = u'web'
display_name = u'E-mail'
formats = ['short.txt', 'full.txt']
def send(self, sender, recipient, notice_type, context, on_site=False,
*args, **kwargs):
"""Always "sends" (i... | from notification.backends.base import NotificationBackend
class WebBackend(NotificationBackend):
slug = u'web'
display_name = u'Web'
formats = ['short.txt', 'full.txt']
def send(self, sender, recipient, notice_type, context, on_site=False,
*args, **kwargs):
"""Always "sends" (i.e.... | Use correct slug for Web backend. | Use correct slug for Web backend.
| Python | mit | theatlantic/django-notification,theatlantic/django-notification | from notification.backends.base import NotificationBackend
class WebBackend(NotificationBackend):
slug = u'web'
display_name = u'E-mail'
formats = ['short.txt', 'full.txt']
def send(self, sender, recipient, notice_type, context, on_site=False,
*args, **kwargs):
"""Always "sends" (i... | from notification.backends.base import NotificationBackend
class WebBackend(NotificationBackend):
slug = u'web'
display_name = u'Web'
formats = ['short.txt', 'full.txt']
def send(self, sender, recipient, notice_type, context, on_site=False,
*args, **kwargs):
"""Always "sends" (i.e.... | <commit_before>from notification.backends.base import NotificationBackend
class WebBackend(NotificationBackend):
slug = u'web'
display_name = u'E-mail'
formats = ['short.txt', 'full.txt']
def send(self, sender, recipient, notice_type, context, on_site=False,
*args, **kwargs):
"""Al... | from notification.backends.base import NotificationBackend
class WebBackend(NotificationBackend):
slug = u'web'
display_name = u'Web'
formats = ['short.txt', 'full.txt']
def send(self, sender, recipient, notice_type, context, on_site=False,
*args, **kwargs):
"""Always "sends" (i.e.... | from notification.backends.base import NotificationBackend
class WebBackend(NotificationBackend):
slug = u'web'
display_name = u'E-mail'
formats = ['short.txt', 'full.txt']
def send(self, sender, recipient, notice_type, context, on_site=False,
*args, **kwargs):
"""Always "sends" (i... | <commit_before>from notification.backends.base import NotificationBackend
class WebBackend(NotificationBackend):
slug = u'web'
display_name = u'E-mail'
formats = ['short.txt', 'full.txt']
def send(self, sender, recipient, notice_type, context, on_site=False,
*args, **kwargs):
"""Al... |
39406267d31ca428dc73d721ccc19285ff7599bd | lit/Quit/expect_exit_code.py | lit/Quit/expect_exit_code.py | #!/usr/bin/env python2
import subprocess
import sys
args = sys.argv
expected_exit_code = args[1]
args = args[2:]
print("Running " + (" ".join(args)))
real_exit_code = subprocess.call(args)
if str(real_exit_code) != expected_exit_code:
print("Got exit code %d but expected %s" % (real_exit_code, expected_exit_code... | #!/usr/bin/env python
import subprocess
import sys
args = sys.argv
expected_exit_code = args[1]
args = args[2:]
print("Running " + (" ".join(args)))
real_exit_code = subprocess.call(args)
if str(real_exit_code) != expected_exit_code:
print("Got exit code %d but expected %s" % (real_exit_code, expected_exit_code)... | Update shebang python2 -> python | [lldb] Update shebang python2 -> python
git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@352259 91177308-0d34-0410-b5e6-96231b3b80d8
| Python | apache-2.0 | apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb | #!/usr/bin/env python2
import subprocess
import sys
args = sys.argv
expected_exit_code = args[1]
args = args[2:]
print("Running " + (" ".join(args)))
real_exit_code = subprocess.call(args)
if str(real_exit_code) != expected_exit_code:
print("Got exit code %d but expected %s" % (real_exit_code, expected_exit_code... | #!/usr/bin/env python
import subprocess
import sys
args = sys.argv
expected_exit_code = args[1]
args = args[2:]
print("Running " + (" ".join(args)))
real_exit_code = subprocess.call(args)
if str(real_exit_code) != expected_exit_code:
print("Got exit code %d but expected %s" % (real_exit_code, expected_exit_code)... | <commit_before>#!/usr/bin/env python2
import subprocess
import sys
args = sys.argv
expected_exit_code = args[1]
args = args[2:]
print("Running " + (" ".join(args)))
real_exit_code = subprocess.call(args)
if str(real_exit_code) != expected_exit_code:
print("Got exit code %d but expected %s" % (real_exit_code, exp... | #!/usr/bin/env python
import subprocess
import sys
args = sys.argv
expected_exit_code = args[1]
args = args[2:]
print("Running " + (" ".join(args)))
real_exit_code = subprocess.call(args)
if str(real_exit_code) != expected_exit_code:
print("Got exit code %d but expected %s" % (real_exit_code, expected_exit_code)... | #!/usr/bin/env python2
import subprocess
import sys
args = sys.argv
expected_exit_code = args[1]
args = args[2:]
print("Running " + (" ".join(args)))
real_exit_code = subprocess.call(args)
if str(real_exit_code) != expected_exit_code:
print("Got exit code %d but expected %s" % (real_exit_code, expected_exit_code... | <commit_before>#!/usr/bin/env python2
import subprocess
import sys
args = sys.argv
expected_exit_code = args[1]
args = args[2:]
print("Running " + (" ".join(args)))
real_exit_code = subprocess.call(args)
if str(real_exit_code) != expected_exit_code:
print("Got exit code %d but expected %s" % (real_exit_code, exp... |
7aa84fbcc7a3af57ef62c29008fac4036d2d28af | django_afip/migrations/0021_drop_batches.py | django_afip/migrations/0021_drop_batches.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-02 23:19
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('afip', '0020_backfill_receiptvalidation__processed_date'),
]
operations = [
... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-02 23:19
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('afip', '0020_backfill_receiptvalidation__processed_date'),
]
operations = [
... | Tweak a migration to run on non-transactional DBs | Tweak a migration to run on non-transactional DBs
A single migration failed to run on databases with no support for
transactions because those require explicit ordering of commands that's
generally implicit on modern relational DBs.
Switch the order of those queries to prevent that crash.
Fixes #27
| Python | isc | hobarrera/django-afip,hobarrera/django-afip | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-02 23:19
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('afip', '0020_backfill_receiptvalidation__processed_date'),
]
operations = [
... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-02 23:19
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('afip', '0020_backfill_receiptvalidation__processed_date'),
]
operations = [
... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-02 23:19
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('afip', '0020_backfill_receiptvalidation__processed_date'),
]
operati... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-02 23:19
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('afip', '0020_backfill_receiptvalidation__processed_date'),
]
operations = [
... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-02 23:19
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('afip', '0020_backfill_receiptvalidation__processed_date'),
]
operations = [
... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-02 23:19
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('afip', '0020_backfill_receiptvalidation__processed_date'),
]
operati... |
1ff616fe4f6ff0ff295eeeaa4a817851df750e51 | openslides/utils/validate.py | openslides/utils/validate.py | import bleach
allowed_tags = [
"a",
"img", # links and images
"br",
"p",
"span",
"blockquote", # text layout
"strike",
"strong",
"u",
"em",
"sup",
"sub",
"pre", # text formatting
"h1",
"h2",
"h3",
"h4",
"h5",
"h6", # headings
"ol",
... | import bleach
allowed_tags = [
"a",
"img", # links and images
"br",
"p",
"span",
"blockquote", # text layout
"strike",
"del",
"ins",
"strong",
"u",
"em",
"sup",
"sub",
"pre", # text formatting
"h1",
"h2",
"h3",
"h4",
"h5",
"h6", #... | Allow <del> and <ins> html tags. | Allow <del> and <ins> html tags.
| Python | mit | tsiegleauq/OpenSlides,ostcar/OpenSlides,FinnStutzenstein/OpenSlides,normanjaeckel/OpenSlides,jwinzer/OpenSlides,OpenSlides/OpenSlides,tsiegleauq/OpenSlides,jwinzer/OpenSlides,FinnStutzenstein/OpenSlides,CatoTH/OpenSlides,CatoTH/OpenSlides,OpenSlides/OpenSlides,tsiegleauq/OpenSlides,CatoTH/OpenSlides,normanjaeckel/OpenS... | import bleach
allowed_tags = [
"a",
"img", # links and images
"br",
"p",
"span",
"blockquote", # text layout
"strike",
"strong",
"u",
"em",
"sup",
"sub",
"pre", # text formatting
"h1",
"h2",
"h3",
"h4",
"h5",
"h6", # headings
"ol",
... | import bleach
allowed_tags = [
"a",
"img", # links and images
"br",
"p",
"span",
"blockquote", # text layout
"strike",
"del",
"ins",
"strong",
"u",
"em",
"sup",
"sub",
"pre", # text formatting
"h1",
"h2",
"h3",
"h4",
"h5",
"h6", #... | <commit_before>import bleach
allowed_tags = [
"a",
"img", # links and images
"br",
"p",
"span",
"blockquote", # text layout
"strike",
"strong",
"u",
"em",
"sup",
"sub",
"pre", # text formatting
"h1",
"h2",
"h3",
"h4",
"h5",
"h6", # headin... | import bleach
allowed_tags = [
"a",
"img", # links and images
"br",
"p",
"span",
"blockquote", # text layout
"strike",
"del",
"ins",
"strong",
"u",
"em",
"sup",
"sub",
"pre", # text formatting
"h1",
"h2",
"h3",
"h4",
"h5",
"h6", #... | import bleach
allowed_tags = [
"a",
"img", # links and images
"br",
"p",
"span",
"blockquote", # text layout
"strike",
"strong",
"u",
"em",
"sup",
"sub",
"pre", # text formatting
"h1",
"h2",
"h3",
"h4",
"h5",
"h6", # headings
"ol",
... | <commit_before>import bleach
allowed_tags = [
"a",
"img", # links and images
"br",
"p",
"span",
"blockquote", # text layout
"strike",
"strong",
"u",
"em",
"sup",
"sub",
"pre", # text formatting
"h1",
"h2",
"h3",
"h4",
"h5",
"h6", # headin... |
e0ebd4cb41d3ed9168e819f7017dd98c2fbb599a | insertion_sort.py | insertion_sort.py | def insertion_sort(un_list):
for idx in range(1, len(un_list)):
current = un_list[idx]
position = idx
while position > 0 and un_list[position-1] > current:
un_list[position] = un_list[position-1]
position = position - 1
un_list[position] = current
if __name... | def insertion_sort(un_list):
if type(un_list) is not list:
return "You must pass a valid list as argument. Do it."
for idx in range(1, len(un_list)):
current = un_list[idx]
position = idx
while position > 0 and un_list[position-1] > current:
un_list[position] = un_l... | Update insertion sort with list validation | Update insertion sort with list validation
| Python | mit | jonathanstallings/data-structures | def insertion_sort(un_list):
for idx in range(1, len(un_list)):
current = un_list[idx]
position = idx
while position > 0 and un_list[position-1] > current:
un_list[position] = un_list[position-1]
position = position - 1
un_list[position] = current
if __name... | def insertion_sort(un_list):
if type(un_list) is not list:
return "You must pass a valid list as argument. Do it."
for idx in range(1, len(un_list)):
current = un_list[idx]
position = idx
while position > 0 and un_list[position-1] > current:
un_list[position] = un_l... | <commit_before>def insertion_sort(un_list):
for idx in range(1, len(un_list)):
current = un_list[idx]
position = idx
while position > 0 and un_list[position-1] > current:
un_list[position] = un_list[position-1]
position = position - 1
un_list[position] = cur... | def insertion_sort(un_list):
if type(un_list) is not list:
return "You must pass a valid list as argument. Do it."
for idx in range(1, len(un_list)):
current = un_list[idx]
position = idx
while position > 0 and un_list[position-1] > current:
un_list[position] = un_l... | def insertion_sort(un_list):
for idx in range(1, len(un_list)):
current = un_list[idx]
position = idx
while position > 0 and un_list[position-1] > current:
un_list[position] = un_list[position-1]
position = position - 1
un_list[position] = current
if __name... | <commit_before>def insertion_sort(un_list):
for idx in range(1, len(un_list)):
current = un_list[idx]
position = idx
while position > 0 and un_list[position-1] > current:
un_list[position] = un_list[position-1]
position = position - 1
un_list[position] = cur... |
a5697ddd595b929ef7261d62fd333c2cd2f56dd0 | plots/views.py | plots/views.py | # Create your views here.
import json
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.utils import simplejson
from django.http import HttpResponse, Http404
from .models import BenchmarkLogs, MachineInfo
import data
def rawdata(request, plotname):
"""
Base... | # Create your views here.
import json
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.utils import simplejson
from django.http import HttpResponse, Http404
from .models import BenchmarkLogs, MachineInfo
import data
def rawdata(request, plotname):
"""
Base... | Raise Http404 instead of 404 | Raise Http404 instead of 404
| Python | bsd-2-clause | ankeshanand/benchmark,ankeshanand/benchmark,ankeshanand/benchmark,ankeshanand/benchmark | # Create your views here.
import json
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.utils import simplejson
from django.http import HttpResponse, Http404
from .models import BenchmarkLogs, MachineInfo
import data
def rawdata(request, plotname):
"""
Base... | # Create your views here.
import json
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.utils import simplejson
from django.http import HttpResponse, Http404
from .models import BenchmarkLogs, MachineInfo
import data
def rawdata(request, plotname):
"""
Base... | <commit_before># Create your views here.
import json
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.utils import simplejson
from django.http import HttpResponse, Http404
from .models import BenchmarkLogs, MachineInfo
import data
def rawdata(request, plotname):
... | # Create your views here.
import json
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.utils import simplejson
from django.http import HttpResponse, Http404
from .models import BenchmarkLogs, MachineInfo
import data
def rawdata(request, plotname):
"""
Base... | # Create your views here.
import json
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.utils import simplejson
from django.http import HttpResponse, Http404
from .models import BenchmarkLogs, MachineInfo
import data
def rawdata(request, plotname):
"""
Base... | <commit_before># Create your views here.
import json
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.utils import simplejson
from django.http import HttpResponse, Http404
from .models import BenchmarkLogs, MachineInfo
import data
def rawdata(request, plotname):
... |
5a2212746bfabcfd64cf27846770b35f767d57a6 | polls/views.py | polls/views.py | from django.shortcuts import render
from django.core.urlresolvers import reverse_lazy
from singleurlcrud.views import CRUDView
from .models import *
# Create your views here.
class AuthorCRUDView(CRUDView):
model = Author
list_display = ('name',)
class QuestionCRUDView(CRUDView):
model = Question
lis... | from django.shortcuts import render
from django.core.urlresolvers import reverse_lazy
from singleurlcrud.views import CRUDView
from .models import *
# Create your views here.
class AuthorCRUDView(CRUDView):
model = Author
list_display = ('name',)
class QuestionCRUDView(CRUDView):
model = Question
lis... | Implement 'Delete' action for polls sample app | Implement 'Delete' action for polls sample app
| Python | bsd-3-clause | harikvpy/crud,harikvpy/crud,harikvpy/crud | from django.shortcuts import render
from django.core.urlresolvers import reverse_lazy
from singleurlcrud.views import CRUDView
from .models import *
# Create your views here.
class AuthorCRUDView(CRUDView):
model = Author
list_display = ('name',)
class QuestionCRUDView(CRUDView):
model = Question
lis... | from django.shortcuts import render
from django.core.urlresolvers import reverse_lazy
from singleurlcrud.views import CRUDView
from .models import *
# Create your views here.
class AuthorCRUDView(CRUDView):
model = Author
list_display = ('name',)
class QuestionCRUDView(CRUDView):
model = Question
lis... | <commit_before>from django.shortcuts import render
from django.core.urlresolvers import reverse_lazy
from singleurlcrud.views import CRUDView
from .models import *
# Create your views here.
class AuthorCRUDView(CRUDView):
model = Author
list_display = ('name',)
class QuestionCRUDView(CRUDView):
model = Q... | from django.shortcuts import render
from django.core.urlresolvers import reverse_lazy
from singleurlcrud.views import CRUDView
from .models import *
# Create your views here.
class AuthorCRUDView(CRUDView):
model = Author
list_display = ('name',)
class QuestionCRUDView(CRUDView):
model = Question
lis... | from django.shortcuts import render
from django.core.urlresolvers import reverse_lazy
from singleurlcrud.views import CRUDView
from .models import *
# Create your views here.
class AuthorCRUDView(CRUDView):
model = Author
list_display = ('name',)
class QuestionCRUDView(CRUDView):
model = Question
lis... | <commit_before>from django.shortcuts import render
from django.core.urlresolvers import reverse_lazy
from singleurlcrud.views import CRUDView
from .models import *
# Create your views here.
class AuthorCRUDView(CRUDView):
model = Author
list_display = ('name',)
class QuestionCRUDView(CRUDView):
model = Q... |
14123d5e3544ab9dbee813e26536e43cbfb9f783 | pycroscopy/__version__.py | pycroscopy/__version__.py | version = '0.59.8'
time = '2018-04-18 08:12:59'
| version = '0.60.0rc1'
time = '2018-04-18 08:12:59'
| Mark as release candidate version | Mark as release candidate version
| Python | mit | pycroscopy/pycroscopy | version = '0.59.8'
time = '2018-04-18 08:12:59'
Mark as release candidate version | version = '0.60.0rc1'
time = '2018-04-18 08:12:59'
| <commit_before>version = '0.59.8'
time = '2018-04-18 08:12:59'
<commit_msg>Mark as release candidate version<commit_after> | version = '0.60.0rc1'
time = '2018-04-18 08:12:59'
| version = '0.59.8'
time = '2018-04-18 08:12:59'
Mark as release candidate versionversion = '0.60.0rc1'
time = '2018-04-18 08:12:59'
| <commit_before>version = '0.59.8'
time = '2018-04-18 08:12:59'
<commit_msg>Mark as release candidate version<commit_after>version = '0.60.0rc1'
time = '2018-04-18 08:12:59'
|
9851430922f9c14583c9eb17062629f6ea99c258 | turbustat/tests/test_vcs.py | turbustat/tests/test_vcs.py | # Licensed under an MIT open source license - see LICENSE
'''
Test functions for VCS
'''
from unittest import TestCase
import numpy as np
import numpy.testing as npt
from ..statistics import VCS, VCS_Distance
from ._testing_data import \
dataset1, dataset2, computed_data, computed_distances
class testVCS(Test... | # Licensed under an MIT open source license - see LICENSE
'''
Test functions for VCS
'''
import pytest
import numpy as np
import numpy.testing as npt
from ..statistics import VCS, VCS_Distance
from ._testing_data import \
dataset1, dataset2, computed_data, computed_distances
def test_VCS_method():
tester ... | Reformat VCS tests; need updated unit test values! | Reformat VCS tests; need updated unit test values!
| Python | mit | e-koch/TurbuStat,Astroua/TurbuStat | # Licensed under an MIT open source license - see LICENSE
'''
Test functions for VCS
'''
from unittest import TestCase
import numpy as np
import numpy.testing as npt
from ..statistics import VCS, VCS_Distance
from ._testing_data import \
dataset1, dataset2, computed_data, computed_distances
class testVCS(Test... | # Licensed under an MIT open source license - see LICENSE
'''
Test functions for VCS
'''
import pytest
import numpy as np
import numpy.testing as npt
from ..statistics import VCS, VCS_Distance
from ._testing_data import \
dataset1, dataset2, computed_data, computed_distances
def test_VCS_method():
tester ... | <commit_before># Licensed under an MIT open source license - see LICENSE
'''
Test functions for VCS
'''
from unittest import TestCase
import numpy as np
import numpy.testing as npt
from ..statistics import VCS, VCS_Distance
from ._testing_data import \
dataset1, dataset2, computed_data, computed_distances
cla... | # Licensed under an MIT open source license - see LICENSE
'''
Test functions for VCS
'''
import pytest
import numpy as np
import numpy.testing as npt
from ..statistics import VCS, VCS_Distance
from ._testing_data import \
dataset1, dataset2, computed_data, computed_distances
def test_VCS_method():
tester ... | # Licensed under an MIT open source license - see LICENSE
'''
Test functions for VCS
'''
from unittest import TestCase
import numpy as np
import numpy.testing as npt
from ..statistics import VCS, VCS_Distance
from ._testing_data import \
dataset1, dataset2, computed_data, computed_distances
class testVCS(Test... | <commit_before># Licensed under an MIT open source license - see LICENSE
'''
Test functions for VCS
'''
from unittest import TestCase
import numpy as np
import numpy.testing as npt
from ..statistics import VCS, VCS_Distance
from ._testing_data import \
dataset1, dataset2, computed_data, computed_distances
cla... |
75b221fa63b0f81b94ffbbe9f5cdc39a0adb848a | dmrg101/core/braket.py | dmrg101/core/braket.py | '''
File: braket.py
Author: Ivan Gonzalez
Description: A function to implement quantum-mechanics brakets
'''
from numpy import inner
from core.exceptions import DMRGException
def braket(bra, ket):
"""Takes a bra and a ket and return their braket
You use this function to calculate the quantum mechanical braket... | '''
File: braket.py
Author: Ivan Gonzalez
Description: A function to implement quantum-mechanics brakets
'''
from numpy import inner, conjugate
from dmrg_exceptions import DMRGException
def braket(bra, ket):
"""Takes a bra and a ket and return their braket
You use this function to calculate the quantum mechan... | Clean up comments, fixing imports. | Clean up comments, fixing imports.
| Python | mit | iglpdc/dmrg101 | '''
File: braket.py
Author: Ivan Gonzalez
Description: A function to implement quantum-mechanics brakets
'''
from numpy import inner
from core.exceptions import DMRGException
def braket(bra, ket):
"""Takes a bra and a ket and return their braket
You use this function to calculate the quantum mechanical braket... | '''
File: braket.py
Author: Ivan Gonzalez
Description: A function to implement quantum-mechanics brakets
'''
from numpy import inner, conjugate
from dmrg_exceptions import DMRGException
def braket(bra, ket):
"""Takes a bra and a ket and return their braket
You use this function to calculate the quantum mechan... | <commit_before>'''
File: braket.py
Author: Ivan Gonzalez
Description: A function to implement quantum-mechanics brakets
'''
from numpy import inner
from core.exceptions import DMRGException
def braket(bra, ket):
"""Takes a bra and a ket and return their braket
You use this function to calculate the quantum me... | '''
File: braket.py
Author: Ivan Gonzalez
Description: A function to implement quantum-mechanics brakets
'''
from numpy import inner, conjugate
from dmrg_exceptions import DMRGException
def braket(bra, ket):
"""Takes a bra and a ket and return their braket
You use this function to calculate the quantum mechan... | '''
File: braket.py
Author: Ivan Gonzalez
Description: A function to implement quantum-mechanics brakets
'''
from numpy import inner
from core.exceptions import DMRGException
def braket(bra, ket):
"""Takes a bra and a ket and return their braket
You use this function to calculate the quantum mechanical braket... | <commit_before>'''
File: braket.py
Author: Ivan Gonzalez
Description: A function to implement quantum-mechanics brakets
'''
from numpy import inner
from core.exceptions import DMRGException
def braket(bra, ket):
"""Takes a bra and a ket and return their braket
You use this function to calculate the quantum me... |
b1bb9e86b51bf0d1c57fa10ac9b8297f0bc078db | flow_workflow/petri_net/future_nets/base.py | flow_workflow/petri_net/future_nets/base.py | from flow.petri_net import future
from flow.petri_net import success_failure_net
# XXX Maybe this turns into a historian mixin?
class GenomeNetBase(success_failure_net.SuccessFailureNet):
def __init__(self, name, operation_id, parent_operation_id=None):
success_failure_net.SuccessFailureNet.__init__(self,... | from flow.petri_net import future
from flow.petri_net.success_failure_net import SuccessFailureNet
# XXX Maybe this turns into a historian mixin?
class GenomeNetBase(SuccessFailureNet):
"""
Basically a success-failure net with operation_id and parent_operation_id and
the ability to construct historian_act... | Add comments and clean-up import of GenomeNetBase | Add comments and clean-up import of GenomeNetBase
| Python | agpl-3.0 | genome/flow-workflow,genome/flow-workflow,genome/flow-workflow | from flow.petri_net import future
from flow.petri_net import success_failure_net
# XXX Maybe this turns into a historian mixin?
class GenomeNetBase(success_failure_net.SuccessFailureNet):
def __init__(self, name, operation_id, parent_operation_id=None):
success_failure_net.SuccessFailureNet.__init__(self,... | from flow.petri_net import future
from flow.petri_net.success_failure_net import SuccessFailureNet
# XXX Maybe this turns into a historian mixin?
class GenomeNetBase(SuccessFailureNet):
"""
Basically a success-failure net with operation_id and parent_operation_id and
the ability to construct historian_act... | <commit_before>from flow.petri_net import future
from flow.petri_net import success_failure_net
# XXX Maybe this turns into a historian mixin?
class GenomeNetBase(success_failure_net.SuccessFailureNet):
def __init__(self, name, operation_id, parent_operation_id=None):
success_failure_net.SuccessFailureNet... | from flow.petri_net import future
from flow.petri_net.success_failure_net import SuccessFailureNet
# XXX Maybe this turns into a historian mixin?
class GenomeNetBase(SuccessFailureNet):
"""
Basically a success-failure net with operation_id and parent_operation_id and
the ability to construct historian_act... | from flow.petri_net import future
from flow.petri_net import success_failure_net
# XXX Maybe this turns into a historian mixin?
class GenomeNetBase(success_failure_net.SuccessFailureNet):
def __init__(self, name, operation_id, parent_operation_id=None):
success_failure_net.SuccessFailureNet.__init__(self,... | <commit_before>from flow.petri_net import future
from flow.petri_net import success_failure_net
# XXX Maybe this turns into a historian mixin?
class GenomeNetBase(success_failure_net.SuccessFailureNet):
def __init__(self, name, operation_id, parent_operation_id=None):
success_failure_net.SuccessFailureNet... |
de348d8816151f2674410566f3eaff9d43d9dcde | src/markdoc/cli/main.py | src/markdoc/cli/main.py | # -*- coding: utf-8 -*-
import os
import argparse
from markdoc.cli import commands
from markdoc.cli.parser import parser
from markdoc.config import Config, ConfigNotFound
def main(cmd_args=None):
"""The main entry point for running the Markdoc CLI."""
if cmd_args is not None:
args = parser.pars... | # -*- coding: utf-8 -*-
import logging
import os
import argparse
from markdoc.cli import commands
from markdoc.cli.parser import parser
from markdoc.config import Config, ConfigNotFound
def main(cmd_args=None):
"""The main entry point for running the Markdoc CLI."""
if cmd_args is not None:
arg... | Use logging levels to suppress non-error output with --quiet on the CLI. | Use logging levels to suppress non-error output with --quiet on the CLI.
| Python | unlicense | wlonk/markdoc,lrem/phdoc,lrem/phdoc,zacharyvoase/markdoc,snoozbuster/markdoc,wlonk/markdoc,snoozbuster/markdoc | # -*- coding: utf-8 -*-
import os
import argparse
from markdoc.cli import commands
from markdoc.cli.parser import parser
from markdoc.config import Config, ConfigNotFound
def main(cmd_args=None):
"""The main entry point for running the Markdoc CLI."""
if cmd_args is not None:
args = parser.pars... | # -*- coding: utf-8 -*-
import logging
import os
import argparse
from markdoc.cli import commands
from markdoc.cli.parser import parser
from markdoc.config import Config, ConfigNotFound
def main(cmd_args=None):
"""The main entry point for running the Markdoc CLI."""
if cmd_args is not None:
arg... | <commit_before># -*- coding: utf-8 -*-
import os
import argparse
from markdoc.cli import commands
from markdoc.cli.parser import parser
from markdoc.config import Config, ConfigNotFound
def main(cmd_args=None):
"""The main entry point for running the Markdoc CLI."""
if cmd_args is not None:
arg... | # -*- coding: utf-8 -*-
import logging
import os
import argparse
from markdoc.cli import commands
from markdoc.cli.parser import parser
from markdoc.config import Config, ConfigNotFound
def main(cmd_args=None):
"""The main entry point for running the Markdoc CLI."""
if cmd_args is not None:
arg... | # -*- coding: utf-8 -*-
import os
import argparse
from markdoc.cli import commands
from markdoc.cli.parser import parser
from markdoc.config import Config, ConfigNotFound
def main(cmd_args=None):
"""The main entry point for running the Markdoc CLI."""
if cmd_args is not None:
args = parser.pars... | <commit_before># -*- coding: utf-8 -*-
import os
import argparse
from markdoc.cli import commands
from markdoc.cli.parser import parser
from markdoc.config import Config, ConfigNotFound
def main(cmd_args=None):
"""The main entry point for running the Markdoc CLI."""
if cmd_args is not None:
arg... |
a9666ecaa7ed904cb9ded38e41ea381eb08d7d65 | citrination_client/models/design/target.py | citrination_client/models/design/target.py | from citrination_client.base.errors import CitrinationClientError
class Target(object):
"""
The optimization target for a design run. Consists of
the name of the output column to optimize and the objective
(either "Max" or "Min")
"""
def __init__(self, name, objective):
"""
Co... | from citrination_client.base.errors import CitrinationClientError
class Target(object):
"""
The optimization target for a design run. Consists of
the name of the output column to optimize and the objective
(either "Max" or "Min", or a scalar value (such as "5.0"))
"""
def __init__(self, name,... | Update outdated design Target docstring | Update outdated design Target docstring
| Python | apache-2.0 | CitrineInformatics/python-citrination-client | from citrination_client.base.errors import CitrinationClientError
class Target(object):
"""
The optimization target for a design run. Consists of
the name of the output column to optimize and the objective
(either "Max" or "Min")
"""
def __init__(self, name, objective):
"""
Co... | from citrination_client.base.errors import CitrinationClientError
class Target(object):
"""
The optimization target for a design run. Consists of
the name of the output column to optimize and the objective
(either "Max" or "Min", or a scalar value (such as "5.0"))
"""
def __init__(self, name,... | <commit_before>from citrination_client.base.errors import CitrinationClientError
class Target(object):
"""
The optimization target for a design run. Consists of
the name of the output column to optimize and the objective
(either "Max" or "Min")
"""
def __init__(self, name, objective):
... | from citrination_client.base.errors import CitrinationClientError
class Target(object):
"""
The optimization target for a design run. Consists of
the name of the output column to optimize and the objective
(either "Max" or "Min", or a scalar value (such as "5.0"))
"""
def __init__(self, name,... | from citrination_client.base.errors import CitrinationClientError
class Target(object):
"""
The optimization target for a design run. Consists of
the name of the output column to optimize and the objective
(either "Max" or "Min")
"""
def __init__(self, name, objective):
"""
Co... | <commit_before>from citrination_client.base.errors import CitrinationClientError
class Target(object):
"""
The optimization target for a design run. Consists of
the name of the output column to optimize and the objective
(either "Max" or "Min")
"""
def __init__(self, name, objective):
... |
dc57eb8fa84f10ffa9ba3f8133563b7de3945034 | whalelinter/commands/common.py | whalelinter/commands/common.py | #!/usr/bin/env python3
from whalelinter.app import App
from whalelinter.dispatcher import Dispatcher
from whalelinter.commands.command import Command
from whalelinter.commands.apt import Apt
@Dispatcher.register(token='run', command='cd')
class Cd(Command):
def __init__(self, **kwar... | #!/usr/bin/env python3
import re
from whalelinter.app import App
from whalelinter.dispatcher import Dispatcher
from whalelinter.commands.command import Command
from whalelinter.commands.apt import Apt
@Dispatcher.register(token='run', command='cd')
class Cd(Command):
def __init__(s... | Enhance flags detection with regex when trying to remove apt cache | Enhance flags detection with regex when trying to remove apt cache
| Python | mit | jeromepin/whale-linter | #!/usr/bin/env python3
from whalelinter.app import App
from whalelinter.dispatcher import Dispatcher
from whalelinter.commands.command import Command
from whalelinter.commands.apt import Apt
@Dispatcher.register(token='run', command='cd')
class Cd(Command):
def __init__(self, **kwar... | #!/usr/bin/env python3
import re
from whalelinter.app import App
from whalelinter.dispatcher import Dispatcher
from whalelinter.commands.command import Command
from whalelinter.commands.apt import Apt
@Dispatcher.register(token='run', command='cd')
class Cd(Command):
def __init__(s... | <commit_before>#!/usr/bin/env python3
from whalelinter.app import App
from whalelinter.dispatcher import Dispatcher
from whalelinter.commands.command import Command
from whalelinter.commands.apt import Apt
@Dispatcher.register(token='run', command='cd')
class Cd(Command):
def __init... | #!/usr/bin/env python3
import re
from whalelinter.app import App
from whalelinter.dispatcher import Dispatcher
from whalelinter.commands.command import Command
from whalelinter.commands.apt import Apt
@Dispatcher.register(token='run', command='cd')
class Cd(Command):
def __init__(s... | #!/usr/bin/env python3
from whalelinter.app import App
from whalelinter.dispatcher import Dispatcher
from whalelinter.commands.command import Command
from whalelinter.commands.apt import Apt
@Dispatcher.register(token='run', command='cd')
class Cd(Command):
def __init__(self, **kwar... | <commit_before>#!/usr/bin/env python3
from whalelinter.app import App
from whalelinter.dispatcher import Dispatcher
from whalelinter.commands.command import Command
from whalelinter.commands.apt import Apt
@Dispatcher.register(token='run', command='cd')
class Cd(Command):
def __init... |
bb3ba296038f45c2de6517c1f980843ce2042aa9 | etcd3/__init__.py | etcd3/__init__.py | from __future__ import absolute_import
import etcd3.etcdrpc as etcdrpc
from etcd3.client import Etcd3Client
from etcd3.client import Transactions
from etcd3.client import client
from etcd3.leases import Lease
from etcd3.locks import Lock
from etcd3.members import Member
__author__ = 'Louis Taylor'
__email__ = 'louis@... | from __future__ import absolute_import
import etcd3.etcdrpc as etcdrpc
from etcd3.client import Etcd3Client
from etcd3.client import Transactions
from etcd3.client import client
from etcd3.leases import Lease
from etcd3.locks import Lock
from etcd3.members import Member
__author__ = 'Louis Taylor'
__email__ = 'louis@... | Remove obsolete 'utils' entry from '__all__ | Remove obsolete 'utils' entry from '__all__
| Python | apache-2.0 | kragniz/python-etcd3 | from __future__ import absolute_import
import etcd3.etcdrpc as etcdrpc
from etcd3.client import Etcd3Client
from etcd3.client import Transactions
from etcd3.client import client
from etcd3.leases import Lease
from etcd3.locks import Lock
from etcd3.members import Member
__author__ = 'Louis Taylor'
__email__ = 'louis@... | from __future__ import absolute_import
import etcd3.etcdrpc as etcdrpc
from etcd3.client import Etcd3Client
from etcd3.client import Transactions
from etcd3.client import client
from etcd3.leases import Lease
from etcd3.locks import Lock
from etcd3.members import Member
__author__ = 'Louis Taylor'
__email__ = 'louis@... | <commit_before>from __future__ import absolute_import
import etcd3.etcdrpc as etcdrpc
from etcd3.client import Etcd3Client
from etcd3.client import Transactions
from etcd3.client import client
from etcd3.leases import Lease
from etcd3.locks import Lock
from etcd3.members import Member
__author__ = 'Louis Taylor'
__em... | from __future__ import absolute_import
import etcd3.etcdrpc as etcdrpc
from etcd3.client import Etcd3Client
from etcd3.client import Transactions
from etcd3.client import client
from etcd3.leases import Lease
from etcd3.locks import Lock
from etcd3.members import Member
__author__ = 'Louis Taylor'
__email__ = 'louis@... | from __future__ import absolute_import
import etcd3.etcdrpc as etcdrpc
from etcd3.client import Etcd3Client
from etcd3.client import Transactions
from etcd3.client import client
from etcd3.leases import Lease
from etcd3.locks import Lock
from etcd3.members import Member
__author__ = 'Louis Taylor'
__email__ = 'louis@... | <commit_before>from __future__ import absolute_import
import etcd3.etcdrpc as etcdrpc
from etcd3.client import Etcd3Client
from etcd3.client import Transactions
from etcd3.client import client
from etcd3.leases import Lease
from etcd3.locks import Lock
from etcd3.members import Member
__author__ = 'Louis Taylor'
__em... |
f698dbc8b10aacf6ac8ee2a5d0d63ad01bd73674 | octopus/image/data.py | octopus/image/data.py | # System Imports
import StringIO
import urllib
# Twisted Imports
from twisted.python.util import unsignedID
# Package Imports
from ..data.errors import Immutable
class Image (object):
@property
def value (self):
output = StringIO.StringIO()
img = self._image_fn()
img.scale(0.25).getPIL().save(output, format... | # System Imports
import StringIO
import urllib
# Package Imports
from ..data.errors import Immutable
class Image (object):
@property
def value (self):
output = StringIO.StringIO()
img = self._image_fn()
img.scale(0.25).getPIL().save(output, format = "PNG")
encoded = "data:image/png;base64," + urllib.quote(... | Replace another call to unsignedID. | Replace another call to unsignedID.
| Python | mit | richardingham/octopus,rasata/octopus,rasata/octopus,richardingham/octopus,richardingham/octopus,richardingham/octopus,rasata/octopus | # System Imports
import StringIO
import urllib
# Twisted Imports
from twisted.python.util import unsignedID
# Package Imports
from ..data.errors import Immutable
class Image (object):
@property
def value (self):
output = StringIO.StringIO()
img = self._image_fn()
img.scale(0.25).getPIL().save(output, format... | # System Imports
import StringIO
import urllib
# Package Imports
from ..data.errors import Immutable
class Image (object):
@property
def value (self):
output = StringIO.StringIO()
img = self._image_fn()
img.scale(0.25).getPIL().save(output, format = "PNG")
encoded = "data:image/png;base64," + urllib.quote(... | <commit_before># System Imports
import StringIO
import urllib
# Twisted Imports
from twisted.python.util import unsignedID
# Package Imports
from ..data.errors import Immutable
class Image (object):
@property
def value (self):
output = StringIO.StringIO()
img = self._image_fn()
img.scale(0.25).getPIL().save... | # System Imports
import StringIO
import urllib
# Package Imports
from ..data.errors import Immutable
class Image (object):
@property
def value (self):
output = StringIO.StringIO()
img = self._image_fn()
img.scale(0.25).getPIL().save(output, format = "PNG")
encoded = "data:image/png;base64," + urllib.quote(... | # System Imports
import StringIO
import urllib
# Twisted Imports
from twisted.python.util import unsignedID
# Package Imports
from ..data.errors import Immutable
class Image (object):
@property
def value (self):
output = StringIO.StringIO()
img = self._image_fn()
img.scale(0.25).getPIL().save(output, format... | <commit_before># System Imports
import StringIO
import urllib
# Twisted Imports
from twisted.python.util import unsignedID
# Package Imports
from ..data.errors import Immutable
class Image (object):
@property
def value (self):
output = StringIO.StringIO()
img = self._image_fn()
img.scale(0.25).getPIL().save... |
7881e6d06a34eddef5523df88ee601fb5e5d3ba6 | encryptit/dump_json.py | encryptit/dump_json.py | import json
from .compat import OrderedDict
from .openpgp_message import OpenPGPMessage
def dump_stream(f, output_stream, indent=4):
message = OpenPGPMessage.from_stream(f)
return json.dump(message, output_stream, indent=indent,
cls=OpenPGPJsonEncoder)
class OpenPGPJsonEncoder(json.JSO... | import json
from .compat import OrderedDict
from .openpgp_message import OpenPGPMessage
def dump_stream(f, output_stream, indent=4):
message = OpenPGPMessage.from_stream(f)
return json.dump(message, output_stream, indent=indent,
cls=OpenPGPJsonEncoder)
class OpenPGPJsonEncoder(json.JSO... | Revert "Fix JSON encoding of `PacketLocation`" | Revert "Fix JSON encoding of `PacketLocation`"
This reverts commit 9e91912c6c1764c88890ec47df9372e6ac41612c.
| Python | agpl-3.0 | paulfurley/encryptit,paulfurley/encryptit | import json
from .compat import OrderedDict
from .openpgp_message import OpenPGPMessage
def dump_stream(f, output_stream, indent=4):
message = OpenPGPMessage.from_stream(f)
return json.dump(message, output_stream, indent=indent,
cls=OpenPGPJsonEncoder)
class OpenPGPJsonEncoder(json.JSO... | import json
from .compat import OrderedDict
from .openpgp_message import OpenPGPMessage
def dump_stream(f, output_stream, indent=4):
message = OpenPGPMessage.from_stream(f)
return json.dump(message, output_stream, indent=indent,
cls=OpenPGPJsonEncoder)
class OpenPGPJsonEncoder(json.JSO... | <commit_before>import json
from .compat import OrderedDict
from .openpgp_message import OpenPGPMessage
def dump_stream(f, output_stream, indent=4):
message = OpenPGPMessage.from_stream(f)
return json.dump(message, output_stream, indent=indent,
cls=OpenPGPJsonEncoder)
class OpenPGPJsonE... | import json
from .compat import OrderedDict
from .openpgp_message import OpenPGPMessage
def dump_stream(f, output_stream, indent=4):
message = OpenPGPMessage.from_stream(f)
return json.dump(message, output_stream, indent=indent,
cls=OpenPGPJsonEncoder)
class OpenPGPJsonEncoder(json.JSO... | import json
from .compat import OrderedDict
from .openpgp_message import OpenPGPMessage
def dump_stream(f, output_stream, indent=4):
message = OpenPGPMessage.from_stream(f)
return json.dump(message, output_stream, indent=indent,
cls=OpenPGPJsonEncoder)
class OpenPGPJsonEncoder(json.JSO... | <commit_before>import json
from .compat import OrderedDict
from .openpgp_message import OpenPGPMessage
def dump_stream(f, output_stream, indent=4):
message = OpenPGPMessage.from_stream(f)
return json.dump(message, output_stream, indent=indent,
cls=OpenPGPJsonEncoder)
class OpenPGPJsonE... |
84a0aef34f8ab187de7e0c2b17c2e79d0e8f2330 | feedback/forms.py | feedback/forms.py | from django import forms
from feedback.models import Feedback
class FeedbackForm(forms.ModelForm):
class Meta:
model = Feedback
exclude = ("url", "resolved", "publish",) | from django import forms
from feedback.models import Feedback
class FeedbackForm(forms.ModelForm):
class Meta:
model = Feedback
exclude = ("user", "url", "resolved", "publish",) | Remove the user field from the form to counter-balance making the field editable. | Remove the user field from the form to counter-balance making the field editable. | Python | bsd-3-clause | gabrielhurley/django-user-feedback | from django import forms
from feedback.models import Feedback
class FeedbackForm(forms.ModelForm):
class Meta:
model = Feedback
exclude = ("url", "resolved", "publish",)Remove the user field from the form to counter-balance making the field editable. | from django import forms
from feedback.models import Feedback
class FeedbackForm(forms.ModelForm):
class Meta:
model = Feedback
exclude = ("user", "url", "resolved", "publish",) | <commit_before>from django import forms
from feedback.models import Feedback
class FeedbackForm(forms.ModelForm):
class Meta:
model = Feedback
exclude = ("url", "resolved", "publish",)<commit_msg>Remove the user field from the form to counter-balance making the field editable.<commit_after> | from django import forms
from feedback.models import Feedback
class FeedbackForm(forms.ModelForm):
class Meta:
model = Feedback
exclude = ("user", "url", "resolved", "publish",) | from django import forms
from feedback.models import Feedback
class FeedbackForm(forms.ModelForm):
class Meta:
model = Feedback
exclude = ("url", "resolved", "publish",)Remove the user field from the form to counter-balance making the field editable.from django import forms
from feedback.models i... | <commit_before>from django import forms
from feedback.models import Feedback
class FeedbackForm(forms.ModelForm):
class Meta:
model = Feedback
exclude = ("url", "resolved", "publish",)<commit_msg>Remove the user field from the form to counter-balance making the field editable.<commit_after>from dj... |
1239128a082757c3a7d53e7b14c189dda06f4171 | flaws/__init__.py | flaws/__init__.py | #!/usr/bin/env python
import sys
from funcy import split, map
from .analysis import global_usage, local_usage, FileSet
import sys, ipdb, traceback
def info(type, value, tb):
traceback.print_exception(type, value, tb)
print
ipdb.pm()
sys.excepthook = info
def main():
command = sys.argv[1]
kwa... | #!/usr/bin/env python
import sys
from funcy import split, map
from .analysis import global_usage, local_usage, FileSet
def main():
command = sys.argv[1]
kwargs, args = split(r'^--', sys.argv[2:])
kwargs = dict(map(r'^--(\w+)(?:=(.+))?', kwargs))
# Run ipdb on exception
if 'ipdb' in kwargs:
... | Make ipdb hook turn on only when --ipdb | Make ipdb hook turn on only when --ipdb
| Python | bsd-2-clause | Suor/flaws | #!/usr/bin/env python
import sys
from funcy import split, map
from .analysis import global_usage, local_usage, FileSet
import sys, ipdb, traceback
def info(type, value, tb):
traceback.print_exception(type, value, tb)
print
ipdb.pm()
sys.excepthook = info
def main():
command = sys.argv[1]
kwa... | #!/usr/bin/env python
import sys
from funcy import split, map
from .analysis import global_usage, local_usage, FileSet
def main():
command = sys.argv[1]
kwargs, args = split(r'^--', sys.argv[2:])
kwargs = dict(map(r'^--(\w+)(?:=(.+))?', kwargs))
# Run ipdb on exception
if 'ipdb' in kwargs:
... | <commit_before>#!/usr/bin/env python
import sys
from funcy import split, map
from .analysis import global_usage, local_usage, FileSet
import sys, ipdb, traceback
def info(type, value, tb):
traceback.print_exception(type, value, tb)
print
ipdb.pm()
sys.excepthook = info
def main():
command = sys.... | #!/usr/bin/env python
import sys
from funcy import split, map
from .analysis import global_usage, local_usage, FileSet
def main():
command = sys.argv[1]
kwargs, args = split(r'^--', sys.argv[2:])
kwargs = dict(map(r'^--(\w+)(?:=(.+))?', kwargs))
# Run ipdb on exception
if 'ipdb' in kwargs:
... | #!/usr/bin/env python
import sys
from funcy import split, map
from .analysis import global_usage, local_usage, FileSet
import sys, ipdb, traceback
def info(type, value, tb):
traceback.print_exception(type, value, tb)
print
ipdb.pm()
sys.excepthook = info
def main():
command = sys.argv[1]
kwa... | <commit_before>#!/usr/bin/env python
import sys
from funcy import split, map
from .analysis import global_usage, local_usage, FileSet
import sys, ipdb, traceback
def info(type, value, tb):
traceback.print_exception(type, value, tb)
print
ipdb.pm()
sys.excepthook = info
def main():
command = sys.... |
c64682fe6204b56bd5282c46a7c7168a55b46a86 | spicedham/__init__.py | spicedham/__init__.py | from pkg_resources import iter_entry_points
from config import config
plugins = []
for plugin in iter_entry_points(group='spicedham.classifiers', name=None):
pluginClass = plugin.load()
plugins.append(pluginClass())
def train(training_data, is_spam):
for plugin in plugins:
plugin.train(training... | from pkg_resources import iter_entry_points
from config import config
plugins = []
for plugin in iter_entry_points(group='spicedham.classifiers', name=None):
pluginClass = plugin.load()
plugins.append(pluginClass())
def train(training_data, is_spam):
for plugin in plugins:
plugin.train(training... | Allow for the case where no plugin returns a score | Allow for the case where no plugin returns a score
| Python | mpl-2.0 | mozilla/spicedham,mozilla/spicedham | from pkg_resources import iter_entry_points
from config import config
plugins = []
for plugin in iter_entry_points(group='spicedham.classifiers', name=None):
pluginClass = plugin.load()
plugins.append(pluginClass())
def train(training_data, is_spam):
for plugin in plugins:
plugin.train(training... | from pkg_resources import iter_entry_points
from config import config
plugins = []
for plugin in iter_entry_points(group='spicedham.classifiers', name=None):
pluginClass = plugin.load()
plugins.append(pluginClass())
def train(training_data, is_spam):
for plugin in plugins:
plugin.train(training... | <commit_before>from pkg_resources import iter_entry_points
from config import config
plugins = []
for plugin in iter_entry_points(group='spicedham.classifiers', name=None):
pluginClass = plugin.load()
plugins.append(pluginClass())
def train(training_data, is_spam):
for plugin in plugins:
plugin... | from pkg_resources import iter_entry_points
from config import config
plugins = []
for plugin in iter_entry_points(group='spicedham.classifiers', name=None):
pluginClass = plugin.load()
plugins.append(pluginClass())
def train(training_data, is_spam):
for plugin in plugins:
plugin.train(training... | from pkg_resources import iter_entry_points
from config import config
plugins = []
for plugin in iter_entry_points(group='spicedham.classifiers', name=None):
pluginClass = plugin.load()
plugins.append(pluginClass())
def train(training_data, is_spam):
for plugin in plugins:
plugin.train(training... | <commit_before>from pkg_resources import iter_entry_points
from config import config
plugins = []
for plugin in iter_entry_points(group='spicedham.classifiers', name=None):
pluginClass = plugin.load()
plugins.append(pluginClass())
def train(training_data, is_spam):
for plugin in plugins:
plugin... |
0a5e2134fda46269626b6fac367a28218734b256 | conf_site/accounts/tests/__init__.py | conf_site/accounts/tests/__init__.py | from factory import fuzzy
from django.contrib.auth import get_user_model
from django.test import TestCase
class AccountsTestCase(TestCase):
def setUp(self):
super(AccountsTestCase, self).setUp()
self.password = fuzzy.FuzzyText(length=16)
self.new_password = fuzzy.FuzzyText(length=16)
... | from factory import fuzzy
from django.contrib.auth import get_user_model
from django.test import TestCase
class AccountsTestCase(TestCase):
def setUp(self):
super(AccountsTestCase, self).setUp()
self.password = fuzzy.FuzzyText(length=16)
self.new_password = fuzzy.FuzzyText(length=16)
... | Add `_become_staff` method to AccountsTestCase. | Add `_become_staff` method to AccountsTestCase.
| Python | mit | pydata/conf_site,pydata/conf_site,pydata/conf_site | from factory import fuzzy
from django.contrib.auth import get_user_model
from django.test import TestCase
class AccountsTestCase(TestCase):
def setUp(self):
super(AccountsTestCase, self).setUp()
self.password = fuzzy.FuzzyText(length=16)
self.new_password = fuzzy.FuzzyText(length=16)
... | from factory import fuzzy
from django.contrib.auth import get_user_model
from django.test import TestCase
class AccountsTestCase(TestCase):
def setUp(self):
super(AccountsTestCase, self).setUp()
self.password = fuzzy.FuzzyText(length=16)
self.new_password = fuzzy.FuzzyText(length=16)
... | <commit_before>from factory import fuzzy
from django.contrib.auth import get_user_model
from django.test import TestCase
class AccountsTestCase(TestCase):
def setUp(self):
super(AccountsTestCase, self).setUp()
self.password = fuzzy.FuzzyText(length=16)
self.new_password = fuzzy.FuzzyText... | from factory import fuzzy
from django.contrib.auth import get_user_model
from django.test import TestCase
class AccountsTestCase(TestCase):
def setUp(self):
super(AccountsTestCase, self).setUp()
self.password = fuzzy.FuzzyText(length=16)
self.new_password = fuzzy.FuzzyText(length=16)
... | from factory import fuzzy
from django.contrib.auth import get_user_model
from django.test import TestCase
class AccountsTestCase(TestCase):
def setUp(self):
super(AccountsTestCase, self).setUp()
self.password = fuzzy.FuzzyText(length=16)
self.new_password = fuzzy.FuzzyText(length=16)
... | <commit_before>from factory import fuzzy
from django.contrib.auth import get_user_model
from django.test import TestCase
class AccountsTestCase(TestCase):
def setUp(self):
super(AccountsTestCase, self).setUp()
self.password = fuzzy.FuzzyText(length=16)
self.new_password = fuzzy.FuzzyText... |
76e436daef154bdf6acd1b0569f6fa2baa61addd | pyxform/tests_v1/test_audit.py | pyxform/tests_v1/test_audit.py | from pyxform.tests_v1.pyxform_test_case import PyxformTestCase
class AuditTest(PyxformTestCase):
def test_audit(self):
self.assertPyxformXform(
name="meta_audit",
md="""
| survey | | | |
| | type | name | label |
... | from pyxform.tests_v1.pyxform_test_case import PyxformTestCase
class AuditTest(PyxformTestCase):
def test_audit(self):
self.assertPyxformXform(
name="meta_audit",
md="""
| survey | | | |
| | type | name | label |
... | Add test for blank audit name. | Add test for blank audit name.
| Python | bsd-2-clause | XLSForm/pyxform,XLSForm/pyxform | from pyxform.tests_v1.pyxform_test_case import PyxformTestCase
class AuditTest(PyxformTestCase):
def test_audit(self):
self.assertPyxformXform(
name="meta_audit",
md="""
| survey | | | |
| | type | name | label |
... | from pyxform.tests_v1.pyxform_test_case import PyxformTestCase
class AuditTest(PyxformTestCase):
def test_audit(self):
self.assertPyxformXform(
name="meta_audit",
md="""
| survey | | | |
| | type | name | label |
... | <commit_before>from pyxform.tests_v1.pyxform_test_case import PyxformTestCase
class AuditTest(PyxformTestCase):
def test_audit(self):
self.assertPyxformXform(
name="meta_audit",
md="""
| survey | | | |
| | type | name | lab... | from pyxform.tests_v1.pyxform_test_case import PyxformTestCase
class AuditTest(PyxformTestCase):
def test_audit(self):
self.assertPyxformXform(
name="meta_audit",
md="""
| survey | | | |
| | type | name | label |
... | from pyxform.tests_v1.pyxform_test_case import PyxformTestCase
class AuditTest(PyxformTestCase):
def test_audit(self):
self.assertPyxformXform(
name="meta_audit",
md="""
| survey | | | |
| | type | name | label |
... | <commit_before>from pyxform.tests_v1.pyxform_test_case import PyxformTestCase
class AuditTest(PyxformTestCase):
def test_audit(self):
self.assertPyxformXform(
name="meta_audit",
md="""
| survey | | | |
| | type | name | lab... |
fb25fa04cf553b1084425a1f2af6a9315266ffaf | salt/renderers/yaml_jinja.py | salt/renderers/yaml_jinja.py | '''
The default rendering engine, process yaml with the jinja2 templating engine
This renderer will take a yaml file with the jinja2 template and render it to a
high data format for salt states.
'''
# Import Python Modules
import os
# Import thirt party modules
import yaml
try:
yaml.Loader = yaml.CLoader
yam... | '''
The default rendering engine, process yaml with the jinja2 templating engine
This renderer will take a yaml file with the jinja2 template and render it to a
high data format for salt states.
'''
# Import Python Modules
import os
# Import thirt party modules
import yaml
try:
yaml.Loader = yaml.CLoader
yam... | Add pillar data to default renderer | Add pillar data to default renderer
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | '''
The default rendering engine, process yaml with the jinja2 templating engine
This renderer will take a yaml file with the jinja2 template and render it to a
high data format for salt states.
'''
# Import Python Modules
import os
# Import thirt party modules
import yaml
try:
yaml.Loader = yaml.CLoader
yam... | '''
The default rendering engine, process yaml with the jinja2 templating engine
This renderer will take a yaml file with the jinja2 template and render it to a
high data format for salt states.
'''
# Import Python Modules
import os
# Import thirt party modules
import yaml
try:
yaml.Loader = yaml.CLoader
yam... | <commit_before>'''
The default rendering engine, process yaml with the jinja2 templating engine
This renderer will take a yaml file with the jinja2 template and render it to a
high data format for salt states.
'''
# Import Python Modules
import os
# Import thirt party modules
import yaml
try:
yaml.Loader = yaml.... | '''
The default rendering engine, process yaml with the jinja2 templating engine
This renderer will take a yaml file with the jinja2 template and render it to a
high data format for salt states.
'''
# Import Python Modules
import os
# Import thirt party modules
import yaml
try:
yaml.Loader = yaml.CLoader
yam... | '''
The default rendering engine, process yaml with the jinja2 templating engine
This renderer will take a yaml file with the jinja2 template and render it to a
high data format for salt states.
'''
# Import Python Modules
import os
# Import thirt party modules
import yaml
try:
yaml.Loader = yaml.CLoader
yam... | <commit_before>'''
The default rendering engine, process yaml with the jinja2 templating engine
This renderer will take a yaml file with the jinja2 template and render it to a
high data format for salt states.
'''
# Import Python Modules
import os
# Import thirt party modules
import yaml
try:
yaml.Loader = yaml.... |
d63e792815b9bfe485e4127bdcb088374d8e983e | salvus/scripts/first_boot.py | salvus/scripts/first_boot.py | #!/usr/bin/env python
# This script is run by /etc/rc.local when booting up. It does special configuration
# depending on what images are mounted, etc.
import os
if os.path.exists('/mnt/home/'):
# Compute machine
if not os.path.exists('/mnt/home/aquota.group'):
os.system("quotacheck -cug /mnt/home")... | #!/usr/bin/env python
# This script is run by /etc/rc.local when booting up. It does special configuration
# depending on what images are mounted, etc.
import os
if os.path.exists('/mnt/home/'):
# Compute machine
if not os.path.exists('/mnt/home/aquota.group'):
os.system("quotacheck -cug /mnt/home")... | Remove .ssh keys on compute node from /mnt/home/salvus account, since this is a security risk (in case compute node is r00ted). | Remove .ssh keys on compute node from /mnt/home/salvus account, since this is a security risk (in case compute node is r00ted).
| Python | agpl-3.0 | tscholl2/smc,sagemathinc/smc,sagemathinc/smc,sagemathinc/smc,DrXyzzy/smc,tscholl2/smc,tscholl2/smc,DrXyzzy/smc,DrXyzzy/smc,DrXyzzy/smc,tscholl2/smc,tscholl2/smc,sagemathinc/smc | #!/usr/bin/env python
# This script is run by /etc/rc.local when booting up. It does special configuration
# depending on what images are mounted, etc.
import os
if os.path.exists('/mnt/home/'):
# Compute machine
if not os.path.exists('/mnt/home/aquota.group'):
os.system("quotacheck -cug /mnt/home")... | #!/usr/bin/env python
# This script is run by /etc/rc.local when booting up. It does special configuration
# depending on what images are mounted, etc.
import os
if os.path.exists('/mnt/home/'):
# Compute machine
if not os.path.exists('/mnt/home/aquota.group'):
os.system("quotacheck -cug /mnt/home")... | <commit_before>#!/usr/bin/env python
# This script is run by /etc/rc.local when booting up. It does special configuration
# depending on what images are mounted, etc.
import os
if os.path.exists('/mnt/home/'):
# Compute machine
if not os.path.exists('/mnt/home/aquota.group'):
os.system("quotacheck -... | #!/usr/bin/env python
# This script is run by /etc/rc.local when booting up. It does special configuration
# depending on what images are mounted, etc.
import os
if os.path.exists('/mnt/home/'):
# Compute machine
if not os.path.exists('/mnt/home/aquota.group'):
os.system("quotacheck -cug /mnt/home")... | #!/usr/bin/env python
# This script is run by /etc/rc.local when booting up. It does special configuration
# depending on what images are mounted, etc.
import os
if os.path.exists('/mnt/home/'):
# Compute machine
if not os.path.exists('/mnt/home/aquota.group'):
os.system("quotacheck -cug /mnt/home")... | <commit_before>#!/usr/bin/env python
# This script is run by /etc/rc.local when booting up. It does special configuration
# depending on what images are mounted, etc.
import os
if os.path.exists('/mnt/home/'):
# Compute machine
if not os.path.exists('/mnt/home/aquota.group'):
os.system("quotacheck -... |
e645104656fda22f4c0c2b3d9841ed792b1e7103 | conftest.py | conftest.py | import sys
pytest_plugins = 'setuptools.tests.fixtures'
def pytest_addoption(parser):
parser.addoption(
"--package_name", action="append", default=[],
help="list of package_name to pass to test functions",
)
collect_ignore = [
'tests/manual_test.py',
'setuptools/tests/mod_with_cons... | import sys
import pytest
pytest_plugins = 'setuptools.tests.fixtures'
def pytest_addoption(parser):
parser.addoption(
"--package_name", action="append", default=[],
help="list of package_name to pass to test functions",
)
parser.addoption(
"--integration", action="store_true", d... | Configure pytest to enable/disable integration tests | Configure pytest to enable/disable integration tests
| Python | mit | pypa/setuptools,pypa/setuptools,pypa/setuptools | import sys
pytest_plugins = 'setuptools.tests.fixtures'
def pytest_addoption(parser):
parser.addoption(
"--package_name", action="append", default=[],
help="list of package_name to pass to test functions",
)
collect_ignore = [
'tests/manual_test.py',
'setuptools/tests/mod_with_cons... | import sys
import pytest
pytest_plugins = 'setuptools.tests.fixtures'
def pytest_addoption(parser):
parser.addoption(
"--package_name", action="append", default=[],
help="list of package_name to pass to test functions",
)
parser.addoption(
"--integration", action="store_true", d... | <commit_before>import sys
pytest_plugins = 'setuptools.tests.fixtures'
def pytest_addoption(parser):
parser.addoption(
"--package_name", action="append", default=[],
help="list of package_name to pass to test functions",
)
collect_ignore = [
'tests/manual_test.py',
'setuptools/test... | import sys
import pytest
pytest_plugins = 'setuptools.tests.fixtures'
def pytest_addoption(parser):
parser.addoption(
"--package_name", action="append", default=[],
help="list of package_name to pass to test functions",
)
parser.addoption(
"--integration", action="store_true", d... | import sys
pytest_plugins = 'setuptools.tests.fixtures'
def pytest_addoption(parser):
parser.addoption(
"--package_name", action="append", default=[],
help="list of package_name to pass to test functions",
)
collect_ignore = [
'tests/manual_test.py',
'setuptools/tests/mod_with_cons... | <commit_before>import sys
pytest_plugins = 'setuptools.tests.fixtures'
def pytest_addoption(parser):
parser.addoption(
"--package_name", action="append", default=[],
help="list of package_name to pass to test functions",
)
collect_ignore = [
'tests/manual_test.py',
'setuptools/test... |
84d9a421b33660f4ad17432fef8604a55b0e2302 | calvin/runtime/south/plugins/io/sensors/environmental/platform/raspberry_pi/sensehat_impl/environmental.py | calvin/runtime/south/plugins/io/sensors/environmental/platform/raspberry_pi/sensehat_impl/environmental.py | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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 ... | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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 ... | Allow use of sensors from more than one actor concurrenctly | Sensehat: Allow use of sensors from more than one actor concurrenctly
| Python | apache-2.0 | EricssonResearch/calvin-base,EricssonResearch/calvin-base,EricssonResearch/calvin-base,EricssonResearch/calvin-base | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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 ... | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | <commit_before># -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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... | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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 ... | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | <commit_before># -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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... |
fa30c15c6bdaa49d3af2e717f559d279da770b46 | src/streamlink/plugins/arconai.py | src/streamlink/plugins/arconai.py | import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http
from streamlink.plugin.api import useragents
from streamlink.stream import HLSStream
_url_re = re.compile(r'''https?://(www\.)?arconaitv\.me/stream\.php\?id=\d+''')
_playlist_re = re.compile(r'''source\ssrc=["'](?P<url>[^"']+)["']''... | import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http
from streamlink.plugin.api import useragents
from streamlink.stream import HLSStream
_url_re = re.compile(r'''https?://(www\.)?arconaitv\.co/stream\.php\?id=\d+''')
_playlist_re = re.compile(r'''source\ssrc=["'](?P<url>[^"']+)["']''... | Update Arconaitv to new url | Update Arconaitv to new url | Python | bsd-2-clause | bastimeyer/streamlink,streamlink/streamlink,back-to/streamlink,melmorabity/streamlink,bastimeyer/streamlink,gravyboat/streamlink,melmorabity/streamlink,javiercantero/streamlink,gravyboat/streamlink,javiercantero/streamlink,wlerin/streamlink,wlerin/streamlink,beardypig/streamlink,chhe/streamlink,streamlink/streamlink,be... | import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http
from streamlink.plugin.api import useragents
from streamlink.stream import HLSStream
_url_re = re.compile(r'''https?://(www\.)?arconaitv\.me/stream\.php\?id=\d+''')
_playlist_re = re.compile(r'''source\ssrc=["'](?P<url>[^"']+)["']''... | import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http
from streamlink.plugin.api import useragents
from streamlink.stream import HLSStream
_url_re = re.compile(r'''https?://(www\.)?arconaitv\.co/stream\.php\?id=\d+''')
_playlist_re = re.compile(r'''source\ssrc=["'](?P<url>[^"']+)["']''... | <commit_before>import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http
from streamlink.plugin.api import useragents
from streamlink.stream import HLSStream
_url_re = re.compile(r'''https?://(www\.)?arconaitv\.me/stream\.php\?id=\d+''')
_playlist_re = re.compile(r'''source\ssrc=["'](?P<ur... | import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http
from streamlink.plugin.api import useragents
from streamlink.stream import HLSStream
_url_re = re.compile(r'''https?://(www\.)?arconaitv\.co/stream\.php\?id=\d+''')
_playlist_re = re.compile(r'''source\ssrc=["'](?P<url>[^"']+)["']''... | import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http
from streamlink.plugin.api import useragents
from streamlink.stream import HLSStream
_url_re = re.compile(r'''https?://(www\.)?arconaitv\.me/stream\.php\?id=\d+''')
_playlist_re = re.compile(r'''source\ssrc=["'](?P<url>[^"']+)["']''... | <commit_before>import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http
from streamlink.plugin.api import useragents
from streamlink.stream import HLSStream
_url_re = re.compile(r'''https?://(www\.)?arconaitv\.me/stream\.php\?id=\d+''')
_playlist_re = re.compile(r'''source\ssrc=["'](?P<ur... |
98aa2b25c63ec5bd6384a9d398a70996799b135e | mygpoauth/urls.py | mygpoauth/urls.py | from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic.base import RedirectView
from mygpoauth import oauth2
urlpatterns = [
# Examples:
# url(r'^$', 'mygpoauth.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', RedirectView.as... | from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic.base import RedirectView
from mygpoauth import oauth2
urlpatterns = [
# Examples:
# url(r'^$', 'mygpoauth.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', RedirectView.as... | Make "/" a non-permanent redirect | Make "/" a non-permanent redirect
| Python | agpl-3.0 | gpodder/mygpo-auth,gpodder/mygpo-auth | from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic.base import RedirectView
from mygpoauth import oauth2
urlpatterns = [
# Examples:
# url(r'^$', 'mygpoauth.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', RedirectView.as... | from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic.base import RedirectView
from mygpoauth import oauth2
urlpatterns = [
# Examples:
# url(r'^$', 'mygpoauth.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', RedirectView.as... | <commit_before>from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic.base import RedirectView
from mygpoauth import oauth2
urlpatterns = [
# Examples:
# url(r'^$', 'mygpoauth.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', ... | from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic.base import RedirectView
from mygpoauth import oauth2
urlpatterns = [
# Examples:
# url(r'^$', 'mygpoauth.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', RedirectView.as... | from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic.base import RedirectView
from mygpoauth import oauth2
urlpatterns = [
# Examples:
# url(r'^$', 'mygpoauth.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', RedirectView.as... | <commit_before>from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic.base import RedirectView
from mygpoauth import oauth2
urlpatterns = [
# Examples:
# url(r'^$', 'mygpoauth.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', ... |
b706c1a949b10a7dd4b3206c02de8d4abda088a9 | pytac/mini_project.py | pytac/mini_project.py | import pytac.load_csv
import pytac.epics
def main():
lattice = pytac.load_csv.load('VMX', pytac.epics.EpicsControlSystem())
bpms = lattice.get_elements('BPM')
bpms_n = 0
try:
for bpm in bpms:
bpm.get_pv_name('y')
bpms_n += 1
print 'There exist {0} BPMy elements i... | import pytac.load_csv
import pytac.epics
def main():
# First task: print the number of bpm y elements in the ring.
lattice = pytac.load_csv.load('VMX', pytac.epics.EpicsControlSystem())
bpms = lattice.get_elements('BPM')
bpms_n = 0
try:
for bpm in bpms:
bpm.get_pv_name('y')
... | Print each bpmx pv name along with the associated value to stdout | Print each bpmx pv name along with the associated value to stdout
| Python | apache-2.0 | razvanvasile/Work-Mini-Projects,razvanvasile/Work-Mini-Projects,razvanvasile/Work-Mini-Projects | import pytac.load_csv
import pytac.epics
def main():
lattice = pytac.load_csv.load('VMX', pytac.epics.EpicsControlSystem())
bpms = lattice.get_elements('BPM')
bpms_n = 0
try:
for bpm in bpms:
bpm.get_pv_name('y')
bpms_n += 1
print 'There exist {0} BPMy elements i... | import pytac.load_csv
import pytac.epics
def main():
# First task: print the number of bpm y elements in the ring.
lattice = pytac.load_csv.load('VMX', pytac.epics.EpicsControlSystem())
bpms = lattice.get_elements('BPM')
bpms_n = 0
try:
for bpm in bpms:
bpm.get_pv_name('y')
... | <commit_before>import pytac.load_csv
import pytac.epics
def main():
lattice = pytac.load_csv.load('VMX', pytac.epics.EpicsControlSystem())
bpms = lattice.get_elements('BPM')
bpms_n = 0
try:
for bpm in bpms:
bpm.get_pv_name('y')
bpms_n += 1
print 'There exist {0} ... | import pytac.load_csv
import pytac.epics
def main():
# First task: print the number of bpm y elements in the ring.
lattice = pytac.load_csv.load('VMX', pytac.epics.EpicsControlSystem())
bpms = lattice.get_elements('BPM')
bpms_n = 0
try:
for bpm in bpms:
bpm.get_pv_name('y')
... | import pytac.load_csv
import pytac.epics
def main():
lattice = pytac.load_csv.load('VMX', pytac.epics.EpicsControlSystem())
bpms = lattice.get_elements('BPM')
bpms_n = 0
try:
for bpm in bpms:
bpm.get_pv_name('y')
bpms_n += 1
print 'There exist {0} BPMy elements i... | <commit_before>import pytac.load_csv
import pytac.epics
def main():
lattice = pytac.load_csv.load('VMX', pytac.epics.EpicsControlSystem())
bpms = lattice.get_elements('BPM')
bpms_n = 0
try:
for bpm in bpms:
bpm.get_pv_name('y')
bpms_n += 1
print 'There exist {0} ... |
0b8b32a044e92f4e996af734d44a2d93d1492684 | project_code/bulk_fitting.py | project_code/bulk_fitting.py |
'''
Bulk spectral line fitting with SDSS galaxy spectra
'''
import os
from astropy.io import fits
from pandas import concat
# Bring in the package funcs
from specfit import do_specfit
from download_spectra import download_spectra
def bulk_fit(obs_file, output_file, keep_spectra=False):
'''
Downloads files ... |
'''
Bulk spectral line fitting with SDSS galaxy spectra
'''
import os
from astropy.io import fits
from pandas import DataFrame
# Bring in the package funcs
from specfit import do_specfit
from download_spectra import download_spectra
def bulk_fit(obs_file, output_file, keep_spectra=False):
'''
Downloads fil... | Correct names, concat dataframes properly | Correct names, concat dataframes properly
| Python | mit | e-koch/Phys-595 |
'''
Bulk spectral line fitting with SDSS galaxy spectra
'''
import os
from astropy.io import fits
from pandas import concat
# Bring in the package funcs
from specfit import do_specfit
from download_spectra import download_spectra
def bulk_fit(obs_file, output_file, keep_spectra=False):
'''
Downloads files ... |
'''
Bulk spectral line fitting with SDSS galaxy spectra
'''
import os
from astropy.io import fits
from pandas import DataFrame
# Bring in the package funcs
from specfit import do_specfit
from download_spectra import download_spectra
def bulk_fit(obs_file, output_file, keep_spectra=False):
'''
Downloads fil... | <commit_before>
'''
Bulk spectral line fitting with SDSS galaxy spectra
'''
import os
from astropy.io import fits
from pandas import concat
# Bring in the package funcs
from specfit import do_specfit
from download_spectra import download_spectra
def bulk_fit(obs_file, output_file, keep_spectra=False):
'''
D... |
'''
Bulk spectral line fitting with SDSS galaxy spectra
'''
import os
from astropy.io import fits
from pandas import DataFrame
# Bring in the package funcs
from specfit import do_specfit
from download_spectra import download_spectra
def bulk_fit(obs_file, output_file, keep_spectra=False):
'''
Downloads fil... |
'''
Bulk spectral line fitting with SDSS galaxy spectra
'''
import os
from astropy.io import fits
from pandas import concat
# Bring in the package funcs
from specfit import do_specfit
from download_spectra import download_spectra
def bulk_fit(obs_file, output_file, keep_spectra=False):
'''
Downloads files ... | <commit_before>
'''
Bulk spectral line fitting with SDSS galaxy spectra
'''
import os
from astropy.io import fits
from pandas import concat
# Bring in the package funcs
from specfit import do_specfit
from download_spectra import download_spectra
def bulk_fit(obs_file, output_file, keep_spectra=False):
'''
D... |
3e41a447076c4aa183923700c1c8203afdf07377 | bitbots_body_behavior/src/bitbots_body_behavior/decisions/ball_close.py | bitbots_body_behavior/src/bitbots_body_behavior/decisions/ball_close.py | from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement
class BallClose(AbstractDecisionElement):
def __init__(self, blackboard, dsd, parameters=None):
super(BallClose, self).__init__(blackboard, dsd, parameters)
self.ball_close_distance = self.blackboard.config['ball_c... | from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement
class BallClose(AbstractDecisionElement):
def __init__(self, blackboard, dsd, parameters=None):
super(BallClose, self).__init__(blackboard, dsd, parameters)
self.ball_close_distance = parameters.get("distance", sel... | Add param to ball close | Add param to ball close
| Python | bsd-3-clause | bit-bots/bitbots_behaviour | from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement
class BallClose(AbstractDecisionElement):
def __init__(self, blackboard, dsd, parameters=None):
super(BallClose, self).__init__(blackboard, dsd, parameters)
self.ball_close_distance = self.blackboard.config['ball_c... | from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement
class BallClose(AbstractDecisionElement):
def __init__(self, blackboard, dsd, parameters=None):
super(BallClose, self).__init__(blackboard, dsd, parameters)
self.ball_close_distance = parameters.get("distance", sel... | <commit_before>from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement
class BallClose(AbstractDecisionElement):
def __init__(self, blackboard, dsd, parameters=None):
super(BallClose, self).__init__(blackboard, dsd, parameters)
self.ball_close_distance = self.blackboard... | from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement
class BallClose(AbstractDecisionElement):
def __init__(self, blackboard, dsd, parameters=None):
super(BallClose, self).__init__(blackboard, dsd, parameters)
self.ball_close_distance = parameters.get("distance", sel... | from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement
class BallClose(AbstractDecisionElement):
def __init__(self, blackboard, dsd, parameters=None):
super(BallClose, self).__init__(blackboard, dsd, parameters)
self.ball_close_distance = self.blackboard.config['ball_c... | <commit_before>from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement
class BallClose(AbstractDecisionElement):
def __init__(self, blackboard, dsd, parameters=None):
super(BallClose, self).__init__(blackboard, dsd, parameters)
self.ball_close_distance = self.blackboard... |
ba4953423450c3bf2924aa76f37694b405c8ee85 | parse-zmmailbox-ids.py | parse-zmmailbox-ids.py | import re
import sys
# $ zmmailbox -z -m username@domain.tld search -l 200 "in:/inbox (before:today)"
# num: 200, more: true
#
# Id Type From Subject Date
# ------- ---- -------------------- -------------------------------------------------... | import re
import sys
# $ zmmailbox -z -m username@domain.tld search -l 200 "in:/inbox (before:today)"
# num: 200, more: true
#
# Id Type From Subject Date
# ------- ---- -------------------- -------------------------------------------------... | Include '-' in ID, print IDs separated by ',' | Include '-' in ID, print IDs separated by ','
| Python | apache-2.0 | hgdeoro/zimbra7-to-zimbra8-password-migrator | import re
import sys
# $ zmmailbox -z -m username@domain.tld search -l 200 "in:/inbox (before:today)"
# num: 200, more: true
#
# Id Type From Subject Date
# ------- ---- -------------------- -------------------------------------------------... | import re
import sys
# $ zmmailbox -z -m username@domain.tld search -l 200 "in:/inbox (before:today)"
# num: 200, more: true
#
# Id Type From Subject Date
# ------- ---- -------------------- -------------------------------------------------... | <commit_before>import re
import sys
# $ zmmailbox -z -m username@domain.tld search -l 200 "in:/inbox (before:today)"
# num: 200, more: true
#
# Id Type From Subject Date
# ------- ---- -------------------- ----------------------------------... | import re
import sys
# $ zmmailbox -z -m username@domain.tld search -l 200 "in:/inbox (before:today)"
# num: 200, more: true
#
# Id Type From Subject Date
# ------- ---- -------------------- -------------------------------------------------... | import re
import sys
# $ zmmailbox -z -m username@domain.tld search -l 200 "in:/inbox (before:today)"
# num: 200, more: true
#
# Id Type From Subject Date
# ------- ---- -------------------- -------------------------------------------------... | <commit_before>import re
import sys
# $ zmmailbox -z -m username@domain.tld search -l 200 "in:/inbox (before:today)"
# num: 200, more: true
#
# Id Type From Subject Date
# ------- ---- -------------------- ----------------------------------... |
62297b3c937d386b759ec14a078cee36f2550d44 | src/aiy/_drivers/_alsa.py | src/aiy/_drivers/_alsa.py | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Return None with invalid sample_width from sample_width_to_string. | Return None with invalid sample_width from sample_width_to_string.
| Python | apache-2.0 | google/aiyprojects-raspbian,t1m0thyj/aiyprojects-raspbian,google/aiyprojects-raspbian,t1m0thyj/aiyprojects-raspbian,google/aiyprojects-raspbian,google/aiyprojects-raspbian,google/aiyprojects-raspbian | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | <commit_before># Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | <commit_before># Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
ec07e139b5585a8ed9bed14426dac987267ebf05 | sbtsettings.py | sbtsettings.py | import sublime
class SBTSettings(object):
def __init__(self, window):
self.window = window
self._plugin_settings = sublime.load_settings('SublimeSBT.sublime-settings')
def sbt_command(self):
return self._view_settings().get('sbt_command', self._plugin_settings.get('sbt_command'))
... | import sublime
from util import maybe
class SBTSettings(object):
def __init__(self, window):
self.window = window
self._plugin_settings = sublime.load_settings('SublimeSBT.sublime-settings')
def sbt_command(self):
return self._view_settings().get('sbt_command', self._plugin_settings... | Fix AttributeError getting project settings when no active view | Fix AttributeError getting project settings when no active view
| Python | mit | jarhart/SublimeSBT | import sublime
class SBTSettings(object):
def __init__(self, window):
self.window = window
self._plugin_settings = sublime.load_settings('SublimeSBT.sublime-settings')
def sbt_command(self):
return self._view_settings().get('sbt_command', self._plugin_settings.get('sbt_command'))
... | import sublime
from util import maybe
class SBTSettings(object):
def __init__(self, window):
self.window = window
self._plugin_settings = sublime.load_settings('SublimeSBT.sublime-settings')
def sbt_command(self):
return self._view_settings().get('sbt_command', self._plugin_settings... | <commit_before>import sublime
class SBTSettings(object):
def __init__(self, window):
self.window = window
self._plugin_settings = sublime.load_settings('SublimeSBT.sublime-settings')
def sbt_command(self):
return self._view_settings().get('sbt_command', self._plugin_settings.get('sbt... | import sublime
from util import maybe
class SBTSettings(object):
def __init__(self, window):
self.window = window
self._plugin_settings = sublime.load_settings('SublimeSBT.sublime-settings')
def sbt_command(self):
return self._view_settings().get('sbt_command', self._plugin_settings... | import sublime
class SBTSettings(object):
def __init__(self, window):
self.window = window
self._plugin_settings = sublime.load_settings('SublimeSBT.sublime-settings')
def sbt_command(self):
return self._view_settings().get('sbt_command', self._plugin_settings.get('sbt_command'))
... | <commit_before>import sublime
class SBTSettings(object):
def __init__(self, window):
self.window = window
self._plugin_settings = sublime.load_settings('SublimeSBT.sublime-settings')
def sbt_command(self):
return self._view_settings().get('sbt_command', self._plugin_settings.get('sbt... |
e1b23cdc089b3a05ae4959c9859e16e5e21b5c91 | apps/careeropportunity/views.py | apps/careeropportunity/views.py | #-*- coding: utf-8 -*-
from django.shortcuts import render_to_response
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from apps.careeropportunity.models import CareerOpportunity
import datetime
def index(request):
opportunities = CareerOpportunity.objects.all()
... | #-*- coding: utf-8 -*-
from datetime import datetime
from django.shortcuts import render_to_response
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from apps.careeropportunity.models import CareerOpportunity
def index(request):
opportunities = CareerOpportunity.objects.f... | Make careerop only display active ops | Make careerop only display active ops
| Python | mit | dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4 | #-*- coding: utf-8 -*-
from django.shortcuts import render_to_response
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from apps.careeropportunity.models import CareerOpportunity
import datetime
def index(request):
opportunities = CareerOpportunity.objects.all()
... | #-*- coding: utf-8 -*-
from datetime import datetime
from django.shortcuts import render_to_response
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from apps.careeropportunity.models import CareerOpportunity
def index(request):
opportunities = CareerOpportunity.objects.f... | <commit_before>#-*- coding: utf-8 -*-
from django.shortcuts import render_to_response
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from apps.careeropportunity.models import CareerOpportunity
import datetime
def index(request):
opportunities = CareerOpportunity.objects... | #-*- coding: utf-8 -*-
from datetime import datetime
from django.shortcuts import render_to_response
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from apps.careeropportunity.models import CareerOpportunity
def index(request):
opportunities = CareerOpportunity.objects.f... | #-*- coding: utf-8 -*-
from django.shortcuts import render_to_response
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from apps.careeropportunity.models import CareerOpportunity
import datetime
def index(request):
opportunities = CareerOpportunity.objects.all()
... | <commit_before>#-*- coding: utf-8 -*-
from django.shortcuts import render_to_response
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from apps.careeropportunity.models import CareerOpportunity
import datetime
def index(request):
opportunities = CareerOpportunity.objects... |
fe167bfd25c0c86b3c6fb5ef76eb24036ad2b6da | tests/ne_np/__init__.py | tests/ne_np/__init__.py | from __future__ import unicode_literals
import unittest
import re
from faker import Factory
from faker.utils import text
from .. import string_types
class ne_NP_FactoryTestCase(unittest.TestCase):
def setUp(self):
self.factory = Factory.create('ne_NP')
def test_address(self):
from fa... | from __future__ import unicode_literals
import unittest
from faker import Factory
from .. import string_types
class NeNPFactoryTestCase(unittest.TestCase):
def setUp(self):
self.factory = Factory.create('ne_NP')
def test_address(self):
from faker.providers.address.ne_NP import Prov... | Fix incorrect ne_NP locale tests | Fix incorrect ne_NP locale tests
This test incorrectly assumes a call to name() will
yield only a first/last name, which isn't always true for this
locale. I suspect it hasn't been uncovered yet because the
tests are seeded the same at the beginning of every run. It only
becomes a problem when you start moving tests a... | Python | mit | trtd/faker,joke2k/faker,joke2k/faker,danhuss/faker | from __future__ import unicode_literals
import unittest
import re
from faker import Factory
from faker.utils import text
from .. import string_types
class ne_NP_FactoryTestCase(unittest.TestCase):
def setUp(self):
self.factory = Factory.create('ne_NP')
def test_address(self):
from fa... | from __future__ import unicode_literals
import unittest
from faker import Factory
from .. import string_types
class NeNPFactoryTestCase(unittest.TestCase):
def setUp(self):
self.factory = Factory.create('ne_NP')
def test_address(self):
from faker.providers.address.ne_NP import Prov... | <commit_before>from __future__ import unicode_literals
import unittest
import re
from faker import Factory
from faker.utils import text
from .. import string_types
class ne_NP_FactoryTestCase(unittest.TestCase):
def setUp(self):
self.factory = Factory.create('ne_NP')
def test_address(self)... | from __future__ import unicode_literals
import unittest
from faker import Factory
from .. import string_types
class NeNPFactoryTestCase(unittest.TestCase):
def setUp(self):
self.factory = Factory.create('ne_NP')
def test_address(self):
from faker.providers.address.ne_NP import Prov... | from __future__ import unicode_literals
import unittest
import re
from faker import Factory
from faker.utils import text
from .. import string_types
class ne_NP_FactoryTestCase(unittest.TestCase):
def setUp(self):
self.factory = Factory.create('ne_NP')
def test_address(self):
from fa... | <commit_before>from __future__ import unicode_literals
import unittest
import re
from faker import Factory
from faker.utils import text
from .. import string_types
class ne_NP_FactoryTestCase(unittest.TestCase):
def setUp(self):
self.factory = Factory.create('ne_NP')
def test_address(self)... |
6b9d9c33b4d68a008bb992b9a11ab2f02a4d5cbd | shelltest/tests/test_runner.py | shelltest/tests/test_runner.py | import tempfile
import StringIO
import pytest
from shelltest.shelltest import ShellTest, ShellTestSource, ShellTestRunner
@pytest.fixture
def tests():
return [ShellTest('echo hello', 'hello\n', ShellTestSource('', 0)),
ShellTest('echo $?', '0\n', ShellTestSource('', 2))]
def test_run(tests):
r... | import tempfile
import StringIO
import pytest
from shelltest.shelltest import ShellTest, ShellTestSource, ShellTestRunner
def runner(tests):
tests = [ShellTest(cmd, output, ShellTestSource('', 0)) for cmd, output in tests]
return ShellTestRunner(tests)
@pytest.mark.parametrize("cmd,output,ret_code,success... | Update runner tests to use parameters | Update runner tests to use parameters
| Python | mit | jthacker/shelltest,jthacker/shelltest | import tempfile
import StringIO
import pytest
from shelltest.shelltest import ShellTest, ShellTestSource, ShellTestRunner
@pytest.fixture
def tests():
return [ShellTest('echo hello', 'hello\n', ShellTestSource('', 0)),
ShellTest('echo $?', '0\n', ShellTestSource('', 2))]
def test_run(tests):
r... | import tempfile
import StringIO
import pytest
from shelltest.shelltest import ShellTest, ShellTestSource, ShellTestRunner
def runner(tests):
tests = [ShellTest(cmd, output, ShellTestSource('', 0)) for cmd, output in tests]
return ShellTestRunner(tests)
@pytest.mark.parametrize("cmd,output,ret_code,success... | <commit_before>import tempfile
import StringIO
import pytest
from shelltest.shelltest import ShellTest, ShellTestSource, ShellTestRunner
@pytest.fixture
def tests():
return [ShellTest('echo hello', 'hello\n', ShellTestSource('', 0)),
ShellTest('echo $?', '0\n', ShellTestSource('', 2))]
def test_ru... | import tempfile
import StringIO
import pytest
from shelltest.shelltest import ShellTest, ShellTestSource, ShellTestRunner
def runner(tests):
tests = [ShellTest(cmd, output, ShellTestSource('', 0)) for cmd, output in tests]
return ShellTestRunner(tests)
@pytest.mark.parametrize("cmd,output,ret_code,success... | import tempfile
import StringIO
import pytest
from shelltest.shelltest import ShellTest, ShellTestSource, ShellTestRunner
@pytest.fixture
def tests():
return [ShellTest('echo hello', 'hello\n', ShellTestSource('', 0)),
ShellTest('echo $?', '0\n', ShellTestSource('', 2))]
def test_run(tests):
r... | <commit_before>import tempfile
import StringIO
import pytest
from shelltest.shelltest import ShellTest, ShellTestSource, ShellTestRunner
@pytest.fixture
def tests():
return [ShellTest('echo hello', 'hello\n', ShellTestSource('', 0)),
ShellTest('echo $?', '0\n', ShellTestSource('', 2))]
def test_ru... |
82f8861df01d67335499682743f69b1763cc3c35 | uberlogs/handlers/kill_process.py | uberlogs/handlers/kill_process.py | import sys
import os
from logging import Handler as LoggingHandler
class KillProcessHandler(LoggingHandler):
def emit(self, record):
if record.levelno != self.level:
return
try:
# flush text before exiting
for fd in [sys.stdout, sys.stderr]:
fd... | import sys
import os
from logging import Handler as LoggingHandler
class KillProcessHandler(LoggingHandler):
def emit(self, record):
if record.levelno != self.level:
return
# flush text before exiting
for fd in [sys.stdout, sys.stderr]:
fd.flush()
# Twist... | Remove redundant try/catch block in kill process handler | Remove redundant try/catch block in kill process handler
| Python | mit | odedlaz/uberlogs,odedlaz/uberlogs | import sys
import os
from logging import Handler as LoggingHandler
class KillProcessHandler(LoggingHandler):
def emit(self, record):
if record.levelno != self.level:
return
try:
# flush text before exiting
for fd in [sys.stdout, sys.stderr]:
fd... | import sys
import os
from logging import Handler as LoggingHandler
class KillProcessHandler(LoggingHandler):
def emit(self, record):
if record.levelno != self.level:
return
# flush text before exiting
for fd in [sys.stdout, sys.stderr]:
fd.flush()
# Twist... | <commit_before>import sys
import os
from logging import Handler as LoggingHandler
class KillProcessHandler(LoggingHandler):
def emit(self, record):
if record.levelno != self.level:
return
try:
# flush text before exiting
for fd in [sys.stdout, sys.stderr]:
... | import sys
import os
from logging import Handler as LoggingHandler
class KillProcessHandler(LoggingHandler):
def emit(self, record):
if record.levelno != self.level:
return
# flush text before exiting
for fd in [sys.stdout, sys.stderr]:
fd.flush()
# Twist... | import sys
import os
from logging import Handler as LoggingHandler
class KillProcessHandler(LoggingHandler):
def emit(self, record):
if record.levelno != self.level:
return
try:
# flush text before exiting
for fd in [sys.stdout, sys.stderr]:
fd... | <commit_before>import sys
import os
from logging import Handler as LoggingHandler
class KillProcessHandler(LoggingHandler):
def emit(self, record):
if record.levelno != self.level:
return
try:
# flush text before exiting
for fd in [sys.stdout, sys.stderr]:
... |
6a531ebe5e097d277a7b07e142e98009d622253f | tests/registryd/test_root_accessible.py | tests/registryd/test_root_accessible.py | # Pytest will pick up this module automatically when running just "pytest".
#
# Each test_*() function gets passed test fixtures, which are defined
# in conftest.py. So, a function "def test_foo(bar)" will get a bar()
# fixture created for it.
PROPERTIES_IFACE = 'org.freedesktop.DBus.Properties'
ACCESSIBLE_IFACE = 'o... | # Pytest will pick up this module automatically when running just "pytest".
#
# Each test_*() function gets passed test fixtures, which are defined
# in conftest.py. So, a function "def test_foo(bar)" will get a bar()
# fixture created for it.
PROPERTIES_IFACE = 'org.freedesktop.DBus.Properties'
ACCESSIBLE_IFACE = 'o... | Put all the Accessibility property tests in a single function | Put all the Accessibility property tests in a single function
We already had machinery for that, anyway.
| Python | lgpl-2.1 | GNOME/at-spi2-core,GNOME/at-spi2-core,GNOME/at-spi2-core | # Pytest will pick up this module automatically when running just "pytest".
#
# Each test_*() function gets passed test fixtures, which are defined
# in conftest.py. So, a function "def test_foo(bar)" will get a bar()
# fixture created for it.
PROPERTIES_IFACE = 'org.freedesktop.DBus.Properties'
ACCESSIBLE_IFACE = 'o... | # Pytest will pick up this module automatically when running just "pytest".
#
# Each test_*() function gets passed test fixtures, which are defined
# in conftest.py. So, a function "def test_foo(bar)" will get a bar()
# fixture created for it.
PROPERTIES_IFACE = 'org.freedesktop.DBus.Properties'
ACCESSIBLE_IFACE = 'o... | <commit_before># Pytest will pick up this module automatically when running just "pytest".
#
# Each test_*() function gets passed test fixtures, which are defined
# in conftest.py. So, a function "def test_foo(bar)" will get a bar()
# fixture created for it.
PROPERTIES_IFACE = 'org.freedesktop.DBus.Properties'
ACCESS... | # Pytest will pick up this module automatically when running just "pytest".
#
# Each test_*() function gets passed test fixtures, which are defined
# in conftest.py. So, a function "def test_foo(bar)" will get a bar()
# fixture created for it.
PROPERTIES_IFACE = 'org.freedesktop.DBus.Properties'
ACCESSIBLE_IFACE = 'o... | # Pytest will pick up this module automatically when running just "pytest".
#
# Each test_*() function gets passed test fixtures, which are defined
# in conftest.py. So, a function "def test_foo(bar)" will get a bar()
# fixture created for it.
PROPERTIES_IFACE = 'org.freedesktop.DBus.Properties'
ACCESSIBLE_IFACE = 'o... | <commit_before># Pytest will pick up this module automatically when running just "pytest".
#
# Each test_*() function gets passed test fixtures, which are defined
# in conftest.py. So, a function "def test_foo(bar)" will get a bar()
# fixture created for it.
PROPERTIES_IFACE = 'org.freedesktop.DBus.Properties'
ACCESS... |
b0e3ed09d401389680db14c6892e84f016423c97 | simplesqlite/error.py | simplesqlite/error.py | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
import sqlite3
from typing import Optional
from tabledata import NameValidationError # noqa: W0611
class DatabaseError(sqlite3.DatabaseError):
"""
Exception raised for errors that are related to the database.
.. seealso::
... | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
import sqlite3
from typing import Optional
from tabledata import NameValidationError # noqa: W0611
class DatabaseError(sqlite3.DatabaseError):
"""
Exception raised for errors that are related to the database.
.. seealso::
... | Modify to pass args to the base class constructor | Modify to pass args to the base class constructor
| Python | mit | thombashi/SimpleSQLite,thombashi/SimpleSQLite | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
import sqlite3
from typing import Optional
from tabledata import NameValidationError # noqa: W0611
class DatabaseError(sqlite3.DatabaseError):
"""
Exception raised for errors that are related to the database.
.. seealso::
... | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
import sqlite3
from typing import Optional
from tabledata import NameValidationError # noqa: W0611
class DatabaseError(sqlite3.DatabaseError):
"""
Exception raised for errors that are related to the database.
.. seealso::
... | <commit_before>"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
import sqlite3
from typing import Optional
from tabledata import NameValidationError # noqa: W0611
class DatabaseError(sqlite3.DatabaseError):
"""
Exception raised for errors that are related to the database.
.. see... | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
import sqlite3
from typing import Optional
from tabledata import NameValidationError # noqa: W0611
class DatabaseError(sqlite3.DatabaseError):
"""
Exception raised for errors that are related to the database.
.. seealso::
... | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
import sqlite3
from typing import Optional
from tabledata import NameValidationError # noqa: W0611
class DatabaseError(sqlite3.DatabaseError):
"""
Exception raised for errors that are related to the database.
.. seealso::
... | <commit_before>"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
import sqlite3
from typing import Optional
from tabledata import NameValidationError # noqa: W0611
class DatabaseError(sqlite3.DatabaseError):
"""
Exception raised for errors that are related to the database.
.. see... |
0d0b470e470ee913cb8983f932323921d405607b | refabric/context_managers.py | refabric/context_managers.py | # coding=utf-8
from contextlib import contextmanager
from fabric.context_managers import settings, hide, prefix
from fabric.state import env
__all__ = ['get_sudo_context', 'sudo', 'only_messages', 'prefix']
@contextmanager
def sudo(user=None):
with settings(sudo_user=user or env.sudo_user or env.user, use_sudo=... | # coding=utf-8
from contextlib import contextmanager
from fabric.context_managers import settings, hide, prefix
from fabric.state import env
__all__ = ['get_sudo_context', 'sudo', 'only_messages', 'prefix']
@contextmanager
def sudo(user=None):
with settings(sudo_user=user or env.sudo_user or env.user, use_sudo=... | Add fine tuning to silent helper | Add fine tuning to silent helper | Python | mit | 5monkeys/refabric | # coding=utf-8
from contextlib import contextmanager
from fabric.context_managers import settings, hide, prefix
from fabric.state import env
__all__ = ['get_sudo_context', 'sudo', 'only_messages', 'prefix']
@contextmanager
def sudo(user=None):
with settings(sudo_user=user or env.sudo_user or env.user, use_sudo=... | # coding=utf-8
from contextlib import contextmanager
from fabric.context_managers import settings, hide, prefix
from fabric.state import env
__all__ = ['get_sudo_context', 'sudo', 'only_messages', 'prefix']
@contextmanager
def sudo(user=None):
with settings(sudo_user=user or env.sudo_user or env.user, use_sudo=... | <commit_before># coding=utf-8
from contextlib import contextmanager
from fabric.context_managers import settings, hide, prefix
from fabric.state import env
__all__ = ['get_sudo_context', 'sudo', 'only_messages', 'prefix']
@contextmanager
def sudo(user=None):
with settings(sudo_user=user or env.sudo_user or env.... | # coding=utf-8
from contextlib import contextmanager
from fabric.context_managers import settings, hide, prefix
from fabric.state import env
__all__ = ['get_sudo_context', 'sudo', 'only_messages', 'prefix']
@contextmanager
def sudo(user=None):
with settings(sudo_user=user or env.sudo_user or env.user, use_sudo=... | # coding=utf-8
from contextlib import contextmanager
from fabric.context_managers import settings, hide, prefix
from fabric.state import env
__all__ = ['get_sudo_context', 'sudo', 'only_messages', 'prefix']
@contextmanager
def sudo(user=None):
with settings(sudo_user=user or env.sudo_user or env.user, use_sudo=... | <commit_before># coding=utf-8
from contextlib import contextmanager
from fabric.context_managers import settings, hide, prefix
from fabric.state import env
__all__ = ['get_sudo_context', 'sudo', 'only_messages', 'prefix']
@contextmanager
def sudo(user=None):
with settings(sudo_user=user or env.sudo_user or env.... |
4aeb85126cf5f75d89cc466c3f7fea2f53702a13 | bluebottle/votes/serializers.py | bluebottle/votes/serializers.py | from bluebottle.votes.models import Vote
from bluebottle.bb_accounts.serializers import UserPreviewSerializer
from rest_framework import serializers
class VoteSerializer(serializers.ModelSerializer):
voter = UserPreviewSerializer(read_only=True)
project = serializers.SlugRelatedField(source='project', slug_fi... | from bluebottle.votes.models import Vote
from bluebottle.bb_accounts.serializers import UserPreviewSerializer
from rest_framework import serializers
class VoteSerializer(serializers.ModelSerializer):
voter = UserPreviewSerializer(read_only=True)
project = serializers.SlugRelatedField(source='project', slug_fi... | Add created to votes api serializer | Add created to votes api serializer
| Python | bsd-3-clause | onepercentclub/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle | from bluebottle.votes.models import Vote
from bluebottle.bb_accounts.serializers import UserPreviewSerializer
from rest_framework import serializers
class VoteSerializer(serializers.ModelSerializer):
voter = UserPreviewSerializer(read_only=True)
project = serializers.SlugRelatedField(source='project', slug_fi... | from bluebottle.votes.models import Vote
from bluebottle.bb_accounts.serializers import UserPreviewSerializer
from rest_framework import serializers
class VoteSerializer(serializers.ModelSerializer):
voter = UserPreviewSerializer(read_only=True)
project = serializers.SlugRelatedField(source='project', slug_fi... | <commit_before>from bluebottle.votes.models import Vote
from bluebottle.bb_accounts.serializers import UserPreviewSerializer
from rest_framework import serializers
class VoteSerializer(serializers.ModelSerializer):
voter = UserPreviewSerializer(read_only=True)
project = serializers.SlugRelatedField(source='pr... | from bluebottle.votes.models import Vote
from bluebottle.bb_accounts.serializers import UserPreviewSerializer
from rest_framework import serializers
class VoteSerializer(serializers.ModelSerializer):
voter = UserPreviewSerializer(read_only=True)
project = serializers.SlugRelatedField(source='project', slug_fi... | from bluebottle.votes.models import Vote
from bluebottle.bb_accounts.serializers import UserPreviewSerializer
from rest_framework import serializers
class VoteSerializer(serializers.ModelSerializer):
voter = UserPreviewSerializer(read_only=True)
project = serializers.SlugRelatedField(source='project', slug_fi... | <commit_before>from bluebottle.votes.models import Vote
from bluebottle.bb_accounts.serializers import UserPreviewSerializer
from rest_framework import serializers
class VoteSerializer(serializers.ModelSerializer):
voter = UserPreviewSerializer(read_only=True)
project = serializers.SlugRelatedField(source='pr... |
8425efaf60b642418786c523d142a370dae3c3a0 | quilt_server/config.py | quilt_server/config.py | # Copyright (c) 2017 Quilt Data, Inc. All rights reserved.
"""
Default config values the Flask app.
Shared between dev, stage, and production.
See `app.config.from_object('...')` in __init__.py.
"""
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ECHO = False # Turn it on for debugging.
PACKAGE_URL_EXPIRATION = ... | # Copyright (c) 2017 Quilt Data, Inc. All rights reserved.
"""
Default config values the Flask app.
Shared between dev, stage, and production.
See `app.config.from_object('...')` in __init__.py.
"""
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ECHO = False # Turn it on for debugging.
PACKAGE_URL_EXPIRATION = ... | Change the S3 URL expiration time from 12 to 24 hours | Change the S3 URL expiration time from 12 to 24 hours
| Python | apache-2.0 | quiltdata/quilt-compiler,quiltdata/quilt-compiler,quiltdata/quilt,quiltdata/quilt-compiler,quiltdata/quilt-compiler,quiltdata/quilt,quiltdata/quilt,quiltdata/quilt,quiltdata/quilt | # Copyright (c) 2017 Quilt Data, Inc. All rights reserved.
"""
Default config values the Flask app.
Shared between dev, stage, and production.
See `app.config.from_object('...')` in __init__.py.
"""
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ECHO = False # Turn it on for debugging.
PACKAGE_URL_EXPIRATION = ... | # Copyright (c) 2017 Quilt Data, Inc. All rights reserved.
"""
Default config values the Flask app.
Shared between dev, stage, and production.
See `app.config.from_object('...')` in __init__.py.
"""
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ECHO = False # Turn it on for debugging.
PACKAGE_URL_EXPIRATION = ... | <commit_before># Copyright (c) 2017 Quilt Data, Inc. All rights reserved.
"""
Default config values the Flask app.
Shared between dev, stage, and production.
See `app.config.from_object('...')` in __init__.py.
"""
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ECHO = False # Turn it on for debugging.
PACKAGE_UR... | # Copyright (c) 2017 Quilt Data, Inc. All rights reserved.
"""
Default config values the Flask app.
Shared between dev, stage, and production.
See `app.config.from_object('...')` in __init__.py.
"""
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ECHO = False # Turn it on for debugging.
PACKAGE_URL_EXPIRATION = ... | # Copyright (c) 2017 Quilt Data, Inc. All rights reserved.
"""
Default config values the Flask app.
Shared between dev, stage, and production.
See `app.config.from_object('...')` in __init__.py.
"""
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ECHO = False # Turn it on for debugging.
PACKAGE_URL_EXPIRATION = ... | <commit_before># Copyright (c) 2017 Quilt Data, Inc. All rights reserved.
"""
Default config values the Flask app.
Shared between dev, stage, and production.
See `app.config.from_object('...')` in __init__.py.
"""
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ECHO = False # Turn it on for debugging.
PACKAGE_UR... |
83036bf711dd5047ef87a56ea9d8def604923882 | ts3observer/features.py | ts3observer/features.py | '''
Created on Nov 10, 2014
@author: fechnert
'''
import logging
class Feature(object):
''' Represents a abstract Feature '''
def __init__(self, config, clients, channels):
''' Initialize the Object '''
self.config = config
self.clients = clients
self.channels = channels
... | '''
Created on Nov 10, 2014
@author: fechnert
'''
import logging
class Feature(object):
''' Represents a abstract Feature '''
def __init__(self, config, clients, channels):
''' Initialize the Object '''
self.config = config
self.clients = clients
self.channels = channels
... | Change Feature classes to match the new config | Change Feature classes to match the new config
| Python | mit | HWDexperte/ts3observer | '''
Created on Nov 10, 2014
@author: fechnert
'''
import logging
class Feature(object):
''' Represents a abstract Feature '''
def __init__(self, config, clients, channels):
''' Initialize the Object '''
self.config = config
self.clients = clients
self.channels = channels
... | '''
Created on Nov 10, 2014
@author: fechnert
'''
import logging
class Feature(object):
''' Represents a abstract Feature '''
def __init__(self, config, clients, channels):
''' Initialize the Object '''
self.config = config
self.clients = clients
self.channels = channels
... | <commit_before>'''
Created on Nov 10, 2014
@author: fechnert
'''
import logging
class Feature(object):
''' Represents a abstract Feature '''
def __init__(self, config, clients, channels):
''' Initialize the Object '''
self.config = config
self.clients = clients
self.channels... | '''
Created on Nov 10, 2014
@author: fechnert
'''
import logging
class Feature(object):
''' Represents a abstract Feature '''
def __init__(self, config, clients, channels):
''' Initialize the Object '''
self.config = config
self.clients = clients
self.channels = channels
... | '''
Created on Nov 10, 2014
@author: fechnert
'''
import logging
class Feature(object):
''' Represents a abstract Feature '''
def __init__(self, config, clients, channels):
''' Initialize the Object '''
self.config = config
self.clients = clients
self.channels = channels
... | <commit_before>'''
Created on Nov 10, 2014
@author: fechnert
'''
import logging
class Feature(object):
''' Represents a abstract Feature '''
def __init__(self, config, clients, channels):
''' Initialize the Object '''
self.config = config
self.clients = clients
self.channels... |
a991d3d66d4a021eb88ad1ff982686f3b930d468 | sqlobject/dberrors.py | sqlobject/dberrors.py | """dberrors: database exception classes for SQLObject.
These classes are dictated by the DB API v2.0:
http://www.python.org/topics/database/DatabaseAPI-2.0.html
"""
import sys
if sys.version_info[0] >= 3:
StandardError = Exception
class Error(StandardError):
pass
class Warning(StandardError):
pa... | """dberrors: database exception classes for SQLObject.
These classes are dictated by the DB API v2.0:
http://www.python.org/topics/database/DatabaseAPI-2.0.html
"""
import sys
if sys.version_info[0] >= 3:
StandardError = Exception
class Error(StandardError):
pass
class Warning(StandardError):
p... | Fix flake8 E302 expected 2 blank lines, found 1 | Fix flake8 E302 expected 2 blank lines, found 1
| Python | lgpl-2.1 | sqlobject/sqlobject,drnlm/sqlobject,sqlobject/sqlobject,drnlm/sqlobject | """dberrors: database exception classes for SQLObject.
These classes are dictated by the DB API v2.0:
http://www.python.org/topics/database/DatabaseAPI-2.0.html
"""
import sys
if sys.version_info[0] >= 3:
StandardError = Exception
class Error(StandardError):
pass
class Warning(StandardError):
pa... | """dberrors: database exception classes for SQLObject.
These classes are dictated by the DB API v2.0:
http://www.python.org/topics/database/DatabaseAPI-2.0.html
"""
import sys
if sys.version_info[0] >= 3:
StandardError = Exception
class Error(StandardError):
pass
class Warning(StandardError):
p... | <commit_before>"""dberrors: database exception classes for SQLObject.
These classes are dictated by the DB API v2.0:
http://www.python.org/topics/database/DatabaseAPI-2.0.html
"""
import sys
if sys.version_info[0] >= 3:
StandardError = Exception
class Error(StandardError):
pass
class Warning(Standar... | """dberrors: database exception classes for SQLObject.
These classes are dictated by the DB API v2.0:
http://www.python.org/topics/database/DatabaseAPI-2.0.html
"""
import sys
if sys.version_info[0] >= 3:
StandardError = Exception
class Error(StandardError):
pass
class Warning(StandardError):
p... | """dberrors: database exception classes for SQLObject.
These classes are dictated by the DB API v2.0:
http://www.python.org/topics/database/DatabaseAPI-2.0.html
"""
import sys
if sys.version_info[0] >= 3:
StandardError = Exception
class Error(StandardError):
pass
class Warning(StandardError):
pa... | <commit_before>"""dberrors: database exception classes for SQLObject.
These classes are dictated by the DB API v2.0:
http://www.python.org/topics/database/DatabaseAPI-2.0.html
"""
import sys
if sys.version_info[0] >= 3:
StandardError = Exception
class Error(StandardError):
pass
class Warning(Standar... |
aa1bbbe1d4b463be8cedaaf445fa44612592513f | minette/test/helper.py | minette/test/helper.py | from time import time
from ..core import Minette
from ..models import Message
class MinetteForTest(Minette):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.default_channel = kwargs.get("default_channel", "")
self.case_id = str(int(time() * 10000000))
def chat(self, req... | from time import time
from ..core import Minette
from ..models import Message
class MinetteForTest(Minette):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.default_channel = kwargs.get("default_channel", "")
self.case_id = str(int(time() * 10000000))
def chat(self, req... | Add `text` attribute to response from `chat` | Add `text` attribute to response from `chat`
| Python | apache-2.0 | uezo/minette-python | from time import time
from ..core import Minette
from ..models import Message
class MinetteForTest(Minette):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.default_channel = kwargs.get("default_channel", "")
self.case_id = str(int(time() * 10000000))
def chat(self, req... | from time import time
from ..core import Minette
from ..models import Message
class MinetteForTest(Minette):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.default_channel = kwargs.get("default_channel", "")
self.case_id = str(int(time() * 10000000))
def chat(self, req... | <commit_before>from time import time
from ..core import Minette
from ..models import Message
class MinetteForTest(Minette):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.default_channel = kwargs.get("default_channel", "")
self.case_id = str(int(time() * 10000000))
def... | from time import time
from ..core import Minette
from ..models import Message
class MinetteForTest(Minette):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.default_channel = kwargs.get("default_channel", "")
self.case_id = str(int(time() * 10000000))
def chat(self, req... | from time import time
from ..core import Minette
from ..models import Message
class MinetteForTest(Minette):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.default_channel = kwargs.get("default_channel", "")
self.case_id = str(int(time() * 10000000))
def chat(self, req... | <commit_before>from time import time
from ..core import Minette
from ..models import Message
class MinetteForTest(Minette):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.default_channel = kwargs.get("default_channel", "")
self.case_id = str(int(time() * 10000000))
def... |
1d043a9fa2140992435bc5d6583601464d96f5b0 | wafer/schedule/renderers.py | wafer/schedule/renderers.py | from django_medusa.renderers import StaticSiteRenderer
class ScheduleRenderer(StaticSiteRenderer):
def get_paths(self):
paths = ["/schedule/", ]
return paths
renderers = [ScheduleRenderer, ]
| from django_medusa.renderers import StaticSiteRenderer
from wafer.schedule.models import Venue
class ScheduleRenderer(StaticSiteRenderer):
def get_paths(self):
paths = ["/schedule/", ]
# Add the venues
items = Venue.objects.all()
for item in items:
paths.append(item.ge... | Add venues to site export | Add venues to site export
| Python | isc | CarlFK/wafer,CarlFK/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CarlFK/wafer,CarlFK/wafer | from django_medusa.renderers import StaticSiteRenderer
class ScheduleRenderer(StaticSiteRenderer):
def get_paths(self):
paths = ["/schedule/", ]
return paths
renderers = [ScheduleRenderer, ]
Add venues to site export | from django_medusa.renderers import StaticSiteRenderer
from wafer.schedule.models import Venue
class ScheduleRenderer(StaticSiteRenderer):
def get_paths(self):
paths = ["/schedule/", ]
# Add the venues
items = Venue.objects.all()
for item in items:
paths.append(item.ge... | <commit_before>from django_medusa.renderers import StaticSiteRenderer
class ScheduleRenderer(StaticSiteRenderer):
def get_paths(self):
paths = ["/schedule/", ]
return paths
renderers = [ScheduleRenderer, ]
<commit_msg>Add venues to site export<commit_after> | from django_medusa.renderers import StaticSiteRenderer
from wafer.schedule.models import Venue
class ScheduleRenderer(StaticSiteRenderer):
def get_paths(self):
paths = ["/schedule/", ]
# Add the venues
items = Venue.objects.all()
for item in items:
paths.append(item.ge... | from django_medusa.renderers import StaticSiteRenderer
class ScheduleRenderer(StaticSiteRenderer):
def get_paths(self):
paths = ["/schedule/", ]
return paths
renderers = [ScheduleRenderer, ]
Add venues to site exportfrom django_medusa.renderers import StaticSiteRenderer
from wafer.schedule.models... | <commit_before>from django_medusa.renderers import StaticSiteRenderer
class ScheduleRenderer(StaticSiteRenderer):
def get_paths(self):
paths = ["/schedule/", ]
return paths
renderers = [ScheduleRenderer, ]
<commit_msg>Add venues to site export<commit_after>from django_medusa.renderers import Stat... |
93474c192516864b2c609f2225a0f6c1fa8ca9a8 | Cauldron/ext/commandkeywords/__init__.py | Cauldron/ext/commandkeywords/__init__.py | # -*- coding: utf-8 -*-
"""
An extension for a command-based keyword.
"""
from __future__ import absolute_import
from Cauldron.types import Boolean, DispatcherKeywordType
from Cauldron.exc import NoWriteNecessary
class CommandKeyword(Boolean, DispatcherKeywordType):
"""This keyword will receive boolean writes as ... | # -*- coding: utf-8 -*-
"""
An extension for a command-based keyword.
"""
from __future__ import absolute_import
from Cauldron.types import Boolean, DispatcherKeywordType
from Cauldron.exc import NoWriteNecessary
from Cauldron.utils.callbacks import Callbacks
class CommandKeyword(Boolean, DispatcherKeywordType):
... | Make command-keyword compatible with DFW implementation | Make command-keyword compatible with DFW implementation
| Python | bsd-3-clause | alexrudy/Cauldron | # -*- coding: utf-8 -*-
"""
An extension for a command-based keyword.
"""
from __future__ import absolute_import
from Cauldron.types import Boolean, DispatcherKeywordType
from Cauldron.exc import NoWriteNecessary
class CommandKeyword(Boolean, DispatcherKeywordType):
"""This keyword will receive boolean writes as ... | # -*- coding: utf-8 -*-
"""
An extension for a command-based keyword.
"""
from __future__ import absolute_import
from Cauldron.types import Boolean, DispatcherKeywordType
from Cauldron.exc import NoWriteNecessary
from Cauldron.utils.callbacks import Callbacks
class CommandKeyword(Boolean, DispatcherKeywordType):
... | <commit_before># -*- coding: utf-8 -*-
"""
An extension for a command-based keyword.
"""
from __future__ import absolute_import
from Cauldron.types import Boolean, DispatcherKeywordType
from Cauldron.exc import NoWriteNecessary
class CommandKeyword(Boolean, DispatcherKeywordType):
"""This keyword will receive boo... | # -*- coding: utf-8 -*-
"""
An extension for a command-based keyword.
"""
from __future__ import absolute_import
from Cauldron.types import Boolean, DispatcherKeywordType
from Cauldron.exc import NoWriteNecessary
from Cauldron.utils.callbacks import Callbacks
class CommandKeyword(Boolean, DispatcherKeywordType):
... | # -*- coding: utf-8 -*-
"""
An extension for a command-based keyword.
"""
from __future__ import absolute_import
from Cauldron.types import Boolean, DispatcherKeywordType
from Cauldron.exc import NoWriteNecessary
class CommandKeyword(Boolean, DispatcherKeywordType):
"""This keyword will receive boolean writes as ... | <commit_before># -*- coding: utf-8 -*-
"""
An extension for a command-based keyword.
"""
from __future__ import absolute_import
from Cauldron.types import Boolean, DispatcherKeywordType
from Cauldron.exc import NoWriteNecessary
class CommandKeyword(Boolean, DispatcherKeywordType):
"""This keyword will receive boo... |
6cf2a3966e12af5f86781a5d20c0810953722811 | tests/basics/scope.py | tests/basics/scope.py | # test scoping rules
# explicit global variable
a = 1
def f():
global a
global a, a # should be able to redefine as global
a = 2
f()
print(a)
# explicit nonlocal variable
def f():
a = 1
def g():
nonlocal a
nonlocal a, a # should be able to redefine as nonlocal
a = 2
g()... | # test scoping rules
# explicit global variable
a = 1
def f():
global a
global a, a # should be able to redefine as global
a = 2
f()
print(a)
# explicit nonlocal variable
def f():
a = 1
def g():
nonlocal a
nonlocal a, a # should be able to redefine as nonlocal
a = 2
g()... | Add further tests for nonlocal scoping and closures. | tests/basics: Add further tests for nonlocal scoping and closures.
| Python | mit | lowRISC/micropython,ryannathans/micropython,tralamazza/micropython,micropython/micropython-esp32,cwyark/micropython,deshipu/micropython,lowRISC/micropython,alex-march/micropython,adafruit/micropython,Peetz0r/micropython-esp32,SHA2017-badge/micropython-esp32,turbinenreiter/micropython,deshipu/micropython,ryannathans/mic... | # test scoping rules
# explicit global variable
a = 1
def f():
global a
global a, a # should be able to redefine as global
a = 2
f()
print(a)
# explicit nonlocal variable
def f():
a = 1
def g():
nonlocal a
nonlocal a, a # should be able to redefine as nonlocal
a = 2
g()... | # test scoping rules
# explicit global variable
a = 1
def f():
global a
global a, a # should be able to redefine as global
a = 2
f()
print(a)
# explicit nonlocal variable
def f():
a = 1
def g():
nonlocal a
nonlocal a, a # should be able to redefine as nonlocal
a = 2
g()... | <commit_before># test scoping rules
# explicit global variable
a = 1
def f():
global a
global a, a # should be able to redefine as global
a = 2
f()
print(a)
# explicit nonlocal variable
def f():
a = 1
def g():
nonlocal a
nonlocal a, a # should be able to redefine as nonlocal
... | # test scoping rules
# explicit global variable
a = 1
def f():
global a
global a, a # should be able to redefine as global
a = 2
f()
print(a)
# explicit nonlocal variable
def f():
a = 1
def g():
nonlocal a
nonlocal a, a # should be able to redefine as nonlocal
a = 2
g()... | # test scoping rules
# explicit global variable
a = 1
def f():
global a
global a, a # should be able to redefine as global
a = 2
f()
print(a)
# explicit nonlocal variable
def f():
a = 1
def g():
nonlocal a
nonlocal a, a # should be able to redefine as nonlocal
a = 2
g()... | <commit_before># test scoping rules
# explicit global variable
a = 1
def f():
global a
global a, a # should be able to redefine as global
a = 2
f()
print(a)
# explicit nonlocal variable
def f():
a = 1
def g():
nonlocal a
nonlocal a, a # should be able to redefine as nonlocal
... |
63ee6f971b99c2f030e0347c37bc9577ba9ee7cd | getMenu.py | getMenu.py | #!/usr/bin/env python
import json, os, requests
from awsauth import S3Auth
key = os.environ.get('UWOPENDATA_APIKEY')
service = 'FoodMenu'
# output = 'json'
# callback = 'None'
request = 'http://api.uwaterloo.ca/public/v1/'
def getMenu():
url = request + '?' + 'key=' + key + '&' + 'service=' + service
r = requests... | #!/usr/bin/env python
import json, os, requests
from awsauth import S3Auth
key = os.environ.get('UWOPENDATA_APIKEY')
service = 'FoodMenu'
def getMenu():
payload = {'key': key, 'service': service}
r = requests.get('http://api.uwaterloo.ca/public/v1/', params=payload)
return r.text
menu = getMenu()
ACCESS_KEY = os.... | Allow requests module to correctly encode query parameters. | Allow requests module to correctly encode query parameters.
| Python | mit | alykhank/FoodMenu,alykhank/FoodMenu,alykhank/FoodMenu | #!/usr/bin/env python
import json, os, requests
from awsauth import S3Auth
key = os.environ.get('UWOPENDATA_APIKEY')
service = 'FoodMenu'
# output = 'json'
# callback = 'None'
request = 'http://api.uwaterloo.ca/public/v1/'
def getMenu():
url = request + '?' + 'key=' + key + '&' + 'service=' + service
r = requests... | #!/usr/bin/env python
import json, os, requests
from awsauth import S3Auth
key = os.environ.get('UWOPENDATA_APIKEY')
service = 'FoodMenu'
def getMenu():
payload = {'key': key, 'service': service}
r = requests.get('http://api.uwaterloo.ca/public/v1/', params=payload)
return r.text
menu = getMenu()
ACCESS_KEY = os.... | <commit_before>#!/usr/bin/env python
import json, os, requests
from awsauth import S3Auth
key = os.environ.get('UWOPENDATA_APIKEY')
service = 'FoodMenu'
# output = 'json'
# callback = 'None'
request = 'http://api.uwaterloo.ca/public/v1/'
def getMenu():
url = request + '?' + 'key=' + key + '&' + 'service=' + servic... | #!/usr/bin/env python
import json, os, requests
from awsauth import S3Auth
key = os.environ.get('UWOPENDATA_APIKEY')
service = 'FoodMenu'
def getMenu():
payload = {'key': key, 'service': service}
r = requests.get('http://api.uwaterloo.ca/public/v1/', params=payload)
return r.text
menu = getMenu()
ACCESS_KEY = os.... | #!/usr/bin/env python
import json, os, requests
from awsauth import S3Auth
key = os.environ.get('UWOPENDATA_APIKEY')
service = 'FoodMenu'
# output = 'json'
# callback = 'None'
request = 'http://api.uwaterloo.ca/public/v1/'
def getMenu():
url = request + '?' + 'key=' + key + '&' + 'service=' + service
r = requests... | <commit_before>#!/usr/bin/env python
import json, os, requests
from awsauth import S3Auth
key = os.environ.get('UWOPENDATA_APIKEY')
service = 'FoodMenu'
# output = 'json'
# callback = 'None'
request = 'http://api.uwaterloo.ca/public/v1/'
def getMenu():
url = request + '?' + 'key=' + key + '&' + 'service=' + servic... |
98a05257eaf4ca6555ffc179a9250a7cfb3a903c | scripts/lib/check-database-compatibility.py | scripts/lib/check-database-compatibility.py | #!/usr/bin/env python3
import logging
import os
import sys
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.insert(0, ZULIP_PATH)
from scripts.lib.setup_path import setup_path
from scripts.lib.zulip_tools import DEPLOYMENTS_DIR, assert_not_running_as_root, parse_versio... | #!/usr/bin/env python3
import logging
import os
import sys
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.insert(0, ZULIP_PATH)
from scripts.lib.setup_path import setup_path
from scripts.lib.zulip_tools import DEPLOYMENTS_DIR, assert_not_running_as_root, parse_versio... | Print names of missing migrations in compatibility check. | scripts: Print names of missing migrations in compatibility check.
This will make it much easier to debug any situations where this
happens.
| Python | apache-2.0 | rht/zulip,rht/zulip,rht/zulip,andersk/zulip,zulip/zulip,zulip/zulip,andersk/zulip,kou/zulip,andersk/zulip,kou/zulip,zulip/zulip,rht/zulip,kou/zulip,andersk/zulip,rht/zulip,kou/zulip,andersk/zulip,rht/zulip,zulip/zulip,kou/zulip,kou/zulip,zulip/zulip,kou/zulip,andersk/zulip,zulip/zulip,andersk/zulip,rht/zulip,zulip/zuli... | #!/usr/bin/env python3
import logging
import os
import sys
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.insert(0, ZULIP_PATH)
from scripts.lib.setup_path import setup_path
from scripts.lib.zulip_tools import DEPLOYMENTS_DIR, assert_not_running_as_root, parse_versio... | #!/usr/bin/env python3
import logging
import os
import sys
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.insert(0, ZULIP_PATH)
from scripts.lib.setup_path import setup_path
from scripts.lib.zulip_tools import DEPLOYMENTS_DIR, assert_not_running_as_root, parse_versio... | <commit_before>#!/usr/bin/env python3
import logging
import os
import sys
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.insert(0, ZULIP_PATH)
from scripts.lib.setup_path import setup_path
from scripts.lib.zulip_tools import DEPLOYMENTS_DIR, assert_not_running_as_roo... | #!/usr/bin/env python3
import logging
import os
import sys
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.insert(0, ZULIP_PATH)
from scripts.lib.setup_path import setup_path
from scripts.lib.zulip_tools import DEPLOYMENTS_DIR, assert_not_running_as_root, parse_versio... | #!/usr/bin/env python3
import logging
import os
import sys
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.insert(0, ZULIP_PATH)
from scripts.lib.setup_path import setup_path
from scripts.lib.zulip_tools import DEPLOYMENTS_DIR, assert_not_running_as_root, parse_versio... | <commit_before>#!/usr/bin/env python3
import logging
import os
import sys
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.insert(0, ZULIP_PATH)
from scripts.lib.setup_path import setup_path
from scripts.lib.zulip_tools import DEPLOYMENTS_DIR, assert_not_running_as_roo... |
cbafc968343cd2b001bcee354d418c9886fe94b4 | tests/test_network.py | tests/test_network.py | from nose.tools import eq_, ok_
import unittest
import openxc.measurements
from openxc.sources import NetworkDataSource
from openxc.sources import DataSourceError
class NetworkDataSourceTests(unittest.TestCase):
def setUp(self):
super(NetworkDataSourceTests, self).setUp()
def test_create(self):
... | from nose.tools import eq_, ok_
import unittest
import openxc.measurements
from openxc.sources import NetworkDataSource
from openxc.sources import DataSourceError
class NetworkDataSourceTests(unittest.TestCase):
def setUp(self):
super(NetworkDataSourceTests, self).setUp()
def test_create(self):
... | Use localhost for network source tests to avoid waiting for DNS. | Use localhost for network source tests to avoid waiting for DNS.
| Python | bsd-3-clause | openxc/openxc-python,openxc/openxc-python,openxc/openxc-python | from nose.tools import eq_, ok_
import unittest
import openxc.measurements
from openxc.sources import NetworkDataSource
from openxc.sources import DataSourceError
class NetworkDataSourceTests(unittest.TestCase):
def setUp(self):
super(NetworkDataSourceTests, self).setUp()
def test_create(self):
... | from nose.tools import eq_, ok_
import unittest
import openxc.measurements
from openxc.sources import NetworkDataSource
from openxc.sources import DataSourceError
class NetworkDataSourceTests(unittest.TestCase):
def setUp(self):
super(NetworkDataSourceTests, self).setUp()
def test_create(self):
... | <commit_before>from nose.tools import eq_, ok_
import unittest
import openxc.measurements
from openxc.sources import NetworkDataSource
from openxc.sources import DataSourceError
class NetworkDataSourceTests(unittest.TestCase):
def setUp(self):
super(NetworkDataSourceTests, self).setUp()
def test_crea... | from nose.tools import eq_, ok_
import unittest
import openxc.measurements
from openxc.sources import NetworkDataSource
from openxc.sources import DataSourceError
class NetworkDataSourceTests(unittest.TestCase):
def setUp(self):
super(NetworkDataSourceTests, self).setUp()
def test_create(self):
... | from nose.tools import eq_, ok_
import unittest
import openxc.measurements
from openxc.sources import NetworkDataSource
from openxc.sources import DataSourceError
class NetworkDataSourceTests(unittest.TestCase):
def setUp(self):
super(NetworkDataSourceTests, self).setUp()
def test_create(self):
... | <commit_before>from nose.tools import eq_, ok_
import unittest
import openxc.measurements
from openxc.sources import NetworkDataSource
from openxc.sources import DataSourceError
class NetworkDataSourceTests(unittest.TestCase):
def setUp(self):
super(NetworkDataSourceTests, self).setUp()
def test_crea... |
86d12c7d13bd7a11a93deccf42f93df4328e70fd | admin_honeypot/urls.py | admin_honeypot/urls.py | from admin_honeypot import views
from django.conf.urls import url
app_name = 'admin_honeypot'
urlpatterns = [
url(r'^login/$', views.AdminHoneypot.as_view(), name='login'),
url(r'^.*$', views.AdminHoneypot.as_view(), name='index'),
]
| from admin_honeypot import views
from django.urls import path, re_path
app_name = 'admin_honeypot'
urlpatterns = [
path('login/', views.AdminHoneypot.as_view(), name='login'),
re_path(r'^.*$', views.AdminHoneypot.as_view(), name='index'),
]
| Update url() to path() in the urlconf. | Update url() to path() in the urlconf.
| Python | mit | dmpayton/django-admin-honeypot,dmpayton/django-admin-honeypot | from admin_honeypot import views
from django.conf.urls import url
app_name = 'admin_honeypot'
urlpatterns = [
url(r'^login/$', views.AdminHoneypot.as_view(), name='login'),
url(r'^.*$', views.AdminHoneypot.as_view(), name='index'),
]
Update url() to path() in the urlconf. | from admin_honeypot import views
from django.urls import path, re_path
app_name = 'admin_honeypot'
urlpatterns = [
path('login/', views.AdminHoneypot.as_view(), name='login'),
re_path(r'^.*$', views.AdminHoneypot.as_view(), name='index'),
]
| <commit_before>from admin_honeypot import views
from django.conf.urls import url
app_name = 'admin_honeypot'
urlpatterns = [
url(r'^login/$', views.AdminHoneypot.as_view(), name='login'),
url(r'^.*$', views.AdminHoneypot.as_view(), name='index'),
]
<commit_msg>Update url() to path() in the urlconf.<commit_aft... | from admin_honeypot import views
from django.urls import path, re_path
app_name = 'admin_honeypot'
urlpatterns = [
path('login/', views.AdminHoneypot.as_view(), name='login'),
re_path(r'^.*$', views.AdminHoneypot.as_view(), name='index'),
]
| from admin_honeypot import views
from django.conf.urls import url
app_name = 'admin_honeypot'
urlpatterns = [
url(r'^login/$', views.AdminHoneypot.as_view(), name='login'),
url(r'^.*$', views.AdminHoneypot.as_view(), name='index'),
]
Update url() to path() in the urlconf.from admin_honeypot import views
from ... | <commit_before>from admin_honeypot import views
from django.conf.urls import url
app_name = 'admin_honeypot'
urlpatterns = [
url(r'^login/$', views.AdminHoneypot.as_view(), name='login'),
url(r'^.*$', views.AdminHoneypot.as_view(), name='index'),
]
<commit_msg>Update url() to path() in the urlconf.<commit_aft... |
1726a73b81c8a7dfc3610690fe9272776e930f0f | aero/adapters/bower.py | aero/adapters/bower.py | # -*- coding: utf-8 -*-
__author__ = 'oliveiraev'
__all__ = ['Bower']
from re import sub
from re import split
from aero.__version__ import enc
from .base import BaseAdapter
class Bower(BaseAdapter):
"""
Twitter Bower - Browser package manager - Adapter
"""
def search(self, query):
return {}
... | # -*- coding: utf-8 -*-
__author__ = 'oliveiraev'
__all__ = ['Bower']
from re import sub
from re import split
from aero.__version__ import enc
from .base import BaseAdapter
class Bower(BaseAdapter):
"""
Twitter Bower - Browser package manager - Adapter
"""
def search(self, query):
response = ... | Simplify return while we're at it | Simplify return while we're at it
| Python | bsd-3-clause | Aeronautics/aero | # -*- coding: utf-8 -*-
__author__ = 'oliveiraev'
__all__ = ['Bower']
from re import sub
from re import split
from aero.__version__ import enc
from .base import BaseAdapter
class Bower(BaseAdapter):
"""
Twitter Bower - Browser package manager - Adapter
"""
def search(self, query):
return {}
... | # -*- coding: utf-8 -*-
__author__ = 'oliveiraev'
__all__ = ['Bower']
from re import sub
from re import split
from aero.__version__ import enc
from .base import BaseAdapter
class Bower(BaseAdapter):
"""
Twitter Bower - Browser package manager - Adapter
"""
def search(self, query):
response = ... | <commit_before># -*- coding: utf-8 -*-
__author__ = 'oliveiraev'
__all__ = ['Bower']
from re import sub
from re import split
from aero.__version__ import enc
from .base import BaseAdapter
class Bower(BaseAdapter):
"""
Twitter Bower - Browser package manager - Adapter
"""
def search(self, query):
... | # -*- coding: utf-8 -*-
__author__ = 'oliveiraev'
__all__ = ['Bower']
from re import sub
from re import split
from aero.__version__ import enc
from .base import BaseAdapter
class Bower(BaseAdapter):
"""
Twitter Bower - Browser package manager - Adapter
"""
def search(self, query):
response = ... | # -*- coding: utf-8 -*-
__author__ = 'oliveiraev'
__all__ = ['Bower']
from re import sub
from re import split
from aero.__version__ import enc
from .base import BaseAdapter
class Bower(BaseAdapter):
"""
Twitter Bower - Browser package manager - Adapter
"""
def search(self, query):
return {}
... | <commit_before># -*- coding: utf-8 -*-
__author__ = 'oliveiraev'
__all__ = ['Bower']
from re import sub
from re import split
from aero.__version__ import enc
from .base import BaseAdapter
class Bower(BaseAdapter):
"""
Twitter Bower - Browser package manager - Adapter
"""
def search(self, query):
... |
19964dc65cecbbb043da3fe85bf355423cf9ce3c | shop/products/admin/forms.py | shop/products/admin/forms.py |
from django.apps import apps
from django import forms
from suit.sortables import SortableTabularInline
from multiupload.fields import MultiFileField
class ProductForm(forms.ModelForm):
images = MultiFileField(max_num=100, min_num=1, required=False)
class Meta:
model = apps.get_model('products', '... |
from django.apps import apps
from django import forms
from suit.sortables import SortableTabularInline
from multiupload.fields import MultiFileField
class ProductForm(forms.ModelForm):
images = MultiFileField(max_num=100, min_num=1, required=False)
def save(self, commit=True):
product = super(Pro... | Clear attr values on category change. | Clear attr values on category change.
| Python | isc | pmaigutyak/mp-shop,pmaigutyak/mp-shop,pmaigutyak/mp-shop |
from django.apps import apps
from django import forms
from suit.sortables import SortableTabularInline
from multiupload.fields import MultiFileField
class ProductForm(forms.ModelForm):
images = MultiFileField(max_num=100, min_num=1, required=False)
class Meta:
model = apps.get_model('products', '... |
from django.apps import apps
from django import forms
from suit.sortables import SortableTabularInline
from multiupload.fields import MultiFileField
class ProductForm(forms.ModelForm):
images = MultiFileField(max_num=100, min_num=1, required=False)
def save(self, commit=True):
product = super(Pro... | <commit_before>
from django.apps import apps
from django import forms
from suit.sortables import SortableTabularInline
from multiupload.fields import MultiFileField
class ProductForm(forms.ModelForm):
images = MultiFileField(max_num=100, min_num=1, required=False)
class Meta:
model = apps.get_mode... |
from django.apps import apps
from django import forms
from suit.sortables import SortableTabularInline
from multiupload.fields import MultiFileField
class ProductForm(forms.ModelForm):
images = MultiFileField(max_num=100, min_num=1, required=False)
def save(self, commit=True):
product = super(Pro... |
from django.apps import apps
from django import forms
from suit.sortables import SortableTabularInline
from multiupload.fields import MultiFileField
class ProductForm(forms.ModelForm):
images = MultiFileField(max_num=100, min_num=1, required=False)
class Meta:
model = apps.get_model('products', '... | <commit_before>
from django.apps import apps
from django import forms
from suit.sortables import SortableTabularInline
from multiupload.fields import MultiFileField
class ProductForm(forms.ModelForm):
images = MultiFileField(max_num=100, min_num=1, required=False)
class Meta:
model = apps.get_mode... |
bd7c6e22146604183412657e68457db7ae7766ed | script/jsonify-book.py | script/jsonify-book.py | import sys
from glob import glob
from os.path import basename
import json
book_dir, out_dir = sys.argv[1:3]
files = [basename(x).rstrip(".xhtml") for x in glob(f"{book_dir}/*.xhtml")]
json_data = {}
for path in files:
with open(f"{book_dir}/{path}.xhtml", "r") as book_part:
content = book_part.read()
... | import sys
from glob import glob
from os.path import basename
import json
book_dir, out_dir = sys.argv[1:3]
files = [basename(x).rstrip(".xhtml") for x in glob(f"{book_dir}/*.xhtml")]
json_data = {}
for path in files:
with open(f"{book_dir}/{path}.json", "r") as meta_part:
json_data = json.load(meta_par... | Add metadata to jsonify output | Add metadata to jsonify output
| Python | lgpl-2.1 | Connexions/cte,Connexions/cnx-recipes,Connexions/cnx-rulesets,Connexions/cnx-recipes,Connexions/cnx-rulesets,Connexions/cnx-rulesets,Connexions/cnx-rulesets,Connexions/cnx-recipes,Connexions/cnx-recipes,Connexions/cte,Connexions/cnx-recipes | import sys
from glob import glob
from os.path import basename
import json
book_dir, out_dir = sys.argv[1:3]
files = [basename(x).rstrip(".xhtml") for x in glob(f"{book_dir}/*.xhtml")]
json_data = {}
for path in files:
with open(f"{book_dir}/{path}.xhtml", "r") as book_part:
content = book_part.read()
... | import sys
from glob import glob
from os.path import basename
import json
book_dir, out_dir = sys.argv[1:3]
files = [basename(x).rstrip(".xhtml") for x in glob(f"{book_dir}/*.xhtml")]
json_data = {}
for path in files:
with open(f"{book_dir}/{path}.json", "r") as meta_part:
json_data = json.load(meta_par... | <commit_before>import sys
from glob import glob
from os.path import basename
import json
book_dir, out_dir = sys.argv[1:3]
files = [basename(x).rstrip(".xhtml") for x in glob(f"{book_dir}/*.xhtml")]
json_data = {}
for path in files:
with open(f"{book_dir}/{path}.xhtml", "r") as book_part:
content = book... | import sys
from glob import glob
from os.path import basename
import json
book_dir, out_dir = sys.argv[1:3]
files = [basename(x).rstrip(".xhtml") for x in glob(f"{book_dir}/*.xhtml")]
json_data = {}
for path in files:
with open(f"{book_dir}/{path}.json", "r") as meta_part:
json_data = json.load(meta_par... | import sys
from glob import glob
from os.path import basename
import json
book_dir, out_dir = sys.argv[1:3]
files = [basename(x).rstrip(".xhtml") for x in glob(f"{book_dir}/*.xhtml")]
json_data = {}
for path in files:
with open(f"{book_dir}/{path}.xhtml", "r") as book_part:
content = book_part.read()
... | <commit_before>import sys
from glob import glob
from os.path import basename
import json
book_dir, out_dir = sys.argv[1:3]
files = [basename(x).rstrip(".xhtml") for x in glob(f"{book_dir}/*.xhtml")]
json_data = {}
for path in files:
with open(f"{book_dir}/{path}.xhtml", "r") as book_part:
content = book... |
b9e3485030ef7acf5b3d312b8e9d9fc54367eded | tests/ext/argcomplete_tests.py | tests/ext/argcomplete_tests.py | """Tests for cement.ext.ext_argcomplete."""
import os
from cement.ext import ext_argcomplete
from cement.ext.ext_argparse import ArgparseController, expose
from cement.utils import test
from cement.utils.misc import rando
APP = rando()[:12]
class MyBaseController(ArgparseController):
class Meta:
label = ... | """Tests for cement.ext.ext_argcomplete."""
import os
from cement.ext import ext_argcomplete
from cement.ext.ext_argparse import ArgparseController, expose
from cement.utils import test
from cement.utils.misc import rando
APP = rando()[:12]
class MyBaseController(ArgparseController):
class Meta:
label = ... | Fix Argcomplete Tests on Python <3.2 | Fix Argcomplete Tests on Python <3.2
| Python | bsd-3-clause | akhilman/cement,fxstein/cement,datafolklabs/cement,akhilman/cement,akhilman/cement,fxstein/cement,fxstein/cement,datafolklabs/cement,datafolklabs/cement | """Tests for cement.ext.ext_argcomplete."""
import os
from cement.ext import ext_argcomplete
from cement.ext.ext_argparse import ArgparseController, expose
from cement.utils import test
from cement.utils.misc import rando
APP = rando()[:12]
class MyBaseController(ArgparseController):
class Meta:
label = ... | """Tests for cement.ext.ext_argcomplete."""
import os
from cement.ext import ext_argcomplete
from cement.ext.ext_argparse import ArgparseController, expose
from cement.utils import test
from cement.utils.misc import rando
APP = rando()[:12]
class MyBaseController(ArgparseController):
class Meta:
label = ... | <commit_before>"""Tests for cement.ext.ext_argcomplete."""
import os
from cement.ext import ext_argcomplete
from cement.ext.ext_argparse import ArgparseController, expose
from cement.utils import test
from cement.utils.misc import rando
APP = rando()[:12]
class MyBaseController(ArgparseController):
class Meta:
... | """Tests for cement.ext.ext_argcomplete."""
import os
from cement.ext import ext_argcomplete
from cement.ext.ext_argparse import ArgparseController, expose
from cement.utils import test
from cement.utils.misc import rando
APP = rando()[:12]
class MyBaseController(ArgparseController):
class Meta:
label = ... | """Tests for cement.ext.ext_argcomplete."""
import os
from cement.ext import ext_argcomplete
from cement.ext.ext_argparse import ArgparseController, expose
from cement.utils import test
from cement.utils.misc import rando
APP = rando()[:12]
class MyBaseController(ArgparseController):
class Meta:
label = ... | <commit_before>"""Tests for cement.ext.ext_argcomplete."""
import os
from cement.ext import ext_argcomplete
from cement.ext.ext_argparse import ArgparseController, expose
from cement.utils import test
from cement.utils.misc import rando
APP = rando()[:12]
class MyBaseController(ArgparseController):
class Meta:
... |
11b16c26c182636016e7d86cd0f94963eec42556 | project/settings/ci.py | project/settings/ci.py | # Local
from .base import *
# JWT Settings
def jwt_get_username_from_payload_handler(payload):
return payload.get('email')
JWT_AUTH = {
# 'JWT_SECRET_KEY': AUTH0_CLIENT_SECRET,
'JWT_AUDIENCE': AUTH0_CLIENT_ID,
'JWT_PAYLOAD_GET_USERNAME_HANDLER': jwt_get_username_from_payload_handler,
'JWT_AUTH_HE... | # Local
from .base import *
# JWT Settings
def jwt_get_username_from_payload_handler(payload):
return payload.get('email')
JWT_AUTH = {
# 'JWT_SECRET_KEY': AUTH0_CLIENT_SECRET,
'JWT_AUDIENCE': AUTH0_CLIENT_ID,
'JWT_PAYLOAD_GET_USERNAME_HANDLER': jwt_get_username_from_payload_handler,
'JWT_AUTH_HE... | Revert "Attempt to bypass test database" | Revert "Attempt to bypass test database"
This reverts commit 889713c8c4c7151ba06448a3993778a91d2abfd6.
| Python | bsd-2-clause | barberscore/barberscore-api,dbinetti/barberscore-django,dbinetti/barberscore-django,barberscore/barberscore-api,barberscore/barberscore-api,dbinetti/barberscore,barberscore/barberscore-api,dbinetti/barberscore | # Local
from .base import *
# JWT Settings
def jwt_get_username_from_payload_handler(payload):
return payload.get('email')
JWT_AUTH = {
# 'JWT_SECRET_KEY': AUTH0_CLIENT_SECRET,
'JWT_AUDIENCE': AUTH0_CLIENT_ID,
'JWT_PAYLOAD_GET_USERNAME_HANDLER': jwt_get_username_from_payload_handler,
'JWT_AUTH_HE... | # Local
from .base import *
# JWT Settings
def jwt_get_username_from_payload_handler(payload):
return payload.get('email')
JWT_AUTH = {
# 'JWT_SECRET_KEY': AUTH0_CLIENT_SECRET,
'JWT_AUDIENCE': AUTH0_CLIENT_ID,
'JWT_PAYLOAD_GET_USERNAME_HANDLER': jwt_get_username_from_payload_handler,
'JWT_AUTH_HE... | <commit_before># Local
from .base import *
# JWT Settings
def jwt_get_username_from_payload_handler(payload):
return payload.get('email')
JWT_AUTH = {
# 'JWT_SECRET_KEY': AUTH0_CLIENT_SECRET,
'JWT_AUDIENCE': AUTH0_CLIENT_ID,
'JWT_PAYLOAD_GET_USERNAME_HANDLER': jwt_get_username_from_payload_handler,
... | # Local
from .base import *
# JWT Settings
def jwt_get_username_from_payload_handler(payload):
return payload.get('email')
JWT_AUTH = {
# 'JWT_SECRET_KEY': AUTH0_CLIENT_SECRET,
'JWT_AUDIENCE': AUTH0_CLIENT_ID,
'JWT_PAYLOAD_GET_USERNAME_HANDLER': jwt_get_username_from_payload_handler,
'JWT_AUTH_HE... | # Local
from .base import *
# JWT Settings
def jwt_get_username_from_payload_handler(payload):
return payload.get('email')
JWT_AUTH = {
# 'JWT_SECRET_KEY': AUTH0_CLIENT_SECRET,
'JWT_AUDIENCE': AUTH0_CLIENT_ID,
'JWT_PAYLOAD_GET_USERNAME_HANDLER': jwt_get_username_from_payload_handler,
'JWT_AUTH_HE... | <commit_before># Local
from .base import *
# JWT Settings
def jwt_get_username_from_payload_handler(payload):
return payload.get('email')
JWT_AUTH = {
# 'JWT_SECRET_KEY': AUTH0_CLIENT_SECRET,
'JWT_AUDIENCE': AUTH0_CLIENT_ID,
'JWT_PAYLOAD_GET_USERNAME_HANDLER': jwt_get_username_from_payload_handler,
... |
77f99f4862ded1b8493b5895e4f9d88a3bbf722b | source/globals/fieldtests.py | source/globals/fieldtests.py | # -*- coding: utf-8 -*-
## \package globals.fieldtests
# MIT licensing
# See: LICENSE.txt
import wx
## Tests if a wx control/instance is enabled
#
# Function for compatibility between wx versions
# \param enabled
# \b \e bool : Check if enabled or disabled
def FieldEnabled(field, enabled=True):
if wx.M... | # -*- coding: utf-8 -*-
## \package globals.fieldtests
# MIT licensing
# See: LICENSE.txt
import wx
## Tests if a wx control/instance is enabled/disabled
#
# Function for compatibility between wx versions
# \param field
# \b \e wx.Window : the wx control to check
# \param enabled
# \b \e bool : Check i... | Add function FieldDisabled to test for disabled controls | Add function FieldDisabled to test for disabled controls | Python | mit | AntumDeluge/desktop_recorder,AntumDeluge/desktop_recorder | # -*- coding: utf-8 -*-
## \package globals.fieldtests
# MIT licensing
# See: LICENSE.txt
import wx
## Tests if a wx control/instance is enabled
#
# Function for compatibility between wx versions
# \param enabled
# \b \e bool : Check if enabled or disabled
def FieldEnabled(field, enabled=True):
if wx.M... | # -*- coding: utf-8 -*-
## \package globals.fieldtests
# MIT licensing
# See: LICENSE.txt
import wx
## Tests if a wx control/instance is enabled/disabled
#
# Function for compatibility between wx versions
# \param field
# \b \e wx.Window : the wx control to check
# \param enabled
# \b \e bool : Check i... | <commit_before># -*- coding: utf-8 -*-
## \package globals.fieldtests
# MIT licensing
# See: LICENSE.txt
import wx
## Tests if a wx control/instance is enabled
#
# Function for compatibility between wx versions
# \param enabled
# \b \e bool : Check if enabled or disabled
def FieldEnabled(field, enabled=Tru... | # -*- coding: utf-8 -*-
## \package globals.fieldtests
# MIT licensing
# See: LICENSE.txt
import wx
## Tests if a wx control/instance is enabled/disabled
#
# Function for compatibility between wx versions
# \param field
# \b \e wx.Window : the wx control to check
# \param enabled
# \b \e bool : Check i... | # -*- coding: utf-8 -*-
## \package globals.fieldtests
# MIT licensing
# See: LICENSE.txt
import wx
## Tests if a wx control/instance is enabled
#
# Function for compatibility between wx versions
# \param enabled
# \b \e bool : Check if enabled or disabled
def FieldEnabled(field, enabled=True):
if wx.M... | <commit_before># -*- coding: utf-8 -*-
## \package globals.fieldtests
# MIT licensing
# See: LICENSE.txt
import wx
## Tests if a wx control/instance is enabled
#
# Function for compatibility between wx versions
# \param enabled
# \b \e bool : Check if enabled or disabled
def FieldEnabled(field, enabled=Tru... |
6a2fb450eb51d46fe4ab53dd4095527ecdcc9266 | tests/laundry_test.py | tests/laundry_test.py | import unittest
from penn import Laundry
class TestLaundry(unittest.TestCase):
def setUp(self):
self.laundry = Laundry()
def test_all(self):
data = self.laundry.all_status()
self.assertEquals('Class of 1925 House', data[0]['name'])
self.assertEquals(55, len(data))
def te... | from nose.tools import ok_, eq_
from penn import Laundry
class TestLaundry():
def setUp(self):
self.laundry = Laundry()
def test_all(self):
data = self.laundry.all_status()
eq_(55, len(data))
eq_('Class of 1925 House', data[0]['name'])
# Check all halls have appropria... | Add more rigorous laundry tests | Add more rigorous laundry tests
| Python | mit | pennlabs/penn-sdk-python,pennlabs/penn-sdk-python | import unittest
from penn import Laundry
class TestLaundry(unittest.TestCase):
def setUp(self):
self.laundry = Laundry()
def test_all(self):
data = self.laundry.all_status()
self.assertEquals('Class of 1925 House', data[0]['name'])
self.assertEquals(55, len(data))
def te... | from nose.tools import ok_, eq_
from penn import Laundry
class TestLaundry():
def setUp(self):
self.laundry = Laundry()
def test_all(self):
data = self.laundry.all_status()
eq_(55, len(data))
eq_('Class of 1925 House', data[0]['name'])
# Check all halls have appropria... | <commit_before>import unittest
from penn import Laundry
class TestLaundry(unittest.TestCase):
def setUp(self):
self.laundry = Laundry()
def test_all(self):
data = self.laundry.all_status()
self.assertEquals('Class of 1925 House', data[0]['name'])
self.assertEquals(55, len(dat... | from nose.tools import ok_, eq_
from penn import Laundry
class TestLaundry():
def setUp(self):
self.laundry = Laundry()
def test_all(self):
data = self.laundry.all_status()
eq_(55, len(data))
eq_('Class of 1925 House', data[0]['name'])
# Check all halls have appropria... | import unittest
from penn import Laundry
class TestLaundry(unittest.TestCase):
def setUp(self):
self.laundry = Laundry()
def test_all(self):
data = self.laundry.all_status()
self.assertEquals('Class of 1925 House', data[0]['name'])
self.assertEquals(55, len(data))
def te... | <commit_before>import unittest
from penn import Laundry
class TestLaundry(unittest.TestCase):
def setUp(self):
self.laundry = Laundry()
def test_all(self):
data = self.laundry.all_status()
self.assertEquals('Class of 1925 House', data[0]['name'])
self.assertEquals(55, len(dat... |
589dac7bf0305ec1289b2f81fe8c03cb61260238 | tools/boilerplate_data/init.py | tools/boilerplate_data/init.py | <%inherit file="layout.py"/>
from .backend import ${r.name}Backend
__all__ = ['${r.name}Backend']
| <%inherit file="layout.py"/>
from .backend import ${r.classname}Backend
__all__ = ['${r.classname}Backend']
| Fix missing use of the class name | boilerplate: Fix missing use of the class name
| Python | agpl-3.0 | sputnick-dev/weboob,RouxRC/weboob,sputnick-dev/weboob,willprice/weboob,laurent-george/weboob,Konubinix/weboob,RouxRC/weboob,Boussadia/weboob,RouxRC/weboob,yannrouillard/weboob,frankrousseau/weboob,yannrouillard/weboob,franek/weboob,Boussadia/weboob,laurent-george/weboob,Konubinix/weboob,Boussadia/weboob,laurent-george/... | <%inherit file="layout.py"/>
from .backend import ${r.name}Backend
__all__ = ['${r.name}Backend']
boilerplate: Fix missing use of the class name | <%inherit file="layout.py"/>
from .backend import ${r.classname}Backend
__all__ = ['${r.classname}Backend']
| <commit_before><%inherit file="layout.py"/>
from .backend import ${r.name}Backend
__all__ = ['${r.name}Backend']
<commit_msg>boilerplate: Fix missing use of the class name<commit_after> | <%inherit file="layout.py"/>
from .backend import ${r.classname}Backend
__all__ = ['${r.classname}Backend']
| <%inherit file="layout.py"/>
from .backend import ${r.name}Backend
__all__ = ['${r.name}Backend']
boilerplate: Fix missing use of the class name<%inherit file="layout.py"/>
from .backend import ${r.classname}Backend
__all__ = ['${r.classname}Backend']
| <commit_before><%inherit file="layout.py"/>
from .backend import ${r.name}Backend
__all__ = ['${r.name}Backend']
<commit_msg>boilerplate: Fix missing use of the class name<commit_after><%inherit file="layout.py"/>
from .backend import ${r.classname}Backend
__all__ = ['${r.classname}Backend']
|
9bb19e21ed7f3b10af9a218cf55ea3a19ee4393c | tests/test_command.py | tests/test_command.py | """Unittest of command entry point."""
# Copyright 2015 Masayuki Yamamoto
#
# 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 r... | """Unittest of command entry point."""
# Copyright 2015 Masayuki Yamamoto
#
# 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 r... | Add command test for '--help' option | Add command test for '--help' option
Check calling 'print_help' method.
| Python | apache-2.0 | ma8ma/yanico | """Unittest of command entry point."""
# Copyright 2015 Masayuki Yamamoto
#
# 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 r... | """Unittest of command entry point."""
# Copyright 2015 Masayuki Yamamoto
#
# 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 r... | <commit_before>"""Unittest of command entry point."""
# Copyright 2015 Masayuki Yamamoto
#
# 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.... | """Unittest of command entry point."""
# Copyright 2015 Masayuki Yamamoto
#
# 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 r... | """Unittest of command entry point."""
# Copyright 2015 Masayuki Yamamoto
#
# 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 r... | <commit_before>"""Unittest of command entry point."""
# Copyright 2015 Masayuki Yamamoto
#
# 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.... |
01920b5dcced36e72a5623bf9c08c5cecfa38753 | src/scrapy_redis/dupefilter.py | src/scrapy_redis/dupefilter.py | import time
from scrapy.dupefilters import BaseDupeFilter
from scrapy.utils.request import request_fingerprint
from . import connection
class RFPDupeFilter(BaseDupeFilter):
"""Redis-based request duplication filter"""
def __init__(self, server, key):
"""Initialize duplication filter
Parame... | import time
from scrapy.dupefilters import BaseDupeFilter
from scrapy.utils.request import request_fingerprint
from . import connection
class RFPDupeFilter(BaseDupeFilter):
"""Redis-based request duplication filter"""
def __init__(self, server, key):
"""Initialize duplication filter
Parame... | Allow to override request fingerprint call. | Allow to override request fingerprint call.
| Python | mit | darkrho/scrapy-redis,rolando/scrapy-redis | import time
from scrapy.dupefilters import BaseDupeFilter
from scrapy.utils.request import request_fingerprint
from . import connection
class RFPDupeFilter(BaseDupeFilter):
"""Redis-based request duplication filter"""
def __init__(self, server, key):
"""Initialize duplication filter
Parame... | import time
from scrapy.dupefilters import BaseDupeFilter
from scrapy.utils.request import request_fingerprint
from . import connection
class RFPDupeFilter(BaseDupeFilter):
"""Redis-based request duplication filter"""
def __init__(self, server, key):
"""Initialize duplication filter
Parame... | <commit_before>import time
from scrapy.dupefilters import BaseDupeFilter
from scrapy.utils.request import request_fingerprint
from . import connection
class RFPDupeFilter(BaseDupeFilter):
"""Redis-based request duplication filter"""
def __init__(self, server, key):
"""Initialize duplication filter
... | import time
from scrapy.dupefilters import BaseDupeFilter
from scrapy.utils.request import request_fingerprint
from . import connection
class RFPDupeFilter(BaseDupeFilter):
"""Redis-based request duplication filter"""
def __init__(self, server, key):
"""Initialize duplication filter
Parame... | import time
from scrapy.dupefilters import BaseDupeFilter
from scrapy.utils.request import request_fingerprint
from . import connection
class RFPDupeFilter(BaseDupeFilter):
"""Redis-based request duplication filter"""
def __init__(self, server, key):
"""Initialize duplication filter
Parame... | <commit_before>import time
from scrapy.dupefilters import BaseDupeFilter
from scrapy.utils.request import request_fingerprint
from . import connection
class RFPDupeFilter(BaseDupeFilter):
"""Redis-based request duplication filter"""
def __init__(self, server, key):
"""Initialize duplication filter
... |
333afea8d8a548948f24745490c700c98500e22f | mlab-ns-simulator/mlabsim/lookup.py | mlab-ns-simulator/mlabsim/lookup.py | """
This simulates the mlab-ns lookup request, whose code lives here:
https://code.google.com/p/m-lab/source/browse/server/mlabns/handlers/lookup.py?repo=ns
The difference in this module is that we don't support features which
ooni-support does not use and we augment features which ooni-support
would rely on if mlab-... | """
This simulates the mlab-ns lookup request, whose code lives here:
https://code.google.com/p/m-lab/source/browse/server/mlabns/handlers/lookup.py?repo=ns
The difference in this module is that we don't support features which
ooni-support does not use and we augment features which ooni-support
would rely on if mlab-... | Implement the current ``GET /ooni`` api. | Implement the current ``GET /ooni`` api.
| Python | apache-2.0 | hellais/ooni-support,m-lab/ooni-support,m-lab/ooni-support,hellais/ooni-support | """
This simulates the mlab-ns lookup request, whose code lives here:
https://code.google.com/p/m-lab/source/browse/server/mlabns/handlers/lookup.py?repo=ns
The difference in this module is that we don't support features which
ooni-support does not use and we augment features which ooni-support
would rely on if mlab-... | """
This simulates the mlab-ns lookup request, whose code lives here:
https://code.google.com/p/m-lab/source/browse/server/mlabns/handlers/lookup.py?repo=ns
The difference in this module is that we don't support features which
ooni-support does not use and we augment features which ooni-support
would rely on if mlab-... | <commit_before>"""
This simulates the mlab-ns lookup request, whose code lives here:
https://code.google.com/p/m-lab/source/browse/server/mlabns/handlers/lookup.py?repo=ns
The difference in this module is that we don't support features which
ooni-support does not use and we augment features which ooni-support
would r... | """
This simulates the mlab-ns lookup request, whose code lives here:
https://code.google.com/p/m-lab/source/browse/server/mlabns/handlers/lookup.py?repo=ns
The difference in this module is that we don't support features which
ooni-support does not use and we augment features which ooni-support
would rely on if mlab-... | """
This simulates the mlab-ns lookup request, whose code lives here:
https://code.google.com/p/m-lab/source/browse/server/mlabns/handlers/lookup.py?repo=ns
The difference in this module is that we don't support features which
ooni-support does not use and we augment features which ooni-support
would rely on if mlab-... | <commit_before>"""
This simulates the mlab-ns lookup request, whose code lives here:
https://code.google.com/p/m-lab/source/browse/server/mlabns/handlers/lookup.py?repo=ns
The difference in this module is that we don't support features which
ooni-support does not use and we augment features which ooni-support
would r... |
a057798f3e54e8d74005df10ba1f7d9b93270787 | odbc2csv.py | odbc2csv.py | import pypyodbc
import csv
conn = pypyodbc.connect("DSN=HOSS_DB")
cur = conn.cursor()
tables = []
cur.execute("select * from sys.tables")
for row in cur.fetchall():
tables.append(row[0])
for table in tables:
print(table)
cur.execute("select * from {}".format(table))
column_names = []
for d i... | import pypyodbc
import csv
conn = pypyodbc.connect("DSN=HOSS_DB")
cur = conn.cursor()
tables = []
cur.execute("select * from sys.tables")
for row in cur.fetchall():
tables.append(row[0])
for table in tables:
print(table)
cur.execute("select * from {}".format(table))
column_names = []
for d i... | Use just newline for file terminator. | Use just newline for file terminator. | Python | isc | wablair/misc_scripts,wablair/misc_scripts,wablair/misc_scripts,wablair/misc_scripts | import pypyodbc
import csv
conn = pypyodbc.connect("DSN=HOSS_DB")
cur = conn.cursor()
tables = []
cur.execute("select * from sys.tables")
for row in cur.fetchall():
tables.append(row[0])
for table in tables:
print(table)
cur.execute("select * from {}".format(table))
column_names = []
for d i... | import pypyodbc
import csv
conn = pypyodbc.connect("DSN=HOSS_DB")
cur = conn.cursor()
tables = []
cur.execute("select * from sys.tables")
for row in cur.fetchall():
tables.append(row[0])
for table in tables:
print(table)
cur.execute("select * from {}".format(table))
column_names = []
for d i... | <commit_before>import pypyodbc
import csv
conn = pypyodbc.connect("DSN=HOSS_DB")
cur = conn.cursor()
tables = []
cur.execute("select * from sys.tables")
for row in cur.fetchall():
tables.append(row[0])
for table in tables:
print(table)
cur.execute("select * from {}".format(table))
column_names = ... | import pypyodbc
import csv
conn = pypyodbc.connect("DSN=HOSS_DB")
cur = conn.cursor()
tables = []
cur.execute("select * from sys.tables")
for row in cur.fetchall():
tables.append(row[0])
for table in tables:
print(table)
cur.execute("select * from {}".format(table))
column_names = []
for d i... | import pypyodbc
import csv
conn = pypyodbc.connect("DSN=HOSS_DB")
cur = conn.cursor()
tables = []
cur.execute("select * from sys.tables")
for row in cur.fetchall():
tables.append(row[0])
for table in tables:
print(table)
cur.execute("select * from {}".format(table))
column_names = []
for d i... | <commit_before>import pypyodbc
import csv
conn = pypyodbc.connect("DSN=HOSS_DB")
cur = conn.cursor()
tables = []
cur.execute("select * from sys.tables")
for row in cur.fetchall():
tables.append(row[0])
for table in tables:
print(table)
cur.execute("select * from {}".format(table))
column_names = ... |
9f5418e5b755232e12ea18e85b131dbd04c74587 | benchmarks_sphere/paper_jrn_parco_rexi_nonlinear/postprocessing_pickle.py | benchmarks_sphere/paper_jrn_parco_rexi_nonlinear/postprocessing_pickle.py | #! /usr/bin/env python3
import sys
import math
import glob
from sweet.postprocessing.pickle_SphereDataPhysicalDiff import *
p = pickle_SphereDataPhysicalDiff("_t00000000120.00000000.csv")
| #! /usr/bin/env python3
import sys
import math
import glob
from sweet.postprocessing.pickle_SphereDataPhysicalDiff import *
from mule.exec_program import *
# Ugly hack!
#output, retval = exec_program('ls *benchref*/*prog_h* | sort | tail -n 1 | sed "s/.*prog_h//"')
#if retval != 0:
# print(output)
# raise Exception(... | Make postprocess pickling generic to various reference files | Make postprocess pickling generic to various reference files
| Python | mit | schreiberx/sweet,schreiberx/sweet,schreiberx/sweet,schreiberx/sweet | #! /usr/bin/env python3
import sys
import math
import glob
from sweet.postprocessing.pickle_SphereDataPhysicalDiff import *
p = pickle_SphereDataPhysicalDiff("_t00000000120.00000000.csv")
Make postprocess pickling generic to various reference files | #! /usr/bin/env python3
import sys
import math
import glob
from sweet.postprocessing.pickle_SphereDataPhysicalDiff import *
from mule.exec_program import *
# Ugly hack!
#output, retval = exec_program('ls *benchref*/*prog_h* | sort | tail -n 1 | sed "s/.*prog_h//"')
#if retval != 0:
# print(output)
# raise Exception(... | <commit_before>#! /usr/bin/env python3
import sys
import math
import glob
from sweet.postprocessing.pickle_SphereDataPhysicalDiff import *
p = pickle_SphereDataPhysicalDiff("_t00000000120.00000000.csv")
<commit_msg>Make postprocess pickling generic to various reference files<commit_after> | #! /usr/bin/env python3
import sys
import math
import glob
from sweet.postprocessing.pickle_SphereDataPhysicalDiff import *
from mule.exec_program import *
# Ugly hack!
#output, retval = exec_program('ls *benchref*/*prog_h* | sort | tail -n 1 | sed "s/.*prog_h//"')
#if retval != 0:
# print(output)
# raise Exception(... | #! /usr/bin/env python3
import sys
import math
import glob
from sweet.postprocessing.pickle_SphereDataPhysicalDiff import *
p = pickle_SphereDataPhysicalDiff("_t00000000120.00000000.csv")
Make postprocess pickling generic to various reference files#! /usr/bin/env python3
import sys
import math
import glob
from sw... | <commit_before>#! /usr/bin/env python3
import sys
import math
import glob
from sweet.postprocessing.pickle_SphereDataPhysicalDiff import *
p = pickle_SphereDataPhysicalDiff("_t00000000120.00000000.csv")
<commit_msg>Make postprocess pickling generic to various reference files<commit_after>#! /usr/bin/env python3
im... |
36ea5e58ce97b69bfd0bf3701cbc5936bc59d100 | install_dotfiles.py | install_dotfiles.py | #!/usr/bin/python
# install_dotfiles
# This script will build platform-specific dotfiles and create the appropriate symlinks in ~
import platform
import os
sysName = platform.system()
os.remove('bashrc')
bashrc = open('bashrc','a')
def writeSection(fileName, allowComments):
f = open(fileName,'r')
for line in f... | #!/usr/bin/python
# install_dotfiles
# This script will build platform-specific dotfiles and create the appropriate symlinks in ~
import platform
import os
sysName = platform.system()
os.remove('bashrc')
bashrc = open('bashrc','a')
bashrc.write("#!/bin/bash\n")
bashrc.write("# This file was generated by a script. D... | Reorder writing of bashrc body sections. | Reorder writing of bashrc body sections.
| Python | mit | rucker/dotfiles-manager | #!/usr/bin/python
# install_dotfiles
# This script will build platform-specific dotfiles and create the appropriate symlinks in ~
import platform
import os
sysName = platform.system()
os.remove('bashrc')
bashrc = open('bashrc','a')
def writeSection(fileName, allowComments):
f = open(fileName,'r')
for line in f... | #!/usr/bin/python
# install_dotfiles
# This script will build platform-specific dotfiles and create the appropriate symlinks in ~
import platform
import os
sysName = platform.system()
os.remove('bashrc')
bashrc = open('bashrc','a')
bashrc.write("#!/bin/bash\n")
bashrc.write("# This file was generated by a script. D... | <commit_before>#!/usr/bin/python
# install_dotfiles
# This script will build platform-specific dotfiles and create the appropriate symlinks in ~
import platform
import os
sysName = platform.system()
os.remove('bashrc')
bashrc = open('bashrc','a')
def writeSection(fileName, allowComments):
f = open(fileName,'r')
... | #!/usr/bin/python
# install_dotfiles
# This script will build platform-specific dotfiles and create the appropriate symlinks in ~
import platform
import os
sysName = platform.system()
os.remove('bashrc')
bashrc = open('bashrc','a')
bashrc.write("#!/bin/bash\n")
bashrc.write("# This file was generated by a script. D... | #!/usr/bin/python
# install_dotfiles
# This script will build platform-specific dotfiles and create the appropriate symlinks in ~
import platform
import os
sysName = platform.system()
os.remove('bashrc')
bashrc = open('bashrc','a')
def writeSection(fileName, allowComments):
f = open(fileName,'r')
for line in f... | <commit_before>#!/usr/bin/python
# install_dotfiles
# This script will build platform-specific dotfiles and create the appropriate symlinks in ~
import platform
import os
sysName = platform.system()
os.remove('bashrc')
bashrc = open('bashrc','a')
def writeSection(fileName, allowComments):
f = open(fileName,'r')
... |
3661edd55553ff2dff27cb102a83d4751e033f2a | painter/management/commands/import_cards.py | painter/management/commands/import_cards.py | import tablib
from django.core.management.base import BaseCommand
from painter.models import Card
class Command(BaseCommand):
def handle(self, *args, **options):
dataset = tablib.Dataset()
| import tablib
from django.core.management.base import BaseCommand
from painter.models import Card
class Command(BaseCommand):
help = ('Clears the database of cards, then fills it with the contents of one or' +
' more specified CSV files.')
def add_arguments(self, parser):
parser.add_argu... | Add help text and a 'filenames' argument. | Add help text and a 'filenames' argument.
* Make it print the filenames it's receiving for the sake of
good testing output.
| Python | mit | adam-incuna/imperial-painter,adam-thomas/imperial-painter,adam-thomas/imperial-painter,adam-incuna/imperial-painter | import tablib
from django.core.management.base import BaseCommand
from painter.models import Card
class Command(BaseCommand):
def handle(self, *args, **options):
dataset = tablib.Dataset()
Add help text and a 'filenames' argument.
* Make it print the filenames it's receiving for the sake of
good testi... | import tablib
from django.core.management.base import BaseCommand
from painter.models import Card
class Command(BaseCommand):
help = ('Clears the database of cards, then fills it with the contents of one or' +
' more specified CSV files.')
def add_arguments(self, parser):
parser.add_argu... | <commit_before>import tablib
from django.core.management.base import BaseCommand
from painter.models import Card
class Command(BaseCommand):
def handle(self, *args, **options):
dataset = tablib.Dataset()
<commit_msg>Add help text and a 'filenames' argument.
* Make it print the filenames it's receiving f... | import tablib
from django.core.management.base import BaseCommand
from painter.models import Card
class Command(BaseCommand):
help = ('Clears the database of cards, then fills it with the contents of one or' +
' more specified CSV files.')
def add_arguments(self, parser):
parser.add_argu... | import tablib
from django.core.management.base import BaseCommand
from painter.models import Card
class Command(BaseCommand):
def handle(self, *args, **options):
dataset = tablib.Dataset()
Add help text and a 'filenames' argument.
* Make it print the filenames it's receiving for the sake of
good testi... | <commit_before>import tablib
from django.core.management.base import BaseCommand
from painter.models import Card
class Command(BaseCommand):
def handle(self, *args, **options):
dataset = tablib.Dataset()
<commit_msg>Add help text and a 'filenames' argument.
* Make it print the filenames it's receiving f... |
b457af108174821965ae8e3ee28eb3d34c0fec06 | plugins/GCodeWriter/__init__.py | plugins/GCodeWriter/__init__.py | # Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from . import GCodeWriter
from UM.i18n import i18nCatalog
catalog = i18nCatalog("cura")
def getMetaData():
return {
"plugin": {
"name": catalog.i18nc("@label", "GCode Writer"),
"author"... | # Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from . import GCodeWriter
from UM.i18n import i18nCatalog
catalog = i18nCatalog("cura")
def getMetaData():
return {
"plugin": {
"name": catalog.i18nc("@label", "GCode Writer"),
"author"... | Add period at end of plug-in description | Add period at end of plug-in description
All other plug-in descriptions have that too. So for consistency.
Contributes to issue CURA-1190.
| Python | agpl-3.0 | fieldOfView/Cura,fieldOfView/Cura,senttech/Cura,ynotstartups/Wanhao,senttech/Cura,hmflash/Cura,totalretribution/Cura,ynotstartups/Wanhao,Curahelper/Cura,totalretribution/Cura,hmflash/Cura,Curahelper/Cura | # Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from . import GCodeWriter
from UM.i18n import i18nCatalog
catalog = i18nCatalog("cura")
def getMetaData():
return {
"plugin": {
"name": catalog.i18nc("@label", "GCode Writer"),
"author"... | # Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from . import GCodeWriter
from UM.i18n import i18nCatalog
catalog = i18nCatalog("cura")
def getMetaData():
return {
"plugin": {
"name": catalog.i18nc("@label", "GCode Writer"),
"author"... | <commit_before># Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from . import GCodeWriter
from UM.i18n import i18nCatalog
catalog = i18nCatalog("cura")
def getMetaData():
return {
"plugin": {
"name": catalog.i18nc("@label", "GCode Writer"),
... | # Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from . import GCodeWriter
from UM.i18n import i18nCatalog
catalog = i18nCatalog("cura")
def getMetaData():
return {
"plugin": {
"name": catalog.i18nc("@label", "GCode Writer"),
"author"... | # Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from . import GCodeWriter
from UM.i18n import i18nCatalog
catalog = i18nCatalog("cura")
def getMetaData():
return {
"plugin": {
"name": catalog.i18nc("@label", "GCode Writer"),
"author"... | <commit_before># Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from . import GCodeWriter
from UM.i18n import i18nCatalog
catalog = i18nCatalog("cura")
def getMetaData():
return {
"plugin": {
"name": catalog.i18nc("@label", "GCode Writer"),
... |
6889946ebb1c1559e0e1c7b83e1d7b1d6896e0b0 | tests/test_train_dictionary.py | tests/test_train_dictionary.py | import unittest
import zstd
class TestTrainDictionary(unittest.TestCase):
def test_no_args(self):
with self.assertRaises(TypeError):
zstd.train_dictionary()
def test_bad_args(self):
with self.assertRaises(TypeError):
zstd.train_dictionary(8192, u'foo')
with s... | import sys
import unittest
import zstd
if sys.version_info[0] >= 3:
int_type = int
else:
int_type = long
class TestTrainDictionary(unittest.TestCase):
def test_no_args(self):
with self.assertRaises(TypeError):
zstd.train_dictionary()
def test_bad_args(self):
with self.a... | Check for appropriate long type on Python 2 | Check for appropriate long type on Python 2
The extension always returns a long, which is not an "int" on
Python 2. Fix the test. | Python | bsd-3-clause | terrelln/python-zstandard,terrelln/python-zstandard,terrelln/python-zstandard,indygreg/python-zstandard,terrelln/python-zstandard,indygreg/python-zstandard,indygreg/python-zstandard,indygreg/python-zstandard | import unittest
import zstd
class TestTrainDictionary(unittest.TestCase):
def test_no_args(self):
with self.assertRaises(TypeError):
zstd.train_dictionary()
def test_bad_args(self):
with self.assertRaises(TypeError):
zstd.train_dictionary(8192, u'foo')
with s... | import sys
import unittest
import zstd
if sys.version_info[0] >= 3:
int_type = int
else:
int_type = long
class TestTrainDictionary(unittest.TestCase):
def test_no_args(self):
with self.assertRaises(TypeError):
zstd.train_dictionary()
def test_bad_args(self):
with self.a... | <commit_before>import unittest
import zstd
class TestTrainDictionary(unittest.TestCase):
def test_no_args(self):
with self.assertRaises(TypeError):
zstd.train_dictionary()
def test_bad_args(self):
with self.assertRaises(TypeError):
zstd.train_dictionary(8192, u'foo')
... | import sys
import unittest
import zstd
if sys.version_info[0] >= 3:
int_type = int
else:
int_type = long
class TestTrainDictionary(unittest.TestCase):
def test_no_args(self):
with self.assertRaises(TypeError):
zstd.train_dictionary()
def test_bad_args(self):
with self.a... | import unittest
import zstd
class TestTrainDictionary(unittest.TestCase):
def test_no_args(self):
with self.assertRaises(TypeError):
zstd.train_dictionary()
def test_bad_args(self):
with self.assertRaises(TypeError):
zstd.train_dictionary(8192, u'foo')
with s... | <commit_before>import unittest
import zstd
class TestTrainDictionary(unittest.TestCase):
def test_no_args(self):
with self.assertRaises(TypeError):
zstd.train_dictionary()
def test_bad_args(self):
with self.assertRaises(TypeError):
zstd.train_dictionary(8192, u'foo')
... |
47fe1412857dbc251ff89004798d5507b0e70b25 | boundary/plugin_get.py | boundary/plugin_get.py | #
# Copyright 2014-2015 Boundary, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | #
# Copyright 2014-2015 Boundary, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | Reformat code to PEP-8 standards | Reformat code to PEP-8 standards
| Python | apache-2.0 | wcainboundary/boundary-api-cli,boundary/pulse-api-cli,jdgwartney/pulse-api-cli,wcainboundary/boundary-api-cli,jdgwartney/boundary-api-cli,boundary/boundary-api-cli,jdgwartney/boundary-api-cli,boundary/pulse-api-cli,jdgwartney/pulse-api-cli,boundary/boundary-api-cli | #
# Copyright 2014-2015 Boundary, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | #
# Copyright 2014-2015 Boundary, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | <commit_before>#
# Copyright 2014-2015 Boundary, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | #
# Copyright 2014-2015 Boundary, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | #
# Copyright 2014-2015 Boundary, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | <commit_before>#
# Copyright 2014-2015 Boundary, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
27d2cd57337497abb9d106fdb033c26771e481e4 | rmgpy/data/__init__.py | rmgpy/data/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2010 Prof. William H. Green (whgreen@mit.edu) and the
# RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby granted, free ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2010 Prof. William H. Green (whgreen@mit.edu) and the
# RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby granted, free ... | Remove getDatabaseDirectory() function from rmgpy.data | Remove getDatabaseDirectory() function from rmgpy.data
This function is not being used anywhere, and also has been
replaced by the settings in rmgpy, which searches for and
saves a database directory
| Python | mit | pierrelb/RMG-Py,pierrelb/RMG-Py,nickvandewiele/RMG-Py,nickvandewiele/RMG-Py,nyee/RMG-Py,nyee/RMG-Py,chatelak/RMG-Py,chatelak/RMG-Py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2010 Prof. William H. Green (whgreen@mit.edu) and the
# RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby granted, free ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2010 Prof. William H. Green (whgreen@mit.edu) and the
# RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby granted, free ... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2010 Prof. William H. Green (whgreen@mit.edu) and the
# RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2010 Prof. William H. Green (whgreen@mit.edu) and the
# RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby granted, free ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2010 Prof. William H. Green (whgreen@mit.edu) and the
# RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby granted, free ... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2010 Prof. William H. Green (whgreen@mit.edu) and the
# RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby... |
f188f2eb81c1310b9862b435a492b4ce6d0fac2d | python3/aniso8601/resolution.py | python3/aniso8601/resolution.py | # -*- coding: utf-8 -*-
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
from enum import Enum
class DateResolution(Enum):
Year, Month, Week, Weekday, Day, Ordinal = range(6)
class TimeResolution(Enum):
Seconds, Minutes, Hours = range(3... | # -*- coding: utf-8 -*-
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
class DateResolution(object):
Year, Month, Week, Weekday, Day, Ordinal = list(range(6))
class TimeResolution(object):
Seconds, Minutes, Hours = list(range(3))
| Remove use of enum in Python3 | Remove use of enum in Python3
| Python | bsd-3-clause | 3stack-software/python-aniso8601-relativedelta | # -*- coding: utf-8 -*-
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
from enum import Enum
class DateResolution(Enum):
Year, Month, Week, Weekday, Day, Ordinal = range(6)
class TimeResolution(Enum):
Seconds, Minutes, Hours = range(3... | # -*- coding: utf-8 -*-
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
class DateResolution(object):
Year, Month, Week, Weekday, Day, Ordinal = list(range(6))
class TimeResolution(object):
Seconds, Minutes, Hours = list(range(3))
| <commit_before># -*- coding: utf-8 -*-
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
from enum import Enum
class DateResolution(Enum):
Year, Month, Week, Weekday, Day, Ordinal = range(6)
class TimeResolution(Enum):
Seconds, Minutes, ... | # -*- coding: utf-8 -*-
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
class DateResolution(object):
Year, Month, Week, Weekday, Day, Ordinal = list(range(6))
class TimeResolution(object):
Seconds, Minutes, Hours = list(range(3))
| # -*- coding: utf-8 -*-
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
from enum import Enum
class DateResolution(Enum):
Year, Month, Week, Weekday, Day, Ordinal = range(6)
class TimeResolution(Enum):
Seconds, Minutes, Hours = range(3... | <commit_before># -*- coding: utf-8 -*-
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
from enum import Enum
class DateResolution(Enum):
Year, Month, Week, Weekday, Day, Ordinal = range(6)
class TimeResolution(Enum):
Seconds, Minutes, ... |
dfef23d834ab67acf91dcefd6fe39e089c71fb9a | quantized_mesh_tile/__init__.py | quantized_mesh_tile/__init__.py | """
This module provides high level utility functions to encode and decode a terrain tile.
Reference
---------
"""
from .terrain import TerrainTile
from .topology import TerrainTopology
def encode(geometries, bounds=[], watermask=[], hasLighting=False, gzipped=False):
"""
Function to convert geometries in a... | Add higher level functions encode and decode | Add higher level functions encode and decode
| Python | mit | loicgasser/quantized-mesh-tile | Add higher level functions encode and decode | """
This module provides high level utility functions to encode and decode a terrain tile.
Reference
---------
"""
from .terrain import TerrainTile
from .topology import TerrainTopology
def encode(geometries, bounds=[], watermask=[], hasLighting=False, gzipped=False):
"""
Function to convert geometries in a... | <commit_before><commit_msg>Add higher level functions encode and decode<commit_after> | """
This module provides high level utility functions to encode and decode a terrain tile.
Reference
---------
"""
from .terrain import TerrainTile
from .topology import TerrainTopology
def encode(geometries, bounds=[], watermask=[], hasLighting=False, gzipped=False):
"""
Function to convert geometries in a... | Add higher level functions encode and decode"""
This module provides high level utility functions to encode and decode a terrain tile.
Reference
---------
"""
from .terrain import TerrainTile
from .topology import TerrainTopology
def encode(geometries, bounds=[], watermask=[], hasLighting=False, gzipped=False):
... | <commit_before><commit_msg>Add higher level functions encode and decode<commit_after>"""
This module provides high level utility functions to encode and decode a terrain tile.
Reference
---------
"""
from .terrain import TerrainTile
from .topology import TerrainTopology
def encode(geometries, bounds=[], watermask=[... | |
b9ba8a929a539f24d674aed7d7ee98b490a6fcd3 | mopidy/__init__.py | mopidy/__init__.py | from mopidy import settings as raw_settings
def get_version():
return u'0.1.dev'
def get_mpd_protocol_version():
return u'0.16.0'
class SettingsError(Exception):
pass
class Settings(object):
def __getattr__(self, attr):
if attr.isupper() and not hasattr(raw_settings, attr):
raise... | from mopidy import settings as raw_settings
def get_version():
return u'0.1.0a0.dev0'
def get_mpd_protocol_version():
return u'0.16.0'
class SettingsError(Exception):
pass
class Settings(object):
def __getattr__(self, attr):
if attr.isupper() and not hasattr(raw_settings, attr):
... | Switch to a StrictVersion-compatible version number | Switch to a StrictVersion-compatible version number
| Python | apache-2.0 | mokieyue/mopidy,swak/mopidy,pacificIT/mopidy,quartz55/mopidy,swak/mopidy,SuperStarPL/mopidy,mopidy/mopidy,priestd09/mopidy,jmarsik/mopidy,diandiankan/mopidy,diandiankan/mopidy,vrs01/mopidy,glogiotatidis/mopidy,adamcik/mopidy,rawdlite/mopidy,pacificIT/mopidy,dbrgn/mopidy,mokieyue/mopidy,pacificIT/mopidy,ali/mopidy,hkari... | from mopidy import settings as raw_settings
def get_version():
return u'0.1.dev'
def get_mpd_protocol_version():
return u'0.16.0'
class SettingsError(Exception):
pass
class Settings(object):
def __getattr__(self, attr):
if attr.isupper() and not hasattr(raw_settings, attr):
raise... | from mopidy import settings as raw_settings
def get_version():
return u'0.1.0a0.dev0'
def get_mpd_protocol_version():
return u'0.16.0'
class SettingsError(Exception):
pass
class Settings(object):
def __getattr__(self, attr):
if attr.isupper() and not hasattr(raw_settings, attr):
... | <commit_before>from mopidy import settings as raw_settings
def get_version():
return u'0.1.dev'
def get_mpd_protocol_version():
return u'0.16.0'
class SettingsError(Exception):
pass
class Settings(object):
def __getattr__(self, attr):
if attr.isupper() and not hasattr(raw_settings, attr):
... | from mopidy import settings as raw_settings
def get_version():
return u'0.1.0a0.dev0'
def get_mpd_protocol_version():
return u'0.16.0'
class SettingsError(Exception):
pass
class Settings(object):
def __getattr__(self, attr):
if attr.isupper() and not hasattr(raw_settings, attr):
... | from mopidy import settings as raw_settings
def get_version():
return u'0.1.dev'
def get_mpd_protocol_version():
return u'0.16.0'
class SettingsError(Exception):
pass
class Settings(object):
def __getattr__(self, attr):
if attr.isupper() and not hasattr(raw_settings, attr):
raise... | <commit_before>from mopidy import settings as raw_settings
def get_version():
return u'0.1.dev'
def get_mpd_protocol_version():
return u'0.16.0'
class SettingsError(Exception):
pass
class Settings(object):
def __getattr__(self, attr):
if attr.isupper() and not hasattr(raw_settings, attr):
... |
4b5a39c6bbc82572f67ea03236490e52049adf52 | tests/query_test/test_scan_range_lengths.py | tests/query_test/test_scan_range_lengths.py | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Validates running with different scan range length values
#
import pytest
from copy import copy
from tests.common.test_vector import TestDimension
from tests.common.impala_test_suite import ImpalaTestSuite, ALL_NODES_ONLY
# We use very sm... | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Validates running with different scan range length values
#
import pytest
from copy import copy
from tests.common.test_vector import TestDimension
from tests.common.impala_test_suite import ImpalaTestSuite, ALL_NODES_ONLY
# We use very sm... | Fix IMPALA-122: Lzo scanner with small scan ranges. | Fix IMPALA-122: Lzo scanner with small scan ranges.
Change-Id: I5226fd1a1aa368f5b291b78ad371363057ef574e
Reviewed-on: http://gerrit.ent.cloudera.com:8080/140
Reviewed-by: Skye Wanderman-Milne <6d4b168ab637b0a20cc9dbf96abb2537f372f946@cloudera.com>
Reviewed-by: Nong Li <99a5e5f8f5911755b88e0b536d46aafa102bed41@cloudera... | Python | apache-2.0 | tempbottle/Impala,cchanning/Impala,kapilrastogi/Impala,cgvarela/Impala,brightchen/Impala,mapr/impala,caseyching/Impala,rampage644/impala-cut,mapr/impala,caseyching/Impala,rampage644/impala-cut,lirui-intel/Impala,mapr/impala,ibmsoe/ImpalaPPC,cchanning/Impala,gistic/PublicSpatialImpala,gerashegalov/Impala,lnliuxing/Impal... | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Validates running with different scan range length values
#
import pytest
from copy import copy
from tests.common.test_vector import TestDimension
from tests.common.impala_test_suite import ImpalaTestSuite, ALL_NODES_ONLY
# We use very sm... | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Validates running with different scan range length values
#
import pytest
from copy import copy
from tests.common.test_vector import TestDimension
from tests.common.impala_test_suite import ImpalaTestSuite, ALL_NODES_ONLY
# We use very sm... | <commit_before>#!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Validates running with different scan range length values
#
import pytest
from copy import copy
from tests.common.test_vector import TestDimension
from tests.common.impala_test_suite import ImpalaTestSuite, ALL_NODES_ONLY
#... | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Validates running with different scan range length values
#
import pytest
from copy import copy
from tests.common.test_vector import TestDimension
from tests.common.impala_test_suite import ImpalaTestSuite, ALL_NODES_ONLY
# We use very sm... | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Validates running with different scan range length values
#
import pytest
from copy import copy
from tests.common.test_vector import TestDimension
from tests.common.impala_test_suite import ImpalaTestSuite, ALL_NODES_ONLY
# We use very sm... | <commit_before>#!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Validates running with different scan range length values
#
import pytest
from copy import copy
from tests.common.test_vector import TestDimension
from tests.common.impala_test_suite import ImpalaTestSuite, ALL_NODES_ONLY
#... |
ce875a972eb3efaa5201ba1a72ae1d8d6754cfe0 | python-pscheduler/pscheduler/pscheduler/db.py | python-pscheduler/pscheduler/pscheduler/db.py | """
Functions for connecting to the pScheduler database
"""
import psycopg2
from filestring import string_from_file
def pg_connection(dsn='', autocommit=True):
"""
Connect to the database, and return a handle to it
Arguments:
dsn - A data source name to use in connecting to the database. If
th... | """
Functions for connecting to the pScheduler database
"""
import os
import psycopg2
import sys
from filestring import string_from_file
def pg_connection(dsn='', autocommit=True, name=None):
"""
Connect to the database, and return a handle to it
Arguments:
dsn - A data source name to use in connec... | Add application name to database connection for great debugging. | Add application name to database connection for great debugging.
| Python | apache-2.0 | mfeit-internet2/pscheduler-dev,perfsonar/pscheduler,perfsonar/pscheduler,perfsonar/pscheduler,perfsonar/pscheduler,mfeit-internet2/pscheduler-dev | """
Functions for connecting to the pScheduler database
"""
import psycopg2
from filestring import string_from_file
def pg_connection(dsn='', autocommit=True):
"""
Connect to the database, and return a handle to it
Arguments:
dsn - A data source name to use in connecting to the database. If
th... | """
Functions for connecting to the pScheduler database
"""
import os
import psycopg2
import sys
from filestring import string_from_file
def pg_connection(dsn='', autocommit=True, name=None):
"""
Connect to the database, and return a handle to it
Arguments:
dsn - A data source name to use in connec... | <commit_before>"""
Functions for connecting to the pScheduler database
"""
import psycopg2
from filestring import string_from_file
def pg_connection(dsn='', autocommit=True):
"""
Connect to the database, and return a handle to it
Arguments:
dsn - A data source name to use in connecting to the datab... | """
Functions for connecting to the pScheduler database
"""
import os
import psycopg2
import sys
from filestring import string_from_file
def pg_connection(dsn='', autocommit=True, name=None):
"""
Connect to the database, and return a handle to it
Arguments:
dsn - A data source name to use in connec... | """
Functions for connecting to the pScheduler database
"""
import psycopg2
from filestring import string_from_file
def pg_connection(dsn='', autocommit=True):
"""
Connect to the database, and return a handle to it
Arguments:
dsn - A data source name to use in connecting to the database. If
th... | <commit_before>"""
Functions for connecting to the pScheduler database
"""
import psycopg2
from filestring import string_from_file
def pg_connection(dsn='', autocommit=True):
"""
Connect to the database, and return a handle to it
Arguments:
dsn - A data source name to use in connecting to the datab... |
b34634c0c9a8db389ed48b50ca4b2e4b92105f93 | node/dictionary.py | node/dictionary.py | #!/usr/bin/env python
from nodes import Node
import json
class Dictionary(Node):
char = ".d"
args = 0
results = 1
def __init__(self, word_ids:Node.IntList):
if not hasattr(Dictionary, "word_list"):
Dictionary.word_list = init_words()
self.words = " ".join(Dictionary.wo... | #!/usr/bin/env python
from nodes import Node
import json
class Dictionary(Node):
char = ".d"
args = 0
results = 1
def __init__(self, word_ids:Node.IntList):
if not hasattr(Dictionary, "word_list"):
Dictionary.word_list = init_words()
self.words = " ".join(Dictionary.wo... | Add some exception handling for dict | Add some exception handling for dict
| Python | mit | muddyfish/PYKE,muddyfish/PYKE | #!/usr/bin/env python
from nodes import Node
import json
class Dictionary(Node):
char = ".d"
args = 0
results = 1
def __init__(self, word_ids:Node.IntList):
if not hasattr(Dictionary, "word_list"):
Dictionary.word_list = init_words()
self.words = " ".join(Dictionary.wo... | #!/usr/bin/env python
from nodes import Node
import json
class Dictionary(Node):
char = ".d"
args = 0
results = 1
def __init__(self, word_ids:Node.IntList):
if not hasattr(Dictionary, "word_list"):
Dictionary.word_list = init_words()
self.words = " ".join(Dictionary.wo... | <commit_before>#!/usr/bin/env python
from nodes import Node
import json
class Dictionary(Node):
char = ".d"
args = 0
results = 1
def __init__(self, word_ids:Node.IntList):
if not hasattr(Dictionary, "word_list"):
Dictionary.word_list = init_words()
self.words = " ".joi... | #!/usr/bin/env python
from nodes import Node
import json
class Dictionary(Node):
char = ".d"
args = 0
results = 1
def __init__(self, word_ids:Node.IntList):
if not hasattr(Dictionary, "word_list"):
Dictionary.word_list = init_words()
self.words = " ".join(Dictionary.wo... | #!/usr/bin/env python
from nodes import Node
import json
class Dictionary(Node):
char = ".d"
args = 0
results = 1
def __init__(self, word_ids:Node.IntList):
if not hasattr(Dictionary, "word_list"):
Dictionary.word_list = init_words()
self.words = " ".join(Dictionary.wo... | <commit_before>#!/usr/bin/env python
from nodes import Node
import json
class Dictionary(Node):
char = ".d"
args = 0
results = 1
def __init__(self, word_ids:Node.IntList):
if not hasattr(Dictionary, "word_list"):
Dictionary.word_list = init_words()
self.words = " ".joi... |
404b7af74fb65299aa9c14e0e40541e3a4a68285 | setuptools/command/bdist_wininst.py | setuptools/command/bdist_wininst.py | from distutils.command.bdist_wininst import bdist_wininst as _bdist_wininst
class bdist_wininst(_bdist_wininst):
def reinitialize_command(self, command, reinit_subcommands=0):
cmd = self.distribution.reinitialize_command(
command, reinit_subcommands)
if command in ('install', 'install_l... | from distutils.command.bdist_wininst import bdist_wininst as _bdist_wininst
class bdist_wininst(_bdist_wininst):
def reinitialize_command(self, command, reinit_subcommands=0):
"""
Supplement reinitialize_command to work around
http://bugs.python.org/issue20819
"""
cmd = self... | Update workaround to reference filed ticket. | Update workaround to reference filed ticket.
| Python | mit | pypa/setuptools,pypa/setuptools,pypa/setuptools | from distutils.command.bdist_wininst import bdist_wininst as _bdist_wininst
class bdist_wininst(_bdist_wininst):
def reinitialize_command(self, command, reinit_subcommands=0):
cmd = self.distribution.reinitialize_command(
command, reinit_subcommands)
if command in ('install', 'install_l... | from distutils.command.bdist_wininst import bdist_wininst as _bdist_wininst
class bdist_wininst(_bdist_wininst):
def reinitialize_command(self, command, reinit_subcommands=0):
"""
Supplement reinitialize_command to work around
http://bugs.python.org/issue20819
"""
cmd = self... | <commit_before>from distutils.command.bdist_wininst import bdist_wininst as _bdist_wininst
class bdist_wininst(_bdist_wininst):
def reinitialize_command(self, command, reinit_subcommands=0):
cmd = self.distribution.reinitialize_command(
command, reinit_subcommands)
if command in ('insta... | from distutils.command.bdist_wininst import bdist_wininst as _bdist_wininst
class bdist_wininst(_bdist_wininst):
def reinitialize_command(self, command, reinit_subcommands=0):
"""
Supplement reinitialize_command to work around
http://bugs.python.org/issue20819
"""
cmd = self... | from distutils.command.bdist_wininst import bdist_wininst as _bdist_wininst
class bdist_wininst(_bdist_wininst):
def reinitialize_command(self, command, reinit_subcommands=0):
cmd = self.distribution.reinitialize_command(
command, reinit_subcommands)
if command in ('install', 'install_l... | <commit_before>from distutils.command.bdist_wininst import bdist_wininst as _bdist_wininst
class bdist_wininst(_bdist_wininst):
def reinitialize_command(self, command, reinit_subcommands=0):
cmd = self.distribution.reinitialize_command(
command, reinit_subcommands)
if command in ('insta... |
efe06967b4896c7d2d4c88fbda96a0504959594b | opps/core/admin.py | opps/core/admin.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
class PublishableAdmin(admin.ModelAdmin):
"""
Overrides standard admin.ModelAdmin save_model method
It sets user (author) based on data from requet.
"""
def save_model(self, request, obj, form, change):
if getat... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
class PublishableAdmin(admin.ModelAdmin):
"""
Overrides standard admin.ModelAdmin save_model method
It sets user (author) based on data from requet.
"""
list_display = ['title', 'channel', 'date_available', 'published']... | Add basic attr on PublishableAdmin | Add basic attr on PublishableAdmin
| Python | mit | williamroot/opps,williamroot/opps,jeanmask/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,opps/opps,YACOWS/opps,jeanmask/opps,williamroot/opps,YACOWS/opps,YACOWS/opps,opps/opps,jeanmask/opps,opps/opps,opps/opps | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
class PublishableAdmin(admin.ModelAdmin):
"""
Overrides standard admin.ModelAdmin save_model method
It sets user (author) based on data from requet.
"""
def save_model(self, request, obj, form, change):
if getat... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
class PublishableAdmin(admin.ModelAdmin):
"""
Overrides standard admin.ModelAdmin save_model method
It sets user (author) based on data from requet.
"""
list_display = ['title', 'channel', 'date_available', 'published']... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
class PublishableAdmin(admin.ModelAdmin):
"""
Overrides standard admin.ModelAdmin save_model method
It sets user (author) based on data from requet.
"""
def save_model(self, request, obj, form, change):
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
class PublishableAdmin(admin.ModelAdmin):
"""
Overrides standard admin.ModelAdmin save_model method
It sets user (author) based on data from requet.
"""
list_display = ['title', 'channel', 'date_available', 'published']... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
class PublishableAdmin(admin.ModelAdmin):
"""
Overrides standard admin.ModelAdmin save_model method
It sets user (author) based on data from requet.
"""
def save_model(self, request, obj, form, change):
if getat... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
class PublishableAdmin(admin.ModelAdmin):
"""
Overrides standard admin.ModelAdmin save_model method
It sets user (author) based on data from requet.
"""
def save_model(self, request, obj, form, change):
... |
927172b383e1c62b9aab34f38ef95e96ed277cbe | conda_env/specs/yaml_file.py | conda_env/specs/yaml_file.py | from .. import env
from ..exceptions import EnvironmentFileNotFound
class YamlFileSpec(object):
_environment = None
def __init__(self, filename=None, **kwargs):
self.filename = filename
self.msg = None
def can_handle(self):
try:
self._environment = env.from_file(self.... | from .. import env
from ..exceptions import EnvironmentFileNotFound
class YamlFileSpec(object):
_environment = None
def __init__(self, filename=None, **kwargs):
self.filename = filename
self.msg = None
def can_handle(self):
try:
self._environment = env.from_file(self.... | Update Python 2-style exception handling to 'as' | Update Python 2-style exception handling to 'as'
| Python | bsd-3-clause | isaac-kit/conda-env,asmeurer/conda-env,mikecroucher/conda-env,isaac-kit/conda-env,conda/conda-env,ESSS/conda-env,ESSS/conda-env,dan-blanchard/conda-env,nicoddemus/conda-env,asmeurer/conda-env,conda/conda-env,phobson/conda-env,nicoddemus/conda-env,mikecroucher/conda-env,dan-blanchard/conda-env,phobson/conda-env | from .. import env
from ..exceptions import EnvironmentFileNotFound
class YamlFileSpec(object):
_environment = None
def __init__(self, filename=None, **kwargs):
self.filename = filename
self.msg = None
def can_handle(self):
try:
self._environment = env.from_file(self.... | from .. import env
from ..exceptions import EnvironmentFileNotFound
class YamlFileSpec(object):
_environment = None
def __init__(self, filename=None, **kwargs):
self.filename = filename
self.msg = None
def can_handle(self):
try:
self._environment = env.from_file(self.... | <commit_before>from .. import env
from ..exceptions import EnvironmentFileNotFound
class YamlFileSpec(object):
_environment = None
def __init__(self, filename=None, **kwargs):
self.filename = filename
self.msg = None
def can_handle(self):
try:
self._environment = env.... | from .. import env
from ..exceptions import EnvironmentFileNotFound
class YamlFileSpec(object):
_environment = None
def __init__(self, filename=None, **kwargs):
self.filename = filename
self.msg = None
def can_handle(self):
try:
self._environment = env.from_file(self.... | from .. import env
from ..exceptions import EnvironmentFileNotFound
class YamlFileSpec(object):
_environment = None
def __init__(self, filename=None, **kwargs):
self.filename = filename
self.msg = None
def can_handle(self):
try:
self._environment = env.from_file(self.... | <commit_before>from .. import env
from ..exceptions import EnvironmentFileNotFound
class YamlFileSpec(object):
_environment = None
def __init__(self, filename=None, **kwargs):
self.filename = filename
self.msg = None
def can_handle(self):
try:
self._environment = env.... |
db751eabb690af3b2b4712f46a41b41c1e0499a2 | lbrynet/__init__.py | lbrynet/__init__.py | import logging
__version__ = "0.17.1"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
| import logging
__version__ = "0.17.2rc1"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
| Bump version 0.17.1 --> 0.17.2rc1 | Bump version 0.17.1 --> 0.17.2rc1
Signed-off-by: Jack Robison <40884020c67726395ea162083a125620dc32cdab@lbry.io>
| Python | mit | lbryio/lbry,lbryio/lbry,lbryio/lbry | import logging
__version__ = "0.17.1"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
Bump version 0.17.1 --> 0.17.2rc1
Signed-off-by: Jack Robison <40884020c67726395ea162083a125620dc32cdab@lbry.io> | import logging
__version__ = "0.17.2rc1"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
| <commit_before>import logging
__version__ = "0.17.1"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
<commit_msg>Bump version 0.17.1 --> 0.17.2rc1
Signed-off-by: Jack Robison <40884020c67726395ea162083a125620dc32cdab@lbry.io><commit_after> | import logging
__version__ = "0.17.2rc1"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
| import logging
__version__ = "0.17.1"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
Bump version 0.17.1 --> 0.17.2rc1
Signed-off-by: Jack Robison <40884020c67726395ea162083a125620dc32cdab@lbry.io>import logging
__version__ = "0.17.2rc1"
version = tuple(__versi... | <commit_before>import logging
__version__ = "0.17.1"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
<commit_msg>Bump version 0.17.1 --> 0.17.2rc1
Signed-off-by: Jack Robison <40884020c67726395ea162083a125620dc32cdab@lbry.io><commit_after>import logging
__versio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.