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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e85d0b100bd907ddf82f4c5e132690000d8cb4a0 | smart_open/__init__.py | smart_open/__init__.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Radim Rehurek <me@radimrehurek.com>
#
# This code is distributed under the terms and conditions
# from the MIT License (MIT).
#
"""
Utilities for streaming to/from several file-like data storages: S3 / HDFS / local
filesystem / compressed files, and many more, using a sim... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Radim Rehurek <me@radimrehurek.com>
#
# This code is distributed under the terms and conditions
# from the MIT License (MIT).
#
"""
Utilities for streaming to/from several file-like data storages: S3 / HDFS / local
filesystem / compressed files, and many more, using a sim... | Revert "Configure logging handlers before submodule imports" | Revert "Configure logging handlers before submodule imports"
This reverts commit d9ce6cc440019ecfc73f1c82e41da4e9ce02a234.
| Python | mit | RaRe-Technologies/smart_open,RaRe-Technologies/smart_open,piskvorky/smart_open | # -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Radim Rehurek <me@radimrehurek.com>
#
# This code is distributed under the terms and conditions
# from the MIT License (MIT).
#
"""
Utilities for streaming to/from several file-like data storages: S3 / HDFS / local
filesystem / compressed files, and many more, using a sim... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Radim Rehurek <me@radimrehurek.com>
#
# This code is distributed under the terms and conditions
# from the MIT License (MIT).
#
"""
Utilities for streaming to/from several file-like data storages: S3 / HDFS / local
filesystem / compressed files, and many more, using a sim... | <commit_before># -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Radim Rehurek <me@radimrehurek.com>
#
# This code is distributed under the terms and conditions
# from the MIT License (MIT).
#
"""
Utilities for streaming to/from several file-like data storages: S3 / HDFS / local
filesystem / compressed files, and many mo... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Radim Rehurek <me@radimrehurek.com>
#
# This code is distributed under the terms and conditions
# from the MIT License (MIT).
#
"""
Utilities for streaming to/from several file-like data storages: S3 / HDFS / local
filesystem / compressed files, and many more, using a sim... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Radim Rehurek <me@radimrehurek.com>
#
# This code is distributed under the terms and conditions
# from the MIT License (MIT).
#
"""
Utilities for streaming to/from several file-like data storages: S3 / HDFS / local
filesystem / compressed files, and many more, using a sim... | <commit_before># -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Radim Rehurek <me@radimrehurek.com>
#
# This code is distributed under the terms and conditions
# from the MIT License (MIT).
#
"""
Utilities for streaming to/from several file-like data storages: S3 / HDFS / local
filesystem / compressed files, and many mo... |
4bc34f0b8adfc22037475cbdafbb149b7ea88421 | tests/test_utils.py | tests/test_utils.py | import sys
from girder_worker.utils import TeeStdOutCustomWrite, TeeStdErrCustomWrite, JobManager
def test_TeeStdOutCustomeWrite(capfd):
_nonlocal = {'data': ''}
def _append_to_data(message, **kwargs):
_nonlocal['data'] += message
with TeeStdOutCustomWrite(_append_to_data):
sys.stdout.wr... | import sys
from girder_worker.utils import TeeStdOutCustomWrite
def test_TeeStdOutCustomWrite(capfd):
nonlocal_ = {'data': ''}
def _append_to_data(message, **kwargs):
nonlocal_['data'] += message
with TeeStdOutCustomWrite(_append_to_data):
sys.stdout.write('Test String')
sys.stdo... | Test TeeStdOutCustomWrite writes through to stdout | Test TeeStdOutCustomWrite writes through to stdout
| Python | apache-2.0 | girder/girder_worker,girder/girder_worker,girder/girder_worker | import sys
from girder_worker.utils import TeeStdOutCustomWrite, TeeStdErrCustomWrite, JobManager
def test_TeeStdOutCustomeWrite(capfd):
_nonlocal = {'data': ''}
def _append_to_data(message, **kwargs):
_nonlocal['data'] += message
with TeeStdOutCustomWrite(_append_to_data):
sys.stdout.wr... | import sys
from girder_worker.utils import TeeStdOutCustomWrite
def test_TeeStdOutCustomWrite(capfd):
nonlocal_ = {'data': ''}
def _append_to_data(message, **kwargs):
nonlocal_['data'] += message
with TeeStdOutCustomWrite(_append_to_data):
sys.stdout.write('Test String')
sys.stdo... | <commit_before>import sys
from girder_worker.utils import TeeStdOutCustomWrite, TeeStdErrCustomWrite, JobManager
def test_TeeStdOutCustomeWrite(capfd):
_nonlocal = {'data': ''}
def _append_to_data(message, **kwargs):
_nonlocal['data'] += message
with TeeStdOutCustomWrite(_append_to_data):
... | import sys
from girder_worker.utils import TeeStdOutCustomWrite
def test_TeeStdOutCustomWrite(capfd):
nonlocal_ = {'data': ''}
def _append_to_data(message, **kwargs):
nonlocal_['data'] += message
with TeeStdOutCustomWrite(_append_to_data):
sys.stdout.write('Test String')
sys.stdo... | import sys
from girder_worker.utils import TeeStdOutCustomWrite, TeeStdErrCustomWrite, JobManager
def test_TeeStdOutCustomeWrite(capfd):
_nonlocal = {'data': ''}
def _append_to_data(message, **kwargs):
_nonlocal['data'] += message
with TeeStdOutCustomWrite(_append_to_data):
sys.stdout.wr... | <commit_before>import sys
from girder_worker.utils import TeeStdOutCustomWrite, TeeStdErrCustomWrite, JobManager
def test_TeeStdOutCustomeWrite(capfd):
_nonlocal = {'data': ''}
def _append_to_data(message, **kwargs):
_nonlocal['data'] += message
with TeeStdOutCustomWrite(_append_to_data):
... |
08116d65cad849a2b031f960ef5da29e7802f4b7 | tests/unit_tests.py | tests/unit_tests.py | import os
import sys
import unittest
import tempfile
sys.path.insert(0, os.environ.get('BLOG_PATH'))
from blog.blog import *
class BlogUnitTestCase(unittest.TestCase):
def test_connect_db(self):
db = connect_db()
assert isinstance(db, sqlite3.Connection)
def test_get_db(self):
self.d... | import os
import sys
import unittest
import tempfile
sys.path.insert(0, os.environ.get('BLOG_PATH'))
from blog.blog import *
class BlogUnitTestCase(unittest.TestCase):
def test_connect_db(self):
db = connect_db()
assert isinstance(db, sqlite3.Connection)
def test_get_db(self):
self.d... | Update count of things in DB | Update count of things in DB
| Python | agpl-3.0 | levlaz/blog,levlaz/blog,levlaz/blog,levlaz/blog | import os
import sys
import unittest
import tempfile
sys.path.insert(0, os.environ.get('BLOG_PATH'))
from blog.blog import *
class BlogUnitTestCase(unittest.TestCase):
def test_connect_db(self):
db = connect_db()
assert isinstance(db, sqlite3.Connection)
def test_get_db(self):
self.d... | import os
import sys
import unittest
import tempfile
sys.path.insert(0, os.environ.get('BLOG_PATH'))
from blog.blog import *
class BlogUnitTestCase(unittest.TestCase):
def test_connect_db(self):
db = connect_db()
assert isinstance(db, sqlite3.Connection)
def test_get_db(self):
self.d... | <commit_before>import os
import sys
import unittest
import tempfile
sys.path.insert(0, os.environ.get('BLOG_PATH'))
from blog.blog import *
class BlogUnitTestCase(unittest.TestCase):
def test_connect_db(self):
db = connect_db()
assert isinstance(db, sqlite3.Connection)
def test_get_db(self):... | import os
import sys
import unittest
import tempfile
sys.path.insert(0, os.environ.get('BLOG_PATH'))
from blog.blog import *
class BlogUnitTestCase(unittest.TestCase):
def test_connect_db(self):
db = connect_db()
assert isinstance(db, sqlite3.Connection)
def test_get_db(self):
self.d... | import os
import sys
import unittest
import tempfile
sys.path.insert(0, os.environ.get('BLOG_PATH'))
from blog.blog import *
class BlogUnitTestCase(unittest.TestCase):
def test_connect_db(self):
db = connect_db()
assert isinstance(db, sqlite3.Connection)
def test_get_db(self):
self.d... | <commit_before>import os
import sys
import unittest
import tempfile
sys.path.insert(0, os.environ.get('BLOG_PATH'))
from blog.blog import *
class BlogUnitTestCase(unittest.TestCase):
def test_connect_db(self):
db = connect_db()
assert isinstance(db, sqlite3.Connection)
def test_get_db(self):... |
ff6502fd8ecc4ee28cb05cb7ee8f11f75240ce47 | mini_project.py | mini_project.py | # Load the machine
import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
# Other stuff
from cothread.catools import caget, caput, ca_nothing
# Load the machine
ap.machines.load('SRI21')
# First task
BPMS = ap.getElements('BPM')
print('There are {} BPM elements in the machine.'.format(len(BPMS)))
# S... | # Load the machine
import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
# Other stuff
from cothread.catools import caget, caput, ca_nothing
# Load the machine
ap.machines.load('SRI21')
# First task
BPMS = ap.getElements('BPM')
print('There are {} BPM elements in the machine.'.format(len(BPMS)))
# S... | Make the difference between PV names and values clearer. | Make the difference between PV names and values clearer.
| Python | apache-2.0 | razvanvasile/Work-Mini-Projects,razvanvasile/Work-Mini-Projects,razvanvasile/Work-Mini-Projects | # Load the machine
import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
# Other stuff
from cothread.catools import caget, caput, ca_nothing
# Load the machine
ap.machines.load('SRI21')
# First task
BPMS = ap.getElements('BPM')
print('There are {} BPM elements in the machine.'.format(len(BPMS)))
# S... | # Load the machine
import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
# Other stuff
from cothread.catools import caget, caput, ca_nothing
# Load the machine
ap.machines.load('SRI21')
# First task
BPMS = ap.getElements('BPM')
print('There are {} BPM elements in the machine.'.format(len(BPMS)))
# S... | <commit_before># Load the machine
import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
# Other stuff
from cothread.catools import caget, caput, ca_nothing
# Load the machine
ap.machines.load('SRI21')
# First task
BPMS = ap.getElements('BPM')
print('There are {} BPM elements in the machine.'.format(l... | # Load the machine
import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
# Other stuff
from cothread.catools import caget, caput, ca_nothing
# Load the machine
ap.machines.load('SRI21')
# First task
BPMS = ap.getElements('BPM')
print('There are {} BPM elements in the machine.'.format(len(BPMS)))
# S... | # Load the machine
import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
# Other stuff
from cothread.catools import caget, caput, ca_nothing
# Load the machine
ap.machines.load('SRI21')
# First task
BPMS = ap.getElements('BPM')
print('There are {} BPM elements in the machine.'.format(len(BPMS)))
# S... | <commit_before># Load the machine
import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
# Other stuff
from cothread.catools import caget, caput, ca_nothing
# Load the machine
ap.machines.load('SRI21')
# First task
BPMS = ap.getElements('BPM')
print('There are {} BPM elements in the machine.'.format(l... |
c1c66caa31506190944c8bd37df6fe056b60c0e2 | vote.py | vote.py | import enki
import json
e = enki.Enki('key', 'http://localhost:5001', 'translations')
e.get_all()
tasks = []
for t in e.tasks:
options = dict()
i = 0
for k in e.task_runs_df[t.id]['msgid'].keys():
options[k] = e.task_runs_df[t.id]['msgid'][k]
t.info['msgid_options'] = options
tasks.appen... | import enki
import json
e = enki.Enki('key', 'http://localhost:5001', 'translations')
e.get_all()
tasks = []
for t in e.tasks:
options = []
i = 0
for k in e.task_runs_df[t.id]['msgid'].keys():
option = dict(task_run_id=None, msgid=None)
option['task_run_id'] = k
option['msgid'] ... | Save the tasks in the proper way. | Save the tasks in the proper way.
| Python | agpl-3.0 | PyBossa/app-translations | import enki
import json
e = enki.Enki('key', 'http://localhost:5001', 'translations')
e.get_all()
tasks = []
for t in e.tasks:
options = dict()
i = 0
for k in e.task_runs_df[t.id]['msgid'].keys():
options[k] = e.task_runs_df[t.id]['msgid'][k]
t.info['msgid_options'] = options
tasks.appen... | import enki
import json
e = enki.Enki('key', 'http://localhost:5001', 'translations')
e.get_all()
tasks = []
for t in e.tasks:
options = []
i = 0
for k in e.task_runs_df[t.id]['msgid'].keys():
option = dict(task_run_id=None, msgid=None)
option['task_run_id'] = k
option['msgid'] ... | <commit_before>import enki
import json
e = enki.Enki('key', 'http://localhost:5001', 'translations')
e.get_all()
tasks = []
for t in e.tasks:
options = dict()
i = 0
for k in e.task_runs_df[t.id]['msgid'].keys():
options[k] = e.task_runs_df[t.id]['msgid'][k]
t.info['msgid_options'] = options
... | import enki
import json
e = enki.Enki('key', 'http://localhost:5001', 'translations')
e.get_all()
tasks = []
for t in e.tasks:
options = []
i = 0
for k in e.task_runs_df[t.id]['msgid'].keys():
option = dict(task_run_id=None, msgid=None)
option['task_run_id'] = k
option['msgid'] ... | import enki
import json
e = enki.Enki('key', 'http://localhost:5001', 'translations')
e.get_all()
tasks = []
for t in e.tasks:
options = dict()
i = 0
for k in e.task_runs_df[t.id]['msgid'].keys():
options[k] = e.task_runs_df[t.id]['msgid'][k]
t.info['msgid_options'] = options
tasks.appen... | <commit_before>import enki
import json
e = enki.Enki('key', 'http://localhost:5001', 'translations')
e.get_all()
tasks = []
for t in e.tasks:
options = dict()
i = 0
for k in e.task_runs_df[t.id]['msgid'].keys():
options[k] = e.task_runs_df[t.id]['msgid'][k]
t.info['msgid_options'] = options
... |
01c5a8d0f7e6540995817fecfee124f1859fa448 | mistraldashboard/executions/views.py | mistraldashboard/executions/views.py | # -*- coding: utf-8 -*-
#
# Copyright 2014 - StackStorm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | # -*- coding: utf-8 -*-
#
# Copyright 2014 - StackStorm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | Fix errors when user click execution id | Fix errors when user click execution id
Missing request argument when calling task list
Change-Id: Idc282c267fc99513dd96a80f6f4a745bfefec2c8
Closes-Bug: #1471778
| Python | apache-2.0 | openstack/mistral-dashboard,openstack/mistral-dashboard,openstack/mistral-dashboard | # -*- coding: utf-8 -*-
#
# Copyright 2014 - StackStorm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | # -*- coding: utf-8 -*-
#
# Copyright 2014 - StackStorm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | <commit_before># -*- coding: utf-8 -*-
#
# Copyright 2014 - StackStorm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | # -*- coding: utf-8 -*-
#
# Copyright 2014 - StackStorm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | # -*- coding: utf-8 -*-
#
# Copyright 2014 - StackStorm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | <commit_before># -*- coding: utf-8 -*-
#
# Copyright 2014 - StackStorm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... |
10360cc4d956faac194c58eb3b52fae2b348b356 | links/functions.py | links/functions.py | from uuid import uuid4
from random import randint
from basic_http import BasicHttp
def random_pk(length=8):
s = uuid4().hex
f = randint(0, (len(s) - length))
t = f + length
return s[f:t]
def get_url_info(url):
print url
req = BasicHttp(url)
print req
res = req.HEAD()
data = {
... | from uuid import uuid4
from random import randint
from basic_http import BasicHttp
def random_pk(length=8):
s = uuid4().hex
f = randint(0, (len(s) - length))
t = f + length
return s[f:t]
def get_url_info(url):
req = BasicHttp(url)
res = req.HEAD()
data = {
'file_name': url.split... | Remove of debug prints. Fix of invalid key name. | Remove of debug prints.
Fix of invalid key name.
| Python | bsd-3-clause | nachopro/followlink,nachopro/followlink | from uuid import uuid4
from random import randint
from basic_http import BasicHttp
def random_pk(length=8):
s = uuid4().hex
f = randint(0, (len(s) - length))
t = f + length
return s[f:t]
def get_url_info(url):
print url
req = BasicHttp(url)
print req
res = req.HEAD()
data = {
... | from uuid import uuid4
from random import randint
from basic_http import BasicHttp
def random_pk(length=8):
s = uuid4().hex
f = randint(0, (len(s) - length))
t = f + length
return s[f:t]
def get_url_info(url):
req = BasicHttp(url)
res = req.HEAD()
data = {
'file_name': url.split... | <commit_before>from uuid import uuid4
from random import randint
from basic_http import BasicHttp
def random_pk(length=8):
s = uuid4().hex
f = randint(0, (len(s) - length))
t = f + length
return s[f:t]
def get_url_info(url):
print url
req = BasicHttp(url)
print req
res = req.HEAD()
... | from uuid import uuid4
from random import randint
from basic_http import BasicHttp
def random_pk(length=8):
s = uuid4().hex
f = randint(0, (len(s) - length))
t = f + length
return s[f:t]
def get_url_info(url):
req = BasicHttp(url)
res = req.HEAD()
data = {
'file_name': url.split... | from uuid import uuid4
from random import randint
from basic_http import BasicHttp
def random_pk(length=8):
s = uuid4().hex
f = randint(0, (len(s) - length))
t = f + length
return s[f:t]
def get_url_info(url):
print url
req = BasicHttp(url)
print req
res = req.HEAD()
data = {
... | <commit_before>from uuid import uuid4
from random import randint
from basic_http import BasicHttp
def random_pk(length=8):
s = uuid4().hex
f = randint(0, (len(s) - length))
t = f + length
return s[f:t]
def get_url_info(url):
print url
req = BasicHttp(url)
print req
res = req.HEAD()
... |
72384b3f06d4c68a94805e101f6cf4f820157834 | process.py | process.py | # encoding: utf-8
import sys
lines = sys.stdin.readlines()
# Contact details are expected to begin on the fourth line, following the
# header and a blank line, and extend until the next blank line. Lines with
# bullets (•) will be split into separate lines.
contact_lines = []
for line in lines[3:]:
lines.remove... | # encoding: utf-8
import sys
lines = sys.stdin.readlines()
# Contact details are expected to begin on the fourth line, following the
# header and a blank line, and extend until the next blank line. Lines with
# bullets (•) will be split into separate lines.
contact_lines = []
for line in lines[3:]:
lines.remove... | Fix display of tildes in PDF output. | Fix display of tildes in PDF output. | Python | apache-2.0 | davidbradway/resume,davidbradway/resume | # encoding: utf-8
import sys
lines = sys.stdin.readlines()
# Contact details are expected to begin on the fourth line, following the
# header and a blank line, and extend until the next blank line. Lines with
# bullets (•) will be split into separate lines.
contact_lines = []
for line in lines[3:]:
lines.remove... | # encoding: utf-8
import sys
lines = sys.stdin.readlines()
# Contact details are expected to begin on the fourth line, following the
# header and a blank line, and extend until the next blank line. Lines with
# bullets (•) will be split into separate lines.
contact_lines = []
for line in lines[3:]:
lines.remove... | <commit_before># encoding: utf-8
import sys
lines = sys.stdin.readlines()
# Contact details are expected to begin on the fourth line, following the
# header and a blank line, and extend until the next blank line. Lines with
# bullets (•) will be split into separate lines.
contact_lines = []
for line in lines[3:]:
... | # encoding: utf-8
import sys
lines = sys.stdin.readlines()
# Contact details are expected to begin on the fourth line, following the
# header and a blank line, and extend until the next blank line. Lines with
# bullets (•) will be split into separate lines.
contact_lines = []
for line in lines[3:]:
lines.remove... | # encoding: utf-8
import sys
lines = sys.stdin.readlines()
# Contact details are expected to begin on the fourth line, following the
# header and a blank line, and extend until the next blank line. Lines with
# bullets (•) will be split into separate lines.
contact_lines = []
for line in lines[3:]:
lines.remove... | <commit_before># encoding: utf-8
import sys
lines = sys.stdin.readlines()
# Contact details are expected to begin on the fourth line, following the
# header and a blank line, and extend until the next blank line. Lines with
# bullets (•) will be split into separate lines.
contact_lines = []
for line in lines[3:]:
... |
4581f05e937800b0541c219fd82390fdfef7644f | opal/tests/test_updates_from_dict.py | opal/tests/test_updates_from_dict.py | from django.test import TestCase
from django.db import models as djangomodels
from opal.models import UpdatesFromDictMixin
class UpdatesFromDictMixinTest(TestCase):
class TestDiagnosis(UpdatesFromDictMixin, djangomodels.Model):
condition = djangomodels.CharField(max_length=255, blank=True, null=True)
... | from django.test import TestCase
from django.db import models as djangomodels
from opal.models import UpdatesFromDictMixin
class UpdatesFromDictMixinTest(TestCase):
class TestDiagnosis(UpdatesFromDictMixin, djangomodels.Model):
condition = djangomodels.CharField(max_length=255, blank=True, null=True)
... | Add a specific test for the updatesfromdict hard coded foreignkey fields | Add a specific test for the updatesfromdict hard coded foreignkey fields
| Python | agpl-3.0 | khchine5/opal,khchine5/opal,khchine5/opal | from django.test import TestCase
from django.db import models as djangomodels
from opal.models import UpdatesFromDictMixin
class UpdatesFromDictMixinTest(TestCase):
class TestDiagnosis(UpdatesFromDictMixin, djangomodels.Model):
condition = djangomodels.CharField(max_length=255, blank=True, null=True)
... | from django.test import TestCase
from django.db import models as djangomodels
from opal.models import UpdatesFromDictMixin
class UpdatesFromDictMixinTest(TestCase):
class TestDiagnosis(UpdatesFromDictMixin, djangomodels.Model):
condition = djangomodels.CharField(max_length=255, blank=True, null=True)
... | <commit_before>from django.test import TestCase
from django.db import models as djangomodels
from opal.models import UpdatesFromDictMixin
class UpdatesFromDictMixinTest(TestCase):
class TestDiagnosis(UpdatesFromDictMixin, djangomodels.Model):
condition = djangomodels.CharField(max_length=255, blank=True, ... | from django.test import TestCase
from django.db import models as djangomodels
from opal.models import UpdatesFromDictMixin
class UpdatesFromDictMixinTest(TestCase):
class TestDiagnosis(UpdatesFromDictMixin, djangomodels.Model):
condition = djangomodels.CharField(max_length=255, blank=True, null=True)
... | from django.test import TestCase
from django.db import models as djangomodels
from opal.models import UpdatesFromDictMixin
class UpdatesFromDictMixinTest(TestCase):
class TestDiagnosis(UpdatesFromDictMixin, djangomodels.Model):
condition = djangomodels.CharField(max_length=255, blank=True, null=True)
... | <commit_before>from django.test import TestCase
from django.db import models as djangomodels
from opal.models import UpdatesFromDictMixin
class UpdatesFromDictMixinTest(TestCase):
class TestDiagnosis(UpdatesFromDictMixin, djangomodels.Model):
condition = djangomodels.CharField(max_length=255, blank=True, ... |
3520217e38849ad18b11245c6cac51d79db8422d | pytablereader/loadermanager/_base.py | pytablereader/loadermanager/_base.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import
from ..interface import TableLoaderInterface
class TableLoaderManager(TableLoaderInterface):
def __init__(self, loader):
self.__loader = loader
@property
def loader... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import
from ..interface import TableLoaderInterface
class TableLoaderManager(TableLoaderInterface):
def __init__(self, loader):
self.__loader = loader
@property
def loader... | Add an interface to change table_name | Add an interface to change table_name
| Python | mit | thombashi/pytablereader,thombashi/pytablereader,thombashi/pytablereader | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import
from ..interface import TableLoaderInterface
class TableLoaderManager(TableLoaderInterface):
def __init__(self, loader):
self.__loader = loader
@property
def loader... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import
from ..interface import TableLoaderInterface
class TableLoaderManager(TableLoaderInterface):
def __init__(self, loader):
self.__loader = loader
@property
def loader... | <commit_before># encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import
from ..interface import TableLoaderInterface
class TableLoaderManager(TableLoaderInterface):
def __init__(self, loader):
self.__loader = loader
@property... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import
from ..interface import TableLoaderInterface
class TableLoaderManager(TableLoaderInterface):
def __init__(self, loader):
self.__loader = loader
@property
def loader... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import
from ..interface import TableLoaderInterface
class TableLoaderManager(TableLoaderInterface):
def __init__(self, loader):
self.__loader = loader
@property
def loader... | <commit_before># encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import
from ..interface import TableLoaderInterface
class TableLoaderManager(TableLoaderInterface):
def __init__(self, loader):
self.__loader = loader
@property... |
ec1058fc1576b7a47af2d00b5b9e60e71dc6dc6b | kraller/kraller.py | kraller/kraller.py | """
Kraller
An application to allow signups for accounts on a server with a key.
"""
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return 'Hello from ACM@CWRU'
if __name__ == '__main__':
app.run()
| """
Kraller
An application to allow signups for accounts on a server with a key.
"""
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return 'Hello from ACM@CWRU'
"""
Don't invoke this directly in production. This is for development only.
Use a WSGI webserver such as Gunicorn to se... | Add debug mode to the development version | Add debug mode to the development version
| Python | bsd-2-clause | Aaronneyer/kraller,Aaronneyer/kraller,bis12/kraller,hashbrowncipher/kraller,hacsoc/kraller,hashbrowncipher/kraller,hacsoc/kraller,cwruacm/kraller,bis12/kraller,cwruacm/kraller | """
Kraller
An application to allow signups for accounts on a server with a key.
"""
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return 'Hello from ACM@CWRU'
if __name__ == '__main__':
app.run()
Add debug mode to the development version | """
Kraller
An application to allow signups for accounts on a server with a key.
"""
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return 'Hello from ACM@CWRU'
"""
Don't invoke this directly in production. This is for development only.
Use a WSGI webserver such as Gunicorn to se... | <commit_before>"""
Kraller
An application to allow signups for accounts on a server with a key.
"""
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return 'Hello from ACM@CWRU'
if __name__ == '__main__':
app.run()
<commit_msg>Add debug mode to the development version<commit_aft... | """
Kraller
An application to allow signups for accounts on a server with a key.
"""
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return 'Hello from ACM@CWRU'
"""
Don't invoke this directly in production. This is for development only.
Use a WSGI webserver such as Gunicorn to se... | """
Kraller
An application to allow signups for accounts on a server with a key.
"""
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return 'Hello from ACM@CWRU'
if __name__ == '__main__':
app.run()
Add debug mode to the development version"""
Kraller
An application to allow s... | <commit_before>"""
Kraller
An application to allow signups for accounts on a server with a key.
"""
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return 'Hello from ACM@CWRU'
if __name__ == '__main__':
app.run()
<commit_msg>Add debug mode to the development version<commit_aft... |
d518c4f8fa7b657c735d5a2b4f653d5c0cad529e | gnotty/templatetags/gnotty_tags.py | gnotty/templatetags/gnotty_tags.py |
from django import template
from django.db.models import Min, Max
from gnotty.models import IRCMessage
from gnotty.conf import settings
register = template.Library()
@register.inclusion_tag("gnotty/includes/nav.html", takes_context=True)
def gnotty_nav(context):
min_max = IRCMessage.objects.aggregate(Min("mes... |
from django import template
from django.db.models import Min, Max
from gnotty.models import IRCMessage
from gnotty.conf import settings
register = template.Library()
@register.inclusion_tag("gnotty/includes/nav.html", takes_context=True)
def gnotty_nav(context):
min_max = IRCMessage.objects.aggregate(Min("mes... | Fix check for empty min/max years. | Fix check for empty min/max years.
| Python | bsd-2-clause | spaceone/gnotty,stephenmcd/gnotty,stephenmcd/gnotty,spaceone/gnotty,stephenmcd/gnotty,spaceone/gnotty |
from django import template
from django.db.models import Min, Max
from gnotty.models import IRCMessage
from gnotty.conf import settings
register = template.Library()
@register.inclusion_tag("gnotty/includes/nav.html", takes_context=True)
def gnotty_nav(context):
min_max = IRCMessage.objects.aggregate(Min("mes... |
from django import template
from django.db.models import Min, Max
from gnotty.models import IRCMessage
from gnotty.conf import settings
register = template.Library()
@register.inclusion_tag("gnotty/includes/nav.html", takes_context=True)
def gnotty_nav(context):
min_max = IRCMessage.objects.aggregate(Min("mes... | <commit_before>
from django import template
from django.db.models import Min, Max
from gnotty.models import IRCMessage
from gnotty.conf import settings
register = template.Library()
@register.inclusion_tag("gnotty/includes/nav.html", takes_context=True)
def gnotty_nav(context):
min_max = IRCMessage.objects.agg... |
from django import template
from django.db.models import Min, Max
from gnotty.models import IRCMessage
from gnotty.conf import settings
register = template.Library()
@register.inclusion_tag("gnotty/includes/nav.html", takes_context=True)
def gnotty_nav(context):
min_max = IRCMessage.objects.aggregate(Min("mes... |
from django import template
from django.db.models import Min, Max
from gnotty.models import IRCMessage
from gnotty.conf import settings
register = template.Library()
@register.inclusion_tag("gnotty/includes/nav.html", takes_context=True)
def gnotty_nav(context):
min_max = IRCMessage.objects.aggregate(Min("mes... | <commit_before>
from django import template
from django.db.models import Min, Max
from gnotty.models import IRCMessage
from gnotty.conf import settings
register = template.Library()
@register.inclusion_tag("gnotty/includes/nav.html", takes_context=True)
def gnotty_nav(context):
min_max = IRCMessage.objects.agg... |
087b6a623e4a48b76fa3ce62a14298d9744afd2a | go/apps/bulk_message/definition.py | go/apps/bulk_message/definition.py | from go.vumitools.conversation.definition import (
ConversationDefinitionBase, ConversationAction)
class BulkSendAction(ConversationAction):
action_name = 'bulk_send'
action_display_name = 'Write and send bulk message'
action_display_verb = 'Send message'
needs_confirmation = True
needs_grou... | from go.scheduler.models import Task
from go.vumitools.conversation.definition import (
ConversationDefinitionBase, ConversationAction)
class BulkSendAction(ConversationAction):
action_name = 'bulk_send'
action_display_name = 'Write and send bulk message'
action_display_verb = 'Send message now'
a... | Add handling for creating scheduled action for bulk send | Add handling for creating scheduled action for bulk send
| Python | bsd-3-clause | praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go | from go.vumitools.conversation.definition import (
ConversationDefinitionBase, ConversationAction)
class BulkSendAction(ConversationAction):
action_name = 'bulk_send'
action_display_name = 'Write and send bulk message'
action_display_verb = 'Send message'
needs_confirmation = True
needs_grou... | from go.scheduler.models import Task
from go.vumitools.conversation.definition import (
ConversationDefinitionBase, ConversationAction)
class BulkSendAction(ConversationAction):
action_name = 'bulk_send'
action_display_name = 'Write and send bulk message'
action_display_verb = 'Send message now'
a... | <commit_before>from go.vumitools.conversation.definition import (
ConversationDefinitionBase, ConversationAction)
class BulkSendAction(ConversationAction):
action_name = 'bulk_send'
action_display_name = 'Write and send bulk message'
action_display_verb = 'Send message'
needs_confirmation = True
... | from go.scheduler.models import Task
from go.vumitools.conversation.definition import (
ConversationDefinitionBase, ConversationAction)
class BulkSendAction(ConversationAction):
action_name = 'bulk_send'
action_display_name = 'Write and send bulk message'
action_display_verb = 'Send message now'
a... | from go.vumitools.conversation.definition import (
ConversationDefinitionBase, ConversationAction)
class BulkSendAction(ConversationAction):
action_name = 'bulk_send'
action_display_name = 'Write and send bulk message'
action_display_verb = 'Send message'
needs_confirmation = True
needs_grou... | <commit_before>from go.vumitools.conversation.definition import (
ConversationDefinitionBase, ConversationAction)
class BulkSendAction(ConversationAction):
action_name = 'bulk_send'
action_display_name = 'Write and send bulk message'
action_display_verb = 'Send message'
needs_confirmation = True
... |
c38fb74a71b3471f5363cf1aa95fecdd8ac9180f | picoCTF-shell/tests/test_problems.py | picoCTF-shell/tests/test_problems.py | import pytest
from os.path import dirname, join, realpath
import hacksport.deploy
from hacksport.deploy import deploy_problem
from shell_manager.util import default_config
PATH = dirname(realpath(__file__))
hacksport.deploy.deploy_config = default_config
@pytest.mark.skip("Broken tests/not working")
class TestProb... | import pytest
from os.path import dirname, join, realpath
import hacksport.deploy
from hacksport.deploy import deploy_problem
PATH = dirname(realpath(__file__))
@pytest.mark.skip("Broken tests/not working")
class TestProblems:
"""
Regression tests for compiled problems.
"""
def test_compiled_sourc... | Remove broken import in skipped tests | Remove broken import in skipped tests
| Python | mit | royragsdale/picoCTF,picoCTF/picoCTF,picoCTF/picoCTF,royragsdale/picoCTF,picoCTF/picoCTF,picoCTF/picoCTF,royragsdale/picoCTF,royragsdale/picoCTF,royragsdale/picoCTF,royragsdale/picoCTF,picoCTF/picoCTF,royragsdale/picoCTF,picoCTF/picoCTF | import pytest
from os.path import dirname, join, realpath
import hacksport.deploy
from hacksport.deploy import deploy_problem
from shell_manager.util import default_config
PATH = dirname(realpath(__file__))
hacksport.deploy.deploy_config = default_config
@pytest.mark.skip("Broken tests/not working")
class TestProb... | import pytest
from os.path import dirname, join, realpath
import hacksport.deploy
from hacksport.deploy import deploy_problem
PATH = dirname(realpath(__file__))
@pytest.mark.skip("Broken tests/not working")
class TestProblems:
"""
Regression tests for compiled problems.
"""
def test_compiled_sourc... | <commit_before>import pytest
from os.path import dirname, join, realpath
import hacksport.deploy
from hacksport.deploy import deploy_problem
from shell_manager.util import default_config
PATH = dirname(realpath(__file__))
hacksport.deploy.deploy_config = default_config
@pytest.mark.skip("Broken tests/not working")... | import pytest
from os.path import dirname, join, realpath
import hacksport.deploy
from hacksport.deploy import deploy_problem
PATH = dirname(realpath(__file__))
@pytest.mark.skip("Broken tests/not working")
class TestProblems:
"""
Regression tests for compiled problems.
"""
def test_compiled_sourc... | import pytest
from os.path import dirname, join, realpath
import hacksport.deploy
from hacksport.deploy import deploy_problem
from shell_manager.util import default_config
PATH = dirname(realpath(__file__))
hacksport.deploy.deploy_config = default_config
@pytest.mark.skip("Broken tests/not working")
class TestProb... | <commit_before>import pytest
from os.path import dirname, join, realpath
import hacksport.deploy
from hacksport.deploy import deploy_problem
from shell_manager.util import default_config
PATH = dirname(realpath(__file__))
hacksport.deploy.deploy_config = default_config
@pytest.mark.skip("Broken tests/not working")... |
36f218ccab5de6799674c438546189245b444b25 | was/photo/forms.py | was/photo/forms.py | from django.forms.models import ModelForm
from .models import Photo
from artists.models import Artists
class UploadPhotoForm(ModelForm):
class Meta:
model = Photo
fields = ['picture', 'comment']
def __init__(self, *args, **kwargs):
self.request = kwargs.pop("request")
super(Up... | from django.forms.models import ModelForm
from .models import Photo
from artists.models import Artists
class UploadPhotoForm(ModelForm):
class Meta:
model = Photo
fields = ['picture', 'comment']
def __init__(self, *args, **kwargs):
self.request = kwargs.pop("request", None)
su... | Add None when request arg is pop, in case we access the form in get | Add None when request arg is pop, in case we access the form in get
| Python | mit | KeserOner/where-artists-share,KeserOner/where-artists-share | from django.forms.models import ModelForm
from .models import Photo
from artists.models import Artists
class UploadPhotoForm(ModelForm):
class Meta:
model = Photo
fields = ['picture', 'comment']
def __init__(self, *args, **kwargs):
self.request = kwargs.pop("request")
super(Up... | from django.forms.models import ModelForm
from .models import Photo
from artists.models import Artists
class UploadPhotoForm(ModelForm):
class Meta:
model = Photo
fields = ['picture', 'comment']
def __init__(self, *args, **kwargs):
self.request = kwargs.pop("request", None)
su... | <commit_before>from django.forms.models import ModelForm
from .models import Photo
from artists.models import Artists
class UploadPhotoForm(ModelForm):
class Meta:
model = Photo
fields = ['picture', 'comment']
def __init__(self, *args, **kwargs):
self.request = kwargs.pop("request")
... | from django.forms.models import ModelForm
from .models import Photo
from artists.models import Artists
class UploadPhotoForm(ModelForm):
class Meta:
model = Photo
fields = ['picture', 'comment']
def __init__(self, *args, **kwargs):
self.request = kwargs.pop("request", None)
su... | from django.forms.models import ModelForm
from .models import Photo
from artists.models import Artists
class UploadPhotoForm(ModelForm):
class Meta:
model = Photo
fields = ['picture', 'comment']
def __init__(self, *args, **kwargs):
self.request = kwargs.pop("request")
super(Up... | <commit_before>from django.forms.models import ModelForm
from .models import Photo
from artists.models import Artists
class UploadPhotoForm(ModelForm):
class Meta:
model = Photo
fields = ['picture', 'comment']
def __init__(self, *args, **kwargs):
self.request = kwargs.pop("request")
... |
224478e0d69197feb19f2f89c21e884a2e5cb77d | organizer/views.py | organizer/views.py | from django.shortcuts import (
get_object_or_404, render)
from .models import Startup, Tag
def startup_detail(request, slug):
startup = get_object_or_404(
Startup, slug__iexact=slug)
return render(
request,
'organizer/startup_detail.html',
{'startup': startup})
def start... | from django.shortcuts import (
get_object_or_404, render)
from .models import Startup, Tag
def startup_detail(request, slug):
startup = get_object_or_404(
Startup, slug__iexact=slug)
return render(
request,
'organizer/startup_detail.html',
{'startup': startup})
def start... | Add HTTP method condition to tag_create(). | Ch09: Add HTTP method condition to tag_create().
| Python | bsd-2-clause | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | from django.shortcuts import (
get_object_or_404, render)
from .models import Startup, Tag
def startup_detail(request, slug):
startup = get_object_or_404(
Startup, slug__iexact=slug)
return render(
request,
'organizer/startup_detail.html',
{'startup': startup})
def start... | from django.shortcuts import (
get_object_or_404, render)
from .models import Startup, Tag
def startup_detail(request, slug):
startup = get_object_or_404(
Startup, slug__iexact=slug)
return render(
request,
'organizer/startup_detail.html',
{'startup': startup})
def start... | <commit_before>from django.shortcuts import (
get_object_or_404, render)
from .models import Startup, Tag
def startup_detail(request, slug):
startup = get_object_or_404(
Startup, slug__iexact=slug)
return render(
request,
'organizer/startup_detail.html',
{'startup': startu... | from django.shortcuts import (
get_object_or_404, render)
from .models import Startup, Tag
def startup_detail(request, slug):
startup = get_object_or_404(
Startup, slug__iexact=slug)
return render(
request,
'organizer/startup_detail.html',
{'startup': startup})
def start... | from django.shortcuts import (
get_object_or_404, render)
from .models import Startup, Tag
def startup_detail(request, slug):
startup = get_object_or_404(
Startup, slug__iexact=slug)
return render(
request,
'organizer/startup_detail.html',
{'startup': startup})
def start... | <commit_before>from django.shortcuts import (
get_object_or_404, render)
from .models import Startup, Tag
def startup_detail(request, slug):
startup = get_object_or_404(
Startup, slug__iexact=slug)
return render(
request,
'organizer/startup_detail.html',
{'startup': startu... |
271c91a607797bbd9d1a1e179745aedf580e8209 | user/models.py | user/models.py | from django.conf import settings
from django.contrib.auth.models import (
AbstractBaseUser, PermissionsMixin)
from django.core.urlresolvers import reverse
from django.db import models
class Profile(models.Model):
user = models.OneToOneField(
settings.AUTH_USER_MODEL)
slug = models.SlugField(
... | from django.conf import settings
from django.contrib.auth.models import (
AbstractBaseUser, PermissionsMixin)
from django.core.urlresolvers import reverse
from django.db import models
class Profile(models.Model):
user = models.OneToOneField(
settings.AUTH_USER_MODEL)
name = models.CharField(
... | Add name and joined date field to Profile. | Ch22: Add name and joined date field to Profile.
| Python | bsd-2-clause | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | from django.conf import settings
from django.contrib.auth.models import (
AbstractBaseUser, PermissionsMixin)
from django.core.urlresolvers import reverse
from django.db import models
class Profile(models.Model):
user = models.OneToOneField(
settings.AUTH_USER_MODEL)
slug = models.SlugField(
... | from django.conf import settings
from django.contrib.auth.models import (
AbstractBaseUser, PermissionsMixin)
from django.core.urlresolvers import reverse
from django.db import models
class Profile(models.Model):
user = models.OneToOneField(
settings.AUTH_USER_MODEL)
name = models.CharField(
... | <commit_before>from django.conf import settings
from django.contrib.auth.models import (
AbstractBaseUser, PermissionsMixin)
from django.core.urlresolvers import reverse
from django.db import models
class Profile(models.Model):
user = models.OneToOneField(
settings.AUTH_USER_MODEL)
slug = models.S... | from django.conf import settings
from django.contrib.auth.models import (
AbstractBaseUser, PermissionsMixin)
from django.core.urlresolvers import reverse
from django.db import models
class Profile(models.Model):
user = models.OneToOneField(
settings.AUTH_USER_MODEL)
name = models.CharField(
... | from django.conf import settings
from django.contrib.auth.models import (
AbstractBaseUser, PermissionsMixin)
from django.core.urlresolvers import reverse
from django.db import models
class Profile(models.Model):
user = models.OneToOneField(
settings.AUTH_USER_MODEL)
slug = models.SlugField(
... | <commit_before>from django.conf import settings
from django.contrib.auth.models import (
AbstractBaseUser, PermissionsMixin)
from django.core.urlresolvers import reverse
from django.db import models
class Profile(models.Model):
user = models.OneToOneField(
settings.AUTH_USER_MODEL)
slug = models.S... |
1b1a40646a08e6a01927279eb7dff8399adec740 | markups/common.py | markups/common.py | # This file is part of python-markups module
# License: BSD
# Copyright: (C) Dmitry Shachnev, 2012-2017
import os.path
# Some common constants and functions
(LANGUAGE_HOME_PAGE, MODULE_HOME_PAGE, SYNTAX_DOCUMENTATION) = range(3)
CONFIGURATION_DIR = (os.getenv('XDG_CONFIG_HOME') or os.getenv('APPDATA') or
os.path.exp... | # This file is part of python-markups module
# License: BSD
# Copyright: (C) Dmitry Shachnev, 2012-2017
import os.path
# Some common constants and functions
(LANGUAGE_HOME_PAGE, MODULE_HOME_PAGE, SYNTAX_DOCUMENTATION) = range(3)
CONFIGURATION_DIR = (os.getenv('XDG_CONFIG_HOME') or os.getenv('APPDATA') or
os.path.exp... | Update MathJax URL to 2.7.2 | Update MathJax URL to 2.7.2
| Python | bsd-3-clause | mitya57/pymarkups,retext-project/pymarkups | # This file is part of python-markups module
# License: BSD
# Copyright: (C) Dmitry Shachnev, 2012-2017
import os.path
# Some common constants and functions
(LANGUAGE_HOME_PAGE, MODULE_HOME_PAGE, SYNTAX_DOCUMENTATION) = range(3)
CONFIGURATION_DIR = (os.getenv('XDG_CONFIG_HOME') or os.getenv('APPDATA') or
os.path.exp... | # This file is part of python-markups module
# License: BSD
# Copyright: (C) Dmitry Shachnev, 2012-2017
import os.path
# Some common constants and functions
(LANGUAGE_HOME_PAGE, MODULE_HOME_PAGE, SYNTAX_DOCUMENTATION) = range(3)
CONFIGURATION_DIR = (os.getenv('XDG_CONFIG_HOME') or os.getenv('APPDATA') or
os.path.exp... | <commit_before># This file is part of python-markups module
# License: BSD
# Copyright: (C) Dmitry Shachnev, 2012-2017
import os.path
# Some common constants and functions
(LANGUAGE_HOME_PAGE, MODULE_HOME_PAGE, SYNTAX_DOCUMENTATION) = range(3)
CONFIGURATION_DIR = (os.getenv('XDG_CONFIG_HOME') or os.getenv('APPDATA') ... | # This file is part of python-markups module
# License: BSD
# Copyright: (C) Dmitry Shachnev, 2012-2017
import os.path
# Some common constants and functions
(LANGUAGE_HOME_PAGE, MODULE_HOME_PAGE, SYNTAX_DOCUMENTATION) = range(3)
CONFIGURATION_DIR = (os.getenv('XDG_CONFIG_HOME') or os.getenv('APPDATA') or
os.path.exp... | # This file is part of python-markups module
# License: BSD
# Copyright: (C) Dmitry Shachnev, 2012-2017
import os.path
# Some common constants and functions
(LANGUAGE_HOME_PAGE, MODULE_HOME_PAGE, SYNTAX_DOCUMENTATION) = range(3)
CONFIGURATION_DIR = (os.getenv('XDG_CONFIG_HOME') or os.getenv('APPDATA') or
os.path.exp... | <commit_before># This file is part of python-markups module
# License: BSD
# Copyright: (C) Dmitry Shachnev, 2012-2017
import os.path
# Some common constants and functions
(LANGUAGE_HOME_PAGE, MODULE_HOME_PAGE, SYNTAX_DOCUMENTATION) = range(3)
CONFIGURATION_DIR = (os.getenv('XDG_CONFIG_HOME') or os.getenv('APPDATA') ... |
5a05b1cbe258ef18607aabbc276aaccd5f2eb14c | admin_crud/router.py | admin_crud/router.py | from django.apps import apps as dj_apps
from django.conf.urls import include, url
from django.template.response import TemplateResponse
from django.utils.text import capfirst
class Router(object):
def __init__(self):
self.registry = []
self._urls = [
url(r'^$', self.index_view, name='i... | from django.apps import apps as dj_apps
from django.conf.urls import include, url
from django.template.response import TemplateResponse
from django.utils.text import capfirst
class Router(object):
def __init__(self):
self.registry = []
self._urls = [
url(r'^$', self.index_view, name='i... | Rename models to groups for corresponding with method name | Rename models to groups for corresponding with method name
| Python | mit | raizanshine/django-admin-crud,raizanshine/django-admin-crud | from django.apps import apps as dj_apps
from django.conf.urls import include, url
from django.template.response import TemplateResponse
from django.utils.text import capfirst
class Router(object):
def __init__(self):
self.registry = []
self._urls = [
url(r'^$', self.index_view, name='i... | from django.apps import apps as dj_apps
from django.conf.urls import include, url
from django.template.response import TemplateResponse
from django.utils.text import capfirst
class Router(object):
def __init__(self):
self.registry = []
self._urls = [
url(r'^$', self.index_view, name='i... | <commit_before>from django.apps import apps as dj_apps
from django.conf.urls import include, url
from django.template.response import TemplateResponse
from django.utils.text import capfirst
class Router(object):
def __init__(self):
self.registry = []
self._urls = [
url(r'^$', self.inde... | from django.apps import apps as dj_apps
from django.conf.urls import include, url
from django.template.response import TemplateResponse
from django.utils.text import capfirst
class Router(object):
def __init__(self):
self.registry = []
self._urls = [
url(r'^$', self.index_view, name='i... | from django.apps import apps as dj_apps
from django.conf.urls import include, url
from django.template.response import TemplateResponse
from django.utils.text import capfirst
class Router(object):
def __init__(self):
self.registry = []
self._urls = [
url(r'^$', self.index_view, name='i... | <commit_before>from django.apps import apps as dj_apps
from django.conf.urls import include, url
from django.template.response import TemplateResponse
from django.utils.text import capfirst
class Router(object):
def __init__(self):
self.registry = []
self._urls = [
url(r'^$', self.inde... |
e0233b0bb0a5a92c641d06648ec9921318b9a028 | knowledge_repo/converters/pdf.py | knowledge_repo/converters/pdf.py | from ..converter import KnowledgePostConverter
from .html import HTMLConverter
class PDFConverter(KnowledgePostConverter):
'''
Use this as a template for new KnowledgePostConverters.
'''
_registry_keys = ['pdf']
@property
def dependencies(self):
# Dependencies required for this conve... | from ..converter import KnowledgePostConverter
from .html import HTMLConverter
class PDFConverter(KnowledgePostConverter):
'''
Use this as a template for new KnowledgePostConverters.
'''
_registry_keys = ['pdf']
@property
def dependencies(self):
# Dependencies required for this conve... | Fix encoding error in Python 3. | Fix encoding error in Python 3.
| Python | apache-2.0 | airbnb/knowledge-repo,airbnb/knowledge-repo,airbnb/knowledge-repo,airbnb/knowledge-repo,airbnb/knowledge-repo | from ..converter import KnowledgePostConverter
from .html import HTMLConverter
class PDFConverter(KnowledgePostConverter):
'''
Use this as a template for new KnowledgePostConverters.
'''
_registry_keys = ['pdf']
@property
def dependencies(self):
# Dependencies required for this conve... | from ..converter import KnowledgePostConverter
from .html import HTMLConverter
class PDFConverter(KnowledgePostConverter):
'''
Use this as a template for new KnowledgePostConverters.
'''
_registry_keys = ['pdf']
@property
def dependencies(self):
# Dependencies required for this conve... | <commit_before>from ..converter import KnowledgePostConverter
from .html import HTMLConverter
class PDFConverter(KnowledgePostConverter):
'''
Use this as a template for new KnowledgePostConverters.
'''
_registry_keys = ['pdf']
@property
def dependencies(self):
# Dependencies required... | from ..converter import KnowledgePostConverter
from .html import HTMLConverter
class PDFConverter(KnowledgePostConverter):
'''
Use this as a template for new KnowledgePostConverters.
'''
_registry_keys = ['pdf']
@property
def dependencies(self):
# Dependencies required for this conve... | from ..converter import KnowledgePostConverter
from .html import HTMLConverter
class PDFConverter(KnowledgePostConverter):
'''
Use this as a template for new KnowledgePostConverters.
'''
_registry_keys = ['pdf']
@property
def dependencies(self):
# Dependencies required for this conve... | <commit_before>from ..converter import KnowledgePostConverter
from .html import HTMLConverter
class PDFConverter(KnowledgePostConverter):
'''
Use this as a template for new KnowledgePostConverters.
'''
_registry_keys = ['pdf']
@property
def dependencies(self):
# Dependencies required... |
4c43e7588d8747e26901400ce67c1485ba98bb92 | l10n_br_purchase/__manifest__.py | l10n_br_purchase/__manifest__.py | # -*- coding: utf-8 -*-
# Copyright (C) 2009 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': 'Brazilian Localization Purchase',
'license': 'AGPL-3',
'category': 'Localisation',
'author': 'Akretion, Odoo Community Association (OCA)',
'website': 'htt... | # -*- coding: utf-8 -*-
# Copyright (C) 2009 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': 'Brazilian Localization Purchase',
'license': 'AGPL-3',
'category': 'Localisation',
'author': 'Akretion, Odoo Community Association (OCA)',
'website': 'htt... | Bump module version to 10.0.1.0.0 | [MIG] Bump module version to 10.0.1.0.0
| Python | agpl-3.0 | OCA/l10n-brazil,akretion/l10n-brazil,akretion/l10n-brazil,OCA/l10n-brazil,OCA/l10n-brazil,akretion/l10n-brazil | # -*- coding: utf-8 -*-
# Copyright (C) 2009 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': 'Brazilian Localization Purchase',
'license': 'AGPL-3',
'category': 'Localisation',
'author': 'Akretion, Odoo Community Association (OCA)',
'website': 'htt... | # -*- coding: utf-8 -*-
# Copyright (C) 2009 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': 'Brazilian Localization Purchase',
'license': 'AGPL-3',
'category': 'Localisation',
'author': 'Akretion, Odoo Community Association (OCA)',
'website': 'htt... | <commit_before># -*- coding: utf-8 -*-
# Copyright (C) 2009 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': 'Brazilian Localization Purchase',
'license': 'AGPL-3',
'category': 'Localisation',
'author': 'Akretion, Odoo Community Association (OCA)',
... | # -*- coding: utf-8 -*-
# Copyright (C) 2009 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': 'Brazilian Localization Purchase',
'license': 'AGPL-3',
'category': 'Localisation',
'author': 'Akretion, Odoo Community Association (OCA)',
'website': 'htt... | # -*- coding: utf-8 -*-
# Copyright (C) 2009 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': 'Brazilian Localization Purchase',
'license': 'AGPL-3',
'category': 'Localisation',
'author': 'Akretion, Odoo Community Association (OCA)',
'website': 'htt... | <commit_before># -*- coding: utf-8 -*-
# Copyright (C) 2009 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': 'Brazilian Localization Purchase',
'license': 'AGPL-3',
'category': 'Localisation',
'author': 'Akretion, Odoo Community Association (OCA)',
... |
6caca3259f4ec8f298b1d35f15e4492efbcff6b1 | tests/basics/dict1.py | tests/basics/dict1.py | # basic dictionary
d = {}
print(d)
d[2] = 123
print(d)
d = {1:2}
d[3] = 3
print(len(d), d[1], d[3])
d[1] = 0
print(len(d), d[1], d[3])
print(str(d) == '{1: 0, 3: 3}' or str(d) == '{3: 3, 1: 0}')
x = 1
while x < 100:
d[x] = x
x += 1
print(d[50])
# equality operator on dicts of different size
print({} == {1:1}... | # basic dictionary
d = {}
print(d)
d[2] = 123
print(d)
d = {1:2}
d[3] = 3
print(len(d), d[1], d[3])
d[1] = 0
print(len(d), d[1], d[3])
print(str(d) == '{1: 0, 3: 3}' or str(d) == '{3: 3, 1: 0}')
x = 1
while x < 100:
d[x] = x
x += 1
print(d[50])
# equality operator on dicts of different size
print({} == {1:1}... | Add test to print full KeyError exc from failed dict lookup. | tests: Add test to print full KeyError exc from failed dict lookup.
| Python | mit | jmarcelino/pycom-micropython,alex-march/micropython,hiway/micropython,AriZuu/micropython,chrisdearman/micropython,kerneltask/micropython,jmarcelino/pycom-micropython,selste/micropython,tuc-osg/micropython,blazewicz/micropython,oopy/micropython,ryannathans/micropython,micropython/micropython-esp32,trezor/micropython,inf... | # basic dictionary
d = {}
print(d)
d[2] = 123
print(d)
d = {1:2}
d[3] = 3
print(len(d), d[1], d[3])
d[1] = 0
print(len(d), d[1], d[3])
print(str(d) == '{1: 0, 3: 3}' or str(d) == '{3: 3, 1: 0}')
x = 1
while x < 100:
d[x] = x
x += 1
print(d[50])
# equality operator on dicts of different size
print({} == {1:1}... | # basic dictionary
d = {}
print(d)
d[2] = 123
print(d)
d = {1:2}
d[3] = 3
print(len(d), d[1], d[3])
d[1] = 0
print(len(d), d[1], d[3])
print(str(d) == '{1: 0, 3: 3}' or str(d) == '{3: 3, 1: 0}')
x = 1
while x < 100:
d[x] = x
x += 1
print(d[50])
# equality operator on dicts of different size
print({} == {1:1}... | <commit_before># basic dictionary
d = {}
print(d)
d[2] = 123
print(d)
d = {1:2}
d[3] = 3
print(len(d), d[1], d[3])
d[1] = 0
print(len(d), d[1], d[3])
print(str(d) == '{1: 0, 3: 3}' or str(d) == '{3: 3, 1: 0}')
x = 1
while x < 100:
d[x] = x
x += 1
print(d[50])
# equality operator on dicts of different size
pr... | # basic dictionary
d = {}
print(d)
d[2] = 123
print(d)
d = {1:2}
d[3] = 3
print(len(d), d[1], d[3])
d[1] = 0
print(len(d), d[1], d[3])
print(str(d) == '{1: 0, 3: 3}' or str(d) == '{3: 3, 1: 0}')
x = 1
while x < 100:
d[x] = x
x += 1
print(d[50])
# equality operator on dicts of different size
print({} == {1:1}... | # basic dictionary
d = {}
print(d)
d[2] = 123
print(d)
d = {1:2}
d[3] = 3
print(len(d), d[1], d[3])
d[1] = 0
print(len(d), d[1], d[3])
print(str(d) == '{1: 0, 3: 3}' or str(d) == '{3: 3, 1: 0}')
x = 1
while x < 100:
d[x] = x
x += 1
print(d[50])
# equality operator on dicts of different size
print({} == {1:1}... | <commit_before># basic dictionary
d = {}
print(d)
d[2] = 123
print(d)
d = {1:2}
d[3] = 3
print(len(d), d[1], d[3])
d[1] = 0
print(len(d), d[1], d[3])
print(str(d) == '{1: 0, 3: 3}' or str(d) == '{3: 3, 1: 0}')
x = 1
while x < 100:
d[x] = x
x += 1
print(d[50])
# equality operator on dicts of different size
pr... |
ad346d73a27c021de131ec871dc19da2e17854ee | armstrong/dev/virtualdjango/base.py | armstrong/dev/virtualdjango/base.py | import os, sys
DEFAULT_SETTINGS = {
'DATABASE_ENGINE': 'sqlite3',
'DATABASES': {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'mydatabase'
}
},
}
class VirtualDjango(object):
def __init__(self,
caller=sys.modules['__main__'],
... | import django
import os, sys
DEFAULT_SETTINGS = {
'DATABASE_ENGINE': 'sqlite3',
'DATABASES': {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'mydatabase'
}
},
}
class VirtualDjango(object):
def __init__(self,
caller=sys.modules['_... | Adjust the settings reset to work with Django 1.4 | Adjust the settings reset to work with Django 1.4
Django changed the `settings._wrapped` value from `None` to the special
`empty` object. This change maintains backwards compatibility for
1.3.X, while using the new method for all other versions of Django.
| Python | apache-2.0 | armstrong/armstrong.dev | import os, sys
DEFAULT_SETTINGS = {
'DATABASE_ENGINE': 'sqlite3',
'DATABASES': {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'mydatabase'
}
},
}
class VirtualDjango(object):
def __init__(self,
caller=sys.modules['__main__'],
... | import django
import os, sys
DEFAULT_SETTINGS = {
'DATABASE_ENGINE': 'sqlite3',
'DATABASES': {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'mydatabase'
}
},
}
class VirtualDjango(object):
def __init__(self,
caller=sys.modules['_... | <commit_before>import os, sys
DEFAULT_SETTINGS = {
'DATABASE_ENGINE': 'sqlite3',
'DATABASES': {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'mydatabase'
}
},
}
class VirtualDjango(object):
def __init__(self,
caller=sys.modules['... | import django
import os, sys
DEFAULT_SETTINGS = {
'DATABASE_ENGINE': 'sqlite3',
'DATABASES': {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'mydatabase'
}
},
}
class VirtualDjango(object):
def __init__(self,
caller=sys.modules['_... | import os, sys
DEFAULT_SETTINGS = {
'DATABASE_ENGINE': 'sqlite3',
'DATABASES': {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'mydatabase'
}
},
}
class VirtualDjango(object):
def __init__(self,
caller=sys.modules['__main__'],
... | <commit_before>import os, sys
DEFAULT_SETTINGS = {
'DATABASE_ENGINE': 'sqlite3',
'DATABASES': {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'mydatabase'
}
},
}
class VirtualDjango(object):
def __init__(self,
caller=sys.modules['... |
1e4bdeeb1156c4ff65d261ba261f594be57bc30f | tests/test_appinfo.py | tests/test_appinfo.py | import io
import os
import pickle
import pytest
from steamfiles import appinfo
test_file_name = os.path.join(os.path.dirname(__file__), 'test_data/appinfo.vdf')
@pytest.yield_fixture
def vdf_data():
with open(test_file_name, 'rb') as f:
yield f.read()
@pytest.mark.usefixtures('vdf_data')
def test_load_... | import io
import os
import pickle
import pytest
from steamfiles import appinfo
test_file_name = os.path.join(os.path.dirname(__file__), 'test_data/appinfo.vdf')
@pytest.yield_fixture
def vdf_data():
with open(test_file_name, 'rb') as f:
yield f.read()
@pytest.mark.usefixtures('vdf_data')
def test_loads... | Add loads-dumps test for Appinfo | Add loads-dumps test for Appinfo
| Python | mit | leovp/steamfiles | import io
import os
import pickle
import pytest
from steamfiles import appinfo
test_file_name = os.path.join(os.path.dirname(__file__), 'test_data/appinfo.vdf')
@pytest.yield_fixture
def vdf_data():
with open(test_file_name, 'rb') as f:
yield f.read()
@pytest.mark.usefixtures('vdf_data')
def test_load_... | import io
import os
import pickle
import pytest
from steamfiles import appinfo
test_file_name = os.path.join(os.path.dirname(__file__), 'test_data/appinfo.vdf')
@pytest.yield_fixture
def vdf_data():
with open(test_file_name, 'rb') as f:
yield f.read()
@pytest.mark.usefixtures('vdf_data')
def test_loads... | <commit_before>import io
import os
import pickle
import pytest
from steamfiles import appinfo
test_file_name = os.path.join(os.path.dirname(__file__), 'test_data/appinfo.vdf')
@pytest.yield_fixture
def vdf_data():
with open(test_file_name, 'rb') as f:
yield f.read()
@pytest.mark.usefixtures('vdf_data')... | import io
import os
import pickle
import pytest
from steamfiles import appinfo
test_file_name = os.path.join(os.path.dirname(__file__), 'test_data/appinfo.vdf')
@pytest.yield_fixture
def vdf_data():
with open(test_file_name, 'rb') as f:
yield f.read()
@pytest.mark.usefixtures('vdf_data')
def test_loads... | import io
import os
import pickle
import pytest
from steamfiles import appinfo
test_file_name = os.path.join(os.path.dirname(__file__), 'test_data/appinfo.vdf')
@pytest.yield_fixture
def vdf_data():
with open(test_file_name, 'rb') as f:
yield f.read()
@pytest.mark.usefixtures('vdf_data')
def test_load_... | <commit_before>import io
import os
import pickle
import pytest
from steamfiles import appinfo
test_file_name = os.path.join(os.path.dirname(__file__), 'test_data/appinfo.vdf')
@pytest.yield_fixture
def vdf_data():
with open(test_file_name, 'rb') as f:
yield f.read()
@pytest.mark.usefixtures('vdf_data')... |
331f776eef9acd0509c7534040ef225869305d7f | tests/test_cookies.py | tests/test_cookies.py | # -*- coding: utf-8 -*-
def test_cookies_fixture(testdir):
"""Make sure that pytest accepts the `cookies` fixture."""
# create a temporary pytest test module
testdir.makepyfile("""
def test_valid_fixture(cookies):
assert hasattr(cookies, 'bake')
assert callable(cookies.bak... | # -*- coding: utf-8 -*-
def test_cookies_fixture(testdir):
"""Make sure that pytest accepts the `cookies` fixture."""
# create a temporary pytest test module
testdir.makepyfile("""
def test_valid_fixture(cookies):
assert hasattr(cookies, 'bake')
assert callable(cookies.bak... | Update test for cookies fixture | Update test for cookies fixture
| Python | mit | hackebrot/pytest-cookies | # -*- coding: utf-8 -*-
def test_cookies_fixture(testdir):
"""Make sure that pytest accepts the `cookies` fixture."""
# create a temporary pytest test module
testdir.makepyfile("""
def test_valid_fixture(cookies):
assert hasattr(cookies, 'bake')
assert callable(cookies.bak... | # -*- coding: utf-8 -*-
def test_cookies_fixture(testdir):
"""Make sure that pytest accepts the `cookies` fixture."""
# create a temporary pytest test module
testdir.makepyfile("""
def test_valid_fixture(cookies):
assert hasattr(cookies, 'bake')
assert callable(cookies.bak... | <commit_before># -*- coding: utf-8 -*-
def test_cookies_fixture(testdir):
"""Make sure that pytest accepts the `cookies` fixture."""
# create a temporary pytest test module
testdir.makepyfile("""
def test_valid_fixture(cookies):
assert hasattr(cookies, 'bake')
assert calla... | # -*- coding: utf-8 -*-
def test_cookies_fixture(testdir):
"""Make sure that pytest accepts the `cookies` fixture."""
# create a temporary pytest test module
testdir.makepyfile("""
def test_valid_fixture(cookies):
assert hasattr(cookies, 'bake')
assert callable(cookies.bak... | # -*- coding: utf-8 -*-
def test_cookies_fixture(testdir):
"""Make sure that pytest accepts the `cookies` fixture."""
# create a temporary pytest test module
testdir.makepyfile("""
def test_valid_fixture(cookies):
assert hasattr(cookies, 'bake')
assert callable(cookies.bak... | <commit_before># -*- coding: utf-8 -*-
def test_cookies_fixture(testdir):
"""Make sure that pytest accepts the `cookies` fixture."""
# create a temporary pytest test module
testdir.makepyfile("""
def test_valid_fixture(cookies):
assert hasattr(cookies, 'bake')
assert calla... |
e8bb81a8be7c76c2e1839d8315bd29f381fea4ae | enable/__init__.py | enable/__init__.py | # Copyright (c) 2007-2013 by Enthought, Inc.
# All rights reserved.
""" A multi-platform object drawing library.
Part of the Enable project of the Enthought Tool Suite.
"""
__version__ = '4.3.0'
__requires__ = [
'traitsui',
'PIL',
]
| # Copyright (c) 2007-2013 by Enthought, Inc.
# All rights reserved.
""" A multi-platform object drawing library.
Part of the Enable project of the Enthought Tool Suite.
"""
__version__ = '4.3.0'
__requires__ = [
'traitsui',
'PIL',
'casuarius',
]
| Add casuarius to the list of required packages. | Add casuarius to the list of required packages.
| Python | bsd-3-clause | tommy-u/enable,tommy-u/enable,tommy-u/enable,tommy-u/enable | # Copyright (c) 2007-2013 by Enthought, Inc.
# All rights reserved.
""" A multi-platform object drawing library.
Part of the Enable project of the Enthought Tool Suite.
"""
__version__ = '4.3.0'
__requires__ = [
'traitsui',
'PIL',
]
Add casuarius to the list of required packages. | # Copyright (c) 2007-2013 by Enthought, Inc.
# All rights reserved.
""" A multi-platform object drawing library.
Part of the Enable project of the Enthought Tool Suite.
"""
__version__ = '4.3.0'
__requires__ = [
'traitsui',
'PIL',
'casuarius',
]
| <commit_before># Copyright (c) 2007-2013 by Enthought, Inc.
# All rights reserved.
""" A multi-platform object drawing library.
Part of the Enable project of the Enthought Tool Suite.
"""
__version__ = '4.3.0'
__requires__ = [
'traitsui',
'PIL',
]
<commit_msg>Add casuarius to the list of required package... | # Copyright (c) 2007-2013 by Enthought, Inc.
# All rights reserved.
""" A multi-platform object drawing library.
Part of the Enable project of the Enthought Tool Suite.
"""
__version__ = '4.3.0'
__requires__ = [
'traitsui',
'PIL',
'casuarius',
]
| # Copyright (c) 2007-2013 by Enthought, Inc.
# All rights reserved.
""" A multi-platform object drawing library.
Part of the Enable project of the Enthought Tool Suite.
"""
__version__ = '4.3.0'
__requires__ = [
'traitsui',
'PIL',
]
Add casuarius to the list of required packages.# Copyright (c) 2007-201... | <commit_before># Copyright (c) 2007-2013 by Enthought, Inc.
# All rights reserved.
""" A multi-platform object drawing library.
Part of the Enable project of the Enthought Tool Suite.
"""
__version__ = '4.3.0'
__requires__ = [
'traitsui',
'PIL',
]
<commit_msg>Add casuarius to the list of required package... |
072497f0032bae261e78e27daf6c8e6caeea68c1 | ANN.py | ANN.py | import tensorflow as tf
class ANN:
def __init__(self):
self.inputNodes = 7
self.hiddenNodes = 64
self.hiddenNodes2 = 32 # weight3
self.outputNodes = 1
self.x = tf.placeholder("float", shape=[None, self.inputNodes], name="sensor-input")
self.W1 = tf.placeholder("fl... | import tensorflow as tf
class ANN:
def __init__(self):
self.inputNodes = 7
self.hiddenNodes = 64
self.hiddenNodes2 = 64 # weight3
self.outputNodes = 1
self.x = tf.placeholder("float", shape=[None, self.inputNodes], name="sensor-input")
self.W1 = tf.placeholder("fl... | Change 2nd hidden layer size | Change 2nd hidden layer size
| Python | mit | DiamondOperators/selfdriving-car | import tensorflow as tf
class ANN:
def __init__(self):
self.inputNodes = 7
self.hiddenNodes = 64
self.hiddenNodes2 = 32 # weight3
self.outputNodes = 1
self.x = tf.placeholder("float", shape=[None, self.inputNodes], name="sensor-input")
self.W1 = tf.placeholder("fl... | import tensorflow as tf
class ANN:
def __init__(self):
self.inputNodes = 7
self.hiddenNodes = 64
self.hiddenNodes2 = 64 # weight3
self.outputNodes = 1
self.x = tf.placeholder("float", shape=[None, self.inputNodes], name="sensor-input")
self.W1 = tf.placeholder("fl... | <commit_before>import tensorflow as tf
class ANN:
def __init__(self):
self.inputNodes = 7
self.hiddenNodes = 64
self.hiddenNodes2 = 32 # weight3
self.outputNodes = 1
self.x = tf.placeholder("float", shape=[None, self.inputNodes], name="sensor-input")
self.W1 = tf.... | import tensorflow as tf
class ANN:
def __init__(self):
self.inputNodes = 7
self.hiddenNodes = 64
self.hiddenNodes2 = 64 # weight3
self.outputNodes = 1
self.x = tf.placeholder("float", shape=[None, self.inputNodes], name="sensor-input")
self.W1 = tf.placeholder("fl... | import tensorflow as tf
class ANN:
def __init__(self):
self.inputNodes = 7
self.hiddenNodes = 64
self.hiddenNodes2 = 32 # weight3
self.outputNodes = 1
self.x = tf.placeholder("float", shape=[None, self.inputNodes], name="sensor-input")
self.W1 = tf.placeholder("fl... | <commit_before>import tensorflow as tf
class ANN:
def __init__(self):
self.inputNodes = 7
self.hiddenNodes = 64
self.hiddenNodes2 = 32 # weight3
self.outputNodes = 1
self.x = tf.placeholder("float", shape=[None, self.inputNodes], name="sensor-input")
self.W1 = tf.... |
f9ba5e64f73c3fa3fed62655c846fb4435d627cc | node/multi_var.py | node/multi_var.py |
from nodes import Node
class MultiVar(Node):
char = "'"
args = 0
results = None
contents = -1
def __init__(self, node_1: Node.NodeSingle, node_2: Node.NodeSingle):
self.node_1 = node_1
self.node_2 = node_2
self.args = max([node_1.args, node_2.args])
def pr... |
from nodes import Node
class MultiVar(Node):
char = "'"
args = 0
results = None
contents = -1
def __init__(self, node_1: Node.NodeSingle, node_2: Node.NodeSingle):
self.node_1 = node_1
self.node_2 = node_2
def prepare(self, stack):
self.node_1.prepare(stac... | Fix multivar for nodes with variable lenght stacks | Fix multivar for nodes with variable lenght stacks
| Python | mit | muddyfish/PYKE,muddyfish/PYKE |
from nodes import Node
class MultiVar(Node):
char = "'"
args = 0
results = None
contents = -1
def __init__(self, node_1: Node.NodeSingle, node_2: Node.NodeSingle):
self.node_1 = node_1
self.node_2 = node_2
self.args = max([node_1.args, node_2.args])
def pr... |
from nodes import Node
class MultiVar(Node):
char = "'"
args = 0
results = None
contents = -1
def __init__(self, node_1: Node.NodeSingle, node_2: Node.NodeSingle):
self.node_1 = node_1
self.node_2 = node_2
def prepare(self, stack):
self.node_1.prepare(stac... | <commit_before>
from nodes import Node
class MultiVar(Node):
char = "'"
args = 0
results = None
contents = -1
def __init__(self, node_1: Node.NodeSingle, node_2: Node.NodeSingle):
self.node_1 = node_1
self.node_2 = node_2
self.args = max([node_1.args, node_2.args])
... |
from nodes import Node
class MultiVar(Node):
char = "'"
args = 0
results = None
contents = -1
def __init__(self, node_1: Node.NodeSingle, node_2: Node.NodeSingle):
self.node_1 = node_1
self.node_2 = node_2
def prepare(self, stack):
self.node_1.prepare(stac... |
from nodes import Node
class MultiVar(Node):
char = "'"
args = 0
results = None
contents = -1
def __init__(self, node_1: Node.NodeSingle, node_2: Node.NodeSingle):
self.node_1 = node_1
self.node_2 = node_2
self.args = max([node_1.args, node_2.args])
def pr... | <commit_before>
from nodes import Node
class MultiVar(Node):
char = "'"
args = 0
results = None
contents = -1
def __init__(self, node_1: Node.NodeSingle, node_2: Node.NodeSingle):
self.node_1 = node_1
self.node_2 = node_2
self.args = max([node_1.args, node_2.args])
... |
253a375af742699ec4a13e5d8b33e669691ed872 | mysite/urls.py | mysite/urls.py | from __future__ import print_function
from cms.sitemaps import CMSSitemap
from django.conf.urls import * # NOQA
from django.conf.urls.i18n import i18n_patterns
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.conf import settings
admin.autodiscover()
ur... | from __future__ import print_function
from cms.sitemaps import CMSSitemap
from django.conf.urls import * # NOQA
from django.conf.urls.i18n import i18n_patterns
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.conf import settings
admin.autodiscover()
ur... | Remove lab_members/ from project URLs | Remove lab_members/ from project URLs
| Python | bsd-3-clause | mfcovington/djangocms-lab-members,mfcovington/djangocms-lab-members | from __future__ import print_function
from cms.sitemaps import CMSSitemap
from django.conf.urls import * # NOQA
from django.conf.urls.i18n import i18n_patterns
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.conf import settings
admin.autodiscover()
ur... | from __future__ import print_function
from cms.sitemaps import CMSSitemap
from django.conf.urls import * # NOQA
from django.conf.urls.i18n import i18n_patterns
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.conf import settings
admin.autodiscover()
ur... | <commit_before>from __future__ import print_function
from cms.sitemaps import CMSSitemap
from django.conf.urls import * # NOQA
from django.conf.urls.i18n import i18n_patterns
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.conf import settings
admin.aut... | from __future__ import print_function
from cms.sitemaps import CMSSitemap
from django.conf.urls import * # NOQA
from django.conf.urls.i18n import i18n_patterns
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.conf import settings
admin.autodiscover()
ur... | from __future__ import print_function
from cms.sitemaps import CMSSitemap
from django.conf.urls import * # NOQA
from django.conf.urls.i18n import i18n_patterns
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.conf import settings
admin.autodiscover()
ur... | <commit_before>from __future__ import print_function
from cms.sitemaps import CMSSitemap
from django.conf.urls import * # NOQA
from django.conf.urls.i18n import i18n_patterns
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.conf import settings
admin.aut... |
e178cfd7b6abba804d8bb856a0c35a6f87209771 | opentreemap/treemap/tests/ui/ui_test_urls.py | opentreemap/treemap/tests/ui/ui_test_urls.py | from django.conf.urls import patterns, include, url
from django.http import HttpResponse
from opentreemap import urls
testing_id = 1
def full_utf8_grid(request):
"""
Creates a big utf8 grid where every entry is 'turned on'
to point to whatever plot id is the currently assigned value
of testing_id
... | from django.conf.urls import patterns, include, url
from django.http import HttpResponse
from opentreemap import urls
testing_id = 1
def full_utf8_grid(request):
"""
Creates a big utf8 grid where every entry is 'turned on'
to point to whatever plot id is the currently assigned value
of testing_id
... | Use "id" instead of "plot_id" | Use "id" instead of "plot_id"
For the fake utf grid
| Python | agpl-3.0 | clever-crow-consulting/otm-core,recklessromeo/otm-core,RickMohr/otm-core,clever-crow-consulting/otm-core,RickMohr/otm-core,recklessromeo/otm-core,recklessromeo/otm-core,recklessromeo/otm-core,maurizi/otm-core,RickMohr/otm-core,RickMohr/otm-core,maurizi/otm-core,maurizi/otm-core,clever-crow-consulting/otm-core,maurizi/o... | from django.conf.urls import patterns, include, url
from django.http import HttpResponse
from opentreemap import urls
testing_id = 1
def full_utf8_grid(request):
"""
Creates a big utf8 grid where every entry is 'turned on'
to point to whatever plot id is the currently assigned value
of testing_id
... | from django.conf.urls import patterns, include, url
from django.http import HttpResponse
from opentreemap import urls
testing_id = 1
def full_utf8_grid(request):
"""
Creates a big utf8 grid where every entry is 'turned on'
to point to whatever plot id is the currently assigned value
of testing_id
... | <commit_before>from django.conf.urls import patterns, include, url
from django.http import HttpResponse
from opentreemap import urls
testing_id = 1
def full_utf8_grid(request):
"""
Creates a big utf8 grid where every entry is 'turned on'
to point to whatever plot id is the currently assigned value
... | from django.conf.urls import patterns, include, url
from django.http import HttpResponse
from opentreemap import urls
testing_id = 1
def full_utf8_grid(request):
"""
Creates a big utf8 grid where every entry is 'turned on'
to point to whatever plot id is the currently assigned value
of testing_id
... | from django.conf.urls import patterns, include, url
from django.http import HttpResponse
from opentreemap import urls
testing_id = 1
def full_utf8_grid(request):
"""
Creates a big utf8 grid where every entry is 'turned on'
to point to whatever plot id is the currently assigned value
of testing_id
... | <commit_before>from django.conf.urls import patterns, include, url
from django.http import HttpResponse
from opentreemap import urls
testing_id = 1
def full_utf8_grid(request):
"""
Creates a big utf8 grid where every entry is 'turned on'
to point to whatever plot id is the currently assigned value
... |
1501510e37722a2b68871d44c431ac8c44060e1e | logster/scanner.py | logster/scanner.py | import os
import pymongo
from .db import connect_to_db
files_to_check = [
'/home/irvind/test.log',
'/home/irvind/test2.log'
]
def run_scanner():
_, db = connect_to_db(async=False)
while True:
try:
pass
except KeyboardInterrupt:
break
| import os
import datetime
import time
import hashlib
from datetime import datetime
import pymongo
from .db import connect_to_db
def file_mtime(path):
return datetime.fromtimestamp(os.stat(path).st_mtime)
def md5_hex(data):
# todo
pass
def run_scanner():
_, db = connect_to_db(async=False)
... | Monitor new records and add them to the database | [wip] Monitor new records and add them to the database
| Python | mit | irvind/logster,irvind/logster,irvind/logster | import os
import pymongo
from .db import connect_to_db
files_to_check = [
'/home/irvind/test.log',
'/home/irvind/test2.log'
]
def run_scanner():
_, db = connect_to_db(async=False)
while True:
try:
pass
except KeyboardInterrupt:
break
[wip] Monitor new record... | import os
import datetime
import time
import hashlib
from datetime import datetime
import pymongo
from .db import connect_to_db
def file_mtime(path):
return datetime.fromtimestamp(os.stat(path).st_mtime)
def md5_hex(data):
# todo
pass
def run_scanner():
_, db = connect_to_db(async=False)
... | <commit_before>import os
import pymongo
from .db import connect_to_db
files_to_check = [
'/home/irvind/test.log',
'/home/irvind/test2.log'
]
def run_scanner():
_, db = connect_to_db(async=False)
while True:
try:
pass
except KeyboardInterrupt:
break
<commit_m... | import os
import datetime
import time
import hashlib
from datetime import datetime
import pymongo
from .db import connect_to_db
def file_mtime(path):
return datetime.fromtimestamp(os.stat(path).st_mtime)
def md5_hex(data):
# todo
pass
def run_scanner():
_, db = connect_to_db(async=False)
... | import os
import pymongo
from .db import connect_to_db
files_to_check = [
'/home/irvind/test.log',
'/home/irvind/test2.log'
]
def run_scanner():
_, db = connect_to_db(async=False)
while True:
try:
pass
except KeyboardInterrupt:
break
[wip] Monitor new record... | <commit_before>import os
import pymongo
from .db import connect_to_db
files_to_check = [
'/home/irvind/test.log',
'/home/irvind/test2.log'
]
def run_scanner():
_, db = connect_to_db(async=False)
while True:
try:
pass
except KeyboardInterrupt:
break
<commit_m... |
5e0dde9e6bb6dc8f24c4eb47e63c5dd68ede809c | pontoon/administration/tasks.py | pontoon/administration/tasks.py |
import commonware
from celery.task import task
from pontoon.base.models import Project
from pontoon.administration.views import _update_from_repository
log = commonware.log.getLogger('pontoon')
@task()
def update_projects_from_repository():
for project in Project.objects.all():
try:
reposi... |
import commonware
import os
from celery.task import task
from django.conf import settings
from pontoon.base.models import Project
from pontoon.administration.views import _update_from_repository
log = commonware.log.getLogger('pontoon')
@task()
def update_projects_from_repository():
for project in Project.obj... | Use master path as the argument, which is crucial for single-locale repositories | Use master path as the argument, which is crucial for single-locale repositories
| Python | bsd-3-clause | yfdyh000/pontoon,sudheesh001/pontoon,mozilla/pontoon,m8ttyB/pontoon,mathjazz/pontoon,participedia/pontoon,sudheesh001/pontoon,Jobava/mirror-pontoon,yfdyh000/pontoon,vivekanand1101/pontoon,jotes/pontoon,m8ttyB/pontoon,yfdyh000/pontoon,mozilla/pontoon,Jobava/mirror-pontoon,participedia/pontoon,Jobava/mirror-pontoon,sudhe... |
import commonware
from celery.task import task
from pontoon.base.models import Project
from pontoon.administration.views import _update_from_repository
log = commonware.log.getLogger('pontoon')
@task()
def update_projects_from_repository():
for project in Project.objects.all():
try:
reposi... |
import commonware
import os
from celery.task import task
from django.conf import settings
from pontoon.base.models import Project
from pontoon.administration.views import _update_from_repository
log = commonware.log.getLogger('pontoon')
@task()
def update_projects_from_repository():
for project in Project.obj... | <commit_before>
import commonware
from celery.task import task
from pontoon.base.models import Project
from pontoon.administration.views import _update_from_repository
log = commonware.log.getLogger('pontoon')
@task()
def update_projects_from_repository():
for project in Project.objects.all():
try:
... |
import commonware
import os
from celery.task import task
from django.conf import settings
from pontoon.base.models import Project
from pontoon.administration.views import _update_from_repository
log = commonware.log.getLogger('pontoon')
@task()
def update_projects_from_repository():
for project in Project.obj... |
import commonware
from celery.task import task
from pontoon.base.models import Project
from pontoon.administration.views import _update_from_repository
log = commonware.log.getLogger('pontoon')
@task()
def update_projects_from_repository():
for project in Project.objects.all():
try:
reposi... | <commit_before>
import commonware
from celery.task import task
from pontoon.base.models import Project
from pontoon.administration.views import _update_from_repository
log = commonware.log.getLogger('pontoon')
@task()
def update_projects_from_repository():
for project in Project.objects.all():
try:
... |
e089a75174c003b4d22c4a2f8d65f3adb3d84def | feedback/models.py | feedback/models.py | from django.db import models
from django.contrib.sites.models import Site
from django.utils.translation import ugettext as _
class Feedback(models.Model):
site = models.ForeignKey(Site, verbose_name=_('site'))
url = models.CharField(max_length=255, verbose_name=_('url'))
urlhash = models.TextField(verbose... | from django.db import models
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _
class Feedback(models.Model):
site = models.ForeignKey(Site, verbose_name=_('site'))
url = models.CharField(max_length=255, verbose_name=_('url'))
urlhash = models.TextField(ve... | Use ugettext_lazy instead of ugettext to support Django 1.7 migrations | Use ugettext_lazy instead of ugettext to support Django 1.7 migrations
| Python | mit | PetrDlouhy/django-feedback,jaredly/django-feedback,jaredly/django-feedback,PetrDlouhy/django-feedback,PetrDlouhy/django-feedback,jaredly/django-feedback | from django.db import models
from django.contrib.sites.models import Site
from django.utils.translation import ugettext as _
class Feedback(models.Model):
site = models.ForeignKey(Site, verbose_name=_('site'))
url = models.CharField(max_length=255, verbose_name=_('url'))
urlhash = models.TextField(verbose... | from django.db import models
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _
class Feedback(models.Model):
site = models.ForeignKey(Site, verbose_name=_('site'))
url = models.CharField(max_length=255, verbose_name=_('url'))
urlhash = models.TextField(ve... | <commit_before>from django.db import models
from django.contrib.sites.models import Site
from django.utils.translation import ugettext as _
class Feedback(models.Model):
site = models.ForeignKey(Site, verbose_name=_('site'))
url = models.CharField(max_length=255, verbose_name=_('url'))
urlhash = models.Te... | from django.db import models
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _
class Feedback(models.Model):
site = models.ForeignKey(Site, verbose_name=_('site'))
url = models.CharField(max_length=255, verbose_name=_('url'))
urlhash = models.TextField(ve... | from django.db import models
from django.contrib.sites.models import Site
from django.utils.translation import ugettext as _
class Feedback(models.Model):
site = models.ForeignKey(Site, verbose_name=_('site'))
url = models.CharField(max_length=255, verbose_name=_('url'))
urlhash = models.TextField(verbose... | <commit_before>from django.db import models
from django.contrib.sites.models import Site
from django.utils.translation import ugettext as _
class Feedback(models.Model):
site = models.ForeignKey(Site, verbose_name=_('site'))
url = models.CharField(max_length=255, verbose_name=_('url'))
urlhash = models.Te... |
fcc9a8ed53385f4cf9ca7f1bb73fdc7407b88b7f | pryvate/blueprints/simple/simple.py | pryvate/blueprints/simple/simple.py | """Simple blueprint."""
import os
from flask import Blueprint, current_app, render_template
blueprint = Blueprint('simple', __name__, url_prefix='/simple',
template_folder='templates')
@blueprint.route('', methods=['GET'])
def get_simple():
"""List all packages."""
packages = os.listdir(c... | """Simple blueprint."""
import os
from flask import Blueprint, current_app, render_template
blueprint = Blueprint('simple', __name__, url_prefix='/simple',
template_folder='templates')
@blueprint.route('', methods=['GET'])
def get_simple():
"""List all packages."""
packages = os.listdir(c... | Use only lowercase letters in the source link as well | Use only lowercase letters in the source link as well
| Python | mit | Dinoshauer/pryvate,Dinoshauer/pryvate | """Simple blueprint."""
import os
from flask import Blueprint, current_app, render_template
blueprint = Blueprint('simple', __name__, url_prefix='/simple',
template_folder='templates')
@blueprint.route('', methods=['GET'])
def get_simple():
"""List all packages."""
packages = os.listdir(c... | """Simple blueprint."""
import os
from flask import Blueprint, current_app, render_template
blueprint = Blueprint('simple', __name__, url_prefix='/simple',
template_folder='templates')
@blueprint.route('', methods=['GET'])
def get_simple():
"""List all packages."""
packages = os.listdir(c... | <commit_before>"""Simple blueprint."""
import os
from flask import Blueprint, current_app, render_template
blueprint = Blueprint('simple', __name__, url_prefix='/simple',
template_folder='templates')
@blueprint.route('', methods=['GET'])
def get_simple():
"""List all packages."""
packages... | """Simple blueprint."""
import os
from flask import Blueprint, current_app, render_template
blueprint = Blueprint('simple', __name__, url_prefix='/simple',
template_folder='templates')
@blueprint.route('', methods=['GET'])
def get_simple():
"""List all packages."""
packages = os.listdir(c... | """Simple blueprint."""
import os
from flask import Blueprint, current_app, render_template
blueprint = Blueprint('simple', __name__, url_prefix='/simple',
template_folder='templates')
@blueprint.route('', methods=['GET'])
def get_simple():
"""List all packages."""
packages = os.listdir(c... | <commit_before>"""Simple blueprint."""
import os
from flask import Blueprint, current_app, render_template
blueprint = Blueprint('simple', __name__, url_prefix='/simple',
template_folder='templates')
@blueprint.route('', methods=['GET'])
def get_simple():
"""List all packages."""
packages... |
ee349a7e26579ec6dffc3153fb8d55fad3281c5b | app.py | app.py | #!/usr/bin/env python
from flask import Flask, abort, jsonify, request
from icalendar import Calendar
from urllib import urlopen
app = Flask(__name__)
@app.route('/')
def index():
return u'Please use like <code>%swww.myserver.com/path/to/file.ics' % request.host_url
@app.route('/<path:url>')
def convert_from_ur... | #!/usr/bin/env python
from flask import Flask, abort, jsonify, request
from icalendar import Calendar
from urllib import urlopen
app = Flask(__name__)
@app.route('/')
def index():
return u'Please use like <code>http://<script>document.write(location.host);</script><noscript>ical2json.ep.io</noscript>/www.myserve... | Fix index page example URL. | Fix index page example URL.
| Python | mit | philippbosch/ical2json | #!/usr/bin/env python
from flask import Flask, abort, jsonify, request
from icalendar import Calendar
from urllib import urlopen
app = Flask(__name__)
@app.route('/')
def index():
return u'Please use like <code>%swww.myserver.com/path/to/file.ics' % request.host_url
@app.route('/<path:url>')
def convert_from_ur... | #!/usr/bin/env python
from flask import Flask, abort, jsonify, request
from icalendar import Calendar
from urllib import urlopen
app = Flask(__name__)
@app.route('/')
def index():
return u'Please use like <code>http://<script>document.write(location.host);</script><noscript>ical2json.ep.io</noscript>/www.myserve... | <commit_before>#!/usr/bin/env python
from flask import Flask, abort, jsonify, request
from icalendar import Calendar
from urllib import urlopen
app = Flask(__name__)
@app.route('/')
def index():
return u'Please use like <code>%swww.myserver.com/path/to/file.ics' % request.host_url
@app.route('/<path:url>')
def ... | #!/usr/bin/env python
from flask import Flask, abort, jsonify, request
from icalendar import Calendar
from urllib import urlopen
app = Flask(__name__)
@app.route('/')
def index():
return u'Please use like <code>http://<script>document.write(location.host);</script><noscript>ical2json.ep.io</noscript>/www.myserve... | #!/usr/bin/env python
from flask import Flask, abort, jsonify, request
from icalendar import Calendar
from urllib import urlopen
app = Flask(__name__)
@app.route('/')
def index():
return u'Please use like <code>%swww.myserver.com/path/to/file.ics' % request.host_url
@app.route('/<path:url>')
def convert_from_ur... | <commit_before>#!/usr/bin/env python
from flask import Flask, abort, jsonify, request
from icalendar import Calendar
from urllib import urlopen
app = Flask(__name__)
@app.route('/')
def index():
return u'Please use like <code>%swww.myserver.com/path/to/file.ics' % request.host_url
@app.route('/<path:url>')
def ... |
5c04957ca44fc43eae034fe389d39b879ec000ae | slideshow/event.py | slideshow/event.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import types
_subscribers = {}
class func:
def __init__(self, inst, method):
self._inst = inst
self._method = method
def __call__(self, *args, **kwargs):
# bind method to class instance
types.MethodType(self._method, self._ins... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import types
import cherrypy
_subscribers = {}
class func:
def __init__(self, inst, method, cls):
self._inst = inst
self._method = method
self._cls = cls
def __call__(self, *args, **kwargs):
# bind method to class instance
... | Add logging and some minor error handling. | Add logging and some minor error handling.
| Python | agpl-3.0 | ext/slideshow-frontend,ext/slideshow,ext/slideshow-frontend,ext/slideshow,ext/slideshow,ext/slideshow,ext/slideshow-frontend,ext/slideshow,ext/slideshow | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import types
_subscribers = {}
class func:
def __init__(self, inst, method):
self._inst = inst
self._method = method
def __call__(self, *args, **kwargs):
# bind method to class instance
types.MethodType(self._method, self._ins... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import types
import cherrypy
_subscribers = {}
class func:
def __init__(self, inst, method, cls):
self._inst = inst
self._method = method
self._cls = cls
def __call__(self, *args, **kwargs):
# bind method to class instance
... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import types
_subscribers = {}
class func:
def __init__(self, inst, method):
self._inst = inst
self._method = method
def __call__(self, *args, **kwargs):
# bind method to class instance
types.MethodType(self._me... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import types
import cherrypy
_subscribers = {}
class func:
def __init__(self, inst, method, cls):
self._inst = inst
self._method = method
self._cls = cls
def __call__(self, *args, **kwargs):
# bind method to class instance
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import types
_subscribers = {}
class func:
def __init__(self, inst, method):
self._inst = inst
self._method = method
def __call__(self, *args, **kwargs):
# bind method to class instance
types.MethodType(self._method, self._ins... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import types
_subscribers = {}
class func:
def __init__(self, inst, method):
self._inst = inst
self._method = method
def __call__(self, *args, **kwargs):
# bind method to class instance
types.MethodType(self._me... |
ea8f2c3b036ff62ea2fa7faea6eefc86ac5471c7 | redis_sessions_fork/settings.py | redis_sessions_fork/settings.py | import os
from django.conf import settings
SESSION_REDIS_HOST = getattr(
settings,
'SESSION_REDIS_HOST',
'127.0.0.1'
)
SESSION_REDIS_PORT = getattr(
settings,
'SESSION_REDIS_PORT',
6379
)
SESSION_REDIS_DB = getattr(
settings,
'SESSION_REDIS_DB',
0
)
SESSION_REDIS_PREFIX = getattr(... | import os
from django.conf import settings
SESSION_REDIS_HOST = getattr(
settings,
'SESSION_REDIS_HOST',
'127.0.0.1'
)
SESSION_REDIS_PORT = getattr(
settings,
'SESSION_REDIS_PORT',
6379
)
SESSION_REDIS_DB = getattr(
settings,
'SESSION_REDIS_DB',
0
)
SESSION_REDIS_PREFIX = getattr(... | Reorder ENV urls redis providers. | Reorder ENV urls redis providers.
| Python | bsd-3-clause | ProDG/django-redis-sessions-fork,hellysmile/django-redis-sessions-fork | import os
from django.conf import settings
SESSION_REDIS_HOST = getattr(
settings,
'SESSION_REDIS_HOST',
'127.0.0.1'
)
SESSION_REDIS_PORT = getattr(
settings,
'SESSION_REDIS_PORT',
6379
)
SESSION_REDIS_DB = getattr(
settings,
'SESSION_REDIS_DB',
0
)
SESSION_REDIS_PREFIX = getattr(... | import os
from django.conf import settings
SESSION_REDIS_HOST = getattr(
settings,
'SESSION_REDIS_HOST',
'127.0.0.1'
)
SESSION_REDIS_PORT = getattr(
settings,
'SESSION_REDIS_PORT',
6379
)
SESSION_REDIS_DB = getattr(
settings,
'SESSION_REDIS_DB',
0
)
SESSION_REDIS_PREFIX = getattr(... | <commit_before>import os
from django.conf import settings
SESSION_REDIS_HOST = getattr(
settings,
'SESSION_REDIS_HOST',
'127.0.0.1'
)
SESSION_REDIS_PORT = getattr(
settings,
'SESSION_REDIS_PORT',
6379
)
SESSION_REDIS_DB = getattr(
settings,
'SESSION_REDIS_DB',
0
)
SESSION_REDIS_PR... | import os
from django.conf import settings
SESSION_REDIS_HOST = getattr(
settings,
'SESSION_REDIS_HOST',
'127.0.0.1'
)
SESSION_REDIS_PORT = getattr(
settings,
'SESSION_REDIS_PORT',
6379
)
SESSION_REDIS_DB = getattr(
settings,
'SESSION_REDIS_DB',
0
)
SESSION_REDIS_PREFIX = getattr(... | import os
from django.conf import settings
SESSION_REDIS_HOST = getattr(
settings,
'SESSION_REDIS_HOST',
'127.0.0.1'
)
SESSION_REDIS_PORT = getattr(
settings,
'SESSION_REDIS_PORT',
6379
)
SESSION_REDIS_DB = getattr(
settings,
'SESSION_REDIS_DB',
0
)
SESSION_REDIS_PREFIX = getattr(... | <commit_before>import os
from django.conf import settings
SESSION_REDIS_HOST = getattr(
settings,
'SESSION_REDIS_HOST',
'127.0.0.1'
)
SESSION_REDIS_PORT = getattr(
settings,
'SESSION_REDIS_PORT',
6379
)
SESSION_REDIS_DB = getattr(
settings,
'SESSION_REDIS_DB',
0
)
SESSION_REDIS_PR... |
5082354efec86bb0ebb111e51c8e5a039ab7ae88 | pypika/dialects.py | pypika/dialects.py | from .enums import Dialects
from .queries import (
Query,
QueryBuilder,
)
class MySQLQuery(Query):
"""
Defines a query class for use with MySQL.
"""
@classmethod
def _builder(cls):
return QueryBuilder(quote_char='`', dialect=Dialects.MYSQL, wrap_union_queries=False)
class Vertic... | from .enums import Dialects
from .queries import (
Query,
QueryBuilder,
)
class MySQLQuery(Query):
"""
Defines a query class for use with MySQL.
"""
@classmethod
def _builder(cls):
return QueryBuilder(quote_char='`', dialect=Dialects.MYSQL, wrap_union_queries=False)
class Vertic... | Disable union wrap for clickhouse | Disable union wrap for clickhouse
| Python | apache-2.0 | kayak/pypika | from .enums import Dialects
from .queries import (
Query,
QueryBuilder,
)
class MySQLQuery(Query):
"""
Defines a query class for use with MySQL.
"""
@classmethod
def _builder(cls):
return QueryBuilder(quote_char='`', dialect=Dialects.MYSQL, wrap_union_queries=False)
class Vertic... | from .enums import Dialects
from .queries import (
Query,
QueryBuilder,
)
class MySQLQuery(Query):
"""
Defines a query class for use with MySQL.
"""
@classmethod
def _builder(cls):
return QueryBuilder(quote_char='`', dialect=Dialects.MYSQL, wrap_union_queries=False)
class Vertic... | <commit_before>from .enums import Dialects
from .queries import (
Query,
QueryBuilder,
)
class MySQLQuery(Query):
"""
Defines a query class for use with MySQL.
"""
@classmethod
def _builder(cls):
return QueryBuilder(quote_char='`', dialect=Dialects.MYSQL, wrap_union_queries=False)... | from .enums import Dialects
from .queries import (
Query,
QueryBuilder,
)
class MySQLQuery(Query):
"""
Defines a query class for use with MySQL.
"""
@classmethod
def _builder(cls):
return QueryBuilder(quote_char='`', dialect=Dialects.MYSQL, wrap_union_queries=False)
class Vertic... | from .enums import Dialects
from .queries import (
Query,
QueryBuilder,
)
class MySQLQuery(Query):
"""
Defines a query class for use with MySQL.
"""
@classmethod
def _builder(cls):
return QueryBuilder(quote_char='`', dialect=Dialects.MYSQL, wrap_union_queries=False)
class Vertic... | <commit_before>from .enums import Dialects
from .queries import (
Query,
QueryBuilder,
)
class MySQLQuery(Query):
"""
Defines a query class for use with MySQL.
"""
@classmethod
def _builder(cls):
return QueryBuilder(quote_char='`', dialect=Dialects.MYSQL, wrap_union_queries=False)... |
b3a9a4a1e451815f15dc35c9b6ec9f7b67387260 | scipy/misc/tests/test_common.py | scipy/misc/tests/test_common.py | from __future__ import division, print_function, absolute_import
import pytest
from numpy.testing import assert_equal, assert_allclose
from scipy._lib._numpy_compat import suppress_warnings
from scipy.misc import pade, logsumexp, face, ascent, electrocardiogram
from scipy.special import logsumexp as sc_logsumexp
de... | from __future__ import division, print_function, absolute_import
import pytest
from numpy.testing import assert_equal, assert_allclose, assert_almost_equal
from scipy._lib._numpy_compat import suppress_warnings
from scipy.misc import pade, logsumexp, face, ascent, electrocardiogram
from scipy.special import logsumexp... | Check mean and STD of returned ECG signal | TST: Check mean and STD of returned ECG signal
| Python | bsd-3-clause | Eric89GXL/scipy,jor-/scipy,andyfaff/scipy,ilayn/scipy,andyfaff/scipy,tylerjereddy/scipy,grlee77/scipy,aarchiba/scipy,arokem/scipy,lhilt/scipy,perimosocordiae/scipy,mdhaber/scipy,rgommers/scipy,matthew-brett/scipy,aeklant/scipy,endolith/scipy,rgommers/scipy,person142/scipy,ilayn/scipy,WarrenWeckesser/scipy,matthew-brett... | from __future__ import division, print_function, absolute_import
import pytest
from numpy.testing import assert_equal, assert_allclose
from scipy._lib._numpy_compat import suppress_warnings
from scipy.misc import pade, logsumexp, face, ascent, electrocardiogram
from scipy.special import logsumexp as sc_logsumexp
de... | from __future__ import division, print_function, absolute_import
import pytest
from numpy.testing import assert_equal, assert_allclose, assert_almost_equal
from scipy._lib._numpy_compat import suppress_warnings
from scipy.misc import pade, logsumexp, face, ascent, electrocardiogram
from scipy.special import logsumexp... | <commit_before>from __future__ import division, print_function, absolute_import
import pytest
from numpy.testing import assert_equal, assert_allclose
from scipy._lib._numpy_compat import suppress_warnings
from scipy.misc import pade, logsumexp, face, ascent, electrocardiogram
from scipy.special import logsumexp as sc... | from __future__ import division, print_function, absolute_import
import pytest
from numpy.testing import assert_equal, assert_allclose, assert_almost_equal
from scipy._lib._numpy_compat import suppress_warnings
from scipy.misc import pade, logsumexp, face, ascent, electrocardiogram
from scipy.special import logsumexp... | from __future__ import division, print_function, absolute_import
import pytest
from numpy.testing import assert_equal, assert_allclose
from scipy._lib._numpy_compat import suppress_warnings
from scipy.misc import pade, logsumexp, face, ascent, electrocardiogram
from scipy.special import logsumexp as sc_logsumexp
de... | <commit_before>from __future__ import division, print_function, absolute_import
import pytest
from numpy.testing import assert_equal, assert_allclose
from scipy._lib._numpy_compat import suppress_warnings
from scipy.misc import pade, logsumexp, face, ascent, electrocardiogram
from scipy.special import logsumexp as sc... |
1ee41f5439f80af139e612591d48cdac5ecfda39 | hiapi/hi.py | hiapi/hi.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hi!\n'
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('-b', '--bind-address',
dest='bind', default='127.0.0.1... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import flask
RESPONSE_CODE = 200
app = flask.Flask(__name__)
@app.route('/')
def hello():
global RESPONSE_CODE
if RESPONSE_CODE == 200:
return 'Hi!\n'
else:
flask.abort(RESPONSE_CODE)
def parse_args():
parser = argparse.A... | Remove uwsgi support, add support for simple alternative responses | Remove uwsgi support, add support for simple alternative responses
| Python | apache-2.0 | GradysGhost/pyhiapi | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hi!\n'
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('-b', '--bind-address',
dest='bind', default='127.0.0.1... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import flask
RESPONSE_CODE = 200
app = flask.Flask(__name__)
@app.route('/')
def hello():
global RESPONSE_CODE
if RESPONSE_CODE == 200:
return 'Hi!\n'
else:
flask.abort(RESPONSE_CODE)
def parse_args():
parser = argparse.A... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hi!\n'
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('-b', '--bind-address',
dest='bind', def... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import flask
RESPONSE_CODE = 200
app = flask.Flask(__name__)
@app.route('/')
def hello():
global RESPONSE_CODE
if RESPONSE_CODE == 200:
return 'Hi!\n'
else:
flask.abort(RESPONSE_CODE)
def parse_args():
parser = argparse.A... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hi!\n'
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('-b', '--bind-address',
dest='bind', default='127.0.0.1... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hi!\n'
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('-b', '--bind-address',
dest='bind', def... |
39b4141ebd939bde649a9dfeb4f4cc832d0f4c39 | solutions/problem_9/solution.py | solutions/problem_9/solution.py | import sys
import os
sys.path.append(os.path.abspath(os.path.dirname('./utils/python')))
from python.decorators import timeit
@timeit
def solution():
n = 1000
for b in xrange(1, n):
for c in xrange(1, n):
a = n - b - c
if (a**2) + (b**2) == (c**2):
return a * b ... | import sys
import os
sys.path.append(os.path.abspath(os.path.dirname('./utils/python')))
from python.utils import timeit
@timeit
def solution():
n = 1000
for b in xrange(1, n):
for c in xrange(1, n):
a = n - b - c
if (a**2) + (b**2) == (c**2):
return a * b * c
... | Fix python import for problem 9 | Fix python import for problem 9
| Python | mit | mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler | import sys
import os
sys.path.append(os.path.abspath(os.path.dirname('./utils/python')))
from python.decorators import timeit
@timeit
def solution():
n = 1000
for b in xrange(1, n):
for c in xrange(1, n):
a = n - b - c
if (a**2) + (b**2) == (c**2):
return a * b ... | import sys
import os
sys.path.append(os.path.abspath(os.path.dirname('./utils/python')))
from python.utils import timeit
@timeit
def solution():
n = 1000
for b in xrange(1, n):
for c in xrange(1, n):
a = n - b - c
if (a**2) + (b**2) == (c**2):
return a * b * c
... | <commit_before>import sys
import os
sys.path.append(os.path.abspath(os.path.dirname('./utils/python')))
from python.decorators import timeit
@timeit
def solution():
n = 1000
for b in xrange(1, n):
for c in xrange(1, n):
a = n - b - c
if (a**2) + (b**2) == (c**2):
... | import sys
import os
sys.path.append(os.path.abspath(os.path.dirname('./utils/python')))
from python.utils import timeit
@timeit
def solution():
n = 1000
for b in xrange(1, n):
for c in xrange(1, n):
a = n - b - c
if (a**2) + (b**2) == (c**2):
return a * b * c
... | import sys
import os
sys.path.append(os.path.abspath(os.path.dirname('./utils/python')))
from python.decorators import timeit
@timeit
def solution():
n = 1000
for b in xrange(1, n):
for c in xrange(1, n):
a = n - b - c
if (a**2) + (b**2) == (c**2):
return a * b ... | <commit_before>import sys
import os
sys.path.append(os.path.abspath(os.path.dirname('./utils/python')))
from python.decorators import timeit
@timeit
def solution():
n = 1000
for b in xrange(1, n):
for c in xrange(1, n):
a = n - b - c
if (a**2) + (b**2) == (c**2):
... |
403bd1cdea0a8d1fae25710a48dc3148fc21ddd9 | bell.py | bell.py | #!/usr/bin/env python
from time import sleep
import subprocess
import httplib, urllib
import RPi.GPIO as GPIO
import config
import logger
GPIO.setmode(GPIO.BCM)
GPIO.setup(config.bell_pin, GPIO.IN)
LOW_PRIORITY = -1
MEDIUM_PRIORITY = 0
HIGH_PRIORITY = 1
log = logger.get(__name__)
def notifyPhones(message, priority... | #!/usr/bin/env python
import logging
import RPi.GPIO as GPIO
from application import logsetup, button, pushover
GPIO.setmode(GPIO.BCM)
GPIO.setup(config.bell_pin, GPIO.IN)
log = logging.getLogger(__name__)
log.info('Doorbell listener Started')
pushover.send('Listener started', pushover.LOW_PRIORITY)
while True:
... | Convert Pi version to use application modules | Convert Pi version to use application modules
| Python | mit | viv/pibell | #!/usr/bin/env python
from time import sleep
import subprocess
import httplib, urllib
import RPi.GPIO as GPIO
import config
import logger
GPIO.setmode(GPIO.BCM)
GPIO.setup(config.bell_pin, GPIO.IN)
LOW_PRIORITY = -1
MEDIUM_PRIORITY = 0
HIGH_PRIORITY = 1
log = logger.get(__name__)
def notifyPhones(message, priority... | #!/usr/bin/env python
import logging
import RPi.GPIO as GPIO
from application import logsetup, button, pushover
GPIO.setmode(GPIO.BCM)
GPIO.setup(config.bell_pin, GPIO.IN)
log = logging.getLogger(__name__)
log.info('Doorbell listener Started')
pushover.send('Listener started', pushover.LOW_PRIORITY)
while True:
... | <commit_before>#!/usr/bin/env python
from time import sleep
import subprocess
import httplib, urllib
import RPi.GPIO as GPIO
import config
import logger
GPIO.setmode(GPIO.BCM)
GPIO.setup(config.bell_pin, GPIO.IN)
LOW_PRIORITY = -1
MEDIUM_PRIORITY = 0
HIGH_PRIORITY = 1
log = logger.get(__name__)
def notifyPhones(me... | #!/usr/bin/env python
import logging
import RPi.GPIO as GPIO
from application import logsetup, button, pushover
GPIO.setmode(GPIO.BCM)
GPIO.setup(config.bell_pin, GPIO.IN)
log = logging.getLogger(__name__)
log.info('Doorbell listener Started')
pushover.send('Listener started', pushover.LOW_PRIORITY)
while True:
... | #!/usr/bin/env python
from time import sleep
import subprocess
import httplib, urllib
import RPi.GPIO as GPIO
import config
import logger
GPIO.setmode(GPIO.BCM)
GPIO.setup(config.bell_pin, GPIO.IN)
LOW_PRIORITY = -1
MEDIUM_PRIORITY = 0
HIGH_PRIORITY = 1
log = logger.get(__name__)
def notifyPhones(message, priority... | <commit_before>#!/usr/bin/env python
from time import sleep
import subprocess
import httplib, urllib
import RPi.GPIO as GPIO
import config
import logger
GPIO.setmode(GPIO.BCM)
GPIO.setup(config.bell_pin, GPIO.IN)
LOW_PRIORITY = -1
MEDIUM_PRIORITY = 0
HIGH_PRIORITY = 1
log = logger.get(__name__)
def notifyPhones(me... |
dde6e451a9e434b980d1ebac84626ec7515485c5 | instruments/bbn.py | instruments/bbn.py | from .instrument import Instrument, VisaInterface
from types import MethodType
class Attenuator(Instrument):
NUM_CHANNELS = 3
"""BBN 3 Channel Instrument"""
def __init__(self, name, resource_name):
super(Attenuator, self).__init__(name, resource_name, interface_type="VISA")
self.interface.... | from .instrument import Instrument, VisaInterface
from types import MethodType
class Attenuator(Instrument):
"""BBN 3 Channel Instrument"""
NUM_CHANNELS = 3
def __init__(self, name, resource_name):
super(Attenuator, self).__init__(name, resource_name, interface_type="VISA")
self.interfac... | Add some channel validity checking to digital attenuator | Add some channel validity checking to digital attenuator
--CAR
| Python | apache-2.0 | BBN-Q/Auspex,BBN-Q/Auspex,BBN-Q/Auspex,BBN-Q/Auspex | from .instrument import Instrument, VisaInterface
from types import MethodType
class Attenuator(Instrument):
NUM_CHANNELS = 3
"""BBN 3 Channel Instrument"""
def __init__(self, name, resource_name):
super(Attenuator, self).__init__(name, resource_name, interface_type="VISA")
self.interface.... | from .instrument import Instrument, VisaInterface
from types import MethodType
class Attenuator(Instrument):
"""BBN 3 Channel Instrument"""
NUM_CHANNELS = 3
def __init__(self, name, resource_name):
super(Attenuator, self).__init__(name, resource_name, interface_type="VISA")
self.interfac... | <commit_before>from .instrument import Instrument, VisaInterface
from types import MethodType
class Attenuator(Instrument):
NUM_CHANNELS = 3
"""BBN 3 Channel Instrument"""
def __init__(self, name, resource_name):
super(Attenuator, self).__init__(name, resource_name, interface_type="VISA")
... | from .instrument import Instrument, VisaInterface
from types import MethodType
class Attenuator(Instrument):
"""BBN 3 Channel Instrument"""
NUM_CHANNELS = 3
def __init__(self, name, resource_name):
super(Attenuator, self).__init__(name, resource_name, interface_type="VISA")
self.interfac... | from .instrument import Instrument, VisaInterface
from types import MethodType
class Attenuator(Instrument):
NUM_CHANNELS = 3
"""BBN 3 Channel Instrument"""
def __init__(self, name, resource_name):
super(Attenuator, self).__init__(name, resource_name, interface_type="VISA")
self.interface.... | <commit_before>from .instrument import Instrument, VisaInterface
from types import MethodType
class Attenuator(Instrument):
NUM_CHANNELS = 3
"""BBN 3 Channel Instrument"""
def __init__(self, name, resource_name):
super(Attenuator, self).__init__(name, resource_name, interface_type="VISA")
... |
cbd39a43d8da9b9fa81582d7e9aaf299631022ae | pytoon/main.py | pytoon/main.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from pytoon.connection import BrickConnection
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///app.db'
app.config['SQLALCHEMY_COMMIT_ON_TEARDOWN'] = True
db = SQLAlchemy(... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from pytoon.connection import BrickConnection
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/app.db'
app.config['SQLALCHEMY_COMMIT_ON_TEARDOWN'] = True
db = SQLAlc... | Fix problem with creating tables | Fix problem with creating tables
| Python | bsd-3-clause | marcofinalist/pytoon,marcofinalist/pytoon,marcoplaisier/pytoon,marcoplaisier/pytoon | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from pytoon.connection import BrickConnection
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///app.db'
app.config['SQLALCHEMY_COMMIT_ON_TEARDOWN'] = True
db = SQLAlchemy(... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from pytoon.connection import BrickConnection
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/app.db'
app.config['SQLALCHEMY_COMMIT_ON_TEARDOWN'] = True
db = SQLAlc... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from pytoon.connection import BrickConnection
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///app.db'
app.config['SQLALCHEMY_COMMIT_ON_TEARDOWN'] = True
d... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from pytoon.connection import BrickConnection
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/app.db'
app.config['SQLALCHEMY_COMMIT_ON_TEARDOWN'] = True
db = SQLAlc... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from pytoon.connection import BrickConnection
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///app.db'
app.config['SQLALCHEMY_COMMIT_ON_TEARDOWN'] = True
db = SQLAlchemy(... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from pytoon.connection import BrickConnection
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///app.db'
app.config['SQLALCHEMY_COMMIT_ON_TEARDOWN'] = True
d... |
3a21d7d174dd8a9cbf76cbf149666337a8352c61 | h5py/_hl/compat.py | h5py/_hl/compat.py | """
Compatibility module for high-level h5py
"""
import sys
from os import fspath, fsencode, fsdecode
WINDOWS_ENCODING = "mbcs"
def filename_encode(filename):
"""
Encode filename for use in the HDF5 library.
Due to how HDF5 handles filenames on different systems, this should be
called on any filenam... | """
Compatibility module for high-level h5py
"""
import sys
from os import fspath, fsencode, fsdecode
from ..version import hdf5_built_version_tuple
WINDOWS_ENCODING = "utf-8" if hdf5_built_version_tuple >= (1, 10, 6) else "mbcs"
def filename_encode(filename):
"""
Encode filename for use in the HDF5 library.... | Use UTF-8 on windows where HDF5 >= 1.10.6 | Use UTF-8 on windows where HDF5 >= 1.10.6
| Python | bsd-3-clause | h5py/h5py,h5py/h5py,h5py/h5py | """
Compatibility module for high-level h5py
"""
import sys
from os import fspath, fsencode, fsdecode
WINDOWS_ENCODING = "mbcs"
def filename_encode(filename):
"""
Encode filename for use in the HDF5 library.
Due to how HDF5 handles filenames on different systems, this should be
called on any filenam... | """
Compatibility module for high-level h5py
"""
import sys
from os import fspath, fsencode, fsdecode
from ..version import hdf5_built_version_tuple
WINDOWS_ENCODING = "utf-8" if hdf5_built_version_tuple >= (1, 10, 6) else "mbcs"
def filename_encode(filename):
"""
Encode filename for use in the HDF5 library.... | <commit_before>"""
Compatibility module for high-level h5py
"""
import sys
from os import fspath, fsencode, fsdecode
WINDOWS_ENCODING = "mbcs"
def filename_encode(filename):
"""
Encode filename for use in the HDF5 library.
Due to how HDF5 handles filenames on different systems, this should be
called... | """
Compatibility module for high-level h5py
"""
import sys
from os import fspath, fsencode, fsdecode
from ..version import hdf5_built_version_tuple
WINDOWS_ENCODING = "utf-8" if hdf5_built_version_tuple >= (1, 10, 6) else "mbcs"
def filename_encode(filename):
"""
Encode filename for use in the HDF5 library.... | """
Compatibility module for high-level h5py
"""
import sys
from os import fspath, fsencode, fsdecode
WINDOWS_ENCODING = "mbcs"
def filename_encode(filename):
"""
Encode filename for use in the HDF5 library.
Due to how HDF5 handles filenames on different systems, this should be
called on any filenam... | <commit_before>"""
Compatibility module for high-level h5py
"""
import sys
from os import fspath, fsencode, fsdecode
WINDOWS_ENCODING = "mbcs"
def filename_encode(filename):
"""
Encode filename for use in the HDF5 library.
Due to how HDF5 handles filenames on different systems, this should be
called... |
35fcaad0474df3352ccdf0545fc34cf2c431761c | tweet_s3_images.py | tweet_s3_images.py | import exifread
import os
class TweetS3Images(object):
def __init__(self, twitter, s3_client):
self._twitter = twitter
self._s3_client = s3_client
self._file = None
def send_image(self, bucket, image_name, cleanup=False):
temp_file = '/tmp/{}'.format(image_name)
self._... | import exifread
import os
class TweetS3Images(object):
def __init__(self, twitter, s3_client):
self._twitter = twitter
self._s3_client = s3_client
self._file = None
def send_image(self, bucket, image_name, cleanup=False):
temp_file = '/tmp/{}'.format(image_name)
self._... | Update class to get image description if available and use it as the update message. | Update class to get image description if available and use it as the update message.
| Python | mit | onema/lambda-tweet | import exifread
import os
class TweetS3Images(object):
def __init__(self, twitter, s3_client):
self._twitter = twitter
self._s3_client = s3_client
self._file = None
def send_image(self, bucket, image_name, cleanup=False):
temp_file = '/tmp/{}'.format(image_name)
self._... | import exifread
import os
class TweetS3Images(object):
def __init__(self, twitter, s3_client):
self._twitter = twitter
self._s3_client = s3_client
self._file = None
def send_image(self, bucket, image_name, cleanup=False):
temp_file = '/tmp/{}'.format(image_name)
self._... | <commit_before>import exifread
import os
class TweetS3Images(object):
def __init__(self, twitter, s3_client):
self._twitter = twitter
self._s3_client = s3_client
self._file = None
def send_image(self, bucket, image_name, cleanup=False):
temp_file = '/tmp/{}'.format(image_name)... | import exifread
import os
class TweetS3Images(object):
def __init__(self, twitter, s3_client):
self._twitter = twitter
self._s3_client = s3_client
self._file = None
def send_image(self, bucket, image_name, cleanup=False):
temp_file = '/tmp/{}'.format(image_name)
self._... | import exifread
import os
class TweetS3Images(object):
def __init__(self, twitter, s3_client):
self._twitter = twitter
self._s3_client = s3_client
self._file = None
def send_image(self, bucket, image_name, cleanup=False):
temp_file = '/tmp/{}'.format(image_name)
self._... | <commit_before>import exifread
import os
class TweetS3Images(object):
def __init__(self, twitter, s3_client):
self._twitter = twitter
self._s3_client = s3_client
self._file = None
def send_image(self, bucket, image_name, cleanup=False):
temp_file = '/tmp/{}'.format(image_name)... |
b096d91564366392c4003b26bafd1e6c3fff47d3 | trayapp.py | trayapp.py |
# Github Tray App
import rumps
import config
import contribs
username = config.get_username()
class GithubTrayApp(rumps.App):
@rumps.timer(60*5)
def timer(self, sender):
count = contribs.get_contribs(username)
self.title = str(count)
@rumps.clicked('Update')
def onoff(self, sender)... |
# Github Tray App
import rumps
import config
import contribs
class GithubTrayApp(rumps.App):
def __init__(self):
super(GithubTrayApp, self).__init__('Github')
self.count = rumps.MenuItem('commits')
self.username = config.get_username()
self.icon = 'github.png'
self.menu =... | Restructure app and display commit count as a disabled menu item | Restructure app and display commit count as a disabled menu item
| Python | mit | chrisfosterelli/commitwatch |
# Github Tray App
import rumps
import config
import contribs
username = config.get_username()
class GithubTrayApp(rumps.App):
@rumps.timer(60*5)
def timer(self, sender):
count = contribs.get_contribs(username)
self.title = str(count)
@rumps.clicked('Update')
def onoff(self, sender)... |
# Github Tray App
import rumps
import config
import contribs
class GithubTrayApp(rumps.App):
def __init__(self):
super(GithubTrayApp, self).__init__('Github')
self.count = rumps.MenuItem('commits')
self.username = config.get_username()
self.icon = 'github.png'
self.menu =... | <commit_before>
# Github Tray App
import rumps
import config
import contribs
username = config.get_username()
class GithubTrayApp(rumps.App):
@rumps.timer(60*5)
def timer(self, sender):
count = contribs.get_contribs(username)
self.title = str(count)
@rumps.clicked('Update')
def onof... |
# Github Tray App
import rumps
import config
import contribs
class GithubTrayApp(rumps.App):
def __init__(self):
super(GithubTrayApp, self).__init__('Github')
self.count = rumps.MenuItem('commits')
self.username = config.get_username()
self.icon = 'github.png'
self.menu =... |
# Github Tray App
import rumps
import config
import contribs
username = config.get_username()
class GithubTrayApp(rumps.App):
@rumps.timer(60*5)
def timer(self, sender):
count = contribs.get_contribs(username)
self.title = str(count)
@rumps.clicked('Update')
def onoff(self, sender)... | <commit_before>
# Github Tray App
import rumps
import config
import contribs
username = config.get_username()
class GithubTrayApp(rumps.App):
@rumps.timer(60*5)
def timer(self, sender):
count = contribs.get_contribs(username)
self.title = str(count)
@rumps.clicked('Update')
def onof... |
b8d3e62bae3559b24a2a135c921ccc9879fab339 | src/py65/memory.py | src/py65/memory.py |
class ObservableMemory:
def __init__(self, subject=None):
if subject is None:
subject = 0x10000 * [0x00]
self._subject = subject
self._read_subscribers = {}
self._write_subscribers = {}
def __setitem__(self, address, value):
callbacks = self._write... |
class ObservableMemory:
def __init__(self, subject=None):
if subject is None:
subject = 0x10000 * [0x00]
self._subject = subject
self._read_subscribers = {}
self._write_subscribers = {}
def __setitem__(self, address, value):
callbacks = self._write... | Use get() instead of setdefault(). | Use get() instead of setdefault().
| Python | bsd-3-clause | mkeller0815/py65,mnaberez/py65 |
class ObservableMemory:
def __init__(self, subject=None):
if subject is None:
subject = 0x10000 * [0x00]
self._subject = subject
self._read_subscribers = {}
self._write_subscribers = {}
def __setitem__(self, address, value):
callbacks = self._write... |
class ObservableMemory:
def __init__(self, subject=None):
if subject is None:
subject = 0x10000 * [0x00]
self._subject = subject
self._read_subscribers = {}
self._write_subscribers = {}
def __setitem__(self, address, value):
callbacks = self._write... | <commit_before>
class ObservableMemory:
def __init__(self, subject=None):
if subject is None:
subject = 0x10000 * [0x00]
self._subject = subject
self._read_subscribers = {}
self._write_subscribers = {}
def __setitem__(self, address, value):
callback... |
class ObservableMemory:
def __init__(self, subject=None):
if subject is None:
subject = 0x10000 * [0x00]
self._subject = subject
self._read_subscribers = {}
self._write_subscribers = {}
def __setitem__(self, address, value):
callbacks = self._write... |
class ObservableMemory:
def __init__(self, subject=None):
if subject is None:
subject = 0x10000 * [0x00]
self._subject = subject
self._read_subscribers = {}
self._write_subscribers = {}
def __setitem__(self, address, value):
callbacks = self._write... | <commit_before>
class ObservableMemory:
def __init__(self, subject=None):
if subject is None:
subject = 0x10000 * [0x00]
self._subject = subject
self._read_subscribers = {}
self._write_subscribers = {}
def __setitem__(self, address, value):
callback... |
f6e42f0f2d931533a9cdcab749feceeb5fa98982 | mopidy/backends/spotify/__init__.py | mopidy/backends/spotify/__init__.py | """A backend for playing music from Spotify
`Spotify <http://www.spotify.com/>`_ is a music streaming service. The backend
uses the official `libspotify
<http://developer.spotify.com/en/libspotify/overview/>`_ library and the
`pyspotify <http://github.com/mopidy/pyspotify/>`_ Python bindings for
libspotify. This backe... | """A backend for playing music from Spotify
`Spotify <http://www.spotify.com/>`_ is a music streaming service. The backend
uses the official `libspotify
<http://developer.spotify.com/en/libspotify/overview/>`_ library and the
`pyspotify <http://github.com/mopidy/pyspotify/>`_ Python bindings for
libspotify. This backe... | Update recommended libspotify and pyspotify version | Update recommended libspotify and pyspotify version
| Python | apache-2.0 | SuperStarPL/mopidy,bacontext/mopidy,priestd09/mopidy,mokieyue/mopidy,hkariti/mopidy,liamw9534/mopidy,adamcik/mopidy,mokieyue/mopidy,rawdlite/mopidy,dbrgn/mopidy,kingosticks/mopidy,mokieyue/mopidy,mopidy/mopidy,SuperStarPL/mopidy,glogiotatidis/mopidy,adamcik/mopidy,rawdlite/mopidy,pacificIT/mopidy,kingosticks/mopidy,hka... | """A backend for playing music from Spotify
`Spotify <http://www.spotify.com/>`_ is a music streaming service. The backend
uses the official `libspotify
<http://developer.spotify.com/en/libspotify/overview/>`_ library and the
`pyspotify <http://github.com/mopidy/pyspotify/>`_ Python bindings for
libspotify. This backe... | """A backend for playing music from Spotify
`Spotify <http://www.spotify.com/>`_ is a music streaming service. The backend
uses the official `libspotify
<http://developer.spotify.com/en/libspotify/overview/>`_ library and the
`pyspotify <http://github.com/mopidy/pyspotify/>`_ Python bindings for
libspotify. This backe... | <commit_before>"""A backend for playing music from Spotify
`Spotify <http://www.spotify.com/>`_ is a music streaming service. The backend
uses the official `libspotify
<http://developer.spotify.com/en/libspotify/overview/>`_ library and the
`pyspotify <http://github.com/mopidy/pyspotify/>`_ Python bindings for
libspot... | """A backend for playing music from Spotify
`Spotify <http://www.spotify.com/>`_ is a music streaming service. The backend
uses the official `libspotify
<http://developer.spotify.com/en/libspotify/overview/>`_ library and the
`pyspotify <http://github.com/mopidy/pyspotify/>`_ Python bindings for
libspotify. This backe... | """A backend for playing music from Spotify
`Spotify <http://www.spotify.com/>`_ is a music streaming service. The backend
uses the official `libspotify
<http://developer.spotify.com/en/libspotify/overview/>`_ library and the
`pyspotify <http://github.com/mopidy/pyspotify/>`_ Python bindings for
libspotify. This backe... | <commit_before>"""A backend for playing music from Spotify
`Spotify <http://www.spotify.com/>`_ is a music streaming service. The backend
uses the official `libspotify
<http://developer.spotify.com/en/libspotify/overview/>`_ library and the
`pyspotify <http://github.com/mopidy/pyspotify/>`_ Python bindings for
libspot... |
87c99c6839d7f74201393066651f3d69a5a2edce | nodeconductor/logging/middleware.py | nodeconductor/logging/middleware.py | from __future__ import unicode_literals
import threading
_locals = threading.local()
def get_event_context():
return getattr(_locals, 'context', None)
def set_event_context(context):
_locals.context = context
def reset_event_context():
if hasattr(_locals, 'context'):
del _locals.context
de... | from __future__ import unicode_literals
import threading
_locals = threading.local()
def get_event_context():
return getattr(_locals, 'context', None)
def set_event_context(context):
_locals.context = context
def reset_event_context():
if hasattr(_locals, 'context'):
del _locals.context
de... | Implement set_current_user for CapturingAuthentication (NC-529) | Implement set_current_user for CapturingAuthentication (NC-529)
| Python | mit | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | from __future__ import unicode_literals
import threading
_locals = threading.local()
def get_event_context():
return getattr(_locals, 'context', None)
def set_event_context(context):
_locals.context = context
def reset_event_context():
if hasattr(_locals, 'context'):
del _locals.context
de... | from __future__ import unicode_literals
import threading
_locals = threading.local()
def get_event_context():
return getattr(_locals, 'context', None)
def set_event_context(context):
_locals.context = context
def reset_event_context():
if hasattr(_locals, 'context'):
del _locals.context
de... | <commit_before>from __future__ import unicode_literals
import threading
_locals = threading.local()
def get_event_context():
return getattr(_locals, 'context', None)
def set_event_context(context):
_locals.context = context
def reset_event_context():
if hasattr(_locals, 'context'):
del _loca... | from __future__ import unicode_literals
import threading
_locals = threading.local()
def get_event_context():
return getattr(_locals, 'context', None)
def set_event_context(context):
_locals.context = context
def reset_event_context():
if hasattr(_locals, 'context'):
del _locals.context
de... | from __future__ import unicode_literals
import threading
_locals = threading.local()
def get_event_context():
return getattr(_locals, 'context', None)
def set_event_context(context):
_locals.context = context
def reset_event_context():
if hasattr(_locals, 'context'):
del _locals.context
de... | <commit_before>from __future__ import unicode_literals
import threading
_locals = threading.local()
def get_event_context():
return getattr(_locals, 'context', None)
def set_event_context(context):
_locals.context = context
def reset_event_context():
if hasattr(_locals, 'context'):
del _loca... |
6183f41cf6fa2125d7d5de626a7b2a994253d4ca | src/levels/main.py | src/levels/main.py | # Copyright 2013 Daniel Stokes, Mitchell Stokes
#
# 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 ... | # Copyright 2013 Daniel Stokes, Mitchell Stokes
#
# 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 ... | Use the src directory instead of the src/levels directory as the cwd. | Use the src directory instead of the src/levels directory as the cwd.
| Python | apache-2.0 | Moguri/ullur,Moguri/ullur | # Copyright 2013 Daniel Stokes, Mitchell Stokes
#
# 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 ... | # Copyright 2013 Daniel Stokes, Mitchell Stokes
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | <commit_before># Copyright 2013 Daniel Stokes, Mitchell Stokes
#
# 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... | # Copyright 2013 Daniel Stokes, Mitchell Stokes
#
# 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 ... | # Copyright 2013 Daniel Stokes, Mitchell Stokes
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | <commit_before># Copyright 2013 Daniel Stokes, Mitchell Stokes
#
# 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... |
3da6393345cca10d44c0823ef6c224a5ceaa4fcd | src/engine/SCons/Platform/darwin.py | src/engine/SCons/Platform/darwin.py | """engine.SCons.Platform.darwin
Platform-specific initialization for Mac OS X systems.
There normally shouldn't be any need to import this module directly. It
will usually be imported through the generic SCons.Platform.Platform()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004 Steven Knight
#
# Permi... | """engine.SCons.Platform.darwin
Platform-specific initialization for Mac OS X systems.
There normally shouldn't be any need to import this module directly. It
will usually be imported through the generic SCons.Platform.Platform()
selection method.
"""
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of char... | Fix __COPYRIGHT__ and __REVISION__ in new Darwin module. | Fix __COPYRIGHT__ and __REVISION__ in new Darwin module.
| Python | mit | azatoth/scons,azatoth/scons,azatoth/scons,azatoth/scons,azatoth/scons | """engine.SCons.Platform.darwin
Platform-specific initialization for Mac OS X systems.
There normally shouldn't be any need to import this module directly. It
will usually be imported through the generic SCons.Platform.Platform()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004 Steven Knight
#
# Permi... | """engine.SCons.Platform.darwin
Platform-specific initialization for Mac OS X systems.
There normally shouldn't be any need to import this module directly. It
will usually be imported through the generic SCons.Platform.Platform()
selection method.
"""
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of char... | <commit_before>"""engine.SCons.Platform.darwin
Platform-specific initialization for Mac OS X systems.
There normally shouldn't be any need to import this module directly. It
will usually be imported through the generic SCons.Platform.Platform()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004 Steven K... | """engine.SCons.Platform.darwin
Platform-specific initialization for Mac OS X systems.
There normally shouldn't be any need to import this module directly. It
will usually be imported through the generic SCons.Platform.Platform()
selection method.
"""
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of char... | """engine.SCons.Platform.darwin
Platform-specific initialization for Mac OS X systems.
There normally shouldn't be any need to import this module directly. It
will usually be imported through the generic SCons.Platform.Platform()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004 Steven Knight
#
# Permi... | <commit_before>"""engine.SCons.Platform.darwin
Platform-specific initialization for Mac OS X systems.
There normally shouldn't be any need to import this module directly. It
will usually be imported through the generic SCons.Platform.Platform()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004 Steven K... |
6480e801de5f21486d99444c25006b70329e580e | luigi/tasks/release/process_data.py | luigi/tasks/release/process_data.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... | Add RGD as part of the regular update pipeline | Add RGD as part of the regular update pipeline
I'm not sure if this will always be part of the update, but it is for at
least for this release.
| 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... |
57a1299e771b97c81249cd3075ff9e7e047356a6 | wikked/__init__.py | wikked/__init__.py | from flask import Flask, abort
# Create the main app.
app = Flask(__name__)
app.config.from_object('wikked.settings')
app.config.from_envvar('WIKKED_SETTINGS', silent=True)
if app.config['DEBUG']:
from werkzeug import SharedDataMiddleware
import os
app.wsgi_app = SharedDataMiddleware(app.wsgi_app, {
... | from flask import Flask, abort
# Create the main app.
app = Flask(__name__)
app.config.from_object('wikked.settings')
app.config.from_envvar('WIKKED_SETTINGS', silent=True)
if app.config['DEBUG']:
from werkzeug import SharedDataMiddleware
import os
app.wsgi_app = SharedDataMiddleware(app.wsgi_app, {
... | Use the settings' wiki root, if any. | Use the settings' wiki root, if any.
| Python | apache-2.0 | ludovicchabant/Wikked,ludovicchabant/Wikked,ludovicchabant/Wikked | from flask import Flask, abort
# Create the main app.
app = Flask(__name__)
app.config.from_object('wikked.settings')
app.config.from_envvar('WIKKED_SETTINGS', silent=True)
if app.config['DEBUG']:
from werkzeug import SharedDataMiddleware
import os
app.wsgi_app = SharedDataMiddleware(app.wsgi_app, {
... | from flask import Flask, abort
# Create the main app.
app = Flask(__name__)
app.config.from_object('wikked.settings')
app.config.from_envvar('WIKKED_SETTINGS', silent=True)
if app.config['DEBUG']:
from werkzeug import SharedDataMiddleware
import os
app.wsgi_app = SharedDataMiddleware(app.wsgi_app, {
... | <commit_before>from flask import Flask, abort
# Create the main app.
app = Flask(__name__)
app.config.from_object('wikked.settings')
app.config.from_envvar('WIKKED_SETTINGS', silent=True)
if app.config['DEBUG']:
from werkzeug import SharedDataMiddleware
import os
app.wsgi_app = SharedDataMiddleware(app.ws... | from flask import Flask, abort
# Create the main app.
app = Flask(__name__)
app.config.from_object('wikked.settings')
app.config.from_envvar('WIKKED_SETTINGS', silent=True)
if app.config['DEBUG']:
from werkzeug import SharedDataMiddleware
import os
app.wsgi_app = SharedDataMiddleware(app.wsgi_app, {
... | from flask import Flask, abort
# Create the main app.
app = Flask(__name__)
app.config.from_object('wikked.settings')
app.config.from_envvar('WIKKED_SETTINGS', silent=True)
if app.config['DEBUG']:
from werkzeug import SharedDataMiddleware
import os
app.wsgi_app = SharedDataMiddleware(app.wsgi_app, {
... | <commit_before>from flask import Flask, abort
# Create the main app.
app = Flask(__name__)
app.config.from_object('wikked.settings')
app.config.from_envvar('WIKKED_SETTINGS', silent=True)
if app.config['DEBUG']:
from werkzeug import SharedDataMiddleware
import os
app.wsgi_app = SharedDataMiddleware(app.ws... |
08d8f2c30c810cda75961e5bf6025f1bf348fc02 | api.py | api.py | from os import environ
from eve import Eve
from settings import API_NAME
api = Eve(API_NAME)
if __name__ == '__main__':
# Heroku support: bind to PORT if defined, otherwise default to 5000.
if 'PORT' in environ:
port = int(environ.get('PORT'))
host = '0.0.0.0'
else:
port = 5000
... | import json
from os import environ
from eve import Eve
from settings import API_NAME, URL_PREFIX
api = Eve(API_NAME)
def add_document(resource, document):
"Add a new document to the given resource."
return api.test_client().post('/' + URL_PREFIX + '/' + resource,
data=json... | Add utility method to add documents | Add utility method to add documents
| Python | apache-2.0 | gwob/Maarifa,gwob/Maarifa,gwob/Maarifa,gwob/Maarifa,gwob/Maarifa | from os import environ
from eve import Eve
from settings import API_NAME
api = Eve(API_NAME)
if __name__ == '__main__':
# Heroku support: bind to PORT if defined, otherwise default to 5000.
if 'PORT' in environ:
port = int(environ.get('PORT'))
host = '0.0.0.0'
else:
port = 5000
... | import json
from os import environ
from eve import Eve
from settings import API_NAME, URL_PREFIX
api = Eve(API_NAME)
def add_document(resource, document):
"Add a new document to the given resource."
return api.test_client().post('/' + URL_PREFIX + '/' + resource,
data=json... | <commit_before>from os import environ
from eve import Eve
from settings import API_NAME
api = Eve(API_NAME)
if __name__ == '__main__':
# Heroku support: bind to PORT if defined, otherwise default to 5000.
if 'PORT' in environ:
port = int(environ.get('PORT'))
host = '0.0.0.0'
else:
... | import json
from os import environ
from eve import Eve
from settings import API_NAME, URL_PREFIX
api = Eve(API_NAME)
def add_document(resource, document):
"Add a new document to the given resource."
return api.test_client().post('/' + URL_PREFIX + '/' + resource,
data=json... | from os import environ
from eve import Eve
from settings import API_NAME
api = Eve(API_NAME)
if __name__ == '__main__':
# Heroku support: bind to PORT if defined, otherwise default to 5000.
if 'PORT' in environ:
port = int(environ.get('PORT'))
host = '0.0.0.0'
else:
port = 5000
... | <commit_before>from os import environ
from eve import Eve
from settings import API_NAME
api = Eve(API_NAME)
if __name__ == '__main__':
# Heroku support: bind to PORT if defined, otherwise default to 5000.
if 'PORT' in environ:
port = int(environ.get('PORT'))
host = '0.0.0.0'
else:
... |
a93607eea32fd5e56de47bf6c7e0e3f098d7bcd8 | runTwircBot.py | runTwircBot.py | #!/usr/bin/env python
from src.TwircBot import TwircBot
import sys
try:
bot = TwircBot(sys.argv[1])
except IndexError:
bot = TwircBot()
bot.print_config()
bot.start()
| #!/usr/bin/env python3
from src.TwircBot import TwircBot
import sys
try:
bot = TwircBot(sys.argv[1])
except IndexError:
bot = TwircBot()
bot.print_config()
bot.start()
| Change shebang to use python3 instead of python | Change shebang to use python3 instead of python
| Python | mit | johnmarcampbell/twircBot | #!/usr/bin/env python
from src.TwircBot import TwircBot
import sys
try:
bot = TwircBot(sys.argv[1])
except IndexError:
bot = TwircBot()
bot.print_config()
bot.start()
Change shebang to use python3 instead of python | #!/usr/bin/env python3
from src.TwircBot import TwircBot
import sys
try:
bot = TwircBot(sys.argv[1])
except IndexError:
bot = TwircBot()
bot.print_config()
bot.start()
| <commit_before>#!/usr/bin/env python
from src.TwircBot import TwircBot
import sys
try:
bot = TwircBot(sys.argv[1])
except IndexError:
bot = TwircBot()
bot.print_config()
bot.start()
<commit_msg>Change shebang to use python3 instead of python<commit_after> | #!/usr/bin/env python3
from src.TwircBot import TwircBot
import sys
try:
bot = TwircBot(sys.argv[1])
except IndexError:
bot = TwircBot()
bot.print_config()
bot.start()
| #!/usr/bin/env python
from src.TwircBot import TwircBot
import sys
try:
bot = TwircBot(sys.argv[1])
except IndexError:
bot = TwircBot()
bot.print_config()
bot.start()
Change shebang to use python3 instead of python#!/usr/bin/env python3
from src.TwircBot import TwircBot
import sys
try:
bot = TwircBot(s... | <commit_before>#!/usr/bin/env python
from src.TwircBot import TwircBot
import sys
try:
bot = TwircBot(sys.argv[1])
except IndexError:
bot = TwircBot()
bot.print_config()
bot.start()
<commit_msg>Change shebang to use python3 instead of python<commit_after>#!/usr/bin/env python3
from src.TwircBot import Twirc... |
dd9161c772e3c345fd21f742b09a62d43f7fa069 | scripts/c19.py | scripts/c19.py | from __future__ import print_function
import sys
from pyspark.sql import SparkSession
from pyspark.sql.functions import lit, col
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: c19.py <input> <output>", file=sys.stderr)
exit(-1)
spark = SparkSession.builder.appName('Select c19... | from __future__ import print_function
import sys
from pyspark.sql import SparkSession
from pyspark.sql.functions import lit, col, datediff
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: c19.py <input> <output>", file=sys.stderr)
exit(-1)
spark = SparkSession.builder.appName('... | Add numeric time column (hour) that respects editions. | Add numeric time column (hour) that respects editions.
| Python | apache-2.0 | ViralTexts/vt-passim,ViralTexts/vt-passim,ViralTexts/vt-passim | from __future__ import print_function
import sys
from pyspark.sql import SparkSession
from pyspark.sql.functions import lit, col
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: c19.py <input> <output>", file=sys.stderr)
exit(-1)
spark = SparkSession.builder.appName('Select c19... | from __future__ import print_function
import sys
from pyspark.sql import SparkSession
from pyspark.sql.functions import lit, col, datediff
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: c19.py <input> <output>", file=sys.stderr)
exit(-1)
spark = SparkSession.builder.appName('... | <commit_before>from __future__ import print_function
import sys
from pyspark.sql import SparkSession
from pyspark.sql.functions import lit, col
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: c19.py <input> <output>", file=sys.stderr)
exit(-1)
spark = SparkSession.builder.appN... | from __future__ import print_function
import sys
from pyspark.sql import SparkSession
from pyspark.sql.functions import lit, col, datediff
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: c19.py <input> <output>", file=sys.stderr)
exit(-1)
spark = SparkSession.builder.appName('... | from __future__ import print_function
import sys
from pyspark.sql import SparkSession
from pyspark.sql.functions import lit, col
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: c19.py <input> <output>", file=sys.stderr)
exit(-1)
spark = SparkSession.builder.appName('Select c19... | <commit_before>from __future__ import print_function
import sys
from pyspark.sql import SparkSession
from pyspark.sql.functions import lit, col
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: c19.py <input> <output>", file=sys.stderr)
exit(-1)
spark = SparkSession.builder.appN... |
fa67de4900be765a5ea4194b1a786cd237934a33 | displacy_service_tests/test_server.py | displacy_service_tests/test_server.py | import falcon.testing
import json
from displacy_service.server import APP
class TestAPI(falcon.testing.TestCase):
def __init__(self):
self.api = APP
def test_deps():
test_api = TestAPI()
result = test_api.simulate_post(path='/dep',
body='''{"text": "This is a... | import falcon.testing
import json
from displacy_service.server import APP
class TestAPI(falcon.testing.TestCase):
def __init__(self):
self.api = APP
def test_deps():
test_api = TestAPI()
result = test_api.simulate_post(
path='/dep',
body='''{"text": "This is a test.", "model": "... | Make test file PEP8 compliant. | Make test file PEP8 compliant.
| Python | mit | jgontrum/spacy-api-docker,jgontrum/spacy-api-docker,jgontrum/spacy-api-docker,jgontrum/spacy-api-docker | import falcon.testing
import json
from displacy_service.server import APP
class TestAPI(falcon.testing.TestCase):
def __init__(self):
self.api = APP
def test_deps():
test_api = TestAPI()
result = test_api.simulate_post(path='/dep',
body='''{"text": "This is a... | import falcon.testing
import json
from displacy_service.server import APP
class TestAPI(falcon.testing.TestCase):
def __init__(self):
self.api = APP
def test_deps():
test_api = TestAPI()
result = test_api.simulate_post(
path='/dep',
body='''{"text": "This is a test.", "model": "... | <commit_before>import falcon.testing
import json
from displacy_service.server import APP
class TestAPI(falcon.testing.TestCase):
def __init__(self):
self.api = APP
def test_deps():
test_api = TestAPI()
result = test_api.simulate_post(path='/dep',
body='''{"te... | import falcon.testing
import json
from displacy_service.server import APP
class TestAPI(falcon.testing.TestCase):
def __init__(self):
self.api = APP
def test_deps():
test_api = TestAPI()
result = test_api.simulate_post(
path='/dep',
body='''{"text": "This is a test.", "model": "... | import falcon.testing
import json
from displacy_service.server import APP
class TestAPI(falcon.testing.TestCase):
def __init__(self):
self.api = APP
def test_deps():
test_api = TestAPI()
result = test_api.simulate_post(path='/dep',
body='''{"text": "This is a... | <commit_before>import falcon.testing
import json
from displacy_service.server import APP
class TestAPI(falcon.testing.TestCase):
def __init__(self):
self.api = APP
def test_deps():
test_api = TestAPI()
result = test_api.simulate_post(path='/dep',
body='''{"te... |
5db0af8fcf83519a44ed59d14bb00bc08e2a5131 | django_seo_js/middleware/useragent.py | django_seo_js/middleware/useragent.py | import re
from django_seo_js import settings
from django_seo_js.backends import SelectedBackend
from django_seo_js.helpers import request_should_be_ignored
import logging
logger = logging.getLogger(__name__)
class UserAgentMiddleware(SelectedBackend):
def __init__(self, *args, **kwargs):
super(UserAgentM... | import re
from django_seo_js import settings
from django_seo_js.backends import SelectedBackend
from django_seo_js.helpers import request_should_be_ignored
import logging
logger = logging.getLogger(__name__)
class UserAgentMiddleware(SelectedBackend):
def __init__(self, *args, **kwargs):
super(UserAgentM... | Change from request.ENABLED to settings.ENABLED | Change from request.ENABLED to settings.ENABLED | Python | mit | skoczen/django-seo-js | import re
from django_seo_js import settings
from django_seo_js.backends import SelectedBackend
from django_seo_js.helpers import request_should_be_ignored
import logging
logger = logging.getLogger(__name__)
class UserAgentMiddleware(SelectedBackend):
def __init__(self, *args, **kwargs):
super(UserAgentM... | import re
from django_seo_js import settings
from django_seo_js.backends import SelectedBackend
from django_seo_js.helpers import request_should_be_ignored
import logging
logger = logging.getLogger(__name__)
class UserAgentMiddleware(SelectedBackend):
def __init__(self, *args, **kwargs):
super(UserAgentM... | <commit_before>import re
from django_seo_js import settings
from django_seo_js.backends import SelectedBackend
from django_seo_js.helpers import request_should_be_ignored
import logging
logger = logging.getLogger(__name__)
class UserAgentMiddleware(SelectedBackend):
def __init__(self, *args, **kwargs):
s... | import re
from django_seo_js import settings
from django_seo_js.backends import SelectedBackend
from django_seo_js.helpers import request_should_be_ignored
import logging
logger = logging.getLogger(__name__)
class UserAgentMiddleware(SelectedBackend):
def __init__(self, *args, **kwargs):
super(UserAgentM... | import re
from django_seo_js import settings
from django_seo_js.backends import SelectedBackend
from django_seo_js.helpers import request_should_be_ignored
import logging
logger = logging.getLogger(__name__)
class UserAgentMiddleware(SelectedBackend):
def __init__(self, *args, **kwargs):
super(UserAgentM... | <commit_before>import re
from django_seo_js import settings
from django_seo_js.backends import SelectedBackend
from django_seo_js.helpers import request_should_be_ignored
import logging
logger = logging.getLogger(__name__)
class UserAgentMiddleware(SelectedBackend):
def __init__(self, *args, **kwargs):
s... |
5ff2390e462219f7dfa148c6ab1bdcecd9248484 | app.py | app.py | from flask import Flask, render_template, request
import requests
from requests_oauthlib import OAuth1
app = Flask(__name__)
app.config.from_pyfile('app.config')
@app.route('/')
def index():
term = request.args.get('q')
icons = []
if term:
auth = OAuth1(
app.config['OAUTH_KEY'],
... | from flask import Flask, render_template, request
import requests
from requests_oauthlib import OAuth1
app = Flask(__name__)
app.jinja_env.trim_blocks = True
app.jinja_env.lstrip_blocks = True
app.config.from_pyfile('app.config')
@app.route('/')
def index():
term = request.args.get('q')
icons = []
if ter... | Trim whitespace on rendered templates | Trim whitespace on rendered templates
| Python | unlicense | ecarreras/pdicons,ecarreras/pdicons,ecarreras/pdicons,ecarreras/pdicons | from flask import Flask, render_template, request
import requests
from requests_oauthlib import OAuth1
app = Flask(__name__)
app.config.from_pyfile('app.config')
@app.route('/')
def index():
term = request.args.get('q')
icons = []
if term:
auth = OAuth1(
app.config['OAUTH_KEY'],
... | from flask import Flask, render_template, request
import requests
from requests_oauthlib import OAuth1
app = Flask(__name__)
app.jinja_env.trim_blocks = True
app.jinja_env.lstrip_blocks = True
app.config.from_pyfile('app.config')
@app.route('/')
def index():
term = request.args.get('q')
icons = []
if ter... | <commit_before>from flask import Flask, render_template, request
import requests
from requests_oauthlib import OAuth1
app = Flask(__name__)
app.config.from_pyfile('app.config')
@app.route('/')
def index():
term = request.args.get('q')
icons = []
if term:
auth = OAuth1(
app.config['OAU... | from flask import Flask, render_template, request
import requests
from requests_oauthlib import OAuth1
app = Flask(__name__)
app.jinja_env.trim_blocks = True
app.jinja_env.lstrip_blocks = True
app.config.from_pyfile('app.config')
@app.route('/')
def index():
term = request.args.get('q')
icons = []
if ter... | from flask import Flask, render_template, request
import requests
from requests_oauthlib import OAuth1
app = Flask(__name__)
app.config.from_pyfile('app.config')
@app.route('/')
def index():
term = request.args.get('q')
icons = []
if term:
auth = OAuth1(
app.config['OAUTH_KEY'],
... | <commit_before>from flask import Flask, render_template, request
import requests
from requests_oauthlib import OAuth1
app = Flask(__name__)
app.config.from_pyfile('app.config')
@app.route('/')
def index():
term = request.args.get('q')
icons = []
if term:
auth = OAuth1(
app.config['OAU... |
7729af745b9894cfb07d99f754465934a90da40d | gigs/settings_prod.py | gigs/settings_prod.py | from gigs.settings_base import *
DEBUG = False
TEMPLATE_DEBUG = False
ADMINS = ()
INSTALLED_APPS += (
'gunicorn',
)
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'standard': {
'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s'
},
... | from gigs.settings_base import *
DEBUG = False
TEMPLATE_DEBUG = False
ADMINS = ()
INSTALLED_APPS += (
'gunicorn',
)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'django',
'OPTIONS':{
'read_default_file':'/etc/tugg/my.cnf',
},
},
}
LOGG... | Add databse config to production settings file | Add databse config to production settings file
| Python | bsd-3-clause | shaunokeefe/gigs,shaunokeefe/gigs | from gigs.settings_base import *
DEBUG = False
TEMPLATE_DEBUG = False
ADMINS = ()
INSTALLED_APPS += (
'gunicorn',
)
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'standard': {
'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s'
},
... | from gigs.settings_base import *
DEBUG = False
TEMPLATE_DEBUG = False
ADMINS = ()
INSTALLED_APPS += (
'gunicorn',
)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'django',
'OPTIONS':{
'read_default_file':'/etc/tugg/my.cnf',
},
},
}
LOGG... | <commit_before>from gigs.settings_base import *
DEBUG = False
TEMPLATE_DEBUG = False
ADMINS = ()
INSTALLED_APPS += (
'gunicorn',
)
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'standard': {
'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)... | from gigs.settings_base import *
DEBUG = False
TEMPLATE_DEBUG = False
ADMINS = ()
INSTALLED_APPS += (
'gunicorn',
)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'django',
'OPTIONS':{
'read_default_file':'/etc/tugg/my.cnf',
},
},
}
LOGG... | from gigs.settings_base import *
DEBUG = False
TEMPLATE_DEBUG = False
ADMINS = ()
INSTALLED_APPS += (
'gunicorn',
)
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'standard': {
'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s'
},
... | <commit_before>from gigs.settings_base import *
DEBUG = False
TEMPLATE_DEBUG = False
ADMINS = ()
INSTALLED_APPS += (
'gunicorn',
)
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'standard': {
'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)... |
9826c49225a3d8aac5ab5432e261babaa2585c1e | PRESUBMIT.py | PRESUBMIT.py | # Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""Presubmit script for dart_ci repository.
See http://dev.chromium.org/developers/how-tos/depottools/pres... | # Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""Presubmit script for dart_ci repository.
See http://dev.chromium.org/developers/how-tos/depottools/pres... | Update presubmit to use 'dart format' command | Update presubmit to use 'dart format' command
The presubmit checks will then work with the Flutter SDK in the path.
This is the case when working on the Flutter web app current_results_ui.
Change-Id: I8a8d5db4454b57bc7936197032460e877037b386
Reviewed-on: https://dart-review.googlesource.com/c/dart_ci/+/191921
Reviewe... | Python | bsd-3-clause | dart-lang/dart_ci,dart-lang/dart_ci,dart-lang/dart_ci,dart-lang/dart_ci | # Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""Presubmit script for dart_ci repository.
See http://dev.chromium.org/developers/how-tos/depottools/pres... | # Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""Presubmit script for dart_ci repository.
See http://dev.chromium.org/developers/how-tos/depottools/pres... | <commit_before># Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""Presubmit script for dart_ci repository.
See http://dev.chromium.org/developers/how-tos/... | # Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""Presubmit script for dart_ci repository.
See http://dev.chromium.org/developers/how-tos/depottools/pres... | # Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""Presubmit script for dart_ci repository.
See http://dev.chromium.org/developers/how-tos/depottools/pres... | <commit_before># Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""Presubmit script for dart_ci repository.
See http://dev.chromium.org/developers/how-tos/... |
f64fabb83cf57e70f938f803ee0a50599f3ab83a | src/odin/fields/future.py | src/odin/fields/future.py | from __future__ import absolute_import
from enum import Enum
from typing import TypeVar, Optional, Any, Type # noqa
from odin.exceptions import ValidationError
from . import Field
__all__ = ("EnumField",)
ET = TypeVar("ET", Enum, Enum)
class EnumField(Field):
"""
Field for handling Python enums.
"""... | from __future__ import absolute_import
from enum import Enum
from typing import TypeVar, Optional, Any, Type # noqa
from odin.exceptions import ValidationError
from . import Field
__all__ = ("EnumField",)
ET = TypeVar("ET", Enum, Enum)
class EnumField(Field):
"""
Field for handling Python enums.
"""... | Update enum value to an is-instance check | Update enum value to an is-instance check
| Python | bsd-3-clause | python-odin/odin | from __future__ import absolute_import
from enum import Enum
from typing import TypeVar, Optional, Any, Type # noqa
from odin.exceptions import ValidationError
from . import Field
__all__ = ("EnumField",)
ET = TypeVar("ET", Enum, Enum)
class EnumField(Field):
"""
Field for handling Python enums.
"""... | from __future__ import absolute_import
from enum import Enum
from typing import TypeVar, Optional, Any, Type # noqa
from odin.exceptions import ValidationError
from . import Field
__all__ = ("EnumField",)
ET = TypeVar("ET", Enum, Enum)
class EnumField(Field):
"""
Field for handling Python enums.
"""... | <commit_before>from __future__ import absolute_import
from enum import Enum
from typing import TypeVar, Optional, Any, Type # noqa
from odin.exceptions import ValidationError
from . import Field
__all__ = ("EnumField",)
ET = TypeVar("ET", Enum, Enum)
class EnumField(Field):
"""
Field for handling Python... | from __future__ import absolute_import
from enum import Enum
from typing import TypeVar, Optional, Any, Type # noqa
from odin.exceptions import ValidationError
from . import Field
__all__ = ("EnumField",)
ET = TypeVar("ET", Enum, Enum)
class EnumField(Field):
"""
Field for handling Python enums.
"""... | from __future__ import absolute_import
from enum import Enum
from typing import TypeVar, Optional, Any, Type # noqa
from odin.exceptions import ValidationError
from . import Field
__all__ = ("EnumField",)
ET = TypeVar("ET", Enum, Enum)
class EnumField(Field):
"""
Field for handling Python enums.
"""... | <commit_before>from __future__ import absolute_import
from enum import Enum
from typing import TypeVar, Optional, Any, Type # noqa
from odin.exceptions import ValidationError
from . import Field
__all__ = ("EnumField",)
ET = TypeVar("ET", Enum, Enum)
class EnumField(Field):
"""
Field for handling Python... |
c3cf9adc2428c4058817daa1aeefca300363e21f | glanerbeard/server.py | glanerbeard/server.py | import requests
import json
import logging
from glanerbeard import show
log = logging.getLogger(__name__)
class Server:
def __init__(self, name, url, apikey):
self.name = name
self.url = url
self.apikey = apikey
def requestJson(self, path):
url = '{url}/api/{apikey}{path}'.format(url=self.url,apikey=self.ap... | import requests
import logging
from glanerbeard import show
log = logging.getLogger(__name__)
class Server:
def __init__(self, name, url, apikey):
self.name = name
self.url = url
self.apikey = apikey
def requestJson(self, path):
url = '{url}/api/{apikey}{path}'.format(url=self.url,apikey=self.apikey,path=pa... | Use requests built-in .json(), pass verify=False. | Use requests built-in .json(), pass verify=False.
| Python | apache-2.0 | daenney/glanerbeard | import requests
import json
import logging
from glanerbeard import show
log = logging.getLogger(__name__)
class Server:
def __init__(self, name, url, apikey):
self.name = name
self.url = url
self.apikey = apikey
def requestJson(self, path):
url = '{url}/api/{apikey}{path}'.format(url=self.url,apikey=self.ap... | import requests
import logging
from glanerbeard import show
log = logging.getLogger(__name__)
class Server:
def __init__(self, name, url, apikey):
self.name = name
self.url = url
self.apikey = apikey
def requestJson(self, path):
url = '{url}/api/{apikey}{path}'.format(url=self.url,apikey=self.apikey,path=pa... | <commit_before>import requests
import json
import logging
from glanerbeard import show
log = logging.getLogger(__name__)
class Server:
def __init__(self, name, url, apikey):
self.name = name
self.url = url
self.apikey = apikey
def requestJson(self, path):
url = '{url}/api/{apikey}{path}'.format(url=self.url... | import requests
import logging
from glanerbeard import show
log = logging.getLogger(__name__)
class Server:
def __init__(self, name, url, apikey):
self.name = name
self.url = url
self.apikey = apikey
def requestJson(self, path):
url = '{url}/api/{apikey}{path}'.format(url=self.url,apikey=self.apikey,path=pa... | import requests
import json
import logging
from glanerbeard import show
log = logging.getLogger(__name__)
class Server:
def __init__(self, name, url, apikey):
self.name = name
self.url = url
self.apikey = apikey
def requestJson(self, path):
url = '{url}/api/{apikey}{path}'.format(url=self.url,apikey=self.ap... | <commit_before>import requests
import json
import logging
from glanerbeard import show
log = logging.getLogger(__name__)
class Server:
def __init__(self, name, url, apikey):
self.name = name
self.url = url
self.apikey = apikey
def requestJson(self, path):
url = '{url}/api/{apikey}{path}'.format(url=self.url... |
321924fff843896fc67d3a4594d635546cf90bec | mycli/packages/expanded.py | mycli/packages/expanded.py | from .tabulate import _text_type
def pad(field, total, char=u" "):
return field + (char * (total - len(field)))
def get_separator(num, header_len, data_len):
sep = u"***************************[ %d. row ]***************************\n" % (num + 1)
return sep
def expanded_table(rows, headers):
header_... | from .tabulate import _text_type
def pad(field, total, char=u" "):
return field + (char * (total - len(field)))
def get_separator(num, header_len, data_len):
sep = u"***************************[ %d. row ]***************************\n" % (num + 1)
return sep
def expanded_table(rows, headers):
header_... | Make the null value consistent between vertical and tabular output. | Make the null value consistent between vertical and tabular output.
| Python | bsd-3-clause | MnO2/rediscli,martijnengler/mycli,qbdsoft/mycli,j-bennet/mycli,D-e-e-m-o/mycli,mdsrosa/mycli,martijnengler/mycli,mattn/mycli,jinstrive/mycli,webwlsong/mycli,brewneaux/mycli,danieljwest/mycli,thanatoskira/mycli,ksmaheshkumar/mycli,brewneaux/mycli,MnO2/rediscli,evook/mycli,webwlsong/mycli,j-bennet/mycli,evook/mycli,suzuk... | from .tabulate import _text_type
def pad(field, total, char=u" "):
return field + (char * (total - len(field)))
def get_separator(num, header_len, data_len):
sep = u"***************************[ %d. row ]***************************\n" % (num + 1)
return sep
def expanded_table(rows, headers):
header_... | from .tabulate import _text_type
def pad(field, total, char=u" "):
return field + (char * (total - len(field)))
def get_separator(num, header_len, data_len):
sep = u"***************************[ %d. row ]***************************\n" % (num + 1)
return sep
def expanded_table(rows, headers):
header_... | <commit_before>from .tabulate import _text_type
def pad(field, total, char=u" "):
return field + (char * (total - len(field)))
def get_separator(num, header_len, data_len):
sep = u"***************************[ %d. row ]***************************\n" % (num + 1)
return sep
def expanded_table(rows, header... | from .tabulate import _text_type
def pad(field, total, char=u" "):
return field + (char * (total - len(field)))
def get_separator(num, header_len, data_len):
sep = u"***************************[ %d. row ]***************************\n" % (num + 1)
return sep
def expanded_table(rows, headers):
header_... | from .tabulate import _text_type
def pad(field, total, char=u" "):
return field + (char * (total - len(field)))
def get_separator(num, header_len, data_len):
sep = u"***************************[ %d. row ]***************************\n" % (num + 1)
return sep
def expanded_table(rows, headers):
header_... | <commit_before>from .tabulate import _text_type
def pad(field, total, char=u" "):
return field + (char * (total - len(field)))
def get_separator(num, header_len, data_len):
sep = u"***************************[ %d. row ]***************************\n" % (num + 1)
return sep
def expanded_table(rows, header... |
495a368098357c94ccec2f9f84c077fd5b27bde7 | tests/PushoverAPI/test_PushoverAPI.py | tests/PushoverAPI/test_PushoverAPI.py | from urllib.parse import urljoin, parse_qs
import responses
from tests.constants import *
from tests.fixtures import PushoverAPI
from tests.util import messages_callback
@responses.activate
def test_PushoverAPI_sends_message(PushoverAPI):
responses.add_callback(
responses.POST,
urljoin(PUSHOVER_... | from urllib.parse import urljoin, parse_qs
import responses
from tests.constants import *
from tests.fixtures import PushoverAPI
from tests.util import messages_callback
@responses.activate
def test_PushoverAPI_sends_message(PushoverAPI):
responses.add_callback(
responses.POST,
urljoin(PUSHOVER_... | Add a test for a proper response, not just proper request | Add a test for a proper response, not just proper request
| Python | mit | scolby33/pushover_complete | from urllib.parse import urljoin, parse_qs
import responses
from tests.constants import *
from tests.fixtures import PushoverAPI
from tests.util import messages_callback
@responses.activate
def test_PushoverAPI_sends_message(PushoverAPI):
responses.add_callback(
responses.POST,
urljoin(PUSHOVER_... | from urllib.parse import urljoin, parse_qs
import responses
from tests.constants import *
from tests.fixtures import PushoverAPI
from tests.util import messages_callback
@responses.activate
def test_PushoverAPI_sends_message(PushoverAPI):
responses.add_callback(
responses.POST,
urljoin(PUSHOVER_... | <commit_before>from urllib.parse import urljoin, parse_qs
import responses
from tests.constants import *
from tests.fixtures import PushoverAPI
from tests.util import messages_callback
@responses.activate
def test_PushoverAPI_sends_message(PushoverAPI):
responses.add_callback(
responses.POST,
ur... | from urllib.parse import urljoin, parse_qs
import responses
from tests.constants import *
from tests.fixtures import PushoverAPI
from tests.util import messages_callback
@responses.activate
def test_PushoverAPI_sends_message(PushoverAPI):
responses.add_callback(
responses.POST,
urljoin(PUSHOVER_... | from urllib.parse import urljoin, parse_qs
import responses
from tests.constants import *
from tests.fixtures import PushoverAPI
from tests.util import messages_callback
@responses.activate
def test_PushoverAPI_sends_message(PushoverAPI):
responses.add_callback(
responses.POST,
urljoin(PUSHOVER_... | <commit_before>from urllib.parse import urljoin, parse_qs
import responses
from tests.constants import *
from tests.fixtures import PushoverAPI
from tests.util import messages_callback
@responses.activate
def test_PushoverAPI_sends_message(PushoverAPI):
responses.add_callback(
responses.POST,
ur... |
dc86283bb517c56eec177804801f66227477a097 | networkx/generators/ego.py | networkx/generators/ego.py | """
Ego graph.
"""
# Copyright (C) 2010 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
__author__ = """\n""".join(['Drew Conway <drew.conway@nyu.edu>',
'Aric Hagberg <hagberg@la... | """
Ego graph.
"""
# Copyright (C) 2010 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
__author__ = """\n""".join(['Drew Conway <drew.conway@nyu.edu>',
'Aric Hagberg <hagberg@la... | Add note about directed graphs | Add note about directed graphs
--HG--
extra : convert_revision : svn%3A3ed01bd8-26fb-0310-9e4c-ca1a4053419f/networkx/trunk%401776
| Python | bsd-3-clause | ghdk/networkx,farhaanbukhsh/networkx,yashu-seth/networkx,bzero/networkx,nathania/networkx,jakevdp/networkx,goulu/networkx,Sixshaman/networkx,ionanrozenfeld/networkx,chrisnatali/networkx,jcurbelo/networkx,tmilicic/networkx,chrisnatali/networkx,RMKD/networkx,ionanrozenfeld/networkx,sharifulgeo/networkx,sharifulgeo/networ... | """
Ego graph.
"""
# Copyright (C) 2010 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
__author__ = """\n""".join(['Drew Conway <drew.conway@nyu.edu>',
'Aric Hagberg <hagberg@la... | """
Ego graph.
"""
# Copyright (C) 2010 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
__author__ = """\n""".join(['Drew Conway <drew.conway@nyu.edu>',
'Aric Hagberg <hagberg@la... | <commit_before>"""
Ego graph.
"""
# Copyright (C) 2010 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
__author__ = """\n""".join(['Drew Conway <drew.conway@nyu.edu>',
'Aric Hagb... | """
Ego graph.
"""
# Copyright (C) 2010 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
__author__ = """\n""".join(['Drew Conway <drew.conway@nyu.edu>',
'Aric Hagberg <hagberg@la... | """
Ego graph.
"""
# Copyright (C) 2010 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
__author__ = """\n""".join(['Drew Conway <drew.conway@nyu.edu>',
'Aric Hagberg <hagberg@la... | <commit_before>"""
Ego graph.
"""
# Copyright (C) 2010 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
__author__ = """\n""".join(['Drew Conway <drew.conway@nyu.edu>',
'Aric Hagb... |
21f7d85d5f22834e04a25ea23eabfd07b279bfe6 | openedx/features/badging/constants.py | openedx/features/badging/constants.py | CONVERSATIONALIST = ('conversationalist', 'Conversationalist')
TEAM_PLAYER = ('team', 'Team player')
BADGES_KEY = 'badges'
BADGE_NOT_FOUND_ERROR = 'There exists no badge with id {badge_id}'
BADGE_TYPE_ERROR = 'Cannot assign badge {badge_id} of unknown type {badge_type}'
FILTER_BADGES_ERROR = 'Unable to get badges for ... | CONVERSATIONALIST = ('conversationalist', 'Conversationalist')
TEAM_PLAYER = ('team', 'Team player')
BADGES_KEY = 'badges'
BADGE_NOT_FOUND_ERROR = 'There exists no badge with id {badge_id}'
BADGE_TYPE_ERROR = 'Cannot assign badge {badge_id} of unknown type {badge_type}'
BADGE_ROOT_URL = '{root_url}/courses/{course_id}... | Add constant for badge url | Add constant for badge url
| Python | agpl-3.0 | philanthropy-u/edx-platform,philanthropy-u/edx-platform,philanthropy-u/edx-platform,philanthropy-u/edx-platform | CONVERSATIONALIST = ('conversationalist', 'Conversationalist')
TEAM_PLAYER = ('team', 'Team player')
BADGES_KEY = 'badges'
BADGE_NOT_FOUND_ERROR = 'There exists no badge with id {badge_id}'
BADGE_TYPE_ERROR = 'Cannot assign badge {badge_id} of unknown type {badge_type}'
FILTER_BADGES_ERROR = 'Unable to get badges for ... | CONVERSATIONALIST = ('conversationalist', 'Conversationalist')
TEAM_PLAYER = ('team', 'Team player')
BADGES_KEY = 'badges'
BADGE_NOT_FOUND_ERROR = 'There exists no badge with id {badge_id}'
BADGE_TYPE_ERROR = 'Cannot assign badge {badge_id} of unknown type {badge_type}'
BADGE_ROOT_URL = '{root_url}/courses/{course_id}... | <commit_before>CONVERSATIONALIST = ('conversationalist', 'Conversationalist')
TEAM_PLAYER = ('team', 'Team player')
BADGES_KEY = 'badges'
BADGE_NOT_FOUND_ERROR = 'There exists no badge with id {badge_id}'
BADGE_TYPE_ERROR = 'Cannot assign badge {badge_id} of unknown type {badge_type}'
FILTER_BADGES_ERROR = 'Unable to ... | CONVERSATIONALIST = ('conversationalist', 'Conversationalist')
TEAM_PLAYER = ('team', 'Team player')
BADGES_KEY = 'badges'
BADGE_NOT_FOUND_ERROR = 'There exists no badge with id {badge_id}'
BADGE_TYPE_ERROR = 'Cannot assign badge {badge_id} of unknown type {badge_type}'
BADGE_ROOT_URL = '{root_url}/courses/{course_id}... | CONVERSATIONALIST = ('conversationalist', 'Conversationalist')
TEAM_PLAYER = ('team', 'Team player')
BADGES_KEY = 'badges'
BADGE_NOT_FOUND_ERROR = 'There exists no badge with id {badge_id}'
BADGE_TYPE_ERROR = 'Cannot assign badge {badge_id} of unknown type {badge_type}'
FILTER_BADGES_ERROR = 'Unable to get badges for ... | <commit_before>CONVERSATIONALIST = ('conversationalist', 'Conversationalist')
TEAM_PLAYER = ('team', 'Team player')
BADGES_KEY = 'badges'
BADGE_NOT_FOUND_ERROR = 'There exists no badge with id {badge_id}'
BADGE_TYPE_ERROR = 'Cannot assign badge {badge_id} of unknown type {badge_type}'
FILTER_BADGES_ERROR = 'Unable to ... |
3b5880c375ee92ce931c29a978ff64cd8849d028 | src/simple-http-server.py | src/simple-http-server.py | #!/usr/bin/env python3
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
import os, http.server
def main(args):
os.chdir(args.directory)
addr = ('' ,args.port)
httpd = http.server.HTTPServer(addr, http.server.SimpleHTTPRequestHandler)
httpd.serve_forever()
if __name__ == '__main__':
... | #!/usr/bin/env python3
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
import os, http.server
def main(args):
os.chdir(args.directory)
addr = ('' ,args.port)
print('Serving', args.directory, 'on', addr)
httpd = http.server.HTTPServer(addr, http.server.SimpleHTTPRequestHandler)
ht... | Add message about where we're listening for connections | Add message about where we're listening for connections
| Python | unlicense | pastly/python-snippits | #!/usr/bin/env python3
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
import os, http.server
def main(args):
os.chdir(args.directory)
addr = ('' ,args.port)
httpd = http.server.HTTPServer(addr, http.server.SimpleHTTPRequestHandler)
httpd.serve_forever()
if __name__ == '__main__':
... | #!/usr/bin/env python3
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
import os, http.server
def main(args):
os.chdir(args.directory)
addr = ('' ,args.port)
print('Serving', args.directory, 'on', addr)
httpd = http.server.HTTPServer(addr, http.server.SimpleHTTPRequestHandler)
ht... | <commit_before>#!/usr/bin/env python3
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
import os, http.server
def main(args):
os.chdir(args.directory)
addr = ('' ,args.port)
httpd = http.server.HTTPServer(addr, http.server.SimpleHTTPRequestHandler)
httpd.serve_forever()
if __name__ =... | #!/usr/bin/env python3
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
import os, http.server
def main(args):
os.chdir(args.directory)
addr = ('' ,args.port)
print('Serving', args.directory, 'on', addr)
httpd = http.server.HTTPServer(addr, http.server.SimpleHTTPRequestHandler)
ht... | #!/usr/bin/env python3
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
import os, http.server
def main(args):
os.chdir(args.directory)
addr = ('' ,args.port)
httpd = http.server.HTTPServer(addr, http.server.SimpleHTTPRequestHandler)
httpd.serve_forever()
if __name__ == '__main__':
... | <commit_before>#!/usr/bin/env python3
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
import os, http.server
def main(args):
os.chdir(args.directory)
addr = ('' ,args.port)
httpd = http.server.HTTPServer(addr, http.server.SimpleHTTPRequestHandler)
httpd.serve_forever()
if __name__ =... |
22382935be99e027da46303107926a15cd8f3017 | tests/twisted/vcard/test-set-alias.py | tests/twisted/vcard/test-set-alias.py |
"""
Test alias setting support.
"""
from servicetest import EventPattern
from gabbletest import exec_test, acknowledge_iq
import constants as cs
def test(q, bus, conn, stream):
iq_event = q.expect('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard')
acknowledge_iq(stream, iq_event.st... |
"""
Test alias setting support.
"""
from servicetest import EventPattern, assertEquals
from gabbletest import exec_test, acknowledge_iq
import constants as cs
import ns
def validate_pep_update(pep_update, expected_nickname):
publish = pep_update.query.elements(uri=ns.PUBSUB, name='publish').next()
assertEqua... | Test setting our own alias via PEP | Test setting our own alias via PEP
Astonishingly, this was untested...
| Python | lgpl-2.1 | Ziemin/telepathy-gabble,jku/telepathy-gabble,mlundblad/telepathy-gabble,Ziemin/telepathy-gabble,mlundblad/telepathy-gabble,jku/telepathy-gabble,Ziemin/telepathy-gabble,mlundblad/telepathy-gabble,jku/telepathy-gabble,Ziemin/telepathy-gabble |
"""
Test alias setting support.
"""
from servicetest import EventPattern
from gabbletest import exec_test, acknowledge_iq
import constants as cs
def test(q, bus, conn, stream):
iq_event = q.expect('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard')
acknowledge_iq(stream, iq_event.st... |
"""
Test alias setting support.
"""
from servicetest import EventPattern, assertEquals
from gabbletest import exec_test, acknowledge_iq
import constants as cs
import ns
def validate_pep_update(pep_update, expected_nickname):
publish = pep_update.query.elements(uri=ns.PUBSUB, name='publish').next()
assertEqua... | <commit_before>
"""
Test alias setting support.
"""
from servicetest import EventPattern
from gabbletest import exec_test, acknowledge_iq
import constants as cs
def test(q, bus, conn, stream):
iq_event = q.expect('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard')
acknowledge_iq(stre... |
"""
Test alias setting support.
"""
from servicetest import EventPattern, assertEquals
from gabbletest import exec_test, acknowledge_iq
import constants as cs
import ns
def validate_pep_update(pep_update, expected_nickname):
publish = pep_update.query.elements(uri=ns.PUBSUB, name='publish').next()
assertEqua... |
"""
Test alias setting support.
"""
from servicetest import EventPattern
from gabbletest import exec_test, acknowledge_iq
import constants as cs
def test(q, bus, conn, stream):
iq_event = q.expect('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard')
acknowledge_iq(stream, iq_event.st... | <commit_before>
"""
Test alias setting support.
"""
from servicetest import EventPattern
from gabbletest import exec_test, acknowledge_iq
import constants as cs
def test(q, bus, conn, stream):
iq_event = q.expect('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard')
acknowledge_iq(stre... |
fe9f48415017bcd873140da82a5f2e463d13b307 | tests/scoring_engine/models/test_setting.py | tests/scoring_engine/models/test_setting.py | from scoring_engine.models.setting import Setting
from tests.scoring_engine.unit_test import UnitTest
class TestSetting(UnitTest):
def test_init_setting(self):
setting = Setting(name='test_setting', value='test value example')
assert setting.id is None
assert setting.name == 'test_settin... | from scoring_engine.models.setting import Setting
from tests.scoring_engine.unit_test import UnitTest
class TestSetting(UnitTest):
def test_init_setting(self):
setting = Setting(name='test_setting', value='test value example')
assert setting.id is None
assert setting.name == 'test_settin... | Add test for setting as boolean value | Add test for setting as boolean value
| Python | mit | pwnbus/scoring_engine,pwnbus/scoring_engine,pwnbus/scoring_engine,pwnbus/scoring_engine | from scoring_engine.models.setting import Setting
from tests.scoring_engine.unit_test import UnitTest
class TestSetting(UnitTest):
def test_init_setting(self):
setting = Setting(name='test_setting', value='test value example')
assert setting.id is None
assert setting.name == 'test_settin... | from scoring_engine.models.setting import Setting
from tests.scoring_engine.unit_test import UnitTest
class TestSetting(UnitTest):
def test_init_setting(self):
setting = Setting(name='test_setting', value='test value example')
assert setting.id is None
assert setting.name == 'test_settin... | <commit_before>from scoring_engine.models.setting import Setting
from tests.scoring_engine.unit_test import UnitTest
class TestSetting(UnitTest):
def test_init_setting(self):
setting = Setting(name='test_setting', value='test value example')
assert setting.id is None
assert setting.name ... | from scoring_engine.models.setting import Setting
from tests.scoring_engine.unit_test import UnitTest
class TestSetting(UnitTest):
def test_init_setting(self):
setting = Setting(name='test_setting', value='test value example')
assert setting.id is None
assert setting.name == 'test_settin... | from scoring_engine.models.setting import Setting
from tests.scoring_engine.unit_test import UnitTest
class TestSetting(UnitTest):
def test_init_setting(self):
setting = Setting(name='test_setting', value='test value example')
assert setting.id is None
assert setting.name == 'test_settin... | <commit_before>from scoring_engine.models.setting import Setting
from tests.scoring_engine.unit_test import UnitTest
class TestSetting(UnitTest):
def test_init_setting(self):
setting = Setting(name='test_setting', value='test value example')
assert setting.id is None
assert setting.name ... |
bd5336d52a1cd2e086dbf1665b90823505d31840 | tests/testapp/tests/test_timer_collector.py | tests/testapp/tests/test_timer_collector.py | from datetime import timedelta
from django_performance_testing.timing import TimeCollector
from freezegun import freeze_time
import pytest
from testapp.test_helpers import capture_result_collected
@pytest.mark.parametrize('seconds', [10, 5, 0.04])
def test_captures_and_measures_elapsed_time(seconds):
with capture... | from datetime import timedelta
from django_performance_testing.timing import TimeCollector
from freezegun import freeze_time
import pytest
from testapp.test_helpers import capture_result_collected
@pytest.mark.parametrize('seconds', [10, 5, 0.04])
def test_captures_and_measures_elapsed_time(seconds):
with capture... | Fix for failing test test_captures_and_measures_elapsed_time: TypeError: unsupported operand type(s) for -: 'float' and 'list' | Fix for failing test test_captures_and_measures_elapsed_time: TypeError: unsupported operand type(s) for -: 'float' and 'list'
| Python | bsd-3-clause | PaesslerAG/django-performance-testing | from datetime import timedelta
from django_performance_testing.timing import TimeCollector
from freezegun import freeze_time
import pytest
from testapp.test_helpers import capture_result_collected
@pytest.mark.parametrize('seconds', [10, 5, 0.04])
def test_captures_and_measures_elapsed_time(seconds):
with capture... | from datetime import timedelta
from django_performance_testing.timing import TimeCollector
from freezegun import freeze_time
import pytest
from testapp.test_helpers import capture_result_collected
@pytest.mark.parametrize('seconds', [10, 5, 0.04])
def test_captures_and_measures_elapsed_time(seconds):
with capture... | <commit_before>from datetime import timedelta
from django_performance_testing.timing import TimeCollector
from freezegun import freeze_time
import pytest
from testapp.test_helpers import capture_result_collected
@pytest.mark.parametrize('seconds', [10, 5, 0.04])
def test_captures_and_measures_elapsed_time(seconds):
... | from datetime import timedelta
from django_performance_testing.timing import TimeCollector
from freezegun import freeze_time
import pytest
from testapp.test_helpers import capture_result_collected
@pytest.mark.parametrize('seconds', [10, 5, 0.04])
def test_captures_and_measures_elapsed_time(seconds):
with capture... | from datetime import timedelta
from django_performance_testing.timing import TimeCollector
from freezegun import freeze_time
import pytest
from testapp.test_helpers import capture_result_collected
@pytest.mark.parametrize('seconds', [10, 5, 0.04])
def test_captures_and_measures_elapsed_time(seconds):
with capture... | <commit_before>from datetime import timedelta
from django_performance_testing.timing import TimeCollector
from freezegun import freeze_time
import pytest
from testapp.test_helpers import capture_result_collected
@pytest.mark.parametrize('seconds', [10, 5, 0.04])
def test_captures_and_measures_elapsed_time(seconds):
... |
4456f5604c1d824f5012bcee550d274c905d74c8 | bigcrunch/shutdown.py | bigcrunch/shutdown.py | import asyncio
import botocore.exceptions
from bigcrunch import webapp
@asyncio.coroutine
def shutdown():
client = yield from webapp.redshift_client()
cluster_control = webapp.ClusterControl(client)
try:
cluster = yield from cluster_control.get()
except botocore.exceptions.ClientError as e:
... | import asyncio
import botocore.exceptions
from bigcrunch import webapp
@asyncio.coroutine
def shutdown():
client = webapp.redshift_client()
cluster_control = webapp.ClusterControl(client)
try:
cluster = yield from cluster_control.get()
except botocore.exceptions.ClientError as e:
if ... | Remove yield from on redshift_client | Remove yield from on redshift_client
| Python | agpl-3.0 | sqlalchemy-redshift/bigcrunch | import asyncio
import botocore.exceptions
from bigcrunch import webapp
@asyncio.coroutine
def shutdown():
client = yield from webapp.redshift_client()
cluster_control = webapp.ClusterControl(client)
try:
cluster = yield from cluster_control.get()
except botocore.exceptions.ClientError as e:
... | import asyncio
import botocore.exceptions
from bigcrunch import webapp
@asyncio.coroutine
def shutdown():
client = webapp.redshift_client()
cluster_control = webapp.ClusterControl(client)
try:
cluster = yield from cluster_control.get()
except botocore.exceptions.ClientError as e:
if ... | <commit_before>import asyncio
import botocore.exceptions
from bigcrunch import webapp
@asyncio.coroutine
def shutdown():
client = yield from webapp.redshift_client()
cluster_control = webapp.ClusterControl(client)
try:
cluster = yield from cluster_control.get()
except botocore.exceptions.Cli... | import asyncio
import botocore.exceptions
from bigcrunch import webapp
@asyncio.coroutine
def shutdown():
client = webapp.redshift_client()
cluster_control = webapp.ClusterControl(client)
try:
cluster = yield from cluster_control.get()
except botocore.exceptions.ClientError as e:
if ... | import asyncio
import botocore.exceptions
from bigcrunch import webapp
@asyncio.coroutine
def shutdown():
client = yield from webapp.redshift_client()
cluster_control = webapp.ClusterControl(client)
try:
cluster = yield from cluster_control.get()
except botocore.exceptions.ClientError as e:
... | <commit_before>import asyncio
import botocore.exceptions
from bigcrunch import webapp
@asyncio.coroutine
def shutdown():
client = yield from webapp.redshift_client()
cluster_control = webapp.ClusterControl(client)
try:
cluster = yield from cluster_control.get()
except botocore.exceptions.Cli... |
1c2ade08262259bb952424d7605d5fc68e038d73 | scripts/generate_labos_aggrega.py | scripts/generate_labos_aggrega.py | #!/usr/bin/env python
from csv import reader
with open("data/public/labos.departements.csv") as f:
data = list(reader(f))
output = {}
keys = data.pop(0)
keys.remove("LABO")
keys.remove("DEPARTEMENT")
for row in data:
if not row[0]:
continue
if row[0] not in output:
output[row[0]] = dict({... | #!/usr/bin/env python
from csv import reader
with open("data/public/labos.departements.csv") as f:
data = list(reader(f))
output = {}
keys = data.pop(0)
keys.remove("LABO")
keys.remove("DEPARTEMENT")
for row in data:
if not row[0]:
continue
if row[0] not in output:
output[row[0]] = dict({... | Make aggregation script compatible with python 3 | Make aggregation script compatible with python 3
| Python | agpl-3.0 | regardscitoyens/sunshine-data,regardscitoyens/sunshine-data,regardscitoyens/sunshine-data,regardscitoyens/sunshine-data,regardscitoyens/sunshine-data,regardscitoyens/sunshine-data | #!/usr/bin/env python
from csv import reader
with open("data/public/labos.departements.csv") as f:
data = list(reader(f))
output = {}
keys = data.pop(0)
keys.remove("LABO")
keys.remove("DEPARTEMENT")
for row in data:
if not row[0]:
continue
if row[0] not in output:
output[row[0]] = dict({... | #!/usr/bin/env python
from csv import reader
with open("data/public/labos.departements.csv") as f:
data = list(reader(f))
output = {}
keys = data.pop(0)
keys.remove("LABO")
keys.remove("DEPARTEMENT")
for row in data:
if not row[0]:
continue
if row[0] not in output:
output[row[0]] = dict({... | <commit_before>#!/usr/bin/env python
from csv import reader
with open("data/public/labos.departements.csv") as f:
data = list(reader(f))
output = {}
keys = data.pop(0)
keys.remove("LABO")
keys.remove("DEPARTEMENT")
for row in data:
if not row[0]:
continue
if row[0] not in output:
output[r... | #!/usr/bin/env python
from csv import reader
with open("data/public/labos.departements.csv") as f:
data = list(reader(f))
output = {}
keys = data.pop(0)
keys.remove("LABO")
keys.remove("DEPARTEMENT")
for row in data:
if not row[0]:
continue
if row[0] not in output:
output[row[0]] = dict({... | #!/usr/bin/env python
from csv import reader
with open("data/public/labos.departements.csv") as f:
data = list(reader(f))
output = {}
keys = data.pop(0)
keys.remove("LABO")
keys.remove("DEPARTEMENT")
for row in data:
if not row[0]:
continue
if row[0] not in output:
output[row[0]] = dict({... | <commit_before>#!/usr/bin/env python
from csv import reader
with open("data/public/labos.departements.csv") as f:
data = list(reader(f))
output = {}
keys = data.pop(0)
keys.remove("LABO")
keys.remove("DEPARTEMENT")
for row in data:
if not row[0]:
continue
if row[0] not in output:
output[r... |
f25a32dd0180af91277ace186fc878c8baffed65 | heisen/core/__init__.py | heisen/core/__init__.py | from heisen.config import settings
from heisen.core.log import logger
from jsonrpclib.request import Connection
def get_rpc_connection():
servers = {
'self': [
('127.0.0.1', settings.RPC_PORT, 'aliehsanmilad', 'Key1_s!3cr3t')
],
}
servers.update(getattr(settings, 'RPC_SERVERS'... | from heisen.config import settings
from heisen.core.log import logger
from jsonrpclib.request import ConnectionPool
def get_rpc_connection():
if settings.CREDENTIALS:
username, passowrd = settings.CREDENTIALS[0]
else:
username = passowrd = None
servers = {'self': [('localhost', settings.R... | Use connection pool for jsonrpc | Use connection pool for jsonrpc
| Python | mit | HeisenCore/heisen | from heisen.config import settings
from heisen.core.log import logger
from jsonrpclib.request import Connection
def get_rpc_connection():
servers = {
'self': [
('127.0.0.1', settings.RPC_PORT, 'aliehsanmilad', 'Key1_s!3cr3t')
],
}
servers.update(getattr(settings, 'RPC_SERVERS'... | from heisen.config import settings
from heisen.core.log import logger
from jsonrpclib.request import ConnectionPool
def get_rpc_connection():
if settings.CREDENTIALS:
username, passowrd = settings.CREDENTIALS[0]
else:
username = passowrd = None
servers = {'self': [('localhost', settings.R... | <commit_before>from heisen.config import settings
from heisen.core.log import logger
from jsonrpclib.request import Connection
def get_rpc_connection():
servers = {
'self': [
('127.0.0.1', settings.RPC_PORT, 'aliehsanmilad', 'Key1_s!3cr3t')
],
}
servers.update(getattr(settings... | from heisen.config import settings
from heisen.core.log import logger
from jsonrpclib.request import ConnectionPool
def get_rpc_connection():
if settings.CREDENTIALS:
username, passowrd = settings.CREDENTIALS[0]
else:
username = passowrd = None
servers = {'self': [('localhost', settings.R... | from heisen.config import settings
from heisen.core.log import logger
from jsonrpclib.request import Connection
def get_rpc_connection():
servers = {
'self': [
('127.0.0.1', settings.RPC_PORT, 'aliehsanmilad', 'Key1_s!3cr3t')
],
}
servers.update(getattr(settings, 'RPC_SERVERS'... | <commit_before>from heisen.config import settings
from heisen.core.log import logger
from jsonrpclib.request import Connection
def get_rpc_connection():
servers = {
'self': [
('127.0.0.1', settings.RPC_PORT, 'aliehsanmilad', 'Key1_s!3cr3t')
],
}
servers.update(getattr(settings... |
57164efc9827f7975cdfa171a5a88e6fcc4059e5 | neutron/conf/policies/service_type.py | neutron/conf/policies/service_type.py | # 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, software
# distributed u... | # 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, software
# distributed u... | Implement secure RBAC for service providers API | Implement secure RBAC for service providers API
This commit updates the policies for service providers API
to understand scope checking and account for a read-only role.
This is part of a broader series of changes across OpenStack to
provide a consistent RBAC experience and improve security.
Partially-Implements blu... | Python | apache-2.0 | mahak/neutron,mahak/neutron,openstack/neutron,openstack/neutron,openstack/neutron,mahak/neutron | # 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, software
# distributed u... | # 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, software
# distributed u... | <commit_before># 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, software
#... | # 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, software
# distributed u... | # 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, software
# distributed u... | <commit_before># 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, software
#... |
c916cc05c57cdda5a9b07901af8af032a97c3841 | karma/api/__init__.py | karma/api/__init__.py | #!/usr/bin/env python
from flask import Blueprint
from flask.ext.restful import Api
api = Blueprint("api", __name__, template_folder="templates")
rest = Api(api)
from karma.api.charity import Charity, Charities
from karma.api.post import Post, Posts
# Adding resources
rest.add_resource(Charity, '/charities/<int... | #!/usr/bin/env python
from flask import Blueprint
from flask.ext.restful import Api
api = Blueprint("api", __name__, template_folder="templates")
rest = Api(api)
from karma.api.charity import Charity, Charities
from karma.api.post import Post, Posts
# Adding resources
rest.add_resource(Charity, '/charities/<int... | Add changes to url thingies | Add changes to url thingies
| Python | mit | hamhut1066/ghu-hack,hamhut1066/ghu-hack | #!/usr/bin/env python
from flask import Blueprint
from flask.ext.restful import Api
api = Blueprint("api", __name__, template_folder="templates")
rest = Api(api)
from karma.api.charity import Charity, Charities
from karma.api.post import Post, Posts
# Adding resources
rest.add_resource(Charity, '/charities/<int... | #!/usr/bin/env python
from flask import Blueprint
from flask.ext.restful import Api
api = Blueprint("api", __name__, template_folder="templates")
rest = Api(api)
from karma.api.charity import Charity, Charities
from karma.api.post import Post, Posts
# Adding resources
rest.add_resource(Charity, '/charities/<int... | <commit_before>#!/usr/bin/env python
from flask import Blueprint
from flask.ext.restful import Api
api = Blueprint("api", __name__, template_folder="templates")
rest = Api(api)
from karma.api.charity import Charity, Charities
from karma.api.post import Post, Posts
# Adding resources
rest.add_resource(Charity, '... | #!/usr/bin/env python
from flask import Blueprint
from flask.ext.restful import Api
api = Blueprint("api", __name__, template_folder="templates")
rest = Api(api)
from karma.api.charity import Charity, Charities
from karma.api.post import Post, Posts
# Adding resources
rest.add_resource(Charity, '/charities/<int... | #!/usr/bin/env python
from flask import Blueprint
from flask.ext.restful import Api
api = Blueprint("api", __name__, template_folder="templates")
rest = Api(api)
from karma.api.charity import Charity, Charities
from karma.api.post import Post, Posts
# Adding resources
rest.add_resource(Charity, '/charities/<int... | <commit_before>#!/usr/bin/env python
from flask import Blueprint
from flask.ext.restful import Api
api = Blueprint("api", __name__, template_folder="templates")
rest = Api(api)
from karma.api.charity import Charity, Charities
from karma.api.post import Post, Posts
# Adding resources
rest.add_resource(Charity, '... |
026d887dd85bdcc5db97d65706509a18252de8ba | l10n_ar_aeroo_sale/__openerp__.py | l10n_ar_aeroo_sale/__openerp__.py | # -*- coding: utf-8 -*-
{
'name': 'Argentinian Like Sale Order Aeroo Report',
'version': '1.0',
'category': 'Localization/Argentina',
'sequence': 14,
'summary': '',
'description': """
Argentinian Like Sale Order / Quotation Aeroo Report
====================================================
""... | # -*- coding: utf-8 -*-
{
'name': 'Argentinian Like Sale Order Aeroo Report',
'version': '1.0',
'category': 'Localization/Argentina',
'sequence': 14,
'summary': '',
'description': """
Argentinian Like Sale Order / Quotation Aeroo Report
====================================================
""... | FIX dependency on aeroo rpoert | FIX dependency on aeroo rpoert
| Python | agpl-3.0 | ingadhoc/argentina-reporting | # -*- coding: utf-8 -*-
{
'name': 'Argentinian Like Sale Order Aeroo Report',
'version': '1.0',
'category': 'Localization/Argentina',
'sequence': 14,
'summary': '',
'description': """
Argentinian Like Sale Order / Quotation Aeroo Report
====================================================
""... | # -*- coding: utf-8 -*-
{
'name': 'Argentinian Like Sale Order Aeroo Report',
'version': '1.0',
'category': 'Localization/Argentina',
'sequence': 14,
'summary': '',
'description': """
Argentinian Like Sale Order / Quotation Aeroo Report
====================================================
""... | <commit_before># -*- coding: utf-8 -*-
{
'name': 'Argentinian Like Sale Order Aeroo Report',
'version': '1.0',
'category': 'Localization/Argentina',
'sequence': 14,
'summary': '',
'description': """
Argentinian Like Sale Order / Quotation Aeroo Report
============================================... | # -*- coding: utf-8 -*-
{
'name': 'Argentinian Like Sale Order Aeroo Report',
'version': '1.0',
'category': 'Localization/Argentina',
'sequence': 14,
'summary': '',
'description': """
Argentinian Like Sale Order / Quotation Aeroo Report
====================================================
""... | # -*- coding: utf-8 -*-
{
'name': 'Argentinian Like Sale Order Aeroo Report',
'version': '1.0',
'category': 'Localization/Argentina',
'sequence': 14,
'summary': '',
'description': """
Argentinian Like Sale Order / Quotation Aeroo Report
====================================================
""... | <commit_before># -*- coding: utf-8 -*-
{
'name': 'Argentinian Like Sale Order Aeroo Report',
'version': '1.0',
'category': 'Localization/Argentina',
'sequence': 14,
'summary': '',
'description': """
Argentinian Like Sale Order / Quotation Aeroo Report
============================================... |
6f745ae05a22031a36cb5cedc6b627cbf7ba6512 | import_goodline_iptv.py | import_goodline_iptv.py | #!/usr/bin/env python3
import configargparse
from goodline_iptv.importer import do_import
if __name__ == '__main__':
parser = configargparse.ArgParser()
parser.add_argument('-o', '--out-dir', required=True, help='Output directory')
parser.add_argument('-e', '--encoding',
default... | #!/usr/bin/env python3
import configargparse
from goodline_iptv.importer import do_import
if __name__ == '__main__':
parser = configargparse.ArgParser()
parser.add_argument('-o', '--out-dir',
required=True,
env_var='OUTDIR',
help='Outpu... | Add environment variable for ability to set the output directory | Add environment variable for ability to set the output directory
| Python | mit | nsadovskiy/goodline_tv | #!/usr/bin/env python3
import configargparse
from goodline_iptv.importer import do_import
if __name__ == '__main__':
parser = configargparse.ArgParser()
parser.add_argument('-o', '--out-dir', required=True, help='Output directory')
parser.add_argument('-e', '--encoding',
default... | #!/usr/bin/env python3
import configargparse
from goodline_iptv.importer import do_import
if __name__ == '__main__':
parser = configargparse.ArgParser()
parser.add_argument('-o', '--out-dir',
required=True,
env_var='OUTDIR',
help='Outpu... | <commit_before>#!/usr/bin/env python3
import configargparse
from goodline_iptv.importer import do_import
if __name__ == '__main__':
parser = configargparse.ArgParser()
parser.add_argument('-o', '--out-dir', required=True, help='Output directory')
parser.add_argument('-e', '--encoding',
... | #!/usr/bin/env python3
import configargparse
from goodline_iptv.importer import do_import
if __name__ == '__main__':
parser = configargparse.ArgParser()
parser.add_argument('-o', '--out-dir',
required=True,
env_var='OUTDIR',
help='Outpu... | #!/usr/bin/env python3
import configargparse
from goodline_iptv.importer import do_import
if __name__ == '__main__':
parser = configargparse.ArgParser()
parser.add_argument('-o', '--out-dir', required=True, help='Output directory')
parser.add_argument('-e', '--encoding',
default... | <commit_before>#!/usr/bin/env python3
import configargparse
from goodline_iptv.importer import do_import
if __name__ == '__main__':
parser = configargparse.ArgParser()
parser.add_argument('-o', '--out-dir', required=True, help='Output directory')
parser.add_argument('-e', '--encoding',
... |
5c8fd314dd89d8964cc5cb75c2b57ed32be275c5 | plsync/users.py | plsync/users.py |
# NOTE: User roles are not managed here. Visit PlanetLab to change user roles.
user_list = [('Stephen', 'Stuart', 'sstuart@google.com'),
('Will', 'Hawkins', 'hawkinsw@opentechinstitute.org'),
('Jordan', 'McCarthy', 'mccarthy@opentechinstitute.org'),
('Chris', 'Ritzo', 'cri... |
# NOTE: User roles are not managed here. Visit PlanetLab to change user roles.
user_list = [('Stephen', 'Stuart', 'sstuart@google.com'),
('Will', 'Hawkins', 'hawkinsw@opentechinstitute.org'),
('Jordan', 'McCarthy', 'mccarthy@opentechinstitute.org'),
('Chris', 'Ritzo', 'cri... | Add pboothe temporarily for testing | Add pboothe temporarily for testing
| Python | apache-2.0 | jheretic/operator,stephen-soltesz/operator,nkinkade/operator,critzo/operator,critzo/operator,jheretic/operator,nkinkade/operator,m-lab/operator,salarcon215/operator,m-lab/operator,salarcon215/operator,stephen-soltesz/operator |
# NOTE: User roles are not managed here. Visit PlanetLab to change user roles.
user_list = [('Stephen', 'Stuart', 'sstuart@google.com'),
('Will', 'Hawkins', 'hawkinsw@opentechinstitute.org'),
('Jordan', 'McCarthy', 'mccarthy@opentechinstitute.org'),
('Chris', 'Ritzo', 'cri... |
# NOTE: User roles are not managed here. Visit PlanetLab to change user roles.
user_list = [('Stephen', 'Stuart', 'sstuart@google.com'),
('Will', 'Hawkins', 'hawkinsw@opentechinstitute.org'),
('Jordan', 'McCarthy', 'mccarthy@opentechinstitute.org'),
('Chris', 'Ritzo', 'cri... | <commit_before>
# NOTE: User roles are not managed here. Visit PlanetLab to change user roles.
user_list = [('Stephen', 'Stuart', 'sstuart@google.com'),
('Will', 'Hawkins', 'hawkinsw@opentechinstitute.org'),
('Jordan', 'McCarthy', 'mccarthy@opentechinstitute.org'),
('Chris', ... |
# NOTE: User roles are not managed here. Visit PlanetLab to change user roles.
user_list = [('Stephen', 'Stuart', 'sstuart@google.com'),
('Will', 'Hawkins', 'hawkinsw@opentechinstitute.org'),
('Jordan', 'McCarthy', 'mccarthy@opentechinstitute.org'),
('Chris', 'Ritzo', 'cri... |
# NOTE: User roles are not managed here. Visit PlanetLab to change user roles.
user_list = [('Stephen', 'Stuart', 'sstuart@google.com'),
('Will', 'Hawkins', 'hawkinsw@opentechinstitute.org'),
('Jordan', 'McCarthy', 'mccarthy@opentechinstitute.org'),
('Chris', 'Ritzo', 'cri... | <commit_before>
# NOTE: User roles are not managed here. Visit PlanetLab to change user roles.
user_list = [('Stephen', 'Stuart', 'sstuart@google.com'),
('Will', 'Hawkins', 'hawkinsw@opentechinstitute.org'),
('Jordan', 'McCarthy', 'mccarthy@opentechinstitute.org'),
('Chris', ... |
4f9b01dcf194c5ce05640852cf8f436fa4e3bf80 | manager/urls.py | manager/urls.py | from django.conf.urls import url
from manager import views
_PACKAGE_NAME_REGEX = r'(?P<package_name>[a-zA-Z0-9_+-]+)'
_PACKAGE_NAME_REGEX_WITH_EMPTY = r'(?P<package_name>[a-zA-Z0-9_+-]*)'
_BUILD_NUMBER_REGEX = r'(?P<build_number>\d+)'
_REGEX = {'name': _PACKAGE_NAME_REGEX, 'number': _BUILD_NUMBER_REGEX}
urlpatterns ... | from django.conf.urls import url
from manager import views
_PACKAGE_NAME_REGEX = r'(?P<package_name>[a-zA-Z0-9_+-.]+)'
_PACKAGE_NAME_REGEX_WITH_EMPTY = r'(?P<package_name>[a-zA-Z0-9_+-.]*)'
_BUILD_NUMBER_REGEX = r'(?P<build_number>\d+)'
_REGEX = {'name': _PACKAGE_NAME_REGEX, 'number': _BUILD_NUMBER_REGEX}
urlpattern... | Allow '.' in package name | Allow '.' in package name
| Python | mit | colajam93/aurpackager,colajam93/aurpackager,colajam93/aurpackager,colajam93/aurpackager | from django.conf.urls import url
from manager import views
_PACKAGE_NAME_REGEX = r'(?P<package_name>[a-zA-Z0-9_+-]+)'
_PACKAGE_NAME_REGEX_WITH_EMPTY = r'(?P<package_name>[a-zA-Z0-9_+-]*)'
_BUILD_NUMBER_REGEX = r'(?P<build_number>\d+)'
_REGEX = {'name': _PACKAGE_NAME_REGEX, 'number': _BUILD_NUMBER_REGEX}
urlpatterns ... | from django.conf.urls import url
from manager import views
_PACKAGE_NAME_REGEX = r'(?P<package_name>[a-zA-Z0-9_+-.]+)'
_PACKAGE_NAME_REGEX_WITH_EMPTY = r'(?P<package_name>[a-zA-Z0-9_+-.]*)'
_BUILD_NUMBER_REGEX = r'(?P<build_number>\d+)'
_REGEX = {'name': _PACKAGE_NAME_REGEX, 'number': _BUILD_NUMBER_REGEX}
urlpattern... | <commit_before>from django.conf.urls import url
from manager import views
_PACKAGE_NAME_REGEX = r'(?P<package_name>[a-zA-Z0-9_+-]+)'
_PACKAGE_NAME_REGEX_WITH_EMPTY = r'(?P<package_name>[a-zA-Z0-9_+-]*)'
_BUILD_NUMBER_REGEX = r'(?P<build_number>\d+)'
_REGEX = {'name': _PACKAGE_NAME_REGEX, 'number': _BUILD_NUMBER_REGEX... | from django.conf.urls import url
from manager import views
_PACKAGE_NAME_REGEX = r'(?P<package_name>[a-zA-Z0-9_+-.]+)'
_PACKAGE_NAME_REGEX_WITH_EMPTY = r'(?P<package_name>[a-zA-Z0-9_+-.]*)'
_BUILD_NUMBER_REGEX = r'(?P<build_number>\d+)'
_REGEX = {'name': _PACKAGE_NAME_REGEX, 'number': _BUILD_NUMBER_REGEX}
urlpattern... | from django.conf.urls import url
from manager import views
_PACKAGE_NAME_REGEX = r'(?P<package_name>[a-zA-Z0-9_+-]+)'
_PACKAGE_NAME_REGEX_WITH_EMPTY = r'(?P<package_name>[a-zA-Z0-9_+-]*)'
_BUILD_NUMBER_REGEX = r'(?P<build_number>\d+)'
_REGEX = {'name': _PACKAGE_NAME_REGEX, 'number': _BUILD_NUMBER_REGEX}
urlpatterns ... | <commit_before>from django.conf.urls import url
from manager import views
_PACKAGE_NAME_REGEX = r'(?P<package_name>[a-zA-Z0-9_+-]+)'
_PACKAGE_NAME_REGEX_WITH_EMPTY = r'(?P<package_name>[a-zA-Z0-9_+-]*)'
_BUILD_NUMBER_REGEX = r'(?P<build_number>\d+)'
_REGEX = {'name': _PACKAGE_NAME_REGEX, 'number': _BUILD_NUMBER_REGEX... |
88b81ee89800592bccf0a714ae79be74507c8f29 | test_engine.py | test_engine.py | import engine
VALID_COORDS = [(x, y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID_COORDS = [
(0, 0), (-1, -1),
(96, 49), (96, 48),
(105, 49), (104, 48),
(96, 56), (97, 57),
(105, 56), (104, 57)
]
VALID_A1 = [chr(x) + chr(y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID... | import engine
VALID_COORDS = [(x, y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID_COORDS = [
(0, 0), (-1, -1),
(96, 49), (96, 48),
(105, 49), (104, 48),
(96, 56), (97, 57),
(105, 56), (104, 57)
]
VALID_A1 = [chr(x) + chr(y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID... | Add test_a1_to_coord() to assert that only valid board coordinates are in teh _a1_to_coord dictionary | Add test_a1_to_coord() to assert that only valid board coordinates are in teh _a1_to_coord dictionary
| Python | mit | EyuelAbebe/gamer,EyuelAbebe/gamer | import engine
VALID_COORDS = [(x, y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID_COORDS = [
(0, 0), (-1, -1),
(96, 49), (96, 48),
(105, 49), (104, 48),
(96, 56), (97, 57),
(105, 56), (104, 57)
]
VALID_A1 = [chr(x) + chr(y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID... | import engine
VALID_COORDS = [(x, y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID_COORDS = [
(0, 0), (-1, -1),
(96, 49), (96, 48),
(105, 49), (104, 48),
(96, 56), (97, 57),
(105, 56), (104, 57)
]
VALID_A1 = [chr(x) + chr(y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID... | <commit_before>import engine
VALID_COORDS = [(x, y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID_COORDS = [
(0, 0), (-1, -1),
(96, 49), (96, 48),
(105, 49), (104, 48),
(96, 56), (97, 57),
(105, 56), (104, 57)
]
VALID_A1 = [chr(x) + chr(y) for x in xrange(97, 105) for y in xrange(4... | import engine
VALID_COORDS = [(x, y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID_COORDS = [
(0, 0), (-1, -1),
(96, 49), (96, 48),
(105, 49), (104, 48),
(96, 56), (97, 57),
(105, 56), (104, 57)
]
VALID_A1 = [chr(x) + chr(y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID... | import engine
VALID_COORDS = [(x, y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID_COORDS = [
(0, 0), (-1, -1),
(96, 49), (96, 48),
(105, 49), (104, 48),
(96, 56), (97, 57),
(105, 56), (104, 57)
]
VALID_A1 = [chr(x) + chr(y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID... | <commit_before>import engine
VALID_COORDS = [(x, y) for x in xrange(97, 105) for y in xrange(49, 57)]
INVALID_COORDS = [
(0, 0), (-1, -1),
(96, 49), (96, 48),
(105, 49), (104, 48),
(96, 56), (97, 57),
(105, 56), (104, 57)
]
VALID_A1 = [chr(x) + chr(y) for x in xrange(97, 105) for y in xrange(4... |
4c3dd0c9d27af0f186f81c4fed0003a9190b4d9e | jal_stats/stats/serializers.py | jal_stats/stats/serializers.py | # from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Activity, Stat
class StatSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Stat
fields = ('id', 'activity', 'reps', 'date')
def create(self, validated_data):
... | # from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Activity, Stat
class StatAddSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Stat
fields = ('id', 'reps', 'date')
class StatSerializer(StatAddSerializer):
class M... | Add new serializer for StatAdd that doesn't have activity | Add new serializer for StatAdd that doesn't have activity
| Python | mit | jal-stats/django | # from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Activity, Stat
class StatSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Stat
fields = ('id', 'activity', 'reps', 'date')
def create(self, validated_data):
... | # from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Activity, Stat
class StatAddSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Stat
fields = ('id', 'reps', 'date')
class StatSerializer(StatAddSerializer):
class M... | <commit_before># from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Activity, Stat
class StatSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Stat
fields = ('id', 'activity', 'reps', 'date')
def create(self, validated... | # from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Activity, Stat
class StatAddSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Stat
fields = ('id', 'reps', 'date')
class StatSerializer(StatAddSerializer):
class M... | # from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Activity, Stat
class StatSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Stat
fields = ('id', 'activity', 'reps', 'date')
def create(self, validated_data):
... | <commit_before># from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Activity, Stat
class StatSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Stat
fields = ('id', 'activity', 'reps', 'date')
def create(self, validated... |
fd6702fbb43eb4e6c5129ac6026908946f03c1a7 | paws/handler.py | paws/handler.py | from .request import Request
from .response import response
class Handler(object):
'''
Simple dispatcher class.
'''
def __call__(self, event, context):
self.request = request = Request(event, context)
func = getattr(self, self.event['httpMethod'], self.invalid)
return func(req... | from .request import Request
from .response import response
class Handler(object):
'''
Simple dispatcher class.
'''
def __init__(self, event, context):
self.request = Request(event, context)
def __call__(self, event, context):
func = getattr(self, self.event['httpMethod'], self.in... | Move request construction to init | Move request construction to init
| Python | bsd-3-clause | funkybob/paws | from .request import Request
from .response import response
class Handler(object):
'''
Simple dispatcher class.
'''
def __call__(self, event, context):
self.request = request = Request(event, context)
func = getattr(self, self.event['httpMethod'], self.invalid)
return func(req... | from .request import Request
from .response import response
class Handler(object):
'''
Simple dispatcher class.
'''
def __init__(self, event, context):
self.request = Request(event, context)
def __call__(self, event, context):
func = getattr(self, self.event['httpMethod'], self.in... | <commit_before>from .request import Request
from .response import response
class Handler(object):
'''
Simple dispatcher class.
'''
def __call__(self, event, context):
self.request = request = Request(event, context)
func = getattr(self, self.event['httpMethod'], self.invalid)
... | from .request import Request
from .response import response
class Handler(object):
'''
Simple dispatcher class.
'''
def __init__(self, event, context):
self.request = Request(event, context)
def __call__(self, event, context):
func = getattr(self, self.event['httpMethod'], self.in... | from .request import Request
from .response import response
class Handler(object):
'''
Simple dispatcher class.
'''
def __call__(self, event, context):
self.request = request = Request(event, context)
func = getattr(self, self.event['httpMethod'], self.invalid)
return func(req... | <commit_before>from .request import Request
from .response import response
class Handler(object):
'''
Simple dispatcher class.
'''
def __call__(self, event, context):
self.request = request = Request(event, context)
func = getattr(self, self.event['httpMethod'], self.invalid)
... |
513709e123c63e1eb30065b6f35c18faceac820b | user.py | user.py | import re
class User:
Groups = {' ':0,'+':1,'☆':1,'%':2,'@':3,'*':3.1,'&':4,'#':5,'~':6}
@staticmethod
def compareRanks(rank1, rank2):
try:
return User.Groups[rank1] >= User.Groups[rank2]
except:
if not rank1 in User.Groups:
print('{rank} is not a supp... | import re
class User:
Groups = {' ':0,'+':1,'☆':1,'%':2,'@':3,'*':3.1,'&':4,'#':5,'~':6}
@staticmethod
def compareRanks(rank1, rank2):
try:
return User.Groups[rank1] >= User.Groups[rank2]
except:
if not rank1 in User.Groups:
print('{rank} is not a supp... | Add default rank to User for simplified tests | Add default rank to User for simplified tests
| Python | mit | QuiteQuiet/PokemonShowdownBot | import re
class User:
Groups = {' ':0,'+':1,'☆':1,'%':2,'@':3,'*':3.1,'&':4,'#':5,'~':6}
@staticmethod
def compareRanks(rank1, rank2):
try:
return User.Groups[rank1] >= User.Groups[rank2]
except:
if not rank1 in User.Groups:
print('{rank} is not a supp... | import re
class User:
Groups = {' ':0,'+':1,'☆':1,'%':2,'@':3,'*':3.1,'&':4,'#':5,'~':6}
@staticmethod
def compareRanks(rank1, rank2):
try:
return User.Groups[rank1] >= User.Groups[rank2]
except:
if not rank1 in User.Groups:
print('{rank} is not a supp... | <commit_before>import re
class User:
Groups = {' ':0,'+':1,'☆':1,'%':2,'@':3,'*':3.1,'&':4,'#':5,'~':6}
@staticmethod
def compareRanks(rank1, rank2):
try:
return User.Groups[rank1] >= User.Groups[rank2]
except:
if not rank1 in User.Groups:
print('{rank... | import re
class User:
Groups = {' ':0,'+':1,'☆':1,'%':2,'@':3,'*':3.1,'&':4,'#':5,'~':6}
@staticmethod
def compareRanks(rank1, rank2):
try:
return User.Groups[rank1] >= User.Groups[rank2]
except:
if not rank1 in User.Groups:
print('{rank} is not a supp... | import re
class User:
Groups = {' ':0,'+':1,'☆':1,'%':2,'@':3,'*':3.1,'&':4,'#':5,'~':6}
@staticmethod
def compareRanks(rank1, rank2):
try:
return User.Groups[rank1] >= User.Groups[rank2]
except:
if not rank1 in User.Groups:
print('{rank} is not a supp... | <commit_before>import re
class User:
Groups = {' ':0,'+':1,'☆':1,'%':2,'@':3,'*':3.1,'&':4,'#':5,'~':6}
@staticmethod
def compareRanks(rank1, rank2):
try:
return User.Groups[rank1] >= User.Groups[rank2]
except:
if not rank1 in User.Groups:
print('{rank... |
bdcf90a0fdf782b1c6cfd261e0dbb208e013eb1b | python/day12.py | python/day12.py | #!/usr/local/bin/python3
import json
import pathlib
input_file = pathlib.Path(__file__).parent.parent.joinpath('day12_input.txt')
def sum_data(d):
total = 0
if isinstance(d, dict):
d = d.values()
for item in d:
if isinstance(item, int):
total += item
elif isinstance(... | #!/usr/local/bin/python3
import json
import pathlib
input_file = pathlib.Path(__file__).parent.parent.joinpath('day12_input.txt')
def sum_data(d):
total = 0
if isinstance(d, dict):
d = d.values()
if 'red' in d: return 0
for item in d:
if isinstance(item, int):
total ... | Add day 12 part two solution in python | Add day 12 part two solution in python
| Python | mit | robjwells/adventofcode-solutions,robjwells/adventofcode-solutions,robjwells/adventofcode-solutions,robjwells/adventofcode-solutions,robjwells/adventofcode-solutions,robjwells/adventofcode-solutions | #!/usr/local/bin/python3
import json
import pathlib
input_file = pathlib.Path(__file__).parent.parent.joinpath('day12_input.txt')
def sum_data(d):
total = 0
if isinstance(d, dict):
d = d.values()
for item in d:
if isinstance(item, int):
total += item
elif isinstance(... | #!/usr/local/bin/python3
import json
import pathlib
input_file = pathlib.Path(__file__).parent.parent.joinpath('day12_input.txt')
def sum_data(d):
total = 0
if isinstance(d, dict):
d = d.values()
if 'red' in d: return 0
for item in d:
if isinstance(item, int):
total ... | <commit_before>#!/usr/local/bin/python3
import json
import pathlib
input_file = pathlib.Path(__file__).parent.parent.joinpath('day12_input.txt')
def sum_data(d):
total = 0
if isinstance(d, dict):
d = d.values()
for item in d:
if isinstance(item, int):
total += item
e... | #!/usr/local/bin/python3
import json
import pathlib
input_file = pathlib.Path(__file__).parent.parent.joinpath('day12_input.txt')
def sum_data(d):
total = 0
if isinstance(d, dict):
d = d.values()
if 'red' in d: return 0
for item in d:
if isinstance(item, int):
total ... | #!/usr/local/bin/python3
import json
import pathlib
input_file = pathlib.Path(__file__).parent.parent.joinpath('day12_input.txt')
def sum_data(d):
total = 0
if isinstance(d, dict):
d = d.values()
for item in d:
if isinstance(item, int):
total += item
elif isinstance(... | <commit_before>#!/usr/local/bin/python3
import json
import pathlib
input_file = pathlib.Path(__file__).parent.parent.joinpath('day12_input.txt')
def sum_data(d):
total = 0
if isinstance(d, dict):
d = d.values()
for item in d:
if isinstance(item, int):
total += item
e... |
025b8915306670ac45f200ac4cbf32115eab53c7 | python/setup.py | python/setup.py | from setuptools import setup
# This is the cabb_scheduler Python library.
# Jamie Stevens 2017
# ATCA Senior Systems Scientist
# Jamie.Stevens@csiro.au
setup(name='cabb_scheduler',
version='1.1',
description='CABB Scheduling Python Library',
url='https://github.com/ste616/cabb-schedule-api',
a... | from setuptools import setup
# This is the cabb_scheduler Python library.
# Jamie Stevens 2017
# ATCA Senior Systems Scientist
# Jamie.Stevens@csiro.au
setup(name='cabb_scheduler',
version='1.2',
description='CABB Scheduling Python Library',
url='https://github.com/ste616/cabb-schedule-api',
a... | Change the library version number. | Change the library version number.
| Python | mit | ste616/cabb-schedule-api | from setuptools import setup
# This is the cabb_scheduler Python library.
# Jamie Stevens 2017
# ATCA Senior Systems Scientist
# Jamie.Stevens@csiro.au
setup(name='cabb_scheduler',
version='1.1',
description='CABB Scheduling Python Library',
url='https://github.com/ste616/cabb-schedule-api',
a... | from setuptools import setup
# This is the cabb_scheduler Python library.
# Jamie Stevens 2017
# ATCA Senior Systems Scientist
# Jamie.Stevens@csiro.au
setup(name='cabb_scheduler',
version='1.2',
description='CABB Scheduling Python Library',
url='https://github.com/ste616/cabb-schedule-api',
a... | <commit_before>from setuptools import setup
# This is the cabb_scheduler Python library.
# Jamie Stevens 2017
# ATCA Senior Systems Scientist
# Jamie.Stevens@csiro.au
setup(name='cabb_scheduler',
version='1.1',
description='CABB Scheduling Python Library',
url='https://github.com/ste616/cabb-schedul... | from setuptools import setup
# This is the cabb_scheduler Python library.
# Jamie Stevens 2017
# ATCA Senior Systems Scientist
# Jamie.Stevens@csiro.au
setup(name='cabb_scheduler',
version='1.2',
description='CABB Scheduling Python Library',
url='https://github.com/ste616/cabb-schedule-api',
a... | from setuptools import setup
# This is the cabb_scheduler Python library.
# Jamie Stevens 2017
# ATCA Senior Systems Scientist
# Jamie.Stevens@csiro.au
setup(name='cabb_scheduler',
version='1.1',
description='CABB Scheduling Python Library',
url='https://github.com/ste616/cabb-schedule-api',
a... | <commit_before>from setuptools import setup
# This is the cabb_scheduler Python library.
# Jamie Stevens 2017
# ATCA Senior Systems Scientist
# Jamie.Stevens@csiro.au
setup(name='cabb_scheduler',
version='1.1',
description='CABB Scheduling Python Library',
url='https://github.com/ste616/cabb-schedul... |
3436b94a4c69b843c65f6ddf6756c18ca540c090 | linked-list/is-list-palindrome.py | linked-list/is-list-palindrome.py | # Given a singly linked list of integers, determine whether or not it's a palindrome
class Node(object): # define constructor
def __init__(self, value):
self.value = value
self.next = None
def is_list_palindrome(l):
if not l.value or not l.next.value:
return True
def create_nodes(l):
root = Node(-1)
current... | # Given a singly linked list of integers, determine whether or not it's a palindrome
class Node(object): # define constructor
def __init__(self, value):
self.value = value
self.next = None
def is_list_palindrome(l):
if not l.value or not l.next.value:
return True
fake_head = Node(None)
fake_head.next = l
f... | Create fast node that is twice the speed of slow node to get to center of list | Create fast node that is twice the speed of slow node to get to center of list
| Python | mit | derekmpham/interview-prep,derekmpham/interview-prep | # Given a singly linked list of integers, determine whether or not it's a palindrome
class Node(object): # define constructor
def __init__(self, value):
self.value = value
self.next = None
def is_list_palindrome(l):
if not l.value or not l.next.value:
return True
def create_nodes(l):
root = Node(-1)
current... | # Given a singly linked list of integers, determine whether or not it's a palindrome
class Node(object): # define constructor
def __init__(self, value):
self.value = value
self.next = None
def is_list_palindrome(l):
if not l.value or not l.next.value:
return True
fake_head = Node(None)
fake_head.next = l
f... | <commit_before># Given a singly linked list of integers, determine whether or not it's a palindrome
class Node(object): # define constructor
def __init__(self, value):
self.value = value
self.next = None
def is_list_palindrome(l):
if not l.value or not l.next.value:
return True
def create_nodes(l):
root = No... | # Given a singly linked list of integers, determine whether or not it's a palindrome
class Node(object): # define constructor
def __init__(self, value):
self.value = value
self.next = None
def is_list_palindrome(l):
if not l.value or not l.next.value:
return True
fake_head = Node(None)
fake_head.next = l
f... | # Given a singly linked list of integers, determine whether or not it's a palindrome
class Node(object): # define constructor
def __init__(self, value):
self.value = value
self.next = None
def is_list_palindrome(l):
if not l.value or not l.next.value:
return True
def create_nodes(l):
root = Node(-1)
current... | <commit_before># Given a singly linked list of integers, determine whether or not it's a palindrome
class Node(object): # define constructor
def __init__(self, value):
self.value = value
self.next = None
def is_list_palindrome(l):
if not l.value or not l.next.value:
return True
def create_nodes(l):
root = No... |
a1a9ab2b2c0ca7749984f5ad6e6430980e0d0ecc | tests/basics/list_sort.py | tests/basics/list_sort.py | l = [1, 3, 2, 5]
print(l)
l.sort()
print(l)
l.sort(key=lambda x: -x)
print(l)
l.sort(key=lambda x: -x, reverse=True)
print(l)
l.sort(reverse=True)
print(l)
l.sort(reverse=False)
print(l)
| l = [1, 3, 2, 5]
print(l)
print(sorted(l))
l.sort()
print(l)
print(l == sorted(l))
print(sorted(l, key=lambda x: -x))
l.sort(key=lambda x: -x)
print(l)
print(l == sorted(l, key=lambda x: -x))
print(sorted(l, key=lambda x: -x, reverse=True))
l.sort(key=lambda x: -x, reverse=True)
print(l)
print(l == sorted(l, key=lam... | Add tests for sorted() function and check that sorted(list) produces same output as list.sort() | Add tests for sorted() function
and check that sorted(list) produces same output as list.sort()
| Python | mit | MrSurly/micropython-esp32,KISSMonX/micropython,mpalomer/micropython,mianos/micropython,ernesto-g/micropython,dxxb/micropython,tuc-osg/micropython,lbattraw/micropython,turbinenreiter/micropython,swegener/micropython,swegener/micropython,praemdonck/micropython,SungEun-Steve-Kim/test-mp,pfalcon/micropython,pozetroninc/mic... | l = [1, 3, 2, 5]
print(l)
l.sort()
print(l)
l.sort(key=lambda x: -x)
print(l)
l.sort(key=lambda x: -x, reverse=True)
print(l)
l.sort(reverse=True)
print(l)
l.sort(reverse=False)
print(l)
Add tests for sorted() function
and check that sorted(list) produces same output as list.sort() | l = [1, 3, 2, 5]
print(l)
print(sorted(l))
l.sort()
print(l)
print(l == sorted(l))
print(sorted(l, key=lambda x: -x))
l.sort(key=lambda x: -x)
print(l)
print(l == sorted(l, key=lambda x: -x))
print(sorted(l, key=lambda x: -x, reverse=True))
l.sort(key=lambda x: -x, reverse=True)
print(l)
print(l == sorted(l, key=lam... | <commit_before>l = [1, 3, 2, 5]
print(l)
l.sort()
print(l)
l.sort(key=lambda x: -x)
print(l)
l.sort(key=lambda x: -x, reverse=True)
print(l)
l.sort(reverse=True)
print(l)
l.sort(reverse=False)
print(l)
<commit_msg>Add tests for sorted() function
and check that sorted(list) produces same output as list.sort()<commit_af... | l = [1, 3, 2, 5]
print(l)
print(sorted(l))
l.sort()
print(l)
print(l == sorted(l))
print(sorted(l, key=lambda x: -x))
l.sort(key=lambda x: -x)
print(l)
print(l == sorted(l, key=lambda x: -x))
print(sorted(l, key=lambda x: -x, reverse=True))
l.sort(key=lambda x: -x, reverse=True)
print(l)
print(l == sorted(l, key=lam... | l = [1, 3, 2, 5]
print(l)
l.sort()
print(l)
l.sort(key=lambda x: -x)
print(l)
l.sort(key=lambda x: -x, reverse=True)
print(l)
l.sort(reverse=True)
print(l)
l.sort(reverse=False)
print(l)
Add tests for sorted() function
and check that sorted(list) produces same output as list.sort()l = [1, 3, 2, 5]
print(l)
print(sort... | <commit_before>l = [1, 3, 2, 5]
print(l)
l.sort()
print(l)
l.sort(key=lambda x: -x)
print(l)
l.sort(key=lambda x: -x, reverse=True)
print(l)
l.sort(reverse=True)
print(l)
l.sort(reverse=False)
print(l)
<commit_msg>Add tests for sorted() function
and check that sorted(list) produces same output as list.sort()<commit_af... |
2d688f97b9869fdfed9237b91fdce287278e3c6c | wsgi.py | wsgi.py | import os
from elasticsearch_raven.transport import ElasticsearchTransport
from elasticsearch_raven.utils import get_index
host = os.environ.get('ELASTICSEARCH_HOST', 'localhost:9200')
transport = ElasticsearchTransport(host)
def application(environ, start_response):
index = get_index(environ)
transport.sen... | import os
from queue import Queue
from threading import Thread
from elasticsearch_raven.transport import ElasticsearchTransport
from elasticsearch_raven.utils import get_index
host = os.environ.get('ELASTICSEARCH_HOST', 'localhost:9200')
transport = ElasticsearchTransport(host)
blocking_queue = Queue()
def send():
... | Send data to elasticsearch asynchronously. | Send data to elasticsearch asynchronously.
| Python | mit | socialwifi/elasticsearch-raven,pozytywnie/elasticsearch-raven,serathius/elasticsearch-raven | import os
from elasticsearch_raven.transport import ElasticsearchTransport
from elasticsearch_raven.utils import get_index
host = os.environ.get('ELASTICSEARCH_HOST', 'localhost:9200')
transport = ElasticsearchTransport(host)
def application(environ, start_response):
index = get_index(environ)
transport.sen... | import os
from queue import Queue
from threading import Thread
from elasticsearch_raven.transport import ElasticsearchTransport
from elasticsearch_raven.utils import get_index
host = os.environ.get('ELASTICSEARCH_HOST', 'localhost:9200')
transport = ElasticsearchTransport(host)
blocking_queue = Queue()
def send():
... | <commit_before>import os
from elasticsearch_raven.transport import ElasticsearchTransport
from elasticsearch_raven.utils import get_index
host = os.environ.get('ELASTICSEARCH_HOST', 'localhost:9200')
transport = ElasticsearchTransport(host)
def application(environ, start_response):
index = get_index(environ)
... | import os
from queue import Queue
from threading import Thread
from elasticsearch_raven.transport import ElasticsearchTransport
from elasticsearch_raven.utils import get_index
host = os.environ.get('ELASTICSEARCH_HOST', 'localhost:9200')
transport = ElasticsearchTransport(host)
blocking_queue = Queue()
def send():
... | import os
from elasticsearch_raven.transport import ElasticsearchTransport
from elasticsearch_raven.utils import get_index
host = os.environ.get('ELASTICSEARCH_HOST', 'localhost:9200')
transport = ElasticsearchTransport(host)
def application(environ, start_response):
index = get_index(environ)
transport.sen... | <commit_before>import os
from elasticsearch_raven.transport import ElasticsearchTransport
from elasticsearch_raven.utils import get_index
host = os.environ.get('ELASTICSEARCH_HOST', 'localhost:9200')
transport = ElasticsearchTransport(host)
def application(environ, start_response):
index = get_index(environ)
... |
d703d7cb8d75a5c660beabccdd0082794a8471d1 | edisgo/tools/networkx_helper.py | edisgo/tools/networkx_helper.py | from networkx import OrderedGraph
def translate_df_to_graph(buses_df, lines_df, transformers_df=None):
graph = OrderedGraph()
buses = buses_df.index
# add nodes
graph.add_nodes_from(buses)
# add branches
branches = []
for line_name, line in lines_df.iterrows():
branches.append(
... | from networkx import Graph
def translate_df_to_graph(buses_df, lines_df, transformers_df=None):
graph = Graph()
buses = []
for bus_name, bus in buses_df.iterrows():
pos = (bus.x, bus.y)
buses.append((bus_name, {'pos': pos}))
# add nodes
graph.add_nodes_from(buses)
# add br... | Include the position into the graph | Include the position into the graph
| Python | agpl-3.0 | openego/eDisGo,openego/eDisGo | from networkx import OrderedGraph
def translate_df_to_graph(buses_df, lines_df, transformers_df=None):
graph = OrderedGraph()
buses = buses_df.index
# add nodes
graph.add_nodes_from(buses)
# add branches
branches = []
for line_name, line in lines_df.iterrows():
branches.append(
... | from networkx import Graph
def translate_df_to_graph(buses_df, lines_df, transformers_df=None):
graph = Graph()
buses = []
for bus_name, bus in buses_df.iterrows():
pos = (bus.x, bus.y)
buses.append((bus_name, {'pos': pos}))
# add nodes
graph.add_nodes_from(buses)
# add br... | <commit_before>from networkx import OrderedGraph
def translate_df_to_graph(buses_df, lines_df, transformers_df=None):
graph = OrderedGraph()
buses = buses_df.index
# add nodes
graph.add_nodes_from(buses)
# add branches
branches = []
for line_name, line in lines_df.iterrows():
bran... | from networkx import Graph
def translate_df_to_graph(buses_df, lines_df, transformers_df=None):
graph = Graph()
buses = []
for bus_name, bus in buses_df.iterrows():
pos = (bus.x, bus.y)
buses.append((bus_name, {'pos': pos}))
# add nodes
graph.add_nodes_from(buses)
# add br... | from networkx import OrderedGraph
def translate_df_to_graph(buses_df, lines_df, transformers_df=None):
graph = OrderedGraph()
buses = buses_df.index
# add nodes
graph.add_nodes_from(buses)
# add branches
branches = []
for line_name, line in lines_df.iterrows():
branches.append(
... | <commit_before>from networkx import OrderedGraph
def translate_df_to_graph(buses_df, lines_df, transformers_df=None):
graph = OrderedGraph()
buses = buses_df.index
# add nodes
graph.add_nodes_from(buses)
# add branches
branches = []
for line_name, line in lines_df.iterrows():
bran... |
78da548cbf7646ea1d67859cbd0946d6931b2b0d | ad-hoc-scripts/lift.py | ad-hoc-scripts/lift.py | #! /usr/bin/env python3
import sys
import json
for arg in sys.argv[1:]:
with open(arg) as f:
equajson = json.load(f)
field_list = [
"always-an-integer",
"always-positive",
"always-dimensionless",
"bound-variable",
"fixed-constant",
"special-function"
... | #! /usr/bin/env python3
import sys
import json
for arg in sys.argv[1:]:
with open(arg) as f:
equajson = json.load(f)
field_list = [
"always-an-integer",
"always-positive",
"always-dimensionless",
"bound-variable",
"fixed-constant",
"special-function"
... | Fix serious file overwriting problem. | Fix serious file overwriting problem.
| Python | mit | nbeaver/equajson | #! /usr/bin/env python3
import sys
import json
for arg in sys.argv[1:]:
with open(arg) as f:
equajson = json.load(f)
field_list = [
"always-an-integer",
"always-positive",
"always-dimensionless",
"bound-variable",
"fixed-constant",
"special-function"
... | #! /usr/bin/env python3
import sys
import json
for arg in sys.argv[1:]:
with open(arg) as f:
equajson = json.load(f)
field_list = [
"always-an-integer",
"always-positive",
"always-dimensionless",
"bound-variable",
"fixed-constant",
"special-function"
... | <commit_before>#! /usr/bin/env python3
import sys
import json
for arg in sys.argv[1:]:
with open(arg) as f:
equajson = json.load(f)
field_list = [
"always-an-integer",
"always-positive",
"always-dimensionless",
"bound-variable",
"fixed-constant",
"speci... | #! /usr/bin/env python3
import sys
import json
for arg in sys.argv[1:]:
with open(arg) as f:
equajson = json.load(f)
field_list = [
"always-an-integer",
"always-positive",
"always-dimensionless",
"bound-variable",
"fixed-constant",
"special-function"
... | #! /usr/bin/env python3
import sys
import json
for arg in sys.argv[1:]:
with open(arg) as f:
equajson = json.load(f)
field_list = [
"always-an-integer",
"always-positive",
"always-dimensionless",
"bound-variable",
"fixed-constant",
"special-function"
... | <commit_before>#! /usr/bin/env python3
import sys
import json
for arg in sys.argv[1:]:
with open(arg) as f:
equajson = json.load(f)
field_list = [
"always-an-integer",
"always-positive",
"always-dimensionless",
"bound-variable",
"fixed-constant",
"speci... |
80271752183c3f71fba9139bb77466427bd48a0a | alfred_listener/__main__.py | alfred_listener/__main__.py | #!/usr/bin/env python
import os
from argh import arg, ArghParser
from functools import wraps
CONFIG = os.environ.get('ALFRED_LISTENER_CONFIG')
def with_app(func, args):
if CONFIG is None:
raise RuntimeError('ALFRED_LISTENER_CONFIG env variable is not set.')
@wraps(func)
def wrapper(*args, **kwa... | #!/usr/bin/env python
import os
from argh import arg, ArghParser
from functools import wraps
def with_app(func):
@arg('--config', help='Path to config file')
@wraps(func)
def wrapper(*args, **kwargs):
config = args[0].config
from alfred_listener import create_app
app = create_app(... | Change the way to determine path to config file | Change the way to determine path to config file
| Python | isc | alfredhq/alfred-listener | #!/usr/bin/env python
import os
from argh import arg, ArghParser
from functools import wraps
CONFIG = os.environ.get('ALFRED_LISTENER_CONFIG')
def with_app(func, args):
if CONFIG is None:
raise RuntimeError('ALFRED_LISTENER_CONFIG env variable is not set.')
@wraps(func)
def wrapper(*args, **kwa... | #!/usr/bin/env python
import os
from argh import arg, ArghParser
from functools import wraps
def with_app(func):
@arg('--config', help='Path to config file')
@wraps(func)
def wrapper(*args, **kwargs):
config = args[0].config
from alfred_listener import create_app
app = create_app(... | <commit_before>#!/usr/bin/env python
import os
from argh import arg, ArghParser
from functools import wraps
CONFIG = os.environ.get('ALFRED_LISTENER_CONFIG')
def with_app(func, args):
if CONFIG is None:
raise RuntimeError('ALFRED_LISTENER_CONFIG env variable is not set.')
@wraps(func)
def wrapp... | #!/usr/bin/env python
import os
from argh import arg, ArghParser
from functools import wraps
def with_app(func):
@arg('--config', help='Path to config file')
@wraps(func)
def wrapper(*args, **kwargs):
config = args[0].config
from alfred_listener import create_app
app = create_app(... | #!/usr/bin/env python
import os
from argh import arg, ArghParser
from functools import wraps
CONFIG = os.environ.get('ALFRED_LISTENER_CONFIG')
def with_app(func, args):
if CONFIG is None:
raise RuntimeError('ALFRED_LISTENER_CONFIG env variable is not set.')
@wraps(func)
def wrapper(*args, **kwa... | <commit_before>#!/usr/bin/env python
import os
from argh import arg, ArghParser
from functools import wraps
CONFIG = os.environ.get('ALFRED_LISTENER_CONFIG')
def with_app(func, args):
if CONFIG is None:
raise RuntimeError('ALFRED_LISTENER_CONFIG env variable is not set.')
@wraps(func)
def wrapp... |
30b64d934d12510e2021aa3bf2e80f5837b88f35 | mnist_sequence_cli.py | mnist_sequence_cli.py | from __future__ import print_function
from mnist_sequence_api import MNIST_Sequence_API
import sys
def main():
arguments = list(sys.argv[1:])
if len(arguments) == 4:
sequence, min_spacing = list(map(int, list(arguments[0])), int(arguments[1]))
max_spacing, image_width = int(arguments[2]), int(... | from __future__ import print_function
from mnist_sequence_api import MNIST_Sequence_API
import sys
def main():
arguments = list(sys.argv[1:])
if len(arguments) == 4:
sequence, min_spacing = list(map(int, list(arguments[0]))), int(arguments[1])
max_spacing, image_width = int(arguments[2]), int(... | Fix argument inputs to list() | Fix argument inputs to list()
| Python | mit | ankitaggarwal011/MNIST-Sequence | from __future__ import print_function
from mnist_sequence_api import MNIST_Sequence_API
import sys
def main():
arguments = list(sys.argv[1:])
if len(arguments) == 4:
sequence, min_spacing = list(map(int, list(arguments[0])), int(arguments[1]))
max_spacing, image_width = int(arguments[2]), int(... | from __future__ import print_function
from mnist_sequence_api import MNIST_Sequence_API
import sys
def main():
arguments = list(sys.argv[1:])
if len(arguments) == 4:
sequence, min_spacing = list(map(int, list(arguments[0]))), int(arguments[1])
max_spacing, image_width = int(arguments[2]), int(... | <commit_before>from __future__ import print_function
from mnist_sequence_api import MNIST_Sequence_API
import sys
def main():
arguments = list(sys.argv[1:])
if len(arguments) == 4:
sequence, min_spacing = list(map(int, list(arguments[0])), int(arguments[1]))
max_spacing, image_width = int(argu... | from __future__ import print_function
from mnist_sequence_api import MNIST_Sequence_API
import sys
def main():
arguments = list(sys.argv[1:])
if len(arguments) == 4:
sequence, min_spacing = list(map(int, list(arguments[0]))), int(arguments[1])
max_spacing, image_width = int(arguments[2]), int(... | from __future__ import print_function
from mnist_sequence_api import MNIST_Sequence_API
import sys
def main():
arguments = list(sys.argv[1:])
if len(arguments) == 4:
sequence, min_spacing = list(map(int, list(arguments[0])), int(arguments[1]))
max_spacing, image_width = int(arguments[2]), int(... | <commit_before>from __future__ import print_function
from mnist_sequence_api import MNIST_Sequence_API
import sys
def main():
arguments = list(sys.argv[1:])
if len(arguments) == 4:
sequence, min_spacing = list(map(int, list(arguments[0])), int(arguments[1]))
max_spacing, image_width = int(argu... |
8fdd73b7b8b907da264eac26ea52eef2bb8f6ce7 | ml/img/load_images.py | ml/img/load_images.py | # ==============================================================================
# LOAD_IMAGE_AS_ARRAY
# ==============================================================================
import scipy.misc
def load_image_as_array(f, rescale=None):
""" Given a f... | # ==============================================================================
# LOAD_IMAGE_AS_ARRAY
# ==============================================================================
# USING SCIPY (with i think PIL on the backend)
import scipy.misc
def load_im... | Add opencv version of load_image_as_array() | FEAT: Add opencv version of load_image_as_array()
| Python | apache-2.0 | ronrest/convenience_py,ronrest/convenience_py | # ==============================================================================
# LOAD_IMAGE_AS_ARRAY
# ==============================================================================
import scipy.misc
def load_image_as_array(f, rescale=None):
""" Given a f... | # ==============================================================================
# LOAD_IMAGE_AS_ARRAY
# ==============================================================================
# USING SCIPY (with i think PIL on the backend)
import scipy.misc
def load_im... | <commit_before># ==============================================================================
# LOAD_IMAGE_AS_ARRAY
# ==============================================================================
import scipy.misc
def load_image_as_array(f, rescale=None):
... | # ==============================================================================
# LOAD_IMAGE_AS_ARRAY
# ==============================================================================
# USING SCIPY (with i think PIL on the backend)
import scipy.misc
def load_im... | # ==============================================================================
# LOAD_IMAGE_AS_ARRAY
# ==============================================================================
import scipy.misc
def load_image_as_array(f, rescale=None):
""" Given a f... | <commit_before># ==============================================================================
# LOAD_IMAGE_AS_ARRAY
# ==============================================================================
import scipy.misc
def load_image_as_array(f, rescale=None):
... |
9516caa0c62289c89b605b9b8a34622a0bb54e2b | tests/70_program_libpfasst_swe_sphere_timestepper_convergence_l1/postprocessing_pickle.py | tests/70_program_libpfasst_swe_sphere_timestepper_convergence_l1/postprocessing_pickle.py | #! /usr/bin/env python3
import sys
import math
import glob
from mule_local.postprocessing.pickle_SphereDataPhysicalDiff import *
from mule.exec_program import *
pickle_SphereDataPhysicalDiff()
| #! /usr/bin/env python3
import sys
import math
import glob
from mule_local.postprocessing.pickle_SphereDataSpectralDiff import *
from mule.exec_program import *
pickle_SphereDataSpectralDiff()
| Use SphereDataSpectral instead of SphereDataPhysical | Use SphereDataSpectral instead of SphereDataPhysical
The script for physical data requires CSV files as default output files,
whereas the spectral script uses .sweet binary files as default.
Since libpfasst_swe_sphere's CSV output is not in the same format as
swe_sphere's CSV output, the CSV parsing does not work --> ... | Python | mit | schreiberx/sweet,schreiberx/sweet,schreiberx/sweet,schreiberx/sweet | #! /usr/bin/env python3
import sys
import math
import glob
from mule_local.postprocessing.pickle_SphereDataPhysicalDiff import *
from mule.exec_program import *
pickle_SphereDataPhysicalDiff()
Use SphereDataSpectral instead of SphereDataPhysical
The script for physical data requires CSV files as default output file... | #! /usr/bin/env python3
import sys
import math
import glob
from mule_local.postprocessing.pickle_SphereDataSpectralDiff import *
from mule.exec_program import *
pickle_SphereDataSpectralDiff()
| <commit_before>#! /usr/bin/env python3
import sys
import math
import glob
from mule_local.postprocessing.pickle_SphereDataPhysicalDiff import *
from mule.exec_program import *
pickle_SphereDataPhysicalDiff()
<commit_msg>Use SphereDataSpectral instead of SphereDataPhysical
The script for physical data requires CSV f... | #! /usr/bin/env python3
import sys
import math
import glob
from mule_local.postprocessing.pickle_SphereDataSpectralDiff import *
from mule.exec_program import *
pickle_SphereDataSpectralDiff()
| #! /usr/bin/env python3
import sys
import math
import glob
from mule_local.postprocessing.pickle_SphereDataPhysicalDiff import *
from mule.exec_program import *
pickle_SphereDataPhysicalDiff()
Use SphereDataSpectral instead of SphereDataPhysical
The script for physical data requires CSV files as default output file... | <commit_before>#! /usr/bin/env python3
import sys
import math
import glob
from mule_local.postprocessing.pickle_SphereDataPhysicalDiff import *
from mule.exec_program import *
pickle_SphereDataPhysicalDiff()
<commit_msg>Use SphereDataSpectral instead of SphereDataPhysical
The script for physical data requires CSV f... |
33f4036825c6ff4d9df0038471727648e0df100d | feder/virus_scan/engine/base.py | feder/virus_scan/engine/base.py | from django.contrib.sites.shortcuts import get_current_site
from django.urls import reverse
from django.core.signing import TimestampSigner
class BaseEngine:
def __init__(self):
self.signer = TimestampSigner()
def get_webhook_url(self):
return "{}://{}{}?token={}".format(
"https",... | import urllib.parse
from django.contrib.sites.shortcuts import get_current_site
from django.urls import reverse
from django.core.signing import TimestampSigner
class BaseEngine:
def __init__(self):
self.signer = TimestampSigner()
def get_webhook_url(self):
return "{}://{}{}?token={}".format(... | Fix urlencode in webhook url | Fix urlencode in webhook url | Python | mit | watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder | from django.contrib.sites.shortcuts import get_current_site
from django.urls import reverse
from django.core.signing import TimestampSigner
class BaseEngine:
def __init__(self):
self.signer = TimestampSigner()
def get_webhook_url(self):
return "{}://{}{}?token={}".format(
"https",... | import urllib.parse
from django.contrib.sites.shortcuts import get_current_site
from django.urls import reverse
from django.core.signing import TimestampSigner
class BaseEngine:
def __init__(self):
self.signer = TimestampSigner()
def get_webhook_url(self):
return "{}://{}{}?token={}".format(... | <commit_before>from django.contrib.sites.shortcuts import get_current_site
from django.urls import reverse
from django.core.signing import TimestampSigner
class BaseEngine:
def __init__(self):
self.signer = TimestampSigner()
def get_webhook_url(self):
return "{}://{}{}?token={}".format(
... | import urllib.parse
from django.contrib.sites.shortcuts import get_current_site
from django.urls import reverse
from django.core.signing import TimestampSigner
class BaseEngine:
def __init__(self):
self.signer = TimestampSigner()
def get_webhook_url(self):
return "{}://{}{}?token={}".format(... | from django.contrib.sites.shortcuts import get_current_site
from django.urls import reverse
from django.core.signing import TimestampSigner
class BaseEngine:
def __init__(self):
self.signer = TimestampSigner()
def get_webhook_url(self):
return "{}://{}{}?token={}".format(
"https",... | <commit_before>from django.contrib.sites.shortcuts import get_current_site
from django.urls import reverse
from django.core.signing import TimestampSigner
class BaseEngine:
def __init__(self):
self.signer = TimestampSigner()
def get_webhook_url(self):
return "{}://{}{}?token={}".format(
... |
d618f430c143874011b70afe0a4fa62c06f5e28c | md5bot.py | md5bot.py | """
md5bot.py -- Twitter bot that tweets the current time as an md5 value
"""
import time
import hashlib
import tweepy
CONSUMER_KEY = 'xxxxxxxxxxxx'
CONSUMER_SECRET = 'xxxxxxxxxxxx'
ACCESS_KEY = 'xxxxxxxxxxxx'
ACCESS_SECRET = 'xxxxxxxxxxxx'
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_to... | #!/usr/bin/env python
__author__ = "Patrick Guelcher"
__copyright__ = "(C) 2016 Patrick Guelcher"
__license__ = "MIT"
__version__ = "1.0"
"""
A bot for Twitter that checks the time and then posts it as an md5 hash value.
"""
import time
import hashlib
import tweepy
# Configuration (Twitter API Settings)
CONSUMER_KE... | Clean code and conform to python conventions | Clean code and conform to python conventions
Some things are still a bit weird, mostly due to my limited knowledge of
Python.
Also fixed code to conform to Python naming conventions for
variables/functions.
| Python | mit | aerovolts/python-scripts | """
md5bot.py -- Twitter bot that tweets the current time as an md5 value
"""
import time
import hashlib
import tweepy
CONSUMER_KEY = 'xxxxxxxxxxxx'
CONSUMER_SECRET = 'xxxxxxxxxxxx'
ACCESS_KEY = 'xxxxxxxxxxxx'
ACCESS_SECRET = 'xxxxxxxxxxxx'
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_to... | #!/usr/bin/env python
__author__ = "Patrick Guelcher"
__copyright__ = "(C) 2016 Patrick Guelcher"
__license__ = "MIT"
__version__ = "1.0"
"""
A bot for Twitter that checks the time and then posts it as an md5 hash value.
"""
import time
import hashlib
import tweepy
# Configuration (Twitter API Settings)
CONSUMER_KE... | <commit_before>"""
md5bot.py -- Twitter bot that tweets the current time as an md5 value
"""
import time
import hashlib
import tweepy
CONSUMER_KEY = 'xxxxxxxxxxxx'
CONSUMER_SECRET = 'xxxxxxxxxxxx'
ACCESS_KEY = 'xxxxxxxxxxxx'
ACCESS_SECRET = 'xxxxxxxxxxxx'
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
aut... | #!/usr/bin/env python
__author__ = "Patrick Guelcher"
__copyright__ = "(C) 2016 Patrick Guelcher"
__license__ = "MIT"
__version__ = "1.0"
"""
A bot for Twitter that checks the time and then posts it as an md5 hash value.
"""
import time
import hashlib
import tweepy
# Configuration (Twitter API Settings)
CONSUMER_KE... | """
md5bot.py -- Twitter bot that tweets the current time as an md5 value
"""
import time
import hashlib
import tweepy
CONSUMER_KEY = 'xxxxxxxxxxxx'
CONSUMER_SECRET = 'xxxxxxxxxxxx'
ACCESS_KEY = 'xxxxxxxxxxxx'
ACCESS_SECRET = 'xxxxxxxxxxxx'
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_to... | <commit_before>"""
md5bot.py -- Twitter bot that tweets the current time as an md5 value
"""
import time
import hashlib
import tweepy
CONSUMER_KEY = 'xxxxxxxxxxxx'
CONSUMER_SECRET = 'xxxxxxxxxxxx'
ACCESS_KEY = 'xxxxxxxxxxxx'
ACCESS_SECRET = 'xxxxxxxxxxxx'
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
aut... |
1a39eea8225ebdf7f654df9ba5b87479e9dbc867 | minify.py | minify.py | """
Copyright 2016 Dee Reddy
"""
import sys
import re
args = sys.argv[1:]
def minify(filepath, comments=False):
""" Minifies/uglifies file
:param
file_:
comments: Boolean. If False, deletes comments during output.
:return:
Minified string.
"""
pattern = re.compile(r"... | """
Copyright 2016 Dee Reddy
"""
import sys
import re
args = sys.argv[1:]
def minify(input_path, output_path, comments=False):
""" Minifies/uglifies file
args:
input_path: input file path
output_path: write-out file path
comments: Boolean. If False, deletes comments during output... | Update regex. Add file write-out. | feat: Update regex. Add file write-out.
Regex is bugged, however. Need to fix regex pattern.
| Python | apache-2.0 | Deesus/Punt | """
Copyright 2016 Dee Reddy
"""
import sys
import re
args = sys.argv[1:]
def minify(filepath, comments=False):
""" Minifies/uglifies file
:param
file_:
comments: Boolean. If False, deletes comments during output.
:return:
Minified string.
"""
pattern = re.compile(r"... | """
Copyright 2016 Dee Reddy
"""
import sys
import re
args = sys.argv[1:]
def minify(input_path, output_path, comments=False):
""" Minifies/uglifies file
args:
input_path: input file path
output_path: write-out file path
comments: Boolean. If False, deletes comments during output... | <commit_before>"""
Copyright 2016 Dee Reddy
"""
import sys
import re
args = sys.argv[1:]
def minify(filepath, comments=False):
""" Minifies/uglifies file
:param
file_:
comments: Boolean. If False, deletes comments during output.
:return:
Minified string.
"""
pattern ... | """
Copyright 2016 Dee Reddy
"""
import sys
import re
args = sys.argv[1:]
def minify(input_path, output_path, comments=False):
""" Minifies/uglifies file
args:
input_path: input file path
output_path: write-out file path
comments: Boolean. If False, deletes comments during output... | """
Copyright 2016 Dee Reddy
"""
import sys
import re
args = sys.argv[1:]
def minify(filepath, comments=False):
""" Minifies/uglifies file
:param
file_:
comments: Boolean. If False, deletes comments during output.
:return:
Minified string.
"""
pattern = re.compile(r"... | <commit_before>"""
Copyright 2016 Dee Reddy
"""
import sys
import re
args = sys.argv[1:]
def minify(filepath, comments=False):
""" Minifies/uglifies file
:param
file_:
comments: Boolean. If False, deletes comments during output.
:return:
Minified string.
"""
pattern ... |
f7a57135ec328063eb4d2d5c4a035994a85ad290 | modules/piperename.py | modules/piperename.py | # piperename.py
#
from pipe2py import util
def pipe_rename(context, _INPUT, conf, **kwargs):
"""This operator renames or copies fields in the input source.
Keyword arguments:
context -- pipeline context
_INPUT -- source generator
kwargs -- other inputs, e.g. to feed terminals for rule values
... | # piperename.py
#
from pipe2py import util
def pipe_rename(context, _INPUT, conf, **kwargs):
"""This operator renames or copies fields in the input source.
Keyword arguments:
context -- pipeline context
_INPUT -- source generator
kwargs -- other inputs, e.g. to feed terminals for rule values
... | Allow dot notation to map to nested dictionaries | Allow dot notation to map to nested dictionaries
| Python | mit | nerevu/riko,nerevu/riko | # piperename.py
#
from pipe2py import util
def pipe_rename(context, _INPUT, conf, **kwargs):
"""This operator renames or copies fields in the input source.
Keyword arguments:
context -- pipeline context
_INPUT -- source generator
kwargs -- other inputs, e.g. to feed terminals for rule values
... | # piperename.py
#
from pipe2py import util
def pipe_rename(context, _INPUT, conf, **kwargs):
"""This operator renames or copies fields in the input source.
Keyword arguments:
context -- pipeline context
_INPUT -- source generator
kwargs -- other inputs, e.g. to feed terminals for rule values
... | <commit_before># piperename.py
#
from pipe2py import util
def pipe_rename(context, _INPUT, conf, **kwargs):
"""This operator renames or copies fields in the input source.
Keyword arguments:
context -- pipeline context
_INPUT -- source generator
kwargs -- other inputs, e.g. to feed terminals for... | # piperename.py
#
from pipe2py import util
def pipe_rename(context, _INPUT, conf, **kwargs):
"""This operator renames or copies fields in the input source.
Keyword arguments:
context -- pipeline context
_INPUT -- source generator
kwargs -- other inputs, e.g. to feed terminals for rule values
... | # piperename.py
#
from pipe2py import util
def pipe_rename(context, _INPUT, conf, **kwargs):
"""This operator renames or copies fields in the input source.
Keyword arguments:
context -- pipeline context
_INPUT -- source generator
kwargs -- other inputs, e.g. to feed terminals for rule values
... | <commit_before># piperename.py
#
from pipe2py import util
def pipe_rename(context, _INPUT, conf, **kwargs):
"""This operator renames or copies fields in the input source.
Keyword arguments:
context -- pipeline context
_INPUT -- source generator
kwargs -- other inputs, e.g. to feed terminals for... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.