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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
511abf77f16a7a92dde93a9f1318967b1d237635 | go_doc_get.py | go_doc_get.py | import sublime
import sublime_plugin
import webbrowser
def cleanPackage(pkgURI):
pkg = pkgURI.split('.com/')[1]
return pkg
class GoDocGetCommand(sublime_plugin.TextCommand):
def run(self, edit):
view = self.view
for region in view.sel():
selected = view.substr(region)
if "github.corp" in selected:
... | import sublime
import sublime_plugin
import webbrowser
def cleanPackage(pkgURI):
pkg = pkgURI.split('.com/')[1]
return pkg
class GoDocGetCommand(sublime_plugin.TextCommand):
def run(self, edit):
view = self.view
for region in view.sel():
selected = view.substr(region)
if "github.corp" in selected:
... | Set specific branch to go to in GitHub | Set specific branch to go to in GitHub | Python | mit | lowellmower/go_doc_get | import sublime
import sublime_plugin
import webbrowser
def cleanPackage(pkgURI):
pkg = pkgURI.split('.com/')[1]
return pkg
class GoDocGetCommand(sublime_plugin.TextCommand):
def run(self, edit):
view = self.view
for region in view.sel():
selected = view.substr(region)
if "github.corp" in selected:
... | import sublime
import sublime_plugin
import webbrowser
def cleanPackage(pkgURI):
pkg = pkgURI.split('.com/')[1]
return pkg
class GoDocGetCommand(sublime_plugin.TextCommand):
def run(self, edit):
view = self.view
for region in view.sel():
selected = view.substr(region)
if "github.corp" in selected:
... | <commit_before>import sublime
import sublime_plugin
import webbrowser
def cleanPackage(pkgURI):
pkg = pkgURI.split('.com/')[1]
return pkg
class GoDocGetCommand(sublime_plugin.TextCommand):
def run(self, edit):
view = self.view
for region in view.sel():
selected = view.substr(region)
if "github.corp" i... | import sublime
import sublime_plugin
import webbrowser
def cleanPackage(pkgURI):
pkg = pkgURI.split('.com/')[1]
return pkg
class GoDocGetCommand(sublime_plugin.TextCommand):
def run(self, edit):
view = self.view
for region in view.sel():
selected = view.substr(region)
if "github.corp" in selected:
... | import sublime
import sublime_plugin
import webbrowser
def cleanPackage(pkgURI):
pkg = pkgURI.split('.com/')[1]
return pkg
class GoDocGetCommand(sublime_plugin.TextCommand):
def run(self, edit):
view = self.view
for region in view.sel():
selected = view.substr(region)
if "github.corp" in selected:
... | <commit_before>import sublime
import sublime_plugin
import webbrowser
def cleanPackage(pkgURI):
pkg = pkgURI.split('.com/')[1]
return pkg
class GoDocGetCommand(sublime_plugin.TextCommand):
def run(self, edit):
view = self.view
for region in view.sel():
selected = view.substr(region)
if "github.corp" i... |
078a4d36c1dc088937b242ca63b88b4c03f33fa0 | isitup/main.py | isitup/main.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import requests
def check(url):
try:
response = requests.get(
"https://isitup.org/{0}.json".format(url),
headers={'User-Agent': 'https://github.com/lord63/isitup'})
except r... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import requests
def check(url):
try:
response = requests.get(
"https://isitup.org/{0}.json".format(url),
headers={'User-Agent': 'https://github.com/lord63/isitup'})
except r... | Make sure handle all the exceptions | Make sure handle all the exceptions
| Python | mit | lord63/isitup | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import requests
def check(url):
try:
response = requests.get(
"https://isitup.org/{0}.json".format(url),
headers={'User-Agent': 'https://github.com/lord63/isitup'})
except r... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import requests
def check(url):
try:
response = requests.get(
"https://isitup.org/{0}.json".format(url),
headers={'User-Agent': 'https://github.com/lord63/isitup'})
except r... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import requests
def check(url):
try:
response = requests.get(
"https://isitup.org/{0}.json".format(url),
headers={'User-Agent': 'https://github.com/lord63/isitup'... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import requests
def check(url):
try:
response = requests.get(
"https://isitup.org/{0}.json".format(url),
headers={'User-Agent': 'https://github.com/lord63/isitup'})
except r... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import requests
def check(url):
try:
response = requests.get(
"https://isitup.org/{0}.json".format(url),
headers={'User-Agent': 'https://github.com/lord63/isitup'})
except r... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import requests
def check(url):
try:
response = requests.get(
"https://isitup.org/{0}.json".format(url),
headers={'User-Agent': 'https://github.com/lord63/isitup'... |
a65eaeaef60492bfc6319fb9c810155d62c1a3b3 | luigi/tasks/export/ftp/go_annotations.py | luigi/tasks/export/ftp/go_annotations.py | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
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... | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
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... | Update name and call correct export | Update name and call correct export
This now calls the correct export function. Additionally, the class name
is changed to reflect it does export.
| Python | apache-2.0 | RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
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... | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
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... | <commit_before># -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
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
Unl... | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
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... | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
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... | <commit_before># -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
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
Unl... |
e74dcb6d19b737a0ec069a9bdda689731a0f295b | sqlalchemy_seed/mixin.py | sqlalchemy_seed/mixin.py | # -*- coding: utf-8 -*-
"""
sqlalchemy_seed.seed_mixin
~~~~~~~~~~~~~~~~~~~~~~~~~~
Mixin class for unittest.
:copyright: (c) 2017 Shinya Ohyanagi, All rights reserved.
:license: BSD, see LICENSE for more details.
"""
from . import (
create_table,
drop_table,
load_fixture_files,
loa... | # -*- coding: utf-8 -*-
"""
sqlalchemy_seed.seed_mixin
~~~~~~~~~~~~~~~~~~~~~~~~~~
Mixin class for unittest.
:copyright: (c) 2017 Shinya Ohyanagi, All rights reserved.
:license: BSD, see LICENSE for more details.
"""
from . import (
create_table,
drop_table,
load_fixture_files,
loa... | Fix typo in SeedMixin.tearDownClass name | Fix typo in SeedMixin.tearDownClass name | Python | bsd-3-clause | heavenshell/py-sqlalchemy_seed | # -*- coding: utf-8 -*-
"""
sqlalchemy_seed.seed_mixin
~~~~~~~~~~~~~~~~~~~~~~~~~~
Mixin class for unittest.
:copyright: (c) 2017 Shinya Ohyanagi, All rights reserved.
:license: BSD, see LICENSE for more details.
"""
from . import (
create_table,
drop_table,
load_fixture_files,
loa... | # -*- coding: utf-8 -*-
"""
sqlalchemy_seed.seed_mixin
~~~~~~~~~~~~~~~~~~~~~~~~~~
Mixin class for unittest.
:copyright: (c) 2017 Shinya Ohyanagi, All rights reserved.
:license: BSD, see LICENSE for more details.
"""
from . import (
create_table,
drop_table,
load_fixture_files,
loa... | <commit_before># -*- coding: utf-8 -*-
"""
sqlalchemy_seed.seed_mixin
~~~~~~~~~~~~~~~~~~~~~~~~~~
Mixin class for unittest.
:copyright: (c) 2017 Shinya Ohyanagi, All rights reserved.
:license: BSD, see LICENSE for more details.
"""
from . import (
create_table,
drop_table,
load_fixture... | # -*- coding: utf-8 -*-
"""
sqlalchemy_seed.seed_mixin
~~~~~~~~~~~~~~~~~~~~~~~~~~
Mixin class for unittest.
:copyright: (c) 2017 Shinya Ohyanagi, All rights reserved.
:license: BSD, see LICENSE for more details.
"""
from . import (
create_table,
drop_table,
load_fixture_files,
loa... | # -*- coding: utf-8 -*-
"""
sqlalchemy_seed.seed_mixin
~~~~~~~~~~~~~~~~~~~~~~~~~~
Mixin class for unittest.
:copyright: (c) 2017 Shinya Ohyanagi, All rights reserved.
:license: BSD, see LICENSE for more details.
"""
from . import (
create_table,
drop_table,
load_fixture_files,
loa... | <commit_before># -*- coding: utf-8 -*-
"""
sqlalchemy_seed.seed_mixin
~~~~~~~~~~~~~~~~~~~~~~~~~~
Mixin class for unittest.
:copyright: (c) 2017 Shinya Ohyanagi, All rights reserved.
:license: BSD, see LICENSE for more details.
"""
from . import (
create_table,
drop_table,
load_fixture... |
a74fe1e0d72821afd643142ae283634bd4e3cc71 | masters/master.client.syzygy/master_source_cfg.py | masters/master.client.syzygy/master_source_cfg.py | # Copyright (c) 2011 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.
from buildbot.changes import svnpoller
from master import build_utils
def SyzygyFileSplitter(path):
"""split_file for Syzygy."""
projects = ['trunk... | # Copyright (c) 2011 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.
from buildbot.changes import svnpoller
from master import build_utils
def SyzygyFileSplitter(path):
"""split_file for Syzygy."""
projects = ['trunk... | Fix link to revision to use 'sawbuck' rather than 'syzygy' | Fix link to revision to use 'sawbuck' rather than 'syzygy'
Review URL: http://codereview.chromium.org/6992029
git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@86449 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | eunchong/build,eunchong/build,eunchong/build,eunchong/build | # Copyright (c) 2011 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.
from buildbot.changes import svnpoller
from master import build_utils
def SyzygyFileSplitter(path):
"""split_file for Syzygy."""
projects = ['trunk... | # Copyright (c) 2011 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.
from buildbot.changes import svnpoller
from master import build_utils
def SyzygyFileSplitter(path):
"""split_file for Syzygy."""
projects = ['trunk... | <commit_before># Copyright (c) 2011 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.
from buildbot.changes import svnpoller
from master import build_utils
def SyzygyFileSplitter(path):
"""split_file for Syzygy."""
pro... | # Copyright (c) 2011 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.
from buildbot.changes import svnpoller
from master import build_utils
def SyzygyFileSplitter(path):
"""split_file for Syzygy."""
projects = ['trunk... | # Copyright (c) 2011 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.
from buildbot.changes import svnpoller
from master import build_utils
def SyzygyFileSplitter(path):
"""split_file for Syzygy."""
projects = ['trunk... | <commit_before># Copyright (c) 2011 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.
from buildbot.changes import svnpoller
from master import build_utils
def SyzygyFileSplitter(path):
"""split_file for Syzygy."""
pro... |
d3cea746432b1bfd1b5f2d38972c1b761b96e8eb | fetchroots.py | fetchroots.py | import os
import base64
from requests import Session, Request
from OpenSSL import crypto
#url = 'http://ct.googleapis.com/aviator/ct/v1/get-roots'
url = 'https://ct.api.venafi.com/ct/v1/get-roots'
s = Session()
r = Request('GET',
url)
prepped = r.prepare()
r = s.send(prepped)
if r.status_code == 20... | import os
import base64
from requests import Session, Request
from OpenSSL import crypto
url = 'http://ct.googleapis.com/aviator/ct/v1/get-roots'
s = Session()
r = Request('GET',
url)
prepped = r.prepare()
r = s.send(prepped)
if r.status_code == 200:
roots = r.json()
# RFC 6962 defines the cert... | Update to use Google Aviator test log | Update to use Google Aviator test log
| Python | apache-2.0 | wgoulet/CTPyClient | import os
import base64
from requests import Session, Request
from OpenSSL import crypto
#url = 'http://ct.googleapis.com/aviator/ct/v1/get-roots'
url = 'https://ct.api.venafi.com/ct/v1/get-roots'
s = Session()
r = Request('GET',
url)
prepped = r.prepare()
r = s.send(prepped)
if r.status_code == 20... | import os
import base64
from requests import Session, Request
from OpenSSL import crypto
url = 'http://ct.googleapis.com/aviator/ct/v1/get-roots'
s = Session()
r = Request('GET',
url)
prepped = r.prepare()
r = s.send(prepped)
if r.status_code == 200:
roots = r.json()
# RFC 6962 defines the cert... | <commit_before>import os
import base64
from requests import Session, Request
from OpenSSL import crypto
#url = 'http://ct.googleapis.com/aviator/ct/v1/get-roots'
url = 'https://ct.api.venafi.com/ct/v1/get-roots'
s = Session()
r = Request('GET',
url)
prepped = r.prepare()
r = s.send(prepped)
if r.st... | import os
import base64
from requests import Session, Request
from OpenSSL import crypto
url = 'http://ct.googleapis.com/aviator/ct/v1/get-roots'
s = Session()
r = Request('GET',
url)
prepped = r.prepare()
r = s.send(prepped)
if r.status_code == 200:
roots = r.json()
# RFC 6962 defines the cert... | import os
import base64
from requests import Session, Request
from OpenSSL import crypto
#url = 'http://ct.googleapis.com/aviator/ct/v1/get-roots'
url = 'https://ct.api.venafi.com/ct/v1/get-roots'
s = Session()
r = Request('GET',
url)
prepped = r.prepare()
r = s.send(prepped)
if r.status_code == 20... | <commit_before>import os
import base64
from requests import Session, Request
from OpenSSL import crypto
#url = 'http://ct.googleapis.com/aviator/ct/v1/get-roots'
url = 'https://ct.api.venafi.com/ct/v1/get-roots'
s = Session()
r = Request('GET',
url)
prepped = r.prepare()
r = s.send(prepped)
if r.st... |
95b90325b1dfa535fc802ad2a06f15e30010bf3a | fore/hotswap.py | fore/hotswap.py | import os
import logging
import threading
log = logging.getLogger(__name__)
class Hotswap(threading.Thread):
def __init__(self, out, mod, *args, **kwargs):
self.out = out
self.gen = mod.generate(*args, **kwargs)
threading.Thread.__init__(self)
self.daemon = True
def run(self... | import os
import logging
import threading
log = logging.getLogger(__name__)
class Hotswap(threading.Thread):
def __init__(self, out, mod, *args, **kwargs):
self.out = out
self.gen = mod.generate(*args, **kwargs)
threading.Thread.__init__(self)
self.daemon = True
def run(self... | Use next(it) instead of it.next() | Hotswap: Use next(it) instead of it.next()
| Python | artistic-2.0 | MikeiLL/appension,MikeiLL/appension,Rosuav/appension,MikeiLL/appension,Rosuav/appension,MikeiLL/appension,Rosuav/appension,Rosuav/appension | import os
import logging
import threading
log = logging.getLogger(__name__)
class Hotswap(threading.Thread):
def __init__(self, out, mod, *args, **kwargs):
self.out = out
self.gen = mod.generate(*args, **kwargs)
threading.Thread.__init__(self)
self.daemon = True
def run(self... | import os
import logging
import threading
log = logging.getLogger(__name__)
class Hotswap(threading.Thread):
def __init__(self, out, mod, *args, **kwargs):
self.out = out
self.gen = mod.generate(*args, **kwargs)
threading.Thread.__init__(self)
self.daemon = True
def run(self... | <commit_before>import os
import logging
import threading
log = logging.getLogger(__name__)
class Hotswap(threading.Thread):
def __init__(self, out, mod, *args, **kwargs):
self.out = out
self.gen = mod.generate(*args, **kwargs)
threading.Thread.__init__(self)
self.daemon = True
... | import os
import logging
import threading
log = logging.getLogger(__name__)
class Hotswap(threading.Thread):
def __init__(self, out, mod, *args, **kwargs):
self.out = out
self.gen = mod.generate(*args, **kwargs)
threading.Thread.__init__(self)
self.daemon = True
def run(self... | import os
import logging
import threading
log = logging.getLogger(__name__)
class Hotswap(threading.Thread):
def __init__(self, out, mod, *args, **kwargs):
self.out = out
self.gen = mod.generate(*args, **kwargs)
threading.Thread.__init__(self)
self.daemon = True
def run(self... | <commit_before>import os
import logging
import threading
log = logging.getLogger(__name__)
class Hotswap(threading.Thread):
def __init__(self, out, mod, *args, **kwargs):
self.out = out
self.gen = mod.generate(*args, **kwargs)
threading.Thread.__init__(self)
self.daemon = True
... |
a727161f67edff10bb94785e70add7c42ba99dcc | morepath/tests/test_app.py | morepath/tests/test_app.py | from morepath.app import App, global_app
import morepath
def setup_module(module):
morepath.disable_implicit()
def test_global_app():
assert global_app.extends == []
assert global_app.name == 'global_app'
def test_app_without_extends():
myapp = App()
assert myapp.extends == [global_app]
as... | from morepath.app import App, global_app
import morepath
def setup_module(module):
morepath.disable_implicit()
def test_global_app():
assert global_app.extends == []
assert global_app.name == 'global_app'
def test_app_without_extends():
myapp = App()
assert myapp.extends == [global_app]
as... | Add coverage of __repr__ of app. | Add coverage of __repr__ of app.
| Python | bsd-3-clause | morepath/morepath,faassen/morepath,taschini/morepath | from morepath.app import App, global_app
import morepath
def setup_module(module):
morepath.disable_implicit()
def test_global_app():
assert global_app.extends == []
assert global_app.name == 'global_app'
def test_app_without_extends():
myapp = App()
assert myapp.extends == [global_app]
as... | from morepath.app import App, global_app
import morepath
def setup_module(module):
morepath.disable_implicit()
def test_global_app():
assert global_app.extends == []
assert global_app.name == 'global_app'
def test_app_without_extends():
myapp = App()
assert myapp.extends == [global_app]
as... | <commit_before>from morepath.app import App, global_app
import morepath
def setup_module(module):
morepath.disable_implicit()
def test_global_app():
assert global_app.extends == []
assert global_app.name == 'global_app'
def test_app_without_extends():
myapp = App()
assert myapp.extends == [glo... | from morepath.app import App, global_app
import morepath
def setup_module(module):
morepath.disable_implicit()
def test_global_app():
assert global_app.extends == []
assert global_app.name == 'global_app'
def test_app_without_extends():
myapp = App()
assert myapp.extends == [global_app]
as... | from morepath.app import App, global_app
import morepath
def setup_module(module):
morepath.disable_implicit()
def test_global_app():
assert global_app.extends == []
assert global_app.name == 'global_app'
def test_app_without_extends():
myapp = App()
assert myapp.extends == [global_app]
as... | <commit_before>from morepath.app import App, global_app
import morepath
def setup_module(module):
morepath.disable_implicit()
def test_global_app():
assert global_app.extends == []
assert global_app.name == 'global_app'
def test_app_without_extends():
myapp = App()
assert myapp.extends == [glo... |
7e00b8a4436ee4bdad4d248a29985b1cef741a53 | nimbus/apps/media/utils.py | nimbus/apps/media/utils.py | def bsd_rand(seed):
return (1103515245 * seed + 12345) & 0x7fffffff
def baseconv(v1, a1, a2):
n1 = {c: i for i, c in dict(enumerate(a1)).items()}
b1 = len(a1)
b2 = len(a2)
d1 = 0
for i, c in enumerate(v1):
d1 += n1[c] * pow(b1, b1 - i - 1)
v2 = ""
while d1:
v2 = a2[d1... | from nimbus.settings import SECRET_KEY
import hashlib
def baseconv(v1, a1, a2):
n1 = {c: i for i, c in enumerate(a1)}
b1 = len(a1)
b2 = len(a2)
d1 = 0
for i, c in enumerate(v1):
d1 += n1[c] * pow(b1, len(v1) - i - 1)
v2 = ""
while d1:
v2 = a2[d1 % b2] + v2
d1 //=... | Patch bug and security vulnerability | Patch bug and security vulnerability
| Python | mit | ethanal/Nimbus,ethanal/Nimbus,ethanal/Nimbus,ethanal/Nimbus | def bsd_rand(seed):
return (1103515245 * seed + 12345) & 0x7fffffff
def baseconv(v1, a1, a2):
n1 = {c: i for i, c in dict(enumerate(a1)).items()}
b1 = len(a1)
b2 = len(a2)
d1 = 0
for i, c in enumerate(v1):
d1 += n1[c] * pow(b1, b1 - i - 1)
v2 = ""
while d1:
v2 = a2[d1... | from nimbus.settings import SECRET_KEY
import hashlib
def baseconv(v1, a1, a2):
n1 = {c: i for i, c in enumerate(a1)}
b1 = len(a1)
b2 = len(a2)
d1 = 0
for i, c in enumerate(v1):
d1 += n1[c] * pow(b1, len(v1) - i - 1)
v2 = ""
while d1:
v2 = a2[d1 % b2] + v2
d1 //=... | <commit_before>def bsd_rand(seed):
return (1103515245 * seed + 12345) & 0x7fffffff
def baseconv(v1, a1, a2):
n1 = {c: i for i, c in dict(enumerate(a1)).items()}
b1 = len(a1)
b2 = len(a2)
d1 = 0
for i, c in enumerate(v1):
d1 += n1[c] * pow(b1, b1 - i - 1)
v2 = ""
while d1:
... | from nimbus.settings import SECRET_KEY
import hashlib
def baseconv(v1, a1, a2):
n1 = {c: i for i, c in enumerate(a1)}
b1 = len(a1)
b2 = len(a2)
d1 = 0
for i, c in enumerate(v1):
d1 += n1[c] * pow(b1, len(v1) - i - 1)
v2 = ""
while d1:
v2 = a2[d1 % b2] + v2
d1 //=... | def bsd_rand(seed):
return (1103515245 * seed + 12345) & 0x7fffffff
def baseconv(v1, a1, a2):
n1 = {c: i for i, c in dict(enumerate(a1)).items()}
b1 = len(a1)
b2 = len(a2)
d1 = 0
for i, c in enumerate(v1):
d1 += n1[c] * pow(b1, b1 - i - 1)
v2 = ""
while d1:
v2 = a2[d1... | <commit_before>def bsd_rand(seed):
return (1103515245 * seed + 12345) & 0x7fffffff
def baseconv(v1, a1, a2):
n1 = {c: i for i, c in dict(enumerate(a1)).items()}
b1 = len(a1)
b2 = len(a2)
d1 = 0
for i, c in enumerate(v1):
d1 += n1[c] * pow(b1, b1 - i - 1)
v2 = ""
while d1:
... |
a646bf7d791e84f4fa258e0c258e598c8d3f43d2 | code/python/seizures/prediction/PredictorBase.py | code/python/seizures/prediction/PredictorBase.py | from abc import abstractmethod
class PredictorBase(object):
""""
Abstract base class that implement the interface that we use for our
predictors. Classic supervised learning.
@author: Heiko
"""
@abstractmethod
def fit(self, X, y):
"""
Method to fit the model.
... | from abc import abstractmethod
class PredictorBase(object):
""""
Abstract base class that implement the interface that we use for our
predictors. Classic supervised learning.
@author: Heiko
"""
@abstractmethod
def fit(self, X, y):
"""
Method to fit the model.
... | Remove y from base predictor. | Remove y from base predictor. | Python | bsd-2-clause | vincentadam87/gatsby-hackathon-seizure,vincentadam87/gatsby-hackathon-seizure | from abc import abstractmethod
class PredictorBase(object):
""""
Abstract base class that implement the interface that we use for our
predictors. Classic supervised learning.
@author: Heiko
"""
@abstractmethod
def fit(self, X, y):
"""
Method to fit the model.
... | from abc import abstractmethod
class PredictorBase(object):
""""
Abstract base class that implement the interface that we use for our
predictors. Classic supervised learning.
@author: Heiko
"""
@abstractmethod
def fit(self, X, y):
"""
Method to fit the model.
... | <commit_before>from abc import abstractmethod
class PredictorBase(object):
""""
Abstract base class that implement the interface that we use for our
predictors. Classic supervised learning.
@author: Heiko
"""
@abstractmethod
def fit(self, X, y):
"""
Method to fit the ... | from abc import abstractmethod
class PredictorBase(object):
""""
Abstract base class that implement the interface that we use for our
predictors. Classic supervised learning.
@author: Heiko
"""
@abstractmethod
def fit(self, X, y):
"""
Method to fit the model.
... | from abc import abstractmethod
class PredictorBase(object):
""""
Abstract base class that implement the interface that we use for our
predictors. Classic supervised learning.
@author: Heiko
"""
@abstractmethod
def fit(self, X, y):
"""
Method to fit the model.
... | <commit_before>from abc import abstractmethod
class PredictorBase(object):
""""
Abstract base class that implement the interface that we use for our
predictors. Classic supervised learning.
@author: Heiko
"""
@abstractmethod
def fit(self, X, y):
"""
Method to fit the ... |
8a4a8cc351ae7fecd53932d0fb6ca0a7f9a83fbc | falcom/api/test/test_uris.py | falcom/api/test/test_uris.py | # Copyright (c) 2017 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.
from hamcrest import *
import unittest
from .hamcrest import ComposedAssertion
from ..uri import URI
# There are three URIs that I need to u... | # Copyright (c) 2017 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.
from hamcrest import *
import unittest
from .hamcrest import ComposedAssertion
from ..uri import URI
# There are three URIs that I need to u... | Refactor a test into its own "given" test class | Refactor a test into its own "given" test class
| Python | bsd-3-clause | mlibrary/image-conversion-and-validation,mlibrary/image-conversion-and-validation | # Copyright (c) 2017 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.
from hamcrest import *
import unittest
from .hamcrest import ComposedAssertion
from ..uri import URI
# There are three URIs that I need to u... | # Copyright (c) 2017 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.
from hamcrest import *
import unittest
from .hamcrest import ComposedAssertion
from ..uri import URI
# There are three URIs that I need to u... | <commit_before># Copyright (c) 2017 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.
from hamcrest import *
import unittest
from .hamcrest import ComposedAssertion
from ..uri import URI
# There are three URIs t... | # Copyright (c) 2017 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.
from hamcrest import *
import unittest
from .hamcrest import ComposedAssertion
from ..uri import URI
# There are three URIs that I need to u... | # Copyright (c) 2017 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.
from hamcrest import *
import unittest
from .hamcrest import ComposedAssertion
from ..uri import URI
# There are three URIs that I need to u... | <commit_before># Copyright (c) 2017 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.
from hamcrest import *
import unittest
from .hamcrest import ComposedAssertion
from ..uri import URI
# There are three URIs t... |
c84aef2acef68d5feadb23aa045d9aa6e2f8512d | tests/app/dao/test_fees_dao.py | tests/app/dao/test_fees_dao.py | from app.dao.fees_dao import dao_update_fee, dao_get_fees, dao_get_fee_by_id
from app.models import Fee
from tests.db import create_fee
class WhenUsingFeesDAO(object):
def it_creates_a_fee(self, db_session):
fee = create_fee()
assert Fee.query.count() == 1
fee_from_db = Fee.query.filter... | from app.dao.fees_dao import dao_update_fee, dao_get_fees, dao_get_fee_by_id
from app.models import Fee
from tests.db import create_fee
class WhenUsingFeesDAO(object):
def it_creates_a_fee(self, db_session):
fee = create_fee()
assert Fee.query.count() == 1
fee_from_db = Fee.query.filter... | Make fees dao test clearer | Make fees dao test clearer
| Python | mit | NewAcropolis/api,NewAcropolis/api,NewAcropolis/api | from app.dao.fees_dao import dao_update_fee, dao_get_fees, dao_get_fee_by_id
from app.models import Fee
from tests.db import create_fee
class WhenUsingFeesDAO(object):
def it_creates_a_fee(self, db_session):
fee = create_fee()
assert Fee.query.count() == 1
fee_from_db = Fee.query.filter... | from app.dao.fees_dao import dao_update_fee, dao_get_fees, dao_get_fee_by_id
from app.models import Fee
from tests.db import create_fee
class WhenUsingFeesDAO(object):
def it_creates_a_fee(self, db_session):
fee = create_fee()
assert Fee.query.count() == 1
fee_from_db = Fee.query.filter... | <commit_before>from app.dao.fees_dao import dao_update_fee, dao_get_fees, dao_get_fee_by_id
from app.models import Fee
from tests.db import create_fee
class WhenUsingFeesDAO(object):
def it_creates_a_fee(self, db_session):
fee = create_fee()
assert Fee.query.count() == 1
fee_from_db = F... | from app.dao.fees_dao import dao_update_fee, dao_get_fees, dao_get_fee_by_id
from app.models import Fee
from tests.db import create_fee
class WhenUsingFeesDAO(object):
def it_creates_a_fee(self, db_session):
fee = create_fee()
assert Fee.query.count() == 1
fee_from_db = Fee.query.filter... | from app.dao.fees_dao import dao_update_fee, dao_get_fees, dao_get_fee_by_id
from app.models import Fee
from tests.db import create_fee
class WhenUsingFeesDAO(object):
def it_creates_a_fee(self, db_session):
fee = create_fee()
assert Fee.query.count() == 1
fee_from_db = Fee.query.filter... | <commit_before>from app.dao.fees_dao import dao_update_fee, dao_get_fees, dao_get_fee_by_id
from app.models import Fee
from tests.db import create_fee
class WhenUsingFeesDAO(object):
def it_creates_a_fee(self, db_session):
fee = create_fee()
assert Fee.query.count() == 1
fee_from_db = F... |
0fa938a459293849761fe344c963c503e59e24df | tests/test_cross_validation.py | tests/test_cross_validation.py | import pytest
from lightfm.cross_validation import random_train_test_split
from lightfm.datasets import fetch_movielens
def _assert_disjoint(x, y):
x = x.tocsr()
y = y.tocoo()
for (i, j) in zip(y.row, y.col):
assert x[i, j] == 0.0
@pytest.mark.parametrize('test_percentage',
... | import pytest
from lightfm.cross_validation import random_train_test_split
from lightfm.datasets import fetch_movielens
def _assert_disjoint(x, y):
x = x.tocsr()
y = y.tocoo()
for (i, j) in zip(y.row, y.col):
assert x[i, j] == 0.0
@pytest.mark.parametrize('test_percentage',
... | Make tests work with Python 2.7. | Make tests work with Python 2.7.
| Python | apache-2.0 | lyst/lightfm,maciejkula/lightfm | import pytest
from lightfm.cross_validation import random_train_test_split
from lightfm.datasets import fetch_movielens
def _assert_disjoint(x, y):
x = x.tocsr()
y = y.tocoo()
for (i, j) in zip(y.row, y.col):
assert x[i, j] == 0.0
@pytest.mark.parametrize('test_percentage',
... | import pytest
from lightfm.cross_validation import random_train_test_split
from lightfm.datasets import fetch_movielens
def _assert_disjoint(x, y):
x = x.tocsr()
y = y.tocoo()
for (i, j) in zip(y.row, y.col):
assert x[i, j] == 0.0
@pytest.mark.parametrize('test_percentage',
... | <commit_before>import pytest
from lightfm.cross_validation import random_train_test_split
from lightfm.datasets import fetch_movielens
def _assert_disjoint(x, y):
x = x.tocsr()
y = y.tocoo()
for (i, j) in zip(y.row, y.col):
assert x[i, j] == 0.0
@pytest.mark.parametrize('test_percentage',
... | import pytest
from lightfm.cross_validation import random_train_test_split
from lightfm.datasets import fetch_movielens
def _assert_disjoint(x, y):
x = x.tocsr()
y = y.tocoo()
for (i, j) in zip(y.row, y.col):
assert x[i, j] == 0.0
@pytest.mark.parametrize('test_percentage',
... | import pytest
from lightfm.cross_validation import random_train_test_split
from lightfm.datasets import fetch_movielens
def _assert_disjoint(x, y):
x = x.tocsr()
y = y.tocoo()
for (i, j) in zip(y.row, y.col):
assert x[i, j] == 0.0
@pytest.mark.parametrize('test_percentage',
... | <commit_before>import pytest
from lightfm.cross_validation import random_train_test_split
from lightfm.datasets import fetch_movielens
def _assert_disjoint(x, y):
x = x.tocsr()
y = y.tocoo()
for (i, j) in zip(y.row, y.col):
assert x[i, j] == 0.0
@pytest.mark.parametrize('test_percentage',
... |
5eb8297b6da0b0cfd885975d5b9993a07acca426 | importlib_metadata/__init__.py | importlib_metadata/__init__.py | import os
import sys
import glob
import email
import itertools
import contextlib
class Distribution:
def __init__(self, path):
"""
Construct a distribution from a path to the metadata dir
"""
self.path = path
@classmethod
def for_name(cls, name, path=sys.path):
for... | import os
import sys
import glob
import email
import itertools
import contextlib
class Distribution:
def __init__(self, path):
"""
Construct a distribution from a path to the metadata dir
"""
self.path = path
@classmethod
def for_name(cls, name, path=sys.path):
glo... | Fix logic in path search. | Fix logic in path search.
| Python | apache-2.0 | python/importlib_metadata | import os
import sys
import glob
import email
import itertools
import contextlib
class Distribution:
def __init__(self, path):
"""
Construct a distribution from a path to the metadata dir
"""
self.path = path
@classmethod
def for_name(cls, name, path=sys.path):
for... | import os
import sys
import glob
import email
import itertools
import contextlib
class Distribution:
def __init__(self, path):
"""
Construct a distribution from a path to the metadata dir
"""
self.path = path
@classmethod
def for_name(cls, name, path=sys.path):
glo... | <commit_before>import os
import sys
import glob
import email
import itertools
import contextlib
class Distribution:
def __init__(self, path):
"""
Construct a distribution from a path to the metadata dir
"""
self.path = path
@classmethod
def for_name(cls, name, path=sys.pat... | import os
import sys
import glob
import email
import itertools
import contextlib
class Distribution:
def __init__(self, path):
"""
Construct a distribution from a path to the metadata dir
"""
self.path = path
@classmethod
def for_name(cls, name, path=sys.path):
glo... | import os
import sys
import glob
import email
import itertools
import contextlib
class Distribution:
def __init__(self, path):
"""
Construct a distribution from a path to the metadata dir
"""
self.path = path
@classmethod
def for_name(cls, name, path=sys.path):
for... | <commit_before>import os
import sys
import glob
import email
import itertools
import contextlib
class Distribution:
def __init__(self, path):
"""
Construct a distribution from a path to the metadata dir
"""
self.path = path
@classmethod
def for_name(cls, name, path=sys.pat... |
694575e2707bdf7a2e042e2dd443a46481bc9d39 | source/segue/__init__.py | source/segue/__init__.py | # :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
| # :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
import os
import imp
import uuid
def discover_processors(paths=None, options=None):
'''Return processor plugins discovered on *paths*.
If *paths* is None will try to use environment variable
:env... | Add helper function for discovering processor plugins. | Add helper function for discovering processor plugins.
| Python | apache-2.0 | 4degrees/segue | # :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
Add helper function for discovering processor plugins. | # :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
import os
import imp
import uuid
def discover_processors(paths=None, options=None):
'''Return processor plugins discovered on *paths*.
If *paths* is None will try to use environment variable
:env... | <commit_before># :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
<commit_msg>Add helper function for discovering processor plugins.<commit_after> | # :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
import os
import imp
import uuid
def discover_processors(paths=None, options=None):
'''Return processor plugins discovered on *paths*.
If *paths* is None will try to use environment variable
:env... | # :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
Add helper function for discovering processor plugins.# :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
import os
import imp
import uuid
def discover_processo... | <commit_before># :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
<commit_msg>Add helper function for discovering processor plugins.<commit_after># :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
import os
impor... |
8754f8b73b140fa597de1f70a0cf636d198fadb2 | extension_course/tests/conftest.py | extension_course/tests/conftest.py | from events.tests.conftest import (administrative_division, administrative_division_type, data_source, event, # noqa
location_id, minimal_event_dict, municipality, organization, place, user,
user_api_client, django_db_modify_db_settings, django_db_s... | from events.tests.conftest import (administrative_division, administrative_division_type, data_source, event, # noqa
location_id, minimal_event_dict, municipality, organization, place, user,
user_api_client, django_db_modify_db_settings, django_db_s... | Add new make_* fixtures to extension_course tests | Add new make_* fixtures to extension_course tests
| Python | mit | City-of-Helsinki/linkedevents,City-of-Helsinki/linkedevents,City-of-Helsinki/linkedevents | from events.tests.conftest import (administrative_division, administrative_division_type, data_source, event, # noqa
location_id, minimal_event_dict, municipality, organization, place, user,
user_api_client, django_db_modify_db_settings, django_db_s... | from events.tests.conftest import (administrative_division, administrative_division_type, data_source, event, # noqa
location_id, minimal_event_dict, municipality, organization, place, user,
user_api_client, django_db_modify_db_settings, django_db_s... | <commit_before>from events.tests.conftest import (administrative_division, administrative_division_type, data_source, event, # noqa
location_id, minimal_event_dict, municipality, organization, place, user,
user_api_client, django_db_modify_db_settin... | from events.tests.conftest import (administrative_division, administrative_division_type, data_source, event, # noqa
location_id, minimal_event_dict, municipality, organization, place, user,
user_api_client, django_db_modify_db_settings, django_db_s... | from events.tests.conftest import (administrative_division, administrative_division_type, data_source, event, # noqa
location_id, minimal_event_dict, municipality, organization, place, user,
user_api_client, django_db_modify_db_settings, django_db_s... | <commit_before>from events.tests.conftest import (administrative_division, administrative_division_type, data_source, event, # noqa
location_id, minimal_event_dict, municipality, organization, place, user,
user_api_client, django_db_modify_db_settin... |
e0d909e25fbf47ebad35756032c9230fe3d3bdaa | example/example/tasksapp/run_tasks.py | example/example/tasksapp/run_tasks.py | import time
from dj_experiment.tasks.tasks import longtime_add, netcdf_save
if __name__ == '__main__':
result = longtime_add.delay(1, 2)
# at this time, our task is not finished, so it will return False
print 'Task finished? ', result.ready()
print 'Task result: ', result.result
# sleep 10 seconds... | import os
import time
from dj_experiment.tasks.tasks import longtime_add, netcdf_save
from example.settings import (DJ_EXPERIMENT_BASE_DATA_DIR,
DJ_EXPERIMENT_DATA_DIR)
if __name__ == '__main__':
result = longtime_add.delay(1, 2)
# at this time, our task is not finished, so it wi... | Fix parameters in task call | Fix parameters in task call
| Python | mit | francbartoli/dj-experiment,francbartoli/dj-experiment | import time
from dj_experiment.tasks.tasks import longtime_add, netcdf_save
if __name__ == '__main__':
result = longtime_add.delay(1, 2)
# at this time, our task is not finished, so it will return False
print 'Task finished? ', result.ready()
print 'Task result: ', result.result
# sleep 10 seconds... | import os
import time
from dj_experiment.tasks.tasks import longtime_add, netcdf_save
from example.settings import (DJ_EXPERIMENT_BASE_DATA_DIR,
DJ_EXPERIMENT_DATA_DIR)
if __name__ == '__main__':
result = longtime_add.delay(1, 2)
# at this time, our task is not finished, so it wi... | <commit_before>import time
from dj_experiment.tasks.tasks import longtime_add, netcdf_save
if __name__ == '__main__':
result = longtime_add.delay(1, 2)
# at this time, our task is not finished, so it will return False
print 'Task finished? ', result.ready()
print 'Task result: ', result.result
# s... | import os
import time
from dj_experiment.tasks.tasks import longtime_add, netcdf_save
from example.settings import (DJ_EXPERIMENT_BASE_DATA_DIR,
DJ_EXPERIMENT_DATA_DIR)
if __name__ == '__main__':
result = longtime_add.delay(1, 2)
# at this time, our task is not finished, so it wi... | import time
from dj_experiment.tasks.tasks import longtime_add, netcdf_save
if __name__ == '__main__':
result = longtime_add.delay(1, 2)
# at this time, our task is not finished, so it will return False
print 'Task finished? ', result.ready()
print 'Task result: ', result.result
# sleep 10 seconds... | <commit_before>import time
from dj_experiment.tasks.tasks import longtime_add, netcdf_save
if __name__ == '__main__':
result = longtime_add.delay(1, 2)
# at this time, our task is not finished, so it will return False
print 'Task finished? ', result.ready()
print 'Task result: ', result.result
# s... |
21e15235b2cd767e0da56a2a0d224824fda58c42 | Tools/idle/ZoomHeight.py | Tools/idle/ZoomHeight.py | # Sample extension: zoom a window to maximum height
import re
import sys
class ZoomHeight:
menudefs = [
('windows', [
('_Zoom Height', '<<zoom-height>>'),
])
]
windows_keydefs = {
'<<zoom-height>>': ['<Alt-F2>'],
}
unix_keydefs = {
'<<zoom-height>>': ... | # Sample extension: zoom a window to maximum height
import re
import sys
class ZoomHeight:
menudefs = [
('windows', [
('_Zoom Height', '<<zoom-height>>'),
])
]
windows_keydefs = {
'<<zoom-height>>': ['<Alt-F2>'],
}
unix_keydefs = {
'<<zoom-height>>': ... | Move zoom height functionality to separate function. | Move zoom height functionality to separate function.
| Python | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | # Sample extension: zoom a window to maximum height
import re
import sys
class ZoomHeight:
menudefs = [
('windows', [
('_Zoom Height', '<<zoom-height>>'),
])
]
windows_keydefs = {
'<<zoom-height>>': ['<Alt-F2>'],
}
unix_keydefs = {
'<<zoom-height>>': ... | # Sample extension: zoom a window to maximum height
import re
import sys
class ZoomHeight:
menudefs = [
('windows', [
('_Zoom Height', '<<zoom-height>>'),
])
]
windows_keydefs = {
'<<zoom-height>>': ['<Alt-F2>'],
}
unix_keydefs = {
'<<zoom-height>>': ... | <commit_before># Sample extension: zoom a window to maximum height
import re
import sys
class ZoomHeight:
menudefs = [
('windows', [
('_Zoom Height', '<<zoom-height>>'),
])
]
windows_keydefs = {
'<<zoom-height>>': ['<Alt-F2>'],
}
unix_keydefs = {
'<<z... | # Sample extension: zoom a window to maximum height
import re
import sys
class ZoomHeight:
menudefs = [
('windows', [
('_Zoom Height', '<<zoom-height>>'),
])
]
windows_keydefs = {
'<<zoom-height>>': ['<Alt-F2>'],
}
unix_keydefs = {
'<<zoom-height>>': ... | # Sample extension: zoom a window to maximum height
import re
import sys
class ZoomHeight:
menudefs = [
('windows', [
('_Zoom Height', '<<zoom-height>>'),
])
]
windows_keydefs = {
'<<zoom-height>>': ['<Alt-F2>'],
}
unix_keydefs = {
'<<zoom-height>>': ... | <commit_before># Sample extension: zoom a window to maximum height
import re
import sys
class ZoomHeight:
menudefs = [
('windows', [
('_Zoom Height', '<<zoom-height>>'),
])
]
windows_keydefs = {
'<<zoom-height>>': ['<Alt-F2>'],
}
unix_keydefs = {
'<<z... |
280c81a3990116f66de9af8e6fd6e71d0215a386 | client.py | client.py | #!/usr/bin/env python
from configReader import ConfigReader
import sys
import os, os.path
import os.path
from time import time
from math import floor
import hashlib
import random
import requests
f = open('adjectives.txt','r')
adjectives = [line.rstrip() for line in f]
f.close()
configReader = ConfigReader(name="clien... | #!/usr/bin/env python
from configReader import ConfigReader
import sys
import os, os.path
import os.path
from time import time
from math import floor
import hashlib
import random
import requests
f = open('adjectives.txt','r')
adjectives = [line.rstrip() for line in f]
f.close()
configReader = ConfigReader(name="clien... | Add authentication to the serverside | Add authentication to the serverside
| Python | mit | ollien/Screenshot-Uploader,ollien/Screenshot-Uploader | #!/usr/bin/env python
from configReader import ConfigReader
import sys
import os, os.path
import os.path
from time import time
from math import floor
import hashlib
import random
import requests
f = open('adjectives.txt','r')
adjectives = [line.rstrip() for line in f]
f.close()
configReader = ConfigReader(name="clien... | #!/usr/bin/env python
from configReader import ConfigReader
import sys
import os, os.path
import os.path
from time import time
from math import floor
import hashlib
import random
import requests
f = open('adjectives.txt','r')
adjectives = [line.rstrip() for line in f]
f.close()
configReader = ConfigReader(name="clien... | <commit_before>#!/usr/bin/env python
from configReader import ConfigReader
import sys
import os, os.path
import os.path
from time import time
from math import floor
import hashlib
import random
import requests
f = open('adjectives.txt','r')
adjectives = [line.rstrip() for line in f]
f.close()
configReader = ConfigRea... | #!/usr/bin/env python
from configReader import ConfigReader
import sys
import os, os.path
import os.path
from time import time
from math import floor
import hashlib
import random
import requests
f = open('adjectives.txt','r')
adjectives = [line.rstrip() for line in f]
f.close()
configReader = ConfigReader(name="clien... | #!/usr/bin/env python
from configReader import ConfigReader
import sys
import os, os.path
import os.path
from time import time
from math import floor
import hashlib
import random
import requests
f = open('adjectives.txt','r')
adjectives = [line.rstrip() for line in f]
f.close()
configReader = ConfigReader(name="clien... | <commit_before>#!/usr/bin/env python
from configReader import ConfigReader
import sys
import os, os.path
import os.path
from time import time
from math import floor
import hashlib
import random
import requests
f = open('adjectives.txt','r')
adjectives = [line.rstrip() for line in f]
f.close()
configReader = ConfigRea... |
a68f3ea83c191478f6a7b0dc6a4b49ff6c297ae2 | imports.py | imports.py | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
from flask import flash
from old_xml_import import old_xml_import
from sml_import import sml_import
import gzip
from model import db, Sample
from sqlalchemy.sql import func
def move_import(xmlfile, filename, user):
if filename.endswith('.gz'):
xmlfil... | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
from flask import flash
from old_xml_import import old_xml_import
from sml_import import sml_import
import gzip
from model import db, Sample
from sqlalchemy.sql import func
def move_import(xmlfile, filename, user):
move = None
if filename.endswith('.gz'... | Fix exception 'local variable 'move' referenced before assignment' in case of upload of unknown file formats | Fix exception 'local variable 'move' referenced before assignment' in case of upload of unknown file formats
| Python | mit | bwaldvogel/openmoves,marguslt/openmoves,marguslt/openmoves,bwaldvogel/openmoves,mourningsun75/openmoves,mourningsun75/openmoves,mourningsun75/openmoves,marguslt/openmoves,bwaldvogel/openmoves | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
from flask import flash
from old_xml_import import old_xml_import
from sml_import import sml_import
import gzip
from model import db, Sample
from sqlalchemy.sql import func
def move_import(xmlfile, filename, user):
if filename.endswith('.gz'):
xmlfil... | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
from flask import flash
from old_xml_import import old_xml_import
from sml_import import sml_import
import gzip
from model import db, Sample
from sqlalchemy.sql import func
def move_import(xmlfile, filename, user):
move = None
if filename.endswith('.gz'... | <commit_before>#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
from flask import flash
from old_xml_import import old_xml_import
from sml_import import sml_import
import gzip
from model import db, Sample
from sqlalchemy.sql import func
def move_import(xmlfile, filename, user):
if filename.endswith('.gz'):... | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
from flask import flash
from old_xml_import import old_xml_import
from sml_import import sml_import
import gzip
from model import db, Sample
from sqlalchemy.sql import func
def move_import(xmlfile, filename, user):
move = None
if filename.endswith('.gz'... | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
from flask import flash
from old_xml_import import old_xml_import
from sml_import import sml_import
import gzip
from model import db, Sample
from sqlalchemy.sql import func
def move_import(xmlfile, filename, user):
if filename.endswith('.gz'):
xmlfil... | <commit_before>#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
from flask import flash
from old_xml_import import old_xml_import
from sml_import import sml_import
import gzip
from model import db, Sample
from sqlalchemy.sql import func
def move_import(xmlfile, filename, user):
if filename.endswith('.gz'):... |
317cf766f3fe1c55e5a57b7e38fb94222c6525d8 | grow/submodules/__init__.py | grow/submodules/__init__.py | import os
import sys
def fix_imports():
here = os.path.dirname(__file__)
dirs = [
os.path.normpath(os.path.join(here, '..', '..')),
os.path.normpath(os.path.join(here, 'babel')),
os.path.normpath(os.path.join(here, 'dulwich')),
os.path.normpath(os.path.join(here, 'google-apputils-python'))... | import os
import sys
def fix_imports():
here = os.path.dirname(__file__)
dirs = [
os.path.normpath(os.path.join(here, '..', '..')),
os.path.normpath(os.path.join(here, 'babel')),
os.path.normpath(os.path.join(here, 'dulwich')),
os.path.normpath(os.path.join(here, 'google-apputils-python'))... | Use python2 pyyaml instead of python3. | Use python2 pyyaml instead of python3.
| Python | mit | grow/grow,vitorio/pygrow,grow/grow,grow/pygrow,grow/pygrow,vitorio/pygrow,codedcolors/pygrow,grow/grow,codedcolors/pygrow,denmojo/pygrow,denmojo/pygrow,denmojo/pygrow,denmojo/pygrow,vitorio/pygrow,grow/pygrow,codedcolors/pygrow,grow/grow | import os
import sys
def fix_imports():
here = os.path.dirname(__file__)
dirs = [
os.path.normpath(os.path.join(here, '..', '..')),
os.path.normpath(os.path.join(here, 'babel')),
os.path.normpath(os.path.join(here, 'dulwich')),
os.path.normpath(os.path.join(here, 'google-apputils-python'))... | import os
import sys
def fix_imports():
here = os.path.dirname(__file__)
dirs = [
os.path.normpath(os.path.join(here, '..', '..')),
os.path.normpath(os.path.join(here, 'babel')),
os.path.normpath(os.path.join(here, 'dulwich')),
os.path.normpath(os.path.join(here, 'google-apputils-python'))... | <commit_before>import os
import sys
def fix_imports():
here = os.path.dirname(__file__)
dirs = [
os.path.normpath(os.path.join(here, '..', '..')),
os.path.normpath(os.path.join(here, 'babel')),
os.path.normpath(os.path.join(here, 'dulwich')),
os.path.normpath(os.path.join(here, 'google-app... | import os
import sys
def fix_imports():
here = os.path.dirname(__file__)
dirs = [
os.path.normpath(os.path.join(here, '..', '..')),
os.path.normpath(os.path.join(here, 'babel')),
os.path.normpath(os.path.join(here, 'dulwich')),
os.path.normpath(os.path.join(here, 'google-apputils-python'))... | import os
import sys
def fix_imports():
here = os.path.dirname(__file__)
dirs = [
os.path.normpath(os.path.join(here, '..', '..')),
os.path.normpath(os.path.join(here, 'babel')),
os.path.normpath(os.path.join(here, 'dulwich')),
os.path.normpath(os.path.join(here, 'google-apputils-python'))... | <commit_before>import os
import sys
def fix_imports():
here = os.path.dirname(__file__)
dirs = [
os.path.normpath(os.path.join(here, '..', '..')),
os.path.normpath(os.path.join(here, 'babel')),
os.path.normpath(os.path.join(here, 'dulwich')),
os.path.normpath(os.path.join(here, 'google-app... |
3d86b4473f66a9311a94b1def4c40189eae23990 | lancet/git.py | lancet/git.py | import sys
import click
from slugify import slugify
class SlugBranchGetter(object):
def __init__(self, base_branch='master'):
self.base_branch = base_branch
def __call__(self, repo, issue):
discriminator = 'features/{}'.format(issue.key)
slug = slugify(issue.fields.summary[:30])
... | import sys
import click
from slugify import slugify
class SlugBranchGetter(object):
prefix = 'feature/'
def __init__(self, base_branch='master'):
self.base_branch = base_branch
def __call__(self, repo, issue):
discriminator = '{}{}'.format(self.prefix, issue.key)
slug = slugify(i... | Change the prefix from features/ to feature/. | Change the prefix from features/ to feature/.
| Python | mit | GaretJax/lancet,GaretJax/lancet | import sys
import click
from slugify import slugify
class SlugBranchGetter(object):
def __init__(self, base_branch='master'):
self.base_branch = base_branch
def __call__(self, repo, issue):
discriminator = 'features/{}'.format(issue.key)
slug = slugify(issue.fields.summary[:30])
... | import sys
import click
from slugify import slugify
class SlugBranchGetter(object):
prefix = 'feature/'
def __init__(self, base_branch='master'):
self.base_branch = base_branch
def __call__(self, repo, issue):
discriminator = '{}{}'.format(self.prefix, issue.key)
slug = slugify(i... | <commit_before>import sys
import click
from slugify import slugify
class SlugBranchGetter(object):
def __init__(self, base_branch='master'):
self.base_branch = base_branch
def __call__(self, repo, issue):
discriminator = 'features/{}'.format(issue.key)
slug = slugify(issue.fields.summ... | import sys
import click
from slugify import slugify
class SlugBranchGetter(object):
prefix = 'feature/'
def __init__(self, base_branch='master'):
self.base_branch = base_branch
def __call__(self, repo, issue):
discriminator = '{}{}'.format(self.prefix, issue.key)
slug = slugify(i... | import sys
import click
from slugify import slugify
class SlugBranchGetter(object):
def __init__(self, base_branch='master'):
self.base_branch = base_branch
def __call__(self, repo, issue):
discriminator = 'features/{}'.format(issue.key)
slug = slugify(issue.fields.summary[:30])
... | <commit_before>import sys
import click
from slugify import slugify
class SlugBranchGetter(object):
def __init__(self, base_branch='master'):
self.base_branch = base_branch
def __call__(self, repo, issue):
discriminator = 'features/{}'.format(issue.key)
slug = slugify(issue.fields.summ... |
8816d06381625938137d9fbf8aaee3d9ddabae72 | src/sentry/api/endpoints/organization_projects.py | src/sentry/api/endpoints/organization_projects.py | from __future__ import absolute_import
from rest_framework.response import Response
from sentry.api.base import DocSection
from sentry.api.bases.organization import OrganizationEndpoint
from sentry.api.serializers import serialize
from sentry.models import Project, Team
class OrganizationProjectsEndpoint(Organizati... | from __future__ import absolute_import
from rest_framework.response import Response
from sentry.api.base import DocSection
from sentry.api.bases.organization import OrganizationEndpoint
from sentry.api.serializers import serialize
from sentry.models import Project
class OrganizationProjectsEndpoint(OrganizationEndp... | Support API keys on organization project list (fixes GH-1666) | Support API keys on organization project list (fixes GH-1666)
| Python | bsd-3-clause | ifduyue/sentry,ngonzalvez/sentry,jean/sentry,Kryz/sentry,nicholasserra/sentry,daevaorn/sentry,BayanGroup/sentry,mvaled/sentry,1tush/sentry,looker/sentry,mvaled/sentry,ngonzalvez/sentry,mvaled/sentry,zenefits/sentry,beeftornado/sentry,JackDanger/sentry,hongliang5623/sentry,daevaorn/sentry,JamesMura/sentry,gencer/sentry,... | from __future__ import absolute_import
from rest_framework.response import Response
from sentry.api.base import DocSection
from sentry.api.bases.organization import OrganizationEndpoint
from sentry.api.serializers import serialize
from sentry.models import Project, Team
class OrganizationProjectsEndpoint(Organizati... | from __future__ import absolute_import
from rest_framework.response import Response
from sentry.api.base import DocSection
from sentry.api.bases.organization import OrganizationEndpoint
from sentry.api.serializers import serialize
from sentry.models import Project
class OrganizationProjectsEndpoint(OrganizationEndp... | <commit_before>from __future__ import absolute_import
from rest_framework.response import Response
from sentry.api.base import DocSection
from sentry.api.bases.organization import OrganizationEndpoint
from sentry.api.serializers import serialize
from sentry.models import Project, Team
class OrganizationProjectsEndp... | from __future__ import absolute_import
from rest_framework.response import Response
from sentry.api.base import DocSection
from sentry.api.bases.organization import OrganizationEndpoint
from sentry.api.serializers import serialize
from sentry.models import Project
class OrganizationProjectsEndpoint(OrganizationEndp... | from __future__ import absolute_import
from rest_framework.response import Response
from sentry.api.base import DocSection
from sentry.api.bases.organization import OrganizationEndpoint
from sentry.api.serializers import serialize
from sentry.models import Project, Team
class OrganizationProjectsEndpoint(Organizati... | <commit_before>from __future__ import absolute_import
from rest_framework.response import Response
from sentry.api.base import DocSection
from sentry.api.bases.organization import OrganizationEndpoint
from sentry.api.serializers import serialize
from sentry.models import Project, Team
class OrganizationProjectsEndp... |
9616b026894327eb7171f978f3856cdae7c9e06b | child_sync_typo3/wizard/delegate_child_wizard.py | child_sync_typo3/wizard/delegate_child_wizard.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: David Coninckx <[email protected]>
#
# The licence is in the file __ope... | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: David Coninckx <[email protected]>
#
# The licence is in the file __ope... | Fix res returned on delegate | Fix res returned on delegate
| Python | agpl-3.0 | MickSandoz/compassion-switzerland,ecino/compassion-switzerland,CompassionCH/compassion-switzerland,ndtran/compassion-switzerland,eicher31/compassion-switzerland,eicher31/compassion-switzerland,ndtran/compassion-switzerland,MickSandoz/compassion-switzerland,Secheron/compassion-switzerland,CompassionCH/compassion-switzer... | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: David Coninckx <[email protected]>
#
# The licence is in the file __ope... | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: David Coninckx <[email protected]>
#
# The licence is in the file __ope... | <commit_before># -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: David Coninckx <[email protected]>
#
# The licence is in... | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: David Coninckx <[email protected]>
#
# The licence is in the file __ope... | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: David Coninckx <[email protected]>
#
# The licence is in the file __ope... | <commit_before># -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: David Coninckx <[email protected]>
#
# The licence is in... |
306e0e38c148fed14cffd82ae0ede9b20ab30853 | corehq/ex-submodules/casexml/apps/phone/utils.py | corehq/ex-submodules/casexml/apps/phone/utils.py |
def delete_sync_logs(before_date, limit=1000):
from casexml.apps.phone.dbaccessors.sync_logs_by_user import get_synclog_ids_before_date
from casexml.apps.phone.models import SyncLog
from dimagi.utils.couch.database import iter_bulk_delete_with_doc_type_verification
sync_log_ids = get_synclog_ids_before... |
def delete_sync_logs(before_date, limit=1000):
from casexml.apps.phone.dbaccessors.sync_logs_by_user import get_synclog_ids_before_date
from casexml.apps.phone.models import SyncLog
from dimagi.utils.couch.database import iter_bulk_delete_with_doc_type_verification
sync_log_ids = get_synclog_ids_before... | Delete sync logs 25 at a time | Delete sync logs 25 at a time
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq |
def delete_sync_logs(before_date, limit=1000):
from casexml.apps.phone.dbaccessors.sync_logs_by_user import get_synclog_ids_before_date
from casexml.apps.phone.models import SyncLog
from dimagi.utils.couch.database import iter_bulk_delete_with_doc_type_verification
sync_log_ids = get_synclog_ids_before... |
def delete_sync_logs(before_date, limit=1000):
from casexml.apps.phone.dbaccessors.sync_logs_by_user import get_synclog_ids_before_date
from casexml.apps.phone.models import SyncLog
from dimagi.utils.couch.database import iter_bulk_delete_with_doc_type_verification
sync_log_ids = get_synclog_ids_before... | <commit_before>
def delete_sync_logs(before_date, limit=1000):
from casexml.apps.phone.dbaccessors.sync_logs_by_user import get_synclog_ids_before_date
from casexml.apps.phone.models import SyncLog
from dimagi.utils.couch.database import iter_bulk_delete_with_doc_type_verification
sync_log_ids = get_syn... |
def delete_sync_logs(before_date, limit=1000):
from casexml.apps.phone.dbaccessors.sync_logs_by_user import get_synclog_ids_before_date
from casexml.apps.phone.models import SyncLog
from dimagi.utils.couch.database import iter_bulk_delete_with_doc_type_verification
sync_log_ids = get_synclog_ids_before... |
def delete_sync_logs(before_date, limit=1000):
from casexml.apps.phone.dbaccessors.sync_logs_by_user import get_synclog_ids_before_date
from casexml.apps.phone.models import SyncLog
from dimagi.utils.couch.database import iter_bulk_delete_with_doc_type_verification
sync_log_ids = get_synclog_ids_before... | <commit_before>
def delete_sync_logs(before_date, limit=1000):
from casexml.apps.phone.dbaccessors.sync_logs_by_user import get_synclog_ids_before_date
from casexml.apps.phone.models import SyncLog
from dimagi.utils.couch.database import iter_bulk_delete_with_doc_type_verification
sync_log_ids = get_syn... |
cc5cf942cc56f12e09c50c29b488f71504387b7f | avalonstar/apps/api/serializers.py | avalonstar/apps/api/serializers.py | # -*- coding: utf-8 -*-
from rest_framework import serializers
from apps.broadcasts.models import Broadcast, Raid, Series
from apps.games.models import Game
class BroadcastSerializer(serializers.ModelSerializer):
class Meta:
depth = 1
model = Broadcast
class RaidSerializer(serializers.ModelSeri... | # -*- coding: utf-8 -*-
from rest_framework import serializers
from apps.broadcasts.models import Broadcast, Raid, Series
from apps.games.models import Game
class BroadcastSerializer(serializers.ModelSerializer):
class Meta:
model = Broadcast
class RaidSerializer(serializers.ModelSerializer):
class... | Remove the depth for now. | Remove the depth for now.
| Python | apache-2.0 | bryanveloso/avalonstar-tv,bryanveloso/avalonstar-tv,bryanveloso/avalonstar-tv | # -*- coding: utf-8 -*-
from rest_framework import serializers
from apps.broadcasts.models import Broadcast, Raid, Series
from apps.games.models import Game
class BroadcastSerializer(serializers.ModelSerializer):
class Meta:
depth = 1
model = Broadcast
class RaidSerializer(serializers.ModelSeri... | # -*- coding: utf-8 -*-
from rest_framework import serializers
from apps.broadcasts.models import Broadcast, Raid, Series
from apps.games.models import Game
class BroadcastSerializer(serializers.ModelSerializer):
class Meta:
model = Broadcast
class RaidSerializer(serializers.ModelSerializer):
class... | <commit_before># -*- coding: utf-8 -*-
from rest_framework import serializers
from apps.broadcasts.models import Broadcast, Raid, Series
from apps.games.models import Game
class BroadcastSerializer(serializers.ModelSerializer):
class Meta:
depth = 1
model = Broadcast
class RaidSerializer(serial... | # -*- coding: utf-8 -*-
from rest_framework import serializers
from apps.broadcasts.models import Broadcast, Raid, Series
from apps.games.models import Game
class BroadcastSerializer(serializers.ModelSerializer):
class Meta:
model = Broadcast
class RaidSerializer(serializers.ModelSerializer):
class... | # -*- coding: utf-8 -*-
from rest_framework import serializers
from apps.broadcasts.models import Broadcast, Raid, Series
from apps.games.models import Game
class BroadcastSerializer(serializers.ModelSerializer):
class Meta:
depth = 1
model = Broadcast
class RaidSerializer(serializers.ModelSeri... | <commit_before># -*- coding: utf-8 -*-
from rest_framework import serializers
from apps.broadcasts.models import Broadcast, Raid, Series
from apps.games.models import Game
class BroadcastSerializer(serializers.ModelSerializer):
class Meta:
depth = 1
model = Broadcast
class RaidSerializer(serial... |
b8770a85e11c048fb0dc6c46f799b17add07568d | productController.py | productController.py | from endpoints import Controller, CorsMixin
import sqlite3
from datetime import datetime
conn = sqlite3.connect('CIUK.db')
cur = conn.cursor()
class Default(Controller, CorsMixin):
def GET(self):
return "CIUK"
def POST(self, **kwargs):
return '{}, {}, {}'.format(kwargs['title'], kwargs['desc'], kwargs['p... | from endpoints import Controller, CorsMixin
import sqlite3
from datetime import datetime
conn = sqlite3.connect('databaseForTest.db')
cur = conn.cursor()
class Default(Controller, CorsMixin):
def GET(self):
return "CIUK"
def POST(self, **kwargs):
return '{}, {}, {}'.format(kwargs['title'], kwargs['desc']... | Change name of database for test | Change name of database for test
| Python | mit | joykuotw/python-endpoints,joykuotw/python-endpoints,joykuotw/python-endpoints | from endpoints import Controller, CorsMixin
import sqlite3
from datetime import datetime
conn = sqlite3.connect('CIUK.db')
cur = conn.cursor()
class Default(Controller, CorsMixin):
def GET(self):
return "CIUK"
def POST(self, **kwargs):
return '{}, {}, {}'.format(kwargs['title'], kwargs['desc'], kwargs['p... | from endpoints import Controller, CorsMixin
import sqlite3
from datetime import datetime
conn = sqlite3.connect('databaseForTest.db')
cur = conn.cursor()
class Default(Controller, CorsMixin):
def GET(self):
return "CIUK"
def POST(self, **kwargs):
return '{}, {}, {}'.format(kwargs['title'], kwargs['desc']... | <commit_before>from endpoints import Controller, CorsMixin
import sqlite3
from datetime import datetime
conn = sqlite3.connect('CIUK.db')
cur = conn.cursor()
class Default(Controller, CorsMixin):
def GET(self):
return "CIUK"
def POST(self, **kwargs):
return '{}, {}, {}'.format(kwargs['title'], kwargs['de... | from endpoints import Controller, CorsMixin
import sqlite3
from datetime import datetime
conn = sqlite3.connect('databaseForTest.db')
cur = conn.cursor()
class Default(Controller, CorsMixin):
def GET(self):
return "CIUK"
def POST(self, **kwargs):
return '{}, {}, {}'.format(kwargs['title'], kwargs['desc']... | from endpoints import Controller, CorsMixin
import sqlite3
from datetime import datetime
conn = sqlite3.connect('CIUK.db')
cur = conn.cursor()
class Default(Controller, CorsMixin):
def GET(self):
return "CIUK"
def POST(self, **kwargs):
return '{}, {}, {}'.format(kwargs['title'], kwargs['desc'], kwargs['p... | <commit_before>from endpoints import Controller, CorsMixin
import sqlite3
from datetime import datetime
conn = sqlite3.connect('CIUK.db')
cur = conn.cursor()
class Default(Controller, CorsMixin):
def GET(self):
return "CIUK"
def POST(self, **kwargs):
return '{}, {}, {}'.format(kwargs['title'], kwargs['de... |
c129b435a7759104feaaa5b828dc2f2ac46d5ab1 | src/cmdlinetest/afp_mock.py | src/cmdlinetest/afp_mock.py | #!/usr/bin/env python
from bottle import route
from textwrap import dedent
from bottledaemon import daemon_run
""" Simple AFP mock to allow testing the afp-cli. """
@route('/account')
def account():
return """{"test_account": ["test_role"]}"""
@route('/account/<account>/<role>')
def credentials(account, role):
... | #!/usr/bin/env python
""" Simple AFP mock to allow testing the afp-cli. """
from bottle import route
from textwrap import dedent
from bottledaemon import daemon_run
@route('/account')
def account():
return """{"test_account": ["test_role"]}"""
@route('/account/<account>/<role>')
def credentials(account, role):
... | Move string above the imports so it becomes a docstring | Move string above the imports so it becomes a docstring
| Python | apache-2.0 | ImmobilienScout24/afp-cli,ImmobilienScout24/afp-cli,ImmobilienScout24/afp-cli | #!/usr/bin/env python
from bottle import route
from textwrap import dedent
from bottledaemon import daemon_run
""" Simple AFP mock to allow testing the afp-cli. """
@route('/account')
def account():
return """{"test_account": ["test_role"]}"""
@route('/account/<account>/<role>')
def credentials(account, role):
... | #!/usr/bin/env python
""" Simple AFP mock to allow testing the afp-cli. """
from bottle import route
from textwrap import dedent
from bottledaemon import daemon_run
@route('/account')
def account():
return """{"test_account": ["test_role"]}"""
@route('/account/<account>/<role>')
def credentials(account, role):
... | <commit_before>#!/usr/bin/env python
from bottle import route
from textwrap import dedent
from bottledaemon import daemon_run
""" Simple AFP mock to allow testing the afp-cli. """
@route('/account')
def account():
return """{"test_account": ["test_role"]}"""
@route('/account/<account>/<role>')
def credentials(a... | #!/usr/bin/env python
""" Simple AFP mock to allow testing the afp-cli. """
from bottle import route
from textwrap import dedent
from bottledaemon import daemon_run
@route('/account')
def account():
return """{"test_account": ["test_role"]}"""
@route('/account/<account>/<role>')
def credentials(account, role):
... | #!/usr/bin/env python
from bottle import route
from textwrap import dedent
from bottledaemon import daemon_run
""" Simple AFP mock to allow testing the afp-cli. """
@route('/account')
def account():
return """{"test_account": ["test_role"]}"""
@route('/account/<account>/<role>')
def credentials(account, role):
... | <commit_before>#!/usr/bin/env python
from bottle import route
from textwrap import dedent
from bottledaemon import daemon_run
""" Simple AFP mock to allow testing the afp-cli. """
@route('/account')
def account():
return """{"test_account": ["test_role"]}"""
@route('/account/<account>/<role>')
def credentials(a... |
fbfeaaad959cd4ed9ef91cebbef847c5f1bf3fdb | src/ggrc/models/cache.py | src/ggrc/models/cache.py | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained By: [email protected]
class Cache:
"""
Tracks modified objects in the session distinguished by
t... | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained By: [email protected]
class Cache:
"""
Tracks modified objects in the session distinguished by
t... | Fix to keep build-chain Python 2.6 compatible | Fix to keep build-chain Python 2.6 compatible
| Python | apache-2.0 | uskudnik/ggrc-core,uskudnik/ggrc-core,vladan-m/ggrc-core,selahssea/ggrc-core,prasannav7/ggrc-core,VinnieJohns/ggrc-core,vladan-m/ggrc-core,josthkko/ggrc-core,j0gurt/ggrc-core,AleksNeStu/ggrc-core,andrei-karalionak/ggrc-core,plamut/ggrc-core,selahssea/ggrc-core,hasanalom/ggrc-core,andrei-karalionak/ggrc-core,jmakov/ggrc... | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained By: [email protected]
class Cache:
"""
Tracks modified objects in the session distinguished by
t... | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained By: [email protected]
class Cache:
"""
Tracks modified objects in the session distinguished by
t... | <commit_before># Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained By: [email protected]
class Cache:
"""
Tracks modified objects in the session disti... | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained By: [email protected]
class Cache:
"""
Tracks modified objects in the session distinguished by
t... | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained By: [email protected]
class Cache:
"""
Tracks modified objects in the session distinguished by
t... | <commit_before># Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained By: [email protected]
class Cache:
"""
Tracks modified objects in the session disti... |
0ee0650dfacf648982615be49cefd57f928a73ee | holonet/core/list_access.py | holonet/core/list_access.py | # -*- coding: utf8 -*-
from django.conf import settings
from holonet.mappings.helpers import clean_address, split_address
from .models import DomainBlacklist, DomainWhitelist, SenderBlacklist, SenderWhitelist
def is_blacklisted(sender):
sender = clean_address(sender)
prefix, domain = split_address(sender)
... | # -*- coding: utf8 -*-
from django.conf import settings
from holonet.mappings.helpers import clean_address, split_address
from .models import DomainBlacklist, DomainWhitelist, SenderBlacklist, SenderWhitelist
def is_blacklisted(sender):
sender = clean_address(sender)
prefix, domain = split_address(sender)
... | Change to exists instead of catching DoesNotExist exception. | Change to exists instead of catching DoesNotExist exception.
| Python | mit | webkom/holonet,webkom/holonet,webkom/holonet | # -*- coding: utf8 -*-
from django.conf import settings
from holonet.mappings.helpers import clean_address, split_address
from .models import DomainBlacklist, DomainWhitelist, SenderBlacklist, SenderWhitelist
def is_blacklisted(sender):
sender = clean_address(sender)
prefix, domain = split_address(sender)
... | # -*- coding: utf8 -*-
from django.conf import settings
from holonet.mappings.helpers import clean_address, split_address
from .models import DomainBlacklist, DomainWhitelist, SenderBlacklist, SenderWhitelist
def is_blacklisted(sender):
sender = clean_address(sender)
prefix, domain = split_address(sender)
... | <commit_before># -*- coding: utf8 -*-
from django.conf import settings
from holonet.mappings.helpers import clean_address, split_address
from .models import DomainBlacklist, DomainWhitelist, SenderBlacklist, SenderWhitelist
def is_blacklisted(sender):
sender = clean_address(sender)
prefix, domain = split_a... | # -*- coding: utf8 -*-
from django.conf import settings
from holonet.mappings.helpers import clean_address, split_address
from .models import DomainBlacklist, DomainWhitelist, SenderBlacklist, SenderWhitelist
def is_blacklisted(sender):
sender = clean_address(sender)
prefix, domain = split_address(sender)
... | # -*- coding: utf8 -*-
from django.conf import settings
from holonet.mappings.helpers import clean_address, split_address
from .models import DomainBlacklist, DomainWhitelist, SenderBlacklist, SenderWhitelist
def is_blacklisted(sender):
sender = clean_address(sender)
prefix, domain = split_address(sender)
... | <commit_before># -*- coding: utf8 -*-
from django.conf import settings
from holonet.mappings.helpers import clean_address, split_address
from .models import DomainBlacklist, DomainWhitelist, SenderBlacklist, SenderWhitelist
def is_blacklisted(sender):
sender = clean_address(sender)
prefix, domain = split_a... |
f68b4b9b133d3c8ecb9826af9736c8c1fca64e49 | maxims/credentials.py | maxims/credentials.py | from axiom import attributes, item
from twisted.cred import credentials
class UsernamePassword(item.Item):
"""
A stored username and password.
"""
username = attributes.bytes(allowNone=False)
password = attributes.bytes(allowNone=False)
def instantiate(self):
return credentials.Userna... | from axiom import attributes, item
from twisted.cred import credentials
class UsernamePassword(item.Item):
"""
A stored username and password.
Note that although this class is an ``IUsernamePassword`` implementation,
you should still use the ``instantiate`` method to get independent
``IUsernamePa... | Add caveat about UsernamePassword already being an IUsernamePassword implementation | Add caveat about UsernamePassword already being an IUsernamePassword implementation
| Python | isc | lvh/maxims | from axiom import attributes, item
from twisted.cred import credentials
class UsernamePassword(item.Item):
"""
A stored username and password.
"""
username = attributes.bytes(allowNone=False)
password = attributes.bytes(allowNone=False)
def instantiate(self):
return credentials.Userna... | from axiom import attributes, item
from twisted.cred import credentials
class UsernamePassword(item.Item):
"""
A stored username and password.
Note that although this class is an ``IUsernamePassword`` implementation,
you should still use the ``instantiate`` method to get independent
``IUsernamePa... | <commit_before>from axiom import attributes, item
from twisted.cred import credentials
class UsernamePassword(item.Item):
"""
A stored username and password.
"""
username = attributes.bytes(allowNone=False)
password = attributes.bytes(allowNone=False)
def instantiate(self):
return cre... | from axiom import attributes, item
from twisted.cred import credentials
class UsernamePassword(item.Item):
"""
A stored username and password.
Note that although this class is an ``IUsernamePassword`` implementation,
you should still use the ``instantiate`` method to get independent
``IUsernamePa... | from axiom import attributes, item
from twisted.cred import credentials
class UsernamePassword(item.Item):
"""
A stored username and password.
"""
username = attributes.bytes(allowNone=False)
password = attributes.bytes(allowNone=False)
def instantiate(self):
return credentials.Userna... | <commit_before>from axiom import attributes, item
from twisted.cred import credentials
class UsernamePassword(item.Item):
"""
A stored username and password.
"""
username = attributes.bytes(allowNone=False)
password = attributes.bytes(allowNone=False)
def instantiate(self):
return cre... |
214511a6fbdd0763667e740735d0876f78a3b244 | derpibooru/query.py | derpibooru/query.py | from .request import url
class Search(object):
def __init__(self, key=None, q=[], sf="created_at", sd="desc"):
self._parameters = {
"key": key,
"q": q,
"sf": sf,
"sd": sd
}
@property
def parameters(self):
return self._parameters
@property
def url(self):
return url(**... | from .request import url
class Search(object):
def __init__(self, key=None, q=[], sf="created_at", sd="desc"):
self._parameters = {
"key": key,
"q": [str(tag).strip() for tag in q if tag],
"sf": sf,
"sd": sd
}
@property
def parameters(self):
return self._parameters
@proper... | Add check for empty tags | Add check for empty tags
| Python | bsd-2-clause | joshua-stone/DerPyBooru | from .request import url
class Search(object):
def __init__(self, key=None, q=[], sf="created_at", sd="desc"):
self._parameters = {
"key": key,
"q": q,
"sf": sf,
"sd": sd
}
@property
def parameters(self):
return self._parameters
@property
def url(self):
return url(**... | from .request import url
class Search(object):
def __init__(self, key=None, q=[], sf="created_at", sd="desc"):
self._parameters = {
"key": key,
"q": [str(tag).strip() for tag in q if tag],
"sf": sf,
"sd": sd
}
@property
def parameters(self):
return self._parameters
@proper... | <commit_before>from .request import url
class Search(object):
def __init__(self, key=None, q=[], sf="created_at", sd="desc"):
self._parameters = {
"key": key,
"q": q,
"sf": sf,
"sd": sd
}
@property
def parameters(self):
return self._parameters
@property
def url(self):
... | from .request import url
class Search(object):
def __init__(self, key=None, q=[], sf="created_at", sd="desc"):
self._parameters = {
"key": key,
"q": [str(tag).strip() for tag in q if tag],
"sf": sf,
"sd": sd
}
@property
def parameters(self):
return self._parameters
@proper... | from .request import url
class Search(object):
def __init__(self, key=None, q=[], sf="created_at", sd="desc"):
self._parameters = {
"key": key,
"q": q,
"sf": sf,
"sd": sd
}
@property
def parameters(self):
return self._parameters
@property
def url(self):
return url(**... | <commit_before>from .request import url
class Search(object):
def __init__(self, key=None, q=[], sf="created_at", sd="desc"):
self._parameters = {
"key": key,
"q": q,
"sf": sf,
"sd": sd
}
@property
def parameters(self):
return self._parameters
@property
def url(self):
... |
ab4d640923e0e556ba3a9f64cc122c95ba4fc52c | settings.py | settings.py | import os
PROJECT_NAME = "lightning-talks"
MONGO_DATABASE = 'lightningtalk-dev'
VOTING = False
ENVIRONMENTS = {
"prd": {
"hosts": ['104.236.202.196']
}
} | import os
PROJECT_NAME = "lightning-talks"
MONGO_DATABASE = 'lightningtalk'
VOTING = False
ENVIRONMENTS = {
"prd": {
"hosts": ['104.236.202.196']
}
} | Change DB location to production. | Change DB location to production.
| Python | mit | ireapps/lightning-talks,ireapps/lightning-talks,ireapps/lightning-talks,ireapps/lightning-talks | import os
PROJECT_NAME = "lightning-talks"
MONGO_DATABASE = 'lightningtalk-dev'
VOTING = False
ENVIRONMENTS = {
"prd": {
"hosts": ['104.236.202.196']
}
}Change DB location to production. | import os
PROJECT_NAME = "lightning-talks"
MONGO_DATABASE = 'lightningtalk'
VOTING = False
ENVIRONMENTS = {
"prd": {
"hosts": ['104.236.202.196']
}
} | <commit_before>import os
PROJECT_NAME = "lightning-talks"
MONGO_DATABASE = 'lightningtalk-dev'
VOTING = False
ENVIRONMENTS = {
"prd": {
"hosts": ['104.236.202.196']
}
}<commit_msg>Change DB location to production.<commit_after> | import os
PROJECT_NAME = "lightning-talks"
MONGO_DATABASE = 'lightningtalk'
VOTING = False
ENVIRONMENTS = {
"prd": {
"hosts": ['104.236.202.196']
}
} | import os
PROJECT_NAME = "lightning-talks"
MONGO_DATABASE = 'lightningtalk-dev'
VOTING = False
ENVIRONMENTS = {
"prd": {
"hosts": ['104.236.202.196']
}
}Change DB location to production.import os
PROJECT_NAME = "lightning-talks"
MONGO_DATABASE = 'lightningtalk'
VOTING = False
ENVIRONMENTS = {
... | <commit_before>import os
PROJECT_NAME = "lightning-talks"
MONGO_DATABASE = 'lightningtalk-dev'
VOTING = False
ENVIRONMENTS = {
"prd": {
"hosts": ['104.236.202.196']
}
}<commit_msg>Change DB location to production.<commit_after>import os
PROJECT_NAME = "lightning-talks"
MONGO_DATABASE = 'lightningt... |
68636bfcf95163e9764860b09a713d59464e3419 | conda/linux_dev/get_freecad_version.py | conda/linux_dev/get_freecad_version.py | import sys
import os
import subprocess
import platform
platform_dict = {}
platform_dict["Darwin"] = "OSX"
sys_n_arch = platform.platform()
sys_n_arch = sys_n_arch.split("-")
system, arch = sys_n_arch[0], sys_n_arch[4]
if system in platform_dict:
system = platform_dict[system]
version_info = subprocess.check_outp... | import sys
import os
import subprocess
import platform
platform_dict = {}
platform_dict["Darwin"] = "OSX"
sys_n_arch = platform.platform()
sys_n_arch = sys_n_arch.split("-")
system, arch = sys_n_arch[0], sys_n_arch[4]
if system in platform_dict:
system = platform_dict[system]
version_info = subprocess.check_outp... | Revert to using current AppImage update info | Revert to using current AppImage update info
https://github.com/FreeCAD/FreeCAD-AppImage/issues/35 | Python | lgpl-2.1 | FreeCAD/FreeCAD-AppImage,FreeCAD/FreeCAD-AppImage | import sys
import os
import subprocess
import platform
platform_dict = {}
platform_dict["Darwin"] = "OSX"
sys_n_arch = platform.platform()
sys_n_arch = sys_n_arch.split("-")
system, arch = sys_n_arch[0], sys_n_arch[4]
if system in platform_dict:
system = platform_dict[system]
version_info = subprocess.check_outp... | import sys
import os
import subprocess
import platform
platform_dict = {}
platform_dict["Darwin"] = "OSX"
sys_n_arch = platform.platform()
sys_n_arch = sys_n_arch.split("-")
system, arch = sys_n_arch[0], sys_n_arch[4]
if system in platform_dict:
system = platform_dict[system]
version_info = subprocess.check_outp... | <commit_before>import sys
import os
import subprocess
import platform
platform_dict = {}
platform_dict["Darwin"] = "OSX"
sys_n_arch = platform.platform()
sys_n_arch = sys_n_arch.split("-")
system, arch = sys_n_arch[0], sys_n_arch[4]
if system in platform_dict:
system = platform_dict[system]
version_info = subpro... | import sys
import os
import subprocess
import platform
platform_dict = {}
platform_dict["Darwin"] = "OSX"
sys_n_arch = platform.platform()
sys_n_arch = sys_n_arch.split("-")
system, arch = sys_n_arch[0], sys_n_arch[4]
if system in platform_dict:
system = platform_dict[system]
version_info = subprocess.check_outp... | import sys
import os
import subprocess
import platform
platform_dict = {}
platform_dict["Darwin"] = "OSX"
sys_n_arch = platform.platform()
sys_n_arch = sys_n_arch.split("-")
system, arch = sys_n_arch[0], sys_n_arch[4]
if system in platform_dict:
system = platform_dict[system]
version_info = subprocess.check_outp... | <commit_before>import sys
import os
import subprocess
import platform
platform_dict = {}
platform_dict["Darwin"] = "OSX"
sys_n_arch = platform.platform()
sys_n_arch = sys_n_arch.split("-")
system, arch = sys_n_arch[0], sys_n_arch[4]
if system in platform_dict:
system = platform_dict[system]
version_info = subpro... |
956ad502766eddbaf3c81672a30e58c814ba8437 | test/test_api_classes.py | test/test_api_classes.py | import pytest
from jedi import api
def make_definitions():
return api.defined_names("""
import sys
class C:
pass
x = C()
def f():
pass
""")
@pytest.mark.parametrize('definition', make_definitions())
def test_basedefinition_type(definition):
assert definition.type in (... | import textwrap
import pytest
from jedi import api
def make_definitions():
"""
Return a list of definitions for parametrized tests.
:rtype: [jedi.api_classes.BaseDefinition]
"""
source = textwrap.dedent("""
import sys
class C:
pass
x = C()
def f():
pass
""... | Make more examples in make_definitions | Make more examples in make_definitions
| Python | mit | WoLpH/jedi,jonashaag/jedi,tjwei/jedi,flurischt/jedi,dwillmer/jedi,jonashaag/jedi,mfussenegger/jedi,flurischt/jedi,tjwei/jedi,mfussenegger/jedi,dwillmer/jedi,WoLpH/jedi | import pytest
from jedi import api
def make_definitions():
return api.defined_names("""
import sys
class C:
pass
x = C()
def f():
pass
""")
@pytest.mark.parametrize('definition', make_definitions())
def test_basedefinition_type(definition):
assert definition.type in (... | import textwrap
import pytest
from jedi import api
def make_definitions():
"""
Return a list of definitions for parametrized tests.
:rtype: [jedi.api_classes.BaseDefinition]
"""
source = textwrap.dedent("""
import sys
class C:
pass
x = C()
def f():
pass
""... | <commit_before>import pytest
from jedi import api
def make_definitions():
return api.defined_names("""
import sys
class C:
pass
x = C()
def f():
pass
""")
@pytest.mark.parametrize('definition', make_definitions())
def test_basedefinition_type(definition):
assert defin... | import textwrap
import pytest
from jedi import api
def make_definitions():
"""
Return a list of definitions for parametrized tests.
:rtype: [jedi.api_classes.BaseDefinition]
"""
source = textwrap.dedent("""
import sys
class C:
pass
x = C()
def f():
pass
""... | import pytest
from jedi import api
def make_definitions():
return api.defined_names("""
import sys
class C:
pass
x = C()
def f():
pass
""")
@pytest.mark.parametrize('definition', make_definitions())
def test_basedefinition_type(definition):
assert definition.type in (... | <commit_before>import pytest
from jedi import api
def make_definitions():
return api.defined_names("""
import sys
class C:
pass
x = C()
def f():
pass
""")
@pytest.mark.parametrize('definition', make_definitions())
def test_basedefinition_type(definition):
assert defin... |
d16d3d9b74f4fdfe06b660fa3d5221614beb2eed | mezzanine/core/management.py | mezzanine/core/management.py |
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth import models as auth_app
from django.db.models.signals import post_syncdb
def create_demo_user(app, created_models, verbosity, **kwargs):
if settings.DEBUG and User in created_models:
if verbosity >= 2:... |
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth import models as auth_app
from django.db.models.signals import post_syncdb
def create_demo_user(app, created_models, verbosity, **kwargs):
if settings.DEBUG and User in created_models and not kwargs.get("interac... | Update creation of default user to only run with ``--noinput`` passed to ``syncdb``. | Update creation of default user to only run with ``--noinput`` passed to ``syncdb``.
| Python | bsd-2-clause | nikolas/mezzanine,sjuxax/mezzanine,biomassives/mezzanine,dekomote/mezzanine-modeltranslation-backport,saintbird/mezzanine,guibernardino/mezzanine,jjz/mezzanine,christianwgd/mezzanine,gbosh/mezzanine,agepoly/mezzanine,wyzex/mezzanine,vladir/mezzanine,viaregio/mezzanine,sjdines/mezzanine,christianwgd/mezzanine,wbtuomela/... |
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth import models as auth_app
from django.db.models.signals import post_syncdb
def create_demo_user(app, created_models, verbosity, **kwargs):
if settings.DEBUG and User in created_models:
if verbosity >= 2:... |
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth import models as auth_app
from django.db.models.signals import post_syncdb
def create_demo_user(app, created_models, verbosity, **kwargs):
if settings.DEBUG and User in created_models and not kwargs.get("interac... | <commit_before>
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth import models as auth_app
from django.db.models.signals import post_syncdb
def create_demo_user(app, created_models, verbosity, **kwargs):
if settings.DEBUG and User in created_models:
if ... |
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth import models as auth_app
from django.db.models.signals import post_syncdb
def create_demo_user(app, created_models, verbosity, **kwargs):
if settings.DEBUG and User in created_models and not kwargs.get("interac... |
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth import models as auth_app
from django.db.models.signals import post_syncdb
def create_demo_user(app, created_models, verbosity, **kwargs):
if settings.DEBUG and User in created_models:
if verbosity >= 2:... | <commit_before>
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth import models as auth_app
from django.db.models.signals import post_syncdb
def create_demo_user(app, created_models, verbosity, **kwargs):
if settings.DEBUG and User in created_models:
if ... |
460a2430fbd8832f3fada1a74b754d71a27ac282 | mockingjay/matcher.py | mockingjay/matcher.py | import abc
import re
class Matcher(object):
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def assert_request_matched(self, request):
"""
Assert that the request matched the spec in this matcher object.
"""
class HeaderMatcher(Matcher):
"""
Matcher for the request's hea... | import abc
import re
class StringOrPattern(object):
"""
A decorator object that wraps a string or a regex pattern so that it can
be compared against another string either literally or using the pattern.
"""
def __init__(self, subject):
self.subject = subject
def __eq__(self, other_str... | Allow all values to be compared with either literally or with a pattern | Allow all values to be compared with either literally or with a pattern
| Python | bsd-3-clause | kevinjqiu/mockingjay | import abc
import re
class Matcher(object):
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def assert_request_matched(self, request):
"""
Assert that the request matched the spec in this matcher object.
"""
class HeaderMatcher(Matcher):
"""
Matcher for the request's hea... | import abc
import re
class StringOrPattern(object):
"""
A decorator object that wraps a string or a regex pattern so that it can
be compared against another string either literally or using the pattern.
"""
def __init__(self, subject):
self.subject = subject
def __eq__(self, other_str... | <commit_before>import abc
import re
class Matcher(object):
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def assert_request_matched(self, request):
"""
Assert that the request matched the spec in this matcher object.
"""
class HeaderMatcher(Matcher):
"""
Matcher for th... | import abc
import re
class StringOrPattern(object):
"""
A decorator object that wraps a string or a regex pattern so that it can
be compared against another string either literally or using the pattern.
"""
def __init__(self, subject):
self.subject = subject
def __eq__(self, other_str... | import abc
import re
class Matcher(object):
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def assert_request_matched(self, request):
"""
Assert that the request matched the spec in this matcher object.
"""
class HeaderMatcher(Matcher):
"""
Matcher for the request's hea... | <commit_before>import abc
import re
class Matcher(object):
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def assert_request_matched(self, request):
"""
Assert that the request matched the spec in this matcher object.
"""
class HeaderMatcher(Matcher):
"""
Matcher for th... |
da69fff2d104c9cccd285078c40de05ea46fdb4d | halaqat/urls.py | halaqat/urls.py | """halaqat URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | """halaqat URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | Add back-office to student URL | Add back-office to student URL
| Python | mit | EmadMokhtar/halaqat,EmadMokhtar/halaqat,EmadMokhtar/halaqat | """halaqat URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | """halaqat URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | <commit_before>"""halaqat URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='h... | """halaqat URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | """halaqat URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | <commit_before>"""halaqat URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='h... |
80b50733a01c70058353815f6db7c621e7868a73 | docs/source/conf.py | docs/source/conf.py | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))
sys.path.insert(0, os.path.abspath(os.getcwd()))
extensions = ['powerline_autodoc', 'sphinx.ext.t... | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))
sys.path.insert(0, os.path.abspath(os.getcwd()))
extensions = ['powerline_autodoc', 'sphinx.ext.t... | Fix latex build: make some unicode characters found in help work | Fix latex build: make some unicode characters found in help work
| Python | mit | Liangjianghao/powerline,bartvm/powerline,junix/powerline,wfscheper/powerline,areteix/powerline,EricSB/powerline,blindFS/powerline,dragon788/powerline,dragon788/powerline,prvnkumar/powerline,s0undt3ch/powerline,russellb/powerline,dragon788/powerline,s0undt3ch/powerline,xxxhycl2010/powerline,xfumihiro/powerline,Liangjian... | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))
sys.path.insert(0, os.path.abspath(os.getcwd()))
extensions = ['powerline_autodoc', 'sphinx.ext.t... | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))
sys.path.insert(0, os.path.abspath(os.getcwd()))
extensions = ['powerline_autodoc', 'sphinx.ext.t... | <commit_before># vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))
sys.path.insert(0, os.path.abspath(os.getcwd()))
extensions = ['powerline_autodoc'... | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))
sys.path.insert(0, os.path.abspath(os.getcwd()))
extensions = ['powerline_autodoc', 'sphinx.ext.t... | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))
sys.path.insert(0, os.path.abspath(os.getcwd()))
extensions = ['powerline_autodoc', 'sphinx.ext.t... | <commit_before># vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))
sys.path.insert(0, os.path.abspath(os.getcwd()))
extensions = ['powerline_autodoc'... |
20929dd2e1ddd0909afc3e25b040bfdcdc2c9b00 | src/opencmiss/neon/core/problems/biomeng321lab1.py | src/opencmiss/neon/core/problems/biomeng321lab1.py | '''
Copyright 2015 University of Auckland
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 agre... | '''
Copyright 2015 University of Auckland
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 agre... | Change name of boundary conditions for Biomeng321 Lab1. | Change name of boundary conditions for Biomeng321 Lab1.
| Python | apache-2.0 | alan-wu/neon | '''
Copyright 2015 University of Auckland
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 agre... | '''
Copyright 2015 University of Auckland
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 agre... | <commit_before>'''
Copyright 2015 University of Auckland
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 applica... | '''
Copyright 2015 University of Auckland
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 agre... | '''
Copyright 2015 University of Auckland
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 agre... | <commit_before>'''
Copyright 2015 University of Auckland
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 applica... |
8c551fe51ed142305945c0cef530ac84ed3e7eb9 | nodeconductor/logging/perms.py | nodeconductor/logging/perms.py | from nodeconductor.core.permissions import StaffPermissionLogic
PERMISSION_LOGICS = (
('logging.Alert', StaffPermissionLogic(any_permission=True)),
('logging.SystemNotification', StaffPermissionLogic(any_permission=True)),
)
| from nodeconductor.core.permissions import StaffPermissionLogic
PERMISSION_LOGICS = (
('logging.Alert', StaffPermissionLogic(any_permission=True)),
('logging.WebHook', StaffPermissionLogic(any_permission=True)),
('logging.PushHook', StaffPermissionLogic(any_permission=True)),
('logging.EmailHook', Sta... | Allow staff user to manage hooks. | Allow staff user to manage hooks.
| Python | mit | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | from nodeconductor.core.permissions import StaffPermissionLogic
PERMISSION_LOGICS = (
('logging.Alert', StaffPermissionLogic(any_permission=True)),
('logging.SystemNotification', StaffPermissionLogic(any_permission=True)),
)
Allow staff user to manage hooks. | from nodeconductor.core.permissions import StaffPermissionLogic
PERMISSION_LOGICS = (
('logging.Alert', StaffPermissionLogic(any_permission=True)),
('logging.WebHook', StaffPermissionLogic(any_permission=True)),
('logging.PushHook', StaffPermissionLogic(any_permission=True)),
('logging.EmailHook', Sta... | <commit_before>from nodeconductor.core.permissions import StaffPermissionLogic
PERMISSION_LOGICS = (
('logging.Alert', StaffPermissionLogic(any_permission=True)),
('logging.SystemNotification', StaffPermissionLogic(any_permission=True)),
)
<commit_msg>Allow staff user to manage hooks.<commit_after> | from nodeconductor.core.permissions import StaffPermissionLogic
PERMISSION_LOGICS = (
('logging.Alert', StaffPermissionLogic(any_permission=True)),
('logging.WebHook', StaffPermissionLogic(any_permission=True)),
('logging.PushHook', StaffPermissionLogic(any_permission=True)),
('logging.EmailHook', Sta... | from nodeconductor.core.permissions import StaffPermissionLogic
PERMISSION_LOGICS = (
('logging.Alert', StaffPermissionLogic(any_permission=True)),
('logging.SystemNotification', StaffPermissionLogic(any_permission=True)),
)
Allow staff user to manage hooks.from nodeconductor.core.permissions import StaffPerm... | <commit_before>from nodeconductor.core.permissions import StaffPermissionLogic
PERMISSION_LOGICS = (
('logging.Alert', StaffPermissionLogic(any_permission=True)),
('logging.SystemNotification', StaffPermissionLogic(any_permission=True)),
)
<commit_msg>Allow staff user to manage hooks.<commit_after>from nodeco... |
13df4b7ba5c706e1fddbd17ac9edf3894e9a7206 | nymms/tests/test_registry.py | nymms/tests/test_registry.py | import unittest
from nymms import registry
from nymms.resources import Command, MonitoringGroup
from weakref import WeakValueDictionary
class TestRegistry(unittest.TestCase):
def test_empty_registry(self):
self.assertEqual(Command.registry, WeakValueDictionary())
def test_register_object(self):
... | import unittest
from nymms import registry
from nymms.resources import Command, MonitoringGroup
from weakref import WeakValueDictionary
class TestRegistry(unittest.TestCase):
def tearDown(self):
# Ensure we have a fresh registry after every test
Command.registry.clear()
def test_empty_registr... | Clear registry between each test | Clear registry between each test
| Python | bsd-2-clause | cloudtools/nymms | import unittest
from nymms import registry
from nymms.resources import Command, MonitoringGroup
from weakref import WeakValueDictionary
class TestRegistry(unittest.TestCase):
def test_empty_registry(self):
self.assertEqual(Command.registry, WeakValueDictionary())
def test_register_object(self):
... | import unittest
from nymms import registry
from nymms.resources import Command, MonitoringGroup
from weakref import WeakValueDictionary
class TestRegistry(unittest.TestCase):
def tearDown(self):
# Ensure we have a fresh registry after every test
Command.registry.clear()
def test_empty_registr... | <commit_before>import unittest
from nymms import registry
from nymms.resources import Command, MonitoringGroup
from weakref import WeakValueDictionary
class TestRegistry(unittest.TestCase):
def test_empty_registry(self):
self.assertEqual(Command.registry, WeakValueDictionary())
def test_register_obje... | import unittest
from nymms import registry
from nymms.resources import Command, MonitoringGroup
from weakref import WeakValueDictionary
class TestRegistry(unittest.TestCase):
def tearDown(self):
# Ensure we have a fresh registry after every test
Command.registry.clear()
def test_empty_registr... | import unittest
from nymms import registry
from nymms.resources import Command, MonitoringGroup
from weakref import WeakValueDictionary
class TestRegistry(unittest.TestCase):
def test_empty_registry(self):
self.assertEqual(Command.registry, WeakValueDictionary())
def test_register_object(self):
... | <commit_before>import unittest
from nymms import registry
from nymms.resources import Command, MonitoringGroup
from weakref import WeakValueDictionary
class TestRegistry(unittest.TestCase):
def test_empty_registry(self):
self.assertEqual(Command.registry, WeakValueDictionary())
def test_register_obje... |
6f50381e2e14ab7c1c90e52479ffcfc7748329b3 | UI/resources/constants.py | UI/resources/constants.py | # -*- coding: utf-8 -*-
SAVE_PASSWORD_HASHED = True
MAX_RETRIES_DOWNLOAD_FROM_SAME_FARMER = 3
MAX_RETRIES_UPLOAD_TO_SAME_FARMER = 3
MAX_RETRIES_NEGOTIATE_CONTRACT = 10
MAX_RETRIES_GET_FILE_POINTERS = 10
FILE_POINTERS_REQUEST_DELAY = 1
# int: file pointers request delay, in seconds.
MAX_DOWNLOAD_REQUEST_BLOCK_SIZE = ... | # -*- coding: utf-8 -*-
SAVE_PASSWORD_HASHED = True
MAX_RETRIES_DOWNLOAD_FROM_SAME_FARMER = 3
MAX_RETRIES_UPLOAD_TO_SAME_FARMER = 3
MAX_RETRIES_NEGOTIATE_CONTRACT = 10
MAX_RETRIES_GET_FILE_POINTERS = 10
FILE_POINTERS_REQUEST_DELAY = 1
# int: file pointers request delay, in seconds.
MAX_DOWNLOAD_REQUEST_BLOCK_SIZE = ... | Add farmer max timeout constant | Add farmer max timeout constant | Python | mit | lakewik/storj-gui-client | # -*- coding: utf-8 -*-
SAVE_PASSWORD_HASHED = True
MAX_RETRIES_DOWNLOAD_FROM_SAME_FARMER = 3
MAX_RETRIES_UPLOAD_TO_SAME_FARMER = 3
MAX_RETRIES_NEGOTIATE_CONTRACT = 10
MAX_RETRIES_GET_FILE_POINTERS = 10
FILE_POINTERS_REQUEST_DELAY = 1
# int: file pointers request delay, in seconds.
MAX_DOWNLOAD_REQUEST_BLOCK_SIZE = ... | # -*- coding: utf-8 -*-
SAVE_PASSWORD_HASHED = True
MAX_RETRIES_DOWNLOAD_FROM_SAME_FARMER = 3
MAX_RETRIES_UPLOAD_TO_SAME_FARMER = 3
MAX_RETRIES_NEGOTIATE_CONTRACT = 10
MAX_RETRIES_GET_FILE_POINTERS = 10
FILE_POINTERS_REQUEST_DELAY = 1
# int: file pointers request delay, in seconds.
MAX_DOWNLOAD_REQUEST_BLOCK_SIZE = ... | <commit_before># -*- coding: utf-8 -*-
SAVE_PASSWORD_HASHED = True
MAX_RETRIES_DOWNLOAD_FROM_SAME_FARMER = 3
MAX_RETRIES_UPLOAD_TO_SAME_FARMER = 3
MAX_RETRIES_NEGOTIATE_CONTRACT = 10
MAX_RETRIES_GET_FILE_POINTERS = 10
FILE_POINTERS_REQUEST_DELAY = 1
# int: file pointers request delay, in seconds.
MAX_DOWNLOAD_REQUES... | # -*- coding: utf-8 -*-
SAVE_PASSWORD_HASHED = True
MAX_RETRIES_DOWNLOAD_FROM_SAME_FARMER = 3
MAX_RETRIES_UPLOAD_TO_SAME_FARMER = 3
MAX_RETRIES_NEGOTIATE_CONTRACT = 10
MAX_RETRIES_GET_FILE_POINTERS = 10
FILE_POINTERS_REQUEST_DELAY = 1
# int: file pointers request delay, in seconds.
MAX_DOWNLOAD_REQUEST_BLOCK_SIZE = ... | # -*- coding: utf-8 -*-
SAVE_PASSWORD_HASHED = True
MAX_RETRIES_DOWNLOAD_FROM_SAME_FARMER = 3
MAX_RETRIES_UPLOAD_TO_SAME_FARMER = 3
MAX_RETRIES_NEGOTIATE_CONTRACT = 10
MAX_RETRIES_GET_FILE_POINTERS = 10
FILE_POINTERS_REQUEST_DELAY = 1
# int: file pointers request delay, in seconds.
MAX_DOWNLOAD_REQUEST_BLOCK_SIZE = ... | <commit_before># -*- coding: utf-8 -*-
SAVE_PASSWORD_HASHED = True
MAX_RETRIES_DOWNLOAD_FROM_SAME_FARMER = 3
MAX_RETRIES_UPLOAD_TO_SAME_FARMER = 3
MAX_RETRIES_NEGOTIATE_CONTRACT = 10
MAX_RETRIES_GET_FILE_POINTERS = 10
FILE_POINTERS_REQUEST_DELAY = 1
# int: file pointers request delay, in seconds.
MAX_DOWNLOAD_REQUES... |
be9d58ffcf23e4fb47d2c09e869368ab9ec738c9 | localore/localore/embeds.py | localore/localore/embeds.py | from urllib.parse import urlparse
from django.conf import settings
from wagtail.wagtailembeds.finders.embedly import embedly
from wagtail.wagtailembeds.finders.oembed import oembed
def get_default_finder():
if hasattr(settings, 'WAGTAILEMBEDS_EMBEDLY_KEY'):
return embedly
return oembed
def finder(... | from urllib.parse import urlparse
from django.conf import settings
from wagtail.wagtailembeds.finders.embedly import embedly
from wagtail.wagtailembeds.finders.oembed import oembed
def get_default_finder():
if hasattr(settings, 'WAGTAILEMBEDS_EMBEDLY_KEY'):
return embedly
return oembed
def finder(... | Fix SoundCloud embed width/height replacement. | Fix SoundCloud embed width/height replacement.
SoundCloud embeds aren't always 500x500.
Also, don't set the "width" embed dict key to '100%':
"width"/"height" keys expect integers only.
| Python | mpl-2.0 | ghostwords/localore,ghostwords/localore,ghostwords/localore | from urllib.parse import urlparse
from django.conf import settings
from wagtail.wagtailembeds.finders.embedly import embedly
from wagtail.wagtailembeds.finders.oembed import oembed
def get_default_finder():
if hasattr(settings, 'WAGTAILEMBEDS_EMBEDLY_KEY'):
return embedly
return oembed
def finder(... | from urllib.parse import urlparse
from django.conf import settings
from wagtail.wagtailembeds.finders.embedly import embedly
from wagtail.wagtailembeds.finders.oembed import oembed
def get_default_finder():
if hasattr(settings, 'WAGTAILEMBEDS_EMBEDLY_KEY'):
return embedly
return oembed
def finder(... | <commit_before>from urllib.parse import urlparse
from django.conf import settings
from wagtail.wagtailembeds.finders.embedly import embedly
from wagtail.wagtailembeds.finders.oembed import oembed
def get_default_finder():
if hasattr(settings, 'WAGTAILEMBEDS_EMBEDLY_KEY'):
return embedly
return oembe... | from urllib.parse import urlparse
from django.conf import settings
from wagtail.wagtailembeds.finders.embedly import embedly
from wagtail.wagtailembeds.finders.oembed import oembed
def get_default_finder():
if hasattr(settings, 'WAGTAILEMBEDS_EMBEDLY_KEY'):
return embedly
return oembed
def finder(... | from urllib.parse import urlparse
from django.conf import settings
from wagtail.wagtailembeds.finders.embedly import embedly
from wagtail.wagtailembeds.finders.oembed import oembed
def get_default_finder():
if hasattr(settings, 'WAGTAILEMBEDS_EMBEDLY_KEY'):
return embedly
return oembed
def finder(... | <commit_before>from urllib.parse import urlparse
from django.conf import settings
from wagtail.wagtailembeds.finders.embedly import embedly
from wagtail.wagtailembeds.finders.oembed import oembed
def get_default_finder():
if hasattr(settings, 'WAGTAILEMBEDS_EMBEDLY_KEY'):
return embedly
return oembe... |
9ca260d508a8d7ed742251cc7f80541fbd32882f | mpld3/test_plots/test_tickformat_str_method.py | mpld3/test_plots/test_tickformat_str_method.py | import matplotlib
import matplotlib.pyplot as plt
import mpld3
from mpld3 import plugins
def create_plot():
fig, ax = plt.subplots()
ax.plot([1, 3], [1, 2])
fmtr = matplotlib.ticker.StrMethodFormatter("{x:.2f}")
ax.xaxis.set_major_formatter(fmtr)
ax.set_title('Tickformat str method test', size=14)... | import matplotlib
import matplotlib.pyplot as plt
import mpld3
from mpld3 import plugins
def create_plot():
fig, ax = plt.subplots()
ax.plot([1, 3], [1, 2])
fmtr = matplotlib.ticker.StrMethodFormatter("{x:.2f} :)")
ax.xaxis.set_major_formatter(fmtr)
ax.set_title('Tickformat str method test', size=... | Clarify purpose of test by...adding a smiley! | Clarify purpose of test by...adding a smiley!
| Python | bsd-3-clause | mpld3/mpld3,jakevdp/mpld3,jakevdp/mpld3,mpld3/mpld3 | import matplotlib
import matplotlib.pyplot as plt
import mpld3
from mpld3 import plugins
def create_plot():
fig, ax = plt.subplots()
ax.plot([1, 3], [1, 2])
fmtr = matplotlib.ticker.StrMethodFormatter("{x:.2f}")
ax.xaxis.set_major_formatter(fmtr)
ax.set_title('Tickformat str method test', size=14)... | import matplotlib
import matplotlib.pyplot as plt
import mpld3
from mpld3 import plugins
def create_plot():
fig, ax = plt.subplots()
ax.plot([1, 3], [1, 2])
fmtr = matplotlib.ticker.StrMethodFormatter("{x:.2f} :)")
ax.xaxis.set_major_formatter(fmtr)
ax.set_title('Tickformat str method test', size=... | <commit_before>import matplotlib
import matplotlib.pyplot as plt
import mpld3
from mpld3 import plugins
def create_plot():
fig, ax = plt.subplots()
ax.plot([1, 3], [1, 2])
fmtr = matplotlib.ticker.StrMethodFormatter("{x:.2f}")
ax.xaxis.set_major_formatter(fmtr)
ax.set_title('Tickformat str method ... | import matplotlib
import matplotlib.pyplot as plt
import mpld3
from mpld3 import plugins
def create_plot():
fig, ax = plt.subplots()
ax.plot([1, 3], [1, 2])
fmtr = matplotlib.ticker.StrMethodFormatter("{x:.2f} :)")
ax.xaxis.set_major_formatter(fmtr)
ax.set_title('Tickformat str method test', size=... | import matplotlib
import matplotlib.pyplot as plt
import mpld3
from mpld3 import plugins
def create_plot():
fig, ax = plt.subplots()
ax.plot([1, 3], [1, 2])
fmtr = matplotlib.ticker.StrMethodFormatter("{x:.2f}")
ax.xaxis.set_major_formatter(fmtr)
ax.set_title('Tickformat str method test', size=14)... | <commit_before>import matplotlib
import matplotlib.pyplot as plt
import mpld3
from mpld3 import plugins
def create_plot():
fig, ax = plt.subplots()
ax.plot([1, 3], [1, 2])
fmtr = matplotlib.ticker.StrMethodFormatter("{x:.2f}")
ax.xaxis.set_major_formatter(fmtr)
ax.set_title('Tickformat str method ... |
8184354179bf6cf88304ebd743b2236258e46522 | unicornclient/routine.py | unicornclient/routine.py | import threading
import queue
class Routine(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.queue = queue.Queue()
self.manager = None
self.no_wait = False
self.is_stopping = False
self.sleeper = threading.Event()
def run(self):
... | import threading
import queue
class Routine(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.queue = queue.Queue()
self.manager = None
self.no_wait = False
self.is_stopping = False
self.sleeper = threading.Event()
def run(self):
... | Disable sleep function when stopping | Disable sleep function when stopping
| Python | mit | amm0nite/unicornclient,amm0nite/unicornclient | import threading
import queue
class Routine(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.queue = queue.Queue()
self.manager = None
self.no_wait = False
self.is_stopping = False
self.sleeper = threading.Event()
def run(self):
... | import threading
import queue
class Routine(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.queue = queue.Queue()
self.manager = None
self.no_wait = False
self.is_stopping = False
self.sleeper = threading.Event()
def run(self):
... | <commit_before>import threading
import queue
class Routine(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.queue = queue.Queue()
self.manager = None
self.no_wait = False
self.is_stopping = False
self.sleeper = threading.Event()
def ru... | import threading
import queue
class Routine(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.queue = queue.Queue()
self.manager = None
self.no_wait = False
self.is_stopping = False
self.sleeper = threading.Event()
def run(self):
... | import threading
import queue
class Routine(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.queue = queue.Queue()
self.manager = None
self.no_wait = False
self.is_stopping = False
self.sleeper = threading.Event()
def run(self):
... | <commit_before>import threading
import queue
class Routine(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.queue = queue.Queue()
self.manager = None
self.no_wait = False
self.is_stopping = False
self.sleeper = threading.Event()
def ru... |
d260eefb8dc8ca8bc71c548c1389853e49eafd28 | scripts/manage_db.py | scripts/manage_db.py | """Database management and migration functionality."""
# pylint: disable=no-name-in-module,import-error
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand
# pylint: enable=no-name-in-module,import-error
from flask_forecaster.flask_app import app, db
migrate = Migrate(app, db)
... | """Database management and migration functionality."""
import logging
import sys
# pylint: disable=no-name-in-module,import-error
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand
# pylint: enable=no-name-in-module,import-error
from flask_forecaster.flask_app import app, db
... | Add logging to database management script | Add logging to database management script
| Python | isc | textbook/flask-forecaster,textbook/flask-forecaster | """Database management and migration functionality."""
# pylint: disable=no-name-in-module,import-error
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand
# pylint: enable=no-name-in-module,import-error
from flask_forecaster.flask_app import app, db
migrate = Migrate(app, db)
... | """Database management and migration functionality."""
import logging
import sys
# pylint: disable=no-name-in-module,import-error
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand
# pylint: enable=no-name-in-module,import-error
from flask_forecaster.flask_app import app, db
... | <commit_before>"""Database management and migration functionality."""
# pylint: disable=no-name-in-module,import-error
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand
# pylint: enable=no-name-in-module,import-error
from flask_forecaster.flask_app import app, db
migrate = Mi... | """Database management and migration functionality."""
import logging
import sys
# pylint: disable=no-name-in-module,import-error
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand
# pylint: enable=no-name-in-module,import-error
from flask_forecaster.flask_app import app, db
... | """Database management and migration functionality."""
# pylint: disable=no-name-in-module,import-error
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand
# pylint: enable=no-name-in-module,import-error
from flask_forecaster.flask_app import app, db
migrate = Migrate(app, db)
... | <commit_before>"""Database management and migration functionality."""
# pylint: disable=no-name-in-module,import-error
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand
# pylint: enable=no-name-in-module,import-error
from flask_forecaster.flask_app import app, db
migrate = Mi... |
42db9ceae490152040651a23d397e7ad4c950712 | flask/flask/tests/test_template.py | flask/flask/tests/test_template.py | from flask import Flask, render_template_string
import jinja2
def test_undefined_variable__no_error():
app = Flask(__name__)
assert issubclass(app.jinja_env.undefined, jinja2.Undefined)
@app.route('/')
def endpoint():
return render_template_string('foo = [{{bar}}]', foo='blabla')
resp = a... | # -*- coding: utf-8 -*-
from flask import Flask, render_template_string
import jinja2
def test_undefined_variable__no_error():
app = Flask(__name__)
assert issubclass(app.jinja_env.undefined, jinja2.Undefined)
@app.route('/')
def endpoint():
return render_template_string('foo = [{{bar}}]', foo... | Fix source code encoding error | [flask] Fix source code encoding error
| Python | mit | imsardine/learning,imsardine/learning,imsardine/learning,imsardine/learning,imsardine/learning,imsardine/learning,imsardine/learning | from flask import Flask, render_template_string
import jinja2
def test_undefined_variable__no_error():
app = Flask(__name__)
assert issubclass(app.jinja_env.undefined, jinja2.Undefined)
@app.route('/')
def endpoint():
return render_template_string('foo = [{{bar}}]', foo='blabla')
resp = a... | # -*- coding: utf-8 -*-
from flask import Flask, render_template_string
import jinja2
def test_undefined_variable__no_error():
app = Flask(__name__)
assert issubclass(app.jinja_env.undefined, jinja2.Undefined)
@app.route('/')
def endpoint():
return render_template_string('foo = [{{bar}}]', foo... | <commit_before>from flask import Flask, render_template_string
import jinja2
def test_undefined_variable__no_error():
app = Flask(__name__)
assert issubclass(app.jinja_env.undefined, jinja2.Undefined)
@app.route('/')
def endpoint():
return render_template_string('foo = [{{bar}}]', foo='blabla'... | # -*- coding: utf-8 -*-
from flask import Flask, render_template_string
import jinja2
def test_undefined_variable__no_error():
app = Flask(__name__)
assert issubclass(app.jinja_env.undefined, jinja2.Undefined)
@app.route('/')
def endpoint():
return render_template_string('foo = [{{bar}}]', foo... | from flask import Flask, render_template_string
import jinja2
def test_undefined_variable__no_error():
app = Flask(__name__)
assert issubclass(app.jinja_env.undefined, jinja2.Undefined)
@app.route('/')
def endpoint():
return render_template_string('foo = [{{bar}}]', foo='blabla')
resp = a... | <commit_before>from flask import Flask, render_template_string
import jinja2
def test_undefined_variable__no_error():
app = Flask(__name__)
assert issubclass(app.jinja_env.undefined, jinja2.Undefined)
@app.route('/')
def endpoint():
return render_template_string('foo = [{{bar}}]', foo='blabla'... |
6838e21d03060d23eefaaf4336214d04d98afe96 | install.py | install.py | #!/usr/bin/env python
import os
cdir = os.path.dirname(os.path.abspath(__file__))
sourcedir = os.path.join(cdir, 'src')
targetdir = '~'
for dotfile in os.listdir(sourcedir):
source = os.path.join(sourcedir, dotfile)
target = os.path.join(targetdir, dotfile)
##TODO## :: Look at why os.symlink doesn't like relati... | #!/usr/bin/env python
import os
cdir = os.path.dirname(os.path.abspath(__file__))
sourcedir = os.path.join(cdir, 'src')
targetdir = os.path.expanduser('~')
for dotfile in os.listdir(sourcedir):
source = os.path.join(sourcedir, dotfile)
target = os.path.join(targetdir, dotfile)
##TODO## :: Look at why os.symlink... | Make home directory selection more portable | Make home directory selection more portable
| Python | mit | jaylynch/dotfiles,jaylynch/dotfiles | #!/usr/bin/env python
import os
cdir = os.path.dirname(os.path.abspath(__file__))
sourcedir = os.path.join(cdir, 'src')
targetdir = '~'
for dotfile in os.listdir(sourcedir):
source = os.path.join(sourcedir, dotfile)
target = os.path.join(targetdir, dotfile)
##TODO## :: Look at why os.symlink doesn't like relati... | #!/usr/bin/env python
import os
cdir = os.path.dirname(os.path.abspath(__file__))
sourcedir = os.path.join(cdir, 'src')
targetdir = os.path.expanduser('~')
for dotfile in os.listdir(sourcedir):
source = os.path.join(sourcedir, dotfile)
target = os.path.join(targetdir, dotfile)
##TODO## :: Look at why os.symlink... | <commit_before>#!/usr/bin/env python
import os
cdir = os.path.dirname(os.path.abspath(__file__))
sourcedir = os.path.join(cdir, 'src')
targetdir = '~'
for dotfile in os.listdir(sourcedir):
source = os.path.join(sourcedir, dotfile)
target = os.path.join(targetdir, dotfile)
##TODO## :: Look at why os.symlink does... | #!/usr/bin/env python
import os
cdir = os.path.dirname(os.path.abspath(__file__))
sourcedir = os.path.join(cdir, 'src')
targetdir = os.path.expanduser('~')
for dotfile in os.listdir(sourcedir):
source = os.path.join(sourcedir, dotfile)
target = os.path.join(targetdir, dotfile)
##TODO## :: Look at why os.symlink... | #!/usr/bin/env python
import os
cdir = os.path.dirname(os.path.abspath(__file__))
sourcedir = os.path.join(cdir, 'src')
targetdir = '~'
for dotfile in os.listdir(sourcedir):
source = os.path.join(sourcedir, dotfile)
target = os.path.join(targetdir, dotfile)
##TODO## :: Look at why os.symlink doesn't like relati... | <commit_before>#!/usr/bin/env python
import os
cdir = os.path.dirname(os.path.abspath(__file__))
sourcedir = os.path.join(cdir, 'src')
targetdir = '~'
for dotfile in os.listdir(sourcedir):
source = os.path.join(sourcedir, dotfile)
target = os.path.join(targetdir, dotfile)
##TODO## :: Look at why os.symlink does... |
49c60d069da48cd83939a4e42e933e9a28e21dd2 | tests/cupy_tests/cuda_tests/test_nccl.py | tests/cupy_tests/cuda_tests/test_nccl.py | import unittest
from cupy import cuda
from cupy.testing import attr
@unittest.skipUnless(cuda.nccl_enabled, 'nccl is not installed')
class TestNCCL(unittest.TestCase):
@attr.gpu
def test_single_proc_ring(self):
id = cuda.nccl.get_unique_id()
comm = cuda.nccl.NcclCommunicator(1, id, 0)
... | import unittest
from cupy import cuda
from cupy.testing import attr
@unittest.skipUnless(cuda.nccl_enabled, 'nccl is not installed')
class TestNCCL(unittest.TestCase):
@attr.gpu
def test_single_proc_ring(self):
id = cuda.nccl.get_unique_id()
comm = cuda.nccl.NcclCommunicator(1, id, 0)
... | Check NCCL existence in test decorators | Check NCCL existence in test decorators
| Python | mit | cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy | import unittest
from cupy import cuda
from cupy.testing import attr
@unittest.skipUnless(cuda.nccl_enabled, 'nccl is not installed')
class TestNCCL(unittest.TestCase):
@attr.gpu
def test_single_proc_ring(self):
id = cuda.nccl.get_unique_id()
comm = cuda.nccl.NcclCommunicator(1, id, 0)
... | import unittest
from cupy import cuda
from cupy.testing import attr
@unittest.skipUnless(cuda.nccl_enabled, 'nccl is not installed')
class TestNCCL(unittest.TestCase):
@attr.gpu
def test_single_proc_ring(self):
id = cuda.nccl.get_unique_id()
comm = cuda.nccl.NcclCommunicator(1, id, 0)
... | <commit_before>import unittest
from cupy import cuda
from cupy.testing import attr
@unittest.skipUnless(cuda.nccl_enabled, 'nccl is not installed')
class TestNCCL(unittest.TestCase):
@attr.gpu
def test_single_proc_ring(self):
id = cuda.nccl.get_unique_id()
comm = cuda.nccl.NcclCommunicator(1... | import unittest
from cupy import cuda
from cupy.testing import attr
@unittest.skipUnless(cuda.nccl_enabled, 'nccl is not installed')
class TestNCCL(unittest.TestCase):
@attr.gpu
def test_single_proc_ring(self):
id = cuda.nccl.get_unique_id()
comm = cuda.nccl.NcclCommunicator(1, id, 0)
... | import unittest
from cupy import cuda
from cupy.testing import attr
@unittest.skipUnless(cuda.nccl_enabled, 'nccl is not installed')
class TestNCCL(unittest.TestCase):
@attr.gpu
def test_single_proc_ring(self):
id = cuda.nccl.get_unique_id()
comm = cuda.nccl.NcclCommunicator(1, id, 0)
... | <commit_before>import unittest
from cupy import cuda
from cupy.testing import attr
@unittest.skipUnless(cuda.nccl_enabled, 'nccl is not installed')
class TestNCCL(unittest.TestCase):
@attr.gpu
def test_single_proc_ring(self):
id = cuda.nccl.get_unique_id()
comm = cuda.nccl.NcclCommunicator(1... |
5ca84f89d08ab4b31c47753ce74129ce06f8ed3a | apps/bluebottle_utils/models.py | apps/bluebottle_utils/models.py | from django.db import models
from django_countries import CountryField
class Address(models.Model):
"""
A postal address.
"""
address_line1 = models.CharField(max_length=100, blank=True)
address_line2 = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=100, blank=... | from django.db import models
from django_countries import CountryField
class Address(models.Model):
"""
A postal address.
"""
address_line1 = models.CharField(max_length=100, blank=True)
address_line2 = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=100, blank=... | Add a __unicode__ method to the Address model in utils. | Add a __unicode__ method to the Address model in utils.
| Python | bsd-3-clause | onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site | from django.db import models
from django_countries import CountryField
class Address(models.Model):
"""
A postal address.
"""
address_line1 = models.CharField(max_length=100, blank=True)
address_line2 = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=100, blank=... | from django.db import models
from django_countries import CountryField
class Address(models.Model):
"""
A postal address.
"""
address_line1 = models.CharField(max_length=100, blank=True)
address_line2 = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=100, blank=... | <commit_before>from django.db import models
from django_countries import CountryField
class Address(models.Model):
"""
A postal address.
"""
address_line1 = models.CharField(max_length=100, blank=True)
address_line2 = models.CharField(max_length=100, blank=True)
city = models.CharField(max_len... | from django.db import models
from django_countries import CountryField
class Address(models.Model):
"""
A postal address.
"""
address_line1 = models.CharField(max_length=100, blank=True)
address_line2 = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=100, blank=... | from django.db import models
from django_countries import CountryField
class Address(models.Model):
"""
A postal address.
"""
address_line1 = models.CharField(max_length=100, blank=True)
address_line2 = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=100, blank=... | <commit_before>from django.db import models
from django_countries import CountryField
class Address(models.Model):
"""
A postal address.
"""
address_line1 = models.CharField(max_length=100, blank=True)
address_line2 = models.CharField(max_length=100, blank=True)
city = models.CharField(max_len... |
a9cebe11642b41a8c0b277e09bf273b52dbb63f9 | apps/careeropportunity/views.py | apps/careeropportunity/views.py | # -*- coding: utf-8 -*-
from django.shortcuts import render
from django.utils import timezone
# API v1
from rest_framework import mixins, viewsets
from rest_framework.permissions import AllowAny
from apps.careeropportunity.models import CareerOpportunity
from apps.careeropportunity.serializers import CareerSerializer... | # -*- coding: utf-8 -*-
from django.shortcuts import render
from django.utils import timezone
# API v1
from rest_framework import mixins, viewsets
from rest_framework.permissions import AllowAny
from rest_framework.pagination import PageNumberPagination
from apps.careeropportunity.models import CareerOpportunity
from... | Increase pagination size for careeropportunity api | Increase pagination size for careeropportunity api
| Python | mit | dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4 | # -*- coding: utf-8 -*-
from django.shortcuts import render
from django.utils import timezone
# API v1
from rest_framework import mixins, viewsets
from rest_framework.permissions import AllowAny
from apps.careeropportunity.models import CareerOpportunity
from apps.careeropportunity.serializers import CareerSerializer... | # -*- coding: utf-8 -*-
from django.shortcuts import render
from django.utils import timezone
# API v1
from rest_framework import mixins, viewsets
from rest_framework.permissions import AllowAny
from rest_framework.pagination import PageNumberPagination
from apps.careeropportunity.models import CareerOpportunity
from... | <commit_before># -*- coding: utf-8 -*-
from django.shortcuts import render
from django.utils import timezone
# API v1
from rest_framework import mixins, viewsets
from rest_framework.permissions import AllowAny
from apps.careeropportunity.models import CareerOpportunity
from apps.careeropportunity.serializers import C... | # -*- coding: utf-8 -*-
from django.shortcuts import render
from django.utils import timezone
# API v1
from rest_framework import mixins, viewsets
from rest_framework.permissions import AllowAny
from rest_framework.pagination import PageNumberPagination
from apps.careeropportunity.models import CareerOpportunity
from... | # -*- coding: utf-8 -*-
from django.shortcuts import render
from django.utils import timezone
# API v1
from rest_framework import mixins, viewsets
from rest_framework.permissions import AllowAny
from apps.careeropportunity.models import CareerOpportunity
from apps.careeropportunity.serializers import CareerSerializer... | <commit_before># -*- coding: utf-8 -*-
from django.shortcuts import render
from django.utils import timezone
# API v1
from rest_framework import mixins, viewsets
from rest_framework.permissions import AllowAny
from apps.careeropportunity.models import CareerOpportunity
from apps.careeropportunity.serializers import C... |
453b6a8697b066174802257156ac364aed2c650a | emission/storage/timeseries/aggregate_timeseries.py | emission/storage/timeseries/aggregate_timeseries.py | import logging
import pandas as pd
import pymongo
import emission.core.get_database as edb
import emission.storage.timeseries.builtin_timeseries as bits
class AggregateTimeSeries(bits.BuiltinTimeSeries):
def __init__(self):
super(AggregateTimeSeries, self).__init__(None)
self.user_query = {}
| import logging
import pandas as pd
import pymongo
import emission.core.get_database as edb
import emission.storage.timeseries.builtin_timeseries as bits
class AggregateTimeSeries(bits.BuiltinTimeSeries):
def __init__(self):
super(AggregateTimeSeries, self).__init__(None)
self.user_query = {}
... | Implement a sort key method for the aggregate timeseries | Implement a sort key method for the aggregate timeseries
This should return null because we want to mix up the identifying information
from the timeseries and sorting will re-impose some order. Also sorting takes
too much time!
| Python | bsd-3-clause | shankari/e-mission-server,yw374cornell/e-mission-server,e-mission/e-mission-server,sunil07t/e-mission-server,e-mission/e-mission-server,sunil07t/e-mission-server,shankari/e-mission-server,shankari/e-mission-server,e-mission/e-mission-server,yw374cornell/e-mission-server,sunil07t/e-mission-server,yw374cornell/e-mission-... | import logging
import pandas as pd
import pymongo
import emission.core.get_database as edb
import emission.storage.timeseries.builtin_timeseries as bits
class AggregateTimeSeries(bits.BuiltinTimeSeries):
def __init__(self):
super(AggregateTimeSeries, self).__init__(None)
self.user_query = {}
Impl... | import logging
import pandas as pd
import pymongo
import emission.core.get_database as edb
import emission.storage.timeseries.builtin_timeseries as bits
class AggregateTimeSeries(bits.BuiltinTimeSeries):
def __init__(self):
super(AggregateTimeSeries, self).__init__(None)
self.user_query = {}
... | <commit_before>import logging
import pandas as pd
import pymongo
import emission.core.get_database as edb
import emission.storage.timeseries.builtin_timeseries as bits
class AggregateTimeSeries(bits.BuiltinTimeSeries):
def __init__(self):
super(AggregateTimeSeries, self).__init__(None)
self.user_q... | import logging
import pandas as pd
import pymongo
import emission.core.get_database as edb
import emission.storage.timeseries.builtin_timeseries as bits
class AggregateTimeSeries(bits.BuiltinTimeSeries):
def __init__(self):
super(AggregateTimeSeries, self).__init__(None)
self.user_query = {}
... | import logging
import pandas as pd
import pymongo
import emission.core.get_database as edb
import emission.storage.timeseries.builtin_timeseries as bits
class AggregateTimeSeries(bits.BuiltinTimeSeries):
def __init__(self):
super(AggregateTimeSeries, self).__init__(None)
self.user_query = {}
Impl... | <commit_before>import logging
import pandas as pd
import pymongo
import emission.core.get_database as edb
import emission.storage.timeseries.builtin_timeseries as bits
class AggregateTimeSeries(bits.BuiltinTimeSeries):
def __init__(self):
super(AggregateTimeSeries, self).__init__(None)
self.user_q... |
6577b521ac8fd0f1c9007f819dc0c7ee27ef4955 | numba/typesystem/tests/test_type_properties.py | numba/typesystem/tests/test_type_properties.py | from numba.typesystem import *
assert int_.is_int
assert int_.is_numeric
assert long_.is_int
assert long_.is_numeric
assert not long_.is_long
assert float_.is_float
assert float_.is_numeric
assert double.is_float
assert double.is_numeric
assert not double.is_double
assert object_.is_object
assert list_.is_list
asser... | from numba.typesystem import *
assert int_.is_int
assert int_.is_numeric
assert long_.is_int
assert long_.is_numeric
assert not long_.is_long
assert float_.is_float
assert float_.is_numeric
assert double.is_float
assert double.is_numeric
assert not double.is_double
assert object_.is_object
assert list_(int_, 2).is_l... | Update test for rename of list type | Update test for rename of list type
| Python | bsd-2-clause | gdementen/numba,GaZ3ll3/numba,stuartarchibald/numba,pitrou/numba,jriehl/numba,stefanseefeld/numba,ssarangi/numba,sklam/numba,IntelLabs/numba,gdementen/numba,jriehl/numba,stuartarchibald/numba,GaZ3ll3/numba,GaZ3ll3/numba,seibert/numba,numba/numba,pombredanne/numba,jriehl/numba,pitrou/numba,cpcloud/numba,gmarkall/numba,s... | from numba.typesystem import *
assert int_.is_int
assert int_.is_numeric
assert long_.is_int
assert long_.is_numeric
assert not long_.is_long
assert float_.is_float
assert float_.is_numeric
assert double.is_float
assert double.is_numeric
assert not double.is_double
assert object_.is_object
assert list_.is_list
asser... | from numba.typesystem import *
assert int_.is_int
assert int_.is_numeric
assert long_.is_int
assert long_.is_numeric
assert not long_.is_long
assert float_.is_float
assert float_.is_numeric
assert double.is_float
assert double.is_numeric
assert not double.is_double
assert object_.is_object
assert list_(int_, 2).is_l... | <commit_before>from numba.typesystem import *
assert int_.is_int
assert int_.is_numeric
assert long_.is_int
assert long_.is_numeric
assert not long_.is_long
assert float_.is_float
assert float_.is_numeric
assert double.is_float
assert double.is_numeric
assert not double.is_double
assert object_.is_object
assert list... | from numba.typesystem import *
assert int_.is_int
assert int_.is_numeric
assert long_.is_int
assert long_.is_numeric
assert not long_.is_long
assert float_.is_float
assert float_.is_numeric
assert double.is_float
assert double.is_numeric
assert not double.is_double
assert object_.is_object
assert list_(int_, 2).is_l... | from numba.typesystem import *
assert int_.is_int
assert int_.is_numeric
assert long_.is_int
assert long_.is_numeric
assert not long_.is_long
assert float_.is_float
assert float_.is_numeric
assert double.is_float
assert double.is_numeric
assert not double.is_double
assert object_.is_object
assert list_.is_list
asser... | <commit_before>from numba.typesystem import *
assert int_.is_int
assert int_.is_numeric
assert long_.is_int
assert long_.is_numeric
assert not long_.is_long
assert float_.is_float
assert float_.is_numeric
assert double.is_float
assert double.is_numeric
assert not double.is_double
assert object_.is_object
assert list... |
3d435421fd3680d4b5e84a4ca69e4d294c3e01e0 | example/__init__.py | example/__init__.py | from pupa.scrape import Jurisdiction
from .people import PersonScraper
class Example(Jurisdiction):
jurisdiction_id = 'ocd-jurisdiction/country:us/state:ex/place:example'
name = 'Example Legislature'
url = 'http://example.com'
terms = [{
'name': '2013-2014',
'sessions': ['2013'],
... | from pupa.scrape import Jurisdiction
from .people import PersonScraper
class Example(Jurisdiction):
jurisdiction_id = 'ocd-jurisdiction/country:us/state:ex/place:example'
name = 'Example Legislature'
url = 'http://example.com'
terms = [{
'name': '2013-2014',
'sessions': ['2013'],
... | Remove trailing comma from example | Remove trailing comma from example
| Python | bsd-3-clause | datamade/pupa,rshorey/pupa,influence-usa/pupa,mileswwatkins/pupa,influence-usa/pupa,opencivicdata/pupa,rshorey/pupa,opencivicdata/pupa,mileswwatkins/pupa,datamade/pupa | from pupa.scrape import Jurisdiction
from .people import PersonScraper
class Example(Jurisdiction):
jurisdiction_id = 'ocd-jurisdiction/country:us/state:ex/place:example'
name = 'Example Legislature'
url = 'http://example.com'
terms = [{
'name': '2013-2014',
'sessions': ['2013'],
... | from pupa.scrape import Jurisdiction
from .people import PersonScraper
class Example(Jurisdiction):
jurisdiction_id = 'ocd-jurisdiction/country:us/state:ex/place:example'
name = 'Example Legislature'
url = 'http://example.com'
terms = [{
'name': '2013-2014',
'sessions': ['2013'],
... | <commit_before>from pupa.scrape import Jurisdiction
from .people import PersonScraper
class Example(Jurisdiction):
jurisdiction_id = 'ocd-jurisdiction/country:us/state:ex/place:example'
name = 'Example Legislature'
url = 'http://example.com'
terms = [{
'name': '2013-2014',
'sessions':... | from pupa.scrape import Jurisdiction
from .people import PersonScraper
class Example(Jurisdiction):
jurisdiction_id = 'ocd-jurisdiction/country:us/state:ex/place:example'
name = 'Example Legislature'
url = 'http://example.com'
terms = [{
'name': '2013-2014',
'sessions': ['2013'],
... | from pupa.scrape import Jurisdiction
from .people import PersonScraper
class Example(Jurisdiction):
jurisdiction_id = 'ocd-jurisdiction/country:us/state:ex/place:example'
name = 'Example Legislature'
url = 'http://example.com'
terms = [{
'name': '2013-2014',
'sessions': ['2013'],
... | <commit_before>from pupa.scrape import Jurisdiction
from .people import PersonScraper
class Example(Jurisdiction):
jurisdiction_id = 'ocd-jurisdiction/country:us/state:ex/place:example'
name = 'Example Legislature'
url = 'http://example.com'
terms = [{
'name': '2013-2014',
'sessions':... |
c9f5bee80dfb0523050afc6cb72eea096a2e3b95 | ir/util.py | ir/util.py | import os
import stat
import time
def updateModificationTime(path):
accessTime = os.stat(path)[stat.ST_ATIME]
modificationTime = time.time()
os.utime(path, (accessTime, modificationTime))
| import os
import stat
import time
from PyQt4.QtCore import SIGNAL
from PyQt4.QtGui import QAction, QKeySequence, QMenu, QShortcut
from aqt import mw
def addMenu(name):
if not hasattr(mw, 'customMenus'):
mw.customMenus = {}
if name not in mw.customMenus:
menu = QMenu('&' + name, mw)
m... | Add helper functions for adding menu items & shortcuts | Add helper functions for adding menu items & shortcuts
| Python | isc | luoliyan/incremental-reading-for-anki,luoliyan/incremental-reading-for-anki | import os
import stat
import time
def updateModificationTime(path):
accessTime = os.stat(path)[stat.ST_ATIME]
modificationTime = time.time()
os.utime(path, (accessTime, modificationTime))
Add helper functions for adding menu items & shortcuts | import os
import stat
import time
from PyQt4.QtCore import SIGNAL
from PyQt4.QtGui import QAction, QKeySequence, QMenu, QShortcut
from aqt import mw
def addMenu(name):
if not hasattr(mw, 'customMenus'):
mw.customMenus = {}
if name not in mw.customMenus:
menu = QMenu('&' + name, mw)
m... | <commit_before>import os
import stat
import time
def updateModificationTime(path):
accessTime = os.stat(path)[stat.ST_ATIME]
modificationTime = time.time()
os.utime(path, (accessTime, modificationTime))
<commit_msg>Add helper functions for adding menu items & shortcuts<commit_after> | import os
import stat
import time
from PyQt4.QtCore import SIGNAL
from PyQt4.QtGui import QAction, QKeySequence, QMenu, QShortcut
from aqt import mw
def addMenu(name):
if not hasattr(mw, 'customMenus'):
mw.customMenus = {}
if name not in mw.customMenus:
menu = QMenu('&' + name, mw)
m... | import os
import stat
import time
def updateModificationTime(path):
accessTime = os.stat(path)[stat.ST_ATIME]
modificationTime = time.time()
os.utime(path, (accessTime, modificationTime))
Add helper functions for adding menu items & shortcutsimport os
import stat
import time
from PyQt4.QtCore im... | <commit_before>import os
import stat
import time
def updateModificationTime(path):
accessTime = os.stat(path)[stat.ST_ATIME]
modificationTime = time.time()
os.utime(path, (accessTime, modificationTime))
<commit_msg>Add helper functions for adding menu items & shortcuts<commit_after>import os
impo... |
eff7f0bf52507013859788eec29eea819af6ce63 | grow/preprocessors/routes_cache.py | grow/preprocessors/routes_cache.py | from . import base
class RoutesCachePreprocessor(base.BasePreprocessor):
KIND = '_routes_cache'
def __init__(self, pod):
self.pod = pod
def run(self, build=True):
self.pod.routes.reset_cache(rebuild=True)
def list_watched_dirs(self):
return ['/content/', '/static/']
| import datetime
from . import base
class RoutesCachePreprocessor(base.BasePreprocessor):
KIND = '_routes_cache'
LIMIT = datetime.timedelta(seconds=1)
def __init__(self, pod):
self.pod = pod
self._last_run = None
def run(self, build=True):
# Avoid rebuilding routes cache more ... | Implement ratelimit on routes cache. | Implement ratelimit on routes cache.
| Python | mit | denmojo/pygrow,grow/pygrow,grow/grow,denmojo/pygrow,denmojo/pygrow,grow/pygrow,grow/grow,grow/grow,grow/grow,grow/pygrow,denmojo/pygrow | from . import base
class RoutesCachePreprocessor(base.BasePreprocessor):
KIND = '_routes_cache'
def __init__(self, pod):
self.pod = pod
def run(self, build=True):
self.pod.routes.reset_cache(rebuild=True)
def list_watched_dirs(self):
return ['/content/', '/static/']
Implemen... | import datetime
from . import base
class RoutesCachePreprocessor(base.BasePreprocessor):
KIND = '_routes_cache'
LIMIT = datetime.timedelta(seconds=1)
def __init__(self, pod):
self.pod = pod
self._last_run = None
def run(self, build=True):
# Avoid rebuilding routes cache more ... | <commit_before>from . import base
class RoutesCachePreprocessor(base.BasePreprocessor):
KIND = '_routes_cache'
def __init__(self, pod):
self.pod = pod
def run(self, build=True):
self.pod.routes.reset_cache(rebuild=True)
def list_watched_dirs(self):
return ['/content/', '/sta... | import datetime
from . import base
class RoutesCachePreprocessor(base.BasePreprocessor):
KIND = '_routes_cache'
LIMIT = datetime.timedelta(seconds=1)
def __init__(self, pod):
self.pod = pod
self._last_run = None
def run(self, build=True):
# Avoid rebuilding routes cache more ... | from . import base
class RoutesCachePreprocessor(base.BasePreprocessor):
KIND = '_routes_cache'
def __init__(self, pod):
self.pod = pod
def run(self, build=True):
self.pod.routes.reset_cache(rebuild=True)
def list_watched_dirs(self):
return ['/content/', '/static/']
Implemen... | <commit_before>from . import base
class RoutesCachePreprocessor(base.BasePreprocessor):
KIND = '_routes_cache'
def __init__(self, pod):
self.pod = pod
def run(self, build=True):
self.pod.routes.reset_cache(rebuild=True)
def list_watched_dirs(self):
return ['/content/', '/sta... |
e2479e3f8748fbfa34c89ecda7d2f3e72e94fa57 | pydata/urls.py | pydata/urls.py | from django.conf.urls import url, include
from . import views
urlpatterns = [
url(r'^events/import/?$',
views.ConferenceImport.as_view(),
name='event_import'),
url(r'^persons/import/?$',
views.PersonImport.as_view(),
name='person_import'),
url(r'^tasks/import/?$',
... | from django.conf.urls import url, include
from . import views
urlpatterns = [
url(r'^events/import/?$',
views.ConferenceImport.as_view(),
name='event_import'),
url(r'^persons/import/?$',
views.PersonImport.as_view(),
name='person_import'),
url(r'^tasks/import/?$',
... | Fix malformed URLs in bulk import | Fix malformed URLs in bulk import
| Python | mit | swcarpentry/amy,vahtras/amy,pbanaszkiewicz/amy,pbanaszkiewicz/amy,swcarpentry/amy,vahtras/amy,swcarpentry/amy,vahtras/amy,pbanaszkiewicz/amy | from django.conf.urls import url, include
from . import views
urlpatterns = [
url(r'^events/import/?$',
views.ConferenceImport.as_view(),
name='event_import'),
url(r'^persons/import/?$',
views.PersonImport.as_view(),
name='person_import'),
url(r'^tasks/import/?$',
... | from django.conf.urls import url, include
from . import views
urlpatterns = [
url(r'^events/import/?$',
views.ConferenceImport.as_view(),
name='event_import'),
url(r'^persons/import/?$',
views.PersonImport.as_view(),
name='person_import'),
url(r'^tasks/import/?$',
... | <commit_before>from django.conf.urls import url, include
from . import views
urlpatterns = [
url(r'^events/import/?$',
views.ConferenceImport.as_view(),
name='event_import'),
url(r'^persons/import/?$',
views.PersonImport.as_view(),
name='person_import'),
url(r'^tasks/impor... | from django.conf.urls import url, include
from . import views
urlpatterns = [
url(r'^events/import/?$',
views.ConferenceImport.as_view(),
name='event_import'),
url(r'^persons/import/?$',
views.PersonImport.as_view(),
name='person_import'),
url(r'^tasks/import/?$',
... | from django.conf.urls import url, include
from . import views
urlpatterns = [
url(r'^events/import/?$',
views.ConferenceImport.as_view(),
name='event_import'),
url(r'^persons/import/?$',
views.PersonImport.as_view(),
name='person_import'),
url(r'^tasks/import/?$',
... | <commit_before>from django.conf.urls import url, include
from . import views
urlpatterns = [
url(r'^events/import/?$',
views.ConferenceImport.as_view(),
name='event_import'),
url(r'^persons/import/?$',
views.PersonImport.as_view(),
name='person_import'),
url(r'^tasks/impor... |
38d16da934503a964ae5e16aafd65c0642970472 | pysocialids.py | pysocialids.py | #
# define overloading of ids for each social site
# to be customized for your accounts
#
#
# flickr
#
def flickr_api_secret():
return ""
def flickr_api_key():
return ""
def flickr_user_id():
return ""
#
# twitter
#
def twitter_consumer_key():
return ""
def twitter_consu... | #
# define overloading of ids for each social site
# to be customized for your accounts
#
#
# flickr
#
def flickr_api_secret():
return ""
def flickr_api_key():
return ""
def flickr_user_id():
return ""
#
# twitter
#
def twitter_consumer_key():
return ""
def twitter_consu... | Complete social ids for wordpress and faa | Complete social ids for wordpress and faa
| Python | mit | JulienLeonard/socialstats | #
# define overloading of ids for each social site
# to be customized for your accounts
#
#
# flickr
#
def flickr_api_secret():
return ""
def flickr_api_key():
return ""
def flickr_user_id():
return ""
#
# twitter
#
def twitter_consumer_key():
return ""
def twitter_consu... | #
# define overloading of ids for each social site
# to be customized for your accounts
#
#
# flickr
#
def flickr_api_secret():
return ""
def flickr_api_key():
return ""
def flickr_user_id():
return ""
#
# twitter
#
def twitter_consumer_key():
return ""
def twitter_consu... | <commit_before>#
# define overloading of ids for each social site
# to be customized for your accounts
#
#
# flickr
#
def flickr_api_secret():
return ""
def flickr_api_key():
return ""
def flickr_user_id():
return ""
#
# twitter
#
def twitter_consumer_key():
return ""
de... | #
# define overloading of ids for each social site
# to be customized for your accounts
#
#
# flickr
#
def flickr_api_secret():
return ""
def flickr_api_key():
return ""
def flickr_user_id():
return ""
#
# twitter
#
def twitter_consumer_key():
return ""
def twitter_consu... | #
# define overloading of ids for each social site
# to be customized for your accounts
#
#
# flickr
#
def flickr_api_secret():
return ""
def flickr_api_key():
return ""
def flickr_user_id():
return ""
#
# twitter
#
def twitter_consumer_key():
return ""
def twitter_consu... | <commit_before>#
# define overloading of ids for each social site
# to be customized for your accounts
#
#
# flickr
#
def flickr_api_secret():
return ""
def flickr_api_key():
return ""
def flickr_user_id():
return ""
#
# twitter
#
def twitter_consumer_key():
return ""
de... |
4e1b76db16658a01d3f8cf99f8b5d58e63b5e343 | project_generator/builders/builder.py | project_generator/builders/builder.py | # Copyright 2014 0xc0170
#
# 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, soft... | # Copyright 2014 0xc0170
#
# 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, soft... | Fix - the project_path is the first member of tuple | Fix - the project_path is the first member of tuple
| Python | apache-2.0 | project-generator/project_generator,sarahmarshy/project_generator,0xc0170/project_generator,hwfwgrp/project_generator,ohagendorf/project_generator,sg-/project_generator,sg-/project_generator,molejar/project_generator | # Copyright 2014 0xc0170
#
# 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, soft... | # Copyright 2014 0xc0170
#
# 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, soft... | <commit_before># Copyright 2014 0xc0170
#
# 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 i... | # Copyright 2014 0xc0170
#
# 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, soft... | # Copyright 2014 0xc0170
#
# 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, soft... | <commit_before># Copyright 2014 0xc0170
#
# 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 i... |
b555137fa7c7e84353daa1d12e29ba636bb9fd77 | post_office/test_settings.py | post_office/test_settings.py | # -*- coding: utf-8 -*-
INSTALLED_APPS = ['post_office']
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
},
}
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
'LOCATION': '127.0.0.1:11211',
... | # -*- coding: utf-8 -*-
INSTALLED_APPS = ['post_office']
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
},
}
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'TIMEOUT': 36000,
'KEY_PREFIX... | Use locmem cache for tests. | Use locmem cache for tests.
| Python | mit | JostCrow/django-post_office,ekohl/django-post_office,CasherWest/django-post_office,ui/django-post_office,carrerasrodrigo/django-post_office,CasherWest/django-post_office,fapelhanz/django-post_office,jrief/django-post_office,RafRaf/django-post_office,LeGast00n/django-post_office,yprez/django-post_office,ui/django-post_o... | # -*- coding: utf-8 -*-
INSTALLED_APPS = ['post_office']
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
},
}
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
'LOCATION': '127.0.0.1:11211',
... | # -*- coding: utf-8 -*-
INSTALLED_APPS = ['post_office']
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
},
}
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'TIMEOUT': 36000,
'KEY_PREFIX... | <commit_before># -*- coding: utf-8 -*-
INSTALLED_APPS = ['post_office']
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
},
}
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
'LOCATION': '127.0... | # -*- coding: utf-8 -*-
INSTALLED_APPS = ['post_office']
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
},
}
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'TIMEOUT': 36000,
'KEY_PREFIX... | # -*- coding: utf-8 -*-
INSTALLED_APPS = ['post_office']
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
},
}
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
'LOCATION': '127.0.0.1:11211',
... | <commit_before># -*- coding: utf-8 -*-
INSTALLED_APPS = ['post_office']
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
},
}
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
'LOCATION': '127.0... |
f712a03fea451b846e6f8b3e33a685dc5794f923 | framework/transactions/commands.py | framework/transactions/commands.py | # -*- coding: utf-8 -*-
import logging
from framework.mongo import database as proxy_database
from website import settings as osfsettings
logger = logging.getLogger(__name__)
def begin(database=None):
database = database or proxy_database
database.command('beginTransaction')
def rollback(database=None):
... | # -*- coding: utf-8 -*-
import contextlib
import logging
from framework.mongo import database as proxy_database
from website import settings as osfsettings
logger = logging.getLogger(__name__)
@contextlib.contextmanager
def handle_missing_client():
try:
yield
except AttributeError:
if not osf... | Handle when database is None | Handle when database is None
| Python | apache-2.0 | baylee-d/osf.io,baylee-d/osf.io,mluo613/osf.io,hmoco/osf.io,caneruguz/osf.io,Nesiehr/osf.io,hmoco/osf.io,alexschiller/osf.io,chrisseto/osf.io,leb2dg/osf.io,saradbowman/osf.io,mattclark/osf.io,cslzchen/osf.io,HalcyonChimera/osf.io,felliott/osf.io,aaxelb/osf.io,pattisdr/osf.io,TomBaxter/osf.io,alexschiller/osf.io,Halcyon... | # -*- coding: utf-8 -*-
import logging
from framework.mongo import database as proxy_database
from website import settings as osfsettings
logger = logging.getLogger(__name__)
def begin(database=None):
database = database or proxy_database
database.command('beginTransaction')
def rollback(database=None):
... | # -*- coding: utf-8 -*-
import contextlib
import logging
from framework.mongo import database as proxy_database
from website import settings as osfsettings
logger = logging.getLogger(__name__)
@contextlib.contextmanager
def handle_missing_client():
try:
yield
except AttributeError:
if not osf... | <commit_before># -*- coding: utf-8 -*-
import logging
from framework.mongo import database as proxy_database
from website import settings as osfsettings
logger = logging.getLogger(__name__)
def begin(database=None):
database = database or proxy_database
database.command('beginTransaction')
def rollback(dat... | # -*- coding: utf-8 -*-
import contextlib
import logging
from framework.mongo import database as proxy_database
from website import settings as osfsettings
logger = logging.getLogger(__name__)
@contextlib.contextmanager
def handle_missing_client():
try:
yield
except AttributeError:
if not osf... | # -*- coding: utf-8 -*-
import logging
from framework.mongo import database as proxy_database
from website import settings as osfsettings
logger = logging.getLogger(__name__)
def begin(database=None):
database = database or proxy_database
database.command('beginTransaction')
def rollback(database=None):
... | <commit_before># -*- coding: utf-8 -*-
import logging
from framework.mongo import database as proxy_database
from website import settings as osfsettings
logger = logging.getLogger(__name__)
def begin(database=None):
database = database or proxy_database
database.command('beginTransaction')
def rollback(dat... |
96856fc267ec99de6e83a997346c853dbdb1cfd5 | reddit_adzerk/lib/validator.py | reddit_adzerk/lib/validator.py | import re
from r2.lib.errors import errors
from r2.lib.validator import (
VMultiByPath,
Validator,
)
from r2.models import (
NotFound,
Subreddit,
)
is_multi_rx = re.compile(r"\A/?(user|r)/[^\/]+/m/(?P<name>.*?)/?\Z")
class VSite(Validator):
def __init__(self, param, required=True, *args, **kwargs... | import re
from r2.lib.errors import errors
from r2.lib.validator import (
VMultiByPath,
Validator,
)
from r2.models import (
NotFound,
Subreddit,
MultiReddit,
)
is_multi_rx = re.compile(r"\A/?(user|r)/[^\/]+/m/(?P<name>.*?)/?\Z")
is_adhoc_multi_rx = re.compile(r"\A\/r\/((?:[0-z]+\+)+(?:[0-z])+)\Z"... | Fix adhoc multisubreddit promo_request network request | Fix adhoc multisubreddit promo_request network request
| Python | bsd-3-clause | madbook/reddit-plugin-adzerk,madbook/reddit-plugin-adzerk,madbook/reddit-plugin-adzerk | import re
from r2.lib.errors import errors
from r2.lib.validator import (
VMultiByPath,
Validator,
)
from r2.models import (
NotFound,
Subreddit,
)
is_multi_rx = re.compile(r"\A/?(user|r)/[^\/]+/m/(?P<name>.*?)/?\Z")
class VSite(Validator):
def __init__(self, param, required=True, *args, **kwargs... | import re
from r2.lib.errors import errors
from r2.lib.validator import (
VMultiByPath,
Validator,
)
from r2.models import (
NotFound,
Subreddit,
MultiReddit,
)
is_multi_rx = re.compile(r"\A/?(user|r)/[^\/]+/m/(?P<name>.*?)/?\Z")
is_adhoc_multi_rx = re.compile(r"\A\/r\/((?:[0-z]+\+)+(?:[0-z])+)\Z"... | <commit_before>import re
from r2.lib.errors import errors
from r2.lib.validator import (
VMultiByPath,
Validator,
)
from r2.models import (
NotFound,
Subreddit,
)
is_multi_rx = re.compile(r"\A/?(user|r)/[^\/]+/m/(?P<name>.*?)/?\Z")
class VSite(Validator):
def __init__(self, param, required=True, ... | import re
from r2.lib.errors import errors
from r2.lib.validator import (
VMultiByPath,
Validator,
)
from r2.models import (
NotFound,
Subreddit,
MultiReddit,
)
is_multi_rx = re.compile(r"\A/?(user|r)/[^\/]+/m/(?P<name>.*?)/?\Z")
is_adhoc_multi_rx = re.compile(r"\A\/r\/((?:[0-z]+\+)+(?:[0-z])+)\Z"... | import re
from r2.lib.errors import errors
from r2.lib.validator import (
VMultiByPath,
Validator,
)
from r2.models import (
NotFound,
Subreddit,
)
is_multi_rx = re.compile(r"\A/?(user|r)/[^\/]+/m/(?P<name>.*?)/?\Z")
class VSite(Validator):
def __init__(self, param, required=True, *args, **kwargs... | <commit_before>import re
from r2.lib.errors import errors
from r2.lib.validator import (
VMultiByPath,
Validator,
)
from r2.models import (
NotFound,
Subreddit,
)
is_multi_rx = re.compile(r"\A/?(user|r)/[^\/]+/m/(?P<name>.*?)/?\Z")
class VSite(Validator):
def __init__(self, param, required=True, ... |
06d271da251d3c85266629197d6b31b2ff617623 | sympy/matrices/expressions/tests/test_hadamard.py | sympy/matrices/expressions/tests/test_hadamard.py | from sympy.matrices.expressions import MatrixSymbol, HadamardProduct
from sympy.matrices import ShapeError
from sympy import symbols
from sympy.utilities.pytest import raises
def test_HadamardProduct():
n, m, k = symbols('n,m,k')
Z = MatrixSymbol('Z', n, n)
A = MatrixSymbol('A', n, m)
B = MatrixSymbol... | from sympy.matrices.expressions import MatrixSymbol, HadamardProduct
from sympy.matrices import ShapeError
from sympy import symbols
from sympy.utilities.pytest import raises
def test_HadamardProduct():
n, m, k = symbols('n,m,k')
Z = MatrixSymbol('Z', n, n)
A = MatrixSymbol('A', n, m)
B = MatrixSymbol... | Add index test for Hadamard+MatMul mix | Add index test for Hadamard+MatMul mix
| Python | bsd-3-clause | kaichogami/sympy,Sumith1896/sympy,sahmed95/sympy,MridulS/sympy,Gadal/sympy,yashsharan/sympy,Shaswat27/sympy,chaffra/sympy,beni55/sympy,drufat/sympy,MechCoder/sympy,souravsingh/sympy,kaushik94/sympy,abhiii5459/sympy,liangjiaxing/sympy,iamutkarshtiwari/sympy,Gadal/sympy,grevutiu-gabriel/sympy,vipulroxx/sympy,moble/sympy,... | from sympy.matrices.expressions import MatrixSymbol, HadamardProduct
from sympy.matrices import ShapeError
from sympy import symbols
from sympy.utilities.pytest import raises
def test_HadamardProduct():
n, m, k = symbols('n,m,k')
Z = MatrixSymbol('Z', n, n)
A = MatrixSymbol('A', n, m)
B = MatrixSymbol... | from sympy.matrices.expressions import MatrixSymbol, HadamardProduct
from sympy.matrices import ShapeError
from sympy import symbols
from sympy.utilities.pytest import raises
def test_HadamardProduct():
n, m, k = symbols('n,m,k')
Z = MatrixSymbol('Z', n, n)
A = MatrixSymbol('A', n, m)
B = MatrixSymbol... | <commit_before>from sympy.matrices.expressions import MatrixSymbol, HadamardProduct
from sympy.matrices import ShapeError
from sympy import symbols
from sympy.utilities.pytest import raises
def test_HadamardProduct():
n, m, k = symbols('n,m,k')
Z = MatrixSymbol('Z', n, n)
A = MatrixSymbol('A', n, m)
B... | from sympy.matrices.expressions import MatrixSymbol, HadamardProduct
from sympy.matrices import ShapeError
from sympy import symbols
from sympy.utilities.pytest import raises
def test_HadamardProduct():
n, m, k = symbols('n,m,k')
Z = MatrixSymbol('Z', n, n)
A = MatrixSymbol('A', n, m)
B = MatrixSymbol... | from sympy.matrices.expressions import MatrixSymbol, HadamardProduct
from sympy.matrices import ShapeError
from sympy import symbols
from sympy.utilities.pytest import raises
def test_HadamardProduct():
n, m, k = symbols('n,m,k')
Z = MatrixSymbol('Z', n, n)
A = MatrixSymbol('A', n, m)
B = MatrixSymbol... | <commit_before>from sympy.matrices.expressions import MatrixSymbol, HadamardProduct
from sympy.matrices import ShapeError
from sympy import symbols
from sympy.utilities.pytest import raises
def test_HadamardProduct():
n, m, k = symbols('n,m,k')
Z = MatrixSymbol('Z', n, n)
A = MatrixSymbol('A', n, m)
B... |
24d2b9620af40395c66bd8d93c443fddfe74b5cf | hs_core/tests/api/rest/__init__.py | hs_core/tests/api/rest/__init__.py | from test_create_resource import *
from test_resource_file import *
from test_resource_list import *
from test_resource_meta import *
from test_resource_types import *
from test_set_access_rules import *
from test_user_info import *
| # Do not import tests here as this will cause
# some tests to be discovered and run twice
| Remove REST test imports to avoid some tests being run twice | Remove REST test imports to avoid some tests being run twice
| Python | bsd-3-clause | ResearchSoftwareInstitute/MyHPOM,hydroshare/hydroshare,ResearchSoftwareInstitute/MyHPOM,hydroshare/hydroshare,FescueFungiShare/hydroshare,ResearchSoftwareInstitute/MyHPOM,RENCI/xDCIShare,ResearchSoftwareInstitute/MyHPOM,hydroshare/hydroshare,FescueFungiShare/hydroshare,ResearchSoftwareInstitute/MyHPOM,RENCI/xDCIShare,h... | from test_create_resource import *
from test_resource_file import *
from test_resource_list import *
from test_resource_meta import *
from test_resource_types import *
from test_set_access_rules import *
from test_user_info import *
Remove REST test imports to avoid some tests being run twice | # Do not import tests here as this will cause
# some tests to be discovered and run twice
| <commit_before>from test_create_resource import *
from test_resource_file import *
from test_resource_list import *
from test_resource_meta import *
from test_resource_types import *
from test_set_access_rules import *
from test_user_info import *
<commit_msg>Remove REST test imports to avoid some tests being run twice... | # Do not import tests here as this will cause
# some tests to be discovered and run twice
| from test_create_resource import *
from test_resource_file import *
from test_resource_list import *
from test_resource_meta import *
from test_resource_types import *
from test_set_access_rules import *
from test_user_info import *
Remove REST test imports to avoid some tests being run twice# Do not import tests here ... | <commit_before>from test_create_resource import *
from test_resource_file import *
from test_resource_list import *
from test_resource_meta import *
from test_resource_types import *
from test_set_access_rules import *
from test_user_info import *
<commit_msg>Remove REST test imports to avoid some tests being run twice... |
d328129a2f2909c1b8769f1edb94746c4a88dd28 | test_project/test_models.py | test_project/test_models.py | from django.db import models
class TestUser0(models.Model):
username = models.CharField()
test_field = models.CharField('My title')
class Meta:
app_label = 'controlcenter'
def foo(self):
return 'original foo value'
foo.short_description = 'original foo label'
def bar(self):
... | from django.db import models
class TestUser0(models.Model):
username = models.CharField(max_length=255)
test_field = models.CharField('My title', max_length=255)
class Meta:
app_label = 'controlcenter'
def foo(self):
return 'original foo value'
foo.short_description = 'original f... | Add `max_length` to char fields | Add `max_length` to char fields
| Python | bsd-3-clause | byashimov/django-controlcenter,byashimov/django-controlcenter,byashimov/django-controlcenter | from django.db import models
class TestUser0(models.Model):
username = models.CharField()
test_field = models.CharField('My title')
class Meta:
app_label = 'controlcenter'
def foo(self):
return 'original foo value'
foo.short_description = 'original foo label'
def bar(self):
... | from django.db import models
class TestUser0(models.Model):
username = models.CharField(max_length=255)
test_field = models.CharField('My title', max_length=255)
class Meta:
app_label = 'controlcenter'
def foo(self):
return 'original foo value'
foo.short_description = 'original f... | <commit_before>from django.db import models
class TestUser0(models.Model):
username = models.CharField()
test_field = models.CharField('My title')
class Meta:
app_label = 'controlcenter'
def foo(self):
return 'original foo value'
foo.short_description = 'original foo label'
... | from django.db import models
class TestUser0(models.Model):
username = models.CharField(max_length=255)
test_field = models.CharField('My title', max_length=255)
class Meta:
app_label = 'controlcenter'
def foo(self):
return 'original foo value'
foo.short_description = 'original f... | from django.db import models
class TestUser0(models.Model):
username = models.CharField()
test_field = models.CharField('My title')
class Meta:
app_label = 'controlcenter'
def foo(self):
return 'original foo value'
foo.short_description = 'original foo label'
def bar(self):
... | <commit_before>from django.db import models
class TestUser0(models.Model):
username = models.CharField()
test_field = models.CharField('My title')
class Meta:
app_label = 'controlcenter'
def foo(self):
return 'original foo value'
foo.short_description = 'original foo label'
... |
36e6e2bedcc37a48097ccf0abd544ca095748412 | build/strip-po-charset.py | build/strip-po-charset.py | #
# strip-po-charset.py
#
import sys, string
def strip_po_charset(inp, out):
out.write(string.replace(inp.read(),
"\"Content-Type: text/plain; charset=UTF-8\\n\"\n",""))
def main():
if len(sys.argv) != 3:
print "Usage: %s <input (po) file> <output (spo) fi... | #
# strip-po-charset.py
#
import sys, string
def strip_po_charset(inp, out):
out.write(string.replace(inp.read(),
"\"Content-Type: text/plain; charset=UTF-8\\n\"\n",""))
def main():
if len(sys.argv) != 3:
print "Usage: %s <input (po) file> <output (spo) file>" % sys.arg... | Set svn:eol-style='native' on some text files that were lacking it. | Set svn:eol-style='native' on some text files that were lacking it.
git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@855475 13f79535-47bb-0310-9956-ffa450edef68
| Python | apache-2.0 | wbond/subversion,wbond/subversion,wbond/subversion,YueLinHo/Subversion,YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,wbond/subversion,wbond/subversion,YueLinHo/Subversion,wbond/subversion,YueLinHo/Subversion,YueLinHo/Subversion,YueLinHo/Subversion,YueLinHo/Subversion | #
# strip-po-charset.py
#
import sys, string
def strip_po_charset(inp, out):
out.write(string.replace(inp.read(),
"\"Content-Type: text/plain; charset=UTF-8\\n\"\n",""))
def main():
if len(sys.argv) != 3:
print "Usage: %s <input (po) file> <output (spo) fi... | #
# strip-po-charset.py
#
import sys, string
def strip_po_charset(inp, out):
out.write(string.replace(inp.read(),
"\"Content-Type: text/plain; charset=UTF-8\\n\"\n",""))
def main():
if len(sys.argv) != 3:
print "Usage: %s <input (po) file> <output (spo) file>" % sys.arg... | <commit_before>#
# strip-po-charset.py
#
import sys, string
def strip_po_charset(inp, out):
out.write(string.replace(inp.read(),
"\"Content-Type: text/plain; charset=UTF-8\\n\"\n",""))
def main():
if len(sys.argv) != 3:
print "Usage: %s <input (po) file> <... | #
# strip-po-charset.py
#
import sys, string
def strip_po_charset(inp, out):
out.write(string.replace(inp.read(),
"\"Content-Type: text/plain; charset=UTF-8\\n\"\n",""))
def main():
if len(sys.argv) != 3:
print "Usage: %s <input (po) file> <output (spo) file>" % sys.arg... | #
# strip-po-charset.py
#
import sys, string
def strip_po_charset(inp, out):
out.write(string.replace(inp.read(),
"\"Content-Type: text/plain; charset=UTF-8\\n\"\n",""))
def main():
if len(sys.argv) != 3:
print "Usage: %s <input (po) file> <output (spo) fi... | <commit_before>#
# strip-po-charset.py
#
import sys, string
def strip_po_charset(inp, out):
out.write(string.replace(inp.read(),
"\"Content-Type: text/plain; charset=UTF-8\\n\"\n",""))
def main():
if len(sys.argv) != 3:
print "Usage: %s <input (po) file> <... |
a00f9c56671c028c69638f61d3d4c1fd022c0430 | cinspect/tests/test_patching.py | cinspect/tests/test_patching.py | from __future__ import absolute_import, print_function
# Standard library
import inspect
import unittest
from cinspect import getfile, getsource
class TestHelloModule(unittest.TestCase):
def test_patching_inspect_should_work(self):
# Given
inspect.getsource = getsource
inspect.getfile =... | from __future__ import absolute_import, print_function
# Standard library
import inspect
import unittest
from cinspect import getfile, getsource
class TestPatching(unittest.TestCase):
def test_patching_inspect_should_work(self):
# Given
inspect.getsource = getsource
inspect.getfile = ge... | Fix copy paste bug in test class name. | Fix copy paste bug in test class name.
| Python | bsd-3-clause | punchagan/cinspect,punchagan/cinspect | from __future__ import absolute_import, print_function
# Standard library
import inspect
import unittest
from cinspect import getfile, getsource
class TestHelloModule(unittest.TestCase):
def test_patching_inspect_should_work(self):
# Given
inspect.getsource = getsource
inspect.getfile =... | from __future__ import absolute_import, print_function
# Standard library
import inspect
import unittest
from cinspect import getfile, getsource
class TestPatching(unittest.TestCase):
def test_patching_inspect_should_work(self):
# Given
inspect.getsource = getsource
inspect.getfile = ge... | <commit_before>from __future__ import absolute_import, print_function
# Standard library
import inspect
import unittest
from cinspect import getfile, getsource
class TestHelloModule(unittest.TestCase):
def test_patching_inspect_should_work(self):
# Given
inspect.getsource = getsource
in... | from __future__ import absolute_import, print_function
# Standard library
import inspect
import unittest
from cinspect import getfile, getsource
class TestPatching(unittest.TestCase):
def test_patching_inspect_should_work(self):
# Given
inspect.getsource = getsource
inspect.getfile = ge... | from __future__ import absolute_import, print_function
# Standard library
import inspect
import unittest
from cinspect import getfile, getsource
class TestHelloModule(unittest.TestCase):
def test_patching_inspect_should_work(self):
# Given
inspect.getsource = getsource
inspect.getfile =... | <commit_before>from __future__ import absolute_import, print_function
# Standard library
import inspect
import unittest
from cinspect import getfile, getsource
class TestHelloModule(unittest.TestCase):
def test_patching_inspect_should_work(self):
# Given
inspect.getsource = getsource
in... |
97e39ec9e03728384ad00a7e011194412521631e | tests/test_containers.py | tests/test_containers.py | try:
from http.server import SimpleHTTPRequestHandler
except ImportError:
from SimpleHTTPServer import SimpleHTTPRequestHandler
try:
from socketserver import TCPServer
except ImportError:
from SocketServer import TCPServer
import os
import threading
import unittest
import containers
PORT = 8080
cla... | try:
from http.server import SimpleHTTPRequestHandler
except ImportError:
from SimpleHTTPServer import SimpleHTTPRequestHandler
try:
from socketserver import TCPServer
except ImportError:
from SocketServer import TCPServer
import os
import threading
import unittest
import glob, os
import containers
... | Remove aci files after tests have run | Remove aci files after tests have run
| Python | mit | kragniz/containers | try:
from http.server import SimpleHTTPRequestHandler
except ImportError:
from SimpleHTTPServer import SimpleHTTPRequestHandler
try:
from socketserver import TCPServer
except ImportError:
from SocketServer import TCPServer
import os
import threading
import unittest
import containers
PORT = 8080
cla... | try:
from http.server import SimpleHTTPRequestHandler
except ImportError:
from SimpleHTTPServer import SimpleHTTPRequestHandler
try:
from socketserver import TCPServer
except ImportError:
from SocketServer import TCPServer
import os
import threading
import unittest
import glob, os
import containers
... | <commit_before>try:
from http.server import SimpleHTTPRequestHandler
except ImportError:
from SimpleHTTPServer import SimpleHTTPRequestHandler
try:
from socketserver import TCPServer
except ImportError:
from SocketServer import TCPServer
import os
import threading
import unittest
import containers
P... | try:
from http.server import SimpleHTTPRequestHandler
except ImportError:
from SimpleHTTPServer import SimpleHTTPRequestHandler
try:
from socketserver import TCPServer
except ImportError:
from SocketServer import TCPServer
import os
import threading
import unittest
import glob, os
import containers
... | try:
from http.server import SimpleHTTPRequestHandler
except ImportError:
from SimpleHTTPServer import SimpleHTTPRequestHandler
try:
from socketserver import TCPServer
except ImportError:
from SocketServer import TCPServer
import os
import threading
import unittest
import containers
PORT = 8080
cla... | <commit_before>try:
from http.server import SimpleHTTPRequestHandler
except ImportError:
from SimpleHTTPServer import SimpleHTTPRequestHandler
try:
from socketserver import TCPServer
except ImportError:
from SocketServer import TCPServer
import os
import threading
import unittest
import containers
P... |
daf4a6fd35811210c546782a771c6ddef8641f25 | opps/images/templatetags/images_tags.py | opps/images/templatetags/images_tags.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import template
from django.conf import settings
from ..generate import image_url as url
register = template.Library()
@register.simple_tag
def image_url(image_url, **kwargs):
return url(image_url=image_url, **kwargs)
@register.simple_tag
def image_obj... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import template
from django.conf import settings
from ..generate import image_url as url
register = template.Library()
@register.simple_tag
def image_url(image_url, **kwargs):
return url(image_url=image_url, **kwargs)
@register.simple_tag
def image_obj... | Fix image_obj template tag when sending Nonetype image | Fix image_obj template tag when sending Nonetype image
| Python | mit | YACOWS/opps,YACOWS/opps,jeanmask/opps,opps/opps,williamroot/opps,jeanmask/opps,opps/opps,YACOWS/opps,jeanmask/opps,YACOWS/opps,williamroot/opps,opps/opps,williamroot/opps,williamroot/opps,opps/opps,jeanmask/opps | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import template
from django.conf import settings
from ..generate import image_url as url
register = template.Library()
@register.simple_tag
def image_url(image_url, **kwargs):
return url(image_url=image_url, **kwargs)
@register.simple_tag
def image_obj... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import template
from django.conf import settings
from ..generate import image_url as url
register = template.Library()
@register.simple_tag
def image_url(image_url, **kwargs):
return url(image_url=image_url, **kwargs)
@register.simple_tag
def image_obj... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import template
from django.conf import settings
from ..generate import image_url as url
register = template.Library()
@register.simple_tag
def image_url(image_url, **kwargs):
return url(image_url=image_url, **kwargs)
@register.simple_ta... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import template
from django.conf import settings
from ..generate import image_url as url
register = template.Library()
@register.simple_tag
def image_url(image_url, **kwargs):
return url(image_url=image_url, **kwargs)
@register.simple_tag
def image_obj... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import template
from django.conf import settings
from ..generate import image_url as url
register = template.Library()
@register.simple_tag
def image_url(image_url, **kwargs):
return url(image_url=image_url, **kwargs)
@register.simple_tag
def image_obj... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import template
from django.conf import settings
from ..generate import image_url as url
register = template.Library()
@register.simple_tag
def image_url(image_url, **kwargs):
return url(image_url=image_url, **kwargs)
@register.simple_ta... |
bb896ed1723ca01ed18d1110eb51ca1661135db6 | rapport/plugins/launchpad.py | rapport/plugins/launchpad.py | # Copyright (c) 2013, Sascha Peilicke <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHO... | # Copyright (c) 2013, Sascha Peilicke <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHO... | Add filter for "argparse" warning | Add filter for "argparse" warning
| Python | apache-2.0 | saschpe/rapport | # Copyright (c) 2013, Sascha Peilicke <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHO... | # Copyright (c) 2013, Sascha Peilicke <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHO... | <commit_before># Copyright (c) 2013, Sascha Peilicke <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be usef... | # Copyright (c) 2013, Sascha Peilicke <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHO... | # Copyright (c) 2013, Sascha Peilicke <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHO... | <commit_before># Copyright (c) 2013, Sascha Peilicke <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be usef... |
53d25950eb1ff21bb4488b60e802cb243735681f | cmsplugin_zinnia/placeholder.py | cmsplugin_zinnia/placeholder.py | """Placeholder model for Zinnia"""
import inspect
from cms.models.fields import PlaceholderField
from cms.plugin_rendering import render_placeholder
from zinnia.models.entry import EntryAbstractClass
class EntryPlaceholder(EntryAbstractClass):
"""Entry with a Placeholder to edit content"""
content_placehol... | """Placeholder model for Zinnia"""
import inspect
from django.template.context import Context, RequestContext
from cms.models.fields import PlaceholderField
from cms.plugin_rendering import render_placeholder
from zinnia.models.entry import EntryAbstractClass
class EntryPlaceholder(EntryAbstractClass):
"""Entry... | Make acquire_context always return some Context | Make acquire_context always return some Context
| Python | bsd-3-clause | django-blog-zinnia/cmsplugin-zinnia,bittner/cmsplugin-zinnia,bittner/cmsplugin-zinnia,django-blog-zinnia/cmsplugin-zinnia,bittner/cmsplugin-zinnia,django-blog-zinnia/cmsplugin-zinnia | """Placeholder model for Zinnia"""
import inspect
from cms.models.fields import PlaceholderField
from cms.plugin_rendering import render_placeholder
from zinnia.models.entry import EntryAbstractClass
class EntryPlaceholder(EntryAbstractClass):
"""Entry with a Placeholder to edit content"""
content_placehol... | """Placeholder model for Zinnia"""
import inspect
from django.template.context import Context, RequestContext
from cms.models.fields import PlaceholderField
from cms.plugin_rendering import render_placeholder
from zinnia.models.entry import EntryAbstractClass
class EntryPlaceholder(EntryAbstractClass):
"""Entry... | <commit_before>"""Placeholder model for Zinnia"""
import inspect
from cms.models.fields import PlaceholderField
from cms.plugin_rendering import render_placeholder
from zinnia.models.entry import EntryAbstractClass
class EntryPlaceholder(EntryAbstractClass):
"""Entry with a Placeholder to edit content"""
c... | """Placeholder model for Zinnia"""
import inspect
from django.template.context import Context, RequestContext
from cms.models.fields import PlaceholderField
from cms.plugin_rendering import render_placeholder
from zinnia.models.entry import EntryAbstractClass
class EntryPlaceholder(EntryAbstractClass):
"""Entry... | """Placeholder model for Zinnia"""
import inspect
from cms.models.fields import PlaceholderField
from cms.plugin_rendering import render_placeholder
from zinnia.models.entry import EntryAbstractClass
class EntryPlaceholder(EntryAbstractClass):
"""Entry with a Placeholder to edit content"""
content_placehol... | <commit_before>"""Placeholder model for Zinnia"""
import inspect
from cms.models.fields import PlaceholderField
from cms.plugin_rendering import render_placeholder
from zinnia.models.entry import EntryAbstractClass
class EntryPlaceholder(EntryAbstractClass):
"""Entry with a Placeholder to edit content"""
c... |
caf245e14421472adb0668e57adf5a3e3ae68424 | scuba/utils.py | scuba/utils.py | try:
from shlex import quote as shell_quote
except ImportError:
from pipes import quote as shell_quote
def format_cmdline(args, maxwidth=80):
def lines():
line = ''
for a in (shell_quote(a) for a in args):
if len(line) + len(a) > maxwidth:
yield line
... | try:
from shlex import quote as shell_quote
except ImportError:
from pipes import quote as shell_quote
def format_cmdline(args, maxwidth=80):
'''Format args into a shell-quoted command line.
The result will be wrapped to maxwidth characters where possible,
not breaking a single long argument.
... | Fix missing final line from format_cmdline() | Fix missing final line from format_cmdline()
The previous code was missing 'yield line' after the for loop.
This commit fixes that, as well as the extra space at the beginning
of each line. Normally, we'd use str.join() to avoid such a problem,
but this code is accumulating the line manually, so we can't just join
the... | Python | mit | JonathonReinhart/scuba,JonathonReinhart/scuba,JonathonReinhart/scuba | try:
from shlex import quote as shell_quote
except ImportError:
from pipes import quote as shell_quote
def format_cmdline(args, maxwidth=80):
def lines():
line = ''
for a in (shell_quote(a) for a in args):
if len(line) + len(a) > maxwidth:
yield line
... | try:
from shlex import quote as shell_quote
except ImportError:
from pipes import quote as shell_quote
def format_cmdline(args, maxwidth=80):
'''Format args into a shell-quoted command line.
The result will be wrapped to maxwidth characters where possible,
not breaking a single long argument.
... | <commit_before>try:
from shlex import quote as shell_quote
except ImportError:
from pipes import quote as shell_quote
def format_cmdline(args, maxwidth=80):
def lines():
line = ''
for a in (shell_quote(a) for a in args):
if len(line) + len(a) > maxwidth:
yield li... | try:
from shlex import quote as shell_quote
except ImportError:
from pipes import quote as shell_quote
def format_cmdline(args, maxwidth=80):
'''Format args into a shell-quoted command line.
The result will be wrapped to maxwidth characters where possible,
not breaking a single long argument.
... | try:
from shlex import quote as shell_quote
except ImportError:
from pipes import quote as shell_quote
def format_cmdline(args, maxwidth=80):
def lines():
line = ''
for a in (shell_quote(a) for a in args):
if len(line) + len(a) > maxwidth:
yield line
... | <commit_before>try:
from shlex import quote as shell_quote
except ImportError:
from pipes import quote as shell_quote
def format_cmdline(args, maxwidth=80):
def lines():
line = ''
for a in (shell_quote(a) for a in args):
if len(line) + len(a) > maxwidth:
yield li... |
2c5c04fd0bb1dc4f5bf54af2e2739fb6a0f1d2c4 | survey/urls.py | survey/urls.py | from django.conf.urls import patterns, include, url
from .views import IndexView, SurveyDetail, ConfirmView, SurveyCompleted
urlpatterns = patterns('',
# Examples:
url(r'^survey/$', IndexView.as_view(), name='survey-list'),
url(r'^survey/(?P<id>[a-zA-Z0-9-]+)/', SurveyDetail.as_view(), name='survey-detail'),
url(... | from django.conf.urls import patterns, include, url
from .views import IndexView, SurveyDetail, ConfirmView, SurveyCompleted
urlpatterns = patterns('',
url(r'^survey/$', IndexView.as_view(), name='survey-list'),
url(r'^survey/(?P<id>\d+)/', SurveyDetail.as_view(), name='survey-detail'),
url(r'^s... | Fix - No more crash when entering an url with letter | Fix - No more crash when entering an url with letter
| Python | agpl-3.0 | Pierre-Sassoulas/django-survey,Pierre-Sassoulas/django-survey,Pierre-Sassoulas/django-survey | from django.conf.urls import patterns, include, url
from .views import IndexView, SurveyDetail, ConfirmView, SurveyCompleted
urlpatterns = patterns('',
# Examples:
url(r'^survey/$', IndexView.as_view(), name='survey-list'),
url(r'^survey/(?P<id>[a-zA-Z0-9-]+)/', SurveyDetail.as_view(), name='survey-detail'),
url(... | from django.conf.urls import patterns, include, url
from .views import IndexView, SurveyDetail, ConfirmView, SurveyCompleted
urlpatterns = patterns('',
url(r'^survey/$', IndexView.as_view(), name='survey-list'),
url(r'^survey/(?P<id>\d+)/', SurveyDetail.as_view(), name='survey-detail'),
url(r'^s... | <commit_before>from django.conf.urls import patterns, include, url
from .views import IndexView, SurveyDetail, ConfirmView, SurveyCompleted
urlpatterns = patterns('',
# Examples:
url(r'^survey/$', IndexView.as_view(), name='survey-list'),
url(r'^survey/(?P<id>[a-zA-Z0-9-]+)/', SurveyDetail.as_view(), name='survey-... | from django.conf.urls import patterns, include, url
from .views import IndexView, SurveyDetail, ConfirmView, SurveyCompleted
urlpatterns = patterns('',
url(r'^survey/$', IndexView.as_view(), name='survey-list'),
url(r'^survey/(?P<id>\d+)/', SurveyDetail.as_view(), name='survey-detail'),
url(r'^s... | from django.conf.urls import patterns, include, url
from .views import IndexView, SurveyDetail, ConfirmView, SurveyCompleted
urlpatterns = patterns('',
# Examples:
url(r'^survey/$', IndexView.as_view(), name='survey-list'),
url(r'^survey/(?P<id>[a-zA-Z0-9-]+)/', SurveyDetail.as_view(), name='survey-detail'),
url(... | <commit_before>from django.conf.urls import patterns, include, url
from .views import IndexView, SurveyDetail, ConfirmView, SurveyCompleted
urlpatterns = patterns('',
# Examples:
url(r'^survey/$', IndexView.as_view(), name='survey-list'),
url(r'^survey/(?P<id>[a-zA-Z0-9-]+)/', SurveyDetail.as_view(), name='survey-... |
3e07e509fe0b1dd7c02b39c490c994e3c0bb94b5 | bot.py | bot.py | import discord
client = discord.Client()
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('!ping'):
msg = 'Pong! This bot is alive.'
await client.send_message(message.channel, msg)
@client.event
async def on_ready():... | # TODO Put an enum matching unit pairs, will make code cleaner
import discord
import re
from unitconverter import *
client = discord.Client()
def construct_response(messageregex):
string = messageregex.string + ' is '
currentvalue = int(messageregex.string.replace(messageregex.group(2), ''))
convertedva... | Add unit conversion for ft | Add unit conversion for ft
| Python | mit | suclearnub/scubot | import discord
client = discord.Client()
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('!ping'):
msg = 'Pong! This bot is alive.'
await client.send_message(message.channel, msg)
@client.event
async def on_ready():... | # TODO Put an enum matching unit pairs, will make code cleaner
import discord
import re
from unitconverter import *
client = discord.Client()
def construct_response(messageregex):
string = messageregex.string + ' is '
currentvalue = int(messageregex.string.replace(messageregex.group(2), ''))
convertedva... | <commit_before>import discord
client = discord.Client()
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('!ping'):
msg = 'Pong! This bot is alive.'
await client.send_message(message.channel, msg)
@client.event
async ... | # TODO Put an enum matching unit pairs, will make code cleaner
import discord
import re
from unitconverter import *
client = discord.Client()
def construct_response(messageregex):
string = messageregex.string + ' is '
currentvalue = int(messageregex.string.replace(messageregex.group(2), ''))
convertedva... | import discord
client = discord.Client()
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('!ping'):
msg = 'Pong! This bot is alive.'
await client.send_message(message.channel, msg)
@client.event
async def on_ready():... | <commit_before>import discord
client = discord.Client()
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('!ping'):
msg = 'Pong! This bot is alive.'
await client.send_message(message.channel, msg)
@client.event
async ... |
0381fe32664e246011d5917a81c81fce936ae364 | tests/tangelo-verbose.py | tests/tangelo-verbose.py | import fixture
def test_standard_verbosity():
stderr = fixture.start_tangelo(stderr=True)
stderr = '\n'.join(stderr)
assert 'TANGELO Server is running' in stderr
assert 'TANGELO Hostname' in stderr
fixture.stop_tangelo()
def test_lower_verbosity():
stderr = fixture.start_tangelo("-q", stder... | import fixture
def test_standard_verbosity():
stderr = fixture.start_tangelo(stderr=True)
stderr = '\n'.join(stderr)
fixture.stop_tangelo()
assert 'TANGELO Server is running' in stderr
assert 'TANGELO Hostname' in stderr
def test_lower_verbosity():
stderr = fixture.start_tangelo("-q", stder... | Reorder when the tangelo instance gets shut down in a test so that if an assert fails, other tests will still be able to run. | Reorder when the tangelo instance gets shut down in a test so that if an assert fails, other tests will still be able to run.
| Python | apache-2.0 | Kitware/tangelo,Kitware/tangelo,Kitware/tangelo | import fixture
def test_standard_verbosity():
stderr = fixture.start_tangelo(stderr=True)
stderr = '\n'.join(stderr)
assert 'TANGELO Server is running' in stderr
assert 'TANGELO Hostname' in stderr
fixture.stop_tangelo()
def test_lower_verbosity():
stderr = fixture.start_tangelo("-q", stder... | import fixture
def test_standard_verbosity():
stderr = fixture.start_tangelo(stderr=True)
stderr = '\n'.join(stderr)
fixture.stop_tangelo()
assert 'TANGELO Server is running' in stderr
assert 'TANGELO Hostname' in stderr
def test_lower_verbosity():
stderr = fixture.start_tangelo("-q", stder... | <commit_before>import fixture
def test_standard_verbosity():
stderr = fixture.start_tangelo(stderr=True)
stderr = '\n'.join(stderr)
assert 'TANGELO Server is running' in stderr
assert 'TANGELO Hostname' in stderr
fixture.stop_tangelo()
def test_lower_verbosity():
stderr = fixture.start_tang... | import fixture
def test_standard_verbosity():
stderr = fixture.start_tangelo(stderr=True)
stderr = '\n'.join(stderr)
fixture.stop_tangelo()
assert 'TANGELO Server is running' in stderr
assert 'TANGELO Hostname' in stderr
def test_lower_verbosity():
stderr = fixture.start_tangelo("-q", stder... | import fixture
def test_standard_verbosity():
stderr = fixture.start_tangelo(stderr=True)
stderr = '\n'.join(stderr)
assert 'TANGELO Server is running' in stderr
assert 'TANGELO Hostname' in stderr
fixture.stop_tangelo()
def test_lower_verbosity():
stderr = fixture.start_tangelo("-q", stder... | <commit_before>import fixture
def test_standard_verbosity():
stderr = fixture.start_tangelo(stderr=True)
stderr = '\n'.join(stderr)
assert 'TANGELO Server is running' in stderr
assert 'TANGELO Hostname' in stderr
fixture.stop_tangelo()
def test_lower_verbosity():
stderr = fixture.start_tang... |
e2954d74b77046d3dee8134128f122a09dff3c7d | clowder_server/emailer.py | clowder_server/emailer.py | from django.core.mail import send_mail
from clowder_account.models import ClowderUser
ADMIN_EMAIL = '[email protected]'
def send_alert(company, name):
for user in ClowderUser.objects.filter(company=company):
subject = 'FAILURE: %s' % (name)
body = subject
send_mail(subject, body, ADMIN_EMAI... | import os
import requests
from django.core.mail import send_mail
from clowder_account.models import ClowderUser
ADMIN_EMAIL = '[email protected]'
def send_alert(company, name):
for user in ClowderUser.objects.filter(company=company):
subject = 'FAILURE: %s' % (name)
body = subject
slack_to... | Add support for slack messaging | Add support for slack messaging
| Python | agpl-3.0 | keithhackbarth/clowder_server,keithhackbarth/clowder_server,keithhackbarth/clowder_server,keithhackbarth/clowder_server | from django.core.mail import send_mail
from clowder_account.models import ClowderUser
ADMIN_EMAIL = '[email protected]'
def send_alert(company, name):
for user in ClowderUser.objects.filter(company=company):
subject = 'FAILURE: %s' % (name)
body = subject
send_mail(subject, body, ADMIN_EMAI... | import os
import requests
from django.core.mail import send_mail
from clowder_account.models import ClowderUser
ADMIN_EMAIL = '[email protected]'
def send_alert(company, name):
for user in ClowderUser.objects.filter(company=company):
subject = 'FAILURE: %s' % (name)
body = subject
slack_to... | <commit_before>from django.core.mail import send_mail
from clowder_account.models import ClowderUser
ADMIN_EMAIL = '[email protected]'
def send_alert(company, name):
for user in ClowderUser.objects.filter(company=company):
subject = 'FAILURE: %s' % (name)
body = subject
send_mail(subject, b... | import os
import requests
from django.core.mail import send_mail
from clowder_account.models import ClowderUser
ADMIN_EMAIL = '[email protected]'
def send_alert(company, name):
for user in ClowderUser.objects.filter(company=company):
subject = 'FAILURE: %s' % (name)
body = subject
slack_to... | from django.core.mail import send_mail
from clowder_account.models import ClowderUser
ADMIN_EMAIL = '[email protected]'
def send_alert(company, name):
for user in ClowderUser.objects.filter(company=company):
subject = 'FAILURE: %s' % (name)
body = subject
send_mail(subject, body, ADMIN_EMAI... | <commit_before>from django.core.mail import send_mail
from clowder_account.models import ClowderUser
ADMIN_EMAIL = '[email protected]'
def send_alert(company, name):
for user in ClowderUser.objects.filter(company=company):
subject = 'FAILURE: %s' % (name)
body = subject
send_mail(subject, b... |
247c1fc0af2556a5bd421488430d97f45c533771 | kaggle/titanic/categorical_and_scaler_prediction.py | kaggle/titanic/categorical_and_scaler_prediction.py | import pandas
def main():
train_all = pandas.DataFrame.from_csv('train.csv')
train = train_all[['Survived', 'Sex', 'Fare']]
print(train)
if __name__ == '__main__':
main()
| import pandas
from sklearn.naive_bayes import MultinomialNB
from sklearn.cross_validation import train_test_split
from sklearn.preprocessing import LabelEncoder
def main():
train_all = pandas.DataFrame.from_csv('train.csv')
train = train_all[['Survived', 'Sex', 'Fare']][:20]
gender_label = LabelEncoder()... | Make predictions with gender and ticket price | Make predictions with gender and ticket price
| Python | mit | noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit | import pandas
def main():
train_all = pandas.DataFrame.from_csv('train.csv')
train = train_all[['Survived', 'Sex', 'Fare']]
print(train)
if __name__ == '__main__':
main()
Make predictions with gender and ticket price | import pandas
from sklearn.naive_bayes import MultinomialNB
from sklearn.cross_validation import train_test_split
from sklearn.preprocessing import LabelEncoder
def main():
train_all = pandas.DataFrame.from_csv('train.csv')
train = train_all[['Survived', 'Sex', 'Fare']][:20]
gender_label = LabelEncoder()... | <commit_before>import pandas
def main():
train_all = pandas.DataFrame.from_csv('train.csv')
train = train_all[['Survived', 'Sex', 'Fare']]
print(train)
if __name__ == '__main__':
main()
<commit_msg>Make predictions with gender and ticket price<commit_after> | import pandas
from sklearn.naive_bayes import MultinomialNB
from sklearn.cross_validation import train_test_split
from sklearn.preprocessing import LabelEncoder
def main():
train_all = pandas.DataFrame.from_csv('train.csv')
train = train_all[['Survived', 'Sex', 'Fare']][:20]
gender_label = LabelEncoder()... | import pandas
def main():
train_all = pandas.DataFrame.from_csv('train.csv')
train = train_all[['Survived', 'Sex', 'Fare']]
print(train)
if __name__ == '__main__':
main()
Make predictions with gender and ticket priceimport pandas
from sklearn.naive_bayes import MultinomialNB
from sklearn.cross_valid... | <commit_before>import pandas
def main():
train_all = pandas.DataFrame.from_csv('train.csv')
train = train_all[['Survived', 'Sex', 'Fare']]
print(train)
if __name__ == '__main__':
main()
<commit_msg>Make predictions with gender and ticket price<commit_after>import pandas
from sklearn.naive_bayes impo... |
70259a9f9ce5647f9c36b70c2eb20b51ba447eda | middleware.py | middleware.py | #!/usr/bin/env python3
class Routes:
'''Define the feature of route for URIs.'''
def __init__(self):
self._Routes = []
def AddRoute(self, uri, callback):
'''Add an URI into the route table.'''
self._Routes.append([uri, callback])
def Dispatch(self, req, res):
'''Dispatch an URI according to the route tab... | #!/usr/bin/env python3
class Routes:
'''Define the feature of route for URIs.'''
def __init__(self):
self._Routes = []
def AddRoute(self, uri, callback):
'''Add an URI into the route table.'''
self._Routes.append([uri, callback])
def Dispatch(self, req, res):
'''Dispatch an URI according to the route tab... | Add read static files feature. | Add read static files feature.
| Python | bsd-3-clause | starnight/MicroHttpServer,starnight/MicroHttpServer,starnight/MicroHttpServer,starnight/MicroHttpServer | #!/usr/bin/env python3
class Routes:
'''Define the feature of route for URIs.'''
def __init__(self):
self._Routes = []
def AddRoute(self, uri, callback):
'''Add an URI into the route table.'''
self._Routes.append([uri, callback])
def Dispatch(self, req, res):
'''Dispatch an URI according to the route tab... | #!/usr/bin/env python3
class Routes:
'''Define the feature of route for URIs.'''
def __init__(self):
self._Routes = []
def AddRoute(self, uri, callback):
'''Add an URI into the route table.'''
self._Routes.append([uri, callback])
def Dispatch(self, req, res):
'''Dispatch an URI according to the route tab... | <commit_before>#!/usr/bin/env python3
class Routes:
'''Define the feature of route for URIs.'''
def __init__(self):
self._Routes = []
def AddRoute(self, uri, callback):
'''Add an URI into the route table.'''
self._Routes.append([uri, callback])
def Dispatch(self, req, res):
'''Dispatch an URI according t... | #!/usr/bin/env python3
class Routes:
'''Define the feature of route for URIs.'''
def __init__(self):
self._Routes = []
def AddRoute(self, uri, callback):
'''Add an URI into the route table.'''
self._Routes.append([uri, callback])
def Dispatch(self, req, res):
'''Dispatch an URI according to the route tab... | #!/usr/bin/env python3
class Routes:
'''Define the feature of route for URIs.'''
def __init__(self):
self._Routes = []
def AddRoute(self, uri, callback):
'''Add an URI into the route table.'''
self._Routes.append([uri, callback])
def Dispatch(self, req, res):
'''Dispatch an URI according to the route tab... | <commit_before>#!/usr/bin/env python3
class Routes:
'''Define the feature of route for URIs.'''
def __init__(self):
self._Routes = []
def AddRoute(self, uri, callback):
'''Add an URI into the route table.'''
self._Routes.append([uri, callback])
def Dispatch(self, req, res):
'''Dispatch an URI according t... |
2ef97501b15a9369d21953312115ea36355f251c | minimax.py | minimax.py | class Heuristic:
def heuristic(self, board, color):
raise NotImplementedError('Dont override this class')
| class Heuristic:
def heuristic(self, board, color):
raise NotImplementedError('Dont override this class')
class Minimax:
def __init__(self, color_me, h_me, h_challenger):
self.h_me = h_me
self.h_challenger = h_challenger
self.color_me = color_me
def heuristic(self, board, color):
if co... | Create the minimal class MiniMax | Create the minimal class MiniMax
| Python | apache-2.0 | frila/agente-minimax | class Heuristic:
def heuristic(self, board, color):
raise NotImplementedError('Dont override this class')
Create the minimal class MiniMax | class Heuristic:
def heuristic(self, board, color):
raise NotImplementedError('Dont override this class')
class Minimax:
def __init__(self, color_me, h_me, h_challenger):
self.h_me = h_me
self.h_challenger = h_challenger
self.color_me = color_me
def heuristic(self, board, color):
if co... | <commit_before>class Heuristic:
def heuristic(self, board, color):
raise NotImplementedError('Dont override this class')
<commit_msg>Create the minimal class MiniMax<commit_after> | class Heuristic:
def heuristic(self, board, color):
raise NotImplementedError('Dont override this class')
class Minimax:
def __init__(self, color_me, h_me, h_challenger):
self.h_me = h_me
self.h_challenger = h_challenger
self.color_me = color_me
def heuristic(self, board, color):
if co... | class Heuristic:
def heuristic(self, board, color):
raise NotImplementedError('Dont override this class')
Create the minimal class MiniMaxclass Heuristic:
def heuristic(self, board, color):
raise NotImplementedError('Dont override this class')
class Minimax:
def __init__(self, color_me, h_me, h_challe... | <commit_before>class Heuristic:
def heuristic(self, board, color):
raise NotImplementedError('Dont override this class')
<commit_msg>Create the minimal class MiniMax<commit_after>class Heuristic:
def heuristic(self, board, color):
raise NotImplementedError('Dont override this class')
class Minimax:
de... |
8a573dae750b1b9415df0c9e2c019750171e66f0 | migrations.py | migrations.py | import os
import json
from dateutil.parser import parse
from scrapi.util import safe_filename
def migrate_from_old_scrapi():
for dirname, dirs, filenames in os.walk('archive'):
for filename in filenames:
oldpath = os.path.join(dirname, filename)
source, sid, dt = dirname.split('/... | import os
import json
from dateutil.parser import parse
from scrapi.util import safe_filename
def migrate_from_old_scrapi():
for dirname, dirs, filenames in os.walk('archive'):
for filename in filenames:
oldpath = os.path.join(dirname, filename)
source, sid, dt = dirname.split('/... | Move json print methods into if statement | Move json print methods into if statement
| Python | apache-2.0 | erinspace/scrapi,CenterForOpenScience/scrapi,icereval/scrapi,fabianvf/scrapi,fabianvf/scrapi,ostwald/scrapi,mehanig/scrapi,alexgarciac/scrapi,jeffreyliu3230/scrapi,felliott/scrapi,felliott/scrapi,CenterForOpenScience/scrapi,mehanig/scrapi,erinspace/scrapi | import os
import json
from dateutil.parser import parse
from scrapi.util import safe_filename
def migrate_from_old_scrapi():
for dirname, dirs, filenames in os.walk('archive'):
for filename in filenames:
oldpath = os.path.join(dirname, filename)
source, sid, dt = dirname.split('/... | import os
import json
from dateutil.parser import parse
from scrapi.util import safe_filename
def migrate_from_old_scrapi():
for dirname, dirs, filenames in os.walk('archive'):
for filename in filenames:
oldpath = os.path.join(dirname, filename)
source, sid, dt = dirname.split('/... | <commit_before>import os
import json
from dateutil.parser import parse
from scrapi.util import safe_filename
def migrate_from_old_scrapi():
for dirname, dirs, filenames in os.walk('archive'):
for filename in filenames:
oldpath = os.path.join(dirname, filename)
source, sid, dt = d... | import os
import json
from dateutil.parser import parse
from scrapi.util import safe_filename
def migrate_from_old_scrapi():
for dirname, dirs, filenames in os.walk('archive'):
for filename in filenames:
oldpath = os.path.join(dirname, filename)
source, sid, dt = dirname.split('/... | import os
import json
from dateutil.parser import parse
from scrapi.util import safe_filename
def migrate_from_old_scrapi():
for dirname, dirs, filenames in os.walk('archive'):
for filename in filenames:
oldpath = os.path.join(dirname, filename)
source, sid, dt = dirname.split('/... | <commit_before>import os
import json
from dateutil.parser import parse
from scrapi.util import safe_filename
def migrate_from_old_scrapi():
for dirname, dirs, filenames in os.walk('archive'):
for filename in filenames:
oldpath = os.path.join(dirname, filename)
source, sid, dt = d... |
c668aaa0f22f5a61094c2028291b65c781733a54 | mojapi/api.py | mojapi/api.py | import json
import requests
import time
def get_statuses():
return requests.get('https://status.mojang.com/check/').json()
def get_uuid(username, unix_timestamp=None):
if unix_timestamp is None:
unix_timestamp = int(time.time())
return requests.get(
'https://api.mojang.com/users/profile... | import json
import requests
import time
def get_statuses():
return requests.get('https://status.mojang.com/check/').json()
def get_uuid(username, unix_timestamp=None):
if unix_timestamp is None:
unix_timestamp = int(time.time())
return requests.get(
'https://api.mojang.com/users/profile... | Add get blocked server hashes call | Add get blocked server hashes call
| Python | mit | zugmc/mojapi | import json
import requests
import time
def get_statuses():
return requests.get('https://status.mojang.com/check/').json()
def get_uuid(username, unix_timestamp=None):
if unix_timestamp is None:
unix_timestamp = int(time.time())
return requests.get(
'https://api.mojang.com/users/profile... | import json
import requests
import time
def get_statuses():
return requests.get('https://status.mojang.com/check/').json()
def get_uuid(username, unix_timestamp=None):
if unix_timestamp is None:
unix_timestamp = int(time.time())
return requests.get(
'https://api.mojang.com/users/profile... | <commit_before>import json
import requests
import time
def get_statuses():
return requests.get('https://status.mojang.com/check/').json()
def get_uuid(username, unix_timestamp=None):
if unix_timestamp is None:
unix_timestamp = int(time.time())
return requests.get(
'https://api.mojang.co... | import json
import requests
import time
def get_statuses():
return requests.get('https://status.mojang.com/check/').json()
def get_uuid(username, unix_timestamp=None):
if unix_timestamp is None:
unix_timestamp = int(time.time())
return requests.get(
'https://api.mojang.com/users/profile... | import json
import requests
import time
def get_statuses():
return requests.get('https://status.mojang.com/check/').json()
def get_uuid(username, unix_timestamp=None):
if unix_timestamp is None:
unix_timestamp = int(time.time())
return requests.get(
'https://api.mojang.com/users/profile... | <commit_before>import json
import requests
import time
def get_statuses():
return requests.get('https://status.mojang.com/check/').json()
def get_uuid(username, unix_timestamp=None):
if unix_timestamp is None:
unix_timestamp = int(time.time())
return requests.get(
'https://api.mojang.co... |
6845c56edc315f5ce07f0bf1101d59ee04036024 | pydir/daemon-rxcmd.py | pydir/daemon-rxcmd.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2016 F Dou<[email protected]>
# See LICENSE for details.
import bluetooth
import os
import logging
import time
from daemon import runner
class RxCmdDaemon():
def __init__(self):
self.stdin_path = '/dev/null'
self.stdou... | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2016 F Dou<[email protected]>
# See LICENSE for details.
import bluetooth
import os
import logging
import time
from daemon import runner
class RxCmdDaemon():
def __init__(self):
self.stdin_path = '/dev/null'
self.stdou... | Add try/catch to improve error handling | Add try/catch to improve error handling
| Python | apache-2.0 | javatechs/RxCmd,javatechs/RxCmd,javatechs/RxCmd | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2016 F Dou<[email protected]>
# See LICENSE for details.
import bluetooth
import os
import logging
import time
from daemon import runner
class RxCmdDaemon():
def __init__(self):
self.stdin_path = '/dev/null'
self.stdou... | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2016 F Dou<[email protected]>
# See LICENSE for details.
import bluetooth
import os
import logging
import time
from daemon import runner
class RxCmdDaemon():
def __init__(self):
self.stdin_path = '/dev/null'
self.stdou... | <commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2016 F Dou<[email protected]>
# See LICENSE for details.
import bluetooth
import os
import logging
import time
from daemon import runner
class RxCmdDaemon():
def __init__(self):
self.stdin_path = '/dev/null'
... | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2016 F Dou<[email protected]>
# See LICENSE for details.
import bluetooth
import os
import logging
import time
from daemon import runner
class RxCmdDaemon():
def __init__(self):
self.stdin_path = '/dev/null'
self.stdou... | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2016 F Dou<[email protected]>
# See LICENSE for details.
import bluetooth
import os
import logging
import time
from daemon import runner
class RxCmdDaemon():
def __init__(self):
self.stdin_path = '/dev/null'
self.stdou... | <commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2016 F Dou<[email protected]>
# See LICENSE for details.
import bluetooth
import os
import logging
import time
from daemon import runner
class RxCmdDaemon():
def __init__(self):
self.stdin_path = '/dev/null'
... |
e45c3a759d56dc70907b2169ece9da2415ab1ffa | resync/resource_container.py | resync/resource_container.py | """ResourceSync Resource Container object
Both ResourceList and Change Set objects are collections of Resource
objects with additional metadata regarding capabilities and
discovery information.
This is a superclass for the ResourceList and ChangeSet classes which
contains common functionality.
"""
class ResourceCo... | """ResourceSync Resource Container object
Both ResourceList and ChangeList objects are collections of Resource
objects with additional metadata regarding capabilities and
discovery information.
This is a superclass for the ResourceList and ChangeList classes which
contains common functionality.
"""
class ResourceC... | Fix comments for beta spec language | Fix comments for beta spec language
| Python | apache-2.0 | dans-er/resync,resync/resync,lindareijnhoudt/resync,lindareijnhoudt/resync,dans-er/resync | """ResourceSync Resource Container object
Both ResourceList and Change Set objects are collections of Resource
objects with additional metadata regarding capabilities and
discovery information.
This is a superclass for the ResourceList and ChangeSet classes which
contains common functionality.
"""
class ResourceCo... | """ResourceSync Resource Container object
Both ResourceList and ChangeList objects are collections of Resource
objects with additional metadata regarding capabilities and
discovery information.
This is a superclass for the ResourceList and ChangeList classes which
contains common functionality.
"""
class ResourceC... | <commit_before>"""ResourceSync Resource Container object
Both ResourceList and Change Set objects are collections of Resource
objects with additional metadata regarding capabilities and
discovery information.
This is a superclass for the ResourceList and ChangeSet classes which
contains common functionality.
"""
c... | """ResourceSync Resource Container object
Both ResourceList and ChangeList objects are collections of Resource
objects with additional metadata regarding capabilities and
discovery information.
This is a superclass for the ResourceList and ChangeList classes which
contains common functionality.
"""
class ResourceC... | """ResourceSync Resource Container object
Both ResourceList and Change Set objects are collections of Resource
objects with additional metadata regarding capabilities and
discovery information.
This is a superclass for the ResourceList and ChangeSet classes which
contains common functionality.
"""
class ResourceCo... | <commit_before>"""ResourceSync Resource Container object
Both ResourceList and Change Set objects are collections of Resource
objects with additional metadata regarding capabilities and
discovery information.
This is a superclass for the ResourceList and ChangeSet classes which
contains common functionality.
"""
c... |
96df077d5485979af256fe7b95708ace658fb8e2 | test/mitmproxy/test_examples.py | test/mitmproxy/test_examples.py | import glob
from mitmproxy import utils, script
from mitmproxy.proxy import config
from netlib import tutils as netutils
from netlib.http import Headers
from . import tservers, tutils
from examples import (
modify_form,
)
def test_load_scripts():
example_dir = utils.Data(__name__).path("../../examples")
... | import glob
from mitmproxy import utils, script
from mitmproxy.proxy import config
from netlib import tutils as netutils
from netlib.http import Headers
from . import tservers, tutils
from examples import (
add_header,
modify_form,
)
def test_load_scripts():
example_dir = utils.Data(__name__).path("../... | Add tests for add_header example | Add tests for add_header example
| Python | mit | mitmproxy/mitmproxy,jvillacorta/mitmproxy,tdickers/mitmproxy,dufferzafar/mitmproxy,mosajjal/mitmproxy,cortesi/mitmproxy,tdickers/mitmproxy,dwfreed/mitmproxy,laurmurclar/mitmproxy,gzzhanghao/mitmproxy,ddworken/mitmproxy,mosajjal/mitmproxy,mhils/mitmproxy,mhils/mitmproxy,fimad/mitmproxy,mitmproxy/mitmproxy,ujjwal96/mitmp... | import glob
from mitmproxy import utils, script
from mitmproxy.proxy import config
from netlib import tutils as netutils
from netlib.http import Headers
from . import tservers, tutils
from examples import (
modify_form,
)
def test_load_scripts():
example_dir = utils.Data(__name__).path("../../examples")
... | import glob
from mitmproxy import utils, script
from mitmproxy.proxy import config
from netlib import tutils as netutils
from netlib.http import Headers
from . import tservers, tutils
from examples import (
add_header,
modify_form,
)
def test_load_scripts():
example_dir = utils.Data(__name__).path("../... | <commit_before>import glob
from mitmproxy import utils, script
from mitmproxy.proxy import config
from netlib import tutils as netutils
from netlib.http import Headers
from . import tservers, tutils
from examples import (
modify_form,
)
def test_load_scripts():
example_dir = utils.Data(__name__).path("../.... | import glob
from mitmproxy import utils, script
from mitmproxy.proxy import config
from netlib import tutils as netutils
from netlib.http import Headers
from . import tservers, tutils
from examples import (
add_header,
modify_form,
)
def test_load_scripts():
example_dir = utils.Data(__name__).path("../... | import glob
from mitmproxy import utils, script
from mitmproxy.proxy import config
from netlib import tutils as netutils
from netlib.http import Headers
from . import tservers, tutils
from examples import (
modify_form,
)
def test_load_scripts():
example_dir = utils.Data(__name__).path("../../examples")
... | <commit_before>import glob
from mitmproxy import utils, script
from mitmproxy.proxy import config
from netlib import tutils as netutils
from netlib.http import Headers
from . import tservers, tutils
from examples import (
modify_form,
)
def test_load_scripts():
example_dir = utils.Data(__name__).path("../.... |
6f45e82af789586baf7354b562bbb1587d94b28c | qual/tests/test_calendar.py | qual/tests/test_calendar.py | import unittest
from datetime import date
import qual
class TestProlepticGregorianCalendar(unittest.TestCase):
def setUp(self):
self.calendar = qual.ProlepticGregorianCalendar()
def check_valid_date(self, year, month, day):
d = self.calendar.date(year, month, day)
self.assertIsNotNon... | import unittest
from datetime import date
import qual
class TestProlepticGregorianCalendar(unittest.TestCase):
def setUp(self):
self.calendar = qual.ProlepticGregorianCalendar()
def check_valid_date(self, year, month, day):
d = self.calendar.date(year, month, day)
self.assertIsNotNon... | Add a test for a date missing from English historical calendars. | Add a test for a date missing from English historical calendars.
| Python | apache-2.0 | jwg4/qual,jwg4/calexicon | import unittest
from datetime import date
import qual
class TestProlepticGregorianCalendar(unittest.TestCase):
def setUp(self):
self.calendar = qual.ProlepticGregorianCalendar()
def check_valid_date(self, year, month, day):
d = self.calendar.date(year, month, day)
self.assertIsNotNon... | import unittest
from datetime import date
import qual
class TestProlepticGregorianCalendar(unittest.TestCase):
def setUp(self):
self.calendar = qual.ProlepticGregorianCalendar()
def check_valid_date(self, year, month, day):
d = self.calendar.date(year, month, day)
self.assertIsNotNon... | <commit_before>import unittest
from datetime import date
import qual
class TestProlepticGregorianCalendar(unittest.TestCase):
def setUp(self):
self.calendar = qual.ProlepticGregorianCalendar()
def check_valid_date(self, year, month, day):
d = self.calendar.date(year, month, day)
self... | import unittest
from datetime import date
import qual
class TestProlepticGregorianCalendar(unittest.TestCase):
def setUp(self):
self.calendar = qual.ProlepticGregorianCalendar()
def check_valid_date(self, year, month, day):
d = self.calendar.date(year, month, day)
self.assertIsNotNon... | import unittest
from datetime import date
import qual
class TestProlepticGregorianCalendar(unittest.TestCase):
def setUp(self):
self.calendar = qual.ProlepticGregorianCalendar()
def check_valid_date(self, year, month, day):
d = self.calendar.date(year, month, day)
self.assertIsNotNon... | <commit_before>import unittest
from datetime import date
import qual
class TestProlepticGregorianCalendar(unittest.TestCase):
def setUp(self):
self.calendar = qual.ProlepticGregorianCalendar()
def check_valid_date(self, year, month, day):
d = self.calendar.date(year, month, day)
self... |
d4c168cc552a444ecb3ee3059f12fa1c34c4419c | test_sempai.py | test_sempai.py | import jsonsempai
import os
import shutil
import sys
import tempfile
TEST_FILE = '''{
"three": 3,
"one": {
"two": {
"three": 3
}
}
}'''
class TestSempai(object):
def setup(self):
self.direc = tempfile.mkdtemp(prefix='jsonsempai')
sys.path.append(self.dire... | import jsonsempai
import os
import shutil
import sys
import tempfile
TEST_FILE = '''{
"three": 3,
"one": {
"two": {
"three": 3
}
}
}'''
class TestSempai(object):
def setup(self):
self.direc = tempfile.mkdtemp(prefix='jsonsempai')
sys.path.append(self.dire... | Add test for removing item | Add test for removing item
| Python | mit | kragniz/json-sempai | import jsonsempai
import os
import shutil
import sys
import tempfile
TEST_FILE = '''{
"three": 3,
"one": {
"two": {
"three": 3
}
}
}'''
class TestSempai(object):
def setup(self):
self.direc = tempfile.mkdtemp(prefix='jsonsempai')
sys.path.append(self.dire... | import jsonsempai
import os
import shutil
import sys
import tempfile
TEST_FILE = '''{
"three": 3,
"one": {
"two": {
"three": 3
}
}
}'''
class TestSempai(object):
def setup(self):
self.direc = tempfile.mkdtemp(prefix='jsonsempai')
sys.path.append(self.dire... | <commit_before>import jsonsempai
import os
import shutil
import sys
import tempfile
TEST_FILE = '''{
"three": 3,
"one": {
"two": {
"three": 3
}
}
}'''
class TestSempai(object):
def setup(self):
self.direc = tempfile.mkdtemp(prefix='jsonsempai')
sys.path.a... | import jsonsempai
import os
import shutil
import sys
import tempfile
TEST_FILE = '''{
"three": 3,
"one": {
"two": {
"three": 3
}
}
}'''
class TestSempai(object):
def setup(self):
self.direc = tempfile.mkdtemp(prefix='jsonsempai')
sys.path.append(self.dire... | import jsonsempai
import os
import shutil
import sys
import tempfile
TEST_FILE = '''{
"three": 3,
"one": {
"two": {
"three": 3
}
}
}'''
class TestSempai(object):
def setup(self):
self.direc = tempfile.mkdtemp(prefix='jsonsempai')
sys.path.append(self.dire... | <commit_before>import jsonsempai
import os
import shutil
import sys
import tempfile
TEST_FILE = '''{
"three": 3,
"one": {
"two": {
"three": 3
}
}
}'''
class TestSempai(object):
def setup(self):
self.direc = tempfile.mkdtemp(prefix='jsonsempai')
sys.path.a... |
004326064c87184e4373ab0b2d8d7ef9b46d94f9 | tokens/conf.py | tokens/conf.py | PHASES = (
('PHASE_01', 'In review',),
('PHASE_02', 'Active',),
('PHASE_02', 'Inactive',),
) | PHASES = (
('PHASE_01', 'In review',),
('PHASE_02', 'Active',),
('PHASE_02', 'Inactive',),
)
TOKEN_TYPES = (
('MintableToken', 'Mintable Token'),
) | Add MintableToken as new token type | Add MintableToken as new token type
| Python | apache-2.0 | onyb/ethane,onyb/ethane,onyb/ethane,onyb/ethane | PHASES = (
('PHASE_01', 'In review',),
('PHASE_02', 'Active',),
('PHASE_02', 'Inactive',),
)Add MintableToken as new token type | PHASES = (
('PHASE_01', 'In review',),
('PHASE_02', 'Active',),
('PHASE_02', 'Inactive',),
)
TOKEN_TYPES = (
('MintableToken', 'Mintable Token'),
) | <commit_before>PHASES = (
('PHASE_01', 'In review',),
('PHASE_02', 'Active',),
('PHASE_02', 'Inactive',),
)<commit_msg>Add MintableToken as new token type<commit_after> | PHASES = (
('PHASE_01', 'In review',),
('PHASE_02', 'Active',),
('PHASE_02', 'Inactive',),
)
TOKEN_TYPES = (
('MintableToken', 'Mintable Token'),
) | PHASES = (
('PHASE_01', 'In review',),
('PHASE_02', 'Active',),
('PHASE_02', 'Inactive',),
)Add MintableToken as new token typePHASES = (
('PHASE_01', 'In review',),
('PHASE_02', 'Active',),
('PHASE_02', 'Inactive',),
)
TOKEN_TYPES = (
('MintableToken', 'Mintable Token'),
) | <commit_before>PHASES = (
('PHASE_01', 'In review',),
('PHASE_02', 'Active',),
('PHASE_02', 'Inactive',),
)<commit_msg>Add MintableToken as new token type<commit_after>PHASES = (
('PHASE_01', 'In review',),
('PHASE_02', 'Active',),
('PHASE_02', 'Inactive',),
)
TOKEN_TYPES = (
('MintableToke... |
76ec25090ece865d67f63c07c32aff7cebf105c1 | ynr/apps/people/migrations/0034_get_birth_year.py | ynr/apps/people/migrations/0034_get_birth_year.py | # Generated by Django 3.2.4 on 2021-10-27 14:41
from django.db import migrations
def get_birth_year(apps, schema_editor):
Person = apps.get_model("people", "Person")
for person in Person.objects.all():
birth_year = person.birth_date.split("-")[0]
person.birth_date = birth_year
person.... | # Generated by Django 3.2.4 on 2021-10-27 14:41
from django.db import migrations
def get_birth_year(apps, schema_editor):
Person = apps.get_model("people", "Person")
for person in Person.objects.exclude(birth_date="").iterator():
birth_year = person.birth_date.split("-")[0]
person.birth_date ... | Improve performance of birth date data migration | Improve performance of birth date data migration
| Python | agpl-3.0 | DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative | # Generated by Django 3.2.4 on 2021-10-27 14:41
from django.db import migrations
def get_birth_year(apps, schema_editor):
Person = apps.get_model("people", "Person")
for person in Person.objects.all():
birth_year = person.birth_date.split("-")[0]
person.birth_date = birth_year
person.... | # Generated by Django 3.2.4 on 2021-10-27 14:41
from django.db import migrations
def get_birth_year(apps, schema_editor):
Person = apps.get_model("people", "Person")
for person in Person.objects.exclude(birth_date="").iterator():
birth_year = person.birth_date.split("-")[0]
person.birth_date ... | <commit_before># Generated by Django 3.2.4 on 2021-10-27 14:41
from django.db import migrations
def get_birth_year(apps, schema_editor):
Person = apps.get_model("people", "Person")
for person in Person.objects.all():
birth_year = person.birth_date.split("-")[0]
person.birth_date = birth_year
... | # Generated by Django 3.2.4 on 2021-10-27 14:41
from django.db import migrations
def get_birth_year(apps, schema_editor):
Person = apps.get_model("people", "Person")
for person in Person.objects.exclude(birth_date="").iterator():
birth_year = person.birth_date.split("-")[0]
person.birth_date ... | # Generated by Django 3.2.4 on 2021-10-27 14:41
from django.db import migrations
def get_birth_year(apps, schema_editor):
Person = apps.get_model("people", "Person")
for person in Person.objects.all():
birth_year = person.birth_date.split("-")[0]
person.birth_date = birth_year
person.... | <commit_before># Generated by Django 3.2.4 on 2021-10-27 14:41
from django.db import migrations
def get_birth_year(apps, schema_editor):
Person = apps.get_model("people", "Person")
for person in Person.objects.all():
birth_year = person.birth_date.split("-")[0]
person.birth_date = birth_year
... |
1782b15b244597d56bff18c465237c7e1f3ab482 | wikked/commands/users.py | wikked/commands/users.py | import logging
import getpass
from wikked.bcryptfallback import generate_password_hash
from wikked.commands.base import WikkedCommand, register_command
logger = logging.getLogger(__name__)
@register_command
class UsersCommand(WikkedCommand):
def __init__(self):
super(UsersCommand, self).__init__()
... | import logging
import getpass
from wikked.bcryptfallback import generate_password_hash
from wikked.commands.base import WikkedCommand, register_command
logger = logging.getLogger(__name__)
@register_command
class UsersCommand(WikkedCommand):
def __init__(self):
super(UsersCommand, self).__init__()
... | Add some explanation as to what to do with the output. | newuser: Add some explanation as to what to do with the output.
| Python | apache-2.0 | ludovicchabant/Wikked,ludovicchabant/Wikked,ludovicchabant/Wikked | import logging
import getpass
from wikked.bcryptfallback import generate_password_hash
from wikked.commands.base import WikkedCommand, register_command
logger = logging.getLogger(__name__)
@register_command
class UsersCommand(WikkedCommand):
def __init__(self):
super(UsersCommand, self).__init__()
... | import logging
import getpass
from wikked.bcryptfallback import generate_password_hash
from wikked.commands.base import WikkedCommand, register_command
logger = logging.getLogger(__name__)
@register_command
class UsersCommand(WikkedCommand):
def __init__(self):
super(UsersCommand, self).__init__()
... | <commit_before>import logging
import getpass
from wikked.bcryptfallback import generate_password_hash
from wikked.commands.base import WikkedCommand, register_command
logger = logging.getLogger(__name__)
@register_command
class UsersCommand(WikkedCommand):
def __init__(self):
super(UsersCommand, self)._... | import logging
import getpass
from wikked.bcryptfallback import generate_password_hash
from wikked.commands.base import WikkedCommand, register_command
logger = logging.getLogger(__name__)
@register_command
class UsersCommand(WikkedCommand):
def __init__(self):
super(UsersCommand, self).__init__()
... | import logging
import getpass
from wikked.bcryptfallback import generate_password_hash
from wikked.commands.base import WikkedCommand, register_command
logger = logging.getLogger(__name__)
@register_command
class UsersCommand(WikkedCommand):
def __init__(self):
super(UsersCommand, self).__init__()
... | <commit_before>import logging
import getpass
from wikked.bcryptfallback import generate_password_hash
from wikked.commands.base import WikkedCommand, register_command
logger = logging.getLogger(__name__)
@register_command
class UsersCommand(WikkedCommand):
def __init__(self):
super(UsersCommand, self)._... |
2342cd5ede9fac66007d2b15025feeff52c2400b | flexget/plugins/operate/verify_ssl_certificates.py | flexget/plugins/operate/verify_ssl_certificates.py | from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import logging
from flexget import plugin
from flexget.event import event
log = logging.getLogger('verify_ssl')
class VerifySSLCertificates(object):
"""
Plugin that ... | from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import logging
from requests.packages import urllib3
from flexget import plugin
from flexget.event import event
log = logging.getLogger('verify_ssl')
class VerifySSLCertifi... | Disable warnings about disabling SSL verification. | Disable warnings about disabling SSL verification.
Disabling SSL certificate verification results in a warning for every
HTTPS request:
"InsecureRequestWarning: Unverified HTTPS request is being made. Adding
certificate verification is strongly advised. See:
https://urllib3.readthedocs.io/en/latest/security.html"
D... | Python | mit | OmgOhnoes/Flexget,qk4l/Flexget,jacobmetrick/Flexget,jacobmetrick/Flexget,Flexget/Flexget,LynxyssCZ/Flexget,crawln45/Flexget,Flexget/Flexget,ianstalk/Flexget,OmgOhnoes/Flexget,poulpito/Flexget,drwyrm/Flexget,malkavi/Flexget,jawilson/Flexget,malkavi/Flexget,LynxyssCZ/Flexget,jawilson/Flexget,ianstalk/Flexget,gazpachoking... | from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import logging
from flexget import plugin
from flexget.event import event
log = logging.getLogger('verify_ssl')
class VerifySSLCertificates(object):
"""
Plugin that ... | from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import logging
from requests.packages import urllib3
from flexget import plugin
from flexget.event import event
log = logging.getLogger('verify_ssl')
class VerifySSLCertifi... | <commit_before>from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import logging
from flexget import plugin
from flexget.event import event
log = logging.getLogger('verify_ssl')
class VerifySSLCertificates(object):
"""
... | from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import logging
from requests.packages import urllib3
from flexget import plugin
from flexget.event import event
log = logging.getLogger('verify_ssl')
class VerifySSLCertifi... | from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import logging
from flexget import plugin
from flexget.event import event
log = logging.getLogger('verify_ssl')
class VerifySSLCertificates(object):
"""
Plugin that ... | <commit_before>from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import logging
from flexget import plugin
from flexget.event import event
log = logging.getLogger('verify_ssl')
class VerifySSLCertificates(object):
"""
... |
3ca30011794143785955792e391902823427ef77 | registration/views.py | registration/views.py | # Create your views here.
from django.http import HttpResponse
from registration.models import Team
from django.core import serializers
def get_teams(request):
return_data = serializers.serialize("json", Team.objects.all())
return HttpResponse(return_data, content_type="application/json") | # Create your views here.
from django.http import HttpResponse
from registration.models import Team
from django.core import serializers
from django.views.decorators.cache import cache_page
@cache_page(60 * 5)
def get_teams(request):
return_data = serializers.serialize("json", Team.objects.all())
return HttpRe... | Add caching for getTeams API call | Add caching for getTeams API call | Python | bsd-3-clause | hgrimberg01/esc,hgrimberg01/esc | # Create your views here.
from django.http import HttpResponse
from registration.models import Team
from django.core import serializers
def get_teams(request):
return_data = serializers.serialize("json", Team.objects.all())
return HttpResponse(return_data, content_type="application/json")Add caching for getTe... | # Create your views here.
from django.http import HttpResponse
from registration.models import Team
from django.core import serializers
from django.views.decorators.cache import cache_page
@cache_page(60 * 5)
def get_teams(request):
return_data = serializers.serialize("json", Team.objects.all())
return HttpRe... | <commit_before># Create your views here.
from django.http import HttpResponse
from registration.models import Team
from django.core import serializers
def get_teams(request):
return_data = serializers.serialize("json", Team.objects.all())
return HttpResponse(return_data, content_type="application/json")<commi... | # Create your views here.
from django.http import HttpResponse
from registration.models import Team
from django.core import serializers
from django.views.decorators.cache import cache_page
@cache_page(60 * 5)
def get_teams(request):
return_data = serializers.serialize("json", Team.objects.all())
return HttpRe... | # Create your views here.
from django.http import HttpResponse
from registration.models import Team
from django.core import serializers
def get_teams(request):
return_data = serializers.serialize("json", Team.objects.all())
return HttpResponse(return_data, content_type="application/json")Add caching for getTe... | <commit_before># Create your views here.
from django.http import HttpResponse
from registration.models import Team
from django.core import serializers
def get_teams(request):
return_data = serializers.serialize("json", Team.objects.all())
return HttpResponse(return_data, content_type="application/json")<commi... |
33fbc424d725836355c071593042953fb195cff6 | server/project/apps/core/serializers.py | server/project/apps/core/serializers.py | from rest_framework import serializers
from .models import Playlist, Track, Favorite
class TrackSerializer(serializers.ModelSerializer):
class Meta:
model = Track
fields = '__all__'
class PlaylistSerializer(serializers.ModelSerializer):
tracks = TrackSerializer(many=True)
class Meta:
... | from rest_framework import serializers
from .models import Playlist, Track, Favorite
class TrackSerializer(serializers.ModelSerializer):
class Meta:
model = Track
fields = '__all__'
class PlaylistSerializer(serializers.ModelSerializer):
tracks = TrackSerializer(many=True)
class Meta:
... | Add tracks to playlist on update | Add tracks to playlist on update
| Python | mit | hrr20-over9000/9001,SoundMoose/SoundMoose,SoundMoose/SoundMoose,douvaughn/9001,douvaughn/9001,hxue920/9001,hrr20-over9000/9001,hxue920/9001,CalHoll/SoundMoose,CalHoll/SoundMoose,douvaughn/9001,CalHoll/SoundMoose,hrr20-over9000/9001,hxue920/9001,douvaughn/9001,hxue920/9001,SoundMoose/SoundMoose,SoundMoose/SoundMoose,Cal... | from rest_framework import serializers
from .models import Playlist, Track, Favorite
class TrackSerializer(serializers.ModelSerializer):
class Meta:
model = Track
fields = '__all__'
class PlaylistSerializer(serializers.ModelSerializer):
tracks = TrackSerializer(many=True)
class Meta:
... | from rest_framework import serializers
from .models import Playlist, Track, Favorite
class TrackSerializer(serializers.ModelSerializer):
class Meta:
model = Track
fields = '__all__'
class PlaylistSerializer(serializers.ModelSerializer):
tracks = TrackSerializer(many=True)
class Meta:
... | <commit_before>from rest_framework import serializers
from .models import Playlist, Track, Favorite
class TrackSerializer(serializers.ModelSerializer):
class Meta:
model = Track
fields = '__all__'
class PlaylistSerializer(serializers.ModelSerializer):
tracks = TrackSerializer(many=True)
c... | from rest_framework import serializers
from .models import Playlist, Track, Favorite
class TrackSerializer(serializers.ModelSerializer):
class Meta:
model = Track
fields = '__all__'
class PlaylistSerializer(serializers.ModelSerializer):
tracks = TrackSerializer(many=True)
class Meta:
... | from rest_framework import serializers
from .models import Playlist, Track, Favorite
class TrackSerializer(serializers.ModelSerializer):
class Meta:
model = Track
fields = '__all__'
class PlaylistSerializer(serializers.ModelSerializer):
tracks = TrackSerializer(many=True)
class Meta:
... | <commit_before>from rest_framework import serializers
from .models import Playlist, Track, Favorite
class TrackSerializer(serializers.ModelSerializer):
class Meta:
model = Track
fields = '__all__'
class PlaylistSerializer(serializers.ModelSerializer):
tracks = TrackSerializer(many=True)
c... |
3bc3a9c29e448e6ca1eaa3c962d144bd1b5f874e | migrations/versions/d596dc9b53d9_create_redmine_tables.py | migrations/versions/d596dc9b53d9_create_redmine_tables.py | """create redmine tables
Revision ID: d596dc9b53d9
Revises: 2ffb0d589280
Create Date: 2017-08-14 14:43:31.234637
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd596dc9b53d9'
down_revision = '2ffb0d589280'
branch_labels = None
depends_on = None
def upgrade()... | """create redmine tables
Revision ID: d596dc9b53d9
Revises: 2ffb0d589280
Create Date: 2017-08-14 14:43:31.234637
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd596dc9b53d9'
down_revision = '2ffb0d589280'
branch_labels = None
depends_on = None
def upgrade()... | Downgrade migration table name updated is current | Downgrade migration table name updated is current
| Python | mit | beproud/beproudbot,beproud/beproudbot | """create redmine tables
Revision ID: d596dc9b53d9
Revises: 2ffb0d589280
Create Date: 2017-08-14 14:43:31.234637
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd596dc9b53d9'
down_revision = '2ffb0d589280'
branch_labels = None
depends_on = None
def upgrade()... | """create redmine tables
Revision ID: d596dc9b53d9
Revises: 2ffb0d589280
Create Date: 2017-08-14 14:43:31.234637
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd596dc9b53d9'
down_revision = '2ffb0d589280'
branch_labels = None
depends_on = None
def upgrade()... | <commit_before>"""create redmine tables
Revision ID: d596dc9b53d9
Revises: 2ffb0d589280
Create Date: 2017-08-14 14:43:31.234637
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd596dc9b53d9'
down_revision = '2ffb0d589280'
branch_labels = None
depends_on = None
... | """create redmine tables
Revision ID: d596dc9b53d9
Revises: 2ffb0d589280
Create Date: 2017-08-14 14:43:31.234637
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd596dc9b53d9'
down_revision = '2ffb0d589280'
branch_labels = None
depends_on = None
def upgrade()... | """create redmine tables
Revision ID: d596dc9b53d9
Revises: 2ffb0d589280
Create Date: 2017-08-14 14:43:31.234637
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd596dc9b53d9'
down_revision = '2ffb0d589280'
branch_labels = None
depends_on = None
def upgrade()... | <commit_before>"""create redmine tables
Revision ID: d596dc9b53d9
Revises: 2ffb0d589280
Create Date: 2017-08-14 14:43:31.234637
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd596dc9b53d9'
down_revision = '2ffb0d589280'
branch_labels = None
depends_on = None
... |
193831b6ee8b49674e32413e71819f2451bfc844 | situational/apps/quick_history/forms.py | situational/apps/quick_history/forms.py | from django import forms
from . import widgets
class HistoryDetailsForm(forms.Form):
CIRCUMSTANCE_CHOICES = [
("full_time", "Full time"),
("part_time", "Part time"),
("work_programme", "Work programme"),
("unemployed", "Unemployed"),
("sick", "Off sick"),
("trainin... | from django import forms
from . import widgets
class HistoryDetailsForm(forms.Form):
CIRCUMSTANCE_CHOICES = [
("full_time", "Full time"),
("part_time", "Part time"),
("unemployed", "Unemployed"),
("sick", "Off sick"),
("training", "In full time training"),
("caring... | Remove "work programme" option from quick history | Remove "work programme" option from quick history
| Python | bsd-3-clause | lm-tools/situational,lm-tools/sectors,lm-tools/situational,lm-tools/situational,lm-tools/situational,lm-tools/sectors,lm-tools/situational,lm-tools/sectors,lm-tools/sectors | from django import forms
from . import widgets
class HistoryDetailsForm(forms.Form):
CIRCUMSTANCE_CHOICES = [
("full_time", "Full time"),
("part_time", "Part time"),
("work_programme", "Work programme"),
("unemployed", "Unemployed"),
("sick", "Off sick"),
("trainin... | from django import forms
from . import widgets
class HistoryDetailsForm(forms.Form):
CIRCUMSTANCE_CHOICES = [
("full_time", "Full time"),
("part_time", "Part time"),
("unemployed", "Unemployed"),
("sick", "Off sick"),
("training", "In full time training"),
("caring... | <commit_before>from django import forms
from . import widgets
class HistoryDetailsForm(forms.Form):
CIRCUMSTANCE_CHOICES = [
("full_time", "Full time"),
("part_time", "Part time"),
("work_programme", "Work programme"),
("unemployed", "Unemployed"),
("sick", "Off sick"),
... | from django import forms
from . import widgets
class HistoryDetailsForm(forms.Form):
CIRCUMSTANCE_CHOICES = [
("full_time", "Full time"),
("part_time", "Part time"),
("unemployed", "Unemployed"),
("sick", "Off sick"),
("training", "In full time training"),
("caring... | from django import forms
from . import widgets
class HistoryDetailsForm(forms.Form):
CIRCUMSTANCE_CHOICES = [
("full_time", "Full time"),
("part_time", "Part time"),
("work_programme", "Work programme"),
("unemployed", "Unemployed"),
("sick", "Off sick"),
("trainin... | <commit_before>from django import forms
from . import widgets
class HistoryDetailsForm(forms.Form):
CIRCUMSTANCE_CHOICES = [
("full_time", "Full time"),
("part_time", "Part time"),
("work_programme", "Work programme"),
("unemployed", "Unemployed"),
("sick", "Off sick"),
... |
bf8d2b33794f676f27b9a22bca57a06b94f7c2ce | smart/accesscontrol/rules/helper_app.py | smart/accesscontrol/rules/helper_app.py | """
Rules for PHAs, AccessTokens, ReqTokens
"""
from smart.views import *
def grant(happ, permset):
"""
grant the permissions of an account to this permset
"""
def need_admin(*a,**b): return happ.admin_p
permset.grant(get_first_record_tokens, None)
permset.grant(get_next_record_tokens, None)... | """
Rules for PHAs, AccessTokens, ReqTokens
"""
from smart.views import *
def grant(happ, permset):
"""
grant the permissions of an account to this permset
"""
def need_admin(*a,**b): return happ.admin_p
permset.grant(get_first_record_tokens, None)
permset.grant(get_next_record_tokens, None)... | Remove put_demographics from the permset of the background apps | Remove put_demographics from the permset of the background apps
| Python | apache-2.0 | smart-classic/smart_server,smart-classic/smart_server | """
Rules for PHAs, AccessTokens, ReqTokens
"""
from smart.views import *
def grant(happ, permset):
"""
grant the permissions of an account to this permset
"""
def need_admin(*a,**b): return happ.admin_p
permset.grant(get_first_record_tokens, None)
permset.grant(get_next_record_tokens, None)... | """
Rules for PHAs, AccessTokens, ReqTokens
"""
from smart.views import *
def grant(happ, permset):
"""
grant the permissions of an account to this permset
"""
def need_admin(*a,**b): return happ.admin_p
permset.grant(get_first_record_tokens, None)
permset.grant(get_next_record_tokens, None)... | <commit_before>"""
Rules for PHAs, AccessTokens, ReqTokens
"""
from smart.views import *
def grant(happ, permset):
"""
grant the permissions of an account to this permset
"""
def need_admin(*a,**b): return happ.admin_p
permset.grant(get_first_record_tokens, None)
permset.grant(get_next_recor... | """
Rules for PHAs, AccessTokens, ReqTokens
"""
from smart.views import *
def grant(happ, permset):
"""
grant the permissions of an account to this permset
"""
def need_admin(*a,**b): return happ.admin_p
permset.grant(get_first_record_tokens, None)
permset.grant(get_next_record_tokens, None)... | """
Rules for PHAs, AccessTokens, ReqTokens
"""
from smart.views import *
def grant(happ, permset):
"""
grant the permissions of an account to this permset
"""
def need_admin(*a,**b): return happ.admin_p
permset.grant(get_first_record_tokens, None)
permset.grant(get_next_record_tokens, None)... | <commit_before>"""
Rules for PHAs, AccessTokens, ReqTokens
"""
from smart.views import *
def grant(happ, permset):
"""
grant the permissions of an account to this permset
"""
def need_admin(*a,**b): return happ.admin_p
permset.grant(get_first_record_tokens, None)
permset.grant(get_next_recor... |
1ca9052a989ad0c1642875c7f29b8ba2130011fa | south/introspection_plugins/__init__.py | south/introspection_plugins/__init__.py | # This module contains built-in introspector plugins for various common
# Django apps.
# These imports trigger the lower-down files
import south.introspection_plugins.geodjango
import south.introspection_plugins.django_tagging
import south.introspection_plugins.django_taggit
import south.introspection_plugins.django_o... | # This module contains built-in introspector plugins for various common
# Django apps.
# These imports trigger the lower-down files
import south.introspection_plugins.geodjango
import south.introspection_plugins.django_tagging
import south.introspection_plugins.django_taggit
import south.introspection_plugins.django_o... | Add import of django-annoying patch | Add import of django-annoying patch
| Python | apache-2.0 | smartfile/django-south,smartfile/django-south | # This module contains built-in introspector plugins for various common
# Django apps.
# These imports trigger the lower-down files
import south.introspection_plugins.geodjango
import south.introspection_plugins.django_tagging
import south.introspection_plugins.django_taggit
import south.introspection_plugins.django_o... | # This module contains built-in introspector plugins for various common
# Django apps.
# These imports trigger the lower-down files
import south.introspection_plugins.geodjango
import south.introspection_plugins.django_tagging
import south.introspection_plugins.django_taggit
import south.introspection_plugins.django_o... | <commit_before># This module contains built-in introspector plugins for various common
# Django apps.
# These imports trigger the lower-down files
import south.introspection_plugins.geodjango
import south.introspection_plugins.django_tagging
import south.introspection_plugins.django_taggit
import south.introspection_p... | # This module contains built-in introspector plugins for various common
# Django apps.
# These imports trigger the lower-down files
import south.introspection_plugins.geodjango
import south.introspection_plugins.django_tagging
import south.introspection_plugins.django_taggit
import south.introspection_plugins.django_o... | # This module contains built-in introspector plugins for various common
# Django apps.
# These imports trigger the lower-down files
import south.introspection_plugins.geodjango
import south.introspection_plugins.django_tagging
import south.introspection_plugins.django_taggit
import south.introspection_plugins.django_o... | <commit_before># This module contains built-in introspector plugins for various common
# Django apps.
# These imports trigger the lower-down files
import south.introspection_plugins.geodjango
import south.introspection_plugins.django_tagging
import south.introspection_plugins.django_taggit
import south.introspection_p... |
93373242eab8d387a9b13c567239fa2e36b10ffa | mqtt_logger/management/commands/runmqttlistener.py | mqtt_logger/management/commands/runmqttlistener.py | from django.core.management.base import BaseCommand, CommandError
from mqtt_logger.models import *
class Command(BaseCommand):
help = 'Start listening to mqtt subscriptions and save messages in database.'
def add_arguments(self, parser):
pass
def handle(self, *args, **options):
self.stdo... | from django.core.management.base import BaseCommand, CommandError
from mqtt_logger.models import *
import time
class Command(BaseCommand):
help = 'Start listening to mqtt subscriptions and save messages in database.'
def add_arguments(self, parser):
pass
def handle(self, *args, **options):
... | Make the listener automatically update the subscriptions. | Make the listener automatically update the subscriptions.
| Python | mit | ast0815/mqtt-hub,ast0815/mqtt-hub | from django.core.management.base import BaseCommand, CommandError
from mqtt_logger.models import *
class Command(BaseCommand):
help = 'Start listening to mqtt subscriptions and save messages in database.'
def add_arguments(self, parser):
pass
def handle(self, *args, **options):
self.stdo... | from django.core.management.base import BaseCommand, CommandError
from mqtt_logger.models import *
import time
class Command(BaseCommand):
help = 'Start listening to mqtt subscriptions and save messages in database.'
def add_arguments(self, parser):
pass
def handle(self, *args, **options):
... | <commit_before>from django.core.management.base import BaseCommand, CommandError
from mqtt_logger.models import *
class Command(BaseCommand):
help = 'Start listening to mqtt subscriptions and save messages in database.'
def add_arguments(self, parser):
pass
def handle(self, *args, **options):
... | from django.core.management.base import BaseCommand, CommandError
from mqtt_logger.models import *
import time
class Command(BaseCommand):
help = 'Start listening to mqtt subscriptions and save messages in database.'
def add_arguments(self, parser):
pass
def handle(self, *args, **options):
... | from django.core.management.base import BaseCommand, CommandError
from mqtt_logger.models import *
class Command(BaseCommand):
help = 'Start listening to mqtt subscriptions and save messages in database.'
def add_arguments(self, parser):
pass
def handle(self, *args, **options):
self.stdo... | <commit_before>from django.core.management.base import BaseCommand, CommandError
from mqtt_logger.models import *
class Command(BaseCommand):
help = 'Start listening to mqtt subscriptions and save messages in database.'
def add_arguments(self, parser):
pass
def handle(self, *args, **options):
... |
e019ce982325a6284e844df3c9a5f8172f494ba3 | run_mandel.py | run_mandel.py | import fractal
import bmp
pixels = fractal.mandelbrot(488, 256)
bmp.write_grayscale('mandel.bmp', pixels) | import fractal
import bmp
def main():
pixels = fractal.mandelbrot(488, 256)
bmp.write_grayscale('mandel.bmp', pixels)
if __name__ == '__main__':
main()
| Add a main runner for mandel | Add a main runner for mandel
| Python | mit | kentoj/python-fundamentals | import fractal
import bmp
pixels = fractal.mandelbrot(488, 256)
bmp.write_grayscale('mandel.bmp', pixels)Add a main runner for mandel | import fractal
import bmp
def main():
pixels = fractal.mandelbrot(488, 256)
bmp.write_grayscale('mandel.bmp', pixels)
if __name__ == '__main__':
main()
| <commit_before>import fractal
import bmp
pixels = fractal.mandelbrot(488, 256)
bmp.write_grayscale('mandel.bmp', pixels)<commit_msg>Add a main runner for mandel<commit_after> | import fractal
import bmp
def main():
pixels = fractal.mandelbrot(488, 256)
bmp.write_grayscale('mandel.bmp', pixels)
if __name__ == '__main__':
main()
| import fractal
import bmp
pixels = fractal.mandelbrot(488, 256)
bmp.write_grayscale('mandel.bmp', pixels)Add a main runner for mandelimport fractal
import bmp
def main():
pixels = fractal.mandelbrot(488, 256)
bmp.write_grayscale('mandel.bmp', pixels)
if __name__ == '__main__':
main()
| <commit_before>import fractal
import bmp
pixels = fractal.mandelbrot(488, 256)
bmp.write_grayscale('mandel.bmp', pixels)<commit_msg>Add a main runner for mandel<commit_after>import fractal
import bmp
def main():
pixels = fractal.mandelbrot(488, 256)
bmp.write_grayscale('mandel.bmp', pixels)
if __name__ =... |
f7f489369fa675e6efe0fa5b164b7ee1fc25f3fd | test/test_legend_labels.py | test/test_legend_labels.py | # -*- coding: utf-8 -*-
#
import helpers
def plot():
from matplotlib import pyplot as plt
import numpy as np
fig = plt.figure()
x = np.ma.arange(0, 2*np.pi, 0.02)
y1 = np.sin(1*x)
y2 = np.sin(2*x)
y3 = np.sin(3*x)
plt.plot(x, y1, label='y1')
plt.plot(x, y2, label=None)
plt.p... | # -*- coding: utf-8 -*-
#
import helpers
def plot():
from matplotlib import pyplot as plt
import numpy as np
fig = plt.figure()
x = np.ma.arange(0, 2*np.pi, 0.02)
y1 = np.sin(1*x)
y2 = np.sin(2*x)
y3 = np.sin(3*x)
plt.plot(x, y1, label='y1')
plt.plot(x, y2, label=None)
plt.p... | Test hash needed to change. | Test hash needed to change.
| Python | mit | nschloe/matplotlib2tikz,m-rossi/matplotlib2tikz,danielhkl/matplotlib2tikz | # -*- coding: utf-8 -*-
#
import helpers
def plot():
from matplotlib import pyplot as plt
import numpy as np
fig = plt.figure()
x = np.ma.arange(0, 2*np.pi, 0.02)
y1 = np.sin(1*x)
y2 = np.sin(2*x)
y3 = np.sin(3*x)
plt.plot(x, y1, label='y1')
plt.plot(x, y2, label=None)
plt.p... | # -*- coding: utf-8 -*-
#
import helpers
def plot():
from matplotlib import pyplot as plt
import numpy as np
fig = plt.figure()
x = np.ma.arange(0, 2*np.pi, 0.02)
y1 = np.sin(1*x)
y2 = np.sin(2*x)
y3 = np.sin(3*x)
plt.plot(x, y1, label='y1')
plt.plot(x, y2, label=None)
plt.p... | <commit_before># -*- coding: utf-8 -*-
#
import helpers
def plot():
from matplotlib import pyplot as plt
import numpy as np
fig = plt.figure()
x = np.ma.arange(0, 2*np.pi, 0.02)
y1 = np.sin(1*x)
y2 = np.sin(2*x)
y3 = np.sin(3*x)
plt.plot(x, y1, label='y1')
plt.plot(x, y2, label=... | # -*- coding: utf-8 -*-
#
import helpers
def plot():
from matplotlib import pyplot as plt
import numpy as np
fig = plt.figure()
x = np.ma.arange(0, 2*np.pi, 0.02)
y1 = np.sin(1*x)
y2 = np.sin(2*x)
y3 = np.sin(3*x)
plt.plot(x, y1, label='y1')
plt.plot(x, y2, label=None)
plt.p... | # -*- coding: utf-8 -*-
#
import helpers
def plot():
from matplotlib import pyplot as plt
import numpy as np
fig = plt.figure()
x = np.ma.arange(0, 2*np.pi, 0.02)
y1 = np.sin(1*x)
y2 = np.sin(2*x)
y3 = np.sin(3*x)
plt.plot(x, y1, label='y1')
plt.plot(x, y2, label=None)
plt.p... | <commit_before># -*- coding: utf-8 -*-
#
import helpers
def plot():
from matplotlib import pyplot as plt
import numpy as np
fig = plt.figure()
x = np.ma.arange(0, 2*np.pi, 0.02)
y1 = np.sin(1*x)
y2 = np.sin(2*x)
y3 = np.sin(3*x)
plt.plot(x, y1, label='y1')
plt.plot(x, y2, label=... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.