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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6559de6724c5e53bed3599c6ec21c968e3a71b83 | openspending/tests/controllers/test_rest.py | openspending/tests/controllers/test_rest.py | from openspending.model.dataset import Dataset
from openspending.tests.base import ControllerTestCase
from openspending.tests.helpers import load_fixture
from pylons import url
class TestRestController(ControllerTestCase):
def setup(self):
super(TestRestController, self).setup()
load_fixture('cr... | from openspending.model.dataset import Dataset
from openspending.tests.base import ControllerTestCase
from openspending.tests.helpers import load_fixture
from pylons import url
class TestRestController(ControllerTestCase):
def setup(self):
super(TestRestController, self).setup()
load_fixture('cr... | Remove test for rest controller. | Remove test for rest controller. | Python | agpl-3.0 | nathanhilbert/FPA_Core,pudo/spendb,nathanhilbert/FPA_Core,openspending/spendb,spendb/spendb,openspending/spendb,CivicVision/datahub,openspending/spendb,CivicVision/datahub,nathanhilbert/FPA_Core,johnjohndoe/spendb,spendb/spendb,spendb/spendb,USStateDept/FPA_Core,pudo/spendb,johnjohndoe/spendb,CivicVision/datahub,USStat... | from openspending.model.dataset import Dataset
from openspending.tests.base import ControllerTestCase
from openspending.tests.helpers import load_fixture
from pylons import url
class TestRestController(ControllerTestCase):
def setup(self):
super(TestRestController, self).setup()
load_fixture('cr... | from openspending.model.dataset import Dataset
from openspending.tests.base import ControllerTestCase
from openspending.tests.helpers import load_fixture
from pylons import url
class TestRestController(ControllerTestCase):
def setup(self):
super(TestRestController, self).setup()
load_fixture('cr... | <commit_before>from openspending.model.dataset import Dataset
from openspending.tests.base import ControllerTestCase
from openspending.tests.helpers import load_fixture
from pylons import url
class TestRestController(ControllerTestCase):
def setup(self):
super(TestRestController, self).setup()
l... | from openspending.model.dataset import Dataset
from openspending.tests.base import ControllerTestCase
from openspending.tests.helpers import load_fixture
from pylons import url
class TestRestController(ControllerTestCase):
def setup(self):
super(TestRestController, self).setup()
load_fixture('cr... | from openspending.model.dataset import Dataset
from openspending.tests.base import ControllerTestCase
from openspending.tests.helpers import load_fixture
from pylons import url
class TestRestController(ControllerTestCase):
def setup(self):
super(TestRestController, self).setup()
load_fixture('cr... | <commit_before>from openspending.model.dataset import Dataset
from openspending.tests.base import ControllerTestCase
from openspending.tests.helpers import load_fixture
from pylons import url
class TestRestController(ControllerTestCase):
def setup(self):
super(TestRestController, self).setup()
l... |
42584d8504daab56ced4447ccc08723999c5ca5b | linter.py | linter.py |
#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Ivan Sobolev
# Copyright (c) 2016 Ivan Sobolev
#
# License: MIT
#
"""This module exports the Bemlint plugin class."""
from SublimeLinter.lint import NodeLinter, util
class Bemlint(NodeLinter):
"""Provides an ... |
#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Ivan Sobolev
# Copyright (c) 2016 Ivan Sobolev
#
# License: MIT
#
"""This module exports the Bemlint plugin class."""
from SublimeLinter.lint import NodeLinter, util
class Bemlint(NodeLinter):
"""Provides an ... | Mark usage of temporary files in `cmd` | Mark usage of temporary files in `cmd`
The marker `@` was ambiguous in SublimeLinter. Its usage has been deprecated in favor of explicit markers like `$temp_file`. | Python | mit | DesTincT/SublimeLinter-contrib-bemlint |
#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Ivan Sobolev
# Copyright (c) 2016 Ivan Sobolev
#
# License: MIT
#
"""This module exports the Bemlint plugin class."""
from SublimeLinter.lint import NodeLinter, util
class Bemlint(NodeLinter):
"""Provides an ... |
#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Ivan Sobolev
# Copyright (c) 2016 Ivan Sobolev
#
# License: MIT
#
"""This module exports the Bemlint plugin class."""
from SublimeLinter.lint import NodeLinter, util
class Bemlint(NodeLinter):
"""Provides an ... | <commit_before>
#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Ivan Sobolev
# Copyright (c) 2016 Ivan Sobolev
#
# License: MIT
#
"""This module exports the Bemlint plugin class."""
from SublimeLinter.lint import NodeLinter, util
class Bemlint(NodeLinter):
... |
#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Ivan Sobolev
# Copyright (c) 2016 Ivan Sobolev
#
# License: MIT
#
"""This module exports the Bemlint plugin class."""
from SublimeLinter.lint import NodeLinter, util
class Bemlint(NodeLinter):
"""Provides an ... |
#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Ivan Sobolev
# Copyright (c) 2016 Ivan Sobolev
#
# License: MIT
#
"""This module exports the Bemlint plugin class."""
from SublimeLinter.lint import NodeLinter, util
class Bemlint(NodeLinter):
"""Provides an ... | <commit_before>
#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Ivan Sobolev
# Copyright (c) 2016 Ivan Sobolev
#
# License: MIT
#
"""This module exports the Bemlint plugin class."""
from SublimeLinter.lint import NodeLinter, util
class Bemlint(NodeLinter):
... |
e1fe3acf94e1358155ce67f6b38c02feb75df074 | linter.py | linter.py | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Dmitry Tsoy
# Copyright (c) 2013 Dmitry Tsoy
#
# License: MIT
#
"""This module exports the Phpcs plugin class."""
from SublimeLinter.lint import Linter
class Phpcs(Linter):
"""Provides an interface to phpcs.""... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Dmitry Tsoy
# Copyright (c) 2013 Dmitry Tsoy
#
# License: MIT
#
"""This module exports the Phpcs plugin class."""
from SublimeLinter.lint import Linter
class Phpcs(Linter):
"""Provides an interface to phpcs.""... | Remove the executable property to allow override. | Remove the executable property to allow override.
This problem was discussed here : SublimeLinter/SublimeLinter#455
If the `executable` property is defined, the plugin require the host system to have a global `phpcs` binary. If I haven't that binary installed (eg. I use composer to install inside my project folder)... | Python | mit | SublimeLinter/SublimeLinter-phpcs | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Dmitry Tsoy
# Copyright (c) 2013 Dmitry Tsoy
#
# License: MIT
#
"""This module exports the Phpcs plugin class."""
from SublimeLinter.lint import Linter
class Phpcs(Linter):
"""Provides an interface to phpcs.""... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Dmitry Tsoy
# Copyright (c) 2013 Dmitry Tsoy
#
# License: MIT
#
"""This module exports the Phpcs plugin class."""
from SublimeLinter.lint import Linter
class Phpcs(Linter):
"""Provides an interface to phpcs.""... | <commit_before>#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Dmitry Tsoy
# Copyright (c) 2013 Dmitry Tsoy
#
# License: MIT
#
"""This module exports the Phpcs plugin class."""
from SublimeLinter.lint import Linter
class Phpcs(Linter):
"""Provides an interf... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Dmitry Tsoy
# Copyright (c) 2013 Dmitry Tsoy
#
# License: MIT
#
"""This module exports the Phpcs plugin class."""
from SublimeLinter.lint import Linter
class Phpcs(Linter):
"""Provides an interface to phpcs.""... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Dmitry Tsoy
# Copyright (c) 2013 Dmitry Tsoy
#
# License: MIT
#
"""This module exports the Phpcs plugin class."""
from SublimeLinter.lint import Linter
class Phpcs(Linter):
"""Provides an interface to phpcs.""... | <commit_before>#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Dmitry Tsoy
# Copyright (c) 2013 Dmitry Tsoy
#
# License: MIT
#
"""This module exports the Phpcs plugin class."""
from SublimeLinter.lint import Linter
class Phpcs(Linter):
"""Provides an interf... |
3a4a67a34359c70ac9f3d0f19db3521f6bea7e48 | linter.py | linter.py | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Andrew Grim
# Copyright (c) 2014 Andrew Grim
#
# License: MIT
#
"""This module exports the Puppet plugin class."""
from SublimeLinter.lint import Linter, util
class Puppet(Linter):
"""Provides an interface to... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Andrew Grim
# Copyright (c) 2014 Andrew Grim
#
# License: MIT
#
"""This module exports the Puppet plugin class."""
from SublimeLinter.lint import Linter, util
class Puppet(Linter):
"""Provides an interface to... | Support Additional Error Output Formats | Support Additional Error Output Formats
Make the 'near' match group more flexible to support multiple error
output styles for some syntax errors.
Examples:
Error: Could not parse for environment production: Syntax error at 'class' at line 27
Error: Could not parse for environment production: Syntax error at ... | Python | mit | travisgroth/SublimeLinter-puppet | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Andrew Grim
# Copyright (c) 2014 Andrew Grim
#
# License: MIT
#
"""This module exports the Puppet plugin class."""
from SublimeLinter.lint import Linter, util
class Puppet(Linter):
"""Provides an interface to... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Andrew Grim
# Copyright (c) 2014 Andrew Grim
#
# License: MIT
#
"""This module exports the Puppet plugin class."""
from SublimeLinter.lint import Linter, util
class Puppet(Linter):
"""Provides an interface to... | <commit_before>#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Andrew Grim
# Copyright (c) 2014 Andrew Grim
#
# License: MIT
#
"""This module exports the Puppet plugin class."""
from SublimeLinter.lint import Linter, util
class Puppet(Linter):
"""Provides ... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Andrew Grim
# Copyright (c) 2014 Andrew Grim
#
# License: MIT
#
"""This module exports the Puppet plugin class."""
from SublimeLinter.lint import Linter, util
class Puppet(Linter):
"""Provides an interface to... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Andrew Grim
# Copyright (c) 2014 Andrew Grim
#
# License: MIT
#
"""This module exports the Puppet plugin class."""
from SublimeLinter.lint import Linter, util
class Puppet(Linter):
"""Provides an interface to... | <commit_before>#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Andrew Grim
# Copyright (c) 2014 Andrew Grim
#
# License: MIT
#
"""This module exports the Puppet plugin class."""
from SublimeLinter.lint import Linter, util
class Puppet(Linter):
"""Provides ... |
e73db09c343d7159c09783c514a406fc2fb3f04f | test_py3/pointfree_test_py3.py | test_py3/pointfree_test_py3.py | from unittest import TestCase
from pointfree import *
def kwonly_pure_func(a, b, *, c):
return a + b + c
@partial
def kwonly_func(a, b, *, c):
return a + b + c
class KwOnlyArgsCase(TestCase):
def testNormalApplication(self):
self.assertEqual(kwonly_func(1,2,c=3), 6)
def testPartialApplicatio... | from unittest import TestCase
from pointfree import *
def kwonly_pure_func(a, b, *, c):
return a + b + c
@partial
def kwonly_func(a, b, *, c):
return a + b + c
@partial
def kwonly_defaults_func(a, b, *, c=3):
return a + b + c
@partial
def kwonly_varkw_func(a, b, *, c, **kwargs):
return (a + b + c, k... | Add tests for more keyword-only arguments behavior | Add tests for more keyword-only arguments behavior
Test for handling of default keyword-only argument values and mixing
keyword-only arguments with variable keyword arguments lists.
| Python | apache-2.0 | markshroyer/pointfree,markshroyer/pointfree | from unittest import TestCase
from pointfree import *
def kwonly_pure_func(a, b, *, c):
return a + b + c
@partial
def kwonly_func(a, b, *, c):
return a + b + c
class KwOnlyArgsCase(TestCase):
def testNormalApplication(self):
self.assertEqual(kwonly_func(1,2,c=3), 6)
def testPartialApplicatio... | from unittest import TestCase
from pointfree import *
def kwonly_pure_func(a, b, *, c):
return a + b + c
@partial
def kwonly_func(a, b, *, c):
return a + b + c
@partial
def kwonly_defaults_func(a, b, *, c=3):
return a + b + c
@partial
def kwonly_varkw_func(a, b, *, c, **kwargs):
return (a + b + c, k... | <commit_before>from unittest import TestCase
from pointfree import *
def kwonly_pure_func(a, b, *, c):
return a + b + c
@partial
def kwonly_func(a, b, *, c):
return a + b + c
class KwOnlyArgsCase(TestCase):
def testNormalApplication(self):
self.assertEqual(kwonly_func(1,2,c=3), 6)
def testPa... | from unittest import TestCase
from pointfree import *
def kwonly_pure_func(a, b, *, c):
return a + b + c
@partial
def kwonly_func(a, b, *, c):
return a + b + c
@partial
def kwonly_defaults_func(a, b, *, c=3):
return a + b + c
@partial
def kwonly_varkw_func(a, b, *, c, **kwargs):
return (a + b + c, k... | from unittest import TestCase
from pointfree import *
def kwonly_pure_func(a, b, *, c):
return a + b + c
@partial
def kwonly_func(a, b, *, c):
return a + b + c
class KwOnlyArgsCase(TestCase):
def testNormalApplication(self):
self.assertEqual(kwonly_func(1,2,c=3), 6)
def testPartialApplicatio... | <commit_before>from unittest import TestCase
from pointfree import *
def kwonly_pure_func(a, b, *, c):
return a + b + c
@partial
def kwonly_func(a, b, *, c):
return a + b + c
class KwOnlyArgsCase(TestCase):
def testNormalApplication(self):
self.assertEqual(kwonly_func(1,2,c=3), 6)
def testPa... |
9294e302e4987531ac61db0a952fad22d8785e82 | lowfat/validator.py | lowfat/validator.py | """
Validator functions
"""
from urllib import request
from django.core.exceptions import ValidationError
import PyPDF2
def online_document(url):
"""Check if online document is available."""
online_resource = request.urlopen(url)
# Need to test if website didn't redirect the request to another resource.... | """
Validator functions
"""
from urllib import request
from urllib.error import HTTPError
from django.core.exceptions import ValidationError
import PyPDF2
def online_document(url):
"""Check if online document is available."""
try:
online_resource = request.urlopen(url)
except HTTPError as excepti... | Handle HTTP Error 410 when checking blog post | Handle HTTP Error 410 when checking blog post
| Python | bsd-3-clause | softwaresaved/fat,softwaresaved/fat,softwaresaved/fat,softwaresaved/fat | """
Validator functions
"""
from urllib import request
from django.core.exceptions import ValidationError
import PyPDF2
def online_document(url):
"""Check if online document is available."""
online_resource = request.urlopen(url)
# Need to test if website didn't redirect the request to another resource.... | """
Validator functions
"""
from urllib import request
from urllib.error import HTTPError
from django.core.exceptions import ValidationError
import PyPDF2
def online_document(url):
"""Check if online document is available."""
try:
online_resource = request.urlopen(url)
except HTTPError as excepti... | <commit_before>"""
Validator functions
"""
from urllib import request
from django.core.exceptions import ValidationError
import PyPDF2
def online_document(url):
"""Check if online document is available."""
online_resource = request.urlopen(url)
# Need to test if website didn't redirect the request to an... | """
Validator functions
"""
from urllib import request
from urllib.error import HTTPError
from django.core.exceptions import ValidationError
import PyPDF2
def online_document(url):
"""Check if online document is available."""
try:
online_resource = request.urlopen(url)
except HTTPError as excepti... | """
Validator functions
"""
from urllib import request
from django.core.exceptions import ValidationError
import PyPDF2
def online_document(url):
"""Check if online document is available."""
online_resource = request.urlopen(url)
# Need to test if website didn't redirect the request to another resource.... | <commit_before>"""
Validator functions
"""
from urllib import request
from django.core.exceptions import ValidationError
import PyPDF2
def online_document(url):
"""Check if online document is available."""
online_resource = request.urlopen(url)
# Need to test if website didn't redirect the request to an... |
9ef096bb067d062ece8bf4310c11759c90e60202 | triggers/makewaves.py | triggers/makewaves.py | #!/usr/bin/env python
wavelist = []
for p in range(48):
for s in range(24):
wave = {'method': 'PUT', 'url': 'http://localhost:3520/scenes/_current'}
wave['name'] = 'P{0:02}-S{1:02}'.format(p + 1, s + 1)
wave['data'] = {'id': p * 24 + s}
wavelist.append(wave)
import json
import stru... | #!/usr/bin/env python
import struct
wavelist = []
for s in range(12):
wave = {'method': 'POST'}
wave['url'] = 'http://localhost:3520/scenes/{0}/_load'.format(s + 1)
wave['name'] = 'Scene {0:02}'.format(s + 1)
wave['data'] = ''
wavelist.append(wave)
for wave in wavelist:
reqdata = '\n'.joi... | Update format of wave file generator. | Update format of wave file generator.
| Python | apache-2.0 | lordjabez/light-maestro,lordjabez/light-maestro,lordjabez/light-maestro,lordjabez/light-maestro | #!/usr/bin/env python
wavelist = []
for p in range(48):
for s in range(24):
wave = {'method': 'PUT', 'url': 'http://localhost:3520/scenes/_current'}
wave['name'] = 'P{0:02}-S{1:02}'.format(p + 1, s + 1)
wave['data'] = {'id': p * 24 + s}
wavelist.append(wave)
import json
import stru... | #!/usr/bin/env python
import struct
wavelist = []
for s in range(12):
wave = {'method': 'POST'}
wave['url'] = 'http://localhost:3520/scenes/{0}/_load'.format(s + 1)
wave['name'] = 'Scene {0:02}'.format(s + 1)
wave['data'] = ''
wavelist.append(wave)
for wave in wavelist:
reqdata = '\n'.joi... | <commit_before>#!/usr/bin/env python
wavelist = []
for p in range(48):
for s in range(24):
wave = {'method': 'PUT', 'url': 'http://localhost:3520/scenes/_current'}
wave['name'] = 'P{0:02}-S{1:02}'.format(p + 1, s + 1)
wave['data'] = {'id': p * 24 + s}
wavelist.append(wave)
import j... | #!/usr/bin/env python
import struct
wavelist = []
for s in range(12):
wave = {'method': 'POST'}
wave['url'] = 'http://localhost:3520/scenes/{0}/_load'.format(s + 1)
wave['name'] = 'Scene {0:02}'.format(s + 1)
wave['data'] = ''
wavelist.append(wave)
for wave in wavelist:
reqdata = '\n'.joi... | #!/usr/bin/env python
wavelist = []
for p in range(48):
for s in range(24):
wave = {'method': 'PUT', 'url': 'http://localhost:3520/scenes/_current'}
wave['name'] = 'P{0:02}-S{1:02}'.format(p + 1, s + 1)
wave['data'] = {'id': p * 24 + s}
wavelist.append(wave)
import json
import stru... | <commit_before>#!/usr/bin/env python
wavelist = []
for p in range(48):
for s in range(24):
wave = {'method': 'PUT', 'url': 'http://localhost:3520/scenes/_current'}
wave['name'] = 'P{0:02}-S{1:02}'.format(p + 1, s + 1)
wave['data'] = {'id': p * 24 + s}
wavelist.append(wave)
import j... |
95abf6608d2deb1759f5911bdfd11f6a66fcf4ca | scripts/slave/chromium/test_webkitpy_wrapper.py | scripts/slave/chromium/test_webkitpy_wrapper.py | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A wrapper script that invokes test-webkitpy."""
import optparse
import os
import sys
from common import chromium_utils
from slave ... | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A wrapper script that invokes test-webkitpy."""
import optparse
import os
import sys
from common import chromium_utils
from slave ... | Revert 232670 "Fix script after r232641" | Revert 232670 "Fix script after r232641"
Needs to be out to speculatively revert r232641.
> Fix script after r232641
>
> BUG=314253
> TBR=pfeldman@chromium.org
>
> Review URL: https://codereview.chromium.org/49753004
TBR=thakis@chromium.org
Review URL: https://codereview.chromium.org/57293002
git-svn-id: 239fca9... | Python | bsd-3-clause | eunchong/build,eunchong/build,eunchong/build,eunchong/build | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A wrapper script that invokes test-webkitpy."""
import optparse
import os
import sys
from common import chromium_utils
from slave ... | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A wrapper script that invokes test-webkitpy."""
import optparse
import os
import sys
from common import chromium_utils
from slave ... | <commit_before>#!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A wrapper script that invokes test-webkitpy."""
import optparse
import os
import sys
from common import chromium_ut... | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A wrapper script that invokes test-webkitpy."""
import optparse
import os
import sys
from common import chromium_utils
from slave ... | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A wrapper script that invokes test-webkitpy."""
import optparse
import os
import sys
from common import chromium_utils
from slave ... | <commit_before>#!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A wrapper script that invokes test-webkitpy."""
import optparse
import os
import sys
from common import chromium_ut... |
cbef288c363c70d6085f7f9390aec126919376bc | bin/isy_showevents.py | bin/isy_showevents.py | #!/usr/local/bin/python2.7 -u
__author__ = "Peter Shipley"
import os
import keyring
import ConfigParser
from ISY.IsyEvent import ISYEvent
def main() :
config = ConfigParser.ConfigParser()
config.read('isy.cfg')
server = ISYEvent()
# you can subscribe to multiple devices
# server.subscrib... | #!/usr/local/bin/python2.7 -u
__author__ = "Peter Shipley"
import os
import keyring
import ConfigParser
from ISY.IsyEvent import ISYEvent
def main() :
config = ConfigParser.ConfigParser()
config.read(os.path.expanduser('~/isy.cfg'))
server = ISYEvent()
# you can subscribe to multiple devices... | Move config file to user home directory | Move config file to user home directory
| Python | bsd-2-clause | fxstein/ISYlib-python | #!/usr/local/bin/python2.7 -u
__author__ = "Peter Shipley"
import os
import keyring
import ConfigParser
from ISY.IsyEvent import ISYEvent
def main() :
config = ConfigParser.ConfigParser()
config.read('isy.cfg')
server = ISYEvent()
# you can subscribe to multiple devices
# server.subscrib... | #!/usr/local/bin/python2.7 -u
__author__ = "Peter Shipley"
import os
import keyring
import ConfigParser
from ISY.IsyEvent import ISYEvent
def main() :
config = ConfigParser.ConfigParser()
config.read(os.path.expanduser('~/isy.cfg'))
server = ISYEvent()
# you can subscribe to multiple devices... | <commit_before>#!/usr/local/bin/python2.7 -u
__author__ = "Peter Shipley"
import os
import keyring
import ConfigParser
from ISY.IsyEvent import ISYEvent
def main() :
config = ConfigParser.ConfigParser()
config.read('isy.cfg')
server = ISYEvent()
# you can subscribe to multiple devices
# ... | #!/usr/local/bin/python2.7 -u
__author__ = "Peter Shipley"
import os
import keyring
import ConfigParser
from ISY.IsyEvent import ISYEvent
def main() :
config = ConfigParser.ConfigParser()
config.read(os.path.expanduser('~/isy.cfg'))
server = ISYEvent()
# you can subscribe to multiple devices... | #!/usr/local/bin/python2.7 -u
__author__ = "Peter Shipley"
import os
import keyring
import ConfigParser
from ISY.IsyEvent import ISYEvent
def main() :
config = ConfigParser.ConfigParser()
config.read('isy.cfg')
server = ISYEvent()
# you can subscribe to multiple devices
# server.subscrib... | <commit_before>#!/usr/local/bin/python2.7 -u
__author__ = "Peter Shipley"
import os
import keyring
import ConfigParser
from ISY.IsyEvent import ISYEvent
def main() :
config = ConfigParser.ConfigParser()
config.read('isy.cfg')
server = ISYEvent()
# you can subscribe to multiple devices
# ... |
35555b568d926caef8a7ad3471e3dd5ba8624c0e | norsourceparser/core/constants.py | norsourceparser/core/constants.py | REDUCED_RULE_VALENCY_TOKEN = 0
REDUCED_RULE_POS = 1
REDUCED_RULE_MORPHOLOGICAL_BREAKUP = 2
REDUCED_RULE_GLOSSES = 3
| REDUCED_RULE_POS = 1
REDUCED_RULE_MORPHOLOGICAL_BREAKUP = 2
REDUCED_RULE_GLOSSES = 3
REDUCED_RULE_VALENCY = 4
| Rename VALENCY constant and change index | Rename VALENCY constant and change index
| Python | mit | Typecraft/norsourceparser | REDUCED_RULE_VALENCY_TOKEN = 0
REDUCED_RULE_POS = 1
REDUCED_RULE_MORPHOLOGICAL_BREAKUP = 2
REDUCED_RULE_GLOSSES = 3
Rename VALENCY constant and change index | REDUCED_RULE_POS = 1
REDUCED_RULE_MORPHOLOGICAL_BREAKUP = 2
REDUCED_RULE_GLOSSES = 3
REDUCED_RULE_VALENCY = 4
| <commit_before>REDUCED_RULE_VALENCY_TOKEN = 0
REDUCED_RULE_POS = 1
REDUCED_RULE_MORPHOLOGICAL_BREAKUP = 2
REDUCED_RULE_GLOSSES = 3
<commit_msg>Rename VALENCY constant and change index<commit_after> | REDUCED_RULE_POS = 1
REDUCED_RULE_MORPHOLOGICAL_BREAKUP = 2
REDUCED_RULE_GLOSSES = 3
REDUCED_RULE_VALENCY = 4
| REDUCED_RULE_VALENCY_TOKEN = 0
REDUCED_RULE_POS = 1
REDUCED_RULE_MORPHOLOGICAL_BREAKUP = 2
REDUCED_RULE_GLOSSES = 3
Rename VALENCY constant and change indexREDUCED_RULE_POS = 1
REDUCED_RULE_MORPHOLOGICAL_BREAKUP = 2
REDUCED_RULE_GLOSSES = 3
REDUCED_RULE_VALENCY = 4
| <commit_before>REDUCED_RULE_VALENCY_TOKEN = 0
REDUCED_RULE_POS = 1
REDUCED_RULE_MORPHOLOGICAL_BREAKUP = 2
REDUCED_RULE_GLOSSES = 3
<commit_msg>Rename VALENCY constant and change index<commit_after>REDUCED_RULE_POS = 1
REDUCED_RULE_MORPHOLOGICAL_BREAKUP = 2
REDUCED_RULE_GLOSSES = 3
REDUCED_RULE_VALENCY = 4
|
838063cc08da66a31666f798437b8dcdde0286f0 | mpf/config_players/flasher_player.py | mpf/config_players/flasher_player.py | """Flasher config player."""
from mpf.config_players.device_config_player import DeviceConfigPlayer
from mpf.core.delays import DelayManager
class FlasherPlayer(DeviceConfigPlayer):
"""Triggers flashers based on config."""
config_file_section = 'flasher_player'
show_section = 'flashers'
__slots__ =... | """Flasher config player."""
from mpf.config_players.device_config_player import DeviceConfigPlayer
from mpf.core.delays import DelayManager
from mpf.core.utility_functions import Util
class FlasherPlayer(DeviceConfigPlayer):
"""Triggers flashers based on config."""
config_file_section = 'flasher_player'
... | Allow list of flashers as show token value | Allow list of flashers as show token value
| Python | mit | missionpinball/mpf,missionpinball/mpf | """Flasher config player."""
from mpf.config_players.device_config_player import DeviceConfigPlayer
from mpf.core.delays import DelayManager
class FlasherPlayer(DeviceConfigPlayer):
"""Triggers flashers based on config."""
config_file_section = 'flasher_player'
show_section = 'flashers'
__slots__ =... | """Flasher config player."""
from mpf.config_players.device_config_player import DeviceConfigPlayer
from mpf.core.delays import DelayManager
from mpf.core.utility_functions import Util
class FlasherPlayer(DeviceConfigPlayer):
"""Triggers flashers based on config."""
config_file_section = 'flasher_player'
... | <commit_before>"""Flasher config player."""
from mpf.config_players.device_config_player import DeviceConfigPlayer
from mpf.core.delays import DelayManager
class FlasherPlayer(DeviceConfigPlayer):
"""Triggers flashers based on config."""
config_file_section = 'flasher_player'
show_section = 'flashers'
... | """Flasher config player."""
from mpf.config_players.device_config_player import DeviceConfigPlayer
from mpf.core.delays import DelayManager
from mpf.core.utility_functions import Util
class FlasherPlayer(DeviceConfigPlayer):
"""Triggers flashers based on config."""
config_file_section = 'flasher_player'
... | """Flasher config player."""
from mpf.config_players.device_config_player import DeviceConfigPlayer
from mpf.core.delays import DelayManager
class FlasherPlayer(DeviceConfigPlayer):
"""Triggers flashers based on config."""
config_file_section = 'flasher_player'
show_section = 'flashers'
__slots__ =... | <commit_before>"""Flasher config player."""
from mpf.config_players.device_config_player import DeviceConfigPlayer
from mpf.core.delays import DelayManager
class FlasherPlayer(DeviceConfigPlayer):
"""Triggers flashers based on config."""
config_file_section = 'flasher_player'
show_section = 'flashers'
... |
67b03b45c338143d0e1496dc0c48046ca000b8e8 | tests/integration/aiohttp_utils.py | tests/integration/aiohttp_utils.py | # flake8: noqa
import asyncio
import aiohttp
from aiohttp.test_utils import TestClient
async def aiohttp_request(loop, method, url, output='text', encoding='utf-8', content_type=None, **kwargs):
session = aiohttp.ClientSession(loop=loop)
response_ctx = session.request(method, url, **kwargs)
response = a... | # flake8: noqa
import asyncio
import aiohttp
from aiohttp.test_utils import TestClient
async def aiohttp_request(loop, method, url, output='text', encoding='utf-8', content_type=None, **kwargs):
session = aiohttp.ClientSession(loop=loop)
response_ctx = session.request(method, url, **kwargs)
response = a... | Add output option to use response.content stream | Add output option to use response.content stream
| Python | mit | kevin1024/vcrpy,kevin1024/vcrpy,graingert/vcrpy,graingert/vcrpy | # flake8: noqa
import asyncio
import aiohttp
from aiohttp.test_utils import TestClient
async def aiohttp_request(loop, method, url, output='text', encoding='utf-8', content_type=None, **kwargs):
session = aiohttp.ClientSession(loop=loop)
response_ctx = session.request(method, url, **kwargs)
response = a... | # flake8: noqa
import asyncio
import aiohttp
from aiohttp.test_utils import TestClient
async def aiohttp_request(loop, method, url, output='text', encoding='utf-8', content_type=None, **kwargs):
session = aiohttp.ClientSession(loop=loop)
response_ctx = session.request(method, url, **kwargs)
response = a... | <commit_before># flake8: noqa
import asyncio
import aiohttp
from aiohttp.test_utils import TestClient
async def aiohttp_request(loop, method, url, output='text', encoding='utf-8', content_type=None, **kwargs):
session = aiohttp.ClientSession(loop=loop)
response_ctx = session.request(method, url, **kwargs)
... | # flake8: noqa
import asyncio
import aiohttp
from aiohttp.test_utils import TestClient
async def aiohttp_request(loop, method, url, output='text', encoding='utf-8', content_type=None, **kwargs):
session = aiohttp.ClientSession(loop=loop)
response_ctx = session.request(method, url, **kwargs)
response = a... | # flake8: noqa
import asyncio
import aiohttp
from aiohttp.test_utils import TestClient
async def aiohttp_request(loop, method, url, output='text', encoding='utf-8', content_type=None, **kwargs):
session = aiohttp.ClientSession(loop=loop)
response_ctx = session.request(method, url, **kwargs)
response = a... | <commit_before># flake8: noqa
import asyncio
import aiohttp
from aiohttp.test_utils import TestClient
async def aiohttp_request(loop, method, url, output='text', encoding='utf-8', content_type=None, **kwargs):
session = aiohttp.ClientSession(loop=loop)
response_ctx = session.request(method, url, **kwargs)
... |
208c850982734e109fe408114f595fe9a459cd8e | client/python/rndlib/conf.py | client/python/rndlib/conf.py | import os
NETWORK_DISABLED = True
NETWORK_PORT = 11338
PLOW_HOSTS = ["localhost:11337"]
| import os
NETWORK_DISABLED = False
NETWORK_PORT = 11338
PLOW_HOSTS = ["localhost:11337"]
| Enable the network by default. | Enable the network by default.
| Python | apache-2.0 | chadmv/plow,Br3nda/plow,Br3nda/plow,Br3nda/plow,chadmv/plow,chadmv/plow,Br3nda/plow,Br3nda/plow,chadmv/plow,chadmv/plow,chadmv/plow,chadmv/plow | import os
NETWORK_DISABLED = True
NETWORK_PORT = 11338
PLOW_HOSTS = ["localhost:11337"]
Enable the network by default. | import os
NETWORK_DISABLED = False
NETWORK_PORT = 11338
PLOW_HOSTS = ["localhost:11337"]
| <commit_before>import os
NETWORK_DISABLED = True
NETWORK_PORT = 11338
PLOW_HOSTS = ["localhost:11337"]
<commit_msg>Enable the network by default.<commit_after> | import os
NETWORK_DISABLED = False
NETWORK_PORT = 11338
PLOW_HOSTS = ["localhost:11337"]
| import os
NETWORK_DISABLED = True
NETWORK_PORT = 11338
PLOW_HOSTS = ["localhost:11337"]
Enable the network by default.import os
NETWORK_DISABLED = False
NETWORK_PORT = 11338
PLOW_HOSTS = ["localhost:11337"]
| <commit_before>import os
NETWORK_DISABLED = True
NETWORK_PORT = 11338
PLOW_HOSTS = ["localhost:11337"]
<commit_msg>Enable the network by default.<commit_after>import os
NETWORK_DISABLED = False
NETWORK_PORT = 11338
PLOW_HOSTS = ["localhost:11337"]
|
0983986f6fc75b1acf0e76255844f7c96ba9838f | pip_refresh/__init__.py | pip_refresh/__init__.py | from functools import partial
import subprocess
import requests
def get_pkg_info(pkg_name, session):
r = session.get('http://pypi.python.org/pypi/%s/json' % (pkg_name,))
if r.status_code == requests.codes.ok:
return r.json
else:
raise ValueError('Package %r not found on PyPI.' % (pkg_name,... | from functools import partial
import subprocess
import multiprocessing
import requests
def get_pkg_info(pkg_name, session):
r = session.get('http://pypi.python.org/pypi/%s/json' % (pkg_name,))
if r.status_code == requests.codes.ok:
return r.json
else:
raise ValueError('Package %r not found... | Use multiprocessing to get quicker updates from PyPI. | Use multiprocessing to get quicker updates from PyPI.
| Python | bsd-2-clause | suutari/prequ,suutari/prequ,suutari-ai/prequ | from functools import partial
import subprocess
import requests
def get_pkg_info(pkg_name, session):
r = session.get('http://pypi.python.org/pypi/%s/json' % (pkg_name,))
if r.status_code == requests.codes.ok:
return r.json
else:
raise ValueError('Package %r not found on PyPI.' % (pkg_name,... | from functools import partial
import subprocess
import multiprocessing
import requests
def get_pkg_info(pkg_name, session):
r = session.get('http://pypi.python.org/pypi/%s/json' % (pkg_name,))
if r.status_code == requests.codes.ok:
return r.json
else:
raise ValueError('Package %r not found... | <commit_before>from functools import partial
import subprocess
import requests
def get_pkg_info(pkg_name, session):
r = session.get('http://pypi.python.org/pypi/%s/json' % (pkg_name,))
if r.status_code == requests.codes.ok:
return r.json
else:
raise ValueError('Package %r not found on PyPI... | from functools import partial
import subprocess
import multiprocessing
import requests
def get_pkg_info(pkg_name, session):
r = session.get('http://pypi.python.org/pypi/%s/json' % (pkg_name,))
if r.status_code == requests.codes.ok:
return r.json
else:
raise ValueError('Package %r not found... | from functools import partial
import subprocess
import requests
def get_pkg_info(pkg_name, session):
r = session.get('http://pypi.python.org/pypi/%s/json' % (pkg_name,))
if r.status_code == requests.codes.ok:
return r.json
else:
raise ValueError('Package %r not found on PyPI.' % (pkg_name,... | <commit_before>from functools import partial
import subprocess
import requests
def get_pkg_info(pkg_name, session):
r = session.get('http://pypi.python.org/pypi/%s/json' % (pkg_name,))
if r.status_code == requests.codes.ok:
return r.json
else:
raise ValueError('Package %r not found on PyPI... |
2994466719ce4f096d68a24c2e20fdd9ffc4232d | project/api/backends.py | project/api/backends.py |
# Third-Party
from django_filters.rest_framework.backends import DjangoFilterBackend
from dry_rest_permissions.generics import DRYPermissionFiltersBase
class CoalesceFilterBackend(DjangoFilterBackend):
"""Support Ember Data coalesceFindRequests."""
def filter_queryset(self, request, queryset, view):
... |
# Third-Party
from django_filters.rest_framework.backends import DjangoFilterBackend
class CoalesceFilterBackend(DjangoFilterBackend):
"""Support Ember Data coalesceFindRequests."""
def filter_queryset(self, request, queryset, view):
raw = request.query_params.get('filter[id]')
if raw:
... | Remove unused score filter backend | Remove unused score filter backend
| Python | bsd-2-clause | dbinetti/barberscore-django,dbinetti/barberscore-django,dbinetti/barberscore,barberscore/barberscore-api,barberscore/barberscore-api,barberscore/barberscore-api,dbinetti/barberscore,barberscore/barberscore-api |
# Third-Party
from django_filters.rest_framework.backends import DjangoFilterBackend
from dry_rest_permissions.generics import DRYPermissionFiltersBase
class CoalesceFilterBackend(DjangoFilterBackend):
"""Support Ember Data coalesceFindRequests."""
def filter_queryset(self, request, queryset, view):
... |
# Third-Party
from django_filters.rest_framework.backends import DjangoFilterBackend
class CoalesceFilterBackend(DjangoFilterBackend):
"""Support Ember Data coalesceFindRequests."""
def filter_queryset(self, request, queryset, view):
raw = request.query_params.get('filter[id]')
if raw:
... | <commit_before>
# Third-Party
from django_filters.rest_framework.backends import DjangoFilterBackend
from dry_rest_permissions.generics import DRYPermissionFiltersBase
class CoalesceFilterBackend(DjangoFilterBackend):
"""Support Ember Data coalesceFindRequests."""
def filter_queryset(self, request, queryset,... |
# Third-Party
from django_filters.rest_framework.backends import DjangoFilterBackend
class CoalesceFilterBackend(DjangoFilterBackend):
"""Support Ember Data coalesceFindRequests."""
def filter_queryset(self, request, queryset, view):
raw = request.query_params.get('filter[id]')
if raw:
... |
# Third-Party
from django_filters.rest_framework.backends import DjangoFilterBackend
from dry_rest_permissions.generics import DRYPermissionFiltersBase
class CoalesceFilterBackend(DjangoFilterBackend):
"""Support Ember Data coalesceFindRequests."""
def filter_queryset(self, request, queryset, view):
... | <commit_before>
# Third-Party
from django_filters.rest_framework.backends import DjangoFilterBackend
from dry_rest_permissions.generics import DRYPermissionFiltersBase
class CoalesceFilterBackend(DjangoFilterBackend):
"""Support Ember Data coalesceFindRequests."""
def filter_queryset(self, request, queryset,... |
693ce5f8b1344f072e1f116ebf3ad79ffaad42b6 | fungui.py | fungui.py | #!/usr/bin/env python
"""
fungui is a software to help measuring the shell of a fungi.
"""
# Import modules
from PyQt4 import QtGui, QtCore
| #!/usr/bin/env python
"""
fungui is a software to help measuring the shell of a fungi.
"""
# Import modules
from PyQt4 import QtGui, QtCore
import sys
# Global variables
FRAME_WIDTH = 1020
FRAME_HEIGHT = 480
class MainWindow(QtGui.QMainWindow):
def __init__(self):
QtGui.QMainWindow.__init__(self)
... | Create a frame with a menu bar. | Create a frame with a menu bar.
The software will have several buttons, but the idea of the menu
bar is to have redundancy on the commands and to inform the user
of the shortcuts.
| Python | bsd-3-clause | leouieda/funghi | #!/usr/bin/env python
"""
fungui is a software to help measuring the shell of a fungi.
"""
# Import modules
from PyQt4 import QtGui, QtCore
Create a frame with a menu bar.
The software will have several buttons, but the idea of the menu
bar is to have redundancy on the commands and to inform the user
of the shortcut... | #!/usr/bin/env python
"""
fungui is a software to help measuring the shell of a fungi.
"""
# Import modules
from PyQt4 import QtGui, QtCore
import sys
# Global variables
FRAME_WIDTH = 1020
FRAME_HEIGHT = 480
class MainWindow(QtGui.QMainWindow):
def __init__(self):
QtGui.QMainWindow.__init__(self)
... | <commit_before>#!/usr/bin/env python
"""
fungui is a software to help measuring the shell of a fungi.
"""
# Import modules
from PyQt4 import QtGui, QtCore
<commit_msg>Create a frame with a menu bar.
The software will have several buttons, but the idea of the menu
bar is to have redundancy on the commands and to info... | #!/usr/bin/env python
"""
fungui is a software to help measuring the shell of a fungi.
"""
# Import modules
from PyQt4 import QtGui, QtCore
import sys
# Global variables
FRAME_WIDTH = 1020
FRAME_HEIGHT = 480
class MainWindow(QtGui.QMainWindow):
def __init__(self):
QtGui.QMainWindow.__init__(self)
... | #!/usr/bin/env python
"""
fungui is a software to help measuring the shell of a fungi.
"""
# Import modules
from PyQt4 import QtGui, QtCore
Create a frame with a menu bar.
The software will have several buttons, but the idea of the menu
bar is to have redundancy on the commands and to inform the user
of the shortcut... | <commit_before>#!/usr/bin/env python
"""
fungui is a software to help measuring the shell of a fungi.
"""
# Import modules
from PyQt4 import QtGui, QtCore
<commit_msg>Create a frame with a menu bar.
The software will have several buttons, but the idea of the menu
bar is to have redundancy on the commands and to info... |
38ceb6d04f7b09b3ab29468c2fa9ccc94e1b5dc5 | casepro/pods/views.py | casepro/pods/views.py | from __future__ import unicode_literals
import json
from django.http import JsonResponse
from casepro.pods import registry
def read_pod_data(request, index):
"""Delegates to the `read_data` function of the correct pod."""
if request.method != 'GET':
return JsonResponse({'reason': 'Method not allowed... | from __future__ import unicode_literals
import json
from django.http import JsonResponse
from casepro.cases.models import Case, CaseAction
from casepro.pods import registry
def read_pod_data(request, index):
"""Delegates to the `read_data` function of the correct pod."""
if request.method != 'GET':
... | Change case field to case_id in error message | Change case field to case_id in error message
| Python | bsd-3-clause | xkmato/casepro,praekelt/casepro,rapidpro/casepro,rapidpro/casepro,rapidpro/casepro,praekelt/casepro,xkmato/casepro,praekelt/casepro | from __future__ import unicode_literals
import json
from django.http import JsonResponse
from casepro.pods import registry
def read_pod_data(request, index):
"""Delegates to the `read_data` function of the correct pod."""
if request.method != 'GET':
return JsonResponse({'reason': 'Method not allowed... | from __future__ import unicode_literals
import json
from django.http import JsonResponse
from casepro.cases.models import Case, CaseAction
from casepro.pods import registry
def read_pod_data(request, index):
"""Delegates to the `read_data` function of the correct pod."""
if request.method != 'GET':
... | <commit_before>from __future__ import unicode_literals
import json
from django.http import JsonResponse
from casepro.pods import registry
def read_pod_data(request, index):
"""Delegates to the `read_data` function of the correct pod."""
if request.method != 'GET':
return JsonResponse({'reason': 'Met... | from __future__ import unicode_literals
import json
from django.http import JsonResponse
from casepro.cases.models import Case, CaseAction
from casepro.pods import registry
def read_pod_data(request, index):
"""Delegates to the `read_data` function of the correct pod."""
if request.method != 'GET':
... | from __future__ import unicode_literals
import json
from django.http import JsonResponse
from casepro.pods import registry
def read_pod_data(request, index):
"""Delegates to the `read_data` function of the correct pod."""
if request.method != 'GET':
return JsonResponse({'reason': 'Method not allowed... | <commit_before>from __future__ import unicode_literals
import json
from django.http import JsonResponse
from casepro.pods import registry
def read_pod_data(request, index):
"""Delegates to the `read_data` function of the correct pod."""
if request.method != 'GET':
return JsonResponse({'reason': 'Met... |
d3fc9414effb4c49104cc4a0888872d9eb4c20a9 | py/garage/garage/sql/utils.py | py/garage/garage/sql/utils.py | __all__ = [
'ensure_only_one_row',
'insert_or_ignore',
]
def ensure_only_one_row(rows):
row = rows.fetchone()
if row is None or rows.fetchone() is not None:
raise KeyError
return row
def insert_or_ignore(conn, table, values):
conn.execute(table.insert().prefix_with('OR IGNORE'), valu... | __all__ = [
'add_if_not_exists_clause',
'ensure_only_one_row',
'insert_or_ignore',
]
from garage import asserts
from sqlalchemy.schema import CreateIndex
def add_if_not_exists_clause(index, engine):
# `sqlalchemy.Index.create()` does not take `checkfirst` for reasons
# that I am unaware of, and ... | Add a hack for appending "IF NOT EXISTS" clause to "CREATE INDEX" | Add a hack for appending "IF NOT EXISTS" clause to "CREATE INDEX"
| Python | mit | clchiou/garage,clchiou/garage,clchiou/garage,clchiou/garage | __all__ = [
'ensure_only_one_row',
'insert_or_ignore',
]
def ensure_only_one_row(rows):
row = rows.fetchone()
if row is None or rows.fetchone() is not None:
raise KeyError
return row
def insert_or_ignore(conn, table, values):
conn.execute(table.insert().prefix_with('OR IGNORE'), valu... | __all__ = [
'add_if_not_exists_clause',
'ensure_only_one_row',
'insert_or_ignore',
]
from garage import asserts
from sqlalchemy.schema import CreateIndex
def add_if_not_exists_clause(index, engine):
# `sqlalchemy.Index.create()` does not take `checkfirst` for reasons
# that I am unaware of, and ... | <commit_before>__all__ = [
'ensure_only_one_row',
'insert_or_ignore',
]
def ensure_only_one_row(rows):
row = rows.fetchone()
if row is None or rows.fetchone() is not None:
raise KeyError
return row
def insert_or_ignore(conn, table, values):
conn.execute(table.insert().prefix_with('OR... | __all__ = [
'add_if_not_exists_clause',
'ensure_only_one_row',
'insert_or_ignore',
]
from garage import asserts
from sqlalchemy.schema import CreateIndex
def add_if_not_exists_clause(index, engine):
# `sqlalchemy.Index.create()` does not take `checkfirst` for reasons
# that I am unaware of, and ... | __all__ = [
'ensure_only_one_row',
'insert_or_ignore',
]
def ensure_only_one_row(rows):
row = rows.fetchone()
if row is None or rows.fetchone() is not None:
raise KeyError
return row
def insert_or_ignore(conn, table, values):
conn.execute(table.insert().prefix_with('OR IGNORE'), valu... | <commit_before>__all__ = [
'ensure_only_one_row',
'insert_or_ignore',
]
def ensure_only_one_row(rows):
row = rows.fetchone()
if row is None or rows.fetchone() is not None:
raise KeyError
return row
def insert_or_ignore(conn, table, values):
conn.execute(table.insert().prefix_with('OR... |
04b785a9761e4d49c3f0e3dfc5d3df06cd3209a1 | coffer/utils/ccopy.py | coffer/utils/ccopy.py | import os
import shutil
def copy(orig, dest, useShutil=False):
if os.path.isdir(orig):
if useShutil:
shutil.copytree(orig, dest, symlinks=True)
else:
os.popen("cp -rf {} {}".format(orig, dest))
else:
if useShutil:
shutil.copy(orig, dest)
else:... | import os
import shutil
def copy(orig, dest, useShutil=False):
if os.path.isdir(orig):
if useShutil:
shutil.copytree(orig, dest, symlinks=True)
else:
os.system("cp -rf {} {}".format(orig, dest))
else:
if useShutil:
shutil.copy(orig, dest)
else... | Copy now waits for files to be copies over | Copy now waits for files to be copies over
| Python | mit | Max00355/Coffer | import os
import shutil
def copy(orig, dest, useShutil=False):
if os.path.isdir(orig):
if useShutil:
shutil.copytree(orig, dest, symlinks=True)
else:
os.popen("cp -rf {} {}".format(orig, dest))
else:
if useShutil:
shutil.copy(orig, dest)
else:... | import os
import shutil
def copy(orig, dest, useShutil=False):
if os.path.isdir(orig):
if useShutil:
shutil.copytree(orig, dest, symlinks=True)
else:
os.system("cp -rf {} {}".format(orig, dest))
else:
if useShutil:
shutil.copy(orig, dest)
else... | <commit_before>import os
import shutil
def copy(orig, dest, useShutil=False):
if os.path.isdir(orig):
if useShutil:
shutil.copytree(orig, dest, symlinks=True)
else:
os.popen("cp -rf {} {}".format(orig, dest))
else:
if useShutil:
shutil.copy(orig, dest... | import os
import shutil
def copy(orig, dest, useShutil=False):
if os.path.isdir(orig):
if useShutil:
shutil.copytree(orig, dest, symlinks=True)
else:
os.system("cp -rf {} {}".format(orig, dest))
else:
if useShutil:
shutil.copy(orig, dest)
else... | import os
import shutil
def copy(orig, dest, useShutil=False):
if os.path.isdir(orig):
if useShutil:
shutil.copytree(orig, dest, symlinks=True)
else:
os.popen("cp -rf {} {}".format(orig, dest))
else:
if useShutil:
shutil.copy(orig, dest)
else:... | <commit_before>import os
import shutil
def copy(orig, dest, useShutil=False):
if os.path.isdir(orig):
if useShutil:
shutil.copytree(orig, dest, symlinks=True)
else:
os.popen("cp -rf {} {}".format(orig, dest))
else:
if useShutil:
shutil.copy(orig, dest... |
0434baddfc2eb3691180e6fa461be3323852eea9 | clubadm/middleware.py | clubadm/middleware.py | from django.http import Http404
from django.utils import timezone
from clubadm.models import Member, Season
class SeasonMiddleware(object):
def process_view(self, request, view_func, view_args, view_kwargs):
if "year" in view_kwargs:
year = int(view_kwargs["year"])
try:
... | from django.http import Http404
from django.utils import timezone
from clubadm.models import Member, Season
class SeasonMiddleware(object):
def process_view(self, request, view_func, view_args, view_kwargs):
if "year" in view_kwargs:
year = int(view_kwargs["year"])
try:
... | Handle an authentication edge case | Handle an authentication edge case
| Python | mit | clubadm/clubadm,clubadm/clubadm,clubadm/clubadm | from django.http import Http404
from django.utils import timezone
from clubadm.models import Member, Season
class SeasonMiddleware(object):
def process_view(self, request, view_func, view_args, view_kwargs):
if "year" in view_kwargs:
year = int(view_kwargs["year"])
try:
... | from django.http import Http404
from django.utils import timezone
from clubadm.models import Member, Season
class SeasonMiddleware(object):
def process_view(self, request, view_func, view_args, view_kwargs):
if "year" in view_kwargs:
year = int(view_kwargs["year"])
try:
... | <commit_before>from django.http import Http404
from django.utils import timezone
from clubadm.models import Member, Season
class SeasonMiddleware(object):
def process_view(self, request, view_func, view_args, view_kwargs):
if "year" in view_kwargs:
year = int(view_kwargs["year"])
... | from django.http import Http404
from django.utils import timezone
from clubadm.models import Member, Season
class SeasonMiddleware(object):
def process_view(self, request, view_func, view_args, view_kwargs):
if "year" in view_kwargs:
year = int(view_kwargs["year"])
try:
... | from django.http import Http404
from django.utils import timezone
from clubadm.models import Member, Season
class SeasonMiddleware(object):
def process_view(self, request, view_func, view_args, view_kwargs):
if "year" in view_kwargs:
year = int(view_kwargs["year"])
try:
... | <commit_before>from django.http import Http404
from django.utils import timezone
from clubadm.models import Member, Season
class SeasonMiddleware(object):
def process_view(self, request, view_func, view_args, view_kwargs):
if "year" in view_kwargs:
year = int(view_kwargs["year"])
... |
d6bec06d22eb8337ed22a536389c6f4ca794106a | py/templates.py | py/templates.py | import os.path
import jinja2
import configmanager
configs = configmanager.ConfigManager(os.path.abspath(os.path.join(os.path.dirname(__file__), "../configs")))
templateConfig = configs["templates"]
templatePath = os.path.abspath(os.path.join(os.path.dirname(__file__), "../", templateConfig["template_directory"]))
cla... | import os.path
import jinja2
import configmanager
configs = configmanager.ConfigManager(os.path.abspath(os.path.join(os.path.dirname(__file__), "../configs")))
templateConfig = configs["templates"]
templatePath = os.path.abspath(os.path.join(os.path.dirname(__file__), "../", templateConfig["template_directory"]))
cla... | Add paramater for template path | Add paramater for template path
| Python | mit | ollien/Timpani,ollien/Timpani,ollien/Timpani | import os.path
import jinja2
import configmanager
configs = configmanager.ConfigManager(os.path.abspath(os.path.join(os.path.dirname(__file__), "../configs")))
templateConfig = configs["templates"]
templatePath = os.path.abspath(os.path.join(os.path.dirname(__file__), "../", templateConfig["template_directory"]))
cla... | import os.path
import jinja2
import configmanager
configs = configmanager.ConfigManager(os.path.abspath(os.path.join(os.path.dirname(__file__), "../configs")))
templateConfig = configs["templates"]
templatePath = os.path.abspath(os.path.join(os.path.dirname(__file__), "../", templateConfig["template_directory"]))
cla... | <commit_before>import os.path
import jinja2
import configmanager
configs = configmanager.ConfigManager(os.path.abspath(os.path.join(os.path.dirname(__file__), "../configs")))
templateConfig = configs["templates"]
templatePath = os.path.abspath(os.path.join(os.path.dirname(__file__), "../", templateConfig["template_dir... | import os.path
import jinja2
import configmanager
configs = configmanager.ConfigManager(os.path.abspath(os.path.join(os.path.dirname(__file__), "../configs")))
templateConfig = configs["templates"]
templatePath = os.path.abspath(os.path.join(os.path.dirname(__file__), "../", templateConfig["template_directory"]))
cla... | import os.path
import jinja2
import configmanager
configs = configmanager.ConfigManager(os.path.abspath(os.path.join(os.path.dirname(__file__), "../configs")))
templateConfig = configs["templates"]
templatePath = os.path.abspath(os.path.join(os.path.dirname(__file__), "../", templateConfig["template_directory"]))
cla... | <commit_before>import os.path
import jinja2
import configmanager
configs = configmanager.ConfigManager(os.path.abspath(os.path.join(os.path.dirname(__file__), "../configs")))
templateConfig = configs["templates"]
templatePath = os.path.abspath(os.path.join(os.path.dirname(__file__), "../", templateConfig["template_dir... |
1339be71399a7fc8efaea4f2bd892f1b54ced011 | libcontextsubscriber/multithreading-tests/stress-test/provider.py | libcontextsubscriber/multithreading-tests/stress-test/provider.py | #!/usr/bin/python
"""A test provider for the stress testing."""
# change registry this often [msec]
registryChangeTimeout = 2017
from ContextKit.flexiprovider import *
import gobject
import time
import os
def update():
t = time.time()
dt = int(1000*(t - round(t)))
gobject.timeout_add(1000 - dt, update)... | #!/usr/bin/python
"""A test provider for the stress testing."""
# change registry this often [msec]
registryChangeTimeout = 2017
from ContextKit.flexiprovider import *
import gobject
import time
import os
def update():
t = time.time()
dt = int(1000*(t - round(t)))
gobject.timeout_add(1000 - dt, update)... | Fix stress test to avoid cdb bus error bug ref 125505 | Fix stress test to avoid cdb bus error
bug ref 125505
Signed-off-by: Marja Hassinen <97dfd0cfe579e2c003b71e95ee20ee035e309879@nokia.com>
| Python | lgpl-2.1 | rburchell/ck,rburchell/ck,rburchell/ck,rburchell/ck,rburchell/ck | #!/usr/bin/python
"""A test provider for the stress testing."""
# change registry this often [msec]
registryChangeTimeout = 2017
from ContextKit.flexiprovider import *
import gobject
import time
import os
def update():
t = time.time()
dt = int(1000*(t - round(t)))
gobject.timeout_add(1000 - dt, update)... | #!/usr/bin/python
"""A test provider for the stress testing."""
# change registry this often [msec]
registryChangeTimeout = 2017
from ContextKit.flexiprovider import *
import gobject
import time
import os
def update():
t = time.time()
dt = int(1000*(t - round(t)))
gobject.timeout_add(1000 - dt, update)... | <commit_before>#!/usr/bin/python
"""A test provider for the stress testing."""
# change registry this often [msec]
registryChangeTimeout = 2017
from ContextKit.flexiprovider import *
import gobject
import time
import os
def update():
t = time.time()
dt = int(1000*(t - round(t)))
gobject.timeout_add(100... | #!/usr/bin/python
"""A test provider for the stress testing."""
# change registry this often [msec]
registryChangeTimeout = 2017
from ContextKit.flexiprovider import *
import gobject
import time
import os
def update():
t = time.time()
dt = int(1000*(t - round(t)))
gobject.timeout_add(1000 - dt, update)... | #!/usr/bin/python
"""A test provider for the stress testing."""
# change registry this often [msec]
registryChangeTimeout = 2017
from ContextKit.flexiprovider import *
import gobject
import time
import os
def update():
t = time.time()
dt = int(1000*(t - round(t)))
gobject.timeout_add(1000 - dt, update)... | <commit_before>#!/usr/bin/python
"""A test provider for the stress testing."""
# change registry this often [msec]
registryChangeTimeout = 2017
from ContextKit.flexiprovider import *
import gobject
import time
import os
def update():
t = time.time()
dt = int(1000*(t - round(t)))
gobject.timeout_add(100... |
312f6d380ed81b420878bb32ea996fef14ba3f6d | run_doctests.py | run_doctests.py |
if __name__ == '__main__':
import doctest
from lesion import trace
doctest.testmod(trace)
|
if __name__ == '__main__':
import doctest
from lesion import lifio, stats, trace
map(doctest.testmod, [lifio, stats, trace])
| Add new modules to doctests | Add new modules to doctests
| Python | bsd-3-clause | jni/lesion |
if __name__ == '__main__':
import doctest
from lesion import trace
doctest.testmod(trace)
Add new modules to doctests |
if __name__ == '__main__':
import doctest
from lesion import lifio, stats, trace
map(doctest.testmod, [lifio, stats, trace])
| <commit_before>
if __name__ == '__main__':
import doctest
from lesion import trace
doctest.testmod(trace)
<commit_msg>Add new modules to doctests<commit_after> |
if __name__ == '__main__':
import doctest
from lesion import lifio, stats, trace
map(doctest.testmod, [lifio, stats, trace])
|
if __name__ == '__main__':
import doctest
from lesion import trace
doctest.testmod(trace)
Add new modules to doctests
if __name__ == '__main__':
import doctest
from lesion import lifio, stats, trace
map(doctest.testmod, [lifio, stats, trace])
| <commit_before>
if __name__ == '__main__':
import doctest
from lesion import trace
doctest.testmod(trace)
<commit_msg>Add new modules to doctests<commit_after>
if __name__ == '__main__':
import doctest
from lesion import lifio, stats, trace
map(doctest.testmod, [lifio, stats, trace])
|
205324a8fdc9742688952421ed5646877f66f583 | pydub/exceptions.py | pydub/exceptions.py | class PydubException(Exception):
"""
Base class for any Pydub exception
"""
class TooManyMissingFrames(PydubException):
pass
class InvalidDuration(PydubException):
pass
class InvalidTag(PydubException):
pass
class InvalidID3TagVersion(PydubException):
pass
class CouldntDecodeError(... | class PydubException(Exception):
"""
Base class for any Pydub exception
"""
class TooManyMissingFrames(PydubException):
pass
class InvalidDuration(PydubException):
pass
class InvalidTag(PydubException):
pass
class InvalidID3TagVersion(PydubException):
pass
class CouldntDecodeError(... | Add blank lines to comply with PEP8 | Add blank lines to comply with PEP8
| Python | mit | jiaaro/pydub | class PydubException(Exception):
"""
Base class for any Pydub exception
"""
class TooManyMissingFrames(PydubException):
pass
class InvalidDuration(PydubException):
pass
class InvalidTag(PydubException):
pass
class InvalidID3TagVersion(PydubException):
pass
class CouldntDecodeError(... | class PydubException(Exception):
"""
Base class for any Pydub exception
"""
class TooManyMissingFrames(PydubException):
pass
class InvalidDuration(PydubException):
pass
class InvalidTag(PydubException):
pass
class InvalidID3TagVersion(PydubException):
pass
class CouldntDecodeError(... | <commit_before>class PydubException(Exception):
"""
Base class for any Pydub exception
"""
class TooManyMissingFrames(PydubException):
pass
class InvalidDuration(PydubException):
pass
class InvalidTag(PydubException):
pass
class InvalidID3TagVersion(PydubException):
pass
class Coul... | class PydubException(Exception):
"""
Base class for any Pydub exception
"""
class TooManyMissingFrames(PydubException):
pass
class InvalidDuration(PydubException):
pass
class InvalidTag(PydubException):
pass
class InvalidID3TagVersion(PydubException):
pass
class CouldntDecodeError(... | class PydubException(Exception):
"""
Base class for any Pydub exception
"""
class TooManyMissingFrames(PydubException):
pass
class InvalidDuration(PydubException):
pass
class InvalidTag(PydubException):
pass
class InvalidID3TagVersion(PydubException):
pass
class CouldntDecodeError(... | <commit_before>class PydubException(Exception):
"""
Base class for any Pydub exception
"""
class TooManyMissingFrames(PydubException):
pass
class InvalidDuration(PydubException):
pass
class InvalidTag(PydubException):
pass
class InvalidID3TagVersion(PydubException):
pass
class Coul... |
3aae3ff16118c8ab743f664c58e4ee3cc9d2b74a | lib/rpnpy/__init__.py | lib/rpnpy/__init__.py | import sys
import ctypes as _ct
if sys.version_info < (3,):
integer_types = (int, long,)
range = xrange
else:
integer_types = (int,)
long = int
# xrange = range
C_WCHAR2CHAR = lambda x: bytes(str(x).encode('ascii'))
C_WCHAR2CHAR.__doc__ = 'Convert str to bytes'
C_CHAR2WCHAR = lambda x: str(x.deco... | import sys
import ctypes as _ct
if sys.version_info < (3,):
integer_types = (int, long,)
range = xrange
else:
integer_types = (int,)
long = int
range = range
C_WCHAR2CHAR = lambda x: bytes(str(x).encode('ascii'))
C_WCHAR2CHAR.__doc__ = 'Convert str to bytes'
C_CHAR2WCHAR = lambda x: str(x.decode(... | Add missing rpnpy.range reference for Python 3. | Add missing rpnpy.range reference for Python 3.
Signed-off-by: Stephane_Chamberland <1054841519c328088796c1f3c72c14f95c4efe35@science.gc.ca>
| Python | lgpl-2.1 | meteokid/python-rpn,meteokid/python-rpn,meteokid/python-rpn,meteokid/python-rpn | import sys
import ctypes as _ct
if sys.version_info < (3,):
integer_types = (int, long,)
range = xrange
else:
integer_types = (int,)
long = int
# xrange = range
C_WCHAR2CHAR = lambda x: bytes(str(x).encode('ascii'))
C_WCHAR2CHAR.__doc__ = 'Convert str to bytes'
C_CHAR2WCHAR = lambda x: str(x.deco... | import sys
import ctypes as _ct
if sys.version_info < (3,):
integer_types = (int, long,)
range = xrange
else:
integer_types = (int,)
long = int
range = range
C_WCHAR2CHAR = lambda x: bytes(str(x).encode('ascii'))
C_WCHAR2CHAR.__doc__ = 'Convert str to bytes'
C_CHAR2WCHAR = lambda x: str(x.decode(... | <commit_before>import sys
import ctypes as _ct
if sys.version_info < (3,):
integer_types = (int, long,)
range = xrange
else:
integer_types = (int,)
long = int
# xrange = range
C_WCHAR2CHAR = lambda x: bytes(str(x).encode('ascii'))
C_WCHAR2CHAR.__doc__ = 'Convert str to bytes'
C_CHAR2WCHAR = lambd... | import sys
import ctypes as _ct
if sys.version_info < (3,):
integer_types = (int, long,)
range = xrange
else:
integer_types = (int,)
long = int
range = range
C_WCHAR2CHAR = lambda x: bytes(str(x).encode('ascii'))
C_WCHAR2CHAR.__doc__ = 'Convert str to bytes'
C_CHAR2WCHAR = lambda x: str(x.decode(... | import sys
import ctypes as _ct
if sys.version_info < (3,):
integer_types = (int, long,)
range = xrange
else:
integer_types = (int,)
long = int
# xrange = range
C_WCHAR2CHAR = lambda x: bytes(str(x).encode('ascii'))
C_WCHAR2CHAR.__doc__ = 'Convert str to bytes'
C_CHAR2WCHAR = lambda x: str(x.deco... | <commit_before>import sys
import ctypes as _ct
if sys.version_info < (3,):
integer_types = (int, long,)
range = xrange
else:
integer_types = (int,)
long = int
# xrange = range
C_WCHAR2CHAR = lambda x: bytes(str(x).encode('ascii'))
C_WCHAR2CHAR.__doc__ = 'Convert str to bytes'
C_CHAR2WCHAR = lambd... |
e7c655bfdc860cd007e9c274c729f8a00d7fa0f5 | dnzo/test/test_api.py | dnzo/test/test_api.py | import unittest
from os import path
from webtest import TestApp
from google.appengine.ext import webapp
from django.utils import simplejson as json
from api.main import API_URLS, API_PREFIX
from test.fixtures import setup_fixtures
from tasks_data.models import Task
class TaskAPITest(unittest.TestCase):
def setUp(... | import unittest
from os import path
from webtest import TestApp
from google.appengine.ext import webapp
from django.utils import simplejson as json
from api.main import API_URLS, API_PREFIX
from test.fixtures import setup_fixtures
from tasks_data.models import Task
BOGUS_IDS = ('abc', '-1', '0.1234', '1.', '.1', ' ... | Add some more basic tests for /t/, which should return all tasks for a user. | Add some more basic tests for /t/, which should return all tasks for a user.
git-svn-id: 062a66634e56759c7c3cc44955c32d2ce0012d25@307 c02d1e6f-6a35-45f2-ab14-3b6f79a691ff
| Python | mit | taylorhughes/done-zo,taylorhughes/done-zo,taylorhughes/done-zo,taylorhughes/done-zo | import unittest
from os import path
from webtest import TestApp
from google.appengine.ext import webapp
from django.utils import simplejson as json
from api.main import API_URLS, API_PREFIX
from test.fixtures import setup_fixtures
from tasks_data.models import Task
class TaskAPITest(unittest.TestCase):
def setUp(... | import unittest
from os import path
from webtest import TestApp
from google.appengine.ext import webapp
from django.utils import simplejson as json
from api.main import API_URLS, API_PREFIX
from test.fixtures import setup_fixtures
from tasks_data.models import Task
BOGUS_IDS = ('abc', '-1', '0.1234', '1.', '.1', ' ... | <commit_before>import unittest
from os import path
from webtest import TestApp
from google.appengine.ext import webapp
from django.utils import simplejson as json
from api.main import API_URLS, API_PREFIX
from test.fixtures import setup_fixtures
from tasks_data.models import Task
class TaskAPITest(unittest.TestCase... | import unittest
from os import path
from webtest import TestApp
from google.appengine.ext import webapp
from django.utils import simplejson as json
from api.main import API_URLS, API_PREFIX
from test.fixtures import setup_fixtures
from tasks_data.models import Task
BOGUS_IDS = ('abc', '-1', '0.1234', '1.', '.1', ' ... | import unittest
from os import path
from webtest import TestApp
from google.appengine.ext import webapp
from django.utils import simplejson as json
from api.main import API_URLS, API_PREFIX
from test.fixtures import setup_fixtures
from tasks_data.models import Task
class TaskAPITest(unittest.TestCase):
def setUp(... | <commit_before>import unittest
from os import path
from webtest import TestApp
from google.appengine.ext import webapp
from django.utils import simplejson as json
from api.main import API_URLS, API_PREFIX
from test.fixtures import setup_fixtures
from tasks_data.models import Task
class TaskAPITest(unittest.TestCase... |
ff5da3c3ccb378772e073a1020d3a7fcee72d7e4 | scripts/install_devplatforms.py | scripts/install_devplatforms.py | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 appli... | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 appli... | Use stable dev/platforms for CI | Use stable dev/platforms for CI
| Python | apache-2.0 | platformio/platformio-core,platformio/platformio-core,platformio/platformio | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 appli... | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 appli... | <commit_before># Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 re... | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 appli... | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 appli... | <commit_before># Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 re... |
59f5007787b87a37b5e5669a75d39d1d7e88e0e9 | redfish/__init__.py | redfish/__init__.py | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | Fix pbr if running without git or sdist | Fix pbr if running without git or sdist
| Python | apache-2.0 | uggla/python-redfish,bcornec/python-redfish,bcornec/python-redfish,uggla/python-redfish,uggla/python-redfish,bcornec/python-redfish | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | <commit_before># -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | <commit_before># -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
4c1993158bf44954bc10305f6f64e23dfd5d4618 | floo/api.py | floo/api.py | from urllib.parse import urlencode
import urllib.error
import urllib.request
from . import shared as G
def create_room(room_name):
url = 'https://%s/api/room/' % G.DEFAULT_HOST
# TODO: let user specify permissions
post_data = {
'username': G.USERNAME,
'secret': G.SECRET,
'name': r... | from urllib.parse import urlencode
import urllib.error
import urllib.request
from . import shared as G
def create_room(room_name):
url = 'https://%s/api/room/' % G.DEFAULT_HOST
# TODO: let user specify permissions
post_data = {
'username': G.USERNAME,
'secret': G.SECRET,
'name': r... | Fix bug when creating rooms | Fix bug when creating rooms
| Python | apache-2.0 | Floobits/floobits-sublime,Floobits/floobits-sublime | from urllib.parse import urlencode
import urllib.error
import urllib.request
from . import shared as G
def create_room(room_name):
url = 'https://%s/api/room/' % G.DEFAULT_HOST
# TODO: let user specify permissions
post_data = {
'username': G.USERNAME,
'secret': G.SECRET,
'name': r... | from urllib.parse import urlencode
import urllib.error
import urllib.request
from . import shared as G
def create_room(room_name):
url = 'https://%s/api/room/' % G.DEFAULT_HOST
# TODO: let user specify permissions
post_data = {
'username': G.USERNAME,
'secret': G.SECRET,
'name': r... | <commit_before>from urllib.parse import urlencode
import urllib.error
import urllib.request
from . import shared as G
def create_room(room_name):
url = 'https://%s/api/room/' % G.DEFAULT_HOST
# TODO: let user specify permissions
post_data = {
'username': G.USERNAME,
'secret': G.SECRET,
... | from urllib.parse import urlencode
import urllib.error
import urllib.request
from . import shared as G
def create_room(room_name):
url = 'https://%s/api/room/' % G.DEFAULT_HOST
# TODO: let user specify permissions
post_data = {
'username': G.USERNAME,
'secret': G.SECRET,
'name': r... | from urllib.parse import urlencode
import urllib.error
import urllib.request
from . import shared as G
def create_room(room_name):
url = 'https://%s/api/room/' % G.DEFAULT_HOST
# TODO: let user specify permissions
post_data = {
'username': G.USERNAME,
'secret': G.SECRET,
'name': r... | <commit_before>from urllib.parse import urlencode
import urllib.error
import urllib.request
from . import shared as G
def create_room(room_name):
url = 'https://%s/api/room/' % G.DEFAULT_HOST
# TODO: let user specify permissions
post_data = {
'username': G.USERNAME,
'secret': G.SECRET,
... |
91edea41858c1171168b8e2ed77f97ea19c8f684 | public/sentry/env_remote_user_middleware.py | public/sentry/env_remote_user_middleware.py | import os
from django.contrib.auth.middleware import RemoteUserMiddleware
class EnvRemoteUserMiddleware(RemoteUserMiddleware):
header = os.environ.get('REMOTE_USER_HEADER', 'REMOTE_USER')
| import os
from django.contrib.auth.middleware import RemoteUserMiddleware
class EnvRemoteUserMiddleware(RemoteUserMiddleware):
header = os.environ.get('REMOTE_USER_HEADER', 'REMOTE_USER')
def configure_user(user):
if 'REMOTE_USER_EMAIL_SUFFIX' in os.environ:
user.email = "{0}{1}".format(u... | Configure user's e-mail via REMOTE_USER_EMAIL_SUFFIX | sentry: Configure user's e-mail via REMOTE_USER_EMAIL_SUFFIX
| Python | mit | 3ofcoins/docker-images,3ofcoins/docker-images | import os
from django.contrib.auth.middleware import RemoteUserMiddleware
class EnvRemoteUserMiddleware(RemoteUserMiddleware):
header = os.environ.get('REMOTE_USER_HEADER', 'REMOTE_USER')
sentry: Configure user's e-mail via REMOTE_USER_EMAIL_SUFFIX | import os
from django.contrib.auth.middleware import RemoteUserMiddleware
class EnvRemoteUserMiddleware(RemoteUserMiddleware):
header = os.environ.get('REMOTE_USER_HEADER', 'REMOTE_USER')
def configure_user(user):
if 'REMOTE_USER_EMAIL_SUFFIX' in os.environ:
user.email = "{0}{1}".format(u... | <commit_before>import os
from django.contrib.auth.middleware import RemoteUserMiddleware
class EnvRemoteUserMiddleware(RemoteUserMiddleware):
header = os.environ.get('REMOTE_USER_HEADER', 'REMOTE_USER')
<commit_msg>sentry: Configure user's e-mail via REMOTE_USER_EMAIL_SUFFIX<commit_after> | import os
from django.contrib.auth.middleware import RemoteUserMiddleware
class EnvRemoteUserMiddleware(RemoteUserMiddleware):
header = os.environ.get('REMOTE_USER_HEADER', 'REMOTE_USER')
def configure_user(user):
if 'REMOTE_USER_EMAIL_SUFFIX' in os.environ:
user.email = "{0}{1}".format(u... | import os
from django.contrib.auth.middleware import RemoteUserMiddleware
class EnvRemoteUserMiddleware(RemoteUserMiddleware):
header = os.environ.get('REMOTE_USER_HEADER', 'REMOTE_USER')
sentry: Configure user's e-mail via REMOTE_USER_EMAIL_SUFFIXimport os
from django.contrib.auth.middleware import RemoteUserMi... | <commit_before>import os
from django.contrib.auth.middleware import RemoteUserMiddleware
class EnvRemoteUserMiddleware(RemoteUserMiddleware):
header = os.environ.get('REMOTE_USER_HEADER', 'REMOTE_USER')
<commit_msg>sentry: Configure user's e-mail via REMOTE_USER_EMAIL_SUFFIX<commit_after>import os
from django.co... |
43d14f73055643a2e4921a58aa1bf5e14fdf8e74 | linter.py | linter.py | import logging
import re
from SublimeLinter.lint import NodeLinter
logger = logging.getLogger('SublimeLinter.plugin.tslint')
class Tslint(NodeLinter):
cmd = 'tslint --format verbose ${file}'
regex = (
r'^(?:'
r'(ERROR:\s+\((?P<error>.*)\))|'
r'(WARNING:\s+\((?P<warning>.*)\))'
... | import logging
import re
from SublimeLinter.lint import NodeLinter
logger = logging.getLogger('SublimeLinter.plugin.tslint')
class Tslint(NodeLinter):
cmd = 'tslint --format verbose ${file}'
regex = (
r'^(?:'
r'(ERROR:\s+\((?P<error>.*)\))|'
r'(WARNING:\s+\((?P<warning>.*)\))'
... | Update regex to include filename capture group. | Update regex to include filename capture group.
| Python | mit | lavrton/SublimeLinter-contrib-tslint | import logging
import re
from SublimeLinter.lint import NodeLinter
logger = logging.getLogger('SublimeLinter.plugin.tslint')
class Tslint(NodeLinter):
cmd = 'tslint --format verbose ${file}'
regex = (
r'^(?:'
r'(ERROR:\s+\((?P<error>.*)\))|'
r'(WARNING:\s+\((?P<warning>.*)\))'
... | import logging
import re
from SublimeLinter.lint import NodeLinter
logger = logging.getLogger('SublimeLinter.plugin.tslint')
class Tslint(NodeLinter):
cmd = 'tslint --format verbose ${file}'
regex = (
r'^(?:'
r'(ERROR:\s+\((?P<error>.*)\))|'
r'(WARNING:\s+\((?P<warning>.*)\))'
... | <commit_before>import logging
import re
from SublimeLinter.lint import NodeLinter
logger = logging.getLogger('SublimeLinter.plugin.tslint')
class Tslint(NodeLinter):
cmd = 'tslint --format verbose ${file}'
regex = (
r'^(?:'
r'(ERROR:\s+\((?P<error>.*)\))|'
r'(WARNING:\s+\((?P<warning>... | import logging
import re
from SublimeLinter.lint import NodeLinter
logger = logging.getLogger('SublimeLinter.plugin.tslint')
class Tslint(NodeLinter):
cmd = 'tslint --format verbose ${file}'
regex = (
r'^(?:'
r'(ERROR:\s+\((?P<error>.*)\))|'
r'(WARNING:\s+\((?P<warning>.*)\))'
... | import logging
import re
from SublimeLinter.lint import NodeLinter
logger = logging.getLogger('SublimeLinter.plugin.tslint')
class Tslint(NodeLinter):
cmd = 'tslint --format verbose ${file}'
regex = (
r'^(?:'
r'(ERROR:\s+\((?P<error>.*)\))|'
r'(WARNING:\s+\((?P<warning>.*)\))'
... | <commit_before>import logging
import re
from SublimeLinter.lint import NodeLinter
logger = logging.getLogger('SublimeLinter.plugin.tslint')
class Tslint(NodeLinter):
cmd = 'tslint --format verbose ${file}'
regex = (
r'^(?:'
r'(ERROR:\s+\((?P<error>.*)\))|'
r'(WARNING:\s+\((?P<warning>... |
3bf73c3a97762af08fafb36729e6e8ab024401e2 | settings/heroku.py | settings/heroku.py | import dj_database_url
from .common import * # noqa
DATABASES = {
'default': dj_database_url.config(conn_max_age=500),
}
DEBUG = False
ALLOWED_HOSTS = ['.herokuapp.com']
| import dj_database_url
from .common import * # noqa
DATABASES = {
'default': dj_database_url.config(conn_max_age=500),
}
DEBUG = False
ALLOWED_HOSTS = ['*']
| Allow all hosts when on Heroku | Allow all hosts when on Heroku
| Python | mit | smtchahal/url-shortener,smtchahal/url-shortener,smtchahal/url-shortener | import dj_database_url
from .common import * # noqa
DATABASES = {
'default': dj_database_url.config(conn_max_age=500),
}
DEBUG = False
ALLOWED_HOSTS = ['.herokuapp.com']
Allow all hosts when on Heroku | import dj_database_url
from .common import * # noqa
DATABASES = {
'default': dj_database_url.config(conn_max_age=500),
}
DEBUG = False
ALLOWED_HOSTS = ['*']
| <commit_before>import dj_database_url
from .common import * # noqa
DATABASES = {
'default': dj_database_url.config(conn_max_age=500),
}
DEBUG = False
ALLOWED_HOSTS = ['.herokuapp.com']
<commit_msg>Allow all hosts when on Heroku<commit_after> | import dj_database_url
from .common import * # noqa
DATABASES = {
'default': dj_database_url.config(conn_max_age=500),
}
DEBUG = False
ALLOWED_HOSTS = ['*']
| import dj_database_url
from .common import * # noqa
DATABASES = {
'default': dj_database_url.config(conn_max_age=500),
}
DEBUG = False
ALLOWED_HOSTS = ['.herokuapp.com']
Allow all hosts when on Herokuimport dj_database_url
from .common import * # noqa
DATABASES = {
'default': dj_database_url.config(conn... | <commit_before>import dj_database_url
from .common import * # noqa
DATABASES = {
'default': dj_database_url.config(conn_max_age=500),
}
DEBUG = False
ALLOWED_HOSTS = ['.herokuapp.com']
<commit_msg>Allow all hosts when on Heroku<commit_after>import dj_database_url
from .common import * # noqa
DATABASES = {
... |
b7377196cdd05d9d6d481f7b93308189c4524c52 | sfm/api/filters.py | sfm/api/filters.py | from django_filters import FilterSet, CharFilter, IsoDateTimeFilter
from ui.models import Warc, Seed, Harvest
from django_filters import Filter
from django_filters.fields import Lookup
class ListFilter(Filter):
def filter(self, qs, value):
return super(ListFilter, self).filter(qs, Lookup(value.split(u",")... | from django_filters import FilterSet, CharFilter, IsoDateTimeFilter
from ui.models import Warc, Seed, Harvest
from django_filters import Filter
from django_filters.fields import Lookup
class ListFilter(Filter):
def filter(self, qs, value):
return super(ListFilter, self).filter(qs, Lookup(value.split(u",")... | Fix to take into account history in API queries. | Fix to take into account history in API queries.
| Python | mit | gwu-libraries/sfm,gwu-libraries/sfm-ui,gwu-libraries/sfm,gwu-libraries/sfm,gwu-libraries/sfm-ui,gwu-libraries/sfm-ui,gwu-libraries/sfm-ui | from django_filters import FilterSet, CharFilter, IsoDateTimeFilter
from ui.models import Warc, Seed, Harvest
from django_filters import Filter
from django_filters.fields import Lookup
class ListFilter(Filter):
def filter(self, qs, value):
return super(ListFilter, self).filter(qs, Lookup(value.split(u",")... | from django_filters import FilterSet, CharFilter, IsoDateTimeFilter
from ui.models import Warc, Seed, Harvest
from django_filters import Filter
from django_filters.fields import Lookup
class ListFilter(Filter):
def filter(self, qs, value):
return super(ListFilter, self).filter(qs, Lookup(value.split(u",")... | <commit_before>from django_filters import FilterSet, CharFilter, IsoDateTimeFilter
from ui.models import Warc, Seed, Harvest
from django_filters import Filter
from django_filters.fields import Lookup
class ListFilter(Filter):
def filter(self, qs, value):
return super(ListFilter, self).filter(qs, Lookup(va... | from django_filters import FilterSet, CharFilter, IsoDateTimeFilter
from ui.models import Warc, Seed, Harvest
from django_filters import Filter
from django_filters.fields import Lookup
class ListFilter(Filter):
def filter(self, qs, value):
return super(ListFilter, self).filter(qs, Lookup(value.split(u",")... | from django_filters import FilterSet, CharFilter, IsoDateTimeFilter
from ui.models import Warc, Seed, Harvest
from django_filters import Filter
from django_filters.fields import Lookup
class ListFilter(Filter):
def filter(self, qs, value):
return super(ListFilter, self).filter(qs, Lookup(value.split(u",")... | <commit_before>from django_filters import FilterSet, CharFilter, IsoDateTimeFilter
from ui.models import Warc, Seed, Harvest
from django_filters import Filter
from django_filters.fields import Lookup
class ListFilter(Filter):
def filter(self, qs, value):
return super(ListFilter, self).filter(qs, Lookup(va... |
b44345efada2a89423c89ec88a24f1dbe97ef562 | viewer.py | viewer.py | # Nessus results viewing tools
#
# Developed by Felix Ingram, f.ingram@gmail.com, @lllamaboy
# http://www.github.com/nccgroup/nessusviewer
#
# Released under AGPL. See LICENSE for more information
if __name__ == '__main__':
import wx
from controller import ViewerController
app = wx.App(0)
Vi... | # Nessus results viewing tools
#
# Developed by Felix Ingram, f.ingram@gmail.com, @lllamaboy
# http://www.github.com/nccgroup/nessusviewer
#
# Released under AGPL. See LICENSE for more information
if __name__ == '__main__':
import sys
try:
import wx
except ImportError:
print("""... | Add simple test for whether WX is installed. Display download link if not. | Add simple test for whether WX is installed. Display download link if not.
| Python | agpl-3.0 | nccgroup/lapith | # Nessus results viewing tools
#
# Developed by Felix Ingram, f.ingram@gmail.com, @lllamaboy
# http://www.github.com/nccgroup/nessusviewer
#
# Released under AGPL. See LICENSE for more information
if __name__ == '__main__':
import wx
from controller import ViewerController
app = wx.App(0)
Vi... | # Nessus results viewing tools
#
# Developed by Felix Ingram, f.ingram@gmail.com, @lllamaboy
# http://www.github.com/nccgroup/nessusviewer
#
# Released under AGPL. See LICENSE for more information
if __name__ == '__main__':
import sys
try:
import wx
except ImportError:
print("""... | <commit_before># Nessus results viewing tools
#
# Developed by Felix Ingram, f.ingram@gmail.com, @lllamaboy
# http://www.github.com/nccgroup/nessusviewer
#
# Released under AGPL. See LICENSE for more information
if __name__ == '__main__':
import wx
from controller import ViewerController
app = wx... | # Nessus results viewing tools
#
# Developed by Felix Ingram, f.ingram@gmail.com, @lllamaboy
# http://www.github.com/nccgroup/nessusviewer
#
# Released under AGPL. See LICENSE for more information
if __name__ == '__main__':
import sys
try:
import wx
except ImportError:
print("""... | # Nessus results viewing tools
#
# Developed by Felix Ingram, f.ingram@gmail.com, @lllamaboy
# http://www.github.com/nccgroup/nessusviewer
#
# Released under AGPL. See LICENSE for more information
if __name__ == '__main__':
import wx
from controller import ViewerController
app = wx.App(0)
Vi... | <commit_before># Nessus results viewing tools
#
# Developed by Felix Ingram, f.ingram@gmail.com, @lllamaboy
# http://www.github.com/nccgroup/nessusviewer
#
# Released under AGPL. See LICENSE for more information
if __name__ == '__main__':
import wx
from controller import ViewerController
app = wx... |
3046eaf265d015c2257efa8066a04c26ddd4448e | search.py | search.py | import io
import getopt
import sys
import pickle
def usage():
print("usage: " + sys.argv[0] + " -d dictionary-file -p postings-file -q file-of-queries -o output-file-of-results")
if __name__ == '__main__':
dict_file = postings_file = query_file = output_file = None
try:
opts, args = getopt.getopt(sys.argv[1:], '... | import io
import getopt
import sys
import pickle
def usage():
print("usage: " + sys.argv[0] + " -d dictionary-file -p postings-file -q file-of-queries -o output-file-of-results")
if __name__ == '__main__':
dict_file = postings_file = query_file = output_file = None
try:
opts, args = getopt.getopt(sys.argv[1:], '... | Add todo for seeking and reading | Add todo for seeking and reading
| Python | mit | ikaruswill/boolean-retrieval,ikaruswill/vector-space-model | import io
import getopt
import sys
import pickle
def usage():
print("usage: " + sys.argv[0] + " -d dictionary-file -p postings-file -q file-of-queries -o output-file-of-results")
if __name__ == '__main__':
dict_file = postings_file = query_file = output_file = None
try:
opts, args = getopt.getopt(sys.argv[1:], '... | import io
import getopt
import sys
import pickle
def usage():
print("usage: " + sys.argv[0] + " -d dictionary-file -p postings-file -q file-of-queries -o output-file-of-results")
if __name__ == '__main__':
dict_file = postings_file = query_file = output_file = None
try:
opts, args = getopt.getopt(sys.argv[1:], '... | <commit_before>import io
import getopt
import sys
import pickle
def usage():
print("usage: " + sys.argv[0] + " -d dictionary-file -p postings-file -q file-of-queries -o output-file-of-results")
if __name__ == '__main__':
dict_file = postings_file = query_file = output_file = None
try:
opts, args = getopt.getopt(... | import io
import getopt
import sys
import pickle
def usage():
print("usage: " + sys.argv[0] + " -d dictionary-file -p postings-file -q file-of-queries -o output-file-of-results")
if __name__ == '__main__':
dict_file = postings_file = query_file = output_file = None
try:
opts, args = getopt.getopt(sys.argv[1:], '... | import io
import getopt
import sys
import pickle
def usage():
print("usage: " + sys.argv[0] + " -d dictionary-file -p postings-file -q file-of-queries -o output-file-of-results")
if __name__ == '__main__':
dict_file = postings_file = query_file = output_file = None
try:
opts, args = getopt.getopt(sys.argv[1:], '... | <commit_before>import io
import getopt
import sys
import pickle
def usage():
print("usage: " + sys.argv[0] + " -d dictionary-file -p postings-file -q file-of-queries -o output-file-of-results")
if __name__ == '__main__':
dict_file = postings_file = query_file = output_file = None
try:
opts, args = getopt.getopt(... |
c259320c1108ed1012266f1bf8d49caf113af4e9 | dsub/_dsub_version.py | dsub/_dsub_version.py | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Update dsub version to 0.4.2.dev0 | Update dsub version to 0.4.2.dev0
PiperOrigin-RevId: 328753098
| Python | apache-2.0 | DataBiosphere/dsub,DataBiosphere/dsub | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | <commit_before># Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | <commit_before># Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
510ab1cd5c39168cb64c733b41f37d3745812782 | src/integrate_tool.py | src/integrate_tool.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bioblend import galaxy
from bioblend import toolshed
if __name__ == '__main__':
gi_url = "http://172.21.23.6:8080/"
ts_url = "http://172.21.23.6:9009/"
name = "qiime"
owner = "iuc"
tool_panel_section_id = "qiime_rRNA_taxonomic_assignation"
g... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bioblend import galaxy
from bioblend import toolshed
if __name__ == '__main__':
gi_url = "http://172.21.23.6:8080/"
ts_url = "http://172.21.23.6:9009/"
name = "qiime"
owner = "iuc"
tool_panel_section_id = "qiime_rRNA_taxonomic_assignation"
g... | Add installation of repository dependencies for tools | Add installation of repository dependencies for tools
| Python | apache-2.0 | ASaiM/framework,ASaiM/framework | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bioblend import galaxy
from bioblend import toolshed
if __name__ == '__main__':
gi_url = "http://172.21.23.6:8080/"
ts_url = "http://172.21.23.6:9009/"
name = "qiime"
owner = "iuc"
tool_panel_section_id = "qiime_rRNA_taxonomic_assignation"
g... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bioblend import galaxy
from bioblend import toolshed
if __name__ == '__main__':
gi_url = "http://172.21.23.6:8080/"
ts_url = "http://172.21.23.6:9009/"
name = "qiime"
owner = "iuc"
tool_panel_section_id = "qiime_rRNA_taxonomic_assignation"
g... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from bioblend import galaxy
from bioblend import toolshed
if __name__ == '__main__':
gi_url = "http://172.21.23.6:8080/"
ts_url = "http://172.21.23.6:9009/"
name = "qiime"
owner = "iuc"
tool_panel_section_id = "qiime_rRNA_taxonomic_assi... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bioblend import galaxy
from bioblend import toolshed
if __name__ == '__main__':
gi_url = "http://172.21.23.6:8080/"
ts_url = "http://172.21.23.6:9009/"
name = "qiime"
owner = "iuc"
tool_panel_section_id = "qiime_rRNA_taxonomic_assignation"
g... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bioblend import galaxy
from bioblend import toolshed
if __name__ == '__main__':
gi_url = "http://172.21.23.6:8080/"
ts_url = "http://172.21.23.6:9009/"
name = "qiime"
owner = "iuc"
tool_panel_section_id = "qiime_rRNA_taxonomic_assignation"
g... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from bioblend import galaxy
from bioblend import toolshed
if __name__ == '__main__':
gi_url = "http://172.21.23.6:8080/"
ts_url = "http://172.21.23.6:9009/"
name = "qiime"
owner = "iuc"
tool_panel_section_id = "qiime_rRNA_taxonomic_assi... |
36d79bd59282f9f1d2ba948cbaf0401f851b2d0a | rtwilio/outgoing.py | rtwilio/outgoing.py | import pprint
import logging
import datetime
from twilio.rest import TwilioRestClient
from rapidsms.backends.base import BackendBase
logger = logging.getLogger(__name__)
class TwilioBackend(BackendBase):
"""A RapidSMS backend for Twilio (http://www.twilio.com/)."""
def configure(self, config=None, **kwarg... | import pprint
import logging
import datetime
from twilio.rest import TwilioRestClient
from rapidsms.backends.base import BackendBase
logger = logging.getLogger(__name__)
class TwilioBackend(BackendBase):
"""A RapidSMS backend for Twilio (http://www.twilio.com/)."""
def configure(self, config=None, **kwarg... | Remove self.debug as LoggerMixin was removed from new versions of rapidsms. | Remove self.debug as LoggerMixin was removed from new versions of rapidsms.
| Python | bsd-3-clause | caktus/rapidsms-twilio | import pprint
import logging
import datetime
from twilio.rest import TwilioRestClient
from rapidsms.backends.base import BackendBase
logger = logging.getLogger(__name__)
class TwilioBackend(BackendBase):
"""A RapidSMS backend for Twilio (http://www.twilio.com/)."""
def configure(self, config=None, **kwarg... | import pprint
import logging
import datetime
from twilio.rest import TwilioRestClient
from rapidsms.backends.base import BackendBase
logger = logging.getLogger(__name__)
class TwilioBackend(BackendBase):
"""A RapidSMS backend for Twilio (http://www.twilio.com/)."""
def configure(self, config=None, **kwarg... | <commit_before>import pprint
import logging
import datetime
from twilio.rest import TwilioRestClient
from rapidsms.backends.base import BackendBase
logger = logging.getLogger(__name__)
class TwilioBackend(BackendBase):
"""A RapidSMS backend for Twilio (http://www.twilio.com/)."""
def configure(self, confi... | import pprint
import logging
import datetime
from twilio.rest import TwilioRestClient
from rapidsms.backends.base import BackendBase
logger = logging.getLogger(__name__)
class TwilioBackend(BackendBase):
"""A RapidSMS backend for Twilio (http://www.twilio.com/)."""
def configure(self, config=None, **kwarg... | import pprint
import logging
import datetime
from twilio.rest import TwilioRestClient
from rapidsms.backends.base import BackendBase
logger = logging.getLogger(__name__)
class TwilioBackend(BackendBase):
"""A RapidSMS backend for Twilio (http://www.twilio.com/)."""
def configure(self, config=None, **kwarg... | <commit_before>import pprint
import logging
import datetime
from twilio.rest import TwilioRestClient
from rapidsms.backends.base import BackendBase
logger = logging.getLogger(__name__)
class TwilioBackend(BackendBase):
"""A RapidSMS backend for Twilio (http://www.twilio.com/)."""
def configure(self, confi... |
592a2c778bf7c87b7aad6f9ba14c1ba83da033e8 | scoring_engine/web/views/services.py | scoring_engine/web/views/services.py | from flask import Blueprint, render_template, flash
from flask_login import login_required, current_user
mod = Blueprint('services', __name__)
@mod.route('/services')
@login_required
def home():
current_team = current_user.team
if not current_user.is_blue_team:
flash('Only blue teams can access servi... | from flask import Blueprint, render_template, url_for, redirect
from flask_login import login_required, current_user
from scoring_engine.models.service import Service
mod = Blueprint('services', __name__)
@mod.route('/services')
@login_required
def home():
current_team = current_user.team
if not current_user... | Add unauthorize to service template | Add unauthorize to service template
Signed-off-by: Brandon Myers <9cda508be11a1ae7ceef912b85c196946f0ec5f3@mozilla.com>
| Python | mit | pwnbus/scoring_engine,pwnbus/scoring_engine,pwnbus/scoring_engine,pwnbus/scoring_engine | from flask import Blueprint, render_template, flash
from flask_login import login_required, current_user
mod = Blueprint('services', __name__)
@mod.route('/services')
@login_required
def home():
current_team = current_user.team
if not current_user.is_blue_team:
flash('Only blue teams can access servi... | from flask import Blueprint, render_template, url_for, redirect
from flask_login import login_required, current_user
from scoring_engine.models.service import Service
mod = Blueprint('services', __name__)
@mod.route('/services')
@login_required
def home():
current_team = current_user.team
if not current_user... | <commit_before>from flask import Blueprint, render_template, flash
from flask_login import login_required, current_user
mod = Blueprint('services', __name__)
@mod.route('/services')
@login_required
def home():
current_team = current_user.team
if not current_user.is_blue_team:
flash('Only blue teams c... | from flask import Blueprint, render_template, url_for, redirect
from flask_login import login_required, current_user
from scoring_engine.models.service import Service
mod = Blueprint('services', __name__)
@mod.route('/services')
@login_required
def home():
current_team = current_user.team
if not current_user... | from flask import Blueprint, render_template, flash
from flask_login import login_required, current_user
mod = Blueprint('services', __name__)
@mod.route('/services')
@login_required
def home():
current_team = current_user.team
if not current_user.is_blue_team:
flash('Only blue teams can access servi... | <commit_before>from flask import Blueprint, render_template, flash
from flask_login import login_required, current_user
mod = Blueprint('services', __name__)
@mod.route('/services')
@login_required
def home():
current_team = current_user.team
if not current_user.is_blue_team:
flash('Only blue teams c... |
7f2c1c46f9a9f1557b3754b26428d9d9862440c3 | server.py | server.py | #!/usr/bin/env python
from recipyGui import recipyGui
import random, threading, webbrowser
port = 5000 + random.randint(0, 999)
url = "http://127.0.0.1:{0}".format(port)
# Give the application some time before it starts
threading.Timer(1.25, lambda: webbrowser.open(url) ).start()
recipyGui.run(debug = True, port=por... | #!/usr/bin/env python
from recipyGui import recipyGui
import threading, webbrowser, socket
def get_free_port():
s = socket.socket()
s.bind(('', 0))
port = s.getsockname()[1]
s.close()
return port
port = get_free_port()
url = "http://127.0.0.1:{0}".format(port)
# Give the application some time bef... | Select random open port for gui | Select random open port for gui
Refs #6.
| Python | apache-2.0 | MBARIMike/recipy,musically-ut/recipy,github4ry/recipy,MichielCottaar/recipy,github4ry/recipy,recipy/recipy-gui,musically-ut/recipy,bsipocz/recipy,MBARIMike/recipy,recipy/recipy,recipy/recipy,recipy/recipy-gui,MichielCottaar/recipy,bsipocz/recipy | #!/usr/bin/env python
from recipyGui import recipyGui
import random, threading, webbrowser
port = 5000 + random.randint(0, 999)
url = "http://127.0.0.1:{0}".format(port)
# Give the application some time before it starts
threading.Timer(1.25, lambda: webbrowser.open(url) ).start()
recipyGui.run(debug = True, port=por... | #!/usr/bin/env python
from recipyGui import recipyGui
import threading, webbrowser, socket
def get_free_port():
s = socket.socket()
s.bind(('', 0))
port = s.getsockname()[1]
s.close()
return port
port = get_free_port()
url = "http://127.0.0.1:{0}".format(port)
# Give the application some time bef... | <commit_before>#!/usr/bin/env python
from recipyGui import recipyGui
import random, threading, webbrowser
port = 5000 + random.randint(0, 999)
url = "http://127.0.0.1:{0}".format(port)
# Give the application some time before it starts
threading.Timer(1.25, lambda: webbrowser.open(url) ).start()
recipyGui.run(debug =... | #!/usr/bin/env python
from recipyGui import recipyGui
import threading, webbrowser, socket
def get_free_port():
s = socket.socket()
s.bind(('', 0))
port = s.getsockname()[1]
s.close()
return port
port = get_free_port()
url = "http://127.0.0.1:{0}".format(port)
# Give the application some time bef... | #!/usr/bin/env python
from recipyGui import recipyGui
import random, threading, webbrowser
port = 5000 + random.randint(0, 999)
url = "http://127.0.0.1:{0}".format(port)
# Give the application some time before it starts
threading.Timer(1.25, lambda: webbrowser.open(url) ).start()
recipyGui.run(debug = True, port=por... | <commit_before>#!/usr/bin/env python
from recipyGui import recipyGui
import random, threading, webbrowser
port = 5000 + random.randint(0, 999)
url = "http://127.0.0.1:{0}".format(port)
# Give the application some time before it starts
threading.Timer(1.25, lambda: webbrowser.open(url) ).start()
recipyGui.run(debug =... |
cdfbd5bab75de151e2e9f3f36eb18741ddb862c1 | sifter.py | sifter.py | import os
import requests
import re
import json
NUM_REGEX = r'\#([0-9]+)'
API_KEY = os.environ['SIFTER']
def find_ticket(number):
headers = {
'X-Sifter-Token': API_KEY
}
url = 'https://unisubs.sifterapp.com/api/projects/12298/issues?q=%s'
api = url % number
r = requests.get(api, headers... | import os
import requests
import re
import json
NUM_REGEX = r'\b\#?(\d\d\d\d?\d?)\b'
API_KEY = os.environ['SIFTER']
def find_ticket(number):
headers = {
'X-Sifter-Token': API_KEY
}
url = 'https://unisubs.sifterapp.com/api/projects/12298/issues?q=%s'
api = url % number
r = requests.get(a... | Change the Sifter issue number matching | Change the Sifter issue number matching
Now it's only 3-5 digits, optionally with the hash,
and only as a standalone word. | Python | bsd-2-clause | honza/nigel | import os
import requests
import re
import json
NUM_REGEX = r'\#([0-9]+)'
API_KEY = os.environ['SIFTER']
def find_ticket(number):
headers = {
'X-Sifter-Token': API_KEY
}
url = 'https://unisubs.sifterapp.com/api/projects/12298/issues?q=%s'
api = url % number
r = requests.get(api, headers... | import os
import requests
import re
import json
NUM_REGEX = r'\b\#?(\d\d\d\d?\d?)\b'
API_KEY = os.environ['SIFTER']
def find_ticket(number):
headers = {
'X-Sifter-Token': API_KEY
}
url = 'https://unisubs.sifterapp.com/api/projects/12298/issues?q=%s'
api = url % number
r = requests.get(a... | <commit_before>import os
import requests
import re
import json
NUM_REGEX = r'\#([0-9]+)'
API_KEY = os.environ['SIFTER']
def find_ticket(number):
headers = {
'X-Sifter-Token': API_KEY
}
url = 'https://unisubs.sifterapp.com/api/projects/12298/issues?q=%s'
api = url % number
r = requests.g... | import os
import requests
import re
import json
NUM_REGEX = r'\b\#?(\d\d\d\d?\d?)\b'
API_KEY = os.environ['SIFTER']
def find_ticket(number):
headers = {
'X-Sifter-Token': API_KEY
}
url = 'https://unisubs.sifterapp.com/api/projects/12298/issues?q=%s'
api = url % number
r = requests.get(a... | import os
import requests
import re
import json
NUM_REGEX = r'\#([0-9]+)'
API_KEY = os.environ['SIFTER']
def find_ticket(number):
headers = {
'X-Sifter-Token': API_KEY
}
url = 'https://unisubs.sifterapp.com/api/projects/12298/issues?q=%s'
api = url % number
r = requests.get(api, headers... | <commit_before>import os
import requests
import re
import json
NUM_REGEX = r'\#([0-9]+)'
API_KEY = os.environ['SIFTER']
def find_ticket(number):
headers = {
'X-Sifter-Token': API_KEY
}
url = 'https://unisubs.sifterapp.com/api/projects/12298/issues?q=%s'
api = url % number
r = requests.g... |
74eb842870424a22334fee35881f1b6c877da8e6 | scot/backend_mne.py | scot/backend_mne.py | # Released under The MIT License (MIT)
# http://opensource.org/licenses/MIT
# Copyright (c) 2013-2016 SCoT Development Team
"""Use mne-python routines as backend."""
from __future__ import absolute_import
import scipy as sp
from . import datatools
from . import backend
from . import backend_builtin as builtin
def ... | # Released under The MIT License (MIT)
# http://opensource.org/licenses/MIT
# Copyright (c) 2013-2016 SCoT Development Team
"""Use mne-python routines as backend."""
from __future__ import absolute_import
import scipy as sp
from . import datatools
from . import backend
from . import backend_builtin as builtin
def ... | Use regularized covariance in CSP by default | Use regularized covariance in CSP by default
| Python | mit | scot-dev/scot,cbrnr/scot,mbillingr/SCoT,cbrnr/scot,scot-dev/scot,cle1109/scot,cle1109/scot,mbillingr/SCoT | # Released under The MIT License (MIT)
# http://opensource.org/licenses/MIT
# Copyright (c) 2013-2016 SCoT Development Team
"""Use mne-python routines as backend."""
from __future__ import absolute_import
import scipy as sp
from . import datatools
from . import backend
from . import backend_builtin as builtin
def ... | # Released under The MIT License (MIT)
# http://opensource.org/licenses/MIT
# Copyright (c) 2013-2016 SCoT Development Team
"""Use mne-python routines as backend."""
from __future__ import absolute_import
import scipy as sp
from . import datatools
from . import backend
from . import backend_builtin as builtin
def ... | <commit_before># Released under The MIT License (MIT)
# http://opensource.org/licenses/MIT
# Copyright (c) 2013-2016 SCoT Development Team
"""Use mne-python routines as backend."""
from __future__ import absolute_import
import scipy as sp
from . import datatools
from . import backend
from . import backend_builtin as... | # Released under The MIT License (MIT)
# http://opensource.org/licenses/MIT
# Copyright (c) 2013-2016 SCoT Development Team
"""Use mne-python routines as backend."""
from __future__ import absolute_import
import scipy as sp
from . import datatools
from . import backend
from . import backend_builtin as builtin
def ... | # Released under The MIT License (MIT)
# http://opensource.org/licenses/MIT
# Copyright (c) 2013-2016 SCoT Development Team
"""Use mne-python routines as backend."""
from __future__ import absolute_import
import scipy as sp
from . import datatools
from . import backend
from . import backend_builtin as builtin
def ... | <commit_before># Released under The MIT License (MIT)
# http://opensource.org/licenses/MIT
# Copyright (c) 2013-2016 SCoT Development Team
"""Use mne-python routines as backend."""
from __future__ import absolute_import
import scipy as sp
from . import datatools
from . import backend
from . import backend_builtin as... |
322ccf3bb4197a466ac5022ae2098a82bbeab6f1 | sorting_algorithms/selection_sort.py | sorting_algorithms/selection_sort.py | def selection_sort(L):
"""
:param L: unsorted list
:return: this is a method, there is no return function. The method sorts a list using
selection sort algorithm
>>> L = [2, 7, 5, 3]
>>> selection_sort(L)
>>> L
[2, 3, 5, 7]
"""
end = len(L)
# Find the index of the smalle... | def selection_sort(L):
"""
(list) -> NoneType
Sort list from smallest to largest using selection sort algorithm
:param L: unsorted list
>>> L = [2, 7, 5, 3]
>>> selection_sort(L)
>>> L
[2, 3, 5, 7]
"""
end = len(L)
# Find the index of the smallest element in L[i:] and sw... | Improve selection sort algorithm's documentation | Improve selection sort algorithm's documentation
| Python | mit | IamGianluca/algorithms_collection,IamGianluca/algorithms | def selection_sort(L):
"""
:param L: unsorted list
:return: this is a method, there is no return function. The method sorts a list using
selection sort algorithm
>>> L = [2, 7, 5, 3]
>>> selection_sort(L)
>>> L
[2, 3, 5, 7]
"""
end = len(L)
# Find the index of the smalle... | def selection_sort(L):
"""
(list) -> NoneType
Sort list from smallest to largest using selection sort algorithm
:param L: unsorted list
>>> L = [2, 7, 5, 3]
>>> selection_sort(L)
>>> L
[2, 3, 5, 7]
"""
end = len(L)
# Find the index of the smallest element in L[i:] and sw... | <commit_before>def selection_sort(L):
"""
:param L: unsorted list
:return: this is a method, there is no return function. The method sorts a list using
selection sort algorithm
>>> L = [2, 7, 5, 3]
>>> selection_sort(L)
>>> L
[2, 3, 5, 7]
"""
end = len(L)
# Find the inde... | def selection_sort(L):
"""
(list) -> NoneType
Sort list from smallest to largest using selection sort algorithm
:param L: unsorted list
>>> L = [2, 7, 5, 3]
>>> selection_sort(L)
>>> L
[2, 3, 5, 7]
"""
end = len(L)
# Find the index of the smallest element in L[i:] and sw... | def selection_sort(L):
"""
:param L: unsorted list
:return: this is a method, there is no return function. The method sorts a list using
selection sort algorithm
>>> L = [2, 7, 5, 3]
>>> selection_sort(L)
>>> L
[2, 3, 5, 7]
"""
end = len(L)
# Find the index of the smalle... | <commit_before>def selection_sort(L):
"""
:param L: unsorted list
:return: this is a method, there is no return function. The method sorts a list using
selection sort algorithm
>>> L = [2, 7, 5, 3]
>>> selection_sort(L)
>>> L
[2, 3, 5, 7]
"""
end = len(L)
# Find the inde... |
16d009a11fdb3022189146fbf97e68d5d71cd70a | girder/test_girder/test_web_client.py | girder/test_girder/test_web_client.py | import os
import pytest
from pytest_girder.utils import runWebClientTest
@pytest.mark.parametrize('spec', (
'annotationListSpec.js',
'annotationSpec.js',
'geojsAnnotationSpec.js',
'geojsSpec.js',
'imageViewerSpec.js',
'largeImageSpec.js'
))
def testWebClient(fsAssetstore, db, spec):
spec =... | import os
import pytest
from pytest_girder.web_client import runWebClientTest
@pytest.mark.parametrize('spec', (
'annotationListSpec.js',
'annotationSpec.js',
'geojsAnnotationSpec.js',
'geojsSpec.js',
'imageViewerSpec.js',
'largeImageSpec.js'
))
def testWebClient(fsAssetstore, db, spec):
s... | Use new location for web client test util | Use new location for web client test util
| Python | apache-2.0 | girder/large_image,DigitalSlideArchive/large_image,DigitalSlideArchive/large_image,girder/large_image,girder/large_image,DigitalSlideArchive/large_image | import os
import pytest
from pytest_girder.utils import runWebClientTest
@pytest.mark.parametrize('spec', (
'annotationListSpec.js',
'annotationSpec.js',
'geojsAnnotationSpec.js',
'geojsSpec.js',
'imageViewerSpec.js',
'largeImageSpec.js'
))
def testWebClient(fsAssetstore, db, spec):
spec =... | import os
import pytest
from pytest_girder.web_client import runWebClientTest
@pytest.mark.parametrize('spec', (
'annotationListSpec.js',
'annotationSpec.js',
'geojsAnnotationSpec.js',
'geojsSpec.js',
'imageViewerSpec.js',
'largeImageSpec.js'
))
def testWebClient(fsAssetstore, db, spec):
s... | <commit_before>import os
import pytest
from pytest_girder.utils import runWebClientTest
@pytest.mark.parametrize('spec', (
'annotationListSpec.js',
'annotationSpec.js',
'geojsAnnotationSpec.js',
'geojsSpec.js',
'imageViewerSpec.js',
'largeImageSpec.js'
))
def testWebClient(fsAssetstore, db, sp... | import os
import pytest
from pytest_girder.web_client import runWebClientTest
@pytest.mark.parametrize('spec', (
'annotationListSpec.js',
'annotationSpec.js',
'geojsAnnotationSpec.js',
'geojsSpec.js',
'imageViewerSpec.js',
'largeImageSpec.js'
))
def testWebClient(fsAssetstore, db, spec):
s... | import os
import pytest
from pytest_girder.utils import runWebClientTest
@pytest.mark.parametrize('spec', (
'annotationListSpec.js',
'annotationSpec.js',
'geojsAnnotationSpec.js',
'geojsSpec.js',
'imageViewerSpec.js',
'largeImageSpec.js'
))
def testWebClient(fsAssetstore, db, spec):
spec =... | <commit_before>import os
import pytest
from pytest_girder.utils import runWebClientTest
@pytest.mark.parametrize('spec', (
'annotationListSpec.js',
'annotationSpec.js',
'geojsAnnotationSpec.js',
'geojsSpec.js',
'imageViewerSpec.js',
'largeImageSpec.js'
))
def testWebClient(fsAssetstore, db, sp... |
21af090f312c2381526050fb4c45eb14cfb91eeb | ureport/stats/migrations/0017_better_indexes.py | ureport/stats/migrations/0017_better_indexes.py | # Generated by Django 3.2.6 on 2021-09-27 17:49
from django.db import migrations
INDEX_POLLSTATS_ORG_RESULT_SQL = """
CREATE INDEX IF NOT EXISTS stats_pollstats_org_result on stats_pollstats (org_id, flow_result_id) WHERE flow_result_id IS NOT NULL;
"""
INDEX_POLLSTATS_ORG_QST_RST_CAT_SQL = """
CREATE INDEX IF NOT ... | # Generated by Django 3.2.6 on 2021-09-27 17:49
from django.db import migrations
INDEX_POLLSTATS_ORG_RESULT_SQL = """
CREATE INDEX IF NOT EXISTS stats_pollstats_org_result on stats_pollstats (org_id, flow_result_id) WHERE flow_result_id IS NOT NULL;
"""
INDEX_POLLSTATS_ORG_QST_RST_CAT_SQL = """
CREATE INDEX IF NOT ... | Add empty reverse migration to be able to unapply the migration in reverse | Add empty reverse migration to be able to unapply the migration in reverse
| Python | agpl-3.0 | Ilhasoft/ureport,rapidpro/ureport,rapidpro/ureport,Ilhasoft/ureport,Ilhasoft/ureport,rapidpro/ureport,Ilhasoft/ureport,rapidpro/ureport | # Generated by Django 3.2.6 on 2021-09-27 17:49
from django.db import migrations
INDEX_POLLSTATS_ORG_RESULT_SQL = """
CREATE INDEX IF NOT EXISTS stats_pollstats_org_result on stats_pollstats (org_id, flow_result_id) WHERE flow_result_id IS NOT NULL;
"""
INDEX_POLLSTATS_ORG_QST_RST_CAT_SQL = """
CREATE INDEX IF NOT ... | # Generated by Django 3.2.6 on 2021-09-27 17:49
from django.db import migrations
INDEX_POLLSTATS_ORG_RESULT_SQL = """
CREATE INDEX IF NOT EXISTS stats_pollstats_org_result on stats_pollstats (org_id, flow_result_id) WHERE flow_result_id IS NOT NULL;
"""
INDEX_POLLSTATS_ORG_QST_RST_CAT_SQL = """
CREATE INDEX IF NOT ... | <commit_before># Generated by Django 3.2.6 on 2021-09-27 17:49
from django.db import migrations
INDEX_POLLSTATS_ORG_RESULT_SQL = """
CREATE INDEX IF NOT EXISTS stats_pollstats_org_result on stats_pollstats (org_id, flow_result_id) WHERE flow_result_id IS NOT NULL;
"""
INDEX_POLLSTATS_ORG_QST_RST_CAT_SQL = """
CREAT... | # Generated by Django 3.2.6 on 2021-09-27 17:49
from django.db import migrations
INDEX_POLLSTATS_ORG_RESULT_SQL = """
CREATE INDEX IF NOT EXISTS stats_pollstats_org_result on stats_pollstats (org_id, flow_result_id) WHERE flow_result_id IS NOT NULL;
"""
INDEX_POLLSTATS_ORG_QST_RST_CAT_SQL = """
CREATE INDEX IF NOT ... | # Generated by Django 3.2.6 on 2021-09-27 17:49
from django.db import migrations
INDEX_POLLSTATS_ORG_RESULT_SQL = """
CREATE INDEX IF NOT EXISTS stats_pollstats_org_result on stats_pollstats (org_id, flow_result_id) WHERE flow_result_id IS NOT NULL;
"""
INDEX_POLLSTATS_ORG_QST_RST_CAT_SQL = """
CREATE INDEX IF NOT ... | <commit_before># Generated by Django 3.2.6 on 2021-09-27 17:49
from django.db import migrations
INDEX_POLLSTATS_ORG_RESULT_SQL = """
CREATE INDEX IF NOT EXISTS stats_pollstats_org_result on stats_pollstats (org_id, flow_result_id) WHERE flow_result_id IS NOT NULL;
"""
INDEX_POLLSTATS_ORG_QST_RST_CAT_SQL = """
CREAT... |
ac30f52aff51dce892e79ce773e84f2458635d1c | digestive/entropy.py | digestive/entropy.py | from collections import Counter
from math import log2
from digestive import Sink
# TODO: stash intermediate histograms in multiple Counters?
# TODO: output as a spark
# TODO: output as plot
class Entropy(Sink):
def __init__(self):
super().__init__('entropy')
self.length = 0
self.counter =... | from collections import Counter
from math import log2
from digestive import Sink
class Entropy(Sink):
def __init__(self):
super().__init__('entropy')
self.length = 0
self.counter = Counter()
def update(self, data):
self.length += len(data)
self.counter.update(data)
... | Remove TODO's converted to issues | Remove TODO's converted to issues
| Python | isc | akaIDIOT/Digestive | from collections import Counter
from math import log2
from digestive import Sink
# TODO: stash intermediate histograms in multiple Counters?
# TODO: output as a spark
# TODO: output as plot
class Entropy(Sink):
def __init__(self):
super().__init__('entropy')
self.length = 0
self.counter =... | from collections import Counter
from math import log2
from digestive import Sink
class Entropy(Sink):
def __init__(self):
super().__init__('entropy')
self.length = 0
self.counter = Counter()
def update(self, data):
self.length += len(data)
self.counter.update(data)
... | <commit_before>from collections import Counter
from math import log2
from digestive import Sink
# TODO: stash intermediate histograms in multiple Counters?
# TODO: output as a spark
# TODO: output as plot
class Entropy(Sink):
def __init__(self):
super().__init__('entropy')
self.length = 0
... | from collections import Counter
from math import log2
from digestive import Sink
class Entropy(Sink):
def __init__(self):
super().__init__('entropy')
self.length = 0
self.counter = Counter()
def update(self, data):
self.length += len(data)
self.counter.update(data)
... | from collections import Counter
from math import log2
from digestive import Sink
# TODO: stash intermediate histograms in multiple Counters?
# TODO: output as a spark
# TODO: output as plot
class Entropy(Sink):
def __init__(self):
super().__init__('entropy')
self.length = 0
self.counter =... | <commit_before>from collections import Counter
from math import log2
from digestive import Sink
# TODO: stash intermediate histograms in multiple Counters?
# TODO: output as a spark
# TODO: output as plot
class Entropy(Sink):
def __init__(self):
super().__init__('entropy')
self.length = 0
... |
bada6787aa111feac1df32952a8732400632f81d | doc/examples/plot_pyramid.py | doc/examples/plot_pyramid.py | """
====================
Build image pyramids
====================
The `build_gaussian_pyramid` function takes an image and yields successive
images shrunk by a constant scale factor. Image pyramids are often used, e.g.,
to implement algorithms for denoising, texture discrimination, and scale-
invariant detection.
"""... | """
====================
Build image pyramids
====================
The `pyramid_gaussian` function takes an image and yields successive images
shrunk by a constant scale factor. Image pyramids are often used, e.g., to
implement algorithms for denoising, texture discrimination, and scale- invariant
detection.
"""
imp... | Update name of pyramid function in pyramid example description | Update name of pyramid function in pyramid example description
| Python | bsd-3-clause | blink1073/scikit-image,warmspringwinds/scikit-image,keflavich/scikit-image,almarklein/scikit-image,blink1073/scikit-image,chintak/scikit-image,robintw/scikit-image,ajaybhat/scikit-image,ClinicalGraphics/scikit-image,SamHames/scikit-image,ofgulban/scikit-image,newville/scikit-image,emon10005/scikit-image,michaelaye/scik... | """
====================
Build image pyramids
====================
The `build_gaussian_pyramid` function takes an image and yields successive
images shrunk by a constant scale factor. Image pyramids are often used, e.g.,
to implement algorithms for denoising, texture discrimination, and scale-
invariant detection.
"""... | """
====================
Build image pyramids
====================
The `pyramid_gaussian` function takes an image and yields successive images
shrunk by a constant scale factor. Image pyramids are often used, e.g., to
implement algorithms for denoising, texture discrimination, and scale- invariant
detection.
"""
imp... | <commit_before>"""
====================
Build image pyramids
====================
The `build_gaussian_pyramid` function takes an image and yields successive
images shrunk by a constant scale factor. Image pyramids are often used, e.g.,
to implement algorithms for denoising, texture discrimination, and scale-
invariant... | """
====================
Build image pyramids
====================
The `pyramid_gaussian` function takes an image and yields successive images
shrunk by a constant scale factor. Image pyramids are often used, e.g., to
implement algorithms for denoising, texture discrimination, and scale- invariant
detection.
"""
imp... | """
====================
Build image pyramids
====================
The `build_gaussian_pyramid` function takes an image and yields successive
images shrunk by a constant scale factor. Image pyramids are often used, e.g.,
to implement algorithms for denoising, texture discrimination, and scale-
invariant detection.
"""... | <commit_before>"""
====================
Build image pyramids
====================
The `build_gaussian_pyramid` function takes an image and yields successive
images shrunk by a constant scale factor. Image pyramids are often used, e.g.,
to implement algorithms for denoising, texture discrimination, and scale-
invariant... |
8f1b473e2dab982e989e9a041aa14e31050d2f4b | scripts/promote_orga.py | scripts/promote_orga.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Promote a user to organizer status.
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import click
from byceps.database import db
from bootstrap.helpers import promote_orga
from bootstrap.util import app_context, get_con... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Promote a user to organizer status.
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import click
from byceps.services.orga import service as orga_service
from bootstrap.util import app_context, get_config_name_from_env... | Use service in script to promote a user to organizer | Use service in script to promote a user to organizer
| Python | bsd-3-clause | m-ober/byceps,m-ober/byceps,homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Promote a user to organizer status.
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import click
from byceps.database import db
from bootstrap.helpers import promote_orga
from bootstrap.util import app_context, get_con... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Promote a user to organizer status.
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import click
from byceps.services.orga import service as orga_service
from bootstrap.util import app_context, get_config_name_from_env... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Promote a user to organizer status.
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import click
from byceps.database import db
from bootstrap.helpers import promote_orga
from bootstrap.util import app_c... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Promote a user to organizer status.
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import click
from byceps.services.orga import service as orga_service
from bootstrap.util import app_context, get_config_name_from_env... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Promote a user to organizer status.
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import click
from byceps.database import db
from bootstrap.helpers import promote_orga
from bootstrap.util import app_context, get_con... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Promote a user to organizer status.
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import click
from byceps.database import db
from bootstrap.helpers import promote_orga
from bootstrap.util import app_c... |
499ad0cb7147f705ebf83604b9e0873b5b0edb61 | api/rest/scrollingpaginator.py | api/rest/scrollingpaginator.py | from rest_framework import pagination
from amcat.tools import amcates
from rest_framework.response import Response
from django.core.urlresolvers import reverse
from rest_framework.utils.urls import replace_query_param
class ScrollingPaginator(pagination.BasePagination):
def paginate_queryset(self, queryset, requ... | from rest_framework import pagination
from amcat.tools import amcates
from rest_framework.response import Response
from django.core.urlresolvers import reverse
from rest_framework.utils.urls import replace_query_param
class ScrollingPaginator(pagination.BasePagination):
def paginate_queryset(self, queryset, requ... | Allow set scroll timeout param | Allow set scroll timeout param
| Python | agpl-3.0 | amcat/amcat,amcat/amcat,amcat/amcat,amcat/amcat,amcat/amcat,amcat/amcat | from rest_framework import pagination
from amcat.tools import amcates
from rest_framework.response import Response
from django.core.urlresolvers import reverse
from rest_framework.utils.urls import replace_query_param
class ScrollingPaginator(pagination.BasePagination):
def paginate_queryset(self, queryset, requ... | from rest_framework import pagination
from amcat.tools import amcates
from rest_framework.response import Response
from django.core.urlresolvers import reverse
from rest_framework.utils.urls import replace_query_param
class ScrollingPaginator(pagination.BasePagination):
def paginate_queryset(self, queryset, requ... | <commit_before>from rest_framework import pagination
from amcat.tools import amcates
from rest_framework.response import Response
from django.core.urlresolvers import reverse
from rest_framework.utils.urls import replace_query_param
class ScrollingPaginator(pagination.BasePagination):
def paginate_queryset(self,... | from rest_framework import pagination
from amcat.tools import amcates
from rest_framework.response import Response
from django.core.urlresolvers import reverse
from rest_framework.utils.urls import replace_query_param
class ScrollingPaginator(pagination.BasePagination):
def paginate_queryset(self, queryset, requ... | from rest_framework import pagination
from amcat.tools import amcates
from rest_framework.response import Response
from django.core.urlresolvers import reverse
from rest_framework.utils.urls import replace_query_param
class ScrollingPaginator(pagination.BasePagination):
def paginate_queryset(self, queryset, requ... | <commit_before>from rest_framework import pagination
from amcat.tools import amcates
from rest_framework.response import Response
from django.core.urlresolvers import reverse
from rest_framework.utils.urls import replace_query_param
class ScrollingPaginator(pagination.BasePagination):
def paginate_queryset(self,... |
99c00b309e89ceb32528c217e308b91f94a56e2b | cogs/command_log.py | cogs/command_log.py | import logging
class CommandLog:
"""A simple cog to log commands executed."""
def __init__(self):
self.log = logging.getLogger('liara.command_log')
async def on_command(self, ctx):
self.log.info('{0.author} ({0.author.id}) executed command "{0.command}" in {0.guild}'.format(ctx))
def se... | import logging
class CommandLog:
"""A simple cog to log commands executed."""
def __init__(self):
self.log = logging.getLogger('liara.command_log')
async def on_command(self, ctx):
kwargs = ', '.join(['{}={}'.format(k, repr(v)) for k, v in ctx.kwargs.items()])
args = 'with argumen... | Make the command log more detailed | Make the command log more detailed
| Python | mit | Thessia/Liara | import logging
class CommandLog:
"""A simple cog to log commands executed."""
def __init__(self):
self.log = logging.getLogger('liara.command_log')
async def on_command(self, ctx):
self.log.info('{0.author} ({0.author.id}) executed command "{0.command}" in {0.guild}'.format(ctx))
def se... | import logging
class CommandLog:
"""A simple cog to log commands executed."""
def __init__(self):
self.log = logging.getLogger('liara.command_log')
async def on_command(self, ctx):
kwargs = ', '.join(['{}={}'.format(k, repr(v)) for k, v in ctx.kwargs.items()])
args = 'with argumen... | <commit_before>import logging
class CommandLog:
"""A simple cog to log commands executed."""
def __init__(self):
self.log = logging.getLogger('liara.command_log')
async def on_command(self, ctx):
self.log.info('{0.author} ({0.author.id}) executed command "{0.command}" in {0.guild}'.format... | import logging
class CommandLog:
"""A simple cog to log commands executed."""
def __init__(self):
self.log = logging.getLogger('liara.command_log')
async def on_command(self, ctx):
kwargs = ', '.join(['{}={}'.format(k, repr(v)) for k, v in ctx.kwargs.items()])
args = 'with argumen... | import logging
class CommandLog:
"""A simple cog to log commands executed."""
def __init__(self):
self.log = logging.getLogger('liara.command_log')
async def on_command(self, ctx):
self.log.info('{0.author} ({0.author.id}) executed command "{0.command}" in {0.guild}'.format(ctx))
def se... | <commit_before>import logging
class CommandLog:
"""A simple cog to log commands executed."""
def __init__(self):
self.log = logging.getLogger('liara.command_log')
async def on_command(self, ctx):
self.log.info('{0.author} ({0.author.id}) executed command "{0.command}" in {0.guild}'.format... |
5a319a118868336cdbca72808b1bf4f6929ce8de | tests/test_tools.py | tests/test_tools.py | # -*- coding: utf-8 -*-
import unittest
from pythainlp.tools import (
get_full_data_path,
get_pythainlp_data_path,
get_pythainlp_path,
)
class TestToolsPackage(unittest.TestCase):
def test_path(self):
data_filename = "ttc_freq.txt"
self.assertTrue(
get_full_data_path(data... | # -*- coding: utf-8 -*-
import unittest
from pythainlp.tools import (
get_full_data_path,
get_pythainlp_data_path,
get_pythainlp_path,
)
class TestToolsPackage(unittest.TestCase):
def test_path(self):
data_filename = "ttc_freq.txt"
self.assertTrue(
get_full_data_path(data... | Fix test case for tools.path | Fix test case for tools.path
| Python | apache-2.0 | PyThaiNLP/pythainlp | # -*- coding: utf-8 -*-
import unittest
from pythainlp.tools import (
get_full_data_path,
get_pythainlp_data_path,
get_pythainlp_path,
)
class TestToolsPackage(unittest.TestCase):
def test_path(self):
data_filename = "ttc_freq.txt"
self.assertTrue(
get_full_data_path(data... | # -*- coding: utf-8 -*-
import unittest
from pythainlp.tools import (
get_full_data_path,
get_pythainlp_data_path,
get_pythainlp_path,
)
class TestToolsPackage(unittest.TestCase):
def test_path(self):
data_filename = "ttc_freq.txt"
self.assertTrue(
get_full_data_path(data... | <commit_before># -*- coding: utf-8 -*-
import unittest
from pythainlp.tools import (
get_full_data_path,
get_pythainlp_data_path,
get_pythainlp_path,
)
class TestToolsPackage(unittest.TestCase):
def test_path(self):
data_filename = "ttc_freq.txt"
self.assertTrue(
get_full... | # -*- coding: utf-8 -*-
import unittest
from pythainlp.tools import (
get_full_data_path,
get_pythainlp_data_path,
get_pythainlp_path,
)
class TestToolsPackage(unittest.TestCase):
def test_path(self):
data_filename = "ttc_freq.txt"
self.assertTrue(
get_full_data_path(data... | # -*- coding: utf-8 -*-
import unittest
from pythainlp.tools import (
get_full_data_path,
get_pythainlp_data_path,
get_pythainlp_path,
)
class TestToolsPackage(unittest.TestCase):
def test_path(self):
data_filename = "ttc_freq.txt"
self.assertTrue(
get_full_data_path(data... | <commit_before># -*- coding: utf-8 -*-
import unittest
from pythainlp.tools import (
get_full_data_path,
get_pythainlp_data_path,
get_pythainlp_path,
)
class TestToolsPackage(unittest.TestCase):
def test_path(self):
data_filename = "ttc_freq.txt"
self.assertTrue(
get_full... |
ebaca4f2572d7db9d9bc912f209cd9027750b3a7 | tingbot/__init__.py | tingbot/__init__.py | try:
import pygame
except ImportError:
print 'Failed to import pygame'
print '-----------------------'
print ''
print 'tingbot-python requires pygame. Please download and install pygame 1.9.1'
print 'or later from http://www.pygame.org/download.shtml'
print ''
print "If you're using a vi... | try:
import pygame
except ImportError:
print 'Failed to import pygame'
print '-----------------------'
print ''
print 'tingbot-python requires pygame. Please download and install pygame 1.9.1'
print 'or later from http://www.pygame.org/download.shtml'
print ''
print "If you're using a vi... | Create reference to app in module | Create reference to app in module
| Python | bsd-2-clause | furbrain/tingbot-python | try:
import pygame
except ImportError:
print 'Failed to import pygame'
print '-----------------------'
print ''
print 'tingbot-python requires pygame. Please download and install pygame 1.9.1'
print 'or later from http://www.pygame.org/download.shtml'
print ''
print "If you're using a vi... | try:
import pygame
except ImportError:
print 'Failed to import pygame'
print '-----------------------'
print ''
print 'tingbot-python requires pygame. Please download and install pygame 1.9.1'
print 'or later from http://www.pygame.org/download.shtml'
print ''
print "If you're using a vi... | <commit_before>try:
import pygame
except ImportError:
print 'Failed to import pygame'
print '-----------------------'
print ''
print 'tingbot-python requires pygame. Please download and install pygame 1.9.1'
print 'or later from http://www.pygame.org/download.shtml'
print ''
print "If yo... | try:
import pygame
except ImportError:
print 'Failed to import pygame'
print '-----------------------'
print ''
print 'tingbot-python requires pygame. Please download and install pygame 1.9.1'
print 'or later from http://www.pygame.org/download.shtml'
print ''
print "If you're using a vi... | try:
import pygame
except ImportError:
print 'Failed to import pygame'
print '-----------------------'
print ''
print 'tingbot-python requires pygame. Please download and install pygame 1.9.1'
print 'or later from http://www.pygame.org/download.shtml'
print ''
print "If you're using a vi... | <commit_before>try:
import pygame
except ImportError:
print 'Failed to import pygame'
print '-----------------------'
print ''
print 'tingbot-python requires pygame. Please download and install pygame 1.9.1'
print 'or later from http://www.pygame.org/download.shtml'
print ''
print "If yo... |
a7d010d591761a459320e904045140ec21670439 | src/oscar/templatetags/currency_filters.py | src/oscar/templatetags/currency_filters.py | from decimal import Decimal as D
from decimal import InvalidOperation
from babel.numbers import format_currency
from django import template
from django.conf import settings
from django.utils.translation import get_language, to_locale
register = template.Library()
@register.filter(name='currency')
def currency(value... | from decimal import Decimal as D
from decimal import InvalidOperation
from babel.numbers import format_currency
from django import template
from django.conf import settings
from django.utils.translation import get_language, to_locale
register = template.Library()
@register.filter(name='currency')
def currency(value... | Support currency digits and currency suffix. | Support currency digits and currency suffix.
| Python | bsd-3-clause | michaelkuty/django-oscar,michaelkuty/django-oscar,michaelkuty/django-oscar,michaelkuty/django-oscar | from decimal import Decimal as D
from decimal import InvalidOperation
from babel.numbers import format_currency
from django import template
from django.conf import settings
from django.utils.translation import get_language, to_locale
register = template.Library()
@register.filter(name='currency')
def currency(value... | from decimal import Decimal as D
from decimal import InvalidOperation
from babel.numbers import format_currency
from django import template
from django.conf import settings
from django.utils.translation import get_language, to_locale
register = template.Library()
@register.filter(name='currency')
def currency(value... | <commit_before>from decimal import Decimal as D
from decimal import InvalidOperation
from babel.numbers import format_currency
from django import template
from django.conf import settings
from django.utils.translation import get_language, to_locale
register = template.Library()
@register.filter(name='currency')
def... | from decimal import Decimal as D
from decimal import InvalidOperation
from babel.numbers import format_currency
from django import template
from django.conf import settings
from django.utils.translation import get_language, to_locale
register = template.Library()
@register.filter(name='currency')
def currency(value... | from decimal import Decimal as D
from decimal import InvalidOperation
from babel.numbers import format_currency
from django import template
from django.conf import settings
from django.utils.translation import get_language, to_locale
register = template.Library()
@register.filter(name='currency')
def currency(value... | <commit_before>from decimal import Decimal as D
from decimal import InvalidOperation
from babel.numbers import format_currency
from django import template
from django.conf import settings
from django.utils.translation import get_language, to_locale
register = template.Library()
@register.filter(name='currency')
def... |
6dbefe8a62ae375b487c7e21340aba5b81eaeb7f | django_git/management/commands/pull_oldest.py | django_git/management/commands/pull_oldest.py | import os
import traceback
from django.utils import timezone
from django_git.management.commands.git_pull_utils.git_folder_enum import enum_git_repo
from django_git.management.commands.git_pull_utils.git_synchronizer import GitSynchronizer
from djangoautoconf.cmd_handler_base.msg_process_cmd_base import DjangoCmdBase... | import os
import traceback
from django.utils import timezone
from django_git.management.commands.git_pull_utils.git_folder_enum import enum_git_repo
from django_git.management.commands.git_pull_utils.git_synchronizer import GitSynchronizer
from djangoautoconf.cmd_handler_base.msg_process_cmd_base import DjangoCmdBase... | Print message for pull success. | Print message for pull success.
| Python | bsd-3-clause | weijia/django-git,weijia/django-git | import os
import traceback
from django.utils import timezone
from django_git.management.commands.git_pull_utils.git_folder_enum import enum_git_repo
from django_git.management.commands.git_pull_utils.git_synchronizer import GitSynchronizer
from djangoautoconf.cmd_handler_base.msg_process_cmd_base import DjangoCmdBase... | import os
import traceback
from django.utils import timezone
from django_git.management.commands.git_pull_utils.git_folder_enum import enum_git_repo
from django_git.management.commands.git_pull_utils.git_synchronizer import GitSynchronizer
from djangoautoconf.cmd_handler_base.msg_process_cmd_base import DjangoCmdBase... | <commit_before>import os
import traceback
from django.utils import timezone
from django_git.management.commands.git_pull_utils.git_folder_enum import enum_git_repo
from django_git.management.commands.git_pull_utils.git_synchronizer import GitSynchronizer
from djangoautoconf.cmd_handler_base.msg_process_cmd_base impor... | import os
import traceback
from django.utils import timezone
from django_git.management.commands.git_pull_utils.git_folder_enum import enum_git_repo
from django_git.management.commands.git_pull_utils.git_synchronizer import GitSynchronizer
from djangoautoconf.cmd_handler_base.msg_process_cmd_base import DjangoCmdBase... | import os
import traceback
from django.utils import timezone
from django_git.management.commands.git_pull_utils.git_folder_enum import enum_git_repo
from django_git.management.commands.git_pull_utils.git_synchronizer import GitSynchronizer
from djangoautoconf.cmd_handler_base.msg_process_cmd_base import DjangoCmdBase... | <commit_before>import os
import traceback
from django.utils import timezone
from django_git.management.commands.git_pull_utils.git_folder_enum import enum_git_repo
from django_git.management.commands.git_pull_utils.git_synchronizer import GitSynchronizer
from djangoautoconf.cmd_handler_base.msg_process_cmd_base impor... |
fcf52a1d427d2e89031480f747374860f64c45ff | constant_listener/pyspeechTest.py | constant_listener/pyspeechTest.py | from pyspeech import best_speech_result
import unittest
from pyaudio import PyAudio
import Queue
class PyspeechTest(unittest.TestCase):
def setUp(self):
self.p = PyAudio()
def test_google_stt(self):
good_morning = open('example_wavs/good_morning.wav', 'rb')
output = best_speech_result(self.p, good_mor... | from pyspeech import best_speech_result
import unittest
from pyaudio import PyAudio
import Queue
class PyspeechTest(unittest.TestCase):
def setUp(self):
self.p = PyAudio()
def test_google_stt(self):
good_morning = open('example_wavs/good_morning.wav', 'rb')
output = best_speech_result(self.p, good_mor... | Add tests for Wit STT | Add tests for Wit STT
| Python | mit | MattWis/constant_listener | from pyspeech import best_speech_result
import unittest
from pyaudio import PyAudio
import Queue
class PyspeechTest(unittest.TestCase):
def setUp(self):
self.p = PyAudio()
def test_google_stt(self):
good_morning = open('example_wavs/good_morning.wav', 'rb')
output = best_speech_result(self.p, good_mor... | from pyspeech import best_speech_result
import unittest
from pyaudio import PyAudio
import Queue
class PyspeechTest(unittest.TestCase):
def setUp(self):
self.p = PyAudio()
def test_google_stt(self):
good_morning = open('example_wavs/good_morning.wav', 'rb')
output = best_speech_result(self.p, good_mor... | <commit_before>from pyspeech import best_speech_result
import unittest
from pyaudio import PyAudio
import Queue
class PyspeechTest(unittest.TestCase):
def setUp(self):
self.p = PyAudio()
def test_google_stt(self):
good_morning = open('example_wavs/good_morning.wav', 'rb')
output = best_speech_result(s... | from pyspeech import best_speech_result
import unittest
from pyaudio import PyAudio
import Queue
class PyspeechTest(unittest.TestCase):
def setUp(self):
self.p = PyAudio()
def test_google_stt(self):
good_morning = open('example_wavs/good_morning.wav', 'rb')
output = best_speech_result(self.p, good_mor... | from pyspeech import best_speech_result
import unittest
from pyaudio import PyAudio
import Queue
class PyspeechTest(unittest.TestCase):
def setUp(self):
self.p = PyAudio()
def test_google_stt(self):
good_morning = open('example_wavs/good_morning.wav', 'rb')
output = best_speech_result(self.p, good_mor... | <commit_before>from pyspeech import best_speech_result
import unittest
from pyaudio import PyAudio
import Queue
class PyspeechTest(unittest.TestCase):
def setUp(self):
self.p = PyAudio()
def test_google_stt(self):
good_morning = open('example_wavs/good_morning.wav', 'rb')
output = best_speech_result(s... |
5a1edb15cac470f392ccb4447b81cc99e8af2a68 | robinette/server.py | robinette/server.py | #!/usr/bin/env python
from irc import irc
from xmlrpc.server import AsyncXMLRPCServer
if __name__ == '__main__':
server = AsyncXMLRPCServer(('localhost', 8000), allow_none=True)
server.add_handler(irc)
try:
server.serve_forever()
except KeyboardInterrupt:
print 'Exiting'
| #!/usr/bin/env python
from irc import irc
from xmlrpc.server import AsyncXMLRPCServer
if __name__ == '__main__':
server = AsyncXMLRPCServer(('localhost', 8000), allow_none=True)
server.add_handler(irc)
print 'Running on %s:%s' % map(str, server.server_address)
try:
server.serve_forever()
... | Print where we're running at | Print where we're running at
| Python | mit | mgracik/robinette | #!/usr/bin/env python
from irc import irc
from xmlrpc.server import AsyncXMLRPCServer
if __name__ == '__main__':
server = AsyncXMLRPCServer(('localhost', 8000), allow_none=True)
server.add_handler(irc)
try:
server.serve_forever()
except KeyboardInterrupt:
print 'Exiting'
Print where w... | #!/usr/bin/env python
from irc import irc
from xmlrpc.server import AsyncXMLRPCServer
if __name__ == '__main__':
server = AsyncXMLRPCServer(('localhost', 8000), allow_none=True)
server.add_handler(irc)
print 'Running on %s:%s' % map(str, server.server_address)
try:
server.serve_forever()
... | <commit_before>#!/usr/bin/env python
from irc import irc
from xmlrpc.server import AsyncXMLRPCServer
if __name__ == '__main__':
server = AsyncXMLRPCServer(('localhost', 8000), allow_none=True)
server.add_handler(irc)
try:
server.serve_forever()
except KeyboardInterrupt:
print 'Exiting... | #!/usr/bin/env python
from irc import irc
from xmlrpc.server import AsyncXMLRPCServer
if __name__ == '__main__':
server = AsyncXMLRPCServer(('localhost', 8000), allow_none=True)
server.add_handler(irc)
print 'Running on %s:%s' % map(str, server.server_address)
try:
server.serve_forever()
... | #!/usr/bin/env python
from irc import irc
from xmlrpc.server import AsyncXMLRPCServer
if __name__ == '__main__':
server = AsyncXMLRPCServer(('localhost', 8000), allow_none=True)
server.add_handler(irc)
try:
server.serve_forever()
except KeyboardInterrupt:
print 'Exiting'
Print where w... | <commit_before>#!/usr/bin/env python
from irc import irc
from xmlrpc.server import AsyncXMLRPCServer
if __name__ == '__main__':
server = AsyncXMLRPCServer(('localhost', 8000), allow_none=True)
server.add_handler(irc)
try:
server.serve_forever()
except KeyboardInterrupt:
print 'Exiting... |
bd78472c14ce9ed487a563a958082b356e0b7c79 | src/epiweb/apps/reminder/admin.py | src/epiweb/apps/reminder/admin.py | from django.contrib import admin
from epiweb.apps.reminder.models import Reminder
class ReminderAdmin(admin.ModelAdmin):
list_display = ('user', 'wday', 'active',
'last_reminder', 'next_reminder')
admin.site.register(Reminder, ReminderAdmin)
| from django.contrib import admin
from epiweb.apps.reminder.models import Reminder
def make_active(modeladmin, request, queryset):
queryset.update(active=True)
make_active.short_description = 'Make selected reminders active'
def make_inactive(modeladmin, request, queryset):
queryset.update(active=False)
make_... | Add actions to make reminders active or inactive | Add actions to make reminders active or inactive
| Python | agpl-3.0 | ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website | from django.contrib import admin
from epiweb.apps.reminder.models import Reminder
class ReminderAdmin(admin.ModelAdmin):
list_display = ('user', 'wday', 'active',
'last_reminder', 'next_reminder')
admin.site.register(Reminder, ReminderAdmin)
Add actions to make reminders active or inactive | from django.contrib import admin
from epiweb.apps.reminder.models import Reminder
def make_active(modeladmin, request, queryset):
queryset.update(active=True)
make_active.short_description = 'Make selected reminders active'
def make_inactive(modeladmin, request, queryset):
queryset.update(active=False)
make_... | <commit_before>from django.contrib import admin
from epiweb.apps.reminder.models import Reminder
class ReminderAdmin(admin.ModelAdmin):
list_display = ('user', 'wday', 'active',
'last_reminder', 'next_reminder')
admin.site.register(Reminder, ReminderAdmin)
<commit_msg>Add actions to make re... | from django.contrib import admin
from epiweb.apps.reminder.models import Reminder
def make_active(modeladmin, request, queryset):
queryset.update(active=True)
make_active.short_description = 'Make selected reminders active'
def make_inactive(modeladmin, request, queryset):
queryset.update(active=False)
make_... | from django.contrib import admin
from epiweb.apps.reminder.models import Reminder
class ReminderAdmin(admin.ModelAdmin):
list_display = ('user', 'wday', 'active',
'last_reminder', 'next_reminder')
admin.site.register(Reminder, ReminderAdmin)
Add actions to make reminders active or inactivef... | <commit_before>from django.contrib import admin
from epiweb.apps.reminder.models import Reminder
class ReminderAdmin(admin.ModelAdmin):
list_display = ('user', 'wday', 'active',
'last_reminder', 'next_reminder')
admin.site.register(Reminder, ReminderAdmin)
<commit_msg>Add actions to make re... |
65428583f066c887d99f885a4fc516f6a5f83f17 | src/livestreamer/plugins/rtlxl.py | src/livestreamer/plugins/rtlxl.py | import re
from livestreamer.plugin import Plugin
from livestreamer.plugin.api import http, validate
from livestreamer.stream import HDSStream, HLSStream, RTMPStream
_url_re = re.compile("""http(?:s)?://(?:\w+\.)?rtlxl.nl/#!/(?:.*)/(?P<uuid>.*?)\Z""", re.IGNORECASE)
class rtlxl(Plugin):
@classmethod
... | import re
from livestreamer.plugin import Plugin
from livestreamer.plugin.api import http, validate
from livestreamer.stream import HDSStream, HLSStream, RTMPStream
_url_re = re.compile("""http(?:s)?://(?:\w+\.)?rtlxl.nl/#!/(?:.*)/(?P<uuid>.*?)\Z""", re.IGNORECASE)
class rtlxl(Plugin):
@classmethod
... | Remove spurious print statement that made the plugin incompatible with python 3. | Remove spurious print statement that made the plugin incompatible with python 3.
| Python | bsd-2-clause | sbstp/streamlink,mmetak/streamlink,wlerin/streamlink,sbstp/streamlink,bastimeyer/streamlink,chhe/streamlink,ethanhlc/streamlink,gravyboat/streamlink,back-to/streamlink,mmetak/streamlink,streamlink/streamlink,fishscene/streamlink,back-to/streamlink,melmorabity/streamlink,gravyboat/streamlink,fishscene/streamlink,chhe/st... | import re
from livestreamer.plugin import Plugin
from livestreamer.plugin.api import http, validate
from livestreamer.stream import HDSStream, HLSStream, RTMPStream
_url_re = re.compile("""http(?:s)?://(?:\w+\.)?rtlxl.nl/#!/(?:.*)/(?P<uuid>.*?)\Z""", re.IGNORECASE)
class rtlxl(Plugin):
@classmethod
... | import re
from livestreamer.plugin import Plugin
from livestreamer.plugin.api import http, validate
from livestreamer.stream import HDSStream, HLSStream, RTMPStream
_url_re = re.compile("""http(?:s)?://(?:\w+\.)?rtlxl.nl/#!/(?:.*)/(?P<uuid>.*?)\Z""", re.IGNORECASE)
class rtlxl(Plugin):
@classmethod
... | <commit_before>import re
from livestreamer.plugin import Plugin
from livestreamer.plugin.api import http, validate
from livestreamer.stream import HDSStream, HLSStream, RTMPStream
_url_re = re.compile("""http(?:s)?://(?:\w+\.)?rtlxl.nl/#!/(?:.*)/(?P<uuid>.*?)\Z""", re.IGNORECASE)
class rtlxl(Plugin):
@c... | import re
from livestreamer.plugin import Plugin
from livestreamer.plugin.api import http, validate
from livestreamer.stream import HDSStream, HLSStream, RTMPStream
_url_re = re.compile("""http(?:s)?://(?:\w+\.)?rtlxl.nl/#!/(?:.*)/(?P<uuid>.*?)\Z""", re.IGNORECASE)
class rtlxl(Plugin):
@classmethod
... | import re
from livestreamer.plugin import Plugin
from livestreamer.plugin.api import http, validate
from livestreamer.stream import HDSStream, HLSStream, RTMPStream
_url_re = re.compile("""http(?:s)?://(?:\w+\.)?rtlxl.nl/#!/(?:.*)/(?P<uuid>.*?)\Z""", re.IGNORECASE)
class rtlxl(Plugin):
@classmethod
... | <commit_before>import re
from livestreamer.plugin import Plugin
from livestreamer.plugin.api import http, validate
from livestreamer.stream import HDSStream, HLSStream, RTMPStream
_url_re = re.compile("""http(?:s)?://(?:\w+\.)?rtlxl.nl/#!/(?:.*)/(?P<uuid>.*?)\Z""", re.IGNORECASE)
class rtlxl(Plugin):
@c... |
cc3a970e893ebe6635982bcd49c48e6549cb5ac3 | stdnum/au/__init__.py | stdnum/au/__init__.py | # __init__.py - collection of Australian numbers
# coding: utf-8
#
# Copyright (C) 2016 Vincent Bastos
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the Licens... | # __init__.py - collection of Australian numbers
# coding: utf-8
#
# Copyright (C) 2016 Vincent Bastos
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the Licens... | Use ABN as Australian VAT number | Use ABN as Australian VAT number
See https://www.ato.gov.au/Business/GST/Tax-invoices/
Closes https://github.com/arthurdejong/python-stdnum/pull/246
| Python | lgpl-2.1 | arthurdejong/python-stdnum,arthurdejong/python-stdnum,arthurdejong/python-stdnum | # __init__.py - collection of Australian numbers
# coding: utf-8
#
# Copyright (C) 2016 Vincent Bastos
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the Licens... | # __init__.py - collection of Australian numbers
# coding: utf-8
#
# Copyright (C) 2016 Vincent Bastos
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the Licens... | <commit_before># __init__.py - collection of Australian numbers
# coding: utf-8
#
# Copyright (C) 2016 Vincent Bastos
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.... | # __init__.py - collection of Australian numbers
# coding: utf-8
#
# Copyright (C) 2016 Vincent Bastos
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the Licens... | # __init__.py - collection of Australian numbers
# coding: utf-8
#
# Copyright (C) 2016 Vincent Bastos
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the Licens... | <commit_before># __init__.py - collection of Australian numbers
# coding: utf-8
#
# Copyright (C) 2016 Vincent Bastos
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.... |
9be7deeaf400858dc00118d274b4cf4d19c60858 | stdnum/cr/__init__.py | stdnum/cr/__init__.py | # __init__.py - collection of Costa Rican numbers
# coding: utf-8
#
# Copyright (C) 2019 Leandro Regueiro
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the Lic... | # __init__.py - collection of Costa Rican numbers
# coding: utf-8
#
# Copyright (C) 2019 Leandro Regueiro
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the Lic... | Add missing vat alias for Costa Rica | Add missing vat alias for Costa Rica
| Python | lgpl-2.1 | arthurdejong/python-stdnum,arthurdejong/python-stdnum,arthurdejong/python-stdnum | # __init__.py - collection of Costa Rican numbers
# coding: utf-8
#
# Copyright (C) 2019 Leandro Regueiro
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the Lic... | # __init__.py - collection of Costa Rican numbers
# coding: utf-8
#
# Copyright (C) 2019 Leandro Regueiro
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the Lic... | <commit_before># __init__.py - collection of Costa Rican numbers
# coding: utf-8
#
# Copyright (C) 2019 Leandro Regueiro
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version... | # __init__.py - collection of Costa Rican numbers
# coding: utf-8
#
# Copyright (C) 2019 Leandro Regueiro
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the Lic... | # __init__.py - collection of Costa Rican numbers
# coding: utf-8
#
# Copyright (C) 2019 Leandro Regueiro
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the Lic... | <commit_before># __init__.py - collection of Costa Rican numbers
# coding: utf-8
#
# Copyright (C) 2019 Leandro Regueiro
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version... |
12c2c7f20e46dce54990d5cf4c0e51ab02d549c4 | adder/__init__.py | adder/__init__.py | """adder is an amazing module which adds things"""
def add(first, second):
"""The power of add is that it adds its arguments"""
return first + second
| """A mighty module to add things to each other"""
def add(first, second):
"""The power of add is that it adds its arguments"""
return first + second
| Make the docstring match the github description | Make the docstring match the github description | Python | mit | jamesmcdonald/adder | """adder is an amazing module which adds things"""
def add(first, second):
"""The power of add is that it adds its arguments"""
return first + second
Make the docstring match the github description | """A mighty module to add things to each other"""
def add(first, second):
"""The power of add is that it adds its arguments"""
return first + second
| <commit_before>"""adder is an amazing module which adds things"""
def add(first, second):
"""The power of add is that it adds its arguments"""
return first + second
<commit_msg>Make the docstring match the github description<commit_after> | """A mighty module to add things to each other"""
def add(first, second):
"""The power of add is that it adds its arguments"""
return first + second
| """adder is an amazing module which adds things"""
def add(first, second):
"""The power of add is that it adds its arguments"""
return first + second
Make the docstring match the github description"""A mighty module to add things to each other"""
def add(first, second):
"""The power of add is that it adds... | <commit_before>"""adder is an amazing module which adds things"""
def add(first, second):
"""The power of add is that it adds its arguments"""
return first + second
<commit_msg>Make the docstring match the github description<commit_after>"""A mighty module to add things to each other"""
def add(first, second)... |
a263ad297000fbefb9399249198be630718350f8 | transfers/pre-transfer/add_metadata.py | transfers/pre-transfer/add_metadata.py | #!/usr/bin/env python2
import json
import os
import sys
def main(transfer_path):
basename = os.path.basename(transfer_path)
try:
_, dc_id, _ = basename.split('---')
except ValueError:
return 1
metadata = [
{
'parts': 'objects',
'dc.identifier': dc_id,
... | #!/usr/bin/env python2
import json
import os
import sys
def main(transfer_path):
basename = os.path.basename(transfer_path)
try:
dc_id, _, _ = basename.split('---')
except ValueError:
return 1
metadata = [
{
'parts': 'objects',
'dc.identifier': dc_id,
... | Automate Transfers: Change default metadata added | Automate Transfers: Change default metadata added
| Python | agpl-3.0 | artefactual/automation-tools,artefactual/automation-tools,finoradin/automation-tools | #!/usr/bin/env python2
import json
import os
import sys
def main(transfer_path):
basename = os.path.basename(transfer_path)
try:
_, dc_id, _ = basename.split('---')
except ValueError:
return 1
metadata = [
{
'parts': 'objects',
'dc.identifier': dc_id,
... | #!/usr/bin/env python2
import json
import os
import sys
def main(transfer_path):
basename = os.path.basename(transfer_path)
try:
dc_id, _, _ = basename.split('---')
except ValueError:
return 1
metadata = [
{
'parts': 'objects',
'dc.identifier': dc_id,
... | <commit_before>#!/usr/bin/env python2
import json
import os
import sys
def main(transfer_path):
basename = os.path.basename(transfer_path)
try:
_, dc_id, _ = basename.split('---')
except ValueError:
return 1
metadata = [
{
'parts': 'objects',
'dc.identif... | #!/usr/bin/env python2
import json
import os
import sys
def main(transfer_path):
basename = os.path.basename(transfer_path)
try:
dc_id, _, _ = basename.split('---')
except ValueError:
return 1
metadata = [
{
'parts': 'objects',
'dc.identifier': dc_id,
... | #!/usr/bin/env python2
import json
import os
import sys
def main(transfer_path):
basename = os.path.basename(transfer_path)
try:
_, dc_id, _ = basename.split('---')
except ValueError:
return 1
metadata = [
{
'parts': 'objects',
'dc.identifier': dc_id,
... | <commit_before>#!/usr/bin/env python2
import json
import os
import sys
def main(transfer_path):
basename = os.path.basename(transfer_path)
try:
_, dc_id, _ = basename.split('---')
except ValueError:
return 1
metadata = [
{
'parts': 'objects',
'dc.identif... |
cfeaf5b01b6c822b2351a556e48a1a68aa2bce88 | glue_vispy_viewers/volume/tests/test_glue_viewer.py | glue_vispy_viewers/volume/tests/test_glue_viewer.py | import operator
import numpy as np
from glue.qt import get_qapp
from glue.core.data import Data
from glue.core.data_collection import DataCollection
from glue.app.qt.application import GlueApplication
from glue.core.subset import InequalitySubsetState
# from glue.core.tests.util import simple_session
from ..vol_glue_vi... | import operator
import numpy as np
from glue.qt import get_qapp
from glue.core.data import Data
from glue.core.data_collection import DataCollection
try:
from glue.app.qt.application import GlueApplication
except:
from glue.qt.glue_application import GlueApplication
from glue.core.subset import InequalitySubs... | Fix compatibility with latest stable glue version | Fix compatibility with latest stable glue version | Python | bsd-2-clause | PennyQ/astro-vispy,PennyQ/glue-3d-viewer,astrofrog/glue-vispy-viewers,glue-viz/glue-3d-viewer,glue-viz/glue-vispy-viewers,astrofrog/glue-3d-viewer | import operator
import numpy as np
from glue.qt import get_qapp
from glue.core.data import Data
from glue.core.data_collection import DataCollection
from glue.app.qt.application import GlueApplication
from glue.core.subset import InequalitySubsetState
# from glue.core.tests.util import simple_session
from ..vol_glue_vi... | import operator
import numpy as np
from glue.qt import get_qapp
from glue.core.data import Data
from glue.core.data_collection import DataCollection
try:
from glue.app.qt.application import GlueApplication
except:
from glue.qt.glue_application import GlueApplication
from glue.core.subset import InequalitySubs... | <commit_before>import operator
import numpy as np
from glue.qt import get_qapp
from glue.core.data import Data
from glue.core.data_collection import DataCollection
from glue.app.qt.application import GlueApplication
from glue.core.subset import InequalitySubsetState
# from glue.core.tests.util import simple_session
fro... | import operator
import numpy as np
from glue.qt import get_qapp
from glue.core.data import Data
from glue.core.data_collection import DataCollection
try:
from glue.app.qt.application import GlueApplication
except:
from glue.qt.glue_application import GlueApplication
from glue.core.subset import InequalitySubs... | import operator
import numpy as np
from glue.qt import get_qapp
from glue.core.data import Data
from glue.core.data_collection import DataCollection
from glue.app.qt.application import GlueApplication
from glue.core.subset import InequalitySubsetState
# from glue.core.tests.util import simple_session
from ..vol_glue_vi... | <commit_before>import operator
import numpy as np
from glue.qt import get_qapp
from glue.core.data import Data
from glue.core.data_collection import DataCollection
from glue.app.qt.application import GlueApplication
from glue.core.subset import InequalitySubsetState
# from glue.core.tests.util import simple_session
fro... |
b5bfa67c87c7043f521cde32e7212c0fffdbacd9 | Solutions/problem67.py | Solutions/problem67.py | # Project Euler Problem 67
# Created on: 2012-06-18
# Created by: William McDonald
def importTri():
t = []
f = open("problem67.txt")
for line in f:
t.append(map(int, line.split(" ")))
return t
def getMax(lm, cur):
l = len(cur) - 1
maxL = [lm[0] + cur[0]]
i = 1
wh... | # Project Euler Problem 67
def import_triangle():
with open('problem67.txt') as f:
# Split each line by spaces and convert to integers
return [list(map(int, line.split(' '))) for line in f]
# The max of this row is the maximum sum up to its parent items plus the value
# in this row. But no... | Update problem 67 to be legible | Update problem 67 to be legible
| Python | mit | WalrusCow/euler | # Project Euler Problem 67
# Created on: 2012-06-18
# Created by: William McDonald
def importTri():
t = []
f = open("problem67.txt")
for line in f:
t.append(map(int, line.split(" ")))
return t
def getMax(lm, cur):
l = len(cur) - 1
maxL = [lm[0] + cur[0]]
i = 1
wh... | # Project Euler Problem 67
def import_triangle():
with open('problem67.txt') as f:
# Split each line by spaces and convert to integers
return [list(map(int, line.split(' '))) for line in f]
# The max of this row is the maximum sum up to its parent items plus the value
# in this row. But no... | <commit_before># Project Euler Problem 67
# Created on: 2012-06-18
# Created by: William McDonald
def importTri():
t = []
f = open("problem67.txt")
for line in f:
t.append(map(int, line.split(" ")))
return t
def getMax(lm, cur):
l = len(cur) - 1
maxL = [lm[0] + cur[0]]
... | # Project Euler Problem 67
def import_triangle():
with open('problem67.txt') as f:
# Split each line by spaces and convert to integers
return [list(map(int, line.split(' '))) for line in f]
# The max of this row is the maximum sum up to its parent items plus the value
# in this row. But no... | # Project Euler Problem 67
# Created on: 2012-06-18
# Created by: William McDonald
def importTri():
t = []
f = open("problem67.txt")
for line in f:
t.append(map(int, line.split(" ")))
return t
def getMax(lm, cur):
l = len(cur) - 1
maxL = [lm[0] + cur[0]]
i = 1
wh... | <commit_before># Project Euler Problem 67
# Created on: 2012-06-18
# Created by: William McDonald
def importTri():
t = []
f = open("problem67.txt")
for line in f:
t.append(map(int, line.split(" ")))
return t
def getMax(lm, cur):
l = len(cur) - 1
maxL = [lm[0] + cur[0]]
... |
c787d7a0967a57ad6bec1924f4f5fdeeb07ffd0e | UM/Mesh/ReadMeshJob.py | UM/Mesh/ReadMeshJob.py | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from UM.Job import Job
from UM.Application import Application
from UM.Message import Message
import os.path
from UM.i18n import i18nCatalog
i18n_catalog = i18nCatalog("uranium")
## A Job subclass that performs mesh l... | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from UM.Job import Job
from UM.Application import Application
from UM.Message import Message
import os.path
from UM.i18n import i18nCatalog
i18n_catalog = i18nCatalog("uranium")
## A Job subclass that performs mesh l... | Format the message string after translating, not before | Format the message string after translating, not before
This makes sure we use the right translated string.
Contributes to Ultimaker/Cura#57
| Python | agpl-3.0 | onitake/Uranium,onitake/Uranium | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from UM.Job import Job
from UM.Application import Application
from UM.Message import Message
import os.path
from UM.i18n import i18nCatalog
i18n_catalog = i18nCatalog("uranium")
## A Job subclass that performs mesh l... | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from UM.Job import Job
from UM.Application import Application
from UM.Message import Message
import os.path
from UM.i18n import i18nCatalog
i18n_catalog = i18nCatalog("uranium")
## A Job subclass that performs mesh l... | <commit_before># Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from UM.Job import Job
from UM.Application import Application
from UM.Message import Message
import os.path
from UM.i18n import i18nCatalog
i18n_catalog = i18nCatalog("uranium")
## A Job subclass that ... | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from UM.Job import Job
from UM.Application import Application
from UM.Message import Message
import os.path
from UM.i18n import i18nCatalog
i18n_catalog = i18nCatalog("uranium")
## A Job subclass that performs mesh l... | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from UM.Job import Job
from UM.Application import Application
from UM.Message import Message
import os.path
from UM.i18n import i18nCatalog
i18n_catalog = i18nCatalog("uranium")
## A Job subclass that performs mesh l... | <commit_before># Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from UM.Job import Job
from UM.Application import Application
from UM.Message import Message
import os.path
from UM.i18n import i18nCatalog
i18n_catalog = i18nCatalog("uranium")
## A Job subclass that ... |
22ac94423dff44db01abdc28358c00fe5eaca79e | actually-do-refunds.py | actually-do-refunds.py | #!/usr/bin/env python -u
from __future__ import absolute_import, division, print_function, unicode_literals
import csv, os, requests
url = 'https://api.balancedpayments.com/debits/{}/refunds'
username = os.environ['BALANCED_API_USER']
inp = csv.reader(open('refunds.csv'))
inp.next() # headers
out = csv.reader(open... | #!/usr/bin/env python -u
from __future__ import absolute_import, division, print_function, unicode_literals
import csv, os, requests
url = 'https://api.balancedpayments.com/debits/{}/refunds'
username = os.environ['BALANCED_API_USER']
inp = csv.reader(open('refunds.csv'))
inp.next() # headers
out = csv.writer(open... | Clean up script to make refunds | Clean up script to make refunds
Tested against httpbin.org
| Python | mit | gratipay/gratipay.com,gratipay/gratipay.com,gratipay/gratipay.com,gratipay/gratipay.com | #!/usr/bin/env python -u
from __future__ import absolute_import, division, print_function, unicode_literals
import csv, os, requests
url = 'https://api.balancedpayments.com/debits/{}/refunds'
username = os.environ['BALANCED_API_USER']
inp = csv.reader(open('refunds.csv'))
inp.next() # headers
out = csv.reader(open... | #!/usr/bin/env python -u
from __future__ import absolute_import, division, print_function, unicode_literals
import csv, os, requests
url = 'https://api.balancedpayments.com/debits/{}/refunds'
username = os.environ['BALANCED_API_USER']
inp = csv.reader(open('refunds.csv'))
inp.next() # headers
out = csv.writer(open... | <commit_before>#!/usr/bin/env python -u
from __future__ import absolute_import, division, print_function, unicode_literals
import csv, os, requests
url = 'https://api.balancedpayments.com/debits/{}/refunds'
username = os.environ['BALANCED_API_USER']
inp = csv.reader(open('refunds.csv'))
inp.next() # headers
out = ... | #!/usr/bin/env python -u
from __future__ import absolute_import, division, print_function, unicode_literals
import csv, os, requests
url = 'https://api.balancedpayments.com/debits/{}/refunds'
username = os.environ['BALANCED_API_USER']
inp = csv.reader(open('refunds.csv'))
inp.next() # headers
out = csv.writer(open... | #!/usr/bin/env python -u
from __future__ import absolute_import, division, print_function, unicode_literals
import csv, os, requests
url = 'https://api.balancedpayments.com/debits/{}/refunds'
username = os.environ['BALANCED_API_USER']
inp = csv.reader(open('refunds.csv'))
inp.next() # headers
out = csv.reader(open... | <commit_before>#!/usr/bin/env python -u
from __future__ import absolute_import, division, print_function, unicode_literals
import csv, os, requests
url = 'https://api.balancedpayments.com/debits/{}/refunds'
username = os.environ['BALANCED_API_USER']
inp = csv.reader(open('refunds.csv'))
inp.next() # headers
out = ... |
715987e85b61807a7ba5a3ae8ead8a44fff425cb | src/sentry/tasks/base.py | src/sentry/tasks/base.py | """
sentry.tasks.base
~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from celery.task import current
from functools import wraps
from sentry.celery import app
from sentry.utils impor... | """
sentry.tasks.base
~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from celery.task import current
from raven.contrib.django.models import client as Raven
from functools import wrap... | Clear context for celery tasks | Clear context for celery tasks
| Python | bsd-3-clause | jean/sentry,ifduyue/sentry,mitsuhiko/sentry,gencer/sentry,mvaled/sentry,jean/sentry,zenefits/sentry,alexm92/sentry,looker/sentry,fotinakis/sentry,jean/sentry,beeftornado/sentry,beeftornado/sentry,looker/sentry,daevaorn/sentry,JamesMura/sentry,alexm92/sentry,JackDanger/sentry,ifduyue/sentry,JackDanger/sentry,looker/sent... | """
sentry.tasks.base
~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from celery.task import current
from functools import wraps
from sentry.celery import app
from sentry.utils impor... | """
sentry.tasks.base
~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from celery.task import current
from raven.contrib.django.models import client as Raven
from functools import wrap... | <commit_before>"""
sentry.tasks.base
~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from celery.task import current
from functools import wraps
from sentry.celery import app
from sen... | """
sentry.tasks.base
~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from celery.task import current
from raven.contrib.django.models import client as Raven
from functools import wrap... | """
sentry.tasks.base
~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from celery.task import current
from functools import wraps
from sentry.celery import app
from sentry.utils impor... | <commit_before>"""
sentry.tasks.base
~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from celery.task import current
from functools import wraps
from sentry.celery import app
from sen... |
ac11d7e7f90a2ee6a240be5fd95093f98c7d42dc | db/create_db.py | db/create_db.py | from models import Base, engine, MetricType
from sqlalchemy.orm import Session
import uuid
import os
# Create all tables in the engine. This is equivalent to "Create Table"
# statements in raw SQL.
Base.metadata.create_all(engine)
session = Session(engine)
def initialize_metric_types():
metric_types = [None] * 2... | from models import Base, engine, MetricType
from sqlalchemy.orm import Session
import uuid
import os
try:
os.remove('station_db.db')
except Exception as ex:
pass
# Create all tables in the engine. This is equivalent to "Create Table"
# statements in raw SQL.
Base.metadata.create_all(engine)
session = Session... | Fix for lack of file. | Fix for lack of file.
Signed-off-by: Maciej Szankin <33c1fdf481c8e628d4c6db7ea8dc77f49f2fa5d7@szankin.pl>
| Python | mit | joannarozes/ddb,joannarozes/ddb,joannarozes/ddb,joannarozes/ddb | from models import Base, engine, MetricType
from sqlalchemy.orm import Session
import uuid
import os
# Create all tables in the engine. This is equivalent to "Create Table"
# statements in raw SQL.
Base.metadata.create_all(engine)
session = Session(engine)
def initialize_metric_types():
metric_types = [None] * 2... | from models import Base, engine, MetricType
from sqlalchemy.orm import Session
import uuid
import os
try:
os.remove('station_db.db')
except Exception as ex:
pass
# Create all tables in the engine. This is equivalent to "Create Table"
# statements in raw SQL.
Base.metadata.create_all(engine)
session = Session... | <commit_before>from models import Base, engine, MetricType
from sqlalchemy.orm import Session
import uuid
import os
# Create all tables in the engine. This is equivalent to "Create Table"
# statements in raw SQL.
Base.metadata.create_all(engine)
session = Session(engine)
def initialize_metric_types():
metric_typ... | from models import Base, engine, MetricType
from sqlalchemy.orm import Session
import uuid
import os
try:
os.remove('station_db.db')
except Exception as ex:
pass
# Create all tables in the engine. This is equivalent to "Create Table"
# statements in raw SQL.
Base.metadata.create_all(engine)
session = Session... | from models import Base, engine, MetricType
from sqlalchemy.orm import Session
import uuid
import os
# Create all tables in the engine. This is equivalent to "Create Table"
# statements in raw SQL.
Base.metadata.create_all(engine)
session = Session(engine)
def initialize_metric_types():
metric_types = [None] * 2... | <commit_before>from models import Base, engine, MetricType
from sqlalchemy.orm import Session
import uuid
import os
# Create all tables in the engine. This is equivalent to "Create Table"
# statements in raw SQL.
Base.metadata.create_all(engine)
session = Session(engine)
def initialize_metric_types():
metric_typ... |
6dbb40b2ca23d90b439fb08a2931b6a43b6c9e61 | update.py | update.py | import os
os.system("git add *")
os.system("git commit -m 'first commit'")
os.system("git push origin master")
| import os
print "Enter commit message:"
commit = raw_input();
os.system("git add *")
os.system("git commit -m '"+commit+"'")
os.system("git push origin master")
| Set up git push script. ;) | Set up git push script. ;)
| Python | mit | connornishijima/electropi2,connornishijima/electropi2 | import os
os.system("git add *")
os.system("git commit -m 'first commit'")
os.system("git push origin master")
Set up git push script. ;) | import os
print "Enter commit message:"
commit = raw_input();
os.system("git add *")
os.system("git commit -m '"+commit+"'")
os.system("git push origin master")
| <commit_before>import os
os.system("git add *")
os.system("git commit -m 'first commit'")
os.system("git push origin master")
<commit_msg>Set up git push script. ;)<commit_after> | import os
print "Enter commit message:"
commit = raw_input();
os.system("git add *")
os.system("git commit -m '"+commit+"'")
os.system("git push origin master")
| import os
os.system("git add *")
os.system("git commit -m 'first commit'")
os.system("git push origin master")
Set up git push script. ;)import os
print "Enter commit message:"
commit = raw_input();
os.system("git add *")
os.system("git commit -m '"+commit+"'")
os.system("git push origin master")
| <commit_before>import os
os.system("git add *")
os.system("git commit -m 'first commit'")
os.system("git push origin master")
<commit_msg>Set up git push script. ;)<commit_after>import os
print "Enter commit message:"
commit = raw_input();
os.system("git add *")
os.system("git commit -m '"+commit+"'")
os.system("git... |
62e4f4b8262c78a20c26de7b9b23a89d2c2e1e90 | examples/wsgi_app.py | examples/wsgi_app.py | import guv
guv.monkey_patch()
import guv.wsgi
import logger
logger.configure()
def app(environ, start_response):
status = '200 OK'
output = [b'Hello World!']
content_length = str(len(b''.join(output)))
response_headers = [('Content-type', 'text/plain'),
('Content-Length', co... | import guv
guv.monkey_patch()
import guv.wsgi
import logger
logger.configure()
def app(environ, start_response):
"""
This is very basic WSGI app useful for testing the performance of guv and guv.wsgi without
the overhead of a framework such as Flask. However, it can just as easily be any other WSGI app
... | Add docstring to WSGI example | Add docstring to WSGI example
| Python | mit | veegee/guv,veegee/guv | import guv
guv.monkey_patch()
import guv.wsgi
import logger
logger.configure()
def app(environ, start_response):
status = '200 OK'
output = [b'Hello World!']
content_length = str(len(b''.join(output)))
response_headers = [('Content-type', 'text/plain'),
('Content-Length', co... | import guv
guv.monkey_patch()
import guv.wsgi
import logger
logger.configure()
def app(environ, start_response):
"""
This is very basic WSGI app useful for testing the performance of guv and guv.wsgi without
the overhead of a framework such as Flask. However, it can just as easily be any other WSGI app
... | <commit_before>import guv
guv.monkey_patch()
import guv.wsgi
import logger
logger.configure()
def app(environ, start_response):
status = '200 OK'
output = [b'Hello World!']
content_length = str(len(b''.join(output)))
response_headers = [('Content-type', 'text/plain'),
('Cont... | import guv
guv.monkey_patch()
import guv.wsgi
import logger
logger.configure()
def app(environ, start_response):
"""
This is very basic WSGI app useful for testing the performance of guv and guv.wsgi without
the overhead of a framework such as Flask. However, it can just as easily be any other WSGI app
... | import guv
guv.monkey_patch()
import guv.wsgi
import logger
logger.configure()
def app(environ, start_response):
status = '200 OK'
output = [b'Hello World!']
content_length = str(len(b''.join(output)))
response_headers = [('Content-type', 'text/plain'),
('Content-Length', co... | <commit_before>import guv
guv.monkey_patch()
import guv.wsgi
import logger
logger.configure()
def app(environ, start_response):
status = '200 OK'
output = [b'Hello World!']
content_length = str(len(b''.join(output)))
response_headers = [('Content-type', 'text/plain'),
('Cont... |
1ec9e85604eb8c69771a06d69681e7d7dbb00de7 | node/delta.py | node/delta.py | #!/usr/bin/env python
import datetime
from nodes import Node
class Delta(Node):
char = "$"
args = 1
results = 1
@Node.test_func([[1, 2, 3, 5]], [[1, 1, 2]])
def delta(self, seq: Node.sequence):
"""Return the difference in terms in the input sequence.
Returns a sequence of the same t... | #!/usr/bin/env python
import datetime
from nodes import Node
class Delta(Node):
char = "$"
args = 1
results = 1
contents = ["PADDING",
"January",
"February",
"March",
"April",
"May",
"June",
... | Update month names of year | Update month names of year
| Python | mit | muddyfish/PYKE,muddyfish/PYKE | #!/usr/bin/env python
import datetime
from nodes import Node
class Delta(Node):
char = "$"
args = 1
results = 1
@Node.test_func([[1, 2, 3, 5]], [[1, 1, 2]])
def delta(self, seq: Node.sequence):
"""Return the difference in terms in the input sequence.
Returns a sequence of the same t... | #!/usr/bin/env python
import datetime
from nodes import Node
class Delta(Node):
char = "$"
args = 1
results = 1
contents = ["PADDING",
"January",
"February",
"March",
"April",
"May",
"June",
... | <commit_before>#!/usr/bin/env python
import datetime
from nodes import Node
class Delta(Node):
char = "$"
args = 1
results = 1
@Node.test_func([[1, 2, 3, 5]], [[1, 1, 2]])
def delta(self, seq: Node.sequence):
"""Return the difference in terms in the input sequence.
Returns a sequenc... | #!/usr/bin/env python
import datetime
from nodes import Node
class Delta(Node):
char = "$"
args = 1
results = 1
contents = ["PADDING",
"January",
"February",
"March",
"April",
"May",
"June",
... | #!/usr/bin/env python
import datetime
from nodes import Node
class Delta(Node):
char = "$"
args = 1
results = 1
@Node.test_func([[1, 2, 3, 5]], [[1, 1, 2]])
def delta(self, seq: Node.sequence):
"""Return the difference in terms in the input sequence.
Returns a sequence of the same t... | <commit_before>#!/usr/bin/env python
import datetime
from nodes import Node
class Delta(Node):
char = "$"
args = 1
results = 1
@Node.test_func([[1, 2, 3, 5]], [[1, 1, 2]])
def delta(self, seq: Node.sequence):
"""Return the difference in terms in the input sequence.
Returns a sequenc... |
a035798ed00df2483a32e76a913cbc4cc8bf8df2 | api/middleware.py | api/middleware.py | class AddResponseHeader:
def process_response(self, req, resp, resource):
resp.set_header('Access-Control-Allow-Origin', 'http://localhost:8000')
components = [AddResponseHeader()]
| class AddResponseHeader:
def process_response(self, req, resp, resource):
resp.set_header('Access-Control-Allow-Origin', 'http://localhost:8000')
resp.set_header('Access-Control-Allow-Methods', 'GET, POST, PUT')
resp.set_header('Access-Control-Allow-Headers', 'Content-Type')
components = [A... | Fix API access control headers | Fix API access control headers
| Python | mit | thepoly/Pipeline,thepoly/Pipeline,thepoly/Pipeline,thepoly/Pipeline,thepoly/Pipeline | class AddResponseHeader:
def process_response(self, req, resp, resource):
resp.set_header('Access-Control-Allow-Origin', 'http://localhost:8000')
components = [AddResponseHeader()]
Fix API access control headers | class AddResponseHeader:
def process_response(self, req, resp, resource):
resp.set_header('Access-Control-Allow-Origin', 'http://localhost:8000')
resp.set_header('Access-Control-Allow-Methods', 'GET, POST, PUT')
resp.set_header('Access-Control-Allow-Headers', 'Content-Type')
components = [A... | <commit_before>class AddResponseHeader:
def process_response(self, req, resp, resource):
resp.set_header('Access-Control-Allow-Origin', 'http://localhost:8000')
components = [AddResponseHeader()]
<commit_msg>Fix API access control headers<commit_after> | class AddResponseHeader:
def process_response(self, req, resp, resource):
resp.set_header('Access-Control-Allow-Origin', 'http://localhost:8000')
resp.set_header('Access-Control-Allow-Methods', 'GET, POST, PUT')
resp.set_header('Access-Control-Allow-Headers', 'Content-Type')
components = [A... | class AddResponseHeader:
def process_response(self, req, resp, resource):
resp.set_header('Access-Control-Allow-Origin', 'http://localhost:8000')
components = [AddResponseHeader()]
Fix API access control headersclass AddResponseHeader:
def process_response(self, req, resp, resource):
resp.set_h... | <commit_before>class AddResponseHeader:
def process_response(self, req, resp, resource):
resp.set_header('Access-Control-Allow-Origin', 'http://localhost:8000')
components = [AddResponseHeader()]
<commit_msg>Fix API access control headers<commit_after>class AddResponseHeader:
def process_response(self,... |
183bd0005b71a587021c21b095961a0760e12f23 | swampdragon/file_upload_handler.py | swampdragon/file_upload_handler.py | from os.path import join
from os import makedirs
from django.conf import settings
def make_file_id(file_data):
return str(abs(hash(file_data)))
def get_file_location(file_name, file_id):
path = join(settings.MEDIA_ROOT, 'tmp')
path = join(path, str(file_id))
try:
makedirs(path)
except:
... | from os.path import join
from os import makedirs
from django.conf import settings
from datetime import datetime
import time
def make_file_id(file_data):
timestamp = datetime.now()
timestamp = time.mktime(timestamp.timetuple()) * 1e3 + timestamp.microsecond / 1e3
timestamp = '{}'.format(timestamp).encode()... | Improve the file id hash | Improve the file id hash
| Python | bsd-3-clause | sahlinet/swampdragon,denizs/swampdragon,sahlinet/swampdragon,aexeagmbh/swampdragon,bastianh/swampdragon,faulkner/swampdragon,faulkner/swampdragon,bastianh/swampdragon,boris-savic/swampdragon,d9pouces/swampdragon,seclinch/swampdragon,aexeagmbh/swampdragon,Manuel4131/swampdragon,seclinch/swampdragon,Manuel4131/swampdrago... | from os.path import join
from os import makedirs
from django.conf import settings
def make_file_id(file_data):
return str(abs(hash(file_data)))
def get_file_location(file_name, file_id):
path = join(settings.MEDIA_ROOT, 'tmp')
path = join(path, str(file_id))
try:
makedirs(path)
except:
... | from os.path import join
from os import makedirs
from django.conf import settings
from datetime import datetime
import time
def make_file_id(file_data):
timestamp = datetime.now()
timestamp = time.mktime(timestamp.timetuple()) * 1e3 + timestamp.microsecond / 1e3
timestamp = '{}'.format(timestamp).encode()... | <commit_before>from os.path import join
from os import makedirs
from django.conf import settings
def make_file_id(file_data):
return str(abs(hash(file_data)))
def get_file_location(file_name, file_id):
path = join(settings.MEDIA_ROOT, 'tmp')
path = join(path, str(file_id))
try:
makedirs(path... | from os.path import join
from os import makedirs
from django.conf import settings
from datetime import datetime
import time
def make_file_id(file_data):
timestamp = datetime.now()
timestamp = time.mktime(timestamp.timetuple()) * 1e3 + timestamp.microsecond / 1e3
timestamp = '{}'.format(timestamp).encode()... | from os.path import join
from os import makedirs
from django.conf import settings
def make_file_id(file_data):
return str(abs(hash(file_data)))
def get_file_location(file_name, file_id):
path = join(settings.MEDIA_ROOT, 'tmp')
path = join(path, str(file_id))
try:
makedirs(path)
except:
... | <commit_before>from os.path import join
from os import makedirs
from django.conf import settings
def make_file_id(file_data):
return str(abs(hash(file_data)))
def get_file_location(file_name, file_id):
path = join(settings.MEDIA_ROOT, 'tmp')
path = join(path, str(file_id))
try:
makedirs(path... |
16a951a119f37927f4f023051e25968c60d4511a | python/crypto-square/crypto_square.py | python/crypto-square/crypto_square.py | import string
import math
import itertools
class CryptoSquare:
@classmethod
def encode(cls, msg):
if len(cls.normalize(msg)) == 0:
return ''
return ' '.join(cls.transpose_square(cls.squarify(cls.normalize(msg))))
@classmethod
def squarify(cls, msg):
return [msg[i:... | import string
import math
import itertools
class CryptoSquare:
@classmethod
def encode(cls, msg):
if len(cls.normalize(msg)) == 0:
return ''
return ' '.join(cls.transpose_square(cls.squarify(cls.normalize(msg))))
@classmethod
def squarify(cls, msg):
return [msg[i:... | Refactor filter out none to method | Refactor filter out none to method
| Python | mit | rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism | import string
import math
import itertools
class CryptoSquare:
@classmethod
def encode(cls, msg):
if len(cls.normalize(msg)) == 0:
return ''
return ' '.join(cls.transpose_square(cls.squarify(cls.normalize(msg))))
@classmethod
def squarify(cls, msg):
return [msg[i:... | import string
import math
import itertools
class CryptoSquare:
@classmethod
def encode(cls, msg):
if len(cls.normalize(msg)) == 0:
return ''
return ' '.join(cls.transpose_square(cls.squarify(cls.normalize(msg))))
@classmethod
def squarify(cls, msg):
return [msg[i:... | <commit_before>import string
import math
import itertools
class CryptoSquare:
@classmethod
def encode(cls, msg):
if len(cls.normalize(msg)) == 0:
return ''
return ' '.join(cls.transpose_square(cls.squarify(cls.normalize(msg))))
@classmethod
def squarify(cls, msg):
... | import string
import math
import itertools
class CryptoSquare:
@classmethod
def encode(cls, msg):
if len(cls.normalize(msg)) == 0:
return ''
return ' '.join(cls.transpose_square(cls.squarify(cls.normalize(msg))))
@classmethod
def squarify(cls, msg):
return [msg[i:... | import string
import math
import itertools
class CryptoSquare:
@classmethod
def encode(cls, msg):
if len(cls.normalize(msg)) == 0:
return ''
return ' '.join(cls.transpose_square(cls.squarify(cls.normalize(msg))))
@classmethod
def squarify(cls, msg):
return [msg[i:... | <commit_before>import string
import math
import itertools
class CryptoSquare:
@classmethod
def encode(cls, msg):
if len(cls.normalize(msg)) == 0:
return ''
return ' '.join(cls.transpose_square(cls.squarify(cls.normalize(msg))))
@classmethod
def squarify(cls, msg):
... |
e01ec3b6c877bc76ffa2e93d97d706036a90405c | test/on_yubikey/cli_piv/test_misc.py | test/on_yubikey/cli_piv/test_misc.py | import unittest
from ..framework import cli_test_suite
from .util import DEFAULT_MANAGEMENT_KEY
@cli_test_suite
def additional_tests(ykman_cli):
class Misc(unittest.TestCase):
def setUp(self):
ykman_cli('piv', 'reset', '-f')
def test_info(self):
output = ykman_cli('piv',... | import unittest
from ..framework import cli_test_suite
from .util import DEFAULT_MANAGEMENT_KEY
@cli_test_suite
def additional_tests(ykman_cli):
class Misc(unittest.TestCase):
def setUp(self):
ykman_cli('piv', 'reset', '-f')
def test_info(self):
output = ykman_cli('piv',... | Test that repeated read/write-object cycles do not change the data | Test that repeated read/write-object cycles do not change the data
| Python | bsd-2-clause | Yubico/yubikey-manager,Yubico/yubikey-manager | import unittest
from ..framework import cli_test_suite
from .util import DEFAULT_MANAGEMENT_KEY
@cli_test_suite
def additional_tests(ykman_cli):
class Misc(unittest.TestCase):
def setUp(self):
ykman_cli('piv', 'reset', '-f')
def test_info(self):
output = ykman_cli('piv',... | import unittest
from ..framework import cli_test_suite
from .util import DEFAULT_MANAGEMENT_KEY
@cli_test_suite
def additional_tests(ykman_cli):
class Misc(unittest.TestCase):
def setUp(self):
ykman_cli('piv', 'reset', '-f')
def test_info(self):
output = ykman_cli('piv',... | <commit_before>import unittest
from ..framework import cli_test_suite
from .util import DEFAULT_MANAGEMENT_KEY
@cli_test_suite
def additional_tests(ykman_cli):
class Misc(unittest.TestCase):
def setUp(self):
ykman_cli('piv', 'reset', '-f')
def test_info(self):
output = y... | import unittest
from ..framework import cli_test_suite
from .util import DEFAULT_MANAGEMENT_KEY
@cli_test_suite
def additional_tests(ykman_cli):
class Misc(unittest.TestCase):
def setUp(self):
ykman_cli('piv', 'reset', '-f')
def test_info(self):
output = ykman_cli('piv',... | import unittest
from ..framework import cli_test_suite
from .util import DEFAULT_MANAGEMENT_KEY
@cli_test_suite
def additional_tests(ykman_cli):
class Misc(unittest.TestCase):
def setUp(self):
ykman_cli('piv', 'reset', '-f')
def test_info(self):
output = ykman_cli('piv',... | <commit_before>import unittest
from ..framework import cli_test_suite
from .util import DEFAULT_MANAGEMENT_KEY
@cli_test_suite
def additional_tests(ykman_cli):
class Misc(unittest.TestCase):
def setUp(self):
ykman_cli('piv', 'reset', '-f')
def test_info(self):
output = y... |
979b521a037b44b300e02d66fa0dbd967e078575 | troposphere/kms.py | troposphere/kms.py | # Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, Tags
from .compat import policytypes
from .validators import boolean, integer_range, key_usage_type
class Alias(AWSObject):
resource_type = "AWS::KMS::Alias"
props = {"... | # Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, Tags
from .compat import policytypes
from .validators import boolean, integer, integer_range, key_usage_type
class Alias(AWSObject):
resource_type = "AWS::KMS::Alias"
p... | Update KMS per 2021-06-17 changes | Update KMS per 2021-06-17 changes
| Python | bsd-2-clause | cloudtools/troposphere,cloudtools/troposphere | # Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, Tags
from .compat import policytypes
from .validators import boolean, integer_range, key_usage_type
class Alias(AWSObject):
resource_type = "AWS::KMS::Alias"
props = {"... | # Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, Tags
from .compat import policytypes
from .validators import boolean, integer, integer_range, key_usage_type
class Alias(AWSObject):
resource_type = "AWS::KMS::Alias"
p... | <commit_before># Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, Tags
from .compat import policytypes
from .validators import boolean, integer_range, key_usage_type
class Alias(AWSObject):
resource_type = "AWS::KMS::Alias"
... | # Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, Tags
from .compat import policytypes
from .validators import boolean, integer, integer_range, key_usage_type
class Alias(AWSObject):
resource_type = "AWS::KMS::Alias"
p... | # Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, Tags
from .compat import policytypes
from .validators import boolean, integer_range, key_usage_type
class Alias(AWSObject):
resource_type = "AWS::KMS::Alias"
props = {"... | <commit_before># Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, Tags
from .compat import policytypes
from .validators import boolean, integer_range, key_usage_type
class Alias(AWSObject):
resource_type = "AWS::KMS::Alias"
... |
a48b7bc7606d85705d8798f7823adb032df6dc0d | u2fval/__init__.py | u2fval/__init__.py | # Copyright (c) 2014 Yubico AB
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditi... | # Copyright (c) 2014 Yubico AB
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditi... | Set a development build version. | Set a development build version.
| Python | bsd-2-clause | Yubico/u2fval | # Copyright (c) 2014 Yubico AB
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditi... | # Copyright (c) 2014 Yubico AB
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditi... | <commit_before># Copyright (c) 2014 Yubico AB
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this ... | # Copyright (c) 2014 Yubico AB
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditi... | # Copyright (c) 2014 Yubico AB
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditi... | <commit_before># Copyright (c) 2014 Yubico AB
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this ... |
d49ef15aca8b9955e02b8719f238cc3a4ea26602 | dev/__init__.py | dev/__init__.py | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import os
package_name = "ocspbuilder"
other_packages = []
requires_oscrypto = True
has_tests_package = False
package_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
build_root = os.path.abspat... | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import os
package_name = "ocspbuilder"
other_packages = []
task_keyword_args = []
requires_oscrypto = True
has_tests_package = False
package_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
bui... | Add missing dev config variable | Add missing dev config variable
| Python | mit | wbond/ocspbuilder | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import os
package_name = "ocspbuilder"
other_packages = []
requires_oscrypto = True
has_tests_package = False
package_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
build_root = os.path.abspat... | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import os
package_name = "ocspbuilder"
other_packages = []
task_keyword_args = []
requires_oscrypto = True
has_tests_package = False
package_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
bui... | <commit_before># coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import os
package_name = "ocspbuilder"
other_packages = []
requires_oscrypto = True
has_tests_package = False
package_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
build_root =... | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import os
package_name = "ocspbuilder"
other_packages = []
task_keyword_args = []
requires_oscrypto = True
has_tests_package = False
package_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
bui... | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import os
package_name = "ocspbuilder"
other_packages = []
requires_oscrypto = True
has_tests_package = False
package_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
build_root = os.path.abspat... | <commit_before># coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import os
package_name = "ocspbuilder"
other_packages = []
requires_oscrypto = True
has_tests_package = False
package_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
build_root =... |
407d99a19c4427d4d94124b615d9d3c9bc5d3494 | frameworks/Python/API-Hour/hello/etc/hello/api_hour/gunicorn_conf.py | frameworks/Python/API-Hour/hello/etc/hello/api_hour/gunicorn_conf.py | import multiprocessing
import os
_is_travis = os.environ.get('TRAVIS') == 'true'
workers = multiprocessing.cpu_count() * 3
if _is_travis:
workers = 2
bind = ['0.0.0.0:8008', '0.0.0.0:8009', '0.0.0.0:8011']
keepalive = 120
errorlog = '-'
pidfile = 'api_hour.pid'
pythonpath = 'hello'
backlog = 10240000 | import multiprocessing
import os
_is_travis = os.environ.get('TRAVIS') == 'true'
workers = multiprocessing.cpu_count() * 2
if _is_travis:
workers = 2
bind = ['0.0.0.0:8008', '0.0.0.0:8009', '0.0.0.0:8011']
keepalive = 120
errorlog = '-'
pidfile = 'api_hour.pid'
pythonpath = 'hello'
backlog = 10240000 | Reduce pgsql socket pool and number of workers to match 2000 maximum connections | Reduce pgsql socket pool and number of workers to match 2000 maximum connections
| Python | bsd-3-clause | xitrum-framework/FrameworkBenchmarks,jaguililla/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,sxend/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,zloster/FrameworkBenchmarks,F3Community/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,RockinRoel/Framewo... | import multiprocessing
import os
_is_travis = os.environ.get('TRAVIS') == 'true'
workers = multiprocessing.cpu_count() * 3
if _is_travis:
workers = 2
bind = ['0.0.0.0:8008', '0.0.0.0:8009', '0.0.0.0:8011']
keepalive = 120
errorlog = '-'
pidfile = 'api_hour.pid'
pythonpath = 'hello'
backlog = 10240000Reduce pgsql... | import multiprocessing
import os
_is_travis = os.environ.get('TRAVIS') == 'true'
workers = multiprocessing.cpu_count() * 2
if _is_travis:
workers = 2
bind = ['0.0.0.0:8008', '0.0.0.0:8009', '0.0.0.0:8011']
keepalive = 120
errorlog = '-'
pidfile = 'api_hour.pid'
pythonpath = 'hello'
backlog = 10240000 | <commit_before>import multiprocessing
import os
_is_travis = os.environ.get('TRAVIS') == 'true'
workers = multiprocessing.cpu_count() * 3
if _is_travis:
workers = 2
bind = ['0.0.0.0:8008', '0.0.0.0:8009', '0.0.0.0:8011']
keepalive = 120
errorlog = '-'
pidfile = 'api_hour.pid'
pythonpath = 'hello'
backlog = 10240... | import multiprocessing
import os
_is_travis = os.environ.get('TRAVIS') == 'true'
workers = multiprocessing.cpu_count() * 2
if _is_travis:
workers = 2
bind = ['0.0.0.0:8008', '0.0.0.0:8009', '0.0.0.0:8011']
keepalive = 120
errorlog = '-'
pidfile = 'api_hour.pid'
pythonpath = 'hello'
backlog = 10240000 | import multiprocessing
import os
_is_travis = os.environ.get('TRAVIS') == 'true'
workers = multiprocessing.cpu_count() * 3
if _is_travis:
workers = 2
bind = ['0.0.0.0:8008', '0.0.0.0:8009', '0.0.0.0:8011']
keepalive = 120
errorlog = '-'
pidfile = 'api_hour.pid'
pythonpath = 'hello'
backlog = 10240000Reduce pgsql... | <commit_before>import multiprocessing
import os
_is_travis = os.environ.get('TRAVIS') == 'true'
workers = multiprocessing.cpu_count() * 3
if _is_travis:
workers = 2
bind = ['0.0.0.0:8008', '0.0.0.0:8009', '0.0.0.0:8011']
keepalive = 120
errorlog = '-'
pidfile = 'api_hour.pid'
pythonpath = 'hello'
backlog = 10240... |
d80a92cfe45907b9f91fd212a3b06fa0b2321364 | wagtail/tests/routablepage/models.py | wagtail/tests/routablepage/models.py | from django.db import models
from django.http import HttpResponse
from django.conf.urls import url
from wagtail.contrib.wagtailroutablepage.models import RoutablePage
def routable_page_external_view(request, arg):
return HttpResponse("EXTERNAL VIEW: " + arg)
class RoutablePageTest(RoutablePage):
subpage_url... | from django.db import models
from django.http import HttpResponse
from django.conf.urls import url
from wagtail.contrib.wagtailroutablepage.models import RoutablePage
def routable_page_external_view(request, arg):
return HttpResponse("EXTERNAL VIEW: " + arg)
class RoutablePageTest(RoutablePage):
@property
... | Make subpage_urls a property on RoutablePageTest | Make subpage_urls a property on RoutablePageTest
| Python | bsd-3-clause | JoshBarr/wagtail,mikedingjan/wagtail,gasman/wagtail,takeflight/wagtail,kurtw/wagtail,jorge-marques/wagtail,Pennebaker/wagtail,zerolab/wagtail,kurtw/wagtail,bjesus/wagtail,nilnvoid/wagtail,mayapurmedia/wagtail,chrxr/wagtail,nilnvoid/wagtail,zerolab/wagtail,Klaudit/wagtail,iho/wagtail,serzans/wagtail,Tivix/wagtail,wagtai... | from django.db import models
from django.http import HttpResponse
from django.conf.urls import url
from wagtail.contrib.wagtailroutablepage.models import RoutablePage
def routable_page_external_view(request, arg):
return HttpResponse("EXTERNAL VIEW: " + arg)
class RoutablePageTest(RoutablePage):
subpage_url... | from django.db import models
from django.http import HttpResponse
from django.conf.urls import url
from wagtail.contrib.wagtailroutablepage.models import RoutablePage
def routable_page_external_view(request, arg):
return HttpResponse("EXTERNAL VIEW: " + arg)
class RoutablePageTest(RoutablePage):
@property
... | <commit_before>from django.db import models
from django.http import HttpResponse
from django.conf.urls import url
from wagtail.contrib.wagtailroutablepage.models import RoutablePage
def routable_page_external_view(request, arg):
return HttpResponse("EXTERNAL VIEW: " + arg)
class RoutablePageTest(RoutablePage):
... | from django.db import models
from django.http import HttpResponse
from django.conf.urls import url
from wagtail.contrib.wagtailroutablepage.models import RoutablePage
def routable_page_external_view(request, arg):
return HttpResponse("EXTERNAL VIEW: " + arg)
class RoutablePageTest(RoutablePage):
@property
... | from django.db import models
from django.http import HttpResponse
from django.conf.urls import url
from wagtail.contrib.wagtailroutablepage.models import RoutablePage
def routable_page_external_view(request, arg):
return HttpResponse("EXTERNAL VIEW: " + arg)
class RoutablePageTest(RoutablePage):
subpage_url... | <commit_before>from django.db import models
from django.http import HttpResponse
from django.conf.urls import url
from wagtail.contrib.wagtailroutablepage.models import RoutablePage
def routable_page_external_view(request, arg):
return HttpResponse("EXTERNAL VIEW: " + arg)
class RoutablePageTest(RoutablePage):
... |
e4e8c4e3b98e122e5cf4c9c349c4fb2abfe00ab1 | api/bioguide/models.py | api/bioguide/models.py | from django.db import models
class Legislator(models.Model):
"""Model representing a legislator in a session of congress.
"""
bioguide_id = models.CharField(max_length=7, db_index=True)
prefix = models.CharField(max_length=16)
first = models.CharField(max_length=64)
last = models.CharField(max_... | from django.db import models
class Legislator(models.Model):
"""Model representing a legislator in a session of congress.
"""
bioguide_id = models.CharField(max_length=7, db_index=True)
prefix = models.CharField(max_length=16)
first = models.CharField(max_length=64)
last = models.CharField(max_... | Add 'position' to unique_together constraint, to account for members who serve in both houses during a Congress (h/t @derekwillis) | Add 'position' to unique_together constraint, to account for members who serve in both houses during a Congress (h/t @derekwillis)
| Python | bsd-3-clause | propublica/Capitol-Words,sunlightlabs/Capitol-Words,sunlightlabs/Capitol-Words,sunlightlabs/Capitol-Words,propublica/Capitol-Words,sunlightlabs/Capitol-Words,propublica/Capitol-Words,sunlightlabs/Capitol-Words,sunlightlabs/Capitol-Words,propublica/Capitol-Words,sunlightlabs/Capitol-Words | from django.db import models
class Legislator(models.Model):
"""Model representing a legislator in a session of congress.
"""
bioguide_id = models.CharField(max_length=7, db_index=True)
prefix = models.CharField(max_length=16)
first = models.CharField(max_length=64)
last = models.CharField(max_... | from django.db import models
class Legislator(models.Model):
"""Model representing a legislator in a session of congress.
"""
bioguide_id = models.CharField(max_length=7, db_index=True)
prefix = models.CharField(max_length=16)
first = models.CharField(max_length=64)
last = models.CharField(max_... | <commit_before>from django.db import models
class Legislator(models.Model):
"""Model representing a legislator in a session of congress.
"""
bioguide_id = models.CharField(max_length=7, db_index=True)
prefix = models.CharField(max_length=16)
first = models.CharField(max_length=64)
last = models... | from django.db import models
class Legislator(models.Model):
"""Model representing a legislator in a session of congress.
"""
bioguide_id = models.CharField(max_length=7, db_index=True)
prefix = models.CharField(max_length=16)
first = models.CharField(max_length=64)
last = models.CharField(max_... | from django.db import models
class Legislator(models.Model):
"""Model representing a legislator in a session of congress.
"""
bioguide_id = models.CharField(max_length=7, db_index=True)
prefix = models.CharField(max_length=16)
first = models.CharField(max_length=64)
last = models.CharField(max_... | <commit_before>from django.db import models
class Legislator(models.Model):
"""Model representing a legislator in a session of congress.
"""
bioguide_id = models.CharField(max_length=7, db_index=True)
prefix = models.CharField(max_length=16)
first = models.CharField(max_length=64)
last = models... |
ee09661f7a40bcecc0dc4d378800a6725a800255 | GPyOpt/experiment_design/latin_design.py | GPyOpt/experiment_design/latin_design.py | import numpy as np
from ..core.errors import InvalidConfigError
from .base import ExperimentDesign
from .random_design import RandomDesign
class LatinDesign(ExperimentDesign):
"""
Latin experiment design.
Uses random design for non-continuous variables, and latin hypercube for continuous ones
"""
... | import numpy as np
from ..core.errors import InvalidConfigError
from .base import ExperimentDesign
from .random_design import RandomDesign
class LatinDesign(ExperimentDesign):
"""
Latin experiment design.
Uses random design for non-continuous variables, and latin hypercube for continuous ones
"""
... | Allow users to choose lhs sampling criteria | Allow users to choose lhs sampling criteria
| Python | bsd-3-clause | SheffieldML/GPyOpt | import numpy as np
from ..core.errors import InvalidConfigError
from .base import ExperimentDesign
from .random_design import RandomDesign
class LatinDesign(ExperimentDesign):
"""
Latin experiment design.
Uses random design for non-continuous variables, and latin hypercube for continuous ones
"""
... | import numpy as np
from ..core.errors import InvalidConfigError
from .base import ExperimentDesign
from .random_design import RandomDesign
class LatinDesign(ExperimentDesign):
"""
Latin experiment design.
Uses random design for non-continuous variables, and latin hypercube for continuous ones
"""
... | <commit_before>import numpy as np
from ..core.errors import InvalidConfigError
from .base import ExperimentDesign
from .random_design import RandomDesign
class LatinDesign(ExperimentDesign):
"""
Latin experiment design.
Uses random design for non-continuous variables, and latin hypercube for continuous o... | import numpy as np
from ..core.errors import InvalidConfigError
from .base import ExperimentDesign
from .random_design import RandomDesign
class LatinDesign(ExperimentDesign):
"""
Latin experiment design.
Uses random design for non-continuous variables, and latin hypercube for continuous ones
"""
... | import numpy as np
from ..core.errors import InvalidConfigError
from .base import ExperimentDesign
from .random_design import RandomDesign
class LatinDesign(ExperimentDesign):
"""
Latin experiment design.
Uses random design for non-continuous variables, and latin hypercube for continuous ones
"""
... | <commit_before>import numpy as np
from ..core.errors import InvalidConfigError
from .base import ExperimentDesign
from .random_design import RandomDesign
class LatinDesign(ExperimentDesign):
"""
Latin experiment design.
Uses random design for non-continuous variables, and latin hypercube for continuous o... |
c2bb36ea80c44d836c3913fadd5b92c24f871dc6 | dj_geocoding/admin.py | dj_geocoding/admin.py | from django.utils.translation import ugettext_lazy as _
from django.contrib.admin import SimpleListFilter
class GeocodedFilter(SimpleListFilter):
"""
Admin list filter for filtering locations by whether they have
[complete] geolocation data.
"""
title = _('geocoded')
parameter_name = 'geocoded... | from django.utils.translation import ugettext_lazy as _
from django.contrib.admin import SimpleListFilter
from .utils import bulk_geocode
class GeocodedFilter(SimpleListFilter):
"""
Admin list filter for filtering locations by whether they have
[complete] geolocation data.
"""
title = _('geocoded'... | Remove reliance on queryset based geocoding method | Remove reliance on queryset based geocoding method
| Python | bsd-3-clause | bennylope/dj-geocoding | from django.utils.translation import ugettext_lazy as _
from django.contrib.admin import SimpleListFilter
class GeocodedFilter(SimpleListFilter):
"""
Admin list filter for filtering locations by whether they have
[complete] geolocation data.
"""
title = _('geocoded')
parameter_name = 'geocoded... | from django.utils.translation import ugettext_lazy as _
from django.contrib.admin import SimpleListFilter
from .utils import bulk_geocode
class GeocodedFilter(SimpleListFilter):
"""
Admin list filter for filtering locations by whether they have
[complete] geolocation data.
"""
title = _('geocoded'... | <commit_before>from django.utils.translation import ugettext_lazy as _
from django.contrib.admin import SimpleListFilter
class GeocodedFilter(SimpleListFilter):
"""
Admin list filter for filtering locations by whether they have
[complete] geolocation data.
"""
title = _('geocoded')
parameter_n... | from django.utils.translation import ugettext_lazy as _
from django.contrib.admin import SimpleListFilter
from .utils import bulk_geocode
class GeocodedFilter(SimpleListFilter):
"""
Admin list filter for filtering locations by whether they have
[complete] geolocation data.
"""
title = _('geocoded'... | from django.utils.translation import ugettext_lazy as _
from django.contrib.admin import SimpleListFilter
class GeocodedFilter(SimpleListFilter):
"""
Admin list filter for filtering locations by whether they have
[complete] geolocation data.
"""
title = _('geocoded')
parameter_name = 'geocoded... | <commit_before>from django.utils.translation import ugettext_lazy as _
from django.contrib.admin import SimpleListFilter
class GeocodedFilter(SimpleListFilter):
"""
Admin list filter for filtering locations by whether they have
[complete] geolocation data.
"""
title = _('geocoded')
parameter_n... |
5a6399e8c25e5c4bb71a6fa4914b38ea6c66a3eb | forms/iforms.py | forms/iforms.py | from nevow.compy import Interface
class IType(Interface):
def validate(self, value):
pass
class IStructure(Interface):
pass
class IWidget(Interface):
def render(self, ctx, key, args, errors):
pass
def processInput(self, ctx, key, args):
pass
clas... | from nevow.compy import Interface
class IType(Interface):
def validate(self, value):
pass
class IStructure(Interface):
pass
class IWidget(Interface):
def render(self, ctx, key, args, errors):
pass
def renderImmutable(self, ctx, key, args, errors):
... | Add missing method to interface | Add missing method to interface | Python | mit | emgee/formal,emgee/formal,emgee/formal | from nevow.compy import Interface
class IType(Interface):
def validate(self, value):
pass
class IStructure(Interface):
pass
class IWidget(Interface):
def render(self, ctx, key, args, errors):
pass
def processInput(self, ctx, key, args):
pass
clas... | from nevow.compy import Interface
class IType(Interface):
def validate(self, value):
pass
class IStructure(Interface):
pass
class IWidget(Interface):
def render(self, ctx, key, args, errors):
pass
def renderImmutable(self, ctx, key, args, errors):
... | <commit_before>from nevow.compy import Interface
class IType(Interface):
def validate(self, value):
pass
class IStructure(Interface):
pass
class IWidget(Interface):
def render(self, ctx, key, args, errors):
pass
def processInput(self, ctx, key, args):
... | from nevow.compy import Interface
class IType(Interface):
def validate(self, value):
pass
class IStructure(Interface):
pass
class IWidget(Interface):
def render(self, ctx, key, args, errors):
pass
def renderImmutable(self, ctx, key, args, errors):
... | from nevow.compy import Interface
class IType(Interface):
def validate(self, value):
pass
class IStructure(Interface):
pass
class IWidget(Interface):
def render(self, ctx, key, args, errors):
pass
def processInput(self, ctx, key, args):
pass
clas... | <commit_before>from nevow.compy import Interface
class IType(Interface):
def validate(self, value):
pass
class IStructure(Interface):
pass
class IWidget(Interface):
def render(self, ctx, key, args, errors):
pass
def processInput(self, ctx, key, args):
... |
c16edd2f00a45829563dad1a8072bc65418bd528 | test/validate_test.py | test/validate_test.py | #! /usr/bin/python
import jsonschema
import json
import sys
import os
import glob
vm_schema = json.loads(open("vm.schema.json").read());
def validate_vm_spec(filename):
# Load and parse as JSON
try:
vm_spec = json.loads(open(filename).read())
except:
raise Exception("JSON load / parse Error for " + file... | #! /usr/bin/python
import jsonschema
import json
import sys
import os
import glob
vm_schema = None
jsons = []
valid_vms = []
def load_schema(filename):
global vm_schema
vm_schema = json.loads(open(filename).read());
def validate_vm_spec(filename):
global valid_vms
vm_spec = None
# Load and parse as JSON
... | Test validator can now be used as a module | Test validator can now be used as a module
| Python | apache-2.0 | alfred-bratterud/IncludeOS,AndreasAakesson/IncludeOS,AndreasAakesson/IncludeOS,alfred-bratterud/IncludeOS,mnordsletten/IncludeOS,alfred-bratterud/IncludeOS,ingve/IncludeOS,hioa-cs/IncludeOS,AndreasAakesson/IncludeOS,hioa-cs/IncludeOS,AndreasAakesson/IncludeOS,AnnikaH/IncludeOS,AndreasAakesson/IncludeOS,mnordsletten/Inc... | #! /usr/bin/python
import jsonschema
import json
import sys
import os
import glob
vm_schema = json.loads(open("vm.schema.json").read());
def validate_vm_spec(filename):
# Load and parse as JSON
try:
vm_spec = json.loads(open(filename).read())
except:
raise Exception("JSON load / parse Error for " + file... | #! /usr/bin/python
import jsonschema
import json
import sys
import os
import glob
vm_schema = None
jsons = []
valid_vms = []
def load_schema(filename):
global vm_schema
vm_schema = json.loads(open(filename).read());
def validate_vm_spec(filename):
global valid_vms
vm_spec = None
# Load and parse as JSON
... | <commit_before>#! /usr/bin/python
import jsonschema
import json
import sys
import os
import glob
vm_schema = json.loads(open("vm.schema.json").read());
def validate_vm_spec(filename):
# Load and parse as JSON
try:
vm_spec = json.loads(open(filename).read())
except:
raise Exception("JSON load / parse Err... | #! /usr/bin/python
import jsonschema
import json
import sys
import os
import glob
vm_schema = None
jsons = []
valid_vms = []
def load_schema(filename):
global vm_schema
vm_schema = json.loads(open(filename).read());
def validate_vm_spec(filename):
global valid_vms
vm_spec = None
# Load and parse as JSON
... | #! /usr/bin/python
import jsonschema
import json
import sys
import os
import glob
vm_schema = json.loads(open("vm.schema.json").read());
def validate_vm_spec(filename):
# Load and parse as JSON
try:
vm_spec = json.loads(open(filename).read())
except:
raise Exception("JSON load / parse Error for " + file... | <commit_before>#! /usr/bin/python
import jsonschema
import json
import sys
import os
import glob
vm_schema = json.loads(open("vm.schema.json").read());
def validate_vm_spec(filename):
# Load and parse as JSON
try:
vm_spec = json.loads(open(filename).read())
except:
raise Exception("JSON load / parse Err... |
81bd740e60ce850d1617d2323b6e65960129ef0f | herana/forms.py | herana/forms.py | from django.contrib.auth.models import User
from django import forms
from models import ProjectDetail
class ProjectDetailForm(forms.ModelForm):
class Meta:
model = ProjectDetail
exclude = ('record_status', 'reporting_period')
def _clean_fields(self):
# If we are saving a draft, only t... | from django.contrib.auth.models import User
from django import forms
from models import ProjectDetail
class ProjectDetailForm(forms.ModelForm):
class Meta:
model = ProjectDetail
exclude = ('record_status', 'reporting_period')
def _clean_fields(self):
# If we are saving a draft, only t... | Fix check for _draft key in request object | Fix check for _draft key in request object
| Python | mit | Code4SA/herana,Code4SA/herana,Code4SA/herana,Code4SA/herana | from django.contrib.auth.models import User
from django import forms
from models import ProjectDetail
class ProjectDetailForm(forms.ModelForm):
class Meta:
model = ProjectDetail
exclude = ('record_status', 'reporting_period')
def _clean_fields(self):
# If we are saving a draft, only t... | from django.contrib.auth.models import User
from django import forms
from models import ProjectDetail
class ProjectDetailForm(forms.ModelForm):
class Meta:
model = ProjectDetail
exclude = ('record_status', 'reporting_period')
def _clean_fields(self):
# If we are saving a draft, only t... | <commit_before>from django.contrib.auth.models import User
from django import forms
from models import ProjectDetail
class ProjectDetailForm(forms.ModelForm):
class Meta:
model = ProjectDetail
exclude = ('record_status', 'reporting_period')
def _clean_fields(self):
# If we are saving ... | from django.contrib.auth.models import User
from django import forms
from models import ProjectDetail
class ProjectDetailForm(forms.ModelForm):
class Meta:
model = ProjectDetail
exclude = ('record_status', 'reporting_period')
def _clean_fields(self):
# If we are saving a draft, only t... | from django.contrib.auth.models import User
from django import forms
from models import ProjectDetail
class ProjectDetailForm(forms.ModelForm):
class Meta:
model = ProjectDetail
exclude = ('record_status', 'reporting_period')
def _clean_fields(self):
# If we are saving a draft, only t... | <commit_before>from django.contrib.auth.models import User
from django import forms
from models import ProjectDetail
class ProjectDetailForm(forms.ModelForm):
class Meta:
model = ProjectDetail
exclude = ('record_status', 'reporting_period')
def _clean_fields(self):
# If we are saving ... |
9e85483d7baef82e7081639e2df746ed80c38418 | tests/test_wheeler.py | tests/test_wheeler.py | # coding=utf-8
import os.path as path
import unittest
from devpi_builder import wheeler
class WheelTest(unittest.TestCase):
def test_build(self):
with wheeler.Builder() as builder:
wheel_file = builder('progressbar', '2.2')
self.assertRegexpMatches(wheel_file, '\.whl$')
... | # coding=utf-8
import os.path as path
import unittest
from devpi_builder import wheeler
class WheelTest(unittest.TestCase):
def test_build(self):
with wheeler.Builder() as builder:
wheel_file = builder('progressbar', '2.2')
self.assertRegexpMatches(wheel_file, '\.whl$')
... | Cover the line that handles the pip<=1.5.2 error case. | Cover the line that handles the pip<=1.5.2 error case.
| Python | bsd-3-clause | tylerdave/devpi-builder | # coding=utf-8
import os.path as path
import unittest
from devpi_builder import wheeler
class WheelTest(unittest.TestCase):
def test_build(self):
with wheeler.Builder() as builder:
wheel_file = builder('progressbar', '2.2')
self.assertRegexpMatches(wheel_file, '\.whl$')
... | # coding=utf-8
import os.path as path
import unittest
from devpi_builder import wheeler
class WheelTest(unittest.TestCase):
def test_build(self):
with wheeler.Builder() as builder:
wheel_file = builder('progressbar', '2.2')
self.assertRegexpMatches(wheel_file, '\.whl$')
... | <commit_before># coding=utf-8
import os.path as path
import unittest
from devpi_builder import wheeler
class WheelTest(unittest.TestCase):
def test_build(self):
with wheeler.Builder() as builder:
wheel_file = builder('progressbar', '2.2')
self.assertRegexpMatches(wheel_file, '\.w... | # coding=utf-8
import os.path as path
import unittest
from devpi_builder import wheeler
class WheelTest(unittest.TestCase):
def test_build(self):
with wheeler.Builder() as builder:
wheel_file = builder('progressbar', '2.2')
self.assertRegexpMatches(wheel_file, '\.whl$')
... | # coding=utf-8
import os.path as path
import unittest
from devpi_builder import wheeler
class WheelTest(unittest.TestCase):
def test_build(self):
with wheeler.Builder() as builder:
wheel_file = builder('progressbar', '2.2')
self.assertRegexpMatches(wheel_file, '\.whl$')
... | <commit_before># coding=utf-8
import os.path as path
import unittest
from devpi_builder import wheeler
class WheelTest(unittest.TestCase):
def test_build(self):
with wheeler.Builder() as builder:
wheel_file = builder('progressbar', '2.2')
self.assertRegexpMatches(wheel_file, '\.w... |
d4d409e52ce62053dd2ed40c1c5ee3ec7bce3ef3 | src/hiss/handler/gntp/sync.py | src/hiss/handler/gntp/sync.py | import socket
from hiss.handler.gntp.message import Response
class GNTPHandler():
def register(self, notifier, target, **kwargs):
pass
def notify(self, notification, target):
pass
def unregister(self, notifier, target):
pass
def send_request(request, target, wait_for_response=Tru... | import socket
from hiss.handler.gntp.message import Response
class GNTPHandler():
def register(self, notifier, target, **kwargs):
pass
def notify(self, notification, target):
pass
def unregister(self, notifier, target):
pass
def send_request(request, target, wait_for_response=Tru... | Make sure we close the socket | Make sure we close the socket
| Python | apache-2.0 | sffjunkie/hiss | import socket
from hiss.handler.gntp.message import Response
class GNTPHandler():
def register(self, notifier, target, **kwargs):
pass
def notify(self, notification, target):
pass
def unregister(self, notifier, target):
pass
def send_request(request, target, wait_for_response=Tru... | import socket
from hiss.handler.gntp.message import Response
class GNTPHandler():
def register(self, notifier, target, **kwargs):
pass
def notify(self, notification, target):
pass
def unregister(self, notifier, target):
pass
def send_request(request, target, wait_for_response=Tru... | <commit_before>import socket
from hiss.handler.gntp.message import Response
class GNTPHandler():
def register(self, notifier, target, **kwargs):
pass
def notify(self, notification, target):
pass
def unregister(self, notifier, target):
pass
def send_request(request, target, wait_f... | import socket
from hiss.handler.gntp.message import Response
class GNTPHandler():
def register(self, notifier, target, **kwargs):
pass
def notify(self, notification, target):
pass
def unregister(self, notifier, target):
pass
def send_request(request, target, wait_for_response=Tru... | import socket
from hiss.handler.gntp.message import Response
class GNTPHandler():
def register(self, notifier, target, **kwargs):
pass
def notify(self, notification, target):
pass
def unregister(self, notifier, target):
pass
def send_request(request, target, wait_for_response=Tru... | <commit_before>import socket
from hiss.handler.gntp.message import Response
class GNTPHandler():
def register(self, notifier, target, **kwargs):
pass
def notify(self, notification, target):
pass
def unregister(self, notifier, target):
pass
def send_request(request, target, wait_f... |
0cd94ef9c5454ef79544d902fa5397bad5f17d54 | dashboard/src/configuration.py | dashboard/src/configuration.py | from server_configuration import *
from s3_configuration import *
class Configuration():
def __init__(self):
self.stage = ServerConfiguration('STAGE')
self.prod = ServerConfiguration('PROD')
self.s3 = S3Configuration()
def __repr__(self):
return "Stage: {s}\nProd: {p}\nS3: {d... | """Configuration for the Dashboard."""
from server_configuration import *
from s3_configuration import *
class Configuration():
"""Class representing configuration for the Dashboard."""
def __init__(self):
"""Construct the configuration structure."""
self.stage = ServerConfiguration('STAGE')
... | Remove excessive parenthesis + add docstrings to module, class, and all public methods | Remove excessive parenthesis + add docstrings to module, class, and all public methods
| Python | apache-2.0 | tisnik/fabric8-analytics-common,tisnik/fabric8-analytics-common,jpopelka/fabric8-analytics-common,tisnik/fabric8-analytics-common,jpopelka/fabric8-analytics-common,jpopelka/fabric8-analytics-common | from server_configuration import *
from s3_configuration import *
class Configuration():
def __init__(self):
self.stage = ServerConfiguration('STAGE')
self.prod = ServerConfiguration('PROD')
self.s3 = S3Configuration()
def __repr__(self):
return "Stage: {s}\nProd: {p}\nS3: {d... | """Configuration for the Dashboard."""
from server_configuration import *
from s3_configuration import *
class Configuration():
"""Class representing configuration for the Dashboard."""
def __init__(self):
"""Construct the configuration structure."""
self.stage = ServerConfiguration('STAGE')
... | <commit_before>from server_configuration import *
from s3_configuration import *
class Configuration():
def __init__(self):
self.stage = ServerConfiguration('STAGE')
self.prod = ServerConfiguration('PROD')
self.s3 = S3Configuration()
def __repr__(self):
return "Stage: {s}\nPr... | """Configuration for the Dashboard."""
from server_configuration import *
from s3_configuration import *
class Configuration():
"""Class representing configuration for the Dashboard."""
def __init__(self):
"""Construct the configuration structure."""
self.stage = ServerConfiguration('STAGE')
... | from server_configuration import *
from s3_configuration import *
class Configuration():
def __init__(self):
self.stage = ServerConfiguration('STAGE')
self.prod = ServerConfiguration('PROD')
self.s3 = S3Configuration()
def __repr__(self):
return "Stage: {s}\nProd: {p}\nS3: {d... | <commit_before>from server_configuration import *
from s3_configuration import *
class Configuration():
def __init__(self):
self.stage = ServerConfiguration('STAGE')
self.prod = ServerConfiguration('PROD')
self.s3 = S3Configuration()
def __repr__(self):
return "Stage: {s}\nPr... |
1f6ba483902c59dc70d15ea1e33957ac6a874f01 | freesound_datasets/local_settings.example.py | freesound_datasets/local_settings.example.py | # Freesound keys for download script
# Get credentials at http://www.freesound.org/apiv2/apply
# Set callback url to https://www.freesound.org/home/app_permissions/permission_granted/
FS_CLIENT_ID = 'FREESOUND_KEY'
FS_CLIENT_SECRET = 'FREESOUND_SECRET'
# Freesound keys for "login with" functionality
# Get credentials ... | # Freesound keys for download script
# Get credentials at http://www.freesound.org/apiv2/apply
# Set callback url to https://www.freesound.org/home/app_permissions/permission_granted/
FS_CLIENT_ID = 'FREESOUND_KEY'
FS_CLIENT_SECRET = 'FREESOUND_SECRET'
# Freesound keys for "login with" functionality
# Get credentials ... | Remove unused social auth keys | Remove unused social auth keys
| Python | agpl-3.0 | MTG/freesound-datasets,MTG/freesound-datasets,MTG/freesound-datasets,MTG/freesound-datasets | # Freesound keys for download script
# Get credentials at http://www.freesound.org/apiv2/apply
# Set callback url to https://www.freesound.org/home/app_permissions/permission_granted/
FS_CLIENT_ID = 'FREESOUND_KEY'
FS_CLIENT_SECRET = 'FREESOUND_SECRET'
# Freesound keys for "login with" functionality
# Get credentials ... | # Freesound keys for download script
# Get credentials at http://www.freesound.org/apiv2/apply
# Set callback url to https://www.freesound.org/home/app_permissions/permission_granted/
FS_CLIENT_ID = 'FREESOUND_KEY'
FS_CLIENT_SECRET = 'FREESOUND_SECRET'
# Freesound keys for "login with" functionality
# Get credentials ... | <commit_before># Freesound keys for download script
# Get credentials at http://www.freesound.org/apiv2/apply
# Set callback url to https://www.freesound.org/home/app_permissions/permission_granted/
FS_CLIENT_ID = 'FREESOUND_KEY'
FS_CLIENT_SECRET = 'FREESOUND_SECRET'
# Freesound keys for "login with" functionality
# G... | # Freesound keys for download script
# Get credentials at http://www.freesound.org/apiv2/apply
# Set callback url to https://www.freesound.org/home/app_permissions/permission_granted/
FS_CLIENT_ID = 'FREESOUND_KEY'
FS_CLIENT_SECRET = 'FREESOUND_SECRET'
# Freesound keys for "login with" functionality
# Get credentials ... | # Freesound keys for download script
# Get credentials at http://www.freesound.org/apiv2/apply
# Set callback url to https://www.freesound.org/home/app_permissions/permission_granted/
FS_CLIENT_ID = 'FREESOUND_KEY'
FS_CLIENT_SECRET = 'FREESOUND_SECRET'
# Freesound keys for "login with" functionality
# Get credentials ... | <commit_before># Freesound keys for download script
# Get credentials at http://www.freesound.org/apiv2/apply
# Set callback url to https://www.freesound.org/home/app_permissions/permission_granted/
FS_CLIENT_ID = 'FREESOUND_KEY'
FS_CLIENT_SECRET = 'FREESOUND_SECRET'
# Freesound keys for "login with" functionality
# G... |
d8fb1906a66c5be2fb1289196bc07caaccfff0dd | php/apache_modules.py | php/apache_modules.py | import os
import yaml
def load_modules(data):
result = yaml.load(data)
if result:
apache = result.get('apache', {})
if apache:
return apache.get('modules', [])
return []
def install_modules(modules):
installed = 0
for module in modules:
print " Installing A... | import os
import yaml
def load_modules(data):
result = yaml.load(data)
if result:
apache = result.get('apache', {})
if apache:
return apache.get('modules', [])
return []
def install_modules(modules):
installed = 0
for module in modules:
print " Installing A... | Remove output when restarting apache after module enable | Remove output when restarting apache after module enable
| Python | bsd-3-clause | jusbrasil/basebuilder,axelerant/basebuilder,axelerant/basebuilder,leandrosouza/basebuilder,keymon/basebuilder,actionjack/basebuilder,emerleite/basebuilder,keymon/basebuilder,axelerant/basebuilder,marcuskara/basebuilder,keymon/basebuilder,jusbrasil/basebuilder,marcuskara/basebuilder,ChangjunZhao/basebuilder,emerleite/ba... | import os
import yaml
def load_modules(data):
result = yaml.load(data)
if result:
apache = result.get('apache', {})
if apache:
return apache.get('modules', [])
return []
def install_modules(modules):
installed = 0
for module in modules:
print " Installing A... | import os
import yaml
def load_modules(data):
result = yaml.load(data)
if result:
apache = result.get('apache', {})
if apache:
return apache.get('modules', [])
return []
def install_modules(modules):
installed = 0
for module in modules:
print " Installing A... | <commit_before>import os
import yaml
def load_modules(data):
result = yaml.load(data)
if result:
apache = result.get('apache', {})
if apache:
return apache.get('modules', [])
return []
def install_modules(modules):
installed = 0
for module in modules:
print "... | import os
import yaml
def load_modules(data):
result = yaml.load(data)
if result:
apache = result.get('apache', {})
if apache:
return apache.get('modules', [])
return []
def install_modules(modules):
installed = 0
for module in modules:
print " Installing A... | import os
import yaml
def load_modules(data):
result = yaml.load(data)
if result:
apache = result.get('apache', {})
if apache:
return apache.get('modules', [])
return []
def install_modules(modules):
installed = 0
for module in modules:
print " Installing A... | <commit_before>import os
import yaml
def load_modules(data):
result = yaml.load(data)
if result:
apache = result.get('apache', {})
if apache:
return apache.get('modules', [])
return []
def install_modules(modules):
installed = 0
for module in modules:
print "... |
786957cf85a641d49b4cfcceef717ef229ac8238 | tests/functional/test_requests.py | tests/functional/test_requests.py | import pytest
@pytest.mark.network
def test_timeout(script):
result = script.pip(
"--timeout",
"0.001",
"install",
"-vvv",
"INITools",
expect_error=True,
)
assert (
"Could not fetch URL https://pypi.org/simple/initools/: "
"connection error: ... | import pytest
@pytest.mark.network
def test_timeout(script):
result = script.pip(
"--timeout",
"0.0001",
"install",
"-vvv",
"INITools",
expect_error=True,
)
assert (
"Could not fetch URL https://pypi.org/simple/initools/: "
"connection error:... | Use a shorter timeout, to ensure that this fails more often | Use a shorter timeout, to ensure that this fails more often
| Python | mit | pypa/pip,sbidoul/pip,pradyunsg/pip,sbidoul/pip,pradyunsg/pip,pfmoore/pip,pypa/pip,pfmoore/pip | import pytest
@pytest.mark.network
def test_timeout(script):
result = script.pip(
"--timeout",
"0.001",
"install",
"-vvv",
"INITools",
expect_error=True,
)
assert (
"Could not fetch URL https://pypi.org/simple/initools/: "
"connection error: ... | import pytest
@pytest.mark.network
def test_timeout(script):
result = script.pip(
"--timeout",
"0.0001",
"install",
"-vvv",
"INITools",
expect_error=True,
)
assert (
"Could not fetch URL https://pypi.org/simple/initools/: "
"connection error:... | <commit_before>import pytest
@pytest.mark.network
def test_timeout(script):
result = script.pip(
"--timeout",
"0.001",
"install",
"-vvv",
"INITools",
expect_error=True,
)
assert (
"Could not fetch URL https://pypi.org/simple/initools/: "
"con... | import pytest
@pytest.mark.network
def test_timeout(script):
result = script.pip(
"--timeout",
"0.0001",
"install",
"-vvv",
"INITools",
expect_error=True,
)
assert (
"Could not fetch URL https://pypi.org/simple/initools/: "
"connection error:... | import pytest
@pytest.mark.network
def test_timeout(script):
result = script.pip(
"--timeout",
"0.001",
"install",
"-vvv",
"INITools",
expect_error=True,
)
assert (
"Could not fetch URL https://pypi.org/simple/initools/: "
"connection error: ... | <commit_before>import pytest
@pytest.mark.network
def test_timeout(script):
result = script.pip(
"--timeout",
"0.001",
"install",
"-vvv",
"INITools",
expect_error=True,
)
assert (
"Could not fetch URL https://pypi.org/simple/initools/: "
"con... |
efc857403d3c67589c1046d60e7f91132c844393 | picdescbot/twitter.py | picdescbot/twitter.py | # coding=utf-8
# picdescbot: a tiny twitter/tumblr bot that tweets random pictures from wikipedia and their descriptions
# this file implements twitter-related functionality
# Copyright (C) 2016 Elad Alfassa <elad@fedoraproject.org>
import time
import tweepy
from . import logger
class Client(object):
name = "twi... | # coding=utf-8
# picdescbot: a tiny twitter/tumblr bot that tweets random pictures from wikipedia and their descriptions
# this file implements twitter-related functionality
# Copyright (C) 2016 Elad Alfassa <elad@fedoraproject.org>
import time
import tweepy
from . import logger
class Client(object):
name = "twi... | Add source links for tweets | Add source links for tweets
| Python | mit | elad661/picdescbot | # coding=utf-8
# picdescbot: a tiny twitter/tumblr bot that tweets random pictures from wikipedia and their descriptions
# this file implements twitter-related functionality
# Copyright (C) 2016 Elad Alfassa <elad@fedoraproject.org>
import time
import tweepy
from . import logger
class Client(object):
name = "twi... | # coding=utf-8
# picdescbot: a tiny twitter/tumblr bot that tweets random pictures from wikipedia and their descriptions
# this file implements twitter-related functionality
# Copyright (C) 2016 Elad Alfassa <elad@fedoraproject.org>
import time
import tweepy
from . import logger
class Client(object):
name = "twi... | <commit_before># coding=utf-8
# picdescbot: a tiny twitter/tumblr bot that tweets random pictures from wikipedia and their descriptions
# this file implements twitter-related functionality
# Copyright (C) 2016 Elad Alfassa <elad@fedoraproject.org>
import time
import tweepy
from . import logger
class Client(object):
... | # coding=utf-8
# picdescbot: a tiny twitter/tumblr bot that tweets random pictures from wikipedia and their descriptions
# this file implements twitter-related functionality
# Copyright (C) 2016 Elad Alfassa <elad@fedoraproject.org>
import time
import tweepy
from . import logger
class Client(object):
name = "twi... | # coding=utf-8
# picdescbot: a tiny twitter/tumblr bot that tweets random pictures from wikipedia and their descriptions
# this file implements twitter-related functionality
# Copyright (C) 2016 Elad Alfassa <elad@fedoraproject.org>
import time
import tweepy
from . import logger
class Client(object):
name = "twi... | <commit_before># coding=utf-8
# picdescbot: a tiny twitter/tumblr bot that tweets random pictures from wikipedia and their descriptions
# this file implements twitter-related functionality
# Copyright (C) 2016 Elad Alfassa <elad@fedoraproject.org>
import time
import tweepy
from . import logger
class Client(object):
... |
e40a8ce30f574a8e2745fdf2c1a74e4f1c00bc0d | cached_counts/tests.py | cached_counts/tests.py | import unittest
from django.test import TestCase
from candidates.tests.test_create_person import mock_create_person
from .models import CachedCount
class CachedCountTechCase(TestCase):
def setUp(self):
initial_counts = (
{
'count_type': 'constituency',
'name':... | import unittest
from django.test import TestCase
from candidates.tests.test_create_person import mock_create_person
from .models import CachedCount
def create_initial_counts(extra=()):
initial_counts = (
{
'count_type': 'constituency',
'name': 'Dulwich and West Norwood',
... | Create initial counts outside the test class | Create initial counts outside the test class
| Python | agpl-3.0 | mysociety/yournextmp-popit,DemocracyClub/yournextrepresentative,openstate/yournextrepresentative,openstate/yournextrepresentative,YoQuieroSaber/yournextrepresentative,neavouli/yournextrepresentative,DemocracyClub/yournextrepresentative,openstate/yournextrepresentative,mysociety/yournextmp-popit,neavouli/yournextreprese... | import unittest
from django.test import TestCase
from candidates.tests.test_create_person import mock_create_person
from .models import CachedCount
class CachedCountTechCase(TestCase):
def setUp(self):
initial_counts = (
{
'count_type': 'constituency',
'name':... | import unittest
from django.test import TestCase
from candidates.tests.test_create_person import mock_create_person
from .models import CachedCount
def create_initial_counts(extra=()):
initial_counts = (
{
'count_type': 'constituency',
'name': 'Dulwich and West Norwood',
... | <commit_before>import unittest
from django.test import TestCase
from candidates.tests.test_create_person import mock_create_person
from .models import CachedCount
class CachedCountTechCase(TestCase):
def setUp(self):
initial_counts = (
{
'count_type': 'constituency',
... | import unittest
from django.test import TestCase
from candidates.tests.test_create_person import mock_create_person
from .models import CachedCount
def create_initial_counts(extra=()):
initial_counts = (
{
'count_type': 'constituency',
'name': 'Dulwich and West Norwood',
... | import unittest
from django.test import TestCase
from candidates.tests.test_create_person import mock_create_person
from .models import CachedCount
class CachedCountTechCase(TestCase):
def setUp(self):
initial_counts = (
{
'count_type': 'constituency',
'name':... | <commit_before>import unittest
from django.test import TestCase
from candidates.tests.test_create_person import mock_create_person
from .models import CachedCount
class CachedCountTechCase(TestCase):
def setUp(self):
initial_counts = (
{
'count_type': 'constituency',
... |
df57dacf8f5ec7f697247fed39ce86d3cde45615 | tests/tests_plotting/test_misc.py | tests/tests_plotting/test_misc.py | import pytest
from matplotlib import pyplot as plt
from poliastro.plotting import OrbitPlotter2D, OrbitPlotter3D
from poliastro.plotting.misc import plot_solar_system
@pytest.mark.parametrize("outer,expected", [(True, 8), (False, 4)])
def test_plot_solar_system_has_expected_number_of_orbits(outer, expected):
ass... | import pytest
from matplotlib import pyplot as plt
from poliastro.plotting import OrbitPlotter2D, OrbitPlotter3D
from poliastro.plotting.misc import plot_solar_system
@pytest.mark.parametrize("outer,expected", [(True, 8), (False, 4)])
def test_plot_solar_system_has_expected_number_of_orbits(outer, expected):
ass... | Check for error if use_3D and non-interactive | Check for error if use_3D and non-interactive
| Python | mit | poliastro/poliastro | import pytest
from matplotlib import pyplot as plt
from poliastro.plotting import OrbitPlotter2D, OrbitPlotter3D
from poliastro.plotting.misc import plot_solar_system
@pytest.mark.parametrize("outer,expected", [(True, 8), (False, 4)])
def test_plot_solar_system_has_expected_number_of_orbits(outer, expected):
ass... | import pytest
from matplotlib import pyplot as plt
from poliastro.plotting import OrbitPlotter2D, OrbitPlotter3D
from poliastro.plotting.misc import plot_solar_system
@pytest.mark.parametrize("outer,expected", [(True, 8), (False, 4)])
def test_plot_solar_system_has_expected_number_of_orbits(outer, expected):
ass... | <commit_before>import pytest
from matplotlib import pyplot as plt
from poliastro.plotting import OrbitPlotter2D, OrbitPlotter3D
from poliastro.plotting.misc import plot_solar_system
@pytest.mark.parametrize("outer,expected", [(True, 8), (False, 4)])
def test_plot_solar_system_has_expected_number_of_orbits(outer, exp... | import pytest
from matplotlib import pyplot as plt
from poliastro.plotting import OrbitPlotter2D, OrbitPlotter3D
from poliastro.plotting.misc import plot_solar_system
@pytest.mark.parametrize("outer,expected", [(True, 8), (False, 4)])
def test_plot_solar_system_has_expected_number_of_orbits(outer, expected):
ass... | import pytest
from matplotlib import pyplot as plt
from poliastro.plotting import OrbitPlotter2D, OrbitPlotter3D
from poliastro.plotting.misc import plot_solar_system
@pytest.mark.parametrize("outer,expected", [(True, 8), (False, 4)])
def test_plot_solar_system_has_expected_number_of_orbits(outer, expected):
ass... | <commit_before>import pytest
from matplotlib import pyplot as plt
from poliastro.plotting import OrbitPlotter2D, OrbitPlotter3D
from poliastro.plotting.misc import plot_solar_system
@pytest.mark.parametrize("outer,expected", [(True, 8), (False, 4)])
def test_plot_solar_system_has_expected_number_of_orbits(outer, exp... |
fae9990c2cd12ebc65abb9cbabe1b53fde9b4eec | wtforms/ext/i18n/form.py | wtforms/ext/i18n/form.py | import warnings
from wtforms import form
from wtforms.ext.i18n.utils import get_translations
translations_cache = {}
class Form(form.Form):
"""
Base form for a simple localized WTForms form.
This will use the stdlib gettext library to retrieve an appropriate
translations object for the language, by ... | import warnings
from wtforms import form
from wtforms.ext.i18n.utils import get_translations
translations_cache = {}
class Form(form.Form):
"""
Base form for a simple localized WTForms form.
**NOTE** this class is now un-necessary as the i18n features have
been moved into the core of WTForms, but it... | Make documentation more explicit for WTForms deprecation. | Make documentation more explicit for WTForms deprecation.
| Python | bsd-3-clause | cklein/wtforms,jmagnusson/wtforms,crast/wtforms,pawl/wtforms,subyraman/wtforms,Aaron1992/wtforms,hsum/wtforms,wtforms/wtforms,Xender/wtforms,skytreader/wtforms,pawl/wtforms,Aaron1992/wtforms | import warnings
from wtforms import form
from wtforms.ext.i18n.utils import get_translations
translations_cache = {}
class Form(form.Form):
"""
Base form for a simple localized WTForms form.
This will use the stdlib gettext library to retrieve an appropriate
translations object for the language, by ... | import warnings
from wtforms import form
from wtforms.ext.i18n.utils import get_translations
translations_cache = {}
class Form(form.Form):
"""
Base form for a simple localized WTForms form.
**NOTE** this class is now un-necessary as the i18n features have
been moved into the core of WTForms, but it... | <commit_before>import warnings
from wtforms import form
from wtforms.ext.i18n.utils import get_translations
translations_cache = {}
class Form(form.Form):
"""
Base form for a simple localized WTForms form.
This will use the stdlib gettext library to retrieve an appropriate
translations object for th... | import warnings
from wtforms import form
from wtforms.ext.i18n.utils import get_translations
translations_cache = {}
class Form(form.Form):
"""
Base form for a simple localized WTForms form.
**NOTE** this class is now un-necessary as the i18n features have
been moved into the core of WTForms, but it... | import warnings
from wtforms import form
from wtforms.ext.i18n.utils import get_translations
translations_cache = {}
class Form(form.Form):
"""
Base form for a simple localized WTForms form.
This will use the stdlib gettext library to retrieve an appropriate
translations object for the language, by ... | <commit_before>import warnings
from wtforms import form
from wtforms.ext.i18n.utils import get_translations
translations_cache = {}
class Form(form.Form):
"""
Base form for a simple localized WTForms form.
This will use the stdlib gettext library to retrieve an appropriate
translations object for th... |
8dff67fbffbb87ec81226ce376bc42fbcf66ea4f | xos/helloworld/models.py | xos/helloworld/models.py | from django.db import models
from core.models import User, Service, SingletonModel, PlCoreBase, Instance
from core.models.plcorebase import StrippedCharField
import os
from django.db import models
from django.forms.models import model_to_dict
from django.db.models import Q
# Create your models here.
class Hello(PlCo... | from django.db import models
from core.models import User, Service, SingletonModel, PlCoreBase, Instance
from core.models.plcorebase import StrippedCharField
import os
from django.db import models
from django.forms.models import model_to_dict
from django.db.models import Q
# Create your models here.
class Hello(PlCo... | Change old 'sliver' ref to instance | Change old 'sliver' ref to instance
| Python | apache-2.0 | opencord/xos,cboling/xos,zdw/xos,cboling/xos,zdw/xos,cboling/xos,zdw/xos,zdw/xos,open-cloud/xos,open-cloud/xos,opencord/xos,open-cloud/xos,cboling/xos,opencord/xos,cboling/xos | from django.db import models
from core.models import User, Service, SingletonModel, PlCoreBase, Instance
from core.models.plcorebase import StrippedCharField
import os
from django.db import models
from django.forms.models import model_to_dict
from django.db.models import Q
# Create your models here.
class Hello(PlCo... | from django.db import models
from core.models import User, Service, SingletonModel, PlCoreBase, Instance
from core.models.plcorebase import StrippedCharField
import os
from django.db import models
from django.forms.models import model_to_dict
from django.db.models import Q
# Create your models here.
class Hello(PlCo... | <commit_before>from django.db import models
from core.models import User, Service, SingletonModel, PlCoreBase, Instance
from core.models.plcorebase import StrippedCharField
import os
from django.db import models
from django.forms.models import model_to_dict
from django.db.models import Q
# Create your models here.
c... | from django.db import models
from core.models import User, Service, SingletonModel, PlCoreBase, Instance
from core.models.plcorebase import StrippedCharField
import os
from django.db import models
from django.forms.models import model_to_dict
from django.db.models import Q
# Create your models here.
class Hello(PlCo... | from django.db import models
from core.models import User, Service, SingletonModel, PlCoreBase, Instance
from core.models.plcorebase import StrippedCharField
import os
from django.db import models
from django.forms.models import model_to_dict
from django.db.models import Q
# Create your models here.
class Hello(PlCo... | <commit_before>from django.db import models
from core.models import User, Service, SingletonModel, PlCoreBase, Instance
from core.models.plcorebase import StrippedCharField
import os
from django.db import models
from django.forms.models import model_to_dict
from django.db.models import Q
# Create your models here.
c... |
eb15105976fd054878e0fb16a8ee6e884496b2db | dmoj/executors/RKT.py | dmoj/executors/RKT.py | from dmoj.executors.base_executor import CompiledExecutor
from dmoj.executors.mixins import ScriptDirectoryMixin
class Executor(ScriptDirectoryMixin, CompiledExecutor):
ext = '.rkt'
name = 'RKT'
fs = ['/etc/nsswitch.conf$', '/etc/passwd$']
command = 'racket'
syscalls = ['epoll_create', 'epoll_wa... | from dmoj.executors.base_executor import CompiledExecutor
from dmoj.executors.mixins import ScriptDirectoryMixin
import os
class Executor(ScriptDirectoryMixin, CompiledExecutor):
ext = '.rkt'
name = 'RKT'
fs = ['/etc/nsswitch.conf$', '/etc/passwd$', os.path.expanduser('~/\.racket/.*?')]
command = 'rac... | Fix Racket on FreeBSD after openat changes | Fix Racket on FreeBSD after openat changes
@quantum5 this feels iffy, but I think it's (marginally) better than allowing all .racket folders to be read
| Python | agpl-3.0 | DMOJ/judge,DMOJ/judge,DMOJ/judge | from dmoj.executors.base_executor import CompiledExecutor
from dmoj.executors.mixins import ScriptDirectoryMixin
class Executor(ScriptDirectoryMixin, CompiledExecutor):
ext = '.rkt'
name = 'RKT'
fs = ['/etc/nsswitch.conf$', '/etc/passwd$']
command = 'racket'
syscalls = ['epoll_create', 'epoll_wa... | from dmoj.executors.base_executor import CompiledExecutor
from dmoj.executors.mixins import ScriptDirectoryMixin
import os
class Executor(ScriptDirectoryMixin, CompiledExecutor):
ext = '.rkt'
name = 'RKT'
fs = ['/etc/nsswitch.conf$', '/etc/passwd$', os.path.expanduser('~/\.racket/.*?')]
command = 'rac... | <commit_before>from dmoj.executors.base_executor import CompiledExecutor
from dmoj.executors.mixins import ScriptDirectoryMixin
class Executor(ScriptDirectoryMixin, CompiledExecutor):
ext = '.rkt'
name = 'RKT'
fs = ['/etc/nsswitch.conf$', '/etc/passwd$']
command = 'racket'
syscalls = ['epoll_cre... | from dmoj.executors.base_executor import CompiledExecutor
from dmoj.executors.mixins import ScriptDirectoryMixin
import os
class Executor(ScriptDirectoryMixin, CompiledExecutor):
ext = '.rkt'
name = 'RKT'
fs = ['/etc/nsswitch.conf$', '/etc/passwd$', os.path.expanduser('~/\.racket/.*?')]
command = 'rac... | from dmoj.executors.base_executor import CompiledExecutor
from dmoj.executors.mixins import ScriptDirectoryMixin
class Executor(ScriptDirectoryMixin, CompiledExecutor):
ext = '.rkt'
name = 'RKT'
fs = ['/etc/nsswitch.conf$', '/etc/passwd$']
command = 'racket'
syscalls = ['epoll_create', 'epoll_wa... | <commit_before>from dmoj.executors.base_executor import CompiledExecutor
from dmoj.executors.mixins import ScriptDirectoryMixin
class Executor(ScriptDirectoryMixin, CompiledExecutor):
ext = '.rkt'
name = 'RKT'
fs = ['/etc/nsswitch.conf$', '/etc/passwd$']
command = 'racket'
syscalls = ['epoll_cre... |
ae2dd4b9fe3686aca44a21ff72a4226c6110f2ee | presentation/views.py | presentation/views.py | from django.views.generic import DetailView
from django.views.generic import ListView
from django.shortcuts import redirect, render
from .forms import PresentationCreateForm
from .models import Presentation, Slide
class PresentationList(ListView):
model = Presentation
paginate_by = 9
context_object_name ... | from django.views.generic import DetailView
from django.views.generic import ListView
from django.shortcuts import redirect, render
from pure_pagination import PaginationMixin
from .forms import PresentationCreateForm
from .models import Presentation, Slide
class PresentationList(PaginationMixin, ListView):
mod... | Add Ordering and PaginationMixin on Listview | Add Ordering and PaginationMixin on Listview
| Python | mit | SaturDJang/warp,SaturDJang/warp,SaturDJang/warp,SaturDJang/warp | from django.views.generic import DetailView
from django.views.generic import ListView
from django.shortcuts import redirect, render
from .forms import PresentationCreateForm
from .models import Presentation, Slide
class PresentationList(ListView):
model = Presentation
paginate_by = 9
context_object_name ... | from django.views.generic import DetailView
from django.views.generic import ListView
from django.shortcuts import redirect, render
from pure_pagination import PaginationMixin
from .forms import PresentationCreateForm
from .models import Presentation, Slide
class PresentationList(PaginationMixin, ListView):
mod... | <commit_before>from django.views.generic import DetailView
from django.views.generic import ListView
from django.shortcuts import redirect, render
from .forms import PresentationCreateForm
from .models import Presentation, Slide
class PresentationList(ListView):
model = Presentation
paginate_by = 9
conte... | from django.views.generic import DetailView
from django.views.generic import ListView
from django.shortcuts import redirect, render
from pure_pagination import PaginationMixin
from .forms import PresentationCreateForm
from .models import Presentation, Slide
class PresentationList(PaginationMixin, ListView):
mod... | from django.views.generic import DetailView
from django.views.generic import ListView
from django.shortcuts import redirect, render
from .forms import PresentationCreateForm
from .models import Presentation, Slide
class PresentationList(ListView):
model = Presentation
paginate_by = 9
context_object_name ... | <commit_before>from django.views.generic import DetailView
from django.views.generic import ListView
from django.shortcuts import redirect, render
from .forms import PresentationCreateForm
from .models import Presentation, Slide
class PresentationList(ListView):
model = Presentation
paginate_by = 9
conte... |
a1ad77dac17766bf8cd3427aa147b90fc094083f | dsub/_dsub_version.py | dsub/_dsub_version.py | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Update dsub version to 0.3.1 | Update dsub version to 0.3.1
PiperOrigin-RevId: 243828346
| Python | apache-2.0 | DataBiosphere/dsub,DataBiosphere/dsub | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | <commit_before># Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | <commit_before># Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.