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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
435e8fc4d9ad8c071a96e37e483fcbc194a94fc6 | tests/integration/files/file/base/_modules/runtests_decorators.py | tests/integration/files/file/base/_modules/runtests_decorators.py | # -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
import time
# Import Salt libs
import salt.utils.decorators
def _fallbackfunc():
return False, 'fallback'
def working_function():
'''
CLI Example:
.. code-block:: bash
'''
return True
@salt.utils.decorato... | # -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
import time
# Import Salt libs
import salt.utils.decorators
def _fallbackfunc():
return False, 'fallback'
def working_function():
'''
CLI Example:
.. code-block:: bash
'''
return True
@salt.utils.decorat... | Fix tests: add module function docstring | Fix tests: add module function docstring
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | # -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
import time
# Import Salt libs
import salt.utils.decorators
def _fallbackfunc():
return False, 'fallback'
def working_function():
'''
CLI Example:
.. code-block:: bash
'''
return True
@salt.utils.decorato... | # -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
import time
# Import Salt libs
import salt.utils.decorators
def _fallbackfunc():
return False, 'fallback'
def working_function():
'''
CLI Example:
.. code-block:: bash
'''
return True
@salt.utils.decorat... | <commit_before># -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
import time
# Import Salt libs
import salt.utils.decorators
def _fallbackfunc():
return False, 'fallback'
def working_function():
'''
CLI Example:
.. code-block:: bash
'''
return True
@salt... | # -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
import time
# Import Salt libs
import salt.utils.decorators
def _fallbackfunc():
return False, 'fallback'
def working_function():
'''
CLI Example:
.. code-block:: bash
'''
return True
@salt.utils.decorat... | # -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
import time
# Import Salt libs
import salt.utils.decorators
def _fallbackfunc():
return False, 'fallback'
def working_function():
'''
CLI Example:
.. code-block:: bash
'''
return True
@salt.utils.decorato... | <commit_before># -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
import time
# Import Salt libs
import salt.utils.decorators
def _fallbackfunc():
return False, 'fallback'
def working_function():
'''
CLI Example:
.. code-block:: bash
'''
return True
@salt... |
75a70e31791c523da6bf6b0ce4409a77f2784ed5 | byceps/services/user/transfer/models.py | byceps/services/user/transfer/models.py | """
byceps.services.user.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from typing import Optional
from attr import attrs
from ....typing import UserID
@attrs(auto_attribs=True, frozen=True, slots=True)
class Us... | """
byceps.services.user.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from dataclasses import dataclass
from typing import Optional
from ....typing import UserID
@dataclass(frozen=True)
class User:
id: UserI... | Change user transfer model from `attrs` to `dataclass` | Change user transfer model from `attrs` to `dataclass`
| Python | bsd-3-clause | m-ober/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | """
byceps.services.user.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from typing import Optional
from attr import attrs
from ....typing import UserID
@attrs(auto_attribs=True, frozen=True, slots=True)
class Us... | """
byceps.services.user.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from dataclasses import dataclass
from typing import Optional
from ....typing import UserID
@dataclass(frozen=True)
class User:
id: UserI... | <commit_before>"""
byceps.services.user.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from typing import Optional
from attr import attrs
from ....typing import UserID
@attrs(auto_attribs=True, frozen=True, slots... | """
byceps.services.user.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from dataclasses import dataclass
from typing import Optional
from ....typing import UserID
@dataclass(frozen=True)
class User:
id: UserI... | """
byceps.services.user.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from typing import Optional
from attr import attrs
from ....typing import UserID
@attrs(auto_attribs=True, frozen=True, slots=True)
class Us... | <commit_before>"""
byceps.services.user.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from typing import Optional
from attr import attrs
from ....typing import UserID
@attrs(auto_attribs=True, frozen=True, slots... |
60a4da0ea090e95ad566743b5ceba874d051d8d9 | pronto/serializers/obo.py | pronto/serializers/obo.py | import io
from typing import BinaryIO, ClassVar
from ._fastobo import FastoboSerializer
from .base import BaseSerializer
class OboSerializer(FastoboSerializer, BaseSerializer):
format = "obo"
def dump(self, file):
writer = io.TextIOWrapper(file)
try:
# dump the header
... | import io
from typing import BinaryIO, ClassVar
from ._fastobo import FastoboSerializer
from .base import BaseSerializer
class OboSerializer(FastoboSerializer, BaseSerializer):
format = "obo"
def dump(self, file):
writer = io.TextIOWrapper(file)
try:
# dump the header
... | Fix bug in OboSerializer` causing `Ontology.dump` to crash | Fix bug in OboSerializer` causing `Ontology.dump` to crash
| Python | mit | althonos/pronto | import io
from typing import BinaryIO, ClassVar
from ._fastobo import FastoboSerializer
from .base import BaseSerializer
class OboSerializer(FastoboSerializer, BaseSerializer):
format = "obo"
def dump(self, file):
writer = io.TextIOWrapper(file)
try:
# dump the header
... | import io
from typing import BinaryIO, ClassVar
from ._fastobo import FastoboSerializer
from .base import BaseSerializer
class OboSerializer(FastoboSerializer, BaseSerializer):
format = "obo"
def dump(self, file):
writer = io.TextIOWrapper(file)
try:
# dump the header
... | <commit_before>import io
from typing import BinaryIO, ClassVar
from ._fastobo import FastoboSerializer
from .base import BaseSerializer
class OboSerializer(FastoboSerializer, BaseSerializer):
format = "obo"
def dump(self, file):
writer = io.TextIOWrapper(file)
try:
# dump the he... | import io
from typing import BinaryIO, ClassVar
from ._fastobo import FastoboSerializer
from .base import BaseSerializer
class OboSerializer(FastoboSerializer, BaseSerializer):
format = "obo"
def dump(self, file):
writer = io.TextIOWrapper(file)
try:
# dump the header
... | import io
from typing import BinaryIO, ClassVar
from ._fastobo import FastoboSerializer
from .base import BaseSerializer
class OboSerializer(FastoboSerializer, BaseSerializer):
format = "obo"
def dump(self, file):
writer = io.TextIOWrapper(file)
try:
# dump the header
... | <commit_before>import io
from typing import BinaryIO, ClassVar
from ._fastobo import FastoboSerializer
from .base import BaseSerializer
class OboSerializer(FastoboSerializer, BaseSerializer):
format = "obo"
def dump(self, file):
writer = io.TextIOWrapper(file)
try:
# dump the he... |
e51d35545d038b5cb7035cc74f39e4a5c2b0756a | thinglang/execution/classes.py | thinglang/execution/classes.py | from thinglang.lexer.symbols.base import LexicalIdentifier
class ThingInstance(object):
def __init__(self, cls):
self.cls = cls
self.methods = {
x.name: x for x in self.cls.children
}
self.members = {}
def __contains__(self, item):
return item in self.memb... | from thinglang.lexer.symbols.base import LexicalIdentifier
class ThingInstance(object):
def __init__(self, cls):
self.cls = cls
self.methods = {
x.name: x for x in self.cls.children
}
self.members = {}
def __contains__(self, item):
return item in self.memb... | Fix bug in ThingInstace __setitem__ | Fix bug in ThingInstace __setitem__
| Python | mit | ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang | from thinglang.lexer.symbols.base import LexicalIdentifier
class ThingInstance(object):
def __init__(self, cls):
self.cls = cls
self.methods = {
x.name: x for x in self.cls.children
}
self.members = {}
def __contains__(self, item):
return item in self.memb... | from thinglang.lexer.symbols.base import LexicalIdentifier
class ThingInstance(object):
def __init__(self, cls):
self.cls = cls
self.methods = {
x.name: x for x in self.cls.children
}
self.members = {}
def __contains__(self, item):
return item in self.memb... | <commit_before>from thinglang.lexer.symbols.base import LexicalIdentifier
class ThingInstance(object):
def __init__(self, cls):
self.cls = cls
self.methods = {
x.name: x for x in self.cls.children
}
self.members = {}
def __contains__(self, item):
return it... | from thinglang.lexer.symbols.base import LexicalIdentifier
class ThingInstance(object):
def __init__(self, cls):
self.cls = cls
self.methods = {
x.name: x for x in self.cls.children
}
self.members = {}
def __contains__(self, item):
return item in self.memb... | from thinglang.lexer.symbols.base import LexicalIdentifier
class ThingInstance(object):
def __init__(self, cls):
self.cls = cls
self.methods = {
x.name: x for x in self.cls.children
}
self.members = {}
def __contains__(self, item):
return item in self.memb... | <commit_before>from thinglang.lexer.symbols.base import LexicalIdentifier
class ThingInstance(object):
def __init__(self, cls):
self.cls = cls
self.methods = {
x.name: x for x in self.cls.children
}
self.members = {}
def __contains__(self, item):
return it... |
428938d5775d973822a0f72aa2ce54ae9e14d429 | main.py | main.py | #!/usr/bin/env python3
"""TODO:
* more flexible sorting options
* use -o to specify output file
* check more explicitly for errors in JSON files
"""
import json, sys
if len(sys.argv) > 1:
inFn = sys.argv[1]
with open(inFn, 'r') as f:
try:
defs = json.load(f)
except:
sys.exit('{} has a... | #!/usr/bin/env python3
"""TODO:
* more flexible sorting options
* use -o to specify output file
* check more explicitly for errors in JSON files
"""
import json, sys
if len(sys.argv) > 1:
inFn = sys.argv[1]
with open(inFn, 'r') as f:
try:
defs = json.load(f)
except:
sys.exit('{} has a... | Add newlines in output for formatting purposes | Add newlines in output for formatting purposes
| Python | mit | JoshuaBrockschmidt/dictbuilder | #!/usr/bin/env python3
"""TODO:
* more flexible sorting options
* use -o to specify output file
* check more explicitly for errors in JSON files
"""
import json, sys
if len(sys.argv) > 1:
inFn = sys.argv[1]
with open(inFn, 'r') as f:
try:
defs = json.load(f)
except:
sys.exit('{} has a... | #!/usr/bin/env python3
"""TODO:
* more flexible sorting options
* use -o to specify output file
* check more explicitly for errors in JSON files
"""
import json, sys
if len(sys.argv) > 1:
inFn = sys.argv[1]
with open(inFn, 'r') as f:
try:
defs = json.load(f)
except:
sys.exit('{} has a... | <commit_before>#!/usr/bin/env python3
"""TODO:
* more flexible sorting options
* use -o to specify output file
* check more explicitly for errors in JSON files
"""
import json, sys
if len(sys.argv) > 1:
inFn = sys.argv[1]
with open(inFn, 'r') as f:
try:
defs = json.load(f)
except:
sys... | #!/usr/bin/env python3
"""TODO:
* more flexible sorting options
* use -o to specify output file
* check more explicitly for errors in JSON files
"""
import json, sys
if len(sys.argv) > 1:
inFn = sys.argv[1]
with open(inFn, 'r') as f:
try:
defs = json.load(f)
except:
sys.exit('{} has a... | #!/usr/bin/env python3
"""TODO:
* more flexible sorting options
* use -o to specify output file
* check more explicitly for errors in JSON files
"""
import json, sys
if len(sys.argv) > 1:
inFn = sys.argv[1]
with open(inFn, 'r') as f:
try:
defs = json.load(f)
except:
sys.exit('{} has a... | <commit_before>#!/usr/bin/env python3
"""TODO:
* more flexible sorting options
* use -o to specify output file
* check more explicitly for errors in JSON files
"""
import json, sys
if len(sys.argv) > 1:
inFn = sys.argv[1]
with open(inFn, 'r') as f:
try:
defs = json.load(f)
except:
sys... |
d51bc62e18a3589ad840bbc26952bac14acaf264 | main.py | main.py | #!/usr/bin/env python
import os
import jinja2
import webapp2
JINJA_ENVIRONMENT = jinja2.Environment(
loader = jinja2.FileSystemLoader(os.path.join(os.path.dirname(__file__), 'html')),
extensions = ['jinja2.ext.autoescape']
)
class MainHandler(webapp2.RequestHandler):
def get(self):
values = { 'v... | #!/usr/bin/env python
import os
import jinja2
import webapp2
JINJA_ENVIRONMENT = jinja2.Environment(
loader = jinja2.FileSystemLoader(os.path.join(os.path.dirname(__file__), 'html')),
extensions = ['jinja2.ext.autoescape']
)
class MainHandler(webapp2.RequestHandler):
def get(self):
self.response... | Remove template variables (not needed) | Remove template variables (not needed)
| Python | bsd-3-clause | siddhantgoel/so-instant,siddhantgoel/so-instant | #!/usr/bin/env python
import os
import jinja2
import webapp2
JINJA_ENVIRONMENT = jinja2.Environment(
loader = jinja2.FileSystemLoader(os.path.join(os.path.dirname(__file__), 'html')),
extensions = ['jinja2.ext.autoescape']
)
class MainHandler(webapp2.RequestHandler):
def get(self):
values = { 'v... | #!/usr/bin/env python
import os
import jinja2
import webapp2
JINJA_ENVIRONMENT = jinja2.Environment(
loader = jinja2.FileSystemLoader(os.path.join(os.path.dirname(__file__), 'html')),
extensions = ['jinja2.ext.autoescape']
)
class MainHandler(webapp2.RequestHandler):
def get(self):
self.response... | <commit_before>#!/usr/bin/env python
import os
import jinja2
import webapp2
JINJA_ENVIRONMENT = jinja2.Environment(
loader = jinja2.FileSystemLoader(os.path.join(os.path.dirname(__file__), 'html')),
extensions = ['jinja2.ext.autoescape']
)
class MainHandler(webapp2.RequestHandler):
def get(self):
... | #!/usr/bin/env python
import os
import jinja2
import webapp2
JINJA_ENVIRONMENT = jinja2.Environment(
loader = jinja2.FileSystemLoader(os.path.join(os.path.dirname(__file__), 'html')),
extensions = ['jinja2.ext.autoescape']
)
class MainHandler(webapp2.RequestHandler):
def get(self):
self.response... | #!/usr/bin/env python
import os
import jinja2
import webapp2
JINJA_ENVIRONMENT = jinja2.Environment(
loader = jinja2.FileSystemLoader(os.path.join(os.path.dirname(__file__), 'html')),
extensions = ['jinja2.ext.autoescape']
)
class MainHandler(webapp2.RequestHandler):
def get(self):
values = { 'v... | <commit_before>#!/usr/bin/env python
import os
import jinja2
import webapp2
JINJA_ENVIRONMENT = jinja2.Environment(
loader = jinja2.FileSystemLoader(os.path.join(os.path.dirname(__file__), 'html')),
extensions = ['jinja2.ext.autoescape']
)
class MainHandler(webapp2.RequestHandler):
def get(self):
... |
324f05e1cbffdad2da209a7ee515f1d9a32cf93b | main.py | main.py | #!/usr/bin/env python
import sys
import json
from pprint import pprint
try:
import requests
except ImportError:
print(
'Script requires requests package. \n'
'You can install it by running "pip install requests"'
)
exit()
API_URL = 'http://jsonplaceholder.typicode.com/posts/'
def get_... | #!/usr/bin/env python
import sys
import json
from pprint import pprint
try:
import requests
except ImportError:
print(
'Script requires requests package. \n'
'You can install it by running "pip install requests"'
)
exit()
API_URL = 'http://jsonplaceholder.typicode.com/posts/'
def get_... | Add message about starting loading data | Add message about starting loading data
| Python | mit | sevazhidkov/rest-wrapper | #!/usr/bin/env python
import sys
import json
from pprint import pprint
try:
import requests
except ImportError:
print(
'Script requires requests package. \n'
'You can install it by running "pip install requests"'
)
exit()
API_URL = 'http://jsonplaceholder.typicode.com/posts/'
def get_... | #!/usr/bin/env python
import sys
import json
from pprint import pprint
try:
import requests
except ImportError:
print(
'Script requires requests package. \n'
'You can install it by running "pip install requests"'
)
exit()
API_URL = 'http://jsonplaceholder.typicode.com/posts/'
def get_... | <commit_before>#!/usr/bin/env python
import sys
import json
from pprint import pprint
try:
import requests
except ImportError:
print(
'Script requires requests package. \n'
'You can install it by running "pip install requests"'
)
exit()
API_URL = 'http://jsonplaceholder.typicode.com/pos... | #!/usr/bin/env python
import sys
import json
from pprint import pprint
try:
import requests
except ImportError:
print(
'Script requires requests package. \n'
'You can install it by running "pip install requests"'
)
exit()
API_URL = 'http://jsonplaceholder.typicode.com/posts/'
def get_... | #!/usr/bin/env python
import sys
import json
from pprint import pprint
try:
import requests
except ImportError:
print(
'Script requires requests package. \n'
'You can install it by running "pip install requests"'
)
exit()
API_URL = 'http://jsonplaceholder.typicode.com/posts/'
def get_... | <commit_before>#!/usr/bin/env python
import sys
import json
from pprint import pprint
try:
import requests
except ImportError:
print(
'Script requires requests package. \n'
'You can install it by running "pip install requests"'
)
exit()
API_URL = 'http://jsonplaceholder.typicode.com/pos... |
42804d3182b9b7489583250856e31a8daaef5fa3 | protolint/__init__.py | protolint/__init__.py | # -*- coding: utf-8 -*-
"""
protolint
~~~~~~~~~
"""
from . import cli
from . import linter
from . import output
__version__ = (1, 0, 0)
| # -*- coding: utf-8 -*-
"""
protolint
~~~~~~~~~
"""
__version__ = (1, 0, 0)
from . import cli
from . import linter
from . import output
| Fix CLI module during build | Fix CLI module during build
| Python | mit | sgammon/codeclimate-protobuf,sgammon/codeclimate-protobuf | # -*- coding: utf-8 -*-
"""
protolint
~~~~~~~~~
"""
from . import cli
from . import linter
from . import output
__version__ = (1, 0, 0)
Fix CLI module during build | # -*- coding: utf-8 -*-
"""
protolint
~~~~~~~~~
"""
__version__ = (1, 0, 0)
from . import cli
from . import linter
from . import output
| <commit_before># -*- coding: utf-8 -*-
"""
protolint
~~~~~~~~~
"""
from . import cli
from . import linter
from . import output
__version__ = (1, 0, 0)
<commit_msg>Fix CLI module during build<commit_after> | # -*- coding: utf-8 -*-
"""
protolint
~~~~~~~~~
"""
__version__ = (1, 0, 0)
from . import cli
from . import linter
from . import output
| # -*- coding: utf-8 -*-
"""
protolint
~~~~~~~~~
"""
from . import cli
from . import linter
from . import output
__version__ = (1, 0, 0)
Fix CLI module during build# -*- coding: utf-8 -*-
"""
protolint
~~~~~~~~~
"""
__version__ = (1, 0, 0)
from . import cli
from . import linter
from . import output
| <commit_before># -*- coding: utf-8 -*-
"""
protolint
~~~~~~~~~
"""
from . import cli
from . import linter
from . import output
__version__ = (1, 0, 0)
<commit_msg>Fix CLI module during build<commit_after># -*- coding: utf-8 -*-
"""
protolint
~~~~~~~~~
"""
__version__ = (1, 0, 0)
from . import cli
from... |
746d3e5aba7b4fb9bfd6c258c80b6a4565de4844 | py/oldfart/handler.py | py/oldfart/handler.py | import http.server
import os
import oldfart.make
__all__ = ['make_http_request_handler_class']
def _send_head(self):
# FIXME: We die here if the directory doesn't exist ('make clean' anyone?)
path = self.translate_path(self.path)
target = os.path.relpath(path, self.maker.project_dir)
if not os.path... | import http.server
import os
import oldfart.make
__all__ = ['make_http_request_handler_class']
def _send_head(self):
# FIXME: We die here if the directory doesn't exist ('make clean' anyone?)
path = self.translate_path(self.path)
target = os.path.relpath(path, self.maker.project_dir)
if not os.path... | Stop handling after responding with 500 | Bugfix: Stop handling after responding with 500
| Python | bsd-3-clause | mjhanninen/oldfart,mjhanninen/oldfart,mjhanninen/oldfart | import http.server
import os
import oldfart.make
__all__ = ['make_http_request_handler_class']
def _send_head(self):
# FIXME: We die here if the directory doesn't exist ('make clean' anyone?)
path = self.translate_path(self.path)
target = os.path.relpath(path, self.maker.project_dir)
if not os.path... | import http.server
import os
import oldfart.make
__all__ = ['make_http_request_handler_class']
def _send_head(self):
# FIXME: We die here if the directory doesn't exist ('make clean' anyone?)
path = self.translate_path(self.path)
target = os.path.relpath(path, self.maker.project_dir)
if not os.path... | <commit_before>import http.server
import os
import oldfart.make
__all__ = ['make_http_request_handler_class']
def _send_head(self):
# FIXME: We die here if the directory doesn't exist ('make clean' anyone?)
path = self.translate_path(self.path)
target = os.path.relpath(path, self.maker.project_dir)
... | import http.server
import os
import oldfart.make
__all__ = ['make_http_request_handler_class']
def _send_head(self):
# FIXME: We die here if the directory doesn't exist ('make clean' anyone?)
path = self.translate_path(self.path)
target = os.path.relpath(path, self.maker.project_dir)
if not os.path... | import http.server
import os
import oldfart.make
__all__ = ['make_http_request_handler_class']
def _send_head(self):
# FIXME: We die here if the directory doesn't exist ('make clean' anyone?)
path = self.translate_path(self.path)
target = os.path.relpath(path, self.maker.project_dir)
if not os.path... | <commit_before>import http.server
import os
import oldfart.make
__all__ = ['make_http_request_handler_class']
def _send_head(self):
# FIXME: We die here if the directory doesn't exist ('make clean' anyone?)
path = self.translate_path(self.path)
target = os.path.relpath(path, self.maker.project_dir)
... |
baa088e1e6cc503b9f0bcfbacf62327a6527550b | kmeldb/mounts.py | kmeldb/mounts.py | import os
def get_fat_mounts():
fat_mounts = []
mounts = os.popen('mount')
for line in mounts.readlines():
device, ign1, mount_point, ign2, filesystem, options = line.split()
if 'fat' in filesystem:
fat_mounts.append((mount_point, filesystem, device))
return fat_mounts
de... | import os
try:
import psutil
except ImportError:
print('Falling back to parsing mounts output')
HAVE_PSUTIL = False
else:
print('Using psutil')
HAVE_PSUTIL = True
def get_fat_mounts():
# global HAVE_PSUTIL
# HAVE_PSUTIL = False
fat_mounts = []
if HAVE_PSUTIL:
partitions =... | Use psutil.disk_partitions to get FAT formatted partitions. | Use psutil.disk_partitions to get FAT formatted partitions.
| Python | apache-2.0 | chrrrisw/kmel_db,chrrrisw/kmel_db | import os
def get_fat_mounts():
fat_mounts = []
mounts = os.popen('mount')
for line in mounts.readlines():
device, ign1, mount_point, ign2, filesystem, options = line.split()
if 'fat' in filesystem:
fat_mounts.append((mount_point, filesystem, device))
return fat_mounts
de... | import os
try:
import psutil
except ImportError:
print('Falling back to parsing mounts output')
HAVE_PSUTIL = False
else:
print('Using psutil')
HAVE_PSUTIL = True
def get_fat_mounts():
# global HAVE_PSUTIL
# HAVE_PSUTIL = False
fat_mounts = []
if HAVE_PSUTIL:
partitions =... | <commit_before>import os
def get_fat_mounts():
fat_mounts = []
mounts = os.popen('mount')
for line in mounts.readlines():
device, ign1, mount_point, ign2, filesystem, options = line.split()
if 'fat' in filesystem:
fat_mounts.append((mount_point, filesystem, device))
return ... | import os
try:
import psutil
except ImportError:
print('Falling back to parsing mounts output')
HAVE_PSUTIL = False
else:
print('Using psutil')
HAVE_PSUTIL = True
def get_fat_mounts():
# global HAVE_PSUTIL
# HAVE_PSUTIL = False
fat_mounts = []
if HAVE_PSUTIL:
partitions =... | import os
def get_fat_mounts():
fat_mounts = []
mounts = os.popen('mount')
for line in mounts.readlines():
device, ign1, mount_point, ign2, filesystem, options = line.split()
if 'fat' in filesystem:
fat_mounts.append((mount_point, filesystem, device))
return fat_mounts
de... | <commit_before>import os
def get_fat_mounts():
fat_mounts = []
mounts = os.popen('mount')
for line in mounts.readlines():
device, ign1, mount_point, ign2, filesystem, options = line.split()
if 'fat' in filesystem:
fat_mounts.append((mount_point, filesystem, device))
return ... |
8d9acd9447400608ddc2ab46948c7d05430b3e0b | reviewboard/hostingsvcs/tests/__init__.py | reviewboard/hostingsvcs/tests/__init__.py | from __future__ import unicode_literals
from reviewboard.hostingsvcs.tests.testcases import ServiceTests
__all__ = [
# Backwards-compatibility for third-party modules that used this import.
'ServiceTests',
]
| Add a backwards-compatibility import for ServiceTests. | Add a backwards-compatibility import for ServiceTests.
We had a class, ServiceTests, which was a base testcase class for
hosting service unit tests. This was moved recently, which broke
extensions that provided hosting service unit tests based on this.
This restores the import for now. We may want to create something... | Python | mit | davidt/reviewboard,chipx86/reviewboard,chipx86/reviewboard,davidt/reviewboard,davidt/reviewboard,chipx86/reviewboard,brennie/reviewboard,sgallagher/reviewboard,reviewboard/reviewboard,brennie/reviewboard,brennie/reviewboard,sgallagher/reviewboard,reviewboard/reviewboard,reviewboard/reviewboard,sgallagher/reviewboard,br... | Add a backwards-compatibility import for ServiceTests.
We had a class, ServiceTests, which was a base testcase class for
hosting service unit tests. This was moved recently, which broke
extensions that provided hosting service unit tests based on this.
This restores the import for now. We may want to create something... | from __future__ import unicode_literals
from reviewboard.hostingsvcs.tests.testcases import ServiceTests
__all__ = [
# Backwards-compatibility for third-party modules that used this import.
'ServiceTests',
]
| <commit_before><commit_msg>Add a backwards-compatibility import for ServiceTests.
We had a class, ServiceTests, which was a base testcase class for
hosting service unit tests. This was moved recently, which broke
extensions that provided hosting service unit tests based on this.
This restores the import for now. We m... | from __future__ import unicode_literals
from reviewboard.hostingsvcs.tests.testcases import ServiceTests
__all__ = [
# Backwards-compatibility for third-party modules that used this import.
'ServiceTests',
]
| Add a backwards-compatibility import for ServiceTests.
We had a class, ServiceTests, which was a base testcase class for
hosting service unit tests. This was moved recently, which broke
extensions that provided hosting service unit tests based on this.
This restores the import for now. We may want to create something... | <commit_before><commit_msg>Add a backwards-compatibility import for ServiceTests.
We had a class, ServiceTests, which was a base testcase class for
hosting service unit tests. This was moved recently, which broke
extensions that provided hosting service unit tests based on this.
This restores the import for now. We m... | |
3da48961d140d7d3909760603675785955856afc | recipes/search_indexes.py | recipes/search_indexes.py | import datetime
from haystack import indexes
from recipes.models import Recipe
class RecipeIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
tags = indexes.MultiValueField()
popularity = indexes.DecimalField(model_attr='popularity')
# TODO: ... | import datetime
from django.utils import timezone
from haystack import indexes
from recipes.models import Recipe
class RecipeIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
tags = indexes.MultiValueField()
popularity = indexes.DecimalField(model_... | Fix for 'naive datetime' complaint when running searches | Fix for 'naive datetime' complaint when running searches
| Python | agpl-3.0 | kamni/nodonuts,kamni/nodonuts,kamni/nodonuts,kamni/nodonuts | import datetime
from haystack import indexes
from recipes.models import Recipe
class RecipeIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
tags = indexes.MultiValueField()
popularity = indexes.DecimalField(model_attr='popularity')
# TODO: ... | import datetime
from django.utils import timezone
from haystack import indexes
from recipes.models import Recipe
class RecipeIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
tags = indexes.MultiValueField()
popularity = indexes.DecimalField(model_... | <commit_before>import datetime
from haystack import indexes
from recipes.models import Recipe
class RecipeIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
tags = indexes.MultiValueField()
popularity = indexes.DecimalField(model_attr='popularity')
... | import datetime
from django.utils import timezone
from haystack import indexes
from recipes.models import Recipe
class RecipeIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
tags = indexes.MultiValueField()
popularity = indexes.DecimalField(model_... | import datetime
from haystack import indexes
from recipes.models import Recipe
class RecipeIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
tags = indexes.MultiValueField()
popularity = indexes.DecimalField(model_attr='popularity')
# TODO: ... | <commit_before>import datetime
from haystack import indexes
from recipes.models import Recipe
class RecipeIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
tags = indexes.MultiValueField()
popularity = indexes.DecimalField(model_attr='popularity')
... |
d89e43c649aba78ac9722ca39f9e0c67be0cc897 | precision/accounts/models.py | precision/accounts/models.py | from django.db import models
# Create your models here.
| from django.contrib.auth.models import AbstractUser
from django.db import models
from django.utils.translation import ugettext_lazy as _
class SchoolAdministrator(AbstractUser):
pass
| Add an simple abstract user model for school administrators which will be used later | Add an simple abstract user model for school administrators which will be used later
| Python | mit | FreeCodeCampRoma/precision_school-management,FreeCodeCampRoma/precision_school-management,FreeCodeCampRoma/precision_school-management,FreeCodeCampRoma/precision_school-management | from django.db import models
# Create your models here.
Add an simple abstract user model for school administrators which will be used later | from django.contrib.auth.models import AbstractUser
from django.db import models
from django.utils.translation import ugettext_lazy as _
class SchoolAdministrator(AbstractUser):
pass
| <commit_before>from django.db import models
# Create your models here.
<commit_msg>Add an simple abstract user model for school administrators which will be used later<commit_after> | from django.contrib.auth.models import AbstractUser
from django.db import models
from django.utils.translation import ugettext_lazy as _
class SchoolAdministrator(AbstractUser):
pass
| from django.db import models
# Create your models here.
Add an simple abstract user model for school administrators which will be used laterfrom django.contrib.auth.models import AbstractUser
from django.db import models
from django.utils.translation import ugettext_lazy as _
class SchoolAdministrator(AbstractUser):... | <commit_before>from django.db import models
# Create your models here.
<commit_msg>Add an simple abstract user model for school administrators which will be used later<commit_after>from django.contrib.auth.models import AbstractUser
from django.db import models
from django.utils.translation import ugettext_lazy as _
... |
4a29b5169524205bfa50a89379f4439d0de40296 | refabric/context_managers.py | refabric/context_managers.py | from contextlib import contextmanager
from fabric.context_managers import settings, hide
from fabric.state import env
@contextmanager
def sudo(user=None):
with settings(sudo_user=user or env.sudo_user or env.user, use_sudo=True):
yield
silent = lambda *h: settings(hide('commands', *h), warn_only=True)
... | from contextlib import contextmanager
from fabric.context_managers import settings, hide
from fabric.state import env
from refabric.state import apply_role_definitions
@contextmanager
def sudo(user=None):
with settings(sudo_user=user or env.sudo_user or env.user, use_sudo=True):
yield
@contextmanager
d... | Add role context manager setting role and definitions | Add role context manager setting role and definitions | Python | mit | 5monkeys/refabric | from contextlib import contextmanager
from fabric.context_managers import settings, hide
from fabric.state import env
@contextmanager
def sudo(user=None):
with settings(sudo_user=user or env.sudo_user or env.user, use_sudo=True):
yield
silent = lambda *h: settings(hide('commands', *h), warn_only=True)
... | from contextlib import contextmanager
from fabric.context_managers import settings, hide
from fabric.state import env
from refabric.state import apply_role_definitions
@contextmanager
def sudo(user=None):
with settings(sudo_user=user or env.sudo_user or env.user, use_sudo=True):
yield
@contextmanager
d... | <commit_before>from contextlib import contextmanager
from fabric.context_managers import settings, hide
from fabric.state import env
@contextmanager
def sudo(user=None):
with settings(sudo_user=user or env.sudo_user or env.user, use_sudo=True):
yield
silent = lambda *h: settings(hide('commands', *h), w... | from contextlib import contextmanager
from fabric.context_managers import settings, hide
from fabric.state import env
from refabric.state import apply_role_definitions
@contextmanager
def sudo(user=None):
with settings(sudo_user=user or env.sudo_user or env.user, use_sudo=True):
yield
@contextmanager
d... | from contextlib import contextmanager
from fabric.context_managers import settings, hide
from fabric.state import env
@contextmanager
def sudo(user=None):
with settings(sudo_user=user or env.sudo_user or env.user, use_sudo=True):
yield
silent = lambda *h: settings(hide('commands', *h), warn_only=True)
... | <commit_before>from contextlib import contextmanager
from fabric.context_managers import settings, hide
from fabric.state import env
@contextmanager
def sudo(user=None):
with settings(sudo_user=user or env.sudo_user or env.user, use_sudo=True):
yield
silent = lambda *h: settings(hide('commands', *h), w... |
5748b1a7dc4a5be3b2b9da9959eabe586347078a | tensorflow_federated/python/program/value_reference.py | tensorflow_federated/python/program/value_reference.py | # Copyright 2021, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | # Copyright 2021, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | Update the Value Reference API to be more precise about the types of values being referenced. | Update the Value Reference API to be more precise about the types of values being referenced.
PiperOrigin-RevId: 404647934
| Python | apache-2.0 | tensorflow/federated,tensorflow/federated,tensorflow/federated | # Copyright 2021, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | # Copyright 2021, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | <commit_before># Copyright 2021, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | # Copyright 2021, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | # Copyright 2021, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | <commit_before># Copyright 2021, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... |
622b81296b292035b970891cd259eaac113d20c1 | apps/accounts/conf.py | apps/accounts/conf.py | from django.conf import settings # noqa
from appconf import AppConf
class AccountConf(AppConf):
"""
Custom settings for the account module. Mainly settings required for
the login on the remote system.
"""
PID = 3
LOGIN_TYPE = 'login'
LOGIN_SUCCESS_URL = 'home'
ENFORCE_LOGIN_TIMEOUT = ... | from django.conf import settings # noqa
from appconf import AppConf
class AccountConf(AppConf):
"""
Custom settings for the account module. Mainly settings required for
the login on the remote system.
"""
PID = 3
LOGIN_TYPE = 'login'
LOGIN_SUCCESS_URL = 'home'
ENFORCE_LOGIN_TIMEOUT = ... | Change internal name of UNCCD role back to previous correct value | Change internal name of UNCCD role back to previous correct value
| Python | apache-2.0 | CDE-UNIBE/qcat,CDE-UNIBE/qcat,CDE-UNIBE/qcat,CDE-UNIBE/qcat | from django.conf import settings # noqa
from appconf import AppConf
class AccountConf(AppConf):
"""
Custom settings for the account module. Mainly settings required for
the login on the remote system.
"""
PID = 3
LOGIN_TYPE = 'login'
LOGIN_SUCCESS_URL = 'home'
ENFORCE_LOGIN_TIMEOUT = ... | from django.conf import settings # noqa
from appconf import AppConf
class AccountConf(AppConf):
"""
Custom settings for the account module. Mainly settings required for
the login on the remote system.
"""
PID = 3
LOGIN_TYPE = 'login'
LOGIN_SUCCESS_URL = 'home'
ENFORCE_LOGIN_TIMEOUT = ... | <commit_before>from django.conf import settings # noqa
from appconf import AppConf
class AccountConf(AppConf):
"""
Custom settings for the account module. Mainly settings required for
the login on the remote system.
"""
PID = 3
LOGIN_TYPE = 'login'
LOGIN_SUCCESS_URL = 'home'
ENFORCE_L... | from django.conf import settings # noqa
from appconf import AppConf
class AccountConf(AppConf):
"""
Custom settings for the account module. Mainly settings required for
the login on the remote system.
"""
PID = 3
LOGIN_TYPE = 'login'
LOGIN_SUCCESS_URL = 'home'
ENFORCE_LOGIN_TIMEOUT = ... | from django.conf import settings # noqa
from appconf import AppConf
class AccountConf(AppConf):
"""
Custom settings for the account module. Mainly settings required for
the login on the remote system.
"""
PID = 3
LOGIN_TYPE = 'login'
LOGIN_SUCCESS_URL = 'home'
ENFORCE_LOGIN_TIMEOUT = ... | <commit_before>from django.conf import settings # noqa
from appconf import AppConf
class AccountConf(AppConf):
"""
Custom settings for the account module. Mainly settings required for
the login on the remote system.
"""
PID = 3
LOGIN_TYPE = 'login'
LOGIN_SUCCESS_URL = 'home'
ENFORCE_L... |
6e3151cd9e4c5309959c93b2ed683bb74d88a640 | backend/breach/tests/test_sniffer.py | backend/breach/tests/test_sniffer.py | from mock import patch
from django.test import TestCase
from breach.sniffer import Sniffer
class SnifferTest(TestCase):
def setUp(self):
self.endpoint = 'http://localhost'
self.sniffer = Sniffer(self.endpoint)
self.source_ip = '147.102.239.229'
self.destination_host = 'dionyziz.c... | from mock import patch
from django.test import TestCase
from breach.sniffer import Sniffer
class SnifferTest(TestCase):
def setUp(self):
self.endpoint = 'http://localhost'
self.sniffer = Sniffer(self.endpoint, '147.102.239.229', 'dionyziz.com', 'wlan0', '8080')
@patch('breach.sniffer.request... | Migrate Sniffer unit test to new API | Migrate Sniffer unit test to new API
| Python | mit | esarafianou/rupture,esarafianou/rupture,dimriou/rupture,dimriou/rupture,dimkarakostas/rupture,dimriou/rupture,esarafianou/rupture,dimkarakostas/rupture,dimkarakostas/rupture,esarafianou/rupture,dionyziz/rupture,dionyziz/rupture,dionyziz/rupture,dionyziz/rupture,dimriou/rupture,dimriou/rupture,dionyziz/rupture,dimkarako... | from mock import patch
from django.test import TestCase
from breach.sniffer import Sniffer
class SnifferTest(TestCase):
def setUp(self):
self.endpoint = 'http://localhost'
self.sniffer = Sniffer(self.endpoint)
self.source_ip = '147.102.239.229'
self.destination_host = 'dionyziz.c... | from mock import patch
from django.test import TestCase
from breach.sniffer import Sniffer
class SnifferTest(TestCase):
def setUp(self):
self.endpoint = 'http://localhost'
self.sniffer = Sniffer(self.endpoint, '147.102.239.229', 'dionyziz.com', 'wlan0', '8080')
@patch('breach.sniffer.request... | <commit_before>from mock import patch
from django.test import TestCase
from breach.sniffer import Sniffer
class SnifferTest(TestCase):
def setUp(self):
self.endpoint = 'http://localhost'
self.sniffer = Sniffer(self.endpoint)
self.source_ip = '147.102.239.229'
self.destination_hos... | from mock import patch
from django.test import TestCase
from breach.sniffer import Sniffer
class SnifferTest(TestCase):
def setUp(self):
self.endpoint = 'http://localhost'
self.sniffer = Sniffer(self.endpoint, '147.102.239.229', 'dionyziz.com', 'wlan0', '8080')
@patch('breach.sniffer.request... | from mock import patch
from django.test import TestCase
from breach.sniffer import Sniffer
class SnifferTest(TestCase):
def setUp(self):
self.endpoint = 'http://localhost'
self.sniffer = Sniffer(self.endpoint)
self.source_ip = '147.102.239.229'
self.destination_host = 'dionyziz.c... | <commit_before>from mock import patch
from django.test import TestCase
from breach.sniffer import Sniffer
class SnifferTest(TestCase):
def setUp(self):
self.endpoint = 'http://localhost'
self.sniffer = Sniffer(self.endpoint)
self.source_ip = '147.102.239.229'
self.destination_hos... |
15e713f76f1fbfef26d9a7d3d3c95fac2d8f213e | casepro/settings_production_momza.py | casepro/settings_production_momza.py | from __future__ import unicode_literals
import os
# import our default settings
from settings_production import * # noqa
PODS[0]['contact_id_fieldname'] = os.environ.get( # noqa: F405
'REGISTRATION_CONTACT_ID_FIELDNAME',
'registrant_id',
)
PODS[0]['field_mapping'] = [ # noqa: F405
{"field": "msisdn_re... | from __future__ import unicode_literals
import os
# import our default settings
from settings_production import * # noqa
PODS[0]['contact_id_fieldname'] = os.environ.get( # noqa: F405
'REGISTRATION_CONTACT_ID_FIELDNAME',
'registrant_id',
)
PODS[0]['field_mapping'] = [ # noqa: F405
{"field": "faccode",... | Remove cell number and language from pod | Remove cell number and language from pod
We started using the identity store and the hub to fetch this information,
but unfortunately the field names are different depending on which service
the info is coming from.
These 2 fields are already displayed in the CasePro interface so it makes
sense to not use the pod at ... | Python | bsd-3-clause | praekelt/casepro,praekelt/casepro,praekelt/casepro | from __future__ import unicode_literals
import os
# import our default settings
from settings_production import * # noqa
PODS[0]['contact_id_fieldname'] = os.environ.get( # noqa: F405
'REGISTRATION_CONTACT_ID_FIELDNAME',
'registrant_id',
)
PODS[0]['field_mapping'] = [ # noqa: F405
{"field": "msisdn_re... | from __future__ import unicode_literals
import os
# import our default settings
from settings_production import * # noqa
PODS[0]['contact_id_fieldname'] = os.environ.get( # noqa: F405
'REGISTRATION_CONTACT_ID_FIELDNAME',
'registrant_id',
)
PODS[0]['field_mapping'] = [ # noqa: F405
{"field": "faccode",... | <commit_before>from __future__ import unicode_literals
import os
# import our default settings
from settings_production import * # noqa
PODS[0]['contact_id_fieldname'] = os.environ.get( # noqa: F405
'REGISTRATION_CONTACT_ID_FIELDNAME',
'registrant_id',
)
PODS[0]['field_mapping'] = [ # noqa: F405
{"fie... | from __future__ import unicode_literals
import os
# import our default settings
from settings_production import * # noqa
PODS[0]['contact_id_fieldname'] = os.environ.get( # noqa: F405
'REGISTRATION_CONTACT_ID_FIELDNAME',
'registrant_id',
)
PODS[0]['field_mapping'] = [ # noqa: F405
{"field": "faccode",... | from __future__ import unicode_literals
import os
# import our default settings
from settings_production import * # noqa
PODS[0]['contact_id_fieldname'] = os.environ.get( # noqa: F405
'REGISTRATION_CONTACT_ID_FIELDNAME',
'registrant_id',
)
PODS[0]['field_mapping'] = [ # noqa: F405
{"field": "msisdn_re... | <commit_before>from __future__ import unicode_literals
import os
# import our default settings
from settings_production import * # noqa
PODS[0]['contact_id_fieldname'] = os.environ.get( # noqa: F405
'REGISTRATION_CONTACT_ID_FIELDNAME',
'registrant_id',
)
PODS[0]['field_mapping'] = [ # noqa: F405
{"fie... |
a6e0d8bab8e886688527372a4de267d274df7c51 | conftest.py | conftest.py | #!/usr/bin/env python
# -*- encoding: utf-8
import collections
import os
import subprocess
import unittest
Result = collections.namedtuple('Result', 'rc stdout stderr')
ROOT = subprocess.check_output([
'git', 'rev-parse', '--show-toplevel']).decode('ascii').strip()
BINARY = os.path.join(ROOT, 'target', 'debug'... | #!/usr/bin/env python
# -*- encoding: utf-8
import collections
import os
import subprocess
import unittest
Result = collections.namedtuple('Result', 'rc stdout stderr')
ROOT = subprocess.check_output([
'git', 'rev-parse', '--show-toplevel']).decode('ascii').strip()
BINARY = os.path.join(ROOT, 'target', 'releas... | Make sure we test the right binary | Make sure we test the right binary
| Python | mit | alexwlchan/safari.rs,alexwlchan/safari.rs | #!/usr/bin/env python
# -*- encoding: utf-8
import collections
import os
import subprocess
import unittest
Result = collections.namedtuple('Result', 'rc stdout stderr')
ROOT = subprocess.check_output([
'git', 'rev-parse', '--show-toplevel']).decode('ascii').strip()
BINARY = os.path.join(ROOT, 'target', 'debug'... | #!/usr/bin/env python
# -*- encoding: utf-8
import collections
import os
import subprocess
import unittest
Result = collections.namedtuple('Result', 'rc stdout stderr')
ROOT = subprocess.check_output([
'git', 'rev-parse', '--show-toplevel']).decode('ascii').strip()
BINARY = os.path.join(ROOT, 'target', 'releas... | <commit_before>#!/usr/bin/env python
# -*- encoding: utf-8
import collections
import os
import subprocess
import unittest
Result = collections.namedtuple('Result', 'rc stdout stderr')
ROOT = subprocess.check_output([
'git', 'rev-parse', '--show-toplevel']).decode('ascii').strip()
BINARY = os.path.join(ROOT, 't... | #!/usr/bin/env python
# -*- encoding: utf-8
import collections
import os
import subprocess
import unittest
Result = collections.namedtuple('Result', 'rc stdout stderr')
ROOT = subprocess.check_output([
'git', 'rev-parse', '--show-toplevel']).decode('ascii').strip()
BINARY = os.path.join(ROOT, 'target', 'releas... | #!/usr/bin/env python
# -*- encoding: utf-8
import collections
import os
import subprocess
import unittest
Result = collections.namedtuple('Result', 'rc stdout stderr')
ROOT = subprocess.check_output([
'git', 'rev-parse', '--show-toplevel']).decode('ascii').strip()
BINARY = os.path.join(ROOT, 'target', 'debug'... | <commit_before>#!/usr/bin/env python
# -*- encoding: utf-8
import collections
import os
import subprocess
import unittest
Result = collections.namedtuple('Result', 'rc stdout stderr')
ROOT = subprocess.check_output([
'git', 'rev-parse', '--show-toplevel']).decode('ascii').strip()
BINARY = os.path.join(ROOT, 't... |
a0c23b5c27c4209cc22e138c72173842664fa98a | tests/query_test/test_decimal_queries.py | tests/query_test/test_decimal_queries.py | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Targeted tests for decimal type.
#
import logging
import pytest
from copy import copy
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
class TestDecimalQueries(ImpalaTestSuite):
BATCH_SIZES = [0, 1]
... | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Targeted tests for decimal type.
#
import logging
import pytest
from copy import copy
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
class TestDecimalQueries(ImpalaTestSuite):
BATCH_SIZES = [0, 1]
... | Update decimal tests to only run on text/none. | Update decimal tests to only run on text/none.
Change-Id: I9a35f9e1687171fc3f06c17516bca2ea4b9af9e1
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2217
Tested-by: jenkins
Reviewed-by: Ishaan Joshi <[email protected]>
| Python | apache-2.0 | AtScaleInc/Impala,placrosse/ImpalaToGo,ImpalaToGo/ImpalaToGo,gistic/PublicSpatialImpala,ImpalaToGo/ImpalaToGo,gistic/PublicSpatialImpala,rampage644/impala-cut,placrosse/ImpalaToGo,rampage644/impala-cut,ImpalaToGo/ImpalaToGo,gistic/PublicSpatialImpala,ImpalaToGo/ImpalaToGo,ImpalaToGo/ImpalaToGo,gistic/PublicSpatialImpal... | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Targeted tests for decimal type.
#
import logging
import pytest
from copy import copy
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
class TestDecimalQueries(ImpalaTestSuite):
BATCH_SIZES = [0, 1]
... | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Targeted tests for decimal type.
#
import logging
import pytest
from copy import copy
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
class TestDecimalQueries(ImpalaTestSuite):
BATCH_SIZES = [0, 1]
... | <commit_before>#!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Targeted tests for decimal type.
#
import logging
import pytest
from copy import copy
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
class TestDecimalQueries(ImpalaTestSuite):
BATCH_SI... | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Targeted tests for decimal type.
#
import logging
import pytest
from copy import copy
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
class TestDecimalQueries(ImpalaTestSuite):
BATCH_SIZES = [0, 1]
... | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Targeted tests for decimal type.
#
import logging
import pytest
from copy import copy
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
class TestDecimalQueries(ImpalaTestSuite):
BATCH_SIZES = [0, 1]
... | <commit_before>#!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Targeted tests for decimal type.
#
import logging
import pytest
from copy import copy
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
class TestDecimalQueries(ImpalaTestSuite):
BATCH_SI... |
7bf391e772cbece78b521f1e357ced4bef6908f4 | bin/upload_version.py | bin/upload_version.py | #!python
import os
import sys
import json
import requests
if __name__ == '__main__':
version = sys.argv[1]
filepath = sys.argv[2]
filename = filepath.split('/')[-1]
github_token = os.environ['GITHUB_TOKEN']
auth = (github_token, 'x-oauth-basic')
commit_sha = os.environ['CIRCLE_SHA1']
params = json.dumps... | #!python
import os
import sys
import json
import requests
if __name__ == '__main__':
version = sys.argv[1]
filepath = sys.argv[2]
filename = filepath.split('/')[-1]
github_token = os.environ['GITHUB_TOKEN']
auth = (github_token, 'x-oauth-basic')
commit_sha = os.environ['CIRCLE_SHA1']
params = json.dumps... | Set automatic releases as 'prerelease'. | Set automatic releases as 'prerelease'.
| Python | bsd-2-clause | pubnative/redash,pubnative/redash,imsally/redash,hudl/redash,denisov-vlad/redash,M32Media/redash,chriszs/redash,easytaxibr/redash,M32Media/redash,jmvasquez/redashtest,crowdworks/redash,pubnative/redash,ninneko/redash,hudl/redash,denisov-vlad/redash,amino-data/redash,EverlyWell/redash,imsally/redash,vishesh92/redash,44p... | #!python
import os
import sys
import json
import requests
if __name__ == '__main__':
version = sys.argv[1]
filepath = sys.argv[2]
filename = filepath.split('/')[-1]
github_token = os.environ['GITHUB_TOKEN']
auth = (github_token, 'x-oauth-basic')
commit_sha = os.environ['CIRCLE_SHA1']
params = json.dumps... | #!python
import os
import sys
import json
import requests
if __name__ == '__main__':
version = sys.argv[1]
filepath = sys.argv[2]
filename = filepath.split('/')[-1]
github_token = os.environ['GITHUB_TOKEN']
auth = (github_token, 'x-oauth-basic')
commit_sha = os.environ['CIRCLE_SHA1']
params = json.dumps... | <commit_before>#!python
import os
import sys
import json
import requests
if __name__ == '__main__':
version = sys.argv[1]
filepath = sys.argv[2]
filename = filepath.split('/')[-1]
github_token = os.environ['GITHUB_TOKEN']
auth = (github_token, 'x-oauth-basic')
commit_sha = os.environ['CIRCLE_SHA1']
para... | #!python
import os
import sys
import json
import requests
if __name__ == '__main__':
version = sys.argv[1]
filepath = sys.argv[2]
filename = filepath.split('/')[-1]
github_token = os.environ['GITHUB_TOKEN']
auth = (github_token, 'x-oauth-basic')
commit_sha = os.environ['CIRCLE_SHA1']
params = json.dumps... | #!python
import os
import sys
import json
import requests
if __name__ == '__main__':
version = sys.argv[1]
filepath = sys.argv[2]
filename = filepath.split('/')[-1]
github_token = os.environ['GITHUB_TOKEN']
auth = (github_token, 'x-oauth-basic')
commit_sha = os.environ['CIRCLE_SHA1']
params = json.dumps... | <commit_before>#!python
import os
import sys
import json
import requests
if __name__ == '__main__':
version = sys.argv[1]
filepath = sys.argv[2]
filename = filepath.split('/')[-1]
github_token = os.environ['GITHUB_TOKEN']
auth = (github_token, 'x-oauth-basic')
commit_sha = os.environ['CIRCLE_SHA1']
para... |
694ea053fe87e4811acf0dde47826fec3eb1c9f7 | source/run.py | source/run.py | import asyncio
import time
from autoreiv import AutoReiv
def main():
while True:
bot = AutoReiv()
bot.load()
try:
bot.run(bot.config.get('login'), bot.config.get('password'))
except Exception as e:
print('* Crashed with error: {}'.format(e))
finally:
print('* Disconnected.')
asyncio.set_event_... | import asyncio
import time
from autoreiv import AutoReiv
def main():
while True:
bot = AutoReiv()
bot.load()
try:
bot.run(bot.config.get('login'), bot.config.get('password'))
except Exception as e:
print('* Crashed with error: {}'.format(e))
finally:
if not bot.is_closed:
bot.close()
prin... | Make sure the event loop gets closed on disconnect | Make sure the event loop gets closed on disconnect
| Python | mit | diath/AutoReiv | import asyncio
import time
from autoreiv import AutoReiv
def main():
while True:
bot = AutoReiv()
bot.load()
try:
bot.run(bot.config.get('login'), bot.config.get('password'))
except Exception as e:
print('* Crashed with error: {}'.format(e))
finally:
print('* Disconnected.')
asyncio.set_event_... | import asyncio
import time
from autoreiv import AutoReiv
def main():
while True:
bot = AutoReiv()
bot.load()
try:
bot.run(bot.config.get('login'), bot.config.get('password'))
except Exception as e:
print('* Crashed with error: {}'.format(e))
finally:
if not bot.is_closed:
bot.close()
prin... | <commit_before>import asyncio
import time
from autoreiv import AutoReiv
def main():
while True:
bot = AutoReiv()
bot.load()
try:
bot.run(bot.config.get('login'), bot.config.get('password'))
except Exception as e:
print('* Crashed with error: {}'.format(e))
finally:
print('* Disconnected.')
asy... | import asyncio
import time
from autoreiv import AutoReiv
def main():
while True:
bot = AutoReiv()
bot.load()
try:
bot.run(bot.config.get('login'), bot.config.get('password'))
except Exception as e:
print('* Crashed with error: {}'.format(e))
finally:
if not bot.is_closed:
bot.close()
prin... | import asyncio
import time
from autoreiv import AutoReiv
def main():
while True:
bot = AutoReiv()
bot.load()
try:
bot.run(bot.config.get('login'), bot.config.get('password'))
except Exception as e:
print('* Crashed with error: {}'.format(e))
finally:
print('* Disconnected.')
asyncio.set_event_... | <commit_before>import asyncio
import time
from autoreiv import AutoReiv
def main():
while True:
bot = AutoReiv()
bot.load()
try:
bot.run(bot.config.get('login'), bot.config.get('password'))
except Exception as e:
print('* Crashed with error: {}'.format(e))
finally:
print('* Disconnected.')
asy... |
3149aaa319620c2e39434fea081968cf7040ef6d | common/djangoapps/enrollment/urls.py | common/djangoapps/enrollment/urls.py | """
URLs for the Enrollment API
"""
from django.conf import settings
from django.conf.urls import patterns, url
from .views import (
EnrollmentView,
EnrollmentListView,
EnrollmentCourseDetailView
)
urlpatterns = patterns(
'enrollment.views',
url(
r'^enrollment/{username},{course_key}$'.f... | """
URLs for the Enrollment API
"""
from django.conf import settings
from django.conf.urls import patterns, url
from .views import (
EnrollmentView,
EnrollmentListView,
EnrollmentCourseDetailView
)
urlpatterns = patterns(
'enrollment.views',
url(
r'^enrollment/{username},{course_key}/$'.... | Add options trailing slashes to the Enrollment API. | Add options trailing slashes to the Enrollment API.
This allows the edX REST API Client to perform a sucessful GET against
this API, since Slumber (which our client is based off of) appends the
trailing slash by default.
| Python | agpl-3.0 | gymnasium/edx-platform,mbareta/edx-platform-ft,MakeHer/edx-platform,romain-li/edx-platform,BehavioralInsightsTeam/edx-platform,CourseTalk/edx-platform,Edraak/edraak-platform,hastexo/edx-platform,doganov/edx-platform,MakeHer/edx-platform,teltek/edx-platform,longmen21/edx-platform,Endika/edx-platform,EDUlib/edx-platform,... | """
URLs for the Enrollment API
"""
from django.conf import settings
from django.conf.urls import patterns, url
from .views import (
EnrollmentView,
EnrollmentListView,
EnrollmentCourseDetailView
)
urlpatterns = patterns(
'enrollment.views',
url(
r'^enrollment/{username},{course_key}$'.f... | """
URLs for the Enrollment API
"""
from django.conf import settings
from django.conf.urls import patterns, url
from .views import (
EnrollmentView,
EnrollmentListView,
EnrollmentCourseDetailView
)
urlpatterns = patterns(
'enrollment.views',
url(
r'^enrollment/{username},{course_key}/$'.... | <commit_before>"""
URLs for the Enrollment API
"""
from django.conf import settings
from django.conf.urls import patterns, url
from .views import (
EnrollmentView,
EnrollmentListView,
EnrollmentCourseDetailView
)
urlpatterns = patterns(
'enrollment.views',
url(
r'^enrollment/{username},{... | """
URLs for the Enrollment API
"""
from django.conf import settings
from django.conf.urls import patterns, url
from .views import (
EnrollmentView,
EnrollmentListView,
EnrollmentCourseDetailView
)
urlpatterns = patterns(
'enrollment.views',
url(
r'^enrollment/{username},{course_key}/$'.... | """
URLs for the Enrollment API
"""
from django.conf import settings
from django.conf.urls import patterns, url
from .views import (
EnrollmentView,
EnrollmentListView,
EnrollmentCourseDetailView
)
urlpatterns = patterns(
'enrollment.views',
url(
r'^enrollment/{username},{course_key}$'.f... | <commit_before>"""
URLs for the Enrollment API
"""
from django.conf import settings
from django.conf.urls import patterns, url
from .views import (
EnrollmentView,
EnrollmentListView,
EnrollmentCourseDetailView
)
urlpatterns = patterns(
'enrollment.views',
url(
r'^enrollment/{username},{... |
509a2e925df6211ab53dd95f28e8ffa230ae9522 | laufpartner_server/settings.sample.py | laufpartner_server/settings.sample.py | """
Django settings for laufpartner_server project.
Generated by 'django-admin startproject' using Django 1.8.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
f... | """
Django settings for laufpartner_server project.
Generated by 'django-admin startproject' using Django 1.8.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
f... | Add notice on how to add custom apps for development | Add notice on how to add custom apps for development
| Python | agpl-3.0 | serendi-app/serendi-server | """
Django settings for laufpartner_server project.
Generated by 'django-admin startproject' using Django 1.8.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
f... | """
Django settings for laufpartner_server project.
Generated by 'django-admin startproject' using Django 1.8.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
f... | <commit_before>"""
Django settings for laufpartner_server project.
Generated by 'django-admin startproject' using Django 1.8.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/s... | """
Django settings for laufpartner_server project.
Generated by 'django-admin startproject' using Django 1.8.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
f... | """
Django settings for laufpartner_server project.
Generated by 'django-admin startproject' using Django 1.8.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
f... | <commit_before>"""
Django settings for laufpartner_server project.
Generated by 'django-admin startproject' using Django 1.8.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/s... |
27efc29b76ff0a65cd5ff12360701ca61231f53f | examples/thread_pool.py | examples/thread_pool.py | from diesel import quickstart, sleep
from diesel.util.pool import ThreadPool
from diesel.protocols.http import HttpClient, HttpHeaders
import random
def handle_it(i):
print 'S', i
sleep(random.random())
print 'E', i
def c():
for x in xrange(0, 20):
yield x
make_it = c().next
threads = Thread... | from diesel import quickstart, sleep, quickstop
from diesel.util.pool import ThreadPool
import random
def handle_it(i):
print 'S', i
sleep(random.random())
print 'E', i
def c():
for x in xrange(0, 20):
yield x
make_it = c().next
def stop_it():
quickstop()
threads = ThreadPool(10, handle... | Clean it up with a finalizer. | Clean it up with a finalizer.
| Python | bsd-3-clause | dieseldev/diesel | from diesel import quickstart, sleep
from diesel.util.pool import ThreadPool
from diesel.protocols.http import HttpClient, HttpHeaders
import random
def handle_it(i):
print 'S', i
sleep(random.random())
print 'E', i
def c():
for x in xrange(0, 20):
yield x
make_it = c().next
threads = Thread... | from diesel import quickstart, sleep, quickstop
from diesel.util.pool import ThreadPool
import random
def handle_it(i):
print 'S', i
sleep(random.random())
print 'E', i
def c():
for x in xrange(0, 20):
yield x
make_it = c().next
def stop_it():
quickstop()
threads = ThreadPool(10, handle... | <commit_before>from diesel import quickstart, sleep
from diesel.util.pool import ThreadPool
from diesel.protocols.http import HttpClient, HttpHeaders
import random
def handle_it(i):
print 'S', i
sleep(random.random())
print 'E', i
def c():
for x in xrange(0, 20):
yield x
make_it = c().next
t... | from diesel import quickstart, sleep, quickstop
from diesel.util.pool import ThreadPool
import random
def handle_it(i):
print 'S', i
sleep(random.random())
print 'E', i
def c():
for x in xrange(0, 20):
yield x
make_it = c().next
def stop_it():
quickstop()
threads = ThreadPool(10, handle... | from diesel import quickstart, sleep
from diesel.util.pool import ThreadPool
from diesel.protocols.http import HttpClient, HttpHeaders
import random
def handle_it(i):
print 'S', i
sleep(random.random())
print 'E', i
def c():
for x in xrange(0, 20):
yield x
make_it = c().next
threads = Thread... | <commit_before>from diesel import quickstart, sleep
from diesel.util.pool import ThreadPool
from diesel.protocols.http import HttpClient, HttpHeaders
import random
def handle_it(i):
print 'S', i
sleep(random.random())
print 'E', i
def c():
for x in xrange(0, 20):
yield x
make_it = c().next
t... |
e5a872bd128e6b3ea3cc82df4094d41843148bce | runtests.py | runtests.py | #!/usr/bin/env python
import sys
from os.path import abspath, dirname
from django.conf import settings
import django
sys.path.insert(0, abspath(dirname(__file__)))
if not settings.configured:
settings.configure(
INSTALLED_APPS=(
'django.contrib.contenttypes',
'django.contrib.ses... | #!/usr/bin/env python
import sys
from os.path import abspath, dirname
from django.conf import settings
import django
sys.path.insert(0, abspath(dirname(__file__)))
if not settings.configured:
settings.configure(
INSTALLED_APPS=(
'django.contrib.contenttypes',
'django.contrib.ses... | Add AuthenticationMiddleware to tests (for 1.7) | Add AuthenticationMiddleware to tests (for 1.7)
| Python | mit | treyhunner/django-email-log,treyhunner/django-email-log | #!/usr/bin/env python
import sys
from os.path import abspath, dirname
from django.conf import settings
import django
sys.path.insert(0, abspath(dirname(__file__)))
if not settings.configured:
settings.configure(
INSTALLED_APPS=(
'django.contrib.contenttypes',
'django.contrib.ses... | #!/usr/bin/env python
import sys
from os.path import abspath, dirname
from django.conf import settings
import django
sys.path.insert(0, abspath(dirname(__file__)))
if not settings.configured:
settings.configure(
INSTALLED_APPS=(
'django.contrib.contenttypes',
'django.contrib.ses... | <commit_before>#!/usr/bin/env python
import sys
from os.path import abspath, dirname
from django.conf import settings
import django
sys.path.insert(0, abspath(dirname(__file__)))
if not settings.configured:
settings.configure(
INSTALLED_APPS=(
'django.contrib.contenttypes',
'dja... | #!/usr/bin/env python
import sys
from os.path import abspath, dirname
from django.conf import settings
import django
sys.path.insert(0, abspath(dirname(__file__)))
if not settings.configured:
settings.configure(
INSTALLED_APPS=(
'django.contrib.contenttypes',
'django.contrib.ses... | #!/usr/bin/env python
import sys
from os.path import abspath, dirname
from django.conf import settings
import django
sys.path.insert(0, abspath(dirname(__file__)))
if not settings.configured:
settings.configure(
INSTALLED_APPS=(
'django.contrib.contenttypes',
'django.contrib.ses... | <commit_before>#!/usr/bin/env python
import sys
from os.path import abspath, dirname
from django.conf import settings
import django
sys.path.insert(0, abspath(dirname(__file__)))
if not settings.configured:
settings.configure(
INSTALLED_APPS=(
'django.contrib.contenttypes',
'dja... |
5a4e8ec1179b2ae3b37190ea45fb0d72ce4d7a90 | canopen/sync.py | canopen/sync.py |
class SyncProducer(object):
"""Transmits a SYNC message periodically."""
#: COB-ID of the SYNC message
cob_id = 0x80
def __init__(self, network):
self.network = network
self.period = None
self._task = None
def transmit(self):
"""Send out a SYNC message once."""
... |
class SyncProducer(object):
"""Transmits a SYNC message periodically."""
#: COB-ID of the SYNC message
cob_id = 0x80
def __init__(self, network):
self.network = network
self.period = None
self._task = None
def transmit(self, count=None):
"""Send out a SYNC messag... | Allow specifying counter in SYNC message | Allow specifying counter in SYNC message
Addresses #63
| Python | mit | christiansandberg/canopen,christiansandberg/canopen |
class SyncProducer(object):
"""Transmits a SYNC message periodically."""
#: COB-ID of the SYNC message
cob_id = 0x80
def __init__(self, network):
self.network = network
self.period = None
self._task = None
def transmit(self):
"""Send out a SYNC message once."""
... |
class SyncProducer(object):
"""Transmits a SYNC message periodically."""
#: COB-ID of the SYNC message
cob_id = 0x80
def __init__(self, network):
self.network = network
self.period = None
self._task = None
def transmit(self, count=None):
"""Send out a SYNC messag... | <commit_before>
class SyncProducer(object):
"""Transmits a SYNC message periodically."""
#: COB-ID of the SYNC message
cob_id = 0x80
def __init__(self, network):
self.network = network
self.period = None
self._task = None
def transmit(self):
"""Send out a SYNC mes... |
class SyncProducer(object):
"""Transmits a SYNC message periodically."""
#: COB-ID of the SYNC message
cob_id = 0x80
def __init__(self, network):
self.network = network
self.period = None
self._task = None
def transmit(self, count=None):
"""Send out a SYNC messag... |
class SyncProducer(object):
"""Transmits a SYNC message periodically."""
#: COB-ID of the SYNC message
cob_id = 0x80
def __init__(self, network):
self.network = network
self.period = None
self._task = None
def transmit(self):
"""Send out a SYNC message once."""
... | <commit_before>
class SyncProducer(object):
"""Transmits a SYNC message periodically."""
#: COB-ID of the SYNC message
cob_id = 0x80
def __init__(self, network):
self.network = network
self.period = None
self._task = None
def transmit(self):
"""Send out a SYNC mes... |
91bf74104c0eee2ca3d8d4fdd293390daf173166 | checker/main.py | checker/main.py | #!/usr/bin/env python
import os
import sys
import subprocess
import getopt
class Chdir:
def __init__(self, newPath):
self.savedPath = os.getcwd()
os.chdir(newPath)
class Checker:
def __init__(self, path):
self.path = path
def get_jobs(self):
Chdir(self.path)
jobs... | #!/usr/bin/env python
import os
import sys
import subprocess
import getopt
class Checker:
def __init__(self, path):
if not os.path.isdir(path):
sys.exit(1);
self.path = os.path.realpath(path)
self.jobs = self.getExecutableFiles(self.path)
def getExecutableFiles(self,path)... | Streamline the filesystem looping code. | Streamline the filesystem looping code.
| Python | mit | bsuweb/checker | #!/usr/bin/env python
import os
import sys
import subprocess
import getopt
class Chdir:
def __init__(self, newPath):
self.savedPath = os.getcwd()
os.chdir(newPath)
class Checker:
def __init__(self, path):
self.path = path
def get_jobs(self):
Chdir(self.path)
jobs... | #!/usr/bin/env python
import os
import sys
import subprocess
import getopt
class Checker:
def __init__(self, path):
if not os.path.isdir(path):
sys.exit(1);
self.path = os.path.realpath(path)
self.jobs = self.getExecutableFiles(self.path)
def getExecutableFiles(self,path)... | <commit_before>#!/usr/bin/env python
import os
import sys
import subprocess
import getopt
class Chdir:
def __init__(self, newPath):
self.savedPath = os.getcwd()
os.chdir(newPath)
class Checker:
def __init__(self, path):
self.path = path
def get_jobs(self):
Chdir(self.pat... | #!/usr/bin/env python
import os
import sys
import subprocess
import getopt
class Checker:
def __init__(self, path):
if not os.path.isdir(path):
sys.exit(1);
self.path = os.path.realpath(path)
self.jobs = self.getExecutableFiles(self.path)
def getExecutableFiles(self,path)... | #!/usr/bin/env python
import os
import sys
import subprocess
import getopt
class Chdir:
def __init__(self, newPath):
self.savedPath = os.getcwd()
os.chdir(newPath)
class Checker:
def __init__(self, path):
self.path = path
def get_jobs(self):
Chdir(self.path)
jobs... | <commit_before>#!/usr/bin/env python
import os
import sys
import subprocess
import getopt
class Chdir:
def __init__(self, newPath):
self.savedPath = os.getcwd()
os.chdir(newPath)
class Checker:
def __init__(self, path):
self.path = path
def get_jobs(self):
Chdir(self.pat... |
a32f7cab9ce32c1c2169b55b1e37957a093e47f8 | collect_district_court_case_details.py | collect_district_court_case_details.py | import datetime
import pymongo
import os
from courtreader import readers
# Connect to database
client = pymongo.MongoClient(os.environ['DISTRICT_DB'])
db = client.va_district_court_cases
# Connect to District Court Reader
reader = readers.DistrictCourtReader()
reader.connect()
# Fill in cases
while True:
case = ... | import datetime
import pymongo
import os
import sys
from courtreader import readers
# Connect to database
client = pymongo.MongoClient(os.environ['DISTRICT_DB'])
db = client.va_district_court_cases
# Connect to District Court Reader
reader = readers.DistrictCourtReader()
reader.connect()
# Fill in cases
while True:
... | Set FIPS code from command line | Set FIPS code from command line
| Python | mit | bschoenfeld/va-court-scraper,bschoenfeld/va-court-scraper | import datetime
import pymongo
import os
from courtreader import readers
# Connect to database
client = pymongo.MongoClient(os.environ['DISTRICT_DB'])
db = client.va_district_court_cases
# Connect to District Court Reader
reader = readers.DistrictCourtReader()
reader.connect()
# Fill in cases
while True:
case = ... | import datetime
import pymongo
import os
import sys
from courtreader import readers
# Connect to database
client = pymongo.MongoClient(os.environ['DISTRICT_DB'])
db = client.va_district_court_cases
# Connect to District Court Reader
reader = readers.DistrictCourtReader()
reader.connect()
# Fill in cases
while True:
... | <commit_before>import datetime
import pymongo
import os
from courtreader import readers
# Connect to database
client = pymongo.MongoClient(os.environ['DISTRICT_DB'])
db = client.va_district_court_cases
# Connect to District Court Reader
reader = readers.DistrictCourtReader()
reader.connect()
# Fill in cases
while Tr... | import datetime
import pymongo
import os
import sys
from courtreader import readers
# Connect to database
client = pymongo.MongoClient(os.environ['DISTRICT_DB'])
db = client.va_district_court_cases
# Connect to District Court Reader
reader = readers.DistrictCourtReader()
reader.connect()
# Fill in cases
while True:
... | import datetime
import pymongo
import os
from courtreader import readers
# Connect to database
client = pymongo.MongoClient(os.environ['DISTRICT_DB'])
db = client.va_district_court_cases
# Connect to District Court Reader
reader = readers.DistrictCourtReader()
reader.connect()
# Fill in cases
while True:
case = ... | <commit_before>import datetime
import pymongo
import os
from courtreader import readers
# Connect to database
client = pymongo.MongoClient(os.environ['DISTRICT_DB'])
db = client.va_district_court_cases
# Connect to District Court Reader
reader = readers.DistrictCourtReader()
reader.connect()
# Fill in cases
while Tr... |
e0e2b4fc60a945e9680c171109fd1cbb6f21e304 | celery/run_carrizo.py | celery/run_carrizo.py | import dem
import tasks
from celery import *
carrizo = dem.DEMGrid('tests/data/carrizo.tif')
d = 100
max_age = 10**3.5
age_step = 1
num_ages = max_age/age_step
num_angles = 180
ages = np.linspace(0, max_age, num=num_ages)
angles = np.linspace(-np.pi/2, np.pi/2, num=num_angles)
template_fits = [tasks.match_template.s... | import dem
import tasks
from celery import *
carrizo = dem.DEMGrid('tests/data/carrizo.tif')
d = 100
max_age = 10**3.5
age_step = 1
num_ages = max_age/age_step
num_angles = 180
ages = np.linspace(0, max_age, num=num_ages)
angles = np.linspace(-np.pi/2, np.pi/2, num=num_angles)
template_fits = [tasks.match_template.s... | Add test script for Carrizo data | Add test script for Carrizo data
| Python | mit | stgl/scarplet,rmsare/scarplet | import dem
import tasks
from celery import *
carrizo = dem.DEMGrid('tests/data/carrizo.tif')
d = 100
max_age = 10**3.5
age_step = 1
num_ages = max_age/age_step
num_angles = 180
ages = np.linspace(0, max_age, num=num_ages)
angles = np.linspace(-np.pi/2, np.pi/2, num=num_angles)
template_fits = [tasks.match_template.s... | import dem
import tasks
from celery import *
carrizo = dem.DEMGrid('tests/data/carrizo.tif')
d = 100
max_age = 10**3.5
age_step = 1
num_ages = max_age/age_step
num_angles = 180
ages = np.linspace(0, max_age, num=num_ages)
angles = np.linspace(-np.pi/2, np.pi/2, num=num_angles)
template_fits = [tasks.match_template.s... | <commit_before>import dem
import tasks
from celery import *
carrizo = dem.DEMGrid('tests/data/carrizo.tif')
d = 100
max_age = 10**3.5
age_step = 1
num_ages = max_age/age_step
num_angles = 180
ages = np.linspace(0, max_age, num=num_ages)
angles = np.linspace(-np.pi/2, np.pi/2, num=num_angles)
template_fits = [tasks.m... | import dem
import tasks
from celery import *
carrizo = dem.DEMGrid('tests/data/carrizo.tif')
d = 100
max_age = 10**3.5
age_step = 1
num_ages = max_age/age_step
num_angles = 180
ages = np.linspace(0, max_age, num=num_ages)
angles = np.linspace(-np.pi/2, np.pi/2, num=num_angles)
template_fits = [tasks.match_template.s... | import dem
import tasks
from celery import *
carrizo = dem.DEMGrid('tests/data/carrizo.tif')
d = 100
max_age = 10**3.5
age_step = 1
num_ages = max_age/age_step
num_angles = 180
ages = np.linspace(0, max_age, num=num_ages)
angles = np.linspace(-np.pi/2, np.pi/2, num=num_angles)
template_fits = [tasks.match_template.s... | <commit_before>import dem
import tasks
from celery import *
carrizo = dem.DEMGrid('tests/data/carrizo.tif')
d = 100
max_age = 10**3.5
age_step = 1
num_ages = max_age/age_step
num_angles = 180
ages = np.linspace(0, max_age, num=num_ages)
angles = np.linspace(-np.pi/2, np.pi/2, num=num_angles)
template_fits = [tasks.m... |
d2b4810d74364394e7e7ecf8f8c5b1011a250f77 | notescli/commands.py | notescli/commands.py | import config
import cliparser
import indexer
import io
import os
def command_ls(index):
with index.index.searcher() as searcher:
results = searcher.documents()
print "Indexed files:"
for result in results:
print result["filename"]
def command_view(index, query):
result_file = indexer.find_resul... | import config
import cliparser
import indexer
import io
import os
def command_ls(index):
print "Indexed files:"
for filename in index.list_files():
print filename
def command_view(index, query):
result_file = indexer.find_result(index.index, query)
if result_file is None:
print "No results found"
el... | Replace implementation of ls by using the indexer | Replace implementation of ls by using the indexer
| Python | mit | phss/notes-cli | import config
import cliparser
import indexer
import io
import os
def command_ls(index):
with index.index.searcher() as searcher:
results = searcher.documents()
print "Indexed files:"
for result in results:
print result["filename"]
def command_view(index, query):
result_file = indexer.find_resul... | import config
import cliparser
import indexer
import io
import os
def command_ls(index):
print "Indexed files:"
for filename in index.list_files():
print filename
def command_view(index, query):
result_file = indexer.find_result(index.index, query)
if result_file is None:
print "No results found"
el... | <commit_before>import config
import cliparser
import indexer
import io
import os
def command_ls(index):
with index.index.searcher() as searcher:
results = searcher.documents()
print "Indexed files:"
for result in results:
print result["filename"]
def command_view(index, query):
result_file = ind... | import config
import cliparser
import indexer
import io
import os
def command_ls(index):
print "Indexed files:"
for filename in index.list_files():
print filename
def command_view(index, query):
result_file = indexer.find_result(index.index, query)
if result_file is None:
print "No results found"
el... | import config
import cliparser
import indexer
import io
import os
def command_ls(index):
with index.index.searcher() as searcher:
results = searcher.documents()
print "Indexed files:"
for result in results:
print result["filename"]
def command_view(index, query):
result_file = indexer.find_resul... | <commit_before>import config
import cliparser
import indexer
import io
import os
def command_ls(index):
with index.index.searcher() as searcher:
results = searcher.documents()
print "Indexed files:"
for result in results:
print result["filename"]
def command_view(index, query):
result_file = ind... |
a5b4a657a1717e2fb9e4c53f93b5232dd58a1c68 | shop_richcatalog/views.py | shop_richcatalog/views.py | from shop.views import ShopListView, ShopDetailView
from shop_richcatalog.models import Catalog
from shop.models import Product
class CatalogListView(ShopListView):
'''
TODO.
'''
model = Catalog
#generic_template = "shop_richcatalog/catalog_list.html"
class CatalogDetailView(ShopDetailView):
... | from shop.views import ShopListView, ShopDetailView
from shop_richcatalog.models import Catalog
from shop.models import Product
class CatalogListView(ShopListView):
'''
Display all catalogs in a tree.
'''
model = Catalog
class CatalogDetailView(ShopDetailView):
'''
Display detailed catalog ... | Document the view classes and make fix their spacing for pep8. | Document the view classes and make fix their spacing for pep8.
| Python | bsd-3-clause | nimbis/django-shop-richcatalog,nimbis/django-shop-richcatalog | from shop.views import ShopListView, ShopDetailView
from shop_richcatalog.models import Catalog
from shop.models import Product
class CatalogListView(ShopListView):
'''
TODO.
'''
model = Catalog
#generic_template = "shop_richcatalog/catalog_list.html"
class CatalogDetailView(ShopDetailView):
... | from shop.views import ShopListView, ShopDetailView
from shop_richcatalog.models import Catalog
from shop.models import Product
class CatalogListView(ShopListView):
'''
Display all catalogs in a tree.
'''
model = Catalog
class CatalogDetailView(ShopDetailView):
'''
Display detailed catalog ... | <commit_before>from shop.views import ShopListView, ShopDetailView
from shop_richcatalog.models import Catalog
from shop.models import Product
class CatalogListView(ShopListView):
'''
TODO.
'''
model = Catalog
#generic_template = "shop_richcatalog/catalog_list.html"
class CatalogDetailView(ShopD... | from shop.views import ShopListView, ShopDetailView
from shop_richcatalog.models import Catalog
from shop.models import Product
class CatalogListView(ShopListView):
'''
Display all catalogs in a tree.
'''
model = Catalog
class CatalogDetailView(ShopDetailView):
'''
Display detailed catalog ... | from shop.views import ShopListView, ShopDetailView
from shop_richcatalog.models import Catalog
from shop.models import Product
class CatalogListView(ShopListView):
'''
TODO.
'''
model = Catalog
#generic_template = "shop_richcatalog/catalog_list.html"
class CatalogDetailView(ShopDetailView):
... | <commit_before>from shop.views import ShopListView, ShopDetailView
from shop_richcatalog.models import Catalog
from shop.models import Product
class CatalogListView(ShopListView):
'''
TODO.
'''
model = Catalog
#generic_template = "shop_richcatalog/catalog_list.html"
class CatalogDetailView(ShopD... |
9639eb34f53444387621ed0a27ef9b273b38df79 | slackclient/_slackrequest.py | slackclient/_slackrequest.py | import json
import requests
import six
class SlackRequest(object):
@staticmethod
def do(token, request="?", post_data=None, domain="slack.com"):
'''
Perform a POST request to the Slack Web API
Args:
token (str): your authentication token
request (str): the me... | import json
import requests
import six
class SlackRequest(object):
@staticmethod
def do(token, request="?", post_data=None, domain="slack.com"):
'''
Perform a POST request to the Slack Web API
Args:
token (str): your authentication token
request (str): the me... | Fix bug preventing API calls requiring a file ID | Fix bug preventing API calls requiring a file ID
For example, an API call to files.info takes a file ID argument named
"file", which was stripped out by this call. Currently, there is only
one request type that accepts file data (files.upload). Every other use
of 'file' is an ID that aught to be contained in the reque... | Python | mit | slackhq/python-slackclient,slackapi/python-slackclient,slackapi/python-slackclient,slackapi/python-slackclient | import json
import requests
import six
class SlackRequest(object):
@staticmethod
def do(token, request="?", post_data=None, domain="slack.com"):
'''
Perform a POST request to the Slack Web API
Args:
token (str): your authentication token
request (str): the me... | import json
import requests
import six
class SlackRequest(object):
@staticmethod
def do(token, request="?", post_data=None, domain="slack.com"):
'''
Perform a POST request to the Slack Web API
Args:
token (str): your authentication token
request (str): the me... | <commit_before>import json
import requests
import six
class SlackRequest(object):
@staticmethod
def do(token, request="?", post_data=None, domain="slack.com"):
'''
Perform a POST request to the Slack Web API
Args:
token (str): your authentication token
reques... | import json
import requests
import six
class SlackRequest(object):
@staticmethod
def do(token, request="?", post_data=None, domain="slack.com"):
'''
Perform a POST request to the Slack Web API
Args:
token (str): your authentication token
request (str): the me... | import json
import requests
import six
class SlackRequest(object):
@staticmethod
def do(token, request="?", post_data=None, domain="slack.com"):
'''
Perform a POST request to the Slack Web API
Args:
token (str): your authentication token
request (str): the me... | <commit_before>import json
import requests
import six
class SlackRequest(object):
@staticmethod
def do(token, request="?", post_data=None, domain="slack.com"):
'''
Perform a POST request to the Slack Web API
Args:
token (str): your authentication token
reques... |
34e36b77095d42f2d9e6a3634d86d09fffcc3411 | molo/core/content_import/api/forms.py | molo/core/content_import/api/forms.py | from django import forms
# TODO: make the form return the valid JSON response
class MainImportForm(forms.Form):
url = forms.CharField(
max_length=100,
)
def __init__(self, **kwargs):
self.importer = kwargs.pop("importer")
super(MainImportForm, self).__init__(**kwargs)
def sav... | from django import forms
# TODO: make the form return the valid JSON response
class MainImportForm(forms.Form):
url = forms.CharField(
max_length=100,
)
def __init__(self, **kwargs):
self.importer = kwargs.pop("importer")
super(MainImportForm, self).__init__(**kwargs)
class Arti... | Add form to allow admin user to specify URL for import | Add form to allow admin user to specify URL for import
| Python | bsd-2-clause | praekelt/molo,praekelt/molo,praekelt/molo,praekelt/molo | from django import forms
# TODO: make the form return the valid JSON response
class MainImportForm(forms.Form):
url = forms.CharField(
max_length=100,
)
def __init__(self, **kwargs):
self.importer = kwargs.pop("importer")
super(MainImportForm, self).__init__(**kwargs)
def sav... | from django import forms
# TODO: make the form return the valid JSON response
class MainImportForm(forms.Form):
url = forms.CharField(
max_length=100,
)
def __init__(self, **kwargs):
self.importer = kwargs.pop("importer")
super(MainImportForm, self).__init__(**kwargs)
class Arti... | <commit_before>from django import forms
# TODO: make the form return the valid JSON response
class MainImportForm(forms.Form):
url = forms.CharField(
max_length=100,
)
def __init__(self, **kwargs):
self.importer = kwargs.pop("importer")
super(MainImportForm, self).__init__(**kwarg... | from django import forms
# TODO: make the form return the valid JSON response
class MainImportForm(forms.Form):
url = forms.CharField(
max_length=100,
)
def __init__(self, **kwargs):
self.importer = kwargs.pop("importer")
super(MainImportForm, self).__init__(**kwargs)
class Arti... | from django import forms
# TODO: make the form return the valid JSON response
class MainImportForm(forms.Form):
url = forms.CharField(
max_length=100,
)
def __init__(self, **kwargs):
self.importer = kwargs.pop("importer")
super(MainImportForm, self).__init__(**kwargs)
def sav... | <commit_before>from django import forms
# TODO: make the form return the valid JSON response
class MainImportForm(forms.Form):
url = forms.CharField(
max_length=100,
)
def __init__(self, **kwargs):
self.importer = kwargs.pop("importer")
super(MainImportForm, self).__init__(**kwarg... |
2395d08c672250b5df273eb36415c8200dd7f801 | tests/tests_twobody/test_mean_elements.py | tests/tests_twobody/test_mean_elements.py | import pytest
from poliastro.twobody.mean_elements import get_mean_elements
def test_get_mean_elements_raises_error_if_invalid_body():
body = "PlanetNine"
with pytest.raises(ValueError) as excinfo:
get_mean_elements(body)
assert f"The input body '{body}' is invalid." in excinfo.exconly()
| import pytest
from poliastro.bodies import Sun
from poliastro.twobody.mean_elements import get_mean_elements
def test_get_mean_elements_raises_error_if_invalid_body():
body = Sun
with pytest.raises(ValueError) as excinfo:
get_mean_elements(body)
assert f"The input body '{body}' is invalid." in e... | Add test for error check | Add test for error check
| Python | mit | poliastro/poliastro | import pytest
from poliastro.twobody.mean_elements import get_mean_elements
def test_get_mean_elements_raises_error_if_invalid_body():
body = "PlanetNine"
with pytest.raises(ValueError) as excinfo:
get_mean_elements(body)
assert f"The input body '{body}' is invalid." in excinfo.exconly()
Add tes... | import pytest
from poliastro.bodies import Sun
from poliastro.twobody.mean_elements import get_mean_elements
def test_get_mean_elements_raises_error_if_invalid_body():
body = Sun
with pytest.raises(ValueError) as excinfo:
get_mean_elements(body)
assert f"The input body '{body}' is invalid." in e... | <commit_before>import pytest
from poliastro.twobody.mean_elements import get_mean_elements
def test_get_mean_elements_raises_error_if_invalid_body():
body = "PlanetNine"
with pytest.raises(ValueError) as excinfo:
get_mean_elements(body)
assert f"The input body '{body}' is invalid." in excinfo.ex... | import pytest
from poliastro.bodies import Sun
from poliastro.twobody.mean_elements import get_mean_elements
def test_get_mean_elements_raises_error_if_invalid_body():
body = Sun
with pytest.raises(ValueError) as excinfo:
get_mean_elements(body)
assert f"The input body '{body}' is invalid." in e... | import pytest
from poliastro.twobody.mean_elements import get_mean_elements
def test_get_mean_elements_raises_error_if_invalid_body():
body = "PlanetNine"
with pytest.raises(ValueError) as excinfo:
get_mean_elements(body)
assert f"The input body '{body}' is invalid." in excinfo.exconly()
Add tes... | <commit_before>import pytest
from poliastro.twobody.mean_elements import get_mean_elements
def test_get_mean_elements_raises_error_if_invalid_body():
body = "PlanetNine"
with pytest.raises(ValueError) as excinfo:
get_mean_elements(body)
assert f"The input body '{body}' is invalid." in excinfo.ex... |
599811e2a80b6f123d3beeb8906c0b82e975da86 | maintenancemode/views/defaults.py | maintenancemode/views/defaults.py | from django.template import Context, loader
from maintenancemode import http
def temporary_unavailable(request, template_name='503.html'):
"""
Default 503 handler, which looks for the requested URL in the redirects
table, redirects if found, and displays 404 page if not redirected.
Templates: `50... | from django.template import RequestContext, loader
from maintenancemode import http
def temporary_unavailable(request, template_name='503.html'):
"""
Default 503 handler, which looks for the requested URL in the redirects
table, redirects if found, and displays 404 page if not redirected.
Templates: ... | Use RequestContext instead of just Context. | Use RequestContext instead of just Context.
| Python | bsd-3-clause | aarsan/django-maintenancemode,21strun/django-maintenancemode,shanx/django-maintenancemode,21strun/django-maintenancemode,shanx/django-maintenancemode,aarsan/django-maintenancemode | from django.template import Context, loader
from maintenancemode import http
def temporary_unavailable(request, template_name='503.html'):
"""
Default 503 handler, which looks for the requested URL in the redirects
table, redirects if found, and displays 404 page if not redirected.
Templates: `50... | from django.template import RequestContext, loader
from maintenancemode import http
def temporary_unavailable(request, template_name='503.html'):
"""
Default 503 handler, which looks for the requested URL in the redirects
table, redirects if found, and displays 404 page if not redirected.
Templates: ... | <commit_before>from django.template import Context, loader
from maintenancemode import http
def temporary_unavailable(request, template_name='503.html'):
"""
Default 503 handler, which looks for the requested URL in the redirects
table, redirects if found, and displays 404 page if not redirected.
... | from django.template import RequestContext, loader
from maintenancemode import http
def temporary_unavailable(request, template_name='503.html'):
"""
Default 503 handler, which looks for the requested URL in the redirects
table, redirects if found, and displays 404 page if not redirected.
Templates: ... | from django.template import Context, loader
from maintenancemode import http
def temporary_unavailable(request, template_name='503.html'):
"""
Default 503 handler, which looks for the requested URL in the redirects
table, redirects if found, and displays 404 page if not redirected.
Templates: `50... | <commit_before>from django.template import Context, loader
from maintenancemode import http
def temporary_unavailable(request, template_name='503.html'):
"""
Default 503 handler, which looks for the requested URL in the redirects
table, redirects if found, and displays 404 page if not redirected.
... |
0983715cd2ee4eb3ac411e1ff24fa2e49df54eb5 | src/manage.py | src/manage.py | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
# Browsers doesn't use content negotiation using ETags with HTTP 1.0 servers
# Force Django to use HTTP 1.1 when using the runserver command
from wsgiref import simple_server
simple_server.ServerHandler.http_version = "1.1"
os.... | Allow to tests ETags when using the runserver command | Allow to tests ETags when using the runserver command
| Python | agpl-3.0 | jpajuelo/wirecloud,jpajuelo/wirecloud,rockneurotiko/wirecloud,rockneurotiko/wirecloud,jpajuelo/wirecloud,rockneurotiko/wirecloud,jpajuelo/wirecloud,rockneurotiko/wirecloud | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
Allow to tests ETags when using the runserver command | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
# Browsers doesn't use content negotiation using ETags with HTTP 1.0 servers
# Force Django to use HTTP 1.1 when using the runserver command
from wsgiref import simple_server
simple_server.ServerHandler.http_version = "1.1"
os.... | <commit_before>#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
<commit_msg>Allow to tests ETags when using the runserver comm... | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
# Browsers doesn't use content negotiation using ETags with HTTP 1.0 servers
# Force Django to use HTTP 1.1 when using the runserver command
from wsgiref import simple_server
simple_server.ServerHandler.http_version = "1.1"
os.... | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
Allow to tests ETags when using the runserver command#!/usr/bin/env python
im... | <commit_before>#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
<commit_msg>Allow to tests ETags when using the runserver comm... |
8b82e15e3c5d8eb98dc9bf32d1d4b9e5d55be2c7 | bitHopper/Website/__init__.py | bitHopper/Website/__init__.py | import logging, json
import bitHopper.Tracking
import bitHopper.util
import bitHopper.Network
import flask
app = flask.Flask(__name__, template_folder='./templates',
static_folder = './static')
app.Debug = False
@app.teardown_request
def teardown_request_wrap(exception):
"""
Prints tracebacks an... | import logging, json
import bitHopper.Tracking
import bitHopper.util
import bitHopper.Network
import flask
app = flask.Flask(__name__, template_folder='bitHopper/templates',
static_folder = 'bitHopper/static')
app.Debug = False
@app.teardown_request
def teardown_request_wrap(exception):
"""
Prin... | Make the template and static folders be inside bitHopper | Make the template and static folders be inside bitHopper
| Python | mit | c00w/bitHopper,c00w/bitHopper | import logging, json
import bitHopper.Tracking
import bitHopper.util
import bitHopper.Network
import flask
app = flask.Flask(__name__, template_folder='./templates',
static_folder = './static')
app.Debug = False
@app.teardown_request
def teardown_request_wrap(exception):
"""
Prints tracebacks an... | import logging, json
import bitHopper.Tracking
import bitHopper.util
import bitHopper.Network
import flask
app = flask.Flask(__name__, template_folder='bitHopper/templates',
static_folder = 'bitHopper/static')
app.Debug = False
@app.teardown_request
def teardown_request_wrap(exception):
"""
Prin... | <commit_before>import logging, json
import bitHopper.Tracking
import bitHopper.util
import bitHopper.Network
import flask
app = flask.Flask(__name__, template_folder='./templates',
static_folder = './static')
app.Debug = False
@app.teardown_request
def teardown_request_wrap(exception):
"""
Print... | import logging, json
import bitHopper.Tracking
import bitHopper.util
import bitHopper.Network
import flask
app = flask.Flask(__name__, template_folder='bitHopper/templates',
static_folder = 'bitHopper/static')
app.Debug = False
@app.teardown_request
def teardown_request_wrap(exception):
"""
Prin... | import logging, json
import bitHopper.Tracking
import bitHopper.util
import bitHopper.Network
import flask
app = flask.Flask(__name__, template_folder='./templates',
static_folder = './static')
app.Debug = False
@app.teardown_request
def teardown_request_wrap(exception):
"""
Prints tracebacks an... | <commit_before>import logging, json
import bitHopper.Tracking
import bitHopper.util
import bitHopper.Network
import flask
app = flask.Flask(__name__, template_folder='./templates',
static_folder = './static')
app.Debug = False
@app.teardown_request
def teardown_request_wrap(exception):
"""
Print... |
efebbe998ac67810f6e0f86b685ab18f1ccf2bda | nio_cli/commands/config.py | nio_cli/commands/config.py | from .base import Base
import requests
class Config(Base):
""" Get basic nio info """
def __init__(self, options, *args, **kwargs):
super().__init__(options, *args, **kwargs)
self._resource = 'services' if self.options['services'] else 'blocks'
self._resource_name = \
self.... | from .base import Base
import requests
class Config(Base):
""" Get basic nio info """
def __init__(self, options, *args, **kwargs):
super().__init__(options, *args, **kwargs)
self._resource = 'services' if self.options['services'] else 'blocks'
self._resource_name = \
self.... | Remove additional http get request | Remove additional http get request
| Python | apache-2.0 | nioinnovation/nio-cli,neutralio/nio-cli | from .base import Base
import requests
class Config(Base):
""" Get basic nio info """
def __init__(self, options, *args, **kwargs):
super().__init__(options, *args, **kwargs)
self._resource = 'services' if self.options['services'] else 'blocks'
self._resource_name = \
self.... | from .base import Base
import requests
class Config(Base):
""" Get basic nio info """
def __init__(self, options, *args, **kwargs):
super().__init__(options, *args, **kwargs)
self._resource = 'services' if self.options['services'] else 'blocks'
self._resource_name = \
self.... | <commit_before>from .base import Base
import requests
class Config(Base):
""" Get basic nio info """
def __init__(self, options, *args, **kwargs):
super().__init__(options, *args, **kwargs)
self._resource = 'services' if self.options['services'] else 'blocks'
self._resource_name = \
... | from .base import Base
import requests
class Config(Base):
""" Get basic nio info """
def __init__(self, options, *args, **kwargs):
super().__init__(options, *args, **kwargs)
self._resource = 'services' if self.options['services'] else 'blocks'
self._resource_name = \
self.... | from .base import Base
import requests
class Config(Base):
""" Get basic nio info """
def __init__(self, options, *args, **kwargs):
super().__init__(options, *args, **kwargs)
self._resource = 'services' if self.options['services'] else 'blocks'
self._resource_name = \
self.... | <commit_before>from .base import Base
import requests
class Config(Base):
""" Get basic nio info """
def __init__(self, options, *args, **kwargs):
super().__init__(options, *args, **kwargs)
self._resource = 'services' if self.options['services'] else 'blocks'
self._resource_name = \
... |
2a1a5073e069b1fbf5b7803417b59339ec72d026 | netdisco/discoverables/belkin_wemo.py | netdisco/discoverables/belkin_wemo.py | """ Discovers Belkin Wemo devices. """
from . import SSDPDiscoverable
class Discoverable(SSDPDiscoverable):
""" Adds support for discovering Belkin WeMo platform devices. """
def info_from_entry(self, entry):
""" Returns most important info from a uPnP entry. """
device = entry.description['... | """ Discovers Belkin Wemo devices. """
from . import SSDPDiscoverable
class Discoverable(SSDPDiscoverable):
""" Adds support for discovering Belkin WeMo platform devices. """
def info_from_entry(self, entry):
""" Returns most important info from a uPnP entry. """
device = entry.description['... | Add MAC address to wemo discovery attributes | Add MAC address to wemo discovery attributes
| Python | mit | sfam/netdisco,brburns/netdisco,balloob/netdisco | """ Discovers Belkin Wemo devices. """
from . import SSDPDiscoverable
class Discoverable(SSDPDiscoverable):
""" Adds support for discovering Belkin WeMo platform devices. """
def info_from_entry(self, entry):
""" Returns most important info from a uPnP entry. """
device = entry.description['... | """ Discovers Belkin Wemo devices. """
from . import SSDPDiscoverable
class Discoverable(SSDPDiscoverable):
""" Adds support for discovering Belkin WeMo platform devices. """
def info_from_entry(self, entry):
""" Returns most important info from a uPnP entry. """
device = entry.description['... | <commit_before>""" Discovers Belkin Wemo devices. """
from . import SSDPDiscoverable
class Discoverable(SSDPDiscoverable):
""" Adds support for discovering Belkin WeMo platform devices. """
def info_from_entry(self, entry):
""" Returns most important info from a uPnP entry. """
device = entr... | """ Discovers Belkin Wemo devices. """
from . import SSDPDiscoverable
class Discoverable(SSDPDiscoverable):
""" Adds support for discovering Belkin WeMo platform devices. """
def info_from_entry(self, entry):
""" Returns most important info from a uPnP entry. """
device = entry.description['... | """ Discovers Belkin Wemo devices. """
from . import SSDPDiscoverable
class Discoverable(SSDPDiscoverable):
""" Adds support for discovering Belkin WeMo platform devices. """
def info_from_entry(self, entry):
""" Returns most important info from a uPnP entry. """
device = entry.description['... | <commit_before>""" Discovers Belkin Wemo devices. """
from . import SSDPDiscoverable
class Discoverable(SSDPDiscoverable):
""" Adds support for discovering Belkin WeMo platform devices. """
def info_from_entry(self, entry):
""" Returns most important info from a uPnP entry. """
device = entr... |
8900aa1b47449bd6ad204725c3a98f75e17eb3ba | python/array_manipulation.py | python/array_manipulation.py | #!/bin/python3
import math
import os
import random
import re
import sys
def arrayManipulation(n, queries):
# An array used to capture the difference of an element
# compared to the previous element.
# Therefore the value of diffs[n] after all array manipulations is
# the cumulative sum of values from... | #!/bin/python3
import math
import os
import random
import re
import sys
def arrayManipulation(n, queries):
diffs = getArrayOfDiffs(n, queries)
return maxFromDiffs(diffs)
def maxFromDiffs(diffs):
sumSoFar = 0
maxSoFar = 0
for diff in diffs:
sumSoFar += diff
if sumSoFar > maxSoFar:... | Refactor into getArrayOfDiffs and maxFromDiffs | Refactor into getArrayOfDiffs and maxFromDiffs
| Python | mit | rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank | #!/bin/python3
import math
import os
import random
import re
import sys
def arrayManipulation(n, queries):
# An array used to capture the difference of an element
# compared to the previous element.
# Therefore the value of diffs[n] after all array manipulations is
# the cumulative sum of values from... | #!/bin/python3
import math
import os
import random
import re
import sys
def arrayManipulation(n, queries):
diffs = getArrayOfDiffs(n, queries)
return maxFromDiffs(diffs)
def maxFromDiffs(diffs):
sumSoFar = 0
maxSoFar = 0
for diff in diffs:
sumSoFar += diff
if sumSoFar > maxSoFar:... | <commit_before>#!/bin/python3
import math
import os
import random
import re
import sys
def arrayManipulation(n, queries):
# An array used to capture the difference of an element
# compared to the previous element.
# Therefore the value of diffs[n] after all array manipulations is
# the cumulative sum... | #!/bin/python3
import math
import os
import random
import re
import sys
def arrayManipulation(n, queries):
diffs = getArrayOfDiffs(n, queries)
return maxFromDiffs(diffs)
def maxFromDiffs(diffs):
sumSoFar = 0
maxSoFar = 0
for diff in diffs:
sumSoFar += diff
if sumSoFar > maxSoFar:... | #!/bin/python3
import math
import os
import random
import re
import sys
def arrayManipulation(n, queries):
# An array used to capture the difference of an element
# compared to the previous element.
# Therefore the value of diffs[n] after all array manipulations is
# the cumulative sum of values from... | <commit_before>#!/bin/python3
import math
import os
import random
import re
import sys
def arrayManipulation(n, queries):
# An array used to capture the difference of an element
# compared to the previous element.
# Therefore the value of diffs[n] after all array manipulations is
# the cumulative sum... |
e8584f4193658399ea9bb2317915caff78fce88b | corehq/apps/commtrack/management/commands/update_supply_point_locations.py | corehq/apps/commtrack/management/commands/update_supply_point_locations.py | from django.core.management.base import BaseCommand
from casexml.apps.case.models import CommCareCase
from corehq.util.couch import iter_update, DocUpdate
class Command(BaseCommand):
help = ("Make sure all supply point cases have their owner_id set "
"to the location_id")
def handle(self, *args, ... | from xml.etree import ElementTree
from django.core.management.base import BaseCommand
from casexml.apps.case.mock import CaseBlock
from casexml.apps.case.models import CommCareCase
from dimagi.utils.chunked import chunked
from dimagi.utils.couch.database import iter_docs
from corehq.apps.domain.models import Domain
f... | Use CaseBlocks to update case owner_ids | Use CaseBlocks to update case owner_ids
| Python | bsd-3-clause | dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq | from django.core.management.base import BaseCommand
from casexml.apps.case.models import CommCareCase
from corehq.util.couch import iter_update, DocUpdate
class Command(BaseCommand):
help = ("Make sure all supply point cases have their owner_id set "
"to the location_id")
def handle(self, *args, ... | from xml.etree import ElementTree
from django.core.management.base import BaseCommand
from casexml.apps.case.mock import CaseBlock
from casexml.apps.case.models import CommCareCase
from dimagi.utils.chunked import chunked
from dimagi.utils.couch.database import iter_docs
from corehq.apps.domain.models import Domain
f... | <commit_before>from django.core.management.base import BaseCommand
from casexml.apps.case.models import CommCareCase
from corehq.util.couch import iter_update, DocUpdate
class Command(BaseCommand):
help = ("Make sure all supply point cases have their owner_id set "
"to the location_id")
def handl... | from xml.etree import ElementTree
from django.core.management.base import BaseCommand
from casexml.apps.case.mock import CaseBlock
from casexml.apps.case.models import CommCareCase
from dimagi.utils.chunked import chunked
from dimagi.utils.couch.database import iter_docs
from corehq.apps.domain.models import Domain
f... | from django.core.management.base import BaseCommand
from casexml.apps.case.models import CommCareCase
from corehq.util.couch import iter_update, DocUpdate
class Command(BaseCommand):
help = ("Make sure all supply point cases have their owner_id set "
"to the location_id")
def handle(self, *args, ... | <commit_before>from django.core.management.base import BaseCommand
from casexml.apps.case.models import CommCareCase
from corehq.util.couch import iter_update, DocUpdate
class Command(BaseCommand):
help = ("Make sure all supply point cases have their owner_id set "
"to the location_id")
def handl... |
553731a0ea12a8303076dc3d83bfbba91e6bc3e8 | scripts/merge_duplicate_users.py | scripts/merge_duplicate_users.py | from django.db.models.functions import Lower
from django.db.models import Count
from bluebottle.members.models import Member
from bluebottle.clients.models import Client
from bluebottle.clients.utils import LocalTenant
from bluebottle.activities.models import Activity, Contributor
from bluebottle.initiatives.models ... | from django.db.models.functions import Lower
from django.db.models import Count
from bluebottle.members.models import Member
from bluebottle.clients.models import Client
from bluebottle.clients.utils import LocalTenant
from bluebottle.activities.models import Activity, Contributor
from bluebottle.initiatives.models ... | Make sure we remember to which the user was merged | Make sure we remember to which the user was merged
| Python | bsd-3-clause | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | from django.db.models.functions import Lower
from django.db.models import Count
from bluebottle.members.models import Member
from bluebottle.clients.models import Client
from bluebottle.clients.utils import LocalTenant
from bluebottle.activities.models import Activity, Contributor
from bluebottle.initiatives.models ... | from django.db.models.functions import Lower
from django.db.models import Count
from bluebottle.members.models import Member
from bluebottle.clients.models import Client
from bluebottle.clients.utils import LocalTenant
from bluebottle.activities.models import Activity, Contributor
from bluebottle.initiatives.models ... | <commit_before>from django.db.models.functions import Lower
from django.db.models import Count
from bluebottle.members.models import Member
from bluebottle.clients.models import Client
from bluebottle.clients.utils import LocalTenant
from bluebottle.activities.models import Activity, Contributor
from bluebottle.init... | from django.db.models.functions import Lower
from django.db.models import Count
from bluebottle.members.models import Member
from bluebottle.clients.models import Client
from bluebottle.clients.utils import LocalTenant
from bluebottle.activities.models import Activity, Contributor
from bluebottle.initiatives.models ... | from django.db.models.functions import Lower
from django.db.models import Count
from bluebottle.members.models import Member
from bluebottle.clients.models import Client
from bluebottle.clients.utils import LocalTenant
from bluebottle.activities.models import Activity, Contributor
from bluebottle.initiatives.models ... | <commit_before>from django.db.models.functions import Lower
from django.db.models import Count
from bluebottle.members.models import Member
from bluebottle.clients.models import Client
from bluebottle.clients.utils import LocalTenant
from bluebottle.activities.models import Activity, Contributor
from bluebottle.init... |
2ca3f28b4423fc8ecd19591a039b7a5c814ab25b | webserver/codemanagement/validators.py | webserver/codemanagement/validators.py | from django.core.validators import RegexValidator
sha1_validator = RegexValidator(regex="^[a-f0-9]{40}$",
message="Must be valid sha1 sum")
tag_validator = RegexValidator(regex="^[A-Za-z][\w\-\.]+[A-Za-z]$",
message="Must be letters and numbers" +
... | from django.core.validators import RegexValidator
from django.core.exceptions import ValidationError
from dulwich.repo import check_ref_format
import re
sha1_validator = RegexValidator(regex="^[a-f0-9]{40}$",
message="Must be valid sha1 sum")
tag_regex = re.compile(r'^[A-Za-z][\w\-\.]+... | Make dulwich check the tag. | Make dulwich check the tag.
| Python | bsd-3-clause | siggame/webserver,siggame/webserver,siggame/webserver | from django.core.validators import RegexValidator
sha1_validator = RegexValidator(regex="^[a-f0-9]{40}$",
message="Must be valid sha1 sum")
tag_validator = RegexValidator(regex="^[A-Za-z][\w\-\.]+[A-Za-z]$",
message="Must be letters and numbers" +
... | from django.core.validators import RegexValidator
from django.core.exceptions import ValidationError
from dulwich.repo import check_ref_format
import re
sha1_validator = RegexValidator(regex="^[a-f0-9]{40}$",
message="Must be valid sha1 sum")
tag_regex = re.compile(r'^[A-Za-z][\w\-\.]+... | <commit_before>from django.core.validators import RegexValidator
sha1_validator = RegexValidator(regex="^[a-f0-9]{40}$",
message="Must be valid sha1 sum")
tag_validator = RegexValidator(regex="^[A-Za-z][\w\-\.]+[A-Za-z]$",
message="Must be letters and numb... | from django.core.validators import RegexValidator
from django.core.exceptions import ValidationError
from dulwich.repo import check_ref_format
import re
sha1_validator = RegexValidator(regex="^[a-f0-9]{40}$",
message="Must be valid sha1 sum")
tag_regex = re.compile(r'^[A-Za-z][\w\-\.]+... | from django.core.validators import RegexValidator
sha1_validator = RegexValidator(regex="^[a-f0-9]{40}$",
message="Must be valid sha1 sum")
tag_validator = RegexValidator(regex="^[A-Za-z][\w\-\.]+[A-Za-z]$",
message="Must be letters and numbers" +
... | <commit_before>from django.core.validators import RegexValidator
sha1_validator = RegexValidator(regex="^[a-f0-9]{40}$",
message="Must be valid sha1 sum")
tag_validator = RegexValidator(regex="^[A-Za-z][\w\-\.]+[A-Za-z]$",
message="Must be letters and numb... |
1e32cddfa5c9999f02c896e13666004260f8047a | examples/guv_simple_http_response.py | examples/guv_simple_http_response.py | import guv
guv.monkey_patch()
import guv.server
import logging
import time
from util import create_example
import logger
from pympler import tracker
tr = tracker.SummaryTracker()
if not hasattr(time, 'perf_counter'):
time.perf_counter = time.clock
logger.configure()
log = logging.getLogger()
response_times = ... | import guv
guv.monkey_patch()
import guv.server
import logging
import time
from util import create_example
import logger
try:
from pympler import tracker
tr = tracker.SummaryTracker()
except ImportError:
tr = None
if not hasattr(time, 'perf_counter'):
time.perf_counter = time.clock
logger.configure... | Use pympler only if available | Use pympler only if available
| Python | mit | veegee/guv,veegee/guv | import guv
guv.monkey_patch()
import guv.server
import logging
import time
from util import create_example
import logger
from pympler import tracker
tr = tracker.SummaryTracker()
if not hasattr(time, 'perf_counter'):
time.perf_counter = time.clock
logger.configure()
log = logging.getLogger()
response_times = ... | import guv
guv.monkey_patch()
import guv.server
import logging
import time
from util import create_example
import logger
try:
from pympler import tracker
tr = tracker.SummaryTracker()
except ImportError:
tr = None
if not hasattr(time, 'perf_counter'):
time.perf_counter = time.clock
logger.configure... | <commit_before>import guv
guv.monkey_patch()
import guv.server
import logging
import time
from util import create_example
import logger
from pympler import tracker
tr = tracker.SummaryTracker()
if not hasattr(time, 'perf_counter'):
time.perf_counter = time.clock
logger.configure()
log = logging.getLogger()
re... | import guv
guv.monkey_patch()
import guv.server
import logging
import time
from util import create_example
import logger
try:
from pympler import tracker
tr = tracker.SummaryTracker()
except ImportError:
tr = None
if not hasattr(time, 'perf_counter'):
time.perf_counter = time.clock
logger.configure... | import guv
guv.monkey_patch()
import guv.server
import logging
import time
from util import create_example
import logger
from pympler import tracker
tr = tracker.SummaryTracker()
if not hasattr(time, 'perf_counter'):
time.perf_counter = time.clock
logger.configure()
log = logging.getLogger()
response_times = ... | <commit_before>import guv
guv.monkey_patch()
import guv.server
import logging
import time
from util import create_example
import logger
from pympler import tracker
tr = tracker.SummaryTracker()
if not hasattr(time, 'perf_counter'):
time.perf_counter = time.clock
logger.configure()
log = logging.getLogger()
re... |
290bf5b5e577673a15e9a71033a5df2704ccff7a | opencademy/model/openacademy_session.py | opencademy/model/openacademy_session.py | # -*- coding: utf-8 -*-
from openerp import fields, models
class Session(models.Model):
_name = 'openacademy.session'
name = fields.Char(required=True)
start_date = fields.Date()
duration = fields.Float(digits=(6, 2), help="Duration in days")
seats = fields.Integer(string="Number of seats")
in... | # -*- coding: utf-8 -*-
from openerp import fields, models
class Session(models.Model):
_name = 'openacademy.session'
name = fields.Char(required=True)
start_date = fields.Date()
duration = fields.Float(digits=(6, 2), help="Duration in days")
seats = fields.Integer(string="Number of seats")
... | Add domain or and ilike | [REF] openacademy: Add domain or and ilike
| Python | apache-2.0 | LihanHA/opencademy-project | # -*- coding: utf-8 -*-
from openerp import fields, models
class Session(models.Model):
_name = 'openacademy.session'
name = fields.Char(required=True)
start_date = fields.Date()
duration = fields.Float(digits=(6, 2), help="Duration in days")
seats = fields.Integer(string="Number of seats")
in... | # -*- coding: utf-8 -*-
from openerp import fields, models
class Session(models.Model):
_name = 'openacademy.session'
name = fields.Char(required=True)
start_date = fields.Date()
duration = fields.Float(digits=(6, 2), help="Duration in days")
seats = fields.Integer(string="Number of seats")
... | <commit_before># -*- coding: utf-8 -*-
from openerp import fields, models
class Session(models.Model):
_name = 'openacademy.session'
name = fields.Char(required=True)
start_date = fields.Date()
duration = fields.Float(digits=(6, 2), help="Duration in days")
seats = fields.Integer(string="Number of... | # -*- coding: utf-8 -*-
from openerp import fields, models
class Session(models.Model):
_name = 'openacademy.session'
name = fields.Char(required=True)
start_date = fields.Date()
duration = fields.Float(digits=(6, 2), help="Duration in days")
seats = fields.Integer(string="Number of seats")
... | # -*- coding: utf-8 -*-
from openerp import fields, models
class Session(models.Model):
_name = 'openacademy.session'
name = fields.Char(required=True)
start_date = fields.Date()
duration = fields.Float(digits=(6, 2), help="Duration in days")
seats = fields.Integer(string="Number of seats")
in... | <commit_before># -*- coding: utf-8 -*-
from openerp import fields, models
class Session(models.Model):
_name = 'openacademy.session'
name = fields.Char(required=True)
start_date = fields.Date()
duration = fields.Float(digits=(6, 2), help="Duration in days")
seats = fields.Integer(string="Number of... |
e4cd2982d488b18af4046eec39a213faa2afa857 | common/djangoapps/dark_lang/models.py | common/djangoapps/dark_lang/models.py | """
Models for the dark-launching languages
"""
from django.db import models
from config_models.models import ConfigurationModel
class DarkLangConfig(ConfigurationModel):
"""
Configuration for the dark_lang django app
"""
released_languages = models.TextField(
blank=True,
help_text="A... | """
Models for the dark-launching languages
"""
from django.db import models
from config_models.models import ConfigurationModel
class DarkLangConfig(ConfigurationModel):
"""
Configuration for the dark_lang django app
"""
released_languages = models.TextField(
blank=True,
help_text="A... | Store released dark_lang codes as all lower-case | Store released dark_lang codes as all lower-case
| Python | agpl-3.0 | louyihua/edx-platform,JCBarahona/edX,JCBarahona/edX,ahmadio/edx-platform,chudaol/edx-platform,Edraak/edraak-platform,appsembler/edx-platform,Semi-global/edx-platform,halvertoluke/edx-platform,B-MOOC/edx-platform,tanmaykm/edx-platform,longmen21/edx-platform,zofuthan/edx-platform,vasyarv/edx-platform,mbareta/edx-platform... | """
Models for the dark-launching languages
"""
from django.db import models
from config_models.models import ConfigurationModel
class DarkLangConfig(ConfigurationModel):
"""
Configuration for the dark_lang django app
"""
released_languages = models.TextField(
blank=True,
help_text="A... | """
Models for the dark-launching languages
"""
from django.db import models
from config_models.models import ConfigurationModel
class DarkLangConfig(ConfigurationModel):
"""
Configuration for the dark_lang django app
"""
released_languages = models.TextField(
blank=True,
help_text="A... | <commit_before>"""
Models for the dark-launching languages
"""
from django.db import models
from config_models.models import ConfigurationModel
class DarkLangConfig(ConfigurationModel):
"""
Configuration for the dark_lang django app
"""
released_languages = models.TextField(
blank=True,
... | """
Models for the dark-launching languages
"""
from django.db import models
from config_models.models import ConfigurationModel
class DarkLangConfig(ConfigurationModel):
"""
Configuration for the dark_lang django app
"""
released_languages = models.TextField(
blank=True,
help_text="A... | """
Models for the dark-launching languages
"""
from django.db import models
from config_models.models import ConfigurationModel
class DarkLangConfig(ConfigurationModel):
"""
Configuration for the dark_lang django app
"""
released_languages = models.TextField(
blank=True,
help_text="A... | <commit_before>"""
Models for the dark-launching languages
"""
from django.db import models
from config_models.models import ConfigurationModel
class DarkLangConfig(ConfigurationModel):
"""
Configuration for the dark_lang django app
"""
released_languages = models.TextField(
blank=True,
... |
42b69fdb0d9267c339200185feddefb430aea6ae | geartracker/admin.py | geartracker/admin.py | from django.contrib import admin
from geartracker.models import *
class ItemAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("make", "model", "size")}
list_display = ('__unicode__', 'type', 'metric_weight', 'acquired')
list_filter = ('archived', 'category', 'type', 'make', 'tags')
search_field... | from django.contrib import admin
from geartracker.models import *
class ItemAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("make", "model", "size")}
list_display = ('__unicode__', 'type', 'metric_weight', 'acquired')
list_filter = ('archived', 'category', 'type', 'make')
search_fields = ('ma... | Remove tags from list_filter and filter_horizontal | Remove tags from list_filter and filter_horizontal
| Python | bsd-3-clause | pigmonkey/django-geartracker | from django.contrib import admin
from geartracker.models import *
class ItemAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("make", "model", "size")}
list_display = ('__unicode__', 'type', 'metric_weight', 'acquired')
list_filter = ('archived', 'category', 'type', 'make', 'tags')
search_field... | from django.contrib import admin
from geartracker.models import *
class ItemAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("make", "model", "size")}
list_display = ('__unicode__', 'type', 'metric_weight', 'acquired')
list_filter = ('archived', 'category', 'type', 'make')
search_fields = ('ma... | <commit_before>from django.contrib import admin
from geartracker.models import *
class ItemAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("make", "model", "size")}
list_display = ('__unicode__', 'type', 'metric_weight', 'acquired')
list_filter = ('archived', 'category', 'type', 'make', 'tags')
... | from django.contrib import admin
from geartracker.models import *
class ItemAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("make", "model", "size")}
list_display = ('__unicode__', 'type', 'metric_weight', 'acquired')
list_filter = ('archived', 'category', 'type', 'make')
search_fields = ('ma... | from django.contrib import admin
from geartracker.models import *
class ItemAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("make", "model", "size")}
list_display = ('__unicode__', 'type', 'metric_weight', 'acquired')
list_filter = ('archived', 'category', 'type', 'make', 'tags')
search_field... | <commit_before>from django.contrib import admin
from geartracker.models import *
class ItemAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("make", "model", "size")}
list_display = ('__unicode__', 'type', 'metric_weight', 'acquired')
list_filter = ('archived', 'category', 'type', 'make', 'tags')
... |
2a6399a74110b6a9e0d48349c68775986c13a579 | pyservice/context.py | pyservice/context.py | """
RequestContext stores state relevant to the current request, as well as
keeping track of the plugin execution order and providing a simple method
`advance` for calling the next plugin in the chain.
"""
import collections
class Container(collections.defaultdict):
DEFAULT_FACTORY = lambda: None
def __init_... | """
RequestContext stores state relevant to the current request, as well as
keeping track of the plugin execution order and providing a simple method
`advance` for calling the next plugin in the chain.
"""
import ujson
import collections
class Container(collections.defaultdict):
DEFAULT_FACTORY = lambda: None
... | Create class for request process recursion | Create class for request process recursion
| Python | mit | numberoverzero/pyservice | """
RequestContext stores state relevant to the current request, as well as
keeping track of the plugin execution order and providing a simple method
`advance` for calling the next plugin in the chain.
"""
import collections
class Container(collections.defaultdict):
DEFAULT_FACTORY = lambda: None
def __init_... | """
RequestContext stores state relevant to the current request, as well as
keeping track of the plugin execution order and providing a simple method
`advance` for calling the next plugin in the chain.
"""
import ujson
import collections
class Container(collections.defaultdict):
DEFAULT_FACTORY = lambda: None
... | <commit_before>"""
RequestContext stores state relevant to the current request, as well as
keeping track of the plugin execution order and providing a simple method
`advance` for calling the next plugin in the chain.
"""
import collections
class Container(collections.defaultdict):
DEFAULT_FACTORY = lambda: None
... | """
RequestContext stores state relevant to the current request, as well as
keeping track of the plugin execution order and providing a simple method
`advance` for calling the next plugin in the chain.
"""
import ujson
import collections
class Container(collections.defaultdict):
DEFAULT_FACTORY = lambda: None
... | """
RequestContext stores state relevant to the current request, as well as
keeping track of the plugin execution order and providing a simple method
`advance` for calling the next plugin in the chain.
"""
import collections
class Container(collections.defaultdict):
DEFAULT_FACTORY = lambda: None
def __init_... | <commit_before>"""
RequestContext stores state relevant to the current request, as well as
keeping track of the plugin execution order and providing a simple method
`advance` for calling the next plugin in the chain.
"""
import collections
class Container(collections.defaultdict):
DEFAULT_FACTORY = lambda: None
... |
cd342448675f3174bf74118de0447c1b0f169f3e | python/volumeBars.py | python/volumeBars.py | #!/usr/bin/env python
from rgbmatrix import RGBMatrix
from random import randint
import numpy
import math
import time
rows = 16
chains = 1
parallel = 1
ledMatrix = RGBMatrix(rows, chains, parallel)
height = ledMatrix.height
width = ledMatrix.width
barWidth = width / 16
pi = numpy.pi
barHeights = numpy.empty([16])
for... | #!/usr/bin/env python
from rgbmatrix import RGBMatrix
from random import randint
import numpy
import math
import time
rows = 16
chains = 1
parallel = 1
ledMatrix = RGBMatrix(rows, chains, parallel)
height = ledMatrix.height
width = ledMatrix.width
barWidth = width / 16
pi = numpy.pi
barHeights = numpy.empty([16])
for... | Create a more random function | Create a more random function
| Python | mit | DarkAce65/rpi-led-matrix,DarkAce65/rpi-led-matrix | #!/usr/bin/env python
from rgbmatrix import RGBMatrix
from random import randint
import numpy
import math
import time
rows = 16
chains = 1
parallel = 1
ledMatrix = RGBMatrix(rows, chains, parallel)
height = ledMatrix.height
width = ledMatrix.width
barWidth = width / 16
pi = numpy.pi
barHeights = numpy.empty([16])
for... | #!/usr/bin/env python
from rgbmatrix import RGBMatrix
from random import randint
import numpy
import math
import time
rows = 16
chains = 1
parallel = 1
ledMatrix = RGBMatrix(rows, chains, parallel)
height = ledMatrix.height
width = ledMatrix.width
barWidth = width / 16
pi = numpy.pi
barHeights = numpy.empty([16])
for... | <commit_before>#!/usr/bin/env python
from rgbmatrix import RGBMatrix
from random import randint
import numpy
import math
import time
rows = 16
chains = 1
parallel = 1
ledMatrix = RGBMatrix(rows, chains, parallel)
height = ledMatrix.height
width = ledMatrix.width
barWidth = width / 16
pi = numpy.pi
barHeights = numpy.... | #!/usr/bin/env python
from rgbmatrix import RGBMatrix
from random import randint
import numpy
import math
import time
rows = 16
chains = 1
parallel = 1
ledMatrix = RGBMatrix(rows, chains, parallel)
height = ledMatrix.height
width = ledMatrix.width
barWidth = width / 16
pi = numpy.pi
barHeights = numpy.empty([16])
for... | #!/usr/bin/env python
from rgbmatrix import RGBMatrix
from random import randint
import numpy
import math
import time
rows = 16
chains = 1
parallel = 1
ledMatrix = RGBMatrix(rows, chains, parallel)
height = ledMatrix.height
width = ledMatrix.width
barWidth = width / 16
pi = numpy.pi
barHeights = numpy.empty([16])
for... | <commit_before>#!/usr/bin/env python
from rgbmatrix import RGBMatrix
from random import randint
import numpy
import math
import time
rows = 16
chains = 1
parallel = 1
ledMatrix = RGBMatrix(rows, chains, parallel)
height = ledMatrix.height
width = ledMatrix.width
barWidth = width / 16
pi = numpy.pi
barHeights = numpy.... |
6c6021cd1a206a91432da096400358e5eb0255fe | nasa_data.py | nasa_data.py |
import requests
import os
def get_apod():
os.makedirs("APODs", exist_ok=True)
try:
apod_data = requests.get("https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY").json()
image_url = apod_data["url"]
if image_url.endswith(".gif"):
raise TypeError
image_data = requ... |
import requests
import os
def get_apod():
os.makedirs("APODs", exist_ok=True)
try:
# check if website is accessible
apod_data = requests.get("https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY")
apod_data.raise_for_status()
apod_data = apod_data.json()
# check if i... | Update 0.7.0 - specified try-block to check the status - changed except block - allowed .gif format but only up to 3MP (Twitter limitation) | Update 0.7.0
- specified try-block to check the status
- changed except block
- allowed .gif format but only up to 3MP (Twitter limitation)
| Python | mit | FXelix/space_facts_bot |
import requests
import os
def get_apod():
os.makedirs("APODs", exist_ok=True)
try:
apod_data = requests.get("https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY").json()
image_url = apod_data["url"]
if image_url.endswith(".gif"):
raise TypeError
image_data = requ... |
import requests
import os
def get_apod():
os.makedirs("APODs", exist_ok=True)
try:
# check if website is accessible
apod_data = requests.get("https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY")
apod_data.raise_for_status()
apod_data = apod_data.json()
# check if i... | <commit_before>
import requests
import os
def get_apod():
os.makedirs("APODs", exist_ok=True)
try:
apod_data = requests.get("https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY").json()
image_url = apod_data["url"]
if image_url.endswith(".gif"):
raise TypeError
im... |
import requests
import os
def get_apod():
os.makedirs("APODs", exist_ok=True)
try:
# check if website is accessible
apod_data = requests.get("https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY")
apod_data.raise_for_status()
apod_data = apod_data.json()
# check if i... |
import requests
import os
def get_apod():
os.makedirs("APODs", exist_ok=True)
try:
apod_data = requests.get("https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY").json()
image_url = apod_data["url"]
if image_url.endswith(".gif"):
raise TypeError
image_data = requ... | <commit_before>
import requests
import os
def get_apod():
os.makedirs("APODs", exist_ok=True)
try:
apod_data = requests.get("https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY").json()
image_url = apod_data["url"]
if image_url.endswith(".gif"):
raise TypeError
im... |
b702569c800953eb3476c927fbc1085e67c88dbd | ghettoq/messaging.py | ghettoq/messaging.py | from Queue import Empty
from itertools import cycle
class Queue(object):
def __init__(self, backend, name):
self.name = name
self.backend = backend
def put(self, payload):
self.backend.put(self.name, payload)
def get(self):
payload = self.backend.get(self.name)
i... | from Queue import Empty
from itertools import cycle
class Queue(object):
def __init__(self, backend, name):
self.name = name
self.backend = backend
def put(self, payload):
self.backend.put(self.name, payload)
def get(self):
payload = self.backend.get(self.name)
i... | Raise QueueEmpty when all queues has been tried. | QueueSet: Raise QueueEmpty when all queues has been tried.
| Python | bsd-3-clause | ask/ghettoq | from Queue import Empty
from itertools import cycle
class Queue(object):
def __init__(self, backend, name):
self.name = name
self.backend = backend
def put(self, payload):
self.backend.put(self.name, payload)
def get(self):
payload = self.backend.get(self.name)
i... | from Queue import Empty
from itertools import cycle
class Queue(object):
def __init__(self, backend, name):
self.name = name
self.backend = backend
def put(self, payload):
self.backend.put(self.name, payload)
def get(self):
payload = self.backend.get(self.name)
i... | <commit_before>from Queue import Empty
from itertools import cycle
class Queue(object):
def __init__(self, backend, name):
self.name = name
self.backend = backend
def put(self, payload):
self.backend.put(self.name, payload)
def get(self):
payload = self.backend.get(self.... | from Queue import Empty
from itertools import cycle
class Queue(object):
def __init__(self, backend, name):
self.name = name
self.backend = backend
def put(self, payload):
self.backend.put(self.name, payload)
def get(self):
payload = self.backend.get(self.name)
i... | from Queue import Empty
from itertools import cycle
class Queue(object):
def __init__(self, backend, name):
self.name = name
self.backend = backend
def put(self, payload):
self.backend.put(self.name, payload)
def get(self):
payload = self.backend.get(self.name)
i... | <commit_before>from Queue import Empty
from itertools import cycle
class Queue(object):
def __init__(self, backend, name):
self.name = name
self.backend = backend
def put(self, payload):
self.backend.put(self.name, payload)
def get(self):
payload = self.backend.get(self.... |
e4275c4f1a408dd9f8095bef4ed650ccc54401e9 | packages/mono-llvm-2-10.py | packages/mono-llvm-2-10.py | GitHubTarballPackage ('mono', 'llvm', '2.10', '943edbc1a93df204d687d82d34d2b2bdf9978f4e',
configure = 'CFLAGS="-m32" CPPFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32" ./configure --prefix="%{prefix}" --enable-optimized --enable-targets="x86 x86_64" --target=i386-apple-darwin10.8.0',
override_properties = { 'make': 'make... | GitHubTarballPackage ('mono', 'llvm', '2.10', '943edbc1a93df204d687d82d34d2b2bdf9978f4e',
configure = './configure --prefix="%{prefix}" --enable-optimized --enable-targets="x86 x86_64" --target=i386-apple-darwin10.8.0',
override_properties = { 'make': 'make' }
)
| Fix llvm so it doesn't corrupt the env when configuring itself | Fix llvm so it doesn't corrupt the env when configuring itself | Python | mit | BansheeMediaPlayer/bockbuild,mono/bockbuild,mono/bockbuild,BansheeMediaPlayer/bockbuild,BansheeMediaPlayer/bockbuild | GitHubTarballPackage ('mono', 'llvm', '2.10', '943edbc1a93df204d687d82d34d2b2bdf9978f4e',
configure = 'CFLAGS="-m32" CPPFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32" ./configure --prefix="%{prefix}" --enable-optimized --enable-targets="x86 x86_64" --target=i386-apple-darwin10.8.0',
override_properties = { 'make': 'make... | GitHubTarballPackage ('mono', 'llvm', '2.10', '943edbc1a93df204d687d82d34d2b2bdf9978f4e',
configure = './configure --prefix="%{prefix}" --enable-optimized --enable-targets="x86 x86_64" --target=i386-apple-darwin10.8.0',
override_properties = { 'make': 'make' }
)
| <commit_before>GitHubTarballPackage ('mono', 'llvm', '2.10', '943edbc1a93df204d687d82d34d2b2bdf9978f4e',
configure = 'CFLAGS="-m32" CPPFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32" ./configure --prefix="%{prefix}" --enable-optimized --enable-targets="x86 x86_64" --target=i386-apple-darwin10.8.0',
override_properties = ... | GitHubTarballPackage ('mono', 'llvm', '2.10', '943edbc1a93df204d687d82d34d2b2bdf9978f4e',
configure = './configure --prefix="%{prefix}" --enable-optimized --enable-targets="x86 x86_64" --target=i386-apple-darwin10.8.0',
override_properties = { 'make': 'make' }
)
| GitHubTarballPackage ('mono', 'llvm', '2.10', '943edbc1a93df204d687d82d34d2b2bdf9978f4e',
configure = 'CFLAGS="-m32" CPPFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32" ./configure --prefix="%{prefix}" --enable-optimized --enable-targets="x86 x86_64" --target=i386-apple-darwin10.8.0',
override_properties = { 'make': 'make... | <commit_before>GitHubTarballPackage ('mono', 'llvm', '2.10', '943edbc1a93df204d687d82d34d2b2bdf9978f4e',
configure = 'CFLAGS="-m32" CPPFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32" ./configure --prefix="%{prefix}" --enable-optimized --enable-targets="x86 x86_64" --target=i386-apple-darwin10.8.0',
override_properties = ... |
979aada6964a5c8ef1f5c787ce84d72420626901 | migrations/versions/36cbde703cc0_add_build_priority.py | migrations/versions/36cbde703cc0_add_build_priority.py | """Add Build.priority
Revision ID: 36cbde703cc0
Revises: fe743605e1a
Create Date: 2014-10-06 10:10:14.729720
"""
# revision identifiers, used by Alembic.
revision = '36cbde703cc0'
down_revision = 'fe743605e1a'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('build', sa.Column('prio... | """Add Build.priority
Revision ID: 36cbde703cc0
Revises: fe743605e1a
Create Date: 2014-10-06 10:10:14.729720
"""
# revision identifiers, used by Alembic.
revision = '36cbde703cc0'
down_revision = '2c6662281b66'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('build', sa.Column('pri... | Update build priority down revision | Update build priority down revision
2c6662281b66
| Python | apache-2.0 | dropbox/changes,dropbox/changes,wfxiang08/changes,wfxiang08/changes,bowlofstew/changes,bowlofstew/changes,wfxiang08/changes,dropbox/changes,wfxiang08/changes,dropbox/changes,bowlofstew/changes,bowlofstew/changes | """Add Build.priority
Revision ID: 36cbde703cc0
Revises: fe743605e1a
Create Date: 2014-10-06 10:10:14.729720
"""
# revision identifiers, used by Alembic.
revision = '36cbde703cc0'
down_revision = 'fe743605e1a'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('build', sa.Column('prio... | """Add Build.priority
Revision ID: 36cbde703cc0
Revises: fe743605e1a
Create Date: 2014-10-06 10:10:14.729720
"""
# revision identifiers, used by Alembic.
revision = '36cbde703cc0'
down_revision = '2c6662281b66'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('build', sa.Column('pri... | <commit_before>"""Add Build.priority
Revision ID: 36cbde703cc0
Revises: fe743605e1a
Create Date: 2014-10-06 10:10:14.729720
"""
# revision identifiers, used by Alembic.
revision = '36cbde703cc0'
down_revision = 'fe743605e1a'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('build', ... | """Add Build.priority
Revision ID: 36cbde703cc0
Revises: fe743605e1a
Create Date: 2014-10-06 10:10:14.729720
"""
# revision identifiers, used by Alembic.
revision = '36cbde703cc0'
down_revision = '2c6662281b66'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('build', sa.Column('pri... | """Add Build.priority
Revision ID: 36cbde703cc0
Revises: fe743605e1a
Create Date: 2014-10-06 10:10:14.729720
"""
# revision identifiers, used by Alembic.
revision = '36cbde703cc0'
down_revision = 'fe743605e1a'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('build', sa.Column('prio... | <commit_before>"""Add Build.priority
Revision ID: 36cbde703cc0
Revises: fe743605e1a
Create Date: 2014-10-06 10:10:14.729720
"""
# revision identifiers, used by Alembic.
revision = '36cbde703cc0'
down_revision = 'fe743605e1a'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('build', ... |
3fdd43166cd9280960afad5cc13f1cd34e0f944d | scripts/populate-noteworthy-projects.py | scripts/populate-noteworthy-projects.py | """
This will update node links on NOTEWORTHY_LINKS_NODE.
"""
import sys
import json
import urllib2
import logging
from modularodm import Q
from website.app import init_app
from website import models
from framework.auth.core import Auth
from scripts import utils as script_utils
from framework.transactions.context impor... | Add script for taking most popular nodes and adding them as node links to NOTEWORTHY_LINKS_NODE. | Add script for taking most popular nodes and adding them as node links to NOTEWORTHY_LINKS_NODE.
| Python | apache-2.0 | RomanZWang/osf.io,Johnetordoff/osf.io,chennan47/osf.io,aaxelb/osf.io,acshi/osf.io,mfraezz/osf.io,chennan47/osf.io,hmoco/osf.io,leb2dg/osf.io,CenterForOpenScience/osf.io,doublebits/osf.io,laurenrevere/osf.io,TomHeatwole/osf.io,wearpants/osf.io,samchrisinger/osf.io,amyshi188/osf.io,RomanZWang/osf.io,aaxelb/osf.io,canerug... | Add script for taking most popular nodes and adding them as node links to NOTEWORTHY_LINKS_NODE. | """
This will update node links on NOTEWORTHY_LINKS_NODE.
"""
import sys
import json
import urllib2
import logging
from modularodm import Q
from website.app import init_app
from website import models
from framework.auth.core import Auth
from scripts import utils as script_utils
from framework.transactions.context impor... | <commit_before><commit_msg>Add script for taking most popular nodes and adding them as node links to NOTEWORTHY_LINKS_NODE.<commit_after> | """
This will update node links on NOTEWORTHY_LINKS_NODE.
"""
import sys
import json
import urllib2
import logging
from modularodm import Q
from website.app import init_app
from website import models
from framework.auth.core import Auth
from scripts import utils as script_utils
from framework.transactions.context impor... | Add script for taking most popular nodes and adding them as node links to NOTEWORTHY_LINKS_NODE."""
This will update node links on NOTEWORTHY_LINKS_NODE.
"""
import sys
import json
import urllib2
import logging
from modularodm import Q
from website.app import init_app
from website import models
from framework.auth.core... | <commit_before><commit_msg>Add script for taking most popular nodes and adding them as node links to NOTEWORTHY_LINKS_NODE.<commit_after>"""
This will update node links on NOTEWORTHY_LINKS_NODE.
"""
import sys
import json
import urllib2
import logging
from modularodm import Q
from website.app import init_app
from websi... | |
c0e00f3caf12ad95bc753e65fc3721623c552aa0 | diceware.py | diceware.py | from random import randint
def sysrand(sides=6, rolls=5):
return ''.join(map(str, [randint(1, sides) for i in range(rolls)]))
def randorg(sides=6, rolls=5):
raise NotImplemented
def generate(suggestions=1, words=6, apikey=''):
with open('diceware.wordlist.asc.txt', 'r') as f:
wordlist = dict([map(str.strip, lin... | from __future__ import print_function
from httplib import HTTPSConnection
from random import randint
from uuid import uuid4
import json, sys
def sysrand(suggestions, words, rolls=5, sides=6, **kwargs):
print('sysrand', file=sys.stderr)
for i in range(suggestions):
yield [''.join(map(str, [randint(1... | Add random.org support for generating keys | Add random.org support for generating keys
* Replace tabs with spaces (d'oh!)
* Implement random key functions as generators so that we can retrieve
numbers necessary for all suggestions in one request from random.org
without burning through requests
* Send a request to the random.org API and parse the response in... | Python | mit | darthmall/Alfred-Diceware-Workflow | from random import randint
def sysrand(sides=6, rolls=5):
return ''.join(map(str, [randint(1, sides) for i in range(rolls)]))
def randorg(sides=6, rolls=5):
raise NotImplemented
def generate(suggestions=1, words=6, apikey=''):
with open('diceware.wordlist.asc.txt', 'r') as f:
wordlist = dict([map(str.strip, lin... | from __future__ import print_function
from httplib import HTTPSConnection
from random import randint
from uuid import uuid4
import json, sys
def sysrand(suggestions, words, rolls=5, sides=6, **kwargs):
print('sysrand', file=sys.stderr)
for i in range(suggestions):
yield [''.join(map(str, [randint(1... | <commit_before>from random import randint
def sysrand(sides=6, rolls=5):
return ''.join(map(str, [randint(1, sides) for i in range(rolls)]))
def randorg(sides=6, rolls=5):
raise NotImplemented
def generate(suggestions=1, words=6, apikey=''):
with open('diceware.wordlist.asc.txt', 'r') as f:
wordlist = dict([map... | from __future__ import print_function
from httplib import HTTPSConnection
from random import randint
from uuid import uuid4
import json, sys
def sysrand(suggestions, words, rolls=5, sides=6, **kwargs):
print('sysrand', file=sys.stderr)
for i in range(suggestions):
yield [''.join(map(str, [randint(1... | from random import randint
def sysrand(sides=6, rolls=5):
return ''.join(map(str, [randint(1, sides) for i in range(rolls)]))
def randorg(sides=6, rolls=5):
raise NotImplemented
def generate(suggestions=1, words=6, apikey=''):
with open('diceware.wordlist.asc.txt', 'r') as f:
wordlist = dict([map(str.strip, lin... | <commit_before>from random import randint
def sysrand(sides=6, rolls=5):
return ''.join(map(str, [randint(1, sides) for i in range(rolls)]))
def randorg(sides=6, rolls=5):
raise NotImplemented
def generate(suggestions=1, words=6, apikey=''):
with open('diceware.wordlist.asc.txt', 'r') as f:
wordlist = dict([map... |
62d5c5b2bf33a228938924a44e229f2f2cb4e02c | registrasion/urls.py | registrasion/urls.py | from django.conf.urls import url, include, patterns
urlpatterns = patterns(
"registrasion.views",
url(r"^category/([0-9]+)$", "product_category", name="product_category"),
url(r"^checkout$", "checkout", name="checkout"),
url(r"^invoice/([0-9]+)$", "invoice", name="invoice"),
url(r"^invoice/([0-9]+)... | from django.conf.urls import url, patterns
urlpatterns = patterns(
"registrasion.views",
url(r"^category/([0-9]+)$", "product_category", name="product_category"),
url(r"^checkout$", "checkout", name="checkout"),
url(r"^invoice/([0-9]+)$", "invoice", name="invoice"),
url(r"^invoice/([0-9]+)/pay$", "... | Revert "Registrasion URLs now include django-nested-admin" | Revert "Registrasion URLs now include django-nested-admin"
This reverts commit 58eed33c429c1035801e840b41aa7104c02b9b5a.
| Python | apache-2.0 | chrisjrn/registrasion,chrisjrn/registrasion | from django.conf.urls import url, include, patterns
urlpatterns = patterns(
"registrasion.views",
url(r"^category/([0-9]+)$", "product_category", name="product_category"),
url(r"^checkout$", "checkout", name="checkout"),
url(r"^invoice/([0-9]+)$", "invoice", name="invoice"),
url(r"^invoice/([0-9]+)... | from django.conf.urls import url, patterns
urlpatterns = patterns(
"registrasion.views",
url(r"^category/([0-9]+)$", "product_category", name="product_category"),
url(r"^checkout$", "checkout", name="checkout"),
url(r"^invoice/([0-9]+)$", "invoice", name="invoice"),
url(r"^invoice/([0-9]+)/pay$", "... | <commit_before>from django.conf.urls import url, include, patterns
urlpatterns = patterns(
"registrasion.views",
url(r"^category/([0-9]+)$", "product_category", name="product_category"),
url(r"^checkout$", "checkout", name="checkout"),
url(r"^invoice/([0-9]+)$", "invoice", name="invoice"),
url(r"^i... | from django.conf.urls import url, patterns
urlpatterns = patterns(
"registrasion.views",
url(r"^category/([0-9]+)$", "product_category", name="product_category"),
url(r"^checkout$", "checkout", name="checkout"),
url(r"^invoice/([0-9]+)$", "invoice", name="invoice"),
url(r"^invoice/([0-9]+)/pay$", "... | from django.conf.urls import url, include, patterns
urlpatterns = patterns(
"registrasion.views",
url(r"^category/([0-9]+)$", "product_category", name="product_category"),
url(r"^checkout$", "checkout", name="checkout"),
url(r"^invoice/([0-9]+)$", "invoice", name="invoice"),
url(r"^invoice/([0-9]+)... | <commit_before>from django.conf.urls import url, include, patterns
urlpatterns = patterns(
"registrasion.views",
url(r"^category/([0-9]+)$", "product_category", name="product_category"),
url(r"^checkout$", "checkout", name="checkout"),
url(r"^invoice/([0-9]+)$", "invoice", name="invoice"),
url(r"^i... |
e7afd7ccda4bb86769386891719d4bc4f7418509 | plugins/PointCloudAlignment/__init__.py | plugins/PointCloudAlignment/__init__.py | from . import PointCloudAlignTool
from . import PointCloudAlignView
from UM.Application import Application
def getMetaData():
return {
'type': 'tool',
'plugin':
{
"name": "PointCloudAlignment",
'author': 'Jaime van Kessel',
'version': '1.0',
'... | from . import PointCloudAlignTool
from . import PointCloudAlignView
from UM.Application import Application
def getMetaData():
return {
'type': 'tool',
'plugin':
{
"name": "PointCloudAlignment",
'author': 'Jaime van Kessel',
'version': '1.0',
'... | Hide PointCloudAlignment things from Cura | Hide PointCloudAlignment things from Cura
| Python | agpl-3.0 | onitake/Uranium,onitake/Uranium | from . import PointCloudAlignTool
from . import PointCloudAlignView
from UM.Application import Application
def getMetaData():
return {
'type': 'tool',
'plugin':
{
"name": "PointCloudAlignment",
'author': 'Jaime van Kessel',
'version': '1.0',
'... | from . import PointCloudAlignTool
from . import PointCloudAlignView
from UM.Application import Application
def getMetaData():
return {
'type': 'tool',
'plugin':
{
"name": "PointCloudAlignment",
'author': 'Jaime van Kessel',
'version': '1.0',
'... | <commit_before>from . import PointCloudAlignTool
from . import PointCloudAlignView
from UM.Application import Application
def getMetaData():
return {
'type': 'tool',
'plugin':
{
"name": "PointCloudAlignment",
'author': 'Jaime van Kessel',
'version': '1.0'... | from . import PointCloudAlignTool
from . import PointCloudAlignView
from UM.Application import Application
def getMetaData():
return {
'type': 'tool',
'plugin':
{
"name": "PointCloudAlignment",
'author': 'Jaime van Kessel',
'version': '1.0',
'... | from . import PointCloudAlignTool
from . import PointCloudAlignView
from UM.Application import Application
def getMetaData():
return {
'type': 'tool',
'plugin':
{
"name": "PointCloudAlignment",
'author': 'Jaime van Kessel',
'version': '1.0',
'... | <commit_before>from . import PointCloudAlignTool
from . import PointCloudAlignView
from UM.Application import Application
def getMetaData():
return {
'type': 'tool',
'plugin':
{
"name": "PointCloudAlignment",
'author': 'Jaime van Kessel',
'version': '1.0'... |
b089522f108c9071013e0cc00813e29bc415595c | logbot/irc_client.py | logbot/irc_client.py | import irc.client
import sys
import os
class IrcClient(object):
def __init__(self, server, port, channel, bot_name):
self.server = server
self.port = port
self.channel = channel
self.bot_name = bot_name
def start(self):
self._client = irc.client.IRC()
self._cli... | import irc.client
import sys
import os
class IrcClient(object):
def __init__(self, server, port, channel, bot_name):
self.server = server
self.port = port
self.channel = channel
self.bot_name = bot_name
def start(self):
self._client = irc.client.IRC()
self._cli... | Add nick to the log | Add nick to the log
| Python | mit | mlopes/LogBot | import irc.client
import sys
import os
class IrcClient(object):
def __init__(self, server, port, channel, bot_name):
self.server = server
self.port = port
self.channel = channel
self.bot_name = bot_name
def start(self):
self._client = irc.client.IRC()
self._cli... | import irc.client
import sys
import os
class IrcClient(object):
def __init__(self, server, port, channel, bot_name):
self.server = server
self.port = port
self.channel = channel
self.bot_name = bot_name
def start(self):
self._client = irc.client.IRC()
self._cli... | <commit_before>import irc.client
import sys
import os
class IrcClient(object):
def __init__(self, server, port, channel, bot_name):
self.server = server
self.port = port
self.channel = channel
self.bot_name = bot_name
def start(self):
self._client = irc.client.IRC()
... | import irc.client
import sys
import os
class IrcClient(object):
def __init__(self, server, port, channel, bot_name):
self.server = server
self.port = port
self.channel = channel
self.bot_name = bot_name
def start(self):
self._client = irc.client.IRC()
self._cli... | import irc.client
import sys
import os
class IrcClient(object):
def __init__(self, server, port, channel, bot_name):
self.server = server
self.port = port
self.channel = channel
self.bot_name = bot_name
def start(self):
self._client = irc.client.IRC()
self._cli... | <commit_before>import irc.client
import sys
import os
class IrcClient(object):
def __init__(self, server, port, channel, bot_name):
self.server = server
self.port = port
self.channel = channel
self.bot_name = bot_name
def start(self):
self._client = irc.client.IRC()
... |
ced2be321f347f3e28e79e5cfac4e4a83f6b6819 | fireplace/cards/blackrock/collectible.py | fireplace/cards/blackrock/collectible.py | from ..utils import *
##
# Minions
# Flamewaker
class BRM_002:
events = [
OWN_SPELL_PLAY.after(Hit(RANDOM_ENEMY_MINION, 1) * 2)
]
##
# Spells
# Solemn Vigil
class BRM_001:
action = [Draw(CONTROLLER) * 2]
def cost(self, value):
return value - self.game.minionsKilledThisTurn
# Dragon's Breath
class BRM_0... | from ..utils import *
##
# Minions
# Flamewaker
class BRM_002:
events = [
OWN_SPELL_PLAY.after(Hit(RANDOM_ENEMY_MINION, 1) * 2)
]
# Imp Gang Boss
class BRM_006:
events = [
Damage(SELF).on(Summon(CONTROLLER, "BRM_006t"))
]
##
# Spells
# Solemn Vigil
class BRM_001:
action = [Draw(CONTROLLER) * 2]
def c... | Implement Demonwrath and Imp Gang Boss | Implement Demonwrath and Imp Gang Boss
| Python | agpl-3.0 | smallnamespace/fireplace,Meerkov/fireplace,smallnamespace/fireplace,butozerca/fireplace,NightKev/fireplace,butozerca/fireplace,Ragowit/fireplace,amw2104/fireplace,Meerkov/fireplace,beheh/fireplace,liujimj/fireplace,liujimj/fireplace,oftc-ftw/fireplace,amw2104/fireplace,Ragowit/fireplace,jleclanche/fireplace,oftc-ftw/fi... | from ..utils import *
##
# Minions
# Flamewaker
class BRM_002:
events = [
OWN_SPELL_PLAY.after(Hit(RANDOM_ENEMY_MINION, 1) * 2)
]
##
# Spells
# Solemn Vigil
class BRM_001:
action = [Draw(CONTROLLER) * 2]
def cost(self, value):
return value - self.game.minionsKilledThisTurn
# Dragon's Breath
class BRM_0... | from ..utils import *
##
# Minions
# Flamewaker
class BRM_002:
events = [
OWN_SPELL_PLAY.after(Hit(RANDOM_ENEMY_MINION, 1) * 2)
]
# Imp Gang Boss
class BRM_006:
events = [
Damage(SELF).on(Summon(CONTROLLER, "BRM_006t"))
]
##
# Spells
# Solemn Vigil
class BRM_001:
action = [Draw(CONTROLLER) * 2]
def c... | <commit_before>from ..utils import *
##
# Minions
# Flamewaker
class BRM_002:
events = [
OWN_SPELL_PLAY.after(Hit(RANDOM_ENEMY_MINION, 1) * 2)
]
##
# Spells
# Solemn Vigil
class BRM_001:
action = [Draw(CONTROLLER) * 2]
def cost(self, value):
return value - self.game.minionsKilledThisTurn
# Dragon's Bre... | from ..utils import *
##
# Minions
# Flamewaker
class BRM_002:
events = [
OWN_SPELL_PLAY.after(Hit(RANDOM_ENEMY_MINION, 1) * 2)
]
# Imp Gang Boss
class BRM_006:
events = [
Damage(SELF).on(Summon(CONTROLLER, "BRM_006t"))
]
##
# Spells
# Solemn Vigil
class BRM_001:
action = [Draw(CONTROLLER) * 2]
def c... | from ..utils import *
##
# Minions
# Flamewaker
class BRM_002:
events = [
OWN_SPELL_PLAY.after(Hit(RANDOM_ENEMY_MINION, 1) * 2)
]
##
# Spells
# Solemn Vigil
class BRM_001:
action = [Draw(CONTROLLER) * 2]
def cost(self, value):
return value - self.game.minionsKilledThisTurn
# Dragon's Breath
class BRM_0... | <commit_before>from ..utils import *
##
# Minions
# Flamewaker
class BRM_002:
events = [
OWN_SPELL_PLAY.after(Hit(RANDOM_ENEMY_MINION, 1) * 2)
]
##
# Spells
# Solemn Vigil
class BRM_001:
action = [Draw(CONTROLLER) * 2]
def cost(self, value):
return value - self.game.minionsKilledThisTurn
# Dragon's Bre... |
d5b439577d6e609ccb736b5d66c19911a95fc460 | icekit/articles/page_type_plugins.py | icekit/articles/page_type_plugins.py | from django.conf.urls import patterns, url
from django.http import Http404
from django.template.response import TemplateResponse
from fluent_pages.extensions import page_type_pool
from icekit.page_types.layout_page.admin import LayoutPageAdmin
from icekit.plugins import ICEkitFluentContentsPagePlugin
class ListingPa... | from django.conf.urls import patterns, url
from django.http import Http404
from django.template.response import TemplateResponse
from fluent_pages.extensions import page_type_pool
from icekit.page_types.layout_page.admin import LayoutPageAdmin
from icekit.plugins import ICEkitFluentContentsPagePlugin
class ListingPa... | Make current request available to `ListingPage`s item methods | Make current request available to `ListingPage`s item methods
This is an awful hack. Hopefully we can find a better way.
See ICEKit ticket #154 in Assembla
| Python | mit | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit | from django.conf.urls import patterns, url
from django.http import Http404
from django.template.response import TemplateResponse
from fluent_pages.extensions import page_type_pool
from icekit.page_types.layout_page.admin import LayoutPageAdmin
from icekit.plugins import ICEkitFluentContentsPagePlugin
class ListingPa... | from django.conf.urls import patterns, url
from django.http import Http404
from django.template.response import TemplateResponse
from fluent_pages.extensions import page_type_pool
from icekit.page_types.layout_page.admin import LayoutPageAdmin
from icekit.plugins import ICEkitFluentContentsPagePlugin
class ListingPa... | <commit_before>from django.conf.urls import patterns, url
from django.http import Http404
from django.template.response import TemplateResponse
from fluent_pages.extensions import page_type_pool
from icekit.page_types.layout_page.admin import LayoutPageAdmin
from icekit.plugins import ICEkitFluentContentsPagePlugin
... | from django.conf.urls import patterns, url
from django.http import Http404
from django.template.response import TemplateResponse
from fluent_pages.extensions import page_type_pool
from icekit.page_types.layout_page.admin import LayoutPageAdmin
from icekit.plugins import ICEkitFluentContentsPagePlugin
class ListingPa... | from django.conf.urls import patterns, url
from django.http import Http404
from django.template.response import TemplateResponse
from fluent_pages.extensions import page_type_pool
from icekit.page_types.layout_page.admin import LayoutPageAdmin
from icekit.plugins import ICEkitFluentContentsPagePlugin
class ListingPa... | <commit_before>from django.conf.urls import patterns, url
from django.http import Http404
from django.template.response import TemplateResponse
from fluent_pages.extensions import page_type_pool
from icekit.page_types.layout_page.admin import LayoutPageAdmin
from icekit.plugins import ICEkitFluentContentsPagePlugin
... |
2959fa0a9f69cbfb7611bbc12488089921d26ab8 | IPython/frontend/html/notebook/__init__.py | IPython/frontend/html/notebook/__init__.py | """The IPython HTML Notebook"""
# check for tornado 2.1.0
msg = "The IPython Notebook requires tornado >= 2.1.0"
try:
import tornado
except ImportError:
raise ImportError(msg)
else:
if tornado.version_info < (2,1,0):
raise ImportError(msg+", but you have %s"%tornado.version)
del msg
| """The IPython HTML Notebook"""
# check for tornado 2.1.0
msg = "The IPython Notebook requires tornado >= 2.1.0"
try:
import tornado
except ImportError:
raise ImportError(msg)
try:
version_info = tornado.version_info
except AttributeError:
raise ImportError(msg + ", but you have < 1.1.0")
if version_in... | Fix for tornado check for tornado < 1.1.0 | Fix for tornado check for tornado < 1.1.0
Tornado < 1.1.0 does not have the ``version_info`` variable to check.
Debian squeeze has tornado 1.0.1.
| Python | bsd-3-clause | ipython/ipython,ipython/ipython | """The IPython HTML Notebook"""
# check for tornado 2.1.0
msg = "The IPython Notebook requires tornado >= 2.1.0"
try:
import tornado
except ImportError:
raise ImportError(msg)
else:
if tornado.version_info < (2,1,0):
raise ImportError(msg+", but you have %s"%tornado.version)
del msg
Fix for tornado... | """The IPython HTML Notebook"""
# check for tornado 2.1.0
msg = "The IPython Notebook requires tornado >= 2.1.0"
try:
import tornado
except ImportError:
raise ImportError(msg)
try:
version_info = tornado.version_info
except AttributeError:
raise ImportError(msg + ", but you have < 1.1.0")
if version_in... | <commit_before>"""The IPython HTML Notebook"""
# check for tornado 2.1.0
msg = "The IPython Notebook requires tornado >= 2.1.0"
try:
import tornado
except ImportError:
raise ImportError(msg)
else:
if tornado.version_info < (2,1,0):
raise ImportError(msg+", but you have %s"%tornado.version)
del msg
... | """The IPython HTML Notebook"""
# check for tornado 2.1.0
msg = "The IPython Notebook requires tornado >= 2.1.0"
try:
import tornado
except ImportError:
raise ImportError(msg)
try:
version_info = tornado.version_info
except AttributeError:
raise ImportError(msg + ", but you have < 1.1.0")
if version_in... | """The IPython HTML Notebook"""
# check for tornado 2.1.0
msg = "The IPython Notebook requires tornado >= 2.1.0"
try:
import tornado
except ImportError:
raise ImportError(msg)
else:
if tornado.version_info < (2,1,0):
raise ImportError(msg+", but you have %s"%tornado.version)
del msg
Fix for tornado... | <commit_before>"""The IPython HTML Notebook"""
# check for tornado 2.1.0
msg = "The IPython Notebook requires tornado >= 2.1.0"
try:
import tornado
except ImportError:
raise ImportError(msg)
else:
if tornado.version_info < (2,1,0):
raise ImportError(msg+", but you have %s"%tornado.version)
del msg
... |
fb256b042a485aefa2d9e45b39daa551a3f779ff | examples/open_file_dialog.py | examples/open_file_dialog.py | import webview
import threading
"""
This example demonstrates creating an open file dialog.
"""
def open_file_dialog():
import time
time.sleep(5)
print(webview.create_file_dialog(webview.OPEN_DIALOG, allow_multiple=True))
if __name__ == '__main__':
t = threading.Thread(target=open_file_dialog)
t... | import webview
import threading
"""
This example demonstrates creating an open file dialog.
"""
def open_file_dialog():
import time
time.sleep(5)
file_types = ('Image Files (*.bmp;*.jpg;*.gif)', 'All files (*.*)')
print(webview.create_file_dialog(webview.OPEN_DIALOG, allow_multiple=True, file_types=f... | Modify example to include file_types param | [All] Modify example to include file_types param
| Python | bsd-3-clause | r0x0r/pywebview,r0x0r/pywebview,shivaprsdv/pywebview,r0x0r/pywebview,shivaprsdv/pywebview,shivaprsdv/pywebview,shivaprsdv/pywebview,r0x0r/pywebview,r0x0r/pywebview | import webview
import threading
"""
This example demonstrates creating an open file dialog.
"""
def open_file_dialog():
import time
time.sleep(5)
print(webview.create_file_dialog(webview.OPEN_DIALOG, allow_multiple=True))
if __name__ == '__main__':
t = threading.Thread(target=open_file_dialog)
t... | import webview
import threading
"""
This example demonstrates creating an open file dialog.
"""
def open_file_dialog():
import time
time.sleep(5)
file_types = ('Image Files (*.bmp;*.jpg;*.gif)', 'All files (*.*)')
print(webview.create_file_dialog(webview.OPEN_DIALOG, allow_multiple=True, file_types=f... | <commit_before>import webview
import threading
"""
This example demonstrates creating an open file dialog.
"""
def open_file_dialog():
import time
time.sleep(5)
print(webview.create_file_dialog(webview.OPEN_DIALOG, allow_multiple=True))
if __name__ == '__main__':
t = threading.Thread(target=open_fil... | import webview
import threading
"""
This example demonstrates creating an open file dialog.
"""
def open_file_dialog():
import time
time.sleep(5)
file_types = ('Image Files (*.bmp;*.jpg;*.gif)', 'All files (*.*)')
print(webview.create_file_dialog(webview.OPEN_DIALOG, allow_multiple=True, file_types=f... | import webview
import threading
"""
This example demonstrates creating an open file dialog.
"""
def open_file_dialog():
import time
time.sleep(5)
print(webview.create_file_dialog(webview.OPEN_DIALOG, allow_multiple=True))
if __name__ == '__main__':
t = threading.Thread(target=open_file_dialog)
t... | <commit_before>import webview
import threading
"""
This example demonstrates creating an open file dialog.
"""
def open_file_dialog():
import time
time.sleep(5)
print(webview.create_file_dialog(webview.OPEN_DIALOG, allow_multiple=True))
if __name__ == '__main__':
t = threading.Thread(target=open_fil... |
d1e5f55681eda2b2b358013ad5dca3a58619c914 | pycom/objects.py | pycom/objects.py | # encoding: utf-8
### Attribute Wrapper
class AttrWrapper(object):
attrs = []
def __setattr__(self, name, value):
if name not in self.attrs:
raise AttributeError("'%s' is not supported" % name)
object.__setattr__(self, name, value)
def __repr__(self):
attrs = []
... | # encoding: utf-8
### Attribute Wrapper
class AttrWrapper(object):
attrs = []
def __setattr__(self, name, value):
if name not in self.attrs:
raise AttributeError("'%s' is not supported" % name)
object.__setattr__(self, name, value)
def __repr__(self):
attrs = []
... | Add the function to get the value of object, dict, list, or tuple. | Add the function to get the value of object, dict, list, or tuple.
| Python | mit | xgfone/pycom,xgfone/xutils | # encoding: utf-8
### Attribute Wrapper
class AttrWrapper(object):
attrs = []
def __setattr__(self, name, value):
if name not in self.attrs:
raise AttributeError("'%s' is not supported" % name)
object.__setattr__(self, name, value)
def __repr__(self):
attrs = []
... | # encoding: utf-8
### Attribute Wrapper
class AttrWrapper(object):
attrs = []
def __setattr__(self, name, value):
if name not in self.attrs:
raise AttributeError("'%s' is not supported" % name)
object.__setattr__(self, name, value)
def __repr__(self):
attrs = []
... | <commit_before># encoding: utf-8
### Attribute Wrapper
class AttrWrapper(object):
attrs = []
def __setattr__(self, name, value):
if name not in self.attrs:
raise AttributeError("'%s' is not supported" % name)
object.__setattr__(self, name, value)
def __repr__(self):
a... | # encoding: utf-8
### Attribute Wrapper
class AttrWrapper(object):
attrs = []
def __setattr__(self, name, value):
if name not in self.attrs:
raise AttributeError("'%s' is not supported" % name)
object.__setattr__(self, name, value)
def __repr__(self):
attrs = []
... | # encoding: utf-8
### Attribute Wrapper
class AttrWrapper(object):
attrs = []
def __setattr__(self, name, value):
if name not in self.attrs:
raise AttributeError("'%s' is not supported" % name)
object.__setattr__(self, name, value)
def __repr__(self):
attrs = []
... | <commit_before># encoding: utf-8
### Attribute Wrapper
class AttrWrapper(object):
attrs = []
def __setattr__(self, name, value):
if name not in self.attrs:
raise AttributeError("'%s' is not supported" % name)
object.__setattr__(self, name, value)
def __repr__(self):
a... |
482b8f7738da51c394969e526b37093d3c52d663 | pyconkr/tests.py | pyconkr/tests.py | # -*- coding: utf-8 -*-
from django.test import TestCase
from django.http import HttpResponse
from django.test import Client
from django.core.urlresolvers import reverse_lazy, reverse
from django.contrib.auth import get_user_model
from pyconkr.helper import render_io_error
User = get_user_model()
class HelperFunct... | # -*- coding: utf-8 -*-
from django.test import TestCase
from django.http import HttpResponse
from django.test import Client
from django.core.urlresolvers import reverse_lazy, reverse
from django.contrib.auth import get_user_model
from pyconkr.helper import render_io_error
User = get_user_model()
class HelperFunct... | Add profile model signal test case | Add profile model signal test case
| Python | mit | pythonkr/pyconapac-2016,pythonkr/pyconapac-2016,pythonkr/pyconapac-2016 | # -*- coding: utf-8 -*-
from django.test import TestCase
from django.http import HttpResponse
from django.test import Client
from django.core.urlresolvers import reverse_lazy, reverse
from django.contrib.auth import get_user_model
from pyconkr.helper import render_io_error
User = get_user_model()
class HelperFunct... | # -*- coding: utf-8 -*-
from django.test import TestCase
from django.http import HttpResponse
from django.test import Client
from django.core.urlresolvers import reverse_lazy, reverse
from django.contrib.auth import get_user_model
from pyconkr.helper import render_io_error
User = get_user_model()
class HelperFunct... | <commit_before># -*- coding: utf-8 -*-
from django.test import TestCase
from django.http import HttpResponse
from django.test import Client
from django.core.urlresolvers import reverse_lazy, reverse
from django.contrib.auth import get_user_model
from pyconkr.helper import render_io_error
User = get_user_model()
cl... | # -*- coding: utf-8 -*-
from django.test import TestCase
from django.http import HttpResponse
from django.test import Client
from django.core.urlresolvers import reverse_lazy, reverse
from django.contrib.auth import get_user_model
from pyconkr.helper import render_io_error
User = get_user_model()
class HelperFunct... | # -*- coding: utf-8 -*-
from django.test import TestCase
from django.http import HttpResponse
from django.test import Client
from django.core.urlresolvers import reverse_lazy, reverse
from django.contrib.auth import get_user_model
from pyconkr.helper import render_io_error
User = get_user_model()
class HelperFunct... | <commit_before># -*- coding: utf-8 -*-
from django.test import TestCase
from django.http import HttpResponse
from django.test import Client
from django.core.urlresolvers import reverse_lazy, reverse
from django.contrib.auth import get_user_model
from pyconkr.helper import render_io_error
User = get_user_model()
cl... |
bb20e4e0f8527f2a24a4164022028793336ab17c | bazaar/utils.py | bazaar/utils.py | from __future__ import unicode_literals
from djmoney_rates.utils import convert_money
import moneyed
from .settings import bazaar_settings
def convert_money_to_default_currency(money):
"""
Convert money amount to the system default currency. If money has no 'currency' attribute
does nothing
"""
... | Add helper function to convert money instances to default currency | Add helper function to convert money instances to default currency
| Python | bsd-2-clause | evonove/django-bazaar,evonove/django-bazaar,meghabhoj/NEWBAZAAR,meghabhoj/NEWBAZAAR,evonove/django-bazaar,meghabhoj/NEWBAZAAR | Add helper function to convert money instances to default currency | from __future__ import unicode_literals
from djmoney_rates.utils import convert_money
import moneyed
from .settings import bazaar_settings
def convert_money_to_default_currency(money):
"""
Convert money amount to the system default currency. If money has no 'currency' attribute
does nothing
"""
... | <commit_before><commit_msg>Add helper function to convert money instances to default currency<commit_after> | from __future__ import unicode_literals
from djmoney_rates.utils import convert_money
import moneyed
from .settings import bazaar_settings
def convert_money_to_default_currency(money):
"""
Convert money amount to the system default currency. If money has no 'currency' attribute
does nothing
"""
... | Add helper function to convert money instances to default currencyfrom __future__ import unicode_literals
from djmoney_rates.utils import convert_money
import moneyed
from .settings import bazaar_settings
def convert_money_to_default_currency(money):
"""
Convert money amount to the system default currency.... | <commit_before><commit_msg>Add helper function to convert money instances to default currency<commit_after>from __future__ import unicode_literals
from djmoney_rates.utils import convert_money
import moneyed
from .settings import bazaar_settings
def convert_money_to_default_currency(money):
"""
Convert mon... | |
ab99a515995e121944e0e7b355e8980984a2fd98 | util.py | util.py | __author__ = 'zifnab'
import string
from passlib.hash import sha512_crypt
import database
from flask_login import login_user
def random_string(size=10, chars=string.ascii_letters + string.digits):
import random
return ''.join(random.choice(chars) for x in range(size))
def create_user(**kwargs):
username ... | __author__ = 'zifnab'
import string
from passlib.hash import sha512_crypt
from random import SystemRandom
import database
from flask_login import login_user
_random = SystemRandom()
def random_string(size=10, chars=string.ascii_letters + string.digits):
return ''.join(_random.choice(chars) for x in range(size))
... | Use a cryptographically secure PRNG in random_string(). | Use a cryptographically secure PRNG in random_string().
By default python uses a non-CS PRNG, so with some analysis, "random_string"s could be predicted.
| Python | mit | zifnab06/zifb.in,zifnab06/zifb.in | __author__ = 'zifnab'
import string
from passlib.hash import sha512_crypt
import database
from flask_login import login_user
def random_string(size=10, chars=string.ascii_letters + string.digits):
import random
return ''.join(random.choice(chars) for x in range(size))
def create_user(**kwargs):
username ... | __author__ = 'zifnab'
import string
from passlib.hash import sha512_crypt
from random import SystemRandom
import database
from flask_login import login_user
_random = SystemRandom()
def random_string(size=10, chars=string.ascii_letters + string.digits):
return ''.join(_random.choice(chars) for x in range(size))
... | <commit_before>__author__ = 'zifnab'
import string
from passlib.hash import sha512_crypt
import database
from flask_login import login_user
def random_string(size=10, chars=string.ascii_letters + string.digits):
import random
return ''.join(random.choice(chars) for x in range(size))
def create_user(**kwargs)... | __author__ = 'zifnab'
import string
from passlib.hash import sha512_crypt
from random import SystemRandom
import database
from flask_login import login_user
_random = SystemRandom()
def random_string(size=10, chars=string.ascii_letters + string.digits):
return ''.join(_random.choice(chars) for x in range(size))
... | __author__ = 'zifnab'
import string
from passlib.hash import sha512_crypt
import database
from flask_login import login_user
def random_string(size=10, chars=string.ascii_letters + string.digits):
import random
return ''.join(random.choice(chars) for x in range(size))
def create_user(**kwargs):
username ... | <commit_before>__author__ = 'zifnab'
import string
from passlib.hash import sha512_crypt
import database
from flask_login import login_user
def random_string(size=10, chars=string.ascii_letters + string.digits):
import random
return ''.join(random.choice(chars) for x in range(size))
def create_user(**kwargs)... |
d283c4c94d9ba510460c2530d602fe0c1eb14be5 | server/proxy_util.py | server/proxy_util.py | #!/usr/bin/env python
import datetime
import json
import logging
import urllib2
class HarManager(object):
def __init__(self, args):
self._logger = logging.getLogger('kcaa.proxy_util')
self.pageref = 1
proxy_root = 'http://{}/proxy/{}'.format(args.proxy_controller,
... | #!/usr/bin/env python
import datetime
import json
import logging
import urllib2
class HarManager(object):
def __init__(self, args):
self._logger = logging.getLogger('kcaa.proxy_util')
self.pageref = 1
proxy_root = 'http://{}/proxy/{}'.format(args.proxy_controller,
... | Add a comment on HAR encoding. | Add a comment on HAR encoding.
| Python | apache-2.0 | kcaa/kcaa,kcaa/kcaa,kcaa/kcaa,kcaa/kcaa | #!/usr/bin/env python
import datetime
import json
import logging
import urllib2
class HarManager(object):
def __init__(self, args):
self._logger = logging.getLogger('kcaa.proxy_util')
self.pageref = 1
proxy_root = 'http://{}/proxy/{}'.format(args.proxy_controller,
... | #!/usr/bin/env python
import datetime
import json
import logging
import urllib2
class HarManager(object):
def __init__(self, args):
self._logger = logging.getLogger('kcaa.proxy_util')
self.pageref = 1
proxy_root = 'http://{}/proxy/{}'.format(args.proxy_controller,
... | <commit_before>#!/usr/bin/env python
import datetime
import json
import logging
import urllib2
class HarManager(object):
def __init__(self, args):
self._logger = logging.getLogger('kcaa.proxy_util')
self.pageref = 1
proxy_root = 'http://{}/proxy/{}'.format(args.proxy_controller,
... | #!/usr/bin/env python
import datetime
import json
import logging
import urllib2
class HarManager(object):
def __init__(self, args):
self._logger = logging.getLogger('kcaa.proxy_util')
self.pageref = 1
proxy_root = 'http://{}/proxy/{}'.format(args.proxy_controller,
... | #!/usr/bin/env python
import datetime
import json
import logging
import urllib2
class HarManager(object):
def __init__(self, args):
self._logger = logging.getLogger('kcaa.proxy_util')
self.pageref = 1
proxy_root = 'http://{}/proxy/{}'.format(args.proxy_controller,
... | <commit_before>#!/usr/bin/env python
import datetime
import json
import logging
import urllib2
class HarManager(object):
def __init__(self, args):
self._logger = logging.getLogger('kcaa.proxy_util')
self.pageref = 1
proxy_root = 'http://{}/proxy/{}'.format(args.proxy_controller,
... |
2aa45922f7d018398e028c2aed964cf2ec00038a | bika/lims/browser/widgets/recordswidget.py | bika/lims/browser/widgets/recordswidget.py | from AccessControl import ClassSecurityInfo
from Products.ATExtensions.widget import RecordsWidget as ATRecordsWidget
from Products.Archetypes.Registry import registerWidget
class RecordsWidget(ATRecordsWidget):
security = ClassSecurityInfo()
_properties = ATRecordsWidget._properties.copy()
_properties.upd... | from AccessControl import ClassSecurityInfo
from Products.ATExtensions.widget import RecordsWidget as ATRecordsWidget
from Products.Archetypes.Registry import registerWidget
class RecordsWidget(ATRecordsWidget):
security = ClassSecurityInfo()
_properties = ATRecordsWidget._properties.copy()
_properties.upd... | Allow empty values in Records Widget | Allow empty values in Records Widget
| Python | agpl-3.0 | anneline/Bika-LIMS,veroc/Bika-LIMS,veroc/Bika-LIMS,veroc/Bika-LIMS,DeBortoliWines/Bika-LIMS,labsanmartin/Bika-LIMS,rockfruit/bika.lims,labsanmartin/Bika-LIMS,anneline/Bika-LIMS,rockfruit/bika.lims,DeBortoliWines/Bika-LIMS,anneline/Bika-LIMS,DeBortoliWines/Bika-LIMS,labsanmartin/Bika-LIMS | from AccessControl import ClassSecurityInfo
from Products.ATExtensions.widget import RecordsWidget as ATRecordsWidget
from Products.Archetypes.Registry import registerWidget
class RecordsWidget(ATRecordsWidget):
security = ClassSecurityInfo()
_properties = ATRecordsWidget._properties.copy()
_properties.upd... | from AccessControl import ClassSecurityInfo
from Products.ATExtensions.widget import RecordsWidget as ATRecordsWidget
from Products.Archetypes.Registry import registerWidget
class RecordsWidget(ATRecordsWidget):
security = ClassSecurityInfo()
_properties = ATRecordsWidget._properties.copy()
_properties.upd... | <commit_before>from AccessControl import ClassSecurityInfo
from Products.ATExtensions.widget import RecordsWidget as ATRecordsWidget
from Products.Archetypes.Registry import registerWidget
class RecordsWidget(ATRecordsWidget):
security = ClassSecurityInfo()
_properties = ATRecordsWidget._properties.copy()
... | from AccessControl import ClassSecurityInfo
from Products.ATExtensions.widget import RecordsWidget as ATRecordsWidget
from Products.Archetypes.Registry import registerWidget
class RecordsWidget(ATRecordsWidget):
security = ClassSecurityInfo()
_properties = ATRecordsWidget._properties.copy()
_properties.upd... | from AccessControl import ClassSecurityInfo
from Products.ATExtensions.widget import RecordsWidget as ATRecordsWidget
from Products.Archetypes.Registry import registerWidget
class RecordsWidget(ATRecordsWidget):
security = ClassSecurityInfo()
_properties = ATRecordsWidget._properties.copy()
_properties.upd... | <commit_before>from AccessControl import ClassSecurityInfo
from Products.ATExtensions.widget import RecordsWidget as ATRecordsWidget
from Products.Archetypes.Registry import registerWidget
class RecordsWidget(ATRecordsWidget):
security = ClassSecurityInfo()
_properties = ATRecordsWidget._properties.copy()
... |
c088a28c9f7020cb64c25eb0e83dfdcd286015d3 | app/assets.py | app/assets.py | from flask.ext.assets import Bundle
app_css = Bundle(
'app.scss',
'map.scss',
filters='scss',
output='styles/app.css'
)
app_js = Bundle(
'app.js',
'descriptor.js',
'map.js',
'resources.js',
filters='jsmin',
output='scripts/app.js'
)
vendor_css = Bundle(
'vendor/semantic.mi... | from flask.ext.assets import Bundle
app_css = Bundle(
'*.scss',
filters='scss',
output='styles/app.css'
)
app_js = Bundle(
'app.js',
'descriptor.js',
'map.js',
'resources.js',
filters='jsmin',
output='scripts/app.js'
)
vendor_css = Bundle(
'vendor/semantic.min.css',
output... | Generalize scss bundle to track all scss files | Generalize scss bundle to track all scss files
| Python | mit | hack4impact/maps4all,hack4impact/asylum-connect-catalog,hack4impact/maps4all-jlc-sp2,hack4impact/maps4all,hack4impact/asylum-connect-catalog,hack4impact/asylum-connect-catalog,AsylumConnect/asylum-connect-catalog,hack4impact/maps4all,hack4impact/maps4all-jlc-sp2,hack4impact/maps4all-jlc-sp2,hack4impact/asylum-connect-c... | from flask.ext.assets import Bundle
app_css = Bundle(
'app.scss',
'map.scss',
filters='scss',
output='styles/app.css'
)
app_js = Bundle(
'app.js',
'descriptor.js',
'map.js',
'resources.js',
filters='jsmin',
output='scripts/app.js'
)
vendor_css = Bundle(
'vendor/semantic.mi... | from flask.ext.assets import Bundle
app_css = Bundle(
'*.scss',
filters='scss',
output='styles/app.css'
)
app_js = Bundle(
'app.js',
'descriptor.js',
'map.js',
'resources.js',
filters='jsmin',
output='scripts/app.js'
)
vendor_css = Bundle(
'vendor/semantic.min.css',
output... | <commit_before>from flask.ext.assets import Bundle
app_css = Bundle(
'app.scss',
'map.scss',
filters='scss',
output='styles/app.css'
)
app_js = Bundle(
'app.js',
'descriptor.js',
'map.js',
'resources.js',
filters='jsmin',
output='scripts/app.js'
)
vendor_css = Bundle(
'ven... | from flask.ext.assets import Bundle
app_css = Bundle(
'*.scss',
filters='scss',
output='styles/app.css'
)
app_js = Bundle(
'app.js',
'descriptor.js',
'map.js',
'resources.js',
filters='jsmin',
output='scripts/app.js'
)
vendor_css = Bundle(
'vendor/semantic.min.css',
output... | from flask.ext.assets import Bundle
app_css = Bundle(
'app.scss',
'map.scss',
filters='scss',
output='styles/app.css'
)
app_js = Bundle(
'app.js',
'descriptor.js',
'map.js',
'resources.js',
filters='jsmin',
output='scripts/app.js'
)
vendor_css = Bundle(
'vendor/semantic.mi... | <commit_before>from flask.ext.assets import Bundle
app_css = Bundle(
'app.scss',
'map.scss',
filters='scss',
output='styles/app.css'
)
app_js = Bundle(
'app.js',
'descriptor.js',
'map.js',
'resources.js',
filters='jsmin',
output='scripts/app.js'
)
vendor_css = Bundle(
'ven... |
ddbc9624aacf9e15897bdfb46fc2016888db114b | git/pmstats2/get-pm-stats.py | git/pmstats2/get-pm-stats.py | #!/usr/bin/env python
# get-pmstats.py
# Henry J Schmale
# November 25, 2017
#
# Calculates the additions and deletions per day within a git repository
# by parsing out the git log. It opens the log itself.
# Produces output as a CSV
import subprocess
from datetime import datetime
changes_by_date = {}
git_log = subp... | #!/usr/bin/env python
# get-pmstats.py
# Henry J Schmale
# November 25, 2017
#
# Calculates the additions and deletions per day within a git repository
# by parsing out the git log. It opens the log itself.
# Produces output as a CSV
import subprocess
from datetime import datetime
def chomp_int(val):
try:
... | Fix script for repos with binaries | Fix script for repos with binaries
| Python | mit | HSchmale16/UsefulScripts,HSchmale16/UsefulScripts,HSchmale16/UsefulScripts,HSchmale16/UsefulScripts,HSchmale16/UsefulScripts | #!/usr/bin/env python
# get-pmstats.py
# Henry J Schmale
# November 25, 2017
#
# Calculates the additions and deletions per day within a git repository
# by parsing out the git log. It opens the log itself.
# Produces output as a CSV
import subprocess
from datetime import datetime
changes_by_date = {}
git_log = subp... | #!/usr/bin/env python
# get-pmstats.py
# Henry J Schmale
# November 25, 2017
#
# Calculates the additions and deletions per day within a git repository
# by parsing out the git log. It opens the log itself.
# Produces output as a CSV
import subprocess
from datetime import datetime
def chomp_int(val):
try:
... | <commit_before>#!/usr/bin/env python
# get-pmstats.py
# Henry J Schmale
# November 25, 2017
#
# Calculates the additions and deletions per day within a git repository
# by parsing out the git log. It opens the log itself.
# Produces output as a CSV
import subprocess
from datetime import datetime
changes_by_date = {}... | #!/usr/bin/env python
# get-pmstats.py
# Henry J Schmale
# November 25, 2017
#
# Calculates the additions and deletions per day within a git repository
# by parsing out the git log. It opens the log itself.
# Produces output as a CSV
import subprocess
from datetime import datetime
def chomp_int(val):
try:
... | #!/usr/bin/env python
# get-pmstats.py
# Henry J Schmale
# November 25, 2017
#
# Calculates the additions and deletions per day within a git repository
# by parsing out the git log. It opens the log itself.
# Produces output as a CSV
import subprocess
from datetime import datetime
changes_by_date = {}
git_log = subp... | <commit_before>#!/usr/bin/env python
# get-pmstats.py
# Henry J Schmale
# November 25, 2017
#
# Calculates the additions and deletions per day within a git repository
# by parsing out the git log. It opens the log itself.
# Produces output as a CSV
import subprocess
from datetime import datetime
changes_by_date = {}... |
c1a2a1052d215f9971c7bb1e580fd88ab0b395f8 | background_hang_reporter_job/tracked.py | background_hang_reporter_job/tracked.py | class AllHangs(object):
title = "All Hangs"
@staticmethod
def matches_hang(_):
return True
class DevtoolsHangs(object):
title = "Devtools Hangs"
@staticmethod
def matches_hang(hang):
#pylint: disable=unused-variable
stack, duration, thread, runnable, process, annotatio... | class AllHangs(object):
title = "All Hangs"
@staticmethod
def matches_hang(_):
return True
class DevtoolsHangs(object):
title = "Devtools Hangs"
@staticmethod
def matches_hang(hang):
#pylint: disable=unused-variable
stack, duration, thread, runnable, process, annotatio... | Fix frame string check in devtools tracking | Fix frame string check in devtools tracking
| Python | mit | squarewave/background-hang-reporter-job,squarewave/background-hang-reporter-job | class AllHangs(object):
title = "All Hangs"
@staticmethod
def matches_hang(_):
return True
class DevtoolsHangs(object):
title = "Devtools Hangs"
@staticmethod
def matches_hang(hang):
#pylint: disable=unused-variable
stack, duration, thread, runnable, process, annotatio... | class AllHangs(object):
title = "All Hangs"
@staticmethod
def matches_hang(_):
return True
class DevtoolsHangs(object):
title = "Devtools Hangs"
@staticmethod
def matches_hang(hang):
#pylint: disable=unused-variable
stack, duration, thread, runnable, process, annotatio... | <commit_before>class AllHangs(object):
title = "All Hangs"
@staticmethod
def matches_hang(_):
return True
class DevtoolsHangs(object):
title = "Devtools Hangs"
@staticmethod
def matches_hang(hang):
#pylint: disable=unused-variable
stack, duration, thread, runnable, pro... | class AllHangs(object):
title = "All Hangs"
@staticmethod
def matches_hang(_):
return True
class DevtoolsHangs(object):
title = "Devtools Hangs"
@staticmethod
def matches_hang(hang):
#pylint: disable=unused-variable
stack, duration, thread, runnable, process, annotatio... | class AllHangs(object):
title = "All Hangs"
@staticmethod
def matches_hang(_):
return True
class DevtoolsHangs(object):
title = "Devtools Hangs"
@staticmethod
def matches_hang(hang):
#pylint: disable=unused-variable
stack, duration, thread, runnable, process, annotatio... | <commit_before>class AllHangs(object):
title = "All Hangs"
@staticmethod
def matches_hang(_):
return True
class DevtoolsHangs(object):
title = "Devtools Hangs"
@staticmethod
def matches_hang(hang):
#pylint: disable=unused-variable
stack, duration, thread, runnable, pro... |
a8596fd4a76460bd3e15509825d3cb3f82a3f8c4 | test/integration/ggrc/converters/test_import_delete.py | test/integration/ggrc/converters/test_import_delete.py | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from ggrc.converters import errors
from integration.ggrc import TestCase
class TestBasicCsvImport(TestCase):
def setUp(self):
TestCase.setUp(self)
self.client.get("/login")
def test_policy_ba... | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from integration.ggrc import TestCase
class TestBasicCsvImport(TestCase):
def setUp(self):
TestCase.setUp(self)
self.client.get("/login")
def test_policy_basic_import(self):
filename = "c... | Optimize basic delete import tests | Optimize basic delete import tests
The dry-run check is now automatically performed on each import and we
do not need to duplicate the work in the delete test.
| Python | apache-2.0 | selahssea/ggrc-core,plamut/ggrc-core,selahssea/ggrc-core,selahssea/ggrc-core,VinnieJohns/ggrc-core,plamut/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,VinnieJohns/ggrc-core,VinnieJohns/ggrc-core,selahssea/ggrc-core,plamut/ggrc-core | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from ggrc.converters import errors
from integration.ggrc import TestCase
class TestBasicCsvImport(TestCase):
def setUp(self):
TestCase.setUp(self)
self.client.get("/login")
def test_policy_ba... | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from integration.ggrc import TestCase
class TestBasicCsvImport(TestCase):
def setUp(self):
TestCase.setUp(self)
self.client.get("/login")
def test_policy_basic_import(self):
filename = "c... | <commit_before># Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from ggrc.converters import errors
from integration.ggrc import TestCase
class TestBasicCsvImport(TestCase):
def setUp(self):
TestCase.setUp(self)
self.client.get("/login")
def... | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from integration.ggrc import TestCase
class TestBasicCsvImport(TestCase):
def setUp(self):
TestCase.setUp(self)
self.client.get("/login")
def test_policy_basic_import(self):
filename = "c... | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from ggrc.converters import errors
from integration.ggrc import TestCase
class TestBasicCsvImport(TestCase):
def setUp(self):
TestCase.setUp(self)
self.client.get("/login")
def test_policy_ba... | <commit_before># Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from ggrc.converters import errors
from integration.ggrc import TestCase
class TestBasicCsvImport(TestCase):
def setUp(self):
TestCase.setUp(self)
self.client.get("/login")
def... |
9d10d279a1f7de2a5572229d68a7065fb9353ab9 | linkedin_scraper/parsers/employment.py | linkedin_scraper/parsers/employment.py | from typing import Tuple
from linkedin_scraper.parsers.base import BaseParser
class EmploymentParser(BaseParser):
def __init__(self):
self.professions_list = self.get_lines_from_datafile(
'professions_list.txt')
def parse(self, item: str) -> Tuple[str, str]:
"""
Parse Lin... | from typing import Tuple
from linkedin_scraper.parsers.base import BaseParser
class EmploymentParser(BaseParser):
def __init__(self):
self.professions_list = self.get_lines_from_datafile(
'professions_list.txt')
def parse(self, item: str) -> Tuple[str, str]:
"""
Parse Lin... | Remove duplicated split call from EmploymentParser. | Remove duplicated split call from EmploymentParser.
| Python | mit | nihn/linkedin-scraper,nihn/linkedin-scraper | from typing import Tuple
from linkedin_scraper.parsers.base import BaseParser
class EmploymentParser(BaseParser):
def __init__(self):
self.professions_list = self.get_lines_from_datafile(
'professions_list.txt')
def parse(self, item: str) -> Tuple[str, str]:
"""
Parse Lin... | from typing import Tuple
from linkedin_scraper.parsers.base import BaseParser
class EmploymentParser(BaseParser):
def __init__(self):
self.professions_list = self.get_lines_from_datafile(
'professions_list.txt')
def parse(self, item: str) -> Tuple[str, str]:
"""
Parse Lin... | <commit_before>from typing import Tuple
from linkedin_scraper.parsers.base import BaseParser
class EmploymentParser(BaseParser):
def __init__(self):
self.professions_list = self.get_lines_from_datafile(
'professions_list.txt')
def parse(self, item: str) -> Tuple[str, str]:
"""
... | from typing import Tuple
from linkedin_scraper.parsers.base import BaseParser
class EmploymentParser(BaseParser):
def __init__(self):
self.professions_list = self.get_lines_from_datafile(
'professions_list.txt')
def parse(self, item: str) -> Tuple[str, str]:
"""
Parse Lin... | from typing import Tuple
from linkedin_scraper.parsers.base import BaseParser
class EmploymentParser(BaseParser):
def __init__(self):
self.professions_list = self.get_lines_from_datafile(
'professions_list.txt')
def parse(self, item: str) -> Tuple[str, str]:
"""
Parse Lin... | <commit_before>from typing import Tuple
from linkedin_scraper.parsers.base import BaseParser
class EmploymentParser(BaseParser):
def __init__(self):
self.professions_list = self.get_lines_from_datafile(
'professions_list.txt')
def parse(self, item: str) -> Tuple[str, str]:
"""
... |
a7afe12e241ee8f6ca8b85850ff43b777220ec62 | cdf/__init__.py | cdf/__init__.py | import django
from django.conf import settings
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'
}
},
)
django.setup()
| Add basic django config to be able to manipulate form classes | Add basic django config to be able to manipulate form classes
| Python | mit | ana-balica/classy-django-forms,ana-balica/classy-django-forms,ana-balica/classy-django-forms | Add basic django config to be able to manipulate form classes | import django
from django.conf import settings
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'
}
},
)
django.setup()
| <commit_before><commit_msg>Add basic django config to be able to manipulate form classes<commit_after> | import django
from django.conf import settings
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'
}
},
)
django.setup()
| Add basic django config to be able to manipulate form classesimport django
from django.conf import settings
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'
}
},
)
django.setup()
| <commit_before><commit_msg>Add basic django config to be able to manipulate form classes<commit_after>import django
from django.conf import settings
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'
}
},
)
django.se... | |
650a4733aa6e15b80e2adeec34fc479a3b2885e3 | src/cmdline/config.py | src/cmdline/config.py | import os
import sys
try:
import pkg_resources
d = pkg_resources.get_distribution('metermaid')
pkg_locations = (
os.path.join(d.location, 'config'),
os.path.join(os.path.dirname(d.location), 'config'),
)
except ImportError:
pkg_locations = ()
def get_config_paths(filename=None):
... | import os
import sys
try:
import pkg_resources
d = pkg_resources.get_distribution('metermaid')
pkg_locations = (
os.path.join(d.location, 'config'),
os.path.join(os.path.dirname(d.location), 'config'),
)
except ImportError:
pkg_locations = ()
def get_config_paths(filename=None):
... | Use etc relative to sys.prefix | Use etc relative to sys.prefix
| Python | apache-2.0 | rca/cmdline | import os
import sys
try:
import pkg_resources
d = pkg_resources.get_distribution('metermaid')
pkg_locations = (
os.path.join(d.location, 'config'),
os.path.join(os.path.dirname(d.location), 'config'),
)
except ImportError:
pkg_locations = ()
def get_config_paths(filename=None):
... | import os
import sys
try:
import pkg_resources
d = pkg_resources.get_distribution('metermaid')
pkg_locations = (
os.path.join(d.location, 'config'),
os.path.join(os.path.dirname(d.location), 'config'),
)
except ImportError:
pkg_locations = ()
def get_config_paths(filename=None):
... | <commit_before>import os
import sys
try:
import pkg_resources
d = pkg_resources.get_distribution('metermaid')
pkg_locations = (
os.path.join(d.location, 'config'),
os.path.join(os.path.dirname(d.location), 'config'),
)
except ImportError:
pkg_locations = ()
def get_config_paths(f... | import os
import sys
try:
import pkg_resources
d = pkg_resources.get_distribution('metermaid')
pkg_locations = (
os.path.join(d.location, 'config'),
os.path.join(os.path.dirname(d.location), 'config'),
)
except ImportError:
pkg_locations = ()
def get_config_paths(filename=None):
... | import os
import sys
try:
import pkg_resources
d = pkg_resources.get_distribution('metermaid')
pkg_locations = (
os.path.join(d.location, 'config'),
os.path.join(os.path.dirname(d.location), 'config'),
)
except ImportError:
pkg_locations = ()
def get_config_paths(filename=None):
... | <commit_before>import os
import sys
try:
import pkg_resources
d = pkg_resources.get_distribution('metermaid')
pkg_locations = (
os.path.join(d.location, 'config'),
os.path.join(os.path.dirname(d.location), 'config'),
)
except ImportError:
pkg_locations = ()
def get_config_paths(f... |
6384e6a23f73eddf1099e01ed0d8c067141651a5 | tcelery/__init__.py | tcelery/__init__.py | from __future__ import absolute_import
import celery
from tornado import ioloop
from .connection import ConnectionPool
from .producer import NonBlockingTaskProducer
from .result import AsyncResult
VERSION = (0, 4, 0)
__version__ = '.'.join(map(str, VERSION)) + '-dev'
def setup_nonblocking_producer(celery_app=None... | from __future__ import absolute_import
import celery
from tornado import ioloop
from .connection import ConnectionPool
from .producer import NonBlockingTaskProducer
from .result import AsyncResult
VERSION = (0, 3, 4)
__version__ = '.'.join(map(str, VERSION))
def setup_nonblocking_producer(celery_app=None, io_loop... | Set release version to 0.3.4 | Set release version to 0.3.4
| Python | bsd-3-clause | shnjp/tornado-celery,qudos-com/tornado-celery,mher/tornado-celery,sangwonl/tornado-celery | from __future__ import absolute_import
import celery
from tornado import ioloop
from .connection import ConnectionPool
from .producer import NonBlockingTaskProducer
from .result import AsyncResult
VERSION = (0, 4, 0)
__version__ = '.'.join(map(str, VERSION)) + '-dev'
def setup_nonblocking_producer(celery_app=None... | from __future__ import absolute_import
import celery
from tornado import ioloop
from .connection import ConnectionPool
from .producer import NonBlockingTaskProducer
from .result import AsyncResult
VERSION = (0, 3, 4)
__version__ = '.'.join(map(str, VERSION))
def setup_nonblocking_producer(celery_app=None, io_loop... | <commit_before>from __future__ import absolute_import
import celery
from tornado import ioloop
from .connection import ConnectionPool
from .producer import NonBlockingTaskProducer
from .result import AsyncResult
VERSION = (0, 4, 0)
__version__ = '.'.join(map(str, VERSION)) + '-dev'
def setup_nonblocking_producer(... | from __future__ import absolute_import
import celery
from tornado import ioloop
from .connection import ConnectionPool
from .producer import NonBlockingTaskProducer
from .result import AsyncResult
VERSION = (0, 3, 4)
__version__ = '.'.join(map(str, VERSION))
def setup_nonblocking_producer(celery_app=None, io_loop... | from __future__ import absolute_import
import celery
from tornado import ioloop
from .connection import ConnectionPool
from .producer import NonBlockingTaskProducer
from .result import AsyncResult
VERSION = (0, 4, 0)
__version__ = '.'.join(map(str, VERSION)) + '-dev'
def setup_nonblocking_producer(celery_app=None... | <commit_before>from __future__ import absolute_import
import celery
from tornado import ioloop
from .connection import ConnectionPool
from .producer import NonBlockingTaskProducer
from .result import AsyncResult
VERSION = (0, 4, 0)
__version__ = '.'.join(map(str, VERSION)) + '-dev'
def setup_nonblocking_producer(... |
2a7a65afc84556396822933f95aa080a56824aaa | wsgi.py | wsgi.py | # Activate virtualenv
import settings
activate_this = settings.VENV
execfile(activate_this, dict(__file__=activate_this))
from webhaak import app as application
if __name__ == "__main__":
# application is ran standalone
application.run()
| # Activate virtualenv
import settings
activate_this = settings.VENV
execfile(activate_this, dict(__file__=activate_this))
from webhaak import app as application
if __name__ == "__main__":
# application is ran standalone
application.run(debug=settings.DEBUG)
| Use the DEBUG setting for enabling/disabling Flask debug | Use the DEBUG setting for enabling/disabling Flask debug
| Python | apache-2.0 | aquatix/webhaak,aquatix/webhaak | # Activate virtualenv
import settings
activate_this = settings.VENV
execfile(activate_this, dict(__file__=activate_this))
from webhaak import app as application
if __name__ == "__main__":
# application is ran standalone
application.run()
Use the DEBUG setting for enabling/disabling Flask debug | # Activate virtualenv
import settings
activate_this = settings.VENV
execfile(activate_this, dict(__file__=activate_this))
from webhaak import app as application
if __name__ == "__main__":
# application is ran standalone
application.run(debug=settings.DEBUG)
| <commit_before># Activate virtualenv
import settings
activate_this = settings.VENV
execfile(activate_this, dict(__file__=activate_this))
from webhaak import app as application
if __name__ == "__main__":
# application is ran standalone
application.run()
<commit_msg>Use the DEBUG setting for enabling/disabling ... | # Activate virtualenv
import settings
activate_this = settings.VENV
execfile(activate_this, dict(__file__=activate_this))
from webhaak import app as application
if __name__ == "__main__":
# application is ran standalone
application.run(debug=settings.DEBUG)
| # Activate virtualenv
import settings
activate_this = settings.VENV
execfile(activate_this, dict(__file__=activate_this))
from webhaak import app as application
if __name__ == "__main__":
# application is ran standalone
application.run()
Use the DEBUG setting for enabling/disabling Flask debug# Activate virtu... | <commit_before># Activate virtualenv
import settings
activate_this = settings.VENV
execfile(activate_this, dict(__file__=activate_this))
from webhaak import app as application
if __name__ == "__main__":
# application is ran standalone
application.run()
<commit_msg>Use the DEBUG setting for enabling/disabling ... |
eb25c6900b307792821f7db6bcfa92cc62a80298 | lims/pricebook/views.py | lims/pricebook/views.py |
from rest_framework import viewsets
from rest_framework.decorators import list_route
from rest_framework.response import Response
from lims.permissions.permissions import IsInAdminGroupOrRO
from lims.shared.mixins import AuditTrailViewMixin
from .models import PriceBook
from .serializers import PriceBookSerializer
f... | from django.conf import settings
from simple_salesforce import Salesforce
from rest_framework import viewsets
from rest_framework.decorators import list_route
from rest_framework.response import Response
from lims.permissions.permissions import IsInAdminGroupOrRO
from lims.shared.mixins import AuditTrailViewMixin
f... | Add list crm pricebooks endpoint and update pricebook fetching | Add list crm pricebooks endpoint and update pricebook fetching
| Python | mit | GETLIMS/LIMS-Backend,GETLIMS/LIMS-Backend |
from rest_framework import viewsets
from rest_framework.decorators import list_route
from rest_framework.response import Response
from lims.permissions.permissions import IsInAdminGroupOrRO
from lims.shared.mixins import AuditTrailViewMixin
from .models import PriceBook
from .serializers import PriceBookSerializer
f... | from django.conf import settings
from simple_salesforce import Salesforce
from rest_framework import viewsets
from rest_framework.decorators import list_route
from rest_framework.response import Response
from lims.permissions.permissions import IsInAdminGroupOrRO
from lims.shared.mixins import AuditTrailViewMixin
f... | <commit_before>
from rest_framework import viewsets
from rest_framework.decorators import list_route
from rest_framework.response import Response
from lims.permissions.permissions import IsInAdminGroupOrRO
from lims.shared.mixins import AuditTrailViewMixin
from .models import PriceBook
from .serializers import PriceB... | from django.conf import settings
from simple_salesforce import Salesforce
from rest_framework import viewsets
from rest_framework.decorators import list_route
from rest_framework.response import Response
from lims.permissions.permissions import IsInAdminGroupOrRO
from lims.shared.mixins import AuditTrailViewMixin
f... |
from rest_framework import viewsets
from rest_framework.decorators import list_route
from rest_framework.response import Response
from lims.permissions.permissions import IsInAdminGroupOrRO
from lims.shared.mixins import AuditTrailViewMixin
from .models import PriceBook
from .serializers import PriceBookSerializer
f... | <commit_before>
from rest_framework import viewsets
from rest_framework.decorators import list_route
from rest_framework.response import Response
from lims.permissions.permissions import IsInAdminGroupOrRO
from lims.shared.mixins import AuditTrailViewMixin
from .models import PriceBook
from .serializers import PriceB... |
07dc719807a6d890fa33338746caca61704de0a1 | src/genbank-gff-to-nquads.py | src/genbank-gff-to-nquads.py | #!/usr/bin/env python
import jargparse
#################
### CONSTANTS ###
#################
metadataPrefix = '#'
accessionKey = '#!genome-build-accession NCBI_Assembly:'
locusTagAttributeKey = 'locus_tag'
#################
### FUNCTIONS ###
#################
def parseRecord(record, locusTags):
components = reco... | #!/usr/bin/env python
import jargparse
#################
### CONSTANTS ###
#################
metadataPrefix = '#'
accessionKey = '#!genome-build-accession NCBI_Assembly:'
#################
### FUNCTIONS ###
#################
def parseRecord(record, locusTags):
locusTagAttributeKey = 'locus_tag'
components =... | Move locus tag attribute key name into the function that uses it | Move locus tag attribute key name into the function that uses it
| Python | apache-2.0 | justinccdev/biolta | #!/usr/bin/env python
import jargparse
#################
### CONSTANTS ###
#################
metadataPrefix = '#'
accessionKey = '#!genome-build-accession NCBI_Assembly:'
locusTagAttributeKey = 'locus_tag'
#################
### FUNCTIONS ###
#################
def parseRecord(record, locusTags):
components = reco... | #!/usr/bin/env python
import jargparse
#################
### CONSTANTS ###
#################
metadataPrefix = '#'
accessionKey = '#!genome-build-accession NCBI_Assembly:'
#################
### FUNCTIONS ###
#################
def parseRecord(record, locusTags):
locusTagAttributeKey = 'locus_tag'
components =... | <commit_before>#!/usr/bin/env python
import jargparse
#################
### CONSTANTS ###
#################
metadataPrefix = '#'
accessionKey = '#!genome-build-accession NCBI_Assembly:'
locusTagAttributeKey = 'locus_tag'
#################
### FUNCTIONS ###
#################
def parseRecord(record, locusTags):
co... | #!/usr/bin/env python
import jargparse
#################
### CONSTANTS ###
#################
metadataPrefix = '#'
accessionKey = '#!genome-build-accession NCBI_Assembly:'
#################
### FUNCTIONS ###
#################
def parseRecord(record, locusTags):
locusTagAttributeKey = 'locus_tag'
components =... | #!/usr/bin/env python
import jargparse
#################
### CONSTANTS ###
#################
metadataPrefix = '#'
accessionKey = '#!genome-build-accession NCBI_Assembly:'
locusTagAttributeKey = 'locus_tag'
#################
### FUNCTIONS ###
#################
def parseRecord(record, locusTags):
components = reco... | <commit_before>#!/usr/bin/env python
import jargparse
#################
### CONSTANTS ###
#################
metadataPrefix = '#'
accessionKey = '#!genome-build-accession NCBI_Assembly:'
locusTagAttributeKey = 'locus_tag'
#################
### FUNCTIONS ###
#################
def parseRecord(record, locusTags):
co... |
af85d44d9a6f7cf65fe504816bcf4a10ba603d51 | pdfdocument/utils.py | pdfdocument/utils.py | import re
from django.http import HttpResponse
from pdfdocument.document import PDFDocument
FILENAME_RE = re.compile(r'[^A-Za-z0-9\-\.]+')
def pdf_response(filename, as_attachment=True, **kwargs):
response = HttpResponse(content_type='application/pdf')
response['Content-Disposition'] = '%s; filename="%s.pd... | import re
from django.http import HttpResponse
from pdfdocument.document import PDFDocument
FILENAME_RE = re.compile(r'[^A-Za-z0-9\-\.]+')
def pdf_response(filename, as_attachment=True, pdfdocument=PDFDocument,
**kwargs):
response = HttpResponse(content_type='application/pdf')
response['Content-Di... | Make the PDFDocument class used in pdf_response configurable | Make the PDFDocument class used in pdf_response configurable
| Python | bsd-3-clause | matthiask/pdfdocument,dongguangming/pdfdocument | import re
from django.http import HttpResponse
from pdfdocument.document import PDFDocument
FILENAME_RE = re.compile(r'[^A-Za-z0-9\-\.]+')
def pdf_response(filename, as_attachment=True, **kwargs):
response = HttpResponse(content_type='application/pdf')
response['Content-Disposition'] = '%s; filename="%s.pd... | import re
from django.http import HttpResponse
from pdfdocument.document import PDFDocument
FILENAME_RE = re.compile(r'[^A-Za-z0-9\-\.]+')
def pdf_response(filename, as_attachment=True, pdfdocument=PDFDocument,
**kwargs):
response = HttpResponse(content_type='application/pdf')
response['Content-Di... | <commit_before>import re
from django.http import HttpResponse
from pdfdocument.document import PDFDocument
FILENAME_RE = re.compile(r'[^A-Za-z0-9\-\.]+')
def pdf_response(filename, as_attachment=True, **kwargs):
response = HttpResponse(content_type='application/pdf')
response['Content-Disposition'] = '%s; ... | import re
from django.http import HttpResponse
from pdfdocument.document import PDFDocument
FILENAME_RE = re.compile(r'[^A-Za-z0-9\-\.]+')
def pdf_response(filename, as_attachment=True, pdfdocument=PDFDocument,
**kwargs):
response = HttpResponse(content_type='application/pdf')
response['Content-Di... | import re
from django.http import HttpResponse
from pdfdocument.document import PDFDocument
FILENAME_RE = re.compile(r'[^A-Za-z0-9\-\.]+')
def pdf_response(filename, as_attachment=True, **kwargs):
response = HttpResponse(content_type='application/pdf')
response['Content-Disposition'] = '%s; filename="%s.pd... | <commit_before>import re
from django.http import HttpResponse
from pdfdocument.document import PDFDocument
FILENAME_RE = re.compile(r'[^A-Za-z0-9\-\.]+')
def pdf_response(filename, as_attachment=True, **kwargs):
response = HttpResponse(content_type='application/pdf')
response['Content-Disposition'] = '%s; ... |
130009c1d995cc11454f37fbfe18d2c5e7e36fde | stock_request_ux/models/stock_move.py | stock_request_ux/models/stock_move.py | ##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import models, fields
class StockMove(models.Model):
_in... | ##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import models, fields
class StockMove(models.Model):
_in... | Fix a problem with the allocations | [FIX] stock_request_ux: Fix a problem with the allocations
For this change https://github.com/OCA/stock-logistics-warehouse/commit/4464be475999c8ada492c56a1c30ca2b0eaa264e
If you confirm with a rute with 3 steps and create 3 pickings them has related with the request by allocation, and the qty_done, qty_In_progress a... | Python | agpl-3.0 | ingadhoc/stock | ##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import models, fields
class StockMove(models.Model):
_in... | ##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import models, fields
class StockMove(models.Model):
_in... | <commit_before>##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import models, fields
class StockMove(models.... | ##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import models, fields
class StockMove(models.Model):
_in... | ##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import models, fields
class StockMove(models.Model):
_in... | <commit_before>##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import models, fields
class StockMove(models.... |
d4e8839ac02935b86c1634848476a9a8512c376d | delivery_transsmart/models/res_partner.py | delivery_transsmart/models/res_partner.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Delivery Transsmart Ingegration
# © 2016 - 1200 Web Development <http://1200wd.com/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Gene... | # -*- coding: utf-8 -*-
##############################################################################
#
# Delivery Transsmart Ingegration
# © 2016 - 1200 Web Development <http://1200wd.com/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Gene... | Remove double product field definitions | [DEL] Remove double product field definitions
| Python | agpl-3.0 | 1200wd/1200wd_addons,1200wd/1200wd_addons | # -*- coding: utf-8 -*-
##############################################################################
#
# Delivery Transsmart Ingegration
# © 2016 - 1200 Web Development <http://1200wd.com/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Gene... | # -*- coding: utf-8 -*-
##############################################################################
#
# Delivery Transsmart Ingegration
# © 2016 - 1200 Web Development <http://1200wd.com/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Gene... | <commit_before># -*- coding: utf-8 -*-
##############################################################################
#
# Delivery Transsmart Ingegration
# © 2016 - 1200 Web Development <http://1200wd.com/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | # -*- coding: utf-8 -*-
##############################################################################
#
# Delivery Transsmart Ingegration
# © 2016 - 1200 Web Development <http://1200wd.com/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Gene... | # -*- coding: utf-8 -*-
##############################################################################
#
# Delivery Transsmart Ingegration
# © 2016 - 1200 Web Development <http://1200wd.com/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Gene... | <commit_before># -*- coding: utf-8 -*-
##############################################################################
#
# Delivery Transsmart Ingegration
# © 2016 - 1200 Web Development <http://1200wd.com/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... |
b8d73fb12fa91a6f0aa33ed985dd5521843e05b8 | src/zeit/content/dynamicfolder/browser/tests/test_folder.py | src/zeit/content/dynamicfolder/browser/tests/test_folder.py | import zeit.cms.interfaces
import zeit.cms.testing
import zeit.content.dynamicfolder.testing
class EditDynamicFolder(zeit.cms.testing.BrowserTestCase):
layer = zeit.content.dynamicfolder.testing.DYNAMIC_LAYER
def test_check_out_and_edit_folder(self):
b = self.browser
b.open('http://localhost... | import zeit.cms.interfaces
import zeit.cms.testing
import zeit.content.dynamicfolder.testing
class EditDynamicFolder(zeit.cms.testing.BrowserTestCase):
layer = zeit.content.dynamicfolder.testing.DYNAMIC_LAYER
def test_check_out_and_edit_folder(self):
b = self.browser
b.open('http://localhost... | Remove superfluous test setup after zeit.cms got smarter | MAINT: Remove superfluous test setup after zeit.cms got smarter
| Python | bsd-3-clause | ZeitOnline/zeit.content.dynamicfolder | import zeit.cms.interfaces
import zeit.cms.testing
import zeit.content.dynamicfolder.testing
class EditDynamicFolder(zeit.cms.testing.BrowserTestCase):
layer = zeit.content.dynamicfolder.testing.DYNAMIC_LAYER
def test_check_out_and_edit_folder(self):
b = self.browser
b.open('http://localhost... | import zeit.cms.interfaces
import zeit.cms.testing
import zeit.content.dynamicfolder.testing
class EditDynamicFolder(zeit.cms.testing.BrowserTestCase):
layer = zeit.content.dynamicfolder.testing.DYNAMIC_LAYER
def test_check_out_and_edit_folder(self):
b = self.browser
b.open('http://localhost... | <commit_before>import zeit.cms.interfaces
import zeit.cms.testing
import zeit.content.dynamicfolder.testing
class EditDynamicFolder(zeit.cms.testing.BrowserTestCase):
layer = zeit.content.dynamicfolder.testing.DYNAMIC_LAYER
def test_check_out_and_edit_folder(self):
b = self.browser
b.open('h... | import zeit.cms.interfaces
import zeit.cms.testing
import zeit.content.dynamicfolder.testing
class EditDynamicFolder(zeit.cms.testing.BrowserTestCase):
layer = zeit.content.dynamicfolder.testing.DYNAMIC_LAYER
def test_check_out_and_edit_folder(self):
b = self.browser
b.open('http://localhost... | import zeit.cms.interfaces
import zeit.cms.testing
import zeit.content.dynamicfolder.testing
class EditDynamicFolder(zeit.cms.testing.BrowserTestCase):
layer = zeit.content.dynamicfolder.testing.DYNAMIC_LAYER
def test_check_out_and_edit_folder(self):
b = self.browser
b.open('http://localhost... | <commit_before>import zeit.cms.interfaces
import zeit.cms.testing
import zeit.content.dynamicfolder.testing
class EditDynamicFolder(zeit.cms.testing.BrowserTestCase):
layer = zeit.content.dynamicfolder.testing.DYNAMIC_LAYER
def test_check_out_and_edit_folder(self):
b = self.browser
b.open('h... |
865ed33da572f2f364dcd89774eac60738bb446c | UI/engine.py | UI/engine.py | # -*- coding: utf-8 -*-
import logging
import storj
from .utilities.account_manager import AccountManager
class StorjEngine:
__logger = logging.getLogger('%s.StorjEngine' % __name__)
def __init__(self):
self.account_manager = AccountManager()
self.password = None
if self.account_ma... | # -*- coding: utf-8 -*-
import logging
import storj
from .utilities.account_manager import AccountManager
class StorjEngine:
__logger = logging.getLogger('%s.StorjEngine' % __name__)
def __init__(self):
self.account_manager = AccountManager()
self.password = None
if self.account_ma... | Add hardcoded timeout 15 seconds | Add hardcoded timeout 15 seconds | Python | mit | lakewik/storj-gui-client | # -*- coding: utf-8 -*-
import logging
import storj
from .utilities.account_manager import AccountManager
class StorjEngine:
__logger = logging.getLogger('%s.StorjEngine' % __name__)
def __init__(self):
self.account_manager = AccountManager()
self.password = None
if self.account_ma... | # -*- coding: utf-8 -*-
import logging
import storj
from .utilities.account_manager import AccountManager
class StorjEngine:
__logger = logging.getLogger('%s.StorjEngine' % __name__)
def __init__(self):
self.account_manager = AccountManager()
self.password = None
if self.account_ma... | <commit_before># -*- coding: utf-8 -*-
import logging
import storj
from .utilities.account_manager import AccountManager
class StorjEngine:
__logger = logging.getLogger('%s.StorjEngine' % __name__)
def __init__(self):
self.account_manager = AccountManager()
self.password = None
if ... | # -*- coding: utf-8 -*-
import logging
import storj
from .utilities.account_manager import AccountManager
class StorjEngine:
__logger = logging.getLogger('%s.StorjEngine' % __name__)
def __init__(self):
self.account_manager = AccountManager()
self.password = None
if self.account_ma... | # -*- coding: utf-8 -*-
import logging
import storj
from .utilities.account_manager import AccountManager
class StorjEngine:
__logger = logging.getLogger('%s.StorjEngine' % __name__)
def __init__(self):
self.account_manager = AccountManager()
self.password = None
if self.account_ma... | <commit_before># -*- coding: utf-8 -*-
import logging
import storj
from .utilities.account_manager import AccountManager
class StorjEngine:
__logger = logging.getLogger('%s.StorjEngine' % __name__)
def __init__(self):
self.account_manager = AccountManager()
self.password = None
if ... |
1a1a45fe5175d002c239610be487607dbb7cdde1 | thinc/neural/_classes/feed_forward.py | thinc/neural/_classes/feed_forward.py | from .model import Model
from ... import describe
def _run_child_hooks(model, X, y):
for layer in model._layers:
for hook in layer.on_data_hooks:
hook(layer, X, y)
X = layer(X[:1000])
@describe.on_data(_run_child_hooks)
class FeedForward(Model):
'''A feed-forward network, that ch... | from .model import Model
from ... import describe
def _run_child_hooks(model, X, y):
for layer in model._layers:
for hook in layer.on_data_hooks:
hook(layer, X, y)
X = layer(X)
if hasattr(X, 'shape'):
X = model.ops.xp.ascontiguousarray(X)
@describe.on_data(_run_ch... | Make copy of X in feed-forward | Make copy of X in feed-forward
| Python | mit | spacy-io/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc | from .model import Model
from ... import describe
def _run_child_hooks(model, X, y):
for layer in model._layers:
for hook in layer.on_data_hooks:
hook(layer, X, y)
X = layer(X[:1000])
@describe.on_data(_run_child_hooks)
class FeedForward(Model):
'''A feed-forward network, that ch... | from .model import Model
from ... import describe
def _run_child_hooks(model, X, y):
for layer in model._layers:
for hook in layer.on_data_hooks:
hook(layer, X, y)
X = layer(X)
if hasattr(X, 'shape'):
X = model.ops.xp.ascontiguousarray(X)
@describe.on_data(_run_ch... | <commit_before>from .model import Model
from ... import describe
def _run_child_hooks(model, X, y):
for layer in model._layers:
for hook in layer.on_data_hooks:
hook(layer, X, y)
X = layer(X[:1000])
@describe.on_data(_run_child_hooks)
class FeedForward(Model):
'''A feed-forward n... | from .model import Model
from ... import describe
def _run_child_hooks(model, X, y):
for layer in model._layers:
for hook in layer.on_data_hooks:
hook(layer, X, y)
X = layer(X)
if hasattr(X, 'shape'):
X = model.ops.xp.ascontiguousarray(X)
@describe.on_data(_run_ch... | from .model import Model
from ... import describe
def _run_child_hooks(model, X, y):
for layer in model._layers:
for hook in layer.on_data_hooks:
hook(layer, X, y)
X = layer(X[:1000])
@describe.on_data(_run_child_hooks)
class FeedForward(Model):
'''A feed-forward network, that ch... | <commit_before>from .model import Model
from ... import describe
def _run_child_hooks(model, X, y):
for layer in model._layers:
for hook in layer.on_data_hooks:
hook(layer, X, y)
X = layer(X[:1000])
@describe.on_data(_run_child_hooks)
class FeedForward(Model):
'''A feed-forward n... |
c862a4c40f17040017e9bb6f67f5b9fa293c23e5 | mcb_interface/driver.py | mcb_interface/driver.py | #!/usr/bin/env python3
from romi import Romi
romi = Romi()
from time import sleep
# from math import pi
while True:
battery_millivolts = romi.read_battery_millivolts()
v_x, v_theta, x, y, theta = romi.read_odometry()
romi.velocity_command(0.1, 0)
print "Battery Voltage: ", battery_millivolts[0], " V... | #!/usr/bin/env python3
from romi import Romi
romi = Romi()
from time import sleep
# from math import pi
while True:
battery_millivolts = romi.read_battery_millivolts()
v_x, v_theta, x, y, theta = romi.read_odometry()
romi.velocity_command(1.0, 0)
print "Battery Voltage: ", battery_millivolts[0], " V... | Add more output printing, increase velocity command. | Add more output printing, increase velocity command.
| Python | mit | waddletown/sw | #!/usr/bin/env python3
from romi import Romi
romi = Romi()
from time import sleep
# from math import pi
while True:
battery_millivolts = romi.read_battery_millivolts()
v_x, v_theta, x, y, theta = romi.read_odometry()
romi.velocity_command(0.1, 0)
print "Battery Voltage: ", battery_millivolts[0], " V... | #!/usr/bin/env python3
from romi import Romi
romi = Romi()
from time import sleep
# from math import pi
while True:
battery_millivolts = romi.read_battery_millivolts()
v_x, v_theta, x, y, theta = romi.read_odometry()
romi.velocity_command(1.0, 0)
print "Battery Voltage: ", battery_millivolts[0], " V... | <commit_before>#!/usr/bin/env python3
from romi import Romi
romi = Romi()
from time import sleep
# from math import pi
while True:
battery_millivolts = romi.read_battery_millivolts()
v_x, v_theta, x, y, theta = romi.read_odometry()
romi.velocity_command(0.1, 0)
print "Battery Voltage: ", battery_mil... | #!/usr/bin/env python3
from romi import Romi
romi = Romi()
from time import sleep
# from math import pi
while True:
battery_millivolts = romi.read_battery_millivolts()
v_x, v_theta, x, y, theta = romi.read_odometry()
romi.velocity_command(1.0, 0)
print "Battery Voltage: ", battery_millivolts[0], " V... | #!/usr/bin/env python3
from romi import Romi
romi = Romi()
from time import sleep
# from math import pi
while True:
battery_millivolts = romi.read_battery_millivolts()
v_x, v_theta, x, y, theta = romi.read_odometry()
romi.velocity_command(0.1, 0)
print "Battery Voltage: ", battery_millivolts[0], " V... | <commit_before>#!/usr/bin/env python3
from romi import Romi
romi = Romi()
from time import sleep
# from math import pi
while True:
battery_millivolts = romi.read_battery_millivolts()
v_x, v_theta, x, y, theta = romi.read_odometry()
romi.velocity_command(0.1, 0)
print "Battery Voltage: ", battery_mil... |
5f888f5ee388efa046bc9e0de0622e5c8b66d712 | src/viewsapp/views.py | src/viewsapp/views.py | from django.shortcuts import (
get_object_or_404, render)
from django.views.decorators.http import \
require_http_methods
from .models import ExampleModel
@require_http_methods(['GET', 'HEAD'])
def model_detail(request, *args, **kwargs):
request_slug = kwargs.get('slug')
example_obj = get_object_or_4... | from django.shortcuts import (
get_object_or_404, render)
from django.views.decorators.http import \
require_safe
from .models import ExampleModel
@require_safe
def model_detail(request, *args, **kwargs):
request_slug = kwargs.get('slug')
example_obj = get_object_or_404(
ExampleModel, slug=re... | Switch HTTP restriction decorator to require_safe. | Switch HTTP restriction decorator to require_safe.
| Python | bsd-2-clause | jambonrose/djangocon2015-views,jambonrose/djangocon2015-views | from django.shortcuts import (
get_object_or_404, render)
from django.views.decorators.http import \
require_http_methods
from .models import ExampleModel
@require_http_methods(['GET', 'HEAD'])
def model_detail(request, *args, **kwargs):
request_slug = kwargs.get('slug')
example_obj = get_object_or_4... | from django.shortcuts import (
get_object_or_404, render)
from django.views.decorators.http import \
require_safe
from .models import ExampleModel
@require_safe
def model_detail(request, *args, **kwargs):
request_slug = kwargs.get('slug')
example_obj = get_object_or_404(
ExampleModel, slug=re... | <commit_before>from django.shortcuts import (
get_object_or_404, render)
from django.views.decorators.http import \
require_http_methods
from .models import ExampleModel
@require_http_methods(['GET', 'HEAD'])
def model_detail(request, *args, **kwargs):
request_slug = kwargs.get('slug')
example_obj = ... | from django.shortcuts import (
get_object_or_404, render)
from django.views.decorators.http import \
require_safe
from .models import ExampleModel
@require_safe
def model_detail(request, *args, **kwargs):
request_slug = kwargs.get('slug')
example_obj = get_object_or_404(
ExampleModel, slug=re... | from django.shortcuts import (
get_object_or_404, render)
from django.views.decorators.http import \
require_http_methods
from .models import ExampleModel
@require_http_methods(['GET', 'HEAD'])
def model_detail(request, *args, **kwargs):
request_slug = kwargs.get('slug')
example_obj = get_object_or_4... | <commit_before>from django.shortcuts import (
get_object_or_404, render)
from django.views.decorators.http import \
require_http_methods
from .models import ExampleModel
@require_http_methods(['GET', 'HEAD'])
def model_detail(request, *args, **kwargs):
request_slug = kwargs.get('slug')
example_obj = ... |
b2df5972bcc9f3367c3832719d1590410317bbba | swift/obj/dedupe/fp_index.py | swift/obj/dedupe/fp_index.py | __author__ = 'mjwtom'
import sqlite3
import unittest
class fp_index:
def __init__(self, name):
if name.endswith('.db'):
self.name = name
else:
self.name = name + '.db'
self.conn = sqlite3.connect(name)
self.c = self.conn.cursor()
self.c.execute('''C... | __author__ = 'mjwtom'
import sqlite3
import unittest
class Fp_Index(object):
def __init__(self, name):
if name.endswith('.db'):
self.name = name
else:
self.name = name + '.db'
self.conn = sqlite3.connect(name)
self.c = self.conn.cursor()
self.c.exec... | Use database to detect the duplication. But the md5 value does not match. Need to add some code here | Use database to detect the duplication. But the md5 value does not match. Need to add some code here
| Python | apache-2.0 | mjwtom/swift,mjwtom/swift | __author__ = 'mjwtom'
import sqlite3
import unittest
class fp_index:
def __init__(self, name):
if name.endswith('.db'):
self.name = name
else:
self.name = name + '.db'
self.conn = sqlite3.connect(name)
self.c = self.conn.cursor()
self.c.execute('''C... | __author__ = 'mjwtom'
import sqlite3
import unittest
class Fp_Index(object):
def __init__(self, name):
if name.endswith('.db'):
self.name = name
else:
self.name = name + '.db'
self.conn = sqlite3.connect(name)
self.c = self.conn.cursor()
self.c.exec... | <commit_before>__author__ = 'mjwtom'
import sqlite3
import unittest
class fp_index:
def __init__(self, name):
if name.endswith('.db'):
self.name = name
else:
self.name = name + '.db'
self.conn = sqlite3.connect(name)
self.c = self.conn.cursor()
self... | __author__ = 'mjwtom'
import sqlite3
import unittest
class Fp_Index(object):
def __init__(self, name):
if name.endswith('.db'):
self.name = name
else:
self.name = name + '.db'
self.conn = sqlite3.connect(name)
self.c = self.conn.cursor()
self.c.exec... | __author__ = 'mjwtom'
import sqlite3
import unittest
class fp_index:
def __init__(self, name):
if name.endswith('.db'):
self.name = name
else:
self.name = name + '.db'
self.conn = sqlite3.connect(name)
self.c = self.conn.cursor()
self.c.execute('''C... | <commit_before>__author__ = 'mjwtom'
import sqlite3
import unittest
class fp_index:
def __init__(self, name):
if name.endswith('.db'):
self.name = name
else:
self.name = name + '.db'
self.conn = sqlite3.connect(name)
self.c = self.conn.cursor()
self... |
bdee8b95429a6ac96cb0577e7eddbd25b764ebfc | mirrit/web/models.py | mirrit/web/models.py | from humbledb import Mongo, Document
class User(Document):
username = ''
password = ''
email = ''
config_database = 'mirrit'
config_collection = 'users'
@property
def id(self):
return unicode(self._id)
@property
def user_id(self):
return unicode(self._id)
@st... | from bson.objectid import ObjectId
from humbledb import Mongo, Document
class ClassProperty (property):
"""Subclass property to make classmethod properties possible"""
def __get__(self, cls, owner):
return self.fget.__get__(None, owner)()
class User(Document):
username = ''
password = ''
... | Fix stupid pseudo-django model crap in signup | Fix stupid pseudo-django model crap in signup
| Python | bsd-3-clause | 1stvamp/mirrit | from humbledb import Mongo, Document
class User(Document):
username = ''
password = ''
email = ''
config_database = 'mirrit'
config_collection = 'users'
@property
def id(self):
return unicode(self._id)
@property
def user_id(self):
return unicode(self._id)
@st... | from bson.objectid import ObjectId
from humbledb import Mongo, Document
class ClassProperty (property):
"""Subclass property to make classmethod properties possible"""
def __get__(self, cls, owner):
return self.fget.__get__(None, owner)()
class User(Document):
username = ''
password = ''
... | <commit_before>from humbledb import Mongo, Document
class User(Document):
username = ''
password = ''
email = ''
config_database = 'mirrit'
config_collection = 'users'
@property
def id(self):
return unicode(self._id)
@property
def user_id(self):
return unicode(sel... | from bson.objectid import ObjectId
from humbledb import Mongo, Document
class ClassProperty (property):
"""Subclass property to make classmethod properties possible"""
def __get__(self, cls, owner):
return self.fget.__get__(None, owner)()
class User(Document):
username = ''
password = ''
... | from humbledb import Mongo, Document
class User(Document):
username = ''
password = ''
email = ''
config_database = 'mirrit'
config_collection = 'users'
@property
def id(self):
return unicode(self._id)
@property
def user_id(self):
return unicode(self._id)
@st... | <commit_before>from humbledb import Mongo, Document
class User(Document):
username = ''
password = ''
email = ''
config_database = 'mirrit'
config_collection = 'users'
@property
def id(self):
return unicode(self._id)
@property
def user_id(self):
return unicode(sel... |
f76bba08c1a8cfd3c821f641adb2b10e3cfa47b9 | tests/test_base_os.py | tests/test_base_os.py | from .fixtures import elasticsearch
def test_base_os(host):
assert host.system_info.distribution == 'centos'
assert host.system_info.release == '7'
def test_java_home_env_var(host):
java_path_cmdline = '$JAVA_HOME/bin/java -version'
assert host.run(java_path_cmdline).exit_status == 0
| from .fixtures import elasticsearch
def test_base_os(host):
assert host.system_info.distribution == 'centos'
assert host.system_info.release == '7'
def test_java_home_env_var(host):
java_path_cmdline = '$JAVA_HOME/bin/java -version'
assert host.run(java_path_cmdline).exit_status == 0
def test_no_... | Add acceptance test to ensure image doesn't contain core files in / | Add acceptance test to ensure image doesn't contain core files in /
In some occasions, depending on the build platform (noticed with aufs with old docker-ce versions) may create a /corefile.<pid>.
Fail a build if the produced image containers any /core* files.
Relates #97 | Python | apache-2.0 | jarpy/elasticsearch-docker,jarpy/elasticsearch-docker | from .fixtures import elasticsearch
def test_base_os(host):
assert host.system_info.distribution == 'centos'
assert host.system_info.release == '7'
def test_java_home_env_var(host):
java_path_cmdline = '$JAVA_HOME/bin/java -version'
assert host.run(java_path_cmdline).exit_status == 0
Add acceptance... | from .fixtures import elasticsearch
def test_base_os(host):
assert host.system_info.distribution == 'centos'
assert host.system_info.release == '7'
def test_java_home_env_var(host):
java_path_cmdline = '$JAVA_HOME/bin/java -version'
assert host.run(java_path_cmdline).exit_status == 0
def test_no_... | <commit_before>from .fixtures import elasticsearch
def test_base_os(host):
assert host.system_info.distribution == 'centos'
assert host.system_info.release == '7'
def test_java_home_env_var(host):
java_path_cmdline = '$JAVA_HOME/bin/java -version'
assert host.run(java_path_cmdline).exit_status == 0... | from .fixtures import elasticsearch
def test_base_os(host):
assert host.system_info.distribution == 'centos'
assert host.system_info.release == '7'
def test_java_home_env_var(host):
java_path_cmdline = '$JAVA_HOME/bin/java -version'
assert host.run(java_path_cmdline).exit_status == 0
def test_no_... | from .fixtures import elasticsearch
def test_base_os(host):
assert host.system_info.distribution == 'centos'
assert host.system_info.release == '7'
def test_java_home_env_var(host):
java_path_cmdline = '$JAVA_HOME/bin/java -version'
assert host.run(java_path_cmdline).exit_status == 0
Add acceptance... | <commit_before>from .fixtures import elasticsearch
def test_base_os(host):
assert host.system_info.distribution == 'centos'
assert host.system_info.release == '7'
def test_java_home_env_var(host):
java_path_cmdline = '$JAVA_HOME/bin/java -version'
assert host.run(java_path_cmdline).exit_status == 0... |
5fc80b347191761d848f6bf736358ec1ec351f33 | fbmsgbot/bot.py | fbmsgbot/bot.py | from http_client import HttpClient
class Bot():
"""
@brief Facebook messenger bot
"""
def __init__(self, token):
self.api_token = token
self.client = HttpClient(token)
def send_message(self, message, completion):
def _completion(response, error):
print error
... | from http_client import HttpClient
class Bot():
"""
@brief Facebook messenger bot
"""
def __init__(self, token):
self.api_token = token
self.client = HttpClient(token)
def send_message(self, message, completion):
def _completion(response, error):
if error is n... | Remove print statments and fix completion logic | Remove print statments and fix completion logic
| Python | mit | ben-cunningham/pybot,ben-cunningham/python-messenger-bot | from http_client import HttpClient
class Bot():
"""
@brief Facebook messenger bot
"""
def __init__(self, token):
self.api_token = token
self.client = HttpClient(token)
def send_message(self, message, completion):
def _completion(response, error):
print error
... | from http_client import HttpClient
class Bot():
"""
@brief Facebook messenger bot
"""
def __init__(self, token):
self.api_token = token
self.client = HttpClient(token)
def send_message(self, message, completion):
def _completion(response, error):
if error is n... | <commit_before>from http_client import HttpClient
class Bot():
"""
@brief Facebook messenger bot
"""
def __init__(self, token):
self.api_token = token
self.client = HttpClient(token)
def send_message(self, message, completion):
def _completion(response, error):
... | from http_client import HttpClient
class Bot():
"""
@brief Facebook messenger bot
"""
def __init__(self, token):
self.api_token = token
self.client = HttpClient(token)
def send_message(self, message, completion):
def _completion(response, error):
if error is n... | from http_client import HttpClient
class Bot():
"""
@brief Facebook messenger bot
"""
def __init__(self, token):
self.api_token = token
self.client = HttpClient(token)
def send_message(self, message, completion):
def _completion(response, error):
print error
... | <commit_before>from http_client import HttpClient
class Bot():
"""
@brief Facebook messenger bot
"""
def __init__(self, token):
self.api_token = token
self.client = HttpClient(token)
def send_message(self, message, completion):
def _completion(response, error):
... |
a32831dbf6b46b33691a76e43012e9fbbbc80e17 | superlists/lists/tests.py | superlists/lists/tests.py | from django.test import TestCase
# Create your tests here.
| from django.test import TestCase
class SmokeTest(TestCase):
def test_bad_maths(self):
self.assertEqual(1 + 1, 3)
| Add app for lists, with deliberately failing unit test | Add app for lists, with deliberately failing unit test
| Python | mit | jrwiegand/tdd-project,jrwiegand/tdd-project,jrwiegand/tdd-project | from django.test import TestCase
# Create your tests here.
Add app for lists, with deliberately failing unit test | from django.test import TestCase
class SmokeTest(TestCase):
def test_bad_maths(self):
self.assertEqual(1 + 1, 3)
| <commit_before>from django.test import TestCase
# Create your tests here.
<commit_msg>Add app for lists, with deliberately failing unit test<commit_after> | from django.test import TestCase
class SmokeTest(TestCase):
def test_bad_maths(self):
self.assertEqual(1 + 1, 3)
| from django.test import TestCase
# Create your tests here.
Add app for lists, with deliberately failing unit testfrom django.test import TestCase
class SmokeTest(TestCase):
def test_bad_maths(self):
self.assertEqual(1 + 1, 3)
| <commit_before>from django.test import TestCase
# Create your tests here.
<commit_msg>Add app for lists, with deliberately failing unit test<commit_after>from django.test import TestCase
class SmokeTest(TestCase):
def test_bad_maths(self):
self.assertEqual(1 + 1, 3)
|
41cf41f501b715902cf180b5a2f62ce16a816f30 | oscar/core/prices.py | oscar/core/prices.py | class TaxNotKnown(Exception):
"""
Exception for when a tax-inclusive price is requested but we don't know
what the tax applicable is (yet).
"""
class Price(object):
"""
Simple price class that encapsulates a price and its tax information
Attributes:
incl_tax (Decimal): Price inclu... | class TaxNotKnown(Exception):
"""
Exception for when a tax-inclusive price is requested but we don't know
what the tax applicable is (yet).
"""
class Price(object):
"""
Simple price class that encapsulates a price and its tax information
Attributes:
incl_tax (Decimal): Price inclu... | Define __repr__ for the core Price class | Define __repr__ for the core Price class
| Python | bsd-3-clause | saadatqadri/django-oscar,WillisXChen/django-oscar,adamend/django-oscar,sasha0/django-oscar,faratro/django-oscar,bnprk/django-oscar,jinnykoo/christmas,jinnykoo/wuyisj.com,WillisXChen/django-oscar,WadeYuChen/django-oscar,taedori81/django-oscar,taedori81/django-oscar,bschuon/django-oscar,WadeYuChen/django-oscar,WillisXChe... | class TaxNotKnown(Exception):
"""
Exception for when a tax-inclusive price is requested but we don't know
what the tax applicable is (yet).
"""
class Price(object):
"""
Simple price class that encapsulates a price and its tax information
Attributes:
incl_tax (Decimal): Price inclu... | class TaxNotKnown(Exception):
"""
Exception for when a tax-inclusive price is requested but we don't know
what the tax applicable is (yet).
"""
class Price(object):
"""
Simple price class that encapsulates a price and its tax information
Attributes:
incl_tax (Decimal): Price inclu... | <commit_before>class TaxNotKnown(Exception):
"""
Exception for when a tax-inclusive price is requested but we don't know
what the tax applicable is (yet).
"""
class Price(object):
"""
Simple price class that encapsulates a price and its tax information
Attributes:
incl_tax (Decima... | class TaxNotKnown(Exception):
"""
Exception for when a tax-inclusive price is requested but we don't know
what the tax applicable is (yet).
"""
class Price(object):
"""
Simple price class that encapsulates a price and its tax information
Attributes:
incl_tax (Decimal): Price inclu... | class TaxNotKnown(Exception):
"""
Exception for when a tax-inclusive price is requested but we don't know
what the tax applicable is (yet).
"""
class Price(object):
"""
Simple price class that encapsulates a price and its tax information
Attributes:
incl_tax (Decimal): Price inclu... | <commit_before>class TaxNotKnown(Exception):
"""
Exception for when a tax-inclusive price is requested but we don't know
what the tax applicable is (yet).
"""
class Price(object):
"""
Simple price class that encapsulates a price and its tax information
Attributes:
incl_tax (Decima... |
a08dea560931c42d04c8bee8c56c1cb548730f21 | synesthesia/preprocess.py | synesthesia/preprocess.py | """ Contains functions for preprocessing audio signals. """
import numpy as np
import pandas as pd
def down_mix(x):
""" Performs down mixing on the audio signal. Reduces
multi-channel audio signals into one channel. It
reduces this by taking the mean across all channels
into one.
... | Add some functions for down sampling and normalization | Add some functions for down sampling and normalization
| Python | mit | mcraig2/synesthesia | Add some functions for down sampling and normalization | """ Contains functions for preprocessing audio signals. """
import numpy as np
import pandas as pd
def down_mix(x):
""" Performs down mixing on the audio signal. Reduces
multi-channel audio signals into one channel. It
reduces this by taking the mean across all channels
into one.
... | <commit_before><commit_msg>Add some functions for down sampling and normalization<commit_after> | """ Contains functions for preprocessing audio signals. """
import numpy as np
import pandas as pd
def down_mix(x):
""" Performs down mixing on the audio signal. Reduces
multi-channel audio signals into one channel. It
reduces this by taking the mean across all channels
into one.
... | Add some functions for down sampling and normalization""" Contains functions for preprocessing audio signals. """
import numpy as np
import pandas as pd
def down_mix(x):
""" Performs down mixing on the audio signal. Reduces
multi-channel audio signals into one channel. It
reduces this by taking t... | <commit_before><commit_msg>Add some functions for down sampling and normalization<commit_after>""" Contains functions for preprocessing audio signals. """
import numpy as np
import pandas as pd
def down_mix(x):
""" Performs down mixing on the audio signal. Reduces
multi-channel audio signals into one cha... | |
836e946e5c6bfb6b097622193a4239c7eba1ca9a | thinglang/parser/blocks/handle_block.py | thinglang/parser/blocks/handle_block.py | from thinglang.compiler.buffer import CompilationBuffer
from thinglang.compiler.opcodes import OpcodeJump, OpcodePopLocal
from thinglang.lexer.blocks.exceptions import LexicalHandle
from thinglang.lexer.values.identifier import Identifier
from thinglang.parser.nodes import BaseNode
from thinglang.parser.rule import Par... | from thinglang.compiler.buffer import CompilationBuffer
from thinglang.compiler.opcodes import OpcodeJump, OpcodePopLocal, OpcodePop
from thinglang.lexer.blocks.exceptions import LexicalHandle
from thinglang.lexer.values.identifier import Identifier
from thinglang.parser.nodes import BaseNode
from thinglang.parser.rule... | Add missing void pop in uncaptured exception blocks | Add missing void pop in uncaptured exception blocks
| Python | mit | ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang | from thinglang.compiler.buffer import CompilationBuffer
from thinglang.compiler.opcodes import OpcodeJump, OpcodePopLocal
from thinglang.lexer.blocks.exceptions import LexicalHandle
from thinglang.lexer.values.identifier import Identifier
from thinglang.parser.nodes import BaseNode
from thinglang.parser.rule import Par... | from thinglang.compiler.buffer import CompilationBuffer
from thinglang.compiler.opcodes import OpcodeJump, OpcodePopLocal, OpcodePop
from thinglang.lexer.blocks.exceptions import LexicalHandle
from thinglang.lexer.values.identifier import Identifier
from thinglang.parser.nodes import BaseNode
from thinglang.parser.rule... | <commit_before>from thinglang.compiler.buffer import CompilationBuffer
from thinglang.compiler.opcodes import OpcodeJump, OpcodePopLocal
from thinglang.lexer.blocks.exceptions import LexicalHandle
from thinglang.lexer.values.identifier import Identifier
from thinglang.parser.nodes import BaseNode
from thinglang.parser.... | from thinglang.compiler.buffer import CompilationBuffer
from thinglang.compiler.opcodes import OpcodeJump, OpcodePopLocal, OpcodePop
from thinglang.lexer.blocks.exceptions import LexicalHandle
from thinglang.lexer.values.identifier import Identifier
from thinglang.parser.nodes import BaseNode
from thinglang.parser.rule... | from thinglang.compiler.buffer import CompilationBuffer
from thinglang.compiler.opcodes import OpcodeJump, OpcodePopLocal
from thinglang.lexer.blocks.exceptions import LexicalHandle
from thinglang.lexer.values.identifier import Identifier
from thinglang.parser.nodes import BaseNode
from thinglang.parser.rule import Par... | <commit_before>from thinglang.compiler.buffer import CompilationBuffer
from thinglang.compiler.opcodes import OpcodeJump, OpcodePopLocal
from thinglang.lexer.blocks.exceptions import LexicalHandle
from thinglang.lexer.values.identifier import Identifier
from thinglang.parser.nodes import BaseNode
from thinglang.parser.... |
44110a305b5a23609c5f6366da9d746244807dbb | power/__init__.py | power/__init__.py | # coding=utf-8
"""
Provides crossplatform checking of current power source, battery warning level and battery time remaining estimate.
Allows you to add observer for power notifications if platform supports it.
Usage:
from power import PowerManagement, PowerManagementObserver # Automatically imports platform-speci... | # coding=utf-8
"""
Provides crossplatform checking of current power source, battery warning level and battery time remaining estimate.
Allows you to add observer for power notifications if platform supports it.
Usage:
from power import PowerManagement, PowerManagementObserver # Automatically imports platform-speci... | Use PowerManagementNoop on import errors | Use PowerManagementNoop on import errors
Platform implementation can fail to import its dependencies.
| Python | mit | Kentzo/Power | # coding=utf-8
"""
Provides crossplatform checking of current power source, battery warning level and battery time remaining estimate.
Allows you to add observer for power notifications if platform supports it.
Usage:
from power import PowerManagement, PowerManagementObserver # Automatically imports platform-speci... | # coding=utf-8
"""
Provides crossplatform checking of current power source, battery warning level and battery time remaining estimate.
Allows you to add observer for power notifications if platform supports it.
Usage:
from power import PowerManagement, PowerManagementObserver # Automatically imports platform-speci... | <commit_before># coding=utf-8
"""
Provides crossplatform checking of current power source, battery warning level and battery time remaining estimate.
Allows you to add observer for power notifications if platform supports it.
Usage:
from power import PowerManagement, PowerManagementObserver # Automatically imports... | # coding=utf-8
"""
Provides crossplatform checking of current power source, battery warning level and battery time remaining estimate.
Allows you to add observer for power notifications if platform supports it.
Usage:
from power import PowerManagement, PowerManagementObserver # Automatically imports platform-speci... | # coding=utf-8
"""
Provides crossplatform checking of current power source, battery warning level and battery time remaining estimate.
Allows you to add observer for power notifications if platform supports it.
Usage:
from power import PowerManagement, PowerManagementObserver # Automatically imports platform-speci... | <commit_before># coding=utf-8
"""
Provides crossplatform checking of current power source, battery warning level and battery time remaining estimate.
Allows you to add observer for power notifications if platform supports it.
Usage:
from power import PowerManagement, PowerManagementObserver # Automatically imports... |
0f7ba6290696e1ce75e42327fdfc4f9eae8614c3 | pdfdocument/utils.py | pdfdocument/utils.py | from datetime import date
import re
from django.db.models import Max, Min
from django.http import HttpResponse
from pdfdocument.document import PDFDocument
def worklog_period(obj):
activity_period = obj.worklogentries.aggregate(Max('date'), Min('date'))
article_period = obj.articleentries.aggregate(Max('dat... | from datetime import date
import re
from django.db.models import Max, Min
from django.http import HttpResponse
from pdfdocument.document import PDFDocument
def worklog_period(obj):
activity_period = obj.worklogentries.aggregate(Max('date'), Min('date'))
article_period = obj.articleentries.aggregate(Max('dat... | Allow passing initialization kwargs to PDFDocument through pdf_response | Allow passing initialization kwargs to PDFDocument through pdf_response
| Python | bsd-3-clause | matthiask/pdfdocument,dongguangming/pdfdocument | from datetime import date
import re
from django.db.models import Max, Min
from django.http import HttpResponse
from pdfdocument.document import PDFDocument
def worklog_period(obj):
activity_period = obj.worklogentries.aggregate(Max('date'), Min('date'))
article_period = obj.articleentries.aggregate(Max('dat... | from datetime import date
import re
from django.db.models import Max, Min
from django.http import HttpResponse
from pdfdocument.document import PDFDocument
def worklog_period(obj):
activity_period = obj.worklogentries.aggregate(Max('date'), Min('date'))
article_period = obj.articleentries.aggregate(Max('dat... | <commit_before>from datetime import date
import re
from django.db.models import Max, Min
from django.http import HttpResponse
from pdfdocument.document import PDFDocument
def worklog_period(obj):
activity_period = obj.worklogentries.aggregate(Max('date'), Min('date'))
article_period = obj.articleentries.agg... | from datetime import date
import re
from django.db.models import Max, Min
from django.http import HttpResponse
from pdfdocument.document import PDFDocument
def worklog_period(obj):
activity_period = obj.worklogentries.aggregate(Max('date'), Min('date'))
article_period = obj.articleentries.aggregate(Max('dat... | from datetime import date
import re
from django.db.models import Max, Min
from django.http import HttpResponse
from pdfdocument.document import PDFDocument
def worklog_period(obj):
activity_period = obj.worklogentries.aggregate(Max('date'), Min('date'))
article_period = obj.articleentries.aggregate(Max('dat... | <commit_before>from datetime import date
import re
from django.db.models import Max, Min
from django.http import HttpResponse
from pdfdocument.document import PDFDocument
def worklog_period(obj):
activity_period = obj.worklogentries.aggregate(Max('date'), Min('date'))
article_period = obj.articleentries.agg... |
edfd2edc5496cb412477b7409f43aa53acf7dea9 | tests/test_loadproblem.py | tests/test_loadproblem.py | # -*- coding: utf-8 -*-
import unittest
import os
from mathdeck import loadproblem
class TestMathdeckLoadProblem(unittest.TestCase):
def test_loadproblem_has_answers_attribute(self):
file_name = 'has_answers_attribute.py'
problem_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)),
... | # -*- coding: utf-8 -*-
import unittest
import os
from mathdeck import loadproblem
class TestMathdeckLoadProblem(unittest.TestCase):
def test_loadproblem_has_answers_attribute(self):
file_name = 'has_answers_attribute.py'
file = os.path.join(os.path.dirname(os.path.realpath(__file__)),
... | Fix parameter values for load function | Fix parameter values for load function
| Python | apache-2.0 | patrickspencer/mathdeck,patrickspencer/mathdeck | # -*- coding: utf-8 -*-
import unittest
import os
from mathdeck import loadproblem
class TestMathdeckLoadProblem(unittest.TestCase):
def test_loadproblem_has_answers_attribute(self):
file_name = 'has_answers_attribute.py'
problem_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)),
... | # -*- coding: utf-8 -*-
import unittest
import os
from mathdeck import loadproblem
class TestMathdeckLoadProblem(unittest.TestCase):
def test_loadproblem_has_answers_attribute(self):
file_name = 'has_answers_attribute.py'
file = os.path.join(os.path.dirname(os.path.realpath(__file__)),
... | <commit_before># -*- coding: utf-8 -*-
import unittest
import os
from mathdeck import loadproblem
class TestMathdeckLoadProblem(unittest.TestCase):
def test_loadproblem_has_answers_attribute(self):
file_name = 'has_answers_attribute.py'
problem_dir = os.path.join(os.path.dirname(os.path.realpath... | # -*- coding: utf-8 -*-
import unittest
import os
from mathdeck import loadproblem
class TestMathdeckLoadProblem(unittest.TestCase):
def test_loadproblem_has_answers_attribute(self):
file_name = 'has_answers_attribute.py'
file = os.path.join(os.path.dirname(os.path.realpath(__file__)),
... | # -*- coding: utf-8 -*-
import unittest
import os
from mathdeck import loadproblem
class TestMathdeckLoadProblem(unittest.TestCase):
def test_loadproblem_has_answers_attribute(self):
file_name = 'has_answers_attribute.py'
problem_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)),
... | <commit_before># -*- coding: utf-8 -*-
import unittest
import os
from mathdeck import loadproblem
class TestMathdeckLoadProblem(unittest.TestCase):
def test_loadproblem_has_answers_attribute(self):
file_name = 'has_answers_attribute.py'
problem_dir = os.path.join(os.path.dirname(os.path.realpath... |
503f92796b9368a78f39c41fb6bb596f32728b8d | herana/views.py | herana/views.py | import json
from django.shortcuts import render
from django.views.generic import View
from models import Institute, ProjectDetail
from forms import SelectInstituteForm, SelectOrgLevelForm
def home(request):
return render(request, 'index.html')
class ResultsView(View):
template_name = 'results.html'
def... | import json
from django.shortcuts import render
from django.views.generic import View
from models import Institute, ProjectDetail
from forms import SelectInstituteForm, SelectOrgLevelForm
def home(request):
return render(request, 'index.html')
class ResultsView(View):
template_name = 'results.html'
def... | Check if user in logged in | Check if user in logged in
| Python | mit | Code4SA/herana,Code4SA/herana,Code4SA/herana,Code4SA/herana | import json
from django.shortcuts import render
from django.views.generic import View
from models import Institute, ProjectDetail
from forms import SelectInstituteForm, SelectOrgLevelForm
def home(request):
return render(request, 'index.html')
class ResultsView(View):
template_name = 'results.html'
def... | import json
from django.shortcuts import render
from django.views.generic import View
from models import Institute, ProjectDetail
from forms import SelectInstituteForm, SelectOrgLevelForm
def home(request):
return render(request, 'index.html')
class ResultsView(View):
template_name = 'results.html'
def... | <commit_before>import json
from django.shortcuts import render
from django.views.generic import View
from models import Institute, ProjectDetail
from forms import SelectInstituteForm, SelectOrgLevelForm
def home(request):
return render(request, 'index.html')
class ResultsView(View):
template_name = 'results... | import json
from django.shortcuts import render
from django.views.generic import View
from models import Institute, ProjectDetail
from forms import SelectInstituteForm, SelectOrgLevelForm
def home(request):
return render(request, 'index.html')
class ResultsView(View):
template_name = 'results.html'
def... | import json
from django.shortcuts import render
from django.views.generic import View
from models import Institute, ProjectDetail
from forms import SelectInstituteForm, SelectOrgLevelForm
def home(request):
return render(request, 'index.html')
class ResultsView(View):
template_name = 'results.html'
def... | <commit_before>import json
from django.shortcuts import render
from django.views.generic import View
from models import Institute, ProjectDetail
from forms import SelectInstituteForm, SelectOrgLevelForm
def home(request):
return render(request, 'index.html')
class ResultsView(View):
template_name = 'results... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.