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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7252af9442d82c42a881d5dfbb4db470b28fcd3a | congress/datasources/settings.py | congress/datasources/settings.py | #!/usr/bin/env python
# Copyright (c) 2014 VMware, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | #!/usr/bin/env python
# Copyright (c) 2014 VMware, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | Change hardcoded ip to localhost | Change hardcoded ip to localhost
This patch just changes the hardcoded ip to local host. We should really
make this configurable through congress.conf but this will probably be
fine for now.
Change-Id: If4980beb73e32e458d9b7dfafecb016f9c2f740c
| Python | apache-2.0 | ramineni/my_congress,openstack/congress,ekcs/congress,openstack/congress,ramineni/my_congress,ekcs/congress,ekcs/congress,ekcs/congress,ramineni/my_congress,ramineni/my_congress | #!/usr/bin/env python
# Copyright (c) 2014 VMware, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | #!/usr/bin/env python
# Copyright (c) 2014 VMware, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | <commit_before>#!/usr/bin/env python
# Copyright (c) 2014 VMware, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | #!/usr/bin/env python
# Copyright (c) 2014 VMware, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | #!/usr/bin/env python
# Copyright (c) 2014 VMware, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | <commit_before>#!/usr/bin/env python
# Copyright (c) 2014 VMware, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... |
7b4fad8b4f08b986b184799817cf4b46958b9e85 | tracker/src/main/freebayes-regenotype-workflow.py | tracker/src/main/freebayes-regenotype-workflow.py | from airflow import DAG
from airflow.operators import BashOperator, PythonOperator
from datetime import datetime, timedelta
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2015, 6, 1),
'email': ['[email protected]'],
'email_on_failure': False,
'email_on_r... | from airflow import DAG
from airflow.operators import BashOperator, PythonOperator
from datetime import datetime, timedelta
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2015, 6, 1),
'email': ['[email protected]'],
'email_on_failure': False,
'email_on_r... | Fix parameter spacing in statup update script invocation from workflow. | Fix parameter spacing in statup update script invocation from workflow.
| Python | mit | llevar/germline-regenotyper,llevar/germline-regenotyper | from airflow import DAG
from airflow.operators import BashOperator, PythonOperator
from datetime import datetime, timedelta
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2015, 6, 1),
'email': ['[email protected]'],
'email_on_failure': False,
'email_on_r... | from airflow import DAG
from airflow.operators import BashOperator, PythonOperator
from datetime import datetime, timedelta
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2015, 6, 1),
'email': ['[email protected]'],
'email_on_failure': False,
'email_on_r... | <commit_before>from airflow import DAG
from airflow.operators import BashOperator, PythonOperator
from datetime import datetime, timedelta
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2015, 6, 1),
'email': ['[email protected]'],
'email_on_failure': False,
... | from airflow import DAG
from airflow.operators import BashOperator, PythonOperator
from datetime import datetime, timedelta
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2015, 6, 1),
'email': ['[email protected]'],
'email_on_failure': False,
'email_on_r... | from airflow import DAG
from airflow.operators import BashOperator, PythonOperator
from datetime import datetime, timedelta
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2015, 6, 1),
'email': ['[email protected]'],
'email_on_failure': False,
'email_on_r... | <commit_before>from airflow import DAG
from airflow.operators import BashOperator, PythonOperator
from datetime import datetime, timedelta
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2015, 6, 1),
'email': ['[email protected]'],
'email_on_failure': False,
... |
fc9296957122fe7499711c0b0801c96e286b6725 | turnstile/utils.py | turnstile/utils.py | import sys
def import_class(import_str):
"""Returns a class from a string including module and class."""
mod_str, _sep, class_str = import_str.rpartition(':')
try:
__import__(mod_str)
return getattr(sys.modules[mod_str], class_str)
except (ImportError, ValueError, AttributeError) as e... | import sys
def import_class(import_str):
"""Returns a class from a string including module and class."""
mod_str, _sep, class_str = import_str.rpartition(':')
try:
__import__(mod_str)
return getattr(sys.modules[mod_str], class_str)
except (ImportError, ValueError, AttributeError) as e... | Add a context manager to ignore exceptions | Add a context manager to ignore exceptions
| Python | apache-2.0 | klmitch/turnstile | import sys
def import_class(import_str):
"""Returns a class from a string including module and class."""
mod_str, _sep, class_str = import_str.rpartition(':')
try:
__import__(mod_str)
return getattr(sys.modules[mod_str], class_str)
except (ImportError, ValueError, AttributeError) as e... | import sys
def import_class(import_str):
"""Returns a class from a string including module and class."""
mod_str, _sep, class_str = import_str.rpartition(':')
try:
__import__(mod_str)
return getattr(sys.modules[mod_str], class_str)
except (ImportError, ValueError, AttributeError) as e... | <commit_before>import sys
def import_class(import_str):
"""Returns a class from a string including module and class."""
mod_str, _sep, class_str = import_str.rpartition(':')
try:
__import__(mod_str)
return getattr(sys.modules[mod_str], class_str)
except (ImportError, ValueError, Attri... | import sys
def import_class(import_str):
"""Returns a class from a string including module and class."""
mod_str, _sep, class_str = import_str.rpartition(':')
try:
__import__(mod_str)
return getattr(sys.modules[mod_str], class_str)
except (ImportError, ValueError, AttributeError) as e... | import sys
def import_class(import_str):
"""Returns a class from a string including module and class."""
mod_str, _sep, class_str = import_str.rpartition(':')
try:
__import__(mod_str)
return getattr(sys.modules[mod_str], class_str)
except (ImportError, ValueError, AttributeError) as e... | <commit_before>import sys
def import_class(import_str):
"""Returns a class from a string including module and class."""
mod_str, _sep, class_str = import_str.rpartition(':')
try:
__import__(mod_str)
return getattr(sys.modules[mod_str], class_str)
except (ImportError, ValueError, Attri... |
d18d4f72ed24177143a9dbcf74fc1c001235ded5 | batch_effect.py | batch_effect.py | #!/usr/bin/env python
import argparse
import csv
import shutil
import subprocess
import sys
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Chain together Inkscape extensions")
parser.add_argument('--id', type=str, action='append', dest='ids', default=[],
help=... | #!/usr/bin/env python
import argparse
import csv
import shutil
import subprocess
import sys
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Chain together Inkscape extensions")
parser.add_argument('--id', type=str, action='append', dest='ids', default=[],
help=... | Clarify --id parameter help text | Clarify --id parameter help text
| Python | mit | jturner314/inkscape-batch-effect | #!/usr/bin/env python
import argparse
import csv
import shutil
import subprocess
import sys
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Chain together Inkscape extensions")
parser.add_argument('--id', type=str, action='append', dest='ids', default=[],
help=... | #!/usr/bin/env python
import argparse
import csv
import shutil
import subprocess
import sys
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Chain together Inkscape extensions")
parser.add_argument('--id', type=str, action='append', dest='ids', default=[],
help=... | <commit_before>#!/usr/bin/env python
import argparse
import csv
import shutil
import subprocess
import sys
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Chain together Inkscape extensions")
parser.add_argument('--id', type=str, action='append', dest='ids', default=[],
... | #!/usr/bin/env python
import argparse
import csv
import shutil
import subprocess
import sys
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Chain together Inkscape extensions")
parser.add_argument('--id', type=str, action='append', dest='ids', default=[],
help=... | #!/usr/bin/env python
import argparse
import csv
import shutil
import subprocess
import sys
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Chain together Inkscape extensions")
parser.add_argument('--id', type=str, action='append', dest='ids', default=[],
help=... | <commit_before>#!/usr/bin/env python
import argparse
import csv
import shutil
import subprocess
import sys
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Chain together Inkscape extensions")
parser.add_argument('--id', type=str, action='append', dest='ids', default=[],
... |
3672d178ac4f9a3f9308acf1e43e9eea663fe30a | OnlineParticipationDataset/pipelines.py | OnlineParticipationDataset/pipelines.py | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import json
from datetime import datetime
from scrapy.exporters import JsonLinesItemExporter
class Onlineparticipationdataset... | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import json,os
from datetime import datetime
from scrapy.exporters import JsonLinesItemExporter
path = "downloads"
class Onl... | Create path if it doesnt exists | Create path if it doesnt exists
| Python | mit | Liebeck/OnlineParticipationDatasets | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import json
from datetime import datetime
from scrapy.exporters import JsonLinesItemExporter
class Onlineparticipationdataset... | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import json,os
from datetime import datetime
from scrapy.exporters import JsonLinesItemExporter
path = "downloads"
class Onl... | <commit_before># -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import json
from datetime import datetime
from scrapy.exporters import JsonLinesItemExporter
class Onlineparti... | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import json,os
from datetime import datetime
from scrapy.exporters import JsonLinesItemExporter
path = "downloads"
class Onl... | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import json
from datetime import datetime
from scrapy.exporters import JsonLinesItemExporter
class Onlineparticipationdataset... | <commit_before># -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import json
from datetime import datetime
from scrapy.exporters import JsonLinesItemExporter
class Onlineparti... |
7169f578892f9a72c2c14baa9bfd1ce2b7f9b9ec | fastats/core/decorator.py | fastats/core/decorator.py |
from contextlib import contextmanager
from functools import wraps
from fastats.core.ast_transforms.convert_to_jit import convert_to_jit
from fastats.core.ast_transforms.processor import AstProcessor
@contextmanager
def code_transform(func, replaced):
try:
yield func
finally:
for k, v in repl... |
from contextlib import contextmanager
from functools import wraps
from fastats.core.ast_transforms.convert_to_jit import convert_to_jit
from fastats.core.ast_transforms.processor import AstProcessor
@contextmanager
def code_transform(func, replaced):
try:
yield func
finally:
for k, v in repl... | Remove a for loop in favour of a dict comprehension | Remove a for loop in favour of a dict comprehension
| Python | mit | fastats/fastats,dwillmer/fastats |
from contextlib import contextmanager
from functools import wraps
from fastats.core.ast_transforms.convert_to_jit import convert_to_jit
from fastats.core.ast_transforms.processor import AstProcessor
@contextmanager
def code_transform(func, replaced):
try:
yield func
finally:
for k, v in repl... |
from contextlib import contextmanager
from functools import wraps
from fastats.core.ast_transforms.convert_to_jit import convert_to_jit
from fastats.core.ast_transforms.processor import AstProcessor
@contextmanager
def code_transform(func, replaced):
try:
yield func
finally:
for k, v in repl... | <commit_before>
from contextlib import contextmanager
from functools import wraps
from fastats.core.ast_transforms.convert_to_jit import convert_to_jit
from fastats.core.ast_transforms.processor import AstProcessor
@contextmanager
def code_transform(func, replaced):
try:
yield func
finally:
f... |
from contextlib import contextmanager
from functools import wraps
from fastats.core.ast_transforms.convert_to_jit import convert_to_jit
from fastats.core.ast_transforms.processor import AstProcessor
@contextmanager
def code_transform(func, replaced):
try:
yield func
finally:
for k, v in repl... |
from contextlib import contextmanager
from functools import wraps
from fastats.core.ast_transforms.convert_to_jit import convert_to_jit
from fastats.core.ast_transforms.processor import AstProcessor
@contextmanager
def code_transform(func, replaced):
try:
yield func
finally:
for k, v in repl... | <commit_before>
from contextlib import contextmanager
from functools import wraps
from fastats.core.ast_transforms.convert_to_jit import convert_to_jit
from fastats.core.ast_transforms.processor import AstProcessor
@contextmanager
def code_transform(func, replaced):
try:
yield func
finally:
f... |
170fa50af3dc5809713ea274b2b6bb1537c22941 | bm/app/admin.py | bm/app/admin.py | from django.contrib import admin
from app.models import Category, Bookmark, Trash
class CategoryAdmin(admin.ModelAdmin):
list_display = ['name', 'user', 'row_number', 'column_number', 'progress_bar_color']
list_filter = ['user']
class BookmarkAdmin(admin.ModelAdmin):
list_display = ['category', 'name', 'row_number... | from django.contrib import admin
from app.models import Category, Bookmark, Trash
class CategoryAdmin(admin.ModelAdmin):
list_display = ['name', 'user', 'row_number', 'column_number', 'progress_bar_color', 'id']
list_filter = ['user']
class BookmarkAdmin(admin.ModelAdmin):
list_display = ['category', 'name', 'row_... | Include id in CategoryAdmin for easier debugging | Include id in CategoryAdmin for easier debugging
| Python | mit | GSC-RNSIT/bookmark-manager,rohithpr/bookmark-manager,rohithpr/bookmark-manager,GSC-RNSIT/bookmark-manager | from django.contrib import admin
from app.models import Category, Bookmark, Trash
class CategoryAdmin(admin.ModelAdmin):
list_display = ['name', 'user', 'row_number', 'column_number', 'progress_bar_color']
list_filter = ['user']
class BookmarkAdmin(admin.ModelAdmin):
list_display = ['category', 'name', 'row_number... | from django.contrib import admin
from app.models import Category, Bookmark, Trash
class CategoryAdmin(admin.ModelAdmin):
list_display = ['name', 'user', 'row_number', 'column_number', 'progress_bar_color', 'id']
list_filter = ['user']
class BookmarkAdmin(admin.ModelAdmin):
list_display = ['category', 'name', 'row_... | <commit_before>from django.contrib import admin
from app.models import Category, Bookmark, Trash
class CategoryAdmin(admin.ModelAdmin):
list_display = ['name', 'user', 'row_number', 'column_number', 'progress_bar_color']
list_filter = ['user']
class BookmarkAdmin(admin.ModelAdmin):
list_display = ['category', 'nam... | from django.contrib import admin
from app.models import Category, Bookmark, Trash
class CategoryAdmin(admin.ModelAdmin):
list_display = ['name', 'user', 'row_number', 'column_number', 'progress_bar_color', 'id']
list_filter = ['user']
class BookmarkAdmin(admin.ModelAdmin):
list_display = ['category', 'name', 'row_... | from django.contrib import admin
from app.models import Category, Bookmark, Trash
class CategoryAdmin(admin.ModelAdmin):
list_display = ['name', 'user', 'row_number', 'column_number', 'progress_bar_color']
list_filter = ['user']
class BookmarkAdmin(admin.ModelAdmin):
list_display = ['category', 'name', 'row_number... | <commit_before>from django.contrib import admin
from app.models import Category, Bookmark, Trash
class CategoryAdmin(admin.ModelAdmin):
list_display = ['name', 'user', 'row_number', 'column_number', 'progress_bar_color']
list_filter = ['user']
class BookmarkAdmin(admin.ModelAdmin):
list_display = ['category', 'nam... |
4fd6a98a887a59dabcc41361a6ba2791393d875e | test/tests/python-pip-requests-ssl/container.py | test/tests/python-pip-requests-ssl/container.py | import pip
pip.main(['install', '-q', 'requests'])
import requests
r = requests.get('https://google.com')
assert(r.status_code == 200)
| import subprocess, sys
subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'requests'])
import requests
r = requests.get('https://google.com')
assert(r.status_code == 200)
| Fix "python-pip-requests-ssl" test to no longer "import pip" | Fix "python-pip-requests-ssl" test to no longer "import pip"
(https://blog.python.org/2018/04/pip-10-has-been-released.html)
> In addition, the previously announced reorganisation of pip's internals has now taken place. Unless you are the author of code that imports the pip module (or a user of such code), this chang... | Python | apache-2.0 | docker-library/official-images,docker-flink/official-images,docker-library/official-images,31z4/official-images,davidl-zend/official-images,jperrin/official-images,infosiftr/stackbrew,neo-technology/docker-official-images,31z4/official-images,dinogun/official-images,docker-flink/official-images,neo-technology/docker-of... | import pip
pip.main(['install', '-q', 'requests'])
import requests
r = requests.get('https://google.com')
assert(r.status_code == 200)
Fix "python-pip-requests-ssl" test to no longer "import pip"
(https://blog.python.org/2018/04/pip-10-has-been-released.html)
> In addition, the previously announced reorganisation ... | import subprocess, sys
subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'requests'])
import requests
r = requests.get('https://google.com')
assert(r.status_code == 200)
| <commit_before>import pip
pip.main(['install', '-q', 'requests'])
import requests
r = requests.get('https://google.com')
assert(r.status_code == 200)
<commit_msg>Fix "python-pip-requests-ssl" test to no longer "import pip"
(https://blog.python.org/2018/04/pip-10-has-been-released.html)
> In addition, the previousl... | import subprocess, sys
subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'requests'])
import requests
r = requests.get('https://google.com')
assert(r.status_code == 200)
| import pip
pip.main(['install', '-q', 'requests'])
import requests
r = requests.get('https://google.com')
assert(r.status_code == 200)
Fix "python-pip-requests-ssl" test to no longer "import pip"
(https://blog.python.org/2018/04/pip-10-has-been-released.html)
> In addition, the previously announced reorganisation ... | <commit_before>import pip
pip.main(['install', '-q', 'requests'])
import requests
r = requests.get('https://google.com')
assert(r.status_code == 200)
<commit_msg>Fix "python-pip-requests-ssl" test to no longer "import pip"
(https://blog.python.org/2018/04/pip-10-has-been-released.html)
> In addition, the previousl... |
e75201bb34f7e930c04e393ff630fdbc1549fd77 | core/admin/migrations/versions/8f9ea78776f4_.py | core/admin/migrations/versions/8f9ea78776f4_.py | """empty message
Revision ID: 8f9ea78776f4
Revises: 3b7eee912b41
Create Date: 2022-03-11 13:53:08.996055
"""
# revision identifiers, used by Alembic.
revision = '8f9ea78776f4'
down_revision = '3b7eee912b41'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('user', sa.Column('spam_mar... | """empty message
Revision ID: 8f9ea78776f4
Revises: 3b7eee912b41
Create Date: 2022-03-11 13:53:08.996055
"""
# revision identifiers, used by Alembic.
revision = '8f9ea78776f4'
down_revision = '3b7eee912b41'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('user', sa.Column('spam_mar... | Add default to column spam_mark_as_read | Add default to column spam_mark_as_read | Python | mit | kaiyou/freeposte.io,kaiyou/freeposte.io,kaiyou/freeposte.io,kaiyou/freeposte.io | """empty message
Revision ID: 8f9ea78776f4
Revises: 3b7eee912b41
Create Date: 2022-03-11 13:53:08.996055
"""
# revision identifiers, used by Alembic.
revision = '8f9ea78776f4'
down_revision = '3b7eee912b41'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('user', sa.Column('spam_mar... | """empty message
Revision ID: 8f9ea78776f4
Revises: 3b7eee912b41
Create Date: 2022-03-11 13:53:08.996055
"""
# revision identifiers, used by Alembic.
revision = '8f9ea78776f4'
down_revision = '3b7eee912b41'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('user', sa.Column('spam_mar... | <commit_before>"""empty message
Revision ID: 8f9ea78776f4
Revises: 3b7eee912b41
Create Date: 2022-03-11 13:53:08.996055
"""
# revision identifiers, used by Alembic.
revision = '8f9ea78776f4'
down_revision = '3b7eee912b41'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('user', sa.C... | """empty message
Revision ID: 8f9ea78776f4
Revises: 3b7eee912b41
Create Date: 2022-03-11 13:53:08.996055
"""
# revision identifiers, used by Alembic.
revision = '8f9ea78776f4'
down_revision = '3b7eee912b41'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('user', sa.Column('spam_mar... | """empty message
Revision ID: 8f9ea78776f4
Revises: 3b7eee912b41
Create Date: 2022-03-11 13:53:08.996055
"""
# revision identifiers, used by Alembic.
revision = '8f9ea78776f4'
down_revision = '3b7eee912b41'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('user', sa.Column('spam_mar... | <commit_before>"""empty message
Revision ID: 8f9ea78776f4
Revises: 3b7eee912b41
Create Date: 2022-03-11 13:53:08.996055
"""
# revision identifiers, used by Alembic.
revision = '8f9ea78776f4'
down_revision = '3b7eee912b41'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('user', sa.C... |
9c44a1c97b1ba60fd7340c15dd82ebe1ceb6d8c3 | icekit/project/settings/_production.py | icekit/project/settings/_production.py | from ._base import *
SITE_PUBLIC_PORT = None # Default: SITE_PORT
# DJANGO ######################################################################
CACHES['default'].update({
# 'BACKEND': 'django_redis.cache.RedisCache',
'BACKEND': 'redis_lock.django_cache.RedisCache',
'LOCATION': 'redis://redis:6379/1',
... | from ._base import *
SITE_PUBLIC_PORT = None # Default: SITE_PORT
# DJANGO ######################################################################
CACHES['default'].update({
# 'BACKEND': 'django_redis.cache.RedisCache',
'BACKEND': 'redis_lock.django_cache.RedisCache',
'LOCATION': 'redis://redis:6379/1',
... | Disable cache middleware and template loader by default. Avoid premature optimisation. | Disable cache middleware and template loader by default. Avoid premature optimisation.
| Python | mit | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit | from ._base import *
SITE_PUBLIC_PORT = None # Default: SITE_PORT
# DJANGO ######################################################################
CACHES['default'].update({
# 'BACKEND': 'django_redis.cache.RedisCache',
'BACKEND': 'redis_lock.django_cache.RedisCache',
'LOCATION': 'redis://redis:6379/1',
... | from ._base import *
SITE_PUBLIC_PORT = None # Default: SITE_PORT
# DJANGO ######################################################################
CACHES['default'].update({
# 'BACKEND': 'django_redis.cache.RedisCache',
'BACKEND': 'redis_lock.django_cache.RedisCache',
'LOCATION': 'redis://redis:6379/1',
... | <commit_before>from ._base import *
SITE_PUBLIC_PORT = None # Default: SITE_PORT
# DJANGO ######################################################################
CACHES['default'].update({
# 'BACKEND': 'django_redis.cache.RedisCache',
'BACKEND': 'redis_lock.django_cache.RedisCache',
'LOCATION': 'redis://... | from ._base import *
SITE_PUBLIC_PORT = None # Default: SITE_PORT
# DJANGO ######################################################################
CACHES['default'].update({
# 'BACKEND': 'django_redis.cache.RedisCache',
'BACKEND': 'redis_lock.django_cache.RedisCache',
'LOCATION': 'redis://redis:6379/1',
... | from ._base import *
SITE_PUBLIC_PORT = None # Default: SITE_PORT
# DJANGO ######################################################################
CACHES['default'].update({
# 'BACKEND': 'django_redis.cache.RedisCache',
'BACKEND': 'redis_lock.django_cache.RedisCache',
'LOCATION': 'redis://redis:6379/1',
... | <commit_before>from ._base import *
SITE_PUBLIC_PORT = None # Default: SITE_PORT
# DJANGO ######################################################################
CACHES['default'].update({
# 'BACKEND': 'django_redis.cache.RedisCache',
'BACKEND': 'redis_lock.django_cache.RedisCache',
'LOCATION': 'redis://... |
345ac9264fbfab5860835b544d2c8951821fe522 | mptt_urls/__init__.py | mptt_urls/__init__.py | # coding: utf-8
from django.utils.module_loading import import_string
def _load(module):
return import_string(module) if isinstance(module, str) else module
class view():
def __init__(self, model, view, slug_field):
self.model = _load(model)
self.view = _load(view)
self.slug_field = ... | # coding: utf-8
from django.utils.module_loading import import_string
def _load(module):
return import_string(module) if isinstance(module, str) else module
class view():
def __init__(self, model, view, slug_field):
self.model = _load(model)
self.view = _load(view)
self.slug_field = ... | Add trailing slash to forward and reverse url resolutions | Add trailing slash to forward and reverse url resolutions
| Python | mit | c0ntribut0r/django-mptt-urls,c0ntribut0r/django-mptt-urls | # coding: utf-8
from django.utils.module_loading import import_string
def _load(module):
return import_string(module) if isinstance(module, str) else module
class view():
def __init__(self, model, view, slug_field):
self.model = _load(model)
self.view = _load(view)
self.slug_field = ... | # coding: utf-8
from django.utils.module_loading import import_string
def _load(module):
return import_string(module) if isinstance(module, str) else module
class view():
def __init__(self, model, view, slug_field):
self.model = _load(model)
self.view = _load(view)
self.slug_field = ... | <commit_before># coding: utf-8
from django.utils.module_loading import import_string
def _load(module):
return import_string(module) if isinstance(module, str) else module
class view():
def __init__(self, model, view, slug_field):
self.model = _load(model)
self.view = _load(view)
sel... | # coding: utf-8
from django.utils.module_loading import import_string
def _load(module):
return import_string(module) if isinstance(module, str) else module
class view():
def __init__(self, model, view, slug_field):
self.model = _load(model)
self.view = _load(view)
self.slug_field = ... | # coding: utf-8
from django.utils.module_loading import import_string
def _load(module):
return import_string(module) if isinstance(module, str) else module
class view():
def __init__(self, model, view, slug_field):
self.model = _load(model)
self.view = _load(view)
self.slug_field = ... | <commit_before># coding: utf-8
from django.utils.module_loading import import_string
def _load(module):
return import_string(module) if isinstance(module, str) else module
class view():
def __init__(self, model, view, slug_field):
self.model = _load(model)
self.view = _load(view)
sel... |
a244623642cdf26bd6615cdc7ff2540c9361d10d | tmapi/models/typed.py | tmapi/models/typed.py | from django.db import models
from construct import Construct
class Typed (Construct, models.Model):
"""Indicates that a Topic Maps construct is typed. `Association`s,
`Role`s, `Occurrence`s, and `Name`s are typed."""
type = models.ForeignKey('Topic', related_name='typed_%(class)ss')
class Meta... | from django.db import models
from tmapi.exceptions import ModelConstraintException
from construct import Construct
class Typed (Construct, models.Model):
"""Indicates that a Topic Maps construct is typed. `Association`s,
`Role`s, `Occurrence`s, and `Name`s are typed."""
type = models.ForeignKey('Topic... | Raise an exception when setting a construct's type to None. | Raise an exception when setting a construct's type to None.
| Python | apache-2.0 | ajenhl/django-tmapi | from django.db import models
from construct import Construct
class Typed (Construct, models.Model):
"""Indicates that a Topic Maps construct is typed. `Association`s,
`Role`s, `Occurrence`s, and `Name`s are typed."""
type = models.ForeignKey('Topic', related_name='typed_%(class)ss')
class Meta... | from django.db import models
from tmapi.exceptions import ModelConstraintException
from construct import Construct
class Typed (Construct, models.Model):
"""Indicates that a Topic Maps construct is typed. `Association`s,
`Role`s, `Occurrence`s, and `Name`s are typed."""
type = models.ForeignKey('Topic... | <commit_before>from django.db import models
from construct import Construct
class Typed (Construct, models.Model):
"""Indicates that a Topic Maps construct is typed. `Association`s,
`Role`s, `Occurrence`s, and `Name`s are typed."""
type = models.ForeignKey('Topic', related_name='typed_%(class)ss')
... | from django.db import models
from tmapi.exceptions import ModelConstraintException
from construct import Construct
class Typed (Construct, models.Model):
"""Indicates that a Topic Maps construct is typed. `Association`s,
`Role`s, `Occurrence`s, and `Name`s are typed."""
type = models.ForeignKey('Topic... | from django.db import models
from construct import Construct
class Typed (Construct, models.Model):
"""Indicates that a Topic Maps construct is typed. `Association`s,
`Role`s, `Occurrence`s, and `Name`s are typed."""
type = models.ForeignKey('Topic', related_name='typed_%(class)ss')
class Meta... | <commit_before>from django.db import models
from construct import Construct
class Typed (Construct, models.Model):
"""Indicates that a Topic Maps construct is typed. `Association`s,
`Role`s, `Occurrence`s, and `Name`s are typed."""
type = models.ForeignKey('Topic', related_name='typed_%(class)ss')
... |
a4931218fbb00d646dbc8de6f8861e4647ef7ab4 | lib/rapidsms/tests/test_backend_irc.py | lib/rapidsms/tests/test_backend_irc.py | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import unittest
from harness import MockRouter
class TestLog(unittest.TestCase):
def test_backend_irc (self):
router = MockRouter()
try:
import irclib
from rapidsms.backends.irc import Backend
backend = Backend(... | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import unittest
from harness import MockRouter
class TestBackendIRC(unittest.TestCase):
def test_backend_irc (self):
router = MockRouter()
try:
import irclib
from rapidsms.backends.irc import Backend
backend = B... | Rename test class (sloppy cut n' paste job) | Rename test class (sloppy cut n' paste job)
| Python | bsd-3-clause | catalpainternational/rapidsms,caktus/rapidsms,ken-muturi/rapidsms,rapidsms/rapidsms-core-dev,catalpainternational/rapidsms,caktus/rapidsms,lsgunth/rapidsms,peterayeni/rapidsms,rapidsms/rapidsms-core-dev,lsgunth/rapidsms,dimagi/rapidsms,ken-muturi/rapidsms,peterayeni/rapidsms,peterayeni/rapidsms,lsgunth/rapidsms,ehealth... | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import unittest
from harness import MockRouter
class TestLog(unittest.TestCase):
def test_backend_irc (self):
router = MockRouter()
try:
import irclib
from rapidsms.backends.irc import Backend
backend = Backend(... | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import unittest
from harness import MockRouter
class TestBackendIRC(unittest.TestCase):
def test_backend_irc (self):
router = MockRouter()
try:
import irclib
from rapidsms.backends.irc import Backend
backend = B... | <commit_before>#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import unittest
from harness import MockRouter
class TestLog(unittest.TestCase):
def test_backend_irc (self):
router = MockRouter()
try:
import irclib
from rapidsms.backends.irc import Backend
bac... | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import unittest
from harness import MockRouter
class TestBackendIRC(unittest.TestCase):
def test_backend_irc (self):
router = MockRouter()
try:
import irclib
from rapidsms.backends.irc import Backend
backend = B... | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import unittest
from harness import MockRouter
class TestLog(unittest.TestCase):
def test_backend_irc (self):
router = MockRouter()
try:
import irclib
from rapidsms.backends.irc import Backend
backend = Backend(... | <commit_before>#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import unittest
from harness import MockRouter
class TestLog(unittest.TestCase):
def test_backend_irc (self):
router = MockRouter()
try:
import irclib
from rapidsms.backends.irc import Backend
bac... |
865651b0d23274d0dcbd9e3123ea9497a06172cf | docker_scripts/lib/common.py | docker_scripts/lib/common.py | # -*- coding: utf-8 -*-
import docker
import os
import sys
import requests
DEFAULT_TIMEOUT_SECONDS = 600
def docker_client():
# Default timeout 10 minutes
try:
timeout = int(os.getenv('DOCKER_TIMEOUT', 600))
except ValueError as e:
print("Provided timeout value: %s cannot be parsed as i... | # -*- coding: utf-8 -*-
import docker
import os
import sys
import requests
DEFAULT_TIMEOUT_SECONDS = 600
def docker_client():
# Default timeout 10 minutes
try:
timeout = int(os.getenv('DOCKER_TIMEOUT', 600))
except ValueError as e:
print("Provided timeout value: %s cannot be parsed as i... | Use AutoVersionClient to fix client incompatibity issues | Use AutoVersionClient to fix client incompatibity issues
Fixes #35
| Python | mit | lichia/docker-scripts,jpopelka/docker-scripts,goldmann/docker-scripts,goldmann/docker-squash,TomasTomecek/docker-scripts | # -*- coding: utf-8 -*-
import docker
import os
import sys
import requests
DEFAULT_TIMEOUT_SECONDS = 600
def docker_client():
# Default timeout 10 minutes
try:
timeout = int(os.getenv('DOCKER_TIMEOUT', 600))
except ValueError as e:
print("Provided timeout value: %s cannot be parsed as i... | # -*- coding: utf-8 -*-
import docker
import os
import sys
import requests
DEFAULT_TIMEOUT_SECONDS = 600
def docker_client():
# Default timeout 10 minutes
try:
timeout = int(os.getenv('DOCKER_TIMEOUT', 600))
except ValueError as e:
print("Provided timeout value: %s cannot be parsed as i... | <commit_before># -*- coding: utf-8 -*-
import docker
import os
import sys
import requests
DEFAULT_TIMEOUT_SECONDS = 600
def docker_client():
# Default timeout 10 minutes
try:
timeout = int(os.getenv('DOCKER_TIMEOUT', 600))
except ValueError as e:
print("Provided timeout value: %s cannot... | # -*- coding: utf-8 -*-
import docker
import os
import sys
import requests
DEFAULT_TIMEOUT_SECONDS = 600
def docker_client():
# Default timeout 10 minutes
try:
timeout = int(os.getenv('DOCKER_TIMEOUT', 600))
except ValueError as e:
print("Provided timeout value: %s cannot be parsed as i... | # -*- coding: utf-8 -*-
import docker
import os
import sys
import requests
DEFAULT_TIMEOUT_SECONDS = 600
def docker_client():
# Default timeout 10 minutes
try:
timeout = int(os.getenv('DOCKER_TIMEOUT', 600))
except ValueError as e:
print("Provided timeout value: %s cannot be parsed as i... | <commit_before># -*- coding: utf-8 -*-
import docker
import os
import sys
import requests
DEFAULT_TIMEOUT_SECONDS = 600
def docker_client():
# Default timeout 10 minutes
try:
timeout = int(os.getenv('DOCKER_TIMEOUT', 600))
except ValueError as e:
print("Provided timeout value: %s cannot... |
b888e6e6fac1a8dca0c8b64134de0380f9c5096b | mopidy_beets/__init__.py | mopidy_beets/__init__.py | from __future__ import unicode_literals
import os
from mopidy import ext, config
from mopidy.exceptions import ExtensionError
__version__ = '1.0.4'
class BeetsExtension(ext.Extension):
dist_name = 'Mopidy-Beets'
ext_name = 'beets'
version = __version__
def get_default_config(self):
conf_... | from __future__ import unicode_literals
import os
from mopidy import ext, config
__version__ = '1.0.4'
class BeetsExtension(ext.Extension):
dist_name = 'Mopidy-Beets'
ext_name = 'beets'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__file__)... | Remove env check as Mopidy checks deps automatically | ext: Remove env check as Mopidy checks deps automatically
| Python | mit | mopidy/mopidy-beets | from __future__ import unicode_literals
import os
from mopidy import ext, config
from mopidy.exceptions import ExtensionError
__version__ = '1.0.4'
class BeetsExtension(ext.Extension):
dist_name = 'Mopidy-Beets'
ext_name = 'beets'
version = __version__
def get_default_config(self):
conf_... | from __future__ import unicode_literals
import os
from mopidy import ext, config
__version__ = '1.0.4'
class BeetsExtension(ext.Extension):
dist_name = 'Mopidy-Beets'
ext_name = 'beets'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__file__)... | <commit_before>from __future__ import unicode_literals
import os
from mopidy import ext, config
from mopidy.exceptions import ExtensionError
__version__ = '1.0.4'
class BeetsExtension(ext.Extension):
dist_name = 'Mopidy-Beets'
ext_name = 'beets'
version = __version__
def get_default_config(self)... | from __future__ import unicode_literals
import os
from mopidy import ext, config
__version__ = '1.0.4'
class BeetsExtension(ext.Extension):
dist_name = 'Mopidy-Beets'
ext_name = 'beets'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__file__)... | from __future__ import unicode_literals
import os
from mopidy import ext, config
from mopidy.exceptions import ExtensionError
__version__ = '1.0.4'
class BeetsExtension(ext.Extension):
dist_name = 'Mopidy-Beets'
ext_name = 'beets'
version = __version__
def get_default_config(self):
conf_... | <commit_before>from __future__ import unicode_literals
import os
from mopidy import ext, config
from mopidy.exceptions import ExtensionError
__version__ = '1.0.4'
class BeetsExtension(ext.Extension):
dist_name = 'Mopidy-Beets'
ext_name = 'beets'
version = __version__
def get_default_config(self)... |
9d7b39708a2abd953aedf6c211fe242d86caed78 | pymacaroons/field_encryptors/secret_box_encryptor.py | pymacaroons/field_encryptors/secret_box_encryptor.py | from base64 import standard_b64encode, standard_b64decode
import nacl.bindings
import nacl.utils
from nacl.secret import SecretBox
from pymacaroons.field_encryptors.base_field_encryptor import (
BaseFieldEncryptor
)
from pymacaroons.utils import (
truncate_or_pad, convert_to_bytes, convert_to_string
)
class... | from base64 import standard_b64encode, standard_b64decode
import nacl.bindings
import nacl.utils
from nacl.secret import SecretBox
from pymacaroons.field_encryptors.base_field_encryptor import (
BaseFieldEncryptor
)
from pymacaroons.utils import (
truncate_or_pad, convert_to_bytes, convert_to_string
)
class... | Break how flake8 wants me to break | Break how flake8 wants me to break
| Python | mit | matrix-org/pymacaroons,matrix-org/pymacaroons | from base64 import standard_b64encode, standard_b64decode
import nacl.bindings
import nacl.utils
from nacl.secret import SecretBox
from pymacaroons.field_encryptors.base_field_encryptor import (
BaseFieldEncryptor
)
from pymacaroons.utils import (
truncate_or_pad, convert_to_bytes, convert_to_string
)
class... | from base64 import standard_b64encode, standard_b64decode
import nacl.bindings
import nacl.utils
from nacl.secret import SecretBox
from pymacaroons.field_encryptors.base_field_encryptor import (
BaseFieldEncryptor
)
from pymacaroons.utils import (
truncate_or_pad, convert_to_bytes, convert_to_string
)
class... | <commit_before>from base64 import standard_b64encode, standard_b64decode
import nacl.bindings
import nacl.utils
from nacl.secret import SecretBox
from pymacaroons.field_encryptors.base_field_encryptor import (
BaseFieldEncryptor
)
from pymacaroons.utils import (
truncate_or_pad, convert_to_bytes, convert_to_s... | from base64 import standard_b64encode, standard_b64decode
import nacl.bindings
import nacl.utils
from nacl.secret import SecretBox
from pymacaroons.field_encryptors.base_field_encryptor import (
BaseFieldEncryptor
)
from pymacaroons.utils import (
truncate_or_pad, convert_to_bytes, convert_to_string
)
class... | from base64 import standard_b64encode, standard_b64decode
import nacl.bindings
import nacl.utils
from nacl.secret import SecretBox
from pymacaroons.field_encryptors.base_field_encryptor import (
BaseFieldEncryptor
)
from pymacaroons.utils import (
truncate_or_pad, convert_to_bytes, convert_to_string
)
class... | <commit_before>from base64 import standard_b64encode, standard_b64decode
import nacl.bindings
import nacl.utils
from nacl.secret import SecretBox
from pymacaroons.field_encryptors.base_field_encryptor import (
BaseFieldEncryptor
)
from pymacaroons.utils import (
truncate_or_pad, convert_to_bytes, convert_to_s... |
158987eebbcd2d58270cf55cc42aa6e2e5738390 | pathvalidate/__init__.py | pathvalidate/__init__.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
"""
from __future__ import absolute_import
from ._common import _validate_null_string
from ._app import validate_excel_sheet_name
from ._app import sanitize_excel_sheet_name
from ._file import validate_filename
from ._file import validate_... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
"""
from __future__ import absolute_import
from ._error import NullNameError
from ._error import InvalidCharError
from ._common import _validate_null_string
from ._app import validate_excel_sheet_name
from ._app import sanitize_excel_shee... | Add imports for error classes | Add imports for error classes
| Python | mit | thombashi/pathvalidate | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
"""
from __future__ import absolute_import
from ._common import _validate_null_string
from ._app import validate_excel_sheet_name
from ._app import sanitize_excel_sheet_name
from ._file import validate_filename
from ._file import validate_... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
"""
from __future__ import absolute_import
from ._error import NullNameError
from ._error import InvalidCharError
from ._common import _validate_null_string
from ._app import validate_excel_sheet_name
from ._app import sanitize_excel_shee... | <commit_before># encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
"""
from __future__ import absolute_import
from ._common import _validate_null_string
from ._app import validate_excel_sheet_name
from ._app import sanitize_excel_sheet_name
from ._file import validate_filename
from ._file i... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
"""
from __future__ import absolute_import
from ._error import NullNameError
from ._error import InvalidCharError
from ._common import _validate_null_string
from ._app import validate_excel_sheet_name
from ._app import sanitize_excel_shee... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
"""
from __future__ import absolute_import
from ._common import _validate_null_string
from ._app import validate_excel_sheet_name
from ._app import sanitize_excel_sheet_name
from ._file import validate_filename
from ._file import validate_... | <commit_before># encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
"""
from __future__ import absolute_import
from ._common import _validate_null_string
from ._app import validate_excel_sheet_name
from ._app import sanitize_excel_sheet_name
from ._file import validate_filename
from ._file i... |
b916f1e3ad294c780c782e93222f018fa57ee981 | apps/bluebottle_utils/models.py | apps/bluebottle_utils/models.py | from django.db import models
from django_countries import CountryField
class Address(models.Model):
"""
A postal address.
"""
address_line1 = models.CharField(max_length=100, blank=True)
address_line2 = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=100, blank=... | from django.db import models
from django_countries import CountryField
class Address(models.Model):
"""
A postal address.
"""
address_line1 = models.CharField(max_length=100, blank=True)
address_line2 = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=100, blank=... | Allow country to be empty in Address model. | Allow country to be empty in Address model.
| Python | bsd-3-clause | onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site | from django.db import models
from django_countries import CountryField
class Address(models.Model):
"""
A postal address.
"""
address_line1 = models.CharField(max_length=100, blank=True)
address_line2 = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=100, blank=... | from django.db import models
from django_countries import CountryField
class Address(models.Model):
"""
A postal address.
"""
address_line1 = models.CharField(max_length=100, blank=True)
address_line2 = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=100, blank=... | <commit_before>from django.db import models
from django_countries import CountryField
class Address(models.Model):
"""
A postal address.
"""
address_line1 = models.CharField(max_length=100, blank=True)
address_line2 = models.CharField(max_length=100, blank=True)
city = models.CharField(max_len... | from django.db import models
from django_countries import CountryField
class Address(models.Model):
"""
A postal address.
"""
address_line1 = models.CharField(max_length=100, blank=True)
address_line2 = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=100, blank=... | from django.db import models
from django_countries import CountryField
class Address(models.Model):
"""
A postal address.
"""
address_line1 = models.CharField(max_length=100, blank=True)
address_line2 = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=100, blank=... | <commit_before>from django.db import models
from django_countries import CountryField
class Address(models.Model):
"""
A postal address.
"""
address_line1 = models.CharField(max_length=100, blank=True)
address_line2 = models.CharField(max_length=100, blank=True)
city = models.CharField(max_len... |
bc8e064e41d43a4579c8111f1480b55e660ca186 | pep8ify/fixes/fix_tabs.py | pep8ify/fixes/fix_tabs.py | from __future__ import unicode_literals
from lib2to3.fixer_base import BaseFix
from lib2to3.pytree import Leaf
SPACES = ' ' * 4
class FixTabs(BaseFix):
'''
For new projects, spaces-only are strongly recommended over tabs. Most
editors have features that make this easy to do.
'''
def match(self, ... | from __future__ import unicode_literals
from lib2to3.fixer_base import BaseFix
from lib2to3.pytree import Leaf
from .utils import SPACES
class FixTabs(BaseFix):
'''
For new projects, spaces-only are strongly recommended over tabs. Most
editors have features that make this easy to do.
'''
def mat... | Use globally define number of spaces. | Clean-up: Use globally define number of spaces.
| Python | apache-2.0 | spulec/pep8ify | from __future__ import unicode_literals
from lib2to3.fixer_base import BaseFix
from lib2to3.pytree import Leaf
SPACES = ' ' * 4
class FixTabs(BaseFix):
'''
For new projects, spaces-only are strongly recommended over tabs. Most
editors have features that make this easy to do.
'''
def match(self, ... | from __future__ import unicode_literals
from lib2to3.fixer_base import BaseFix
from lib2to3.pytree import Leaf
from .utils import SPACES
class FixTabs(BaseFix):
'''
For new projects, spaces-only are strongly recommended over tabs. Most
editors have features that make this easy to do.
'''
def mat... | <commit_before>from __future__ import unicode_literals
from lib2to3.fixer_base import BaseFix
from lib2to3.pytree import Leaf
SPACES = ' ' * 4
class FixTabs(BaseFix):
'''
For new projects, spaces-only are strongly recommended over tabs. Most
editors have features that make this easy to do.
'''
d... | from __future__ import unicode_literals
from lib2to3.fixer_base import BaseFix
from lib2to3.pytree import Leaf
from .utils import SPACES
class FixTabs(BaseFix):
'''
For new projects, spaces-only are strongly recommended over tabs. Most
editors have features that make this easy to do.
'''
def mat... | from __future__ import unicode_literals
from lib2to3.fixer_base import BaseFix
from lib2to3.pytree import Leaf
SPACES = ' ' * 4
class FixTabs(BaseFix):
'''
For new projects, spaces-only are strongly recommended over tabs. Most
editors have features that make this easy to do.
'''
def match(self, ... | <commit_before>from __future__ import unicode_literals
from lib2to3.fixer_base import BaseFix
from lib2to3.pytree import Leaf
SPACES = ' ' * 4
class FixTabs(BaseFix):
'''
For new projects, spaces-only are strongly recommended over tabs. Most
editors have features that make this easy to do.
'''
d... |
64533459ffa6c33d4708bbc6ff0de9f295ef771d | permissions/tests/base.py | permissions/tests/base.py | from django.test import TestCase as BaseTestCase
from django.test import RequestFactory
from permissions import PermissionsRegistry as BasePermissionsRegistry
class PermissionsRegistry(BasePermissionsRegistry):
def _get_model_instance(self, model, **kwargs):
return model(**kwargs)
class Model:
d... | from django.test import TestCase as BaseTestCase
from django.test import RequestFactory
from permissions import PermissionsRegistry as BasePermissionsRegistry
class PermissionsRegistry(BasePermissionsRegistry):
def _get_model_instance(self, model, **kwargs):
return model(**kwargs)
class Model:
d... | Add mock User and Anonymous user classes for testing | Add mock User and Anonymous user classes for testing
| Python | mit | PSU-OIT-ARC/django-perms,wylee/django-perms | from django.test import TestCase as BaseTestCase
from django.test import RequestFactory
from permissions import PermissionsRegistry as BasePermissionsRegistry
class PermissionsRegistry(BasePermissionsRegistry):
def _get_model_instance(self, model, **kwargs):
return model(**kwargs)
class Model:
d... | from django.test import TestCase as BaseTestCase
from django.test import RequestFactory
from permissions import PermissionsRegistry as BasePermissionsRegistry
class PermissionsRegistry(BasePermissionsRegistry):
def _get_model_instance(self, model, **kwargs):
return model(**kwargs)
class Model:
d... | <commit_before>from django.test import TestCase as BaseTestCase
from django.test import RequestFactory
from permissions import PermissionsRegistry as BasePermissionsRegistry
class PermissionsRegistry(BasePermissionsRegistry):
def _get_model_instance(self, model, **kwargs):
return model(**kwargs)
clas... | from django.test import TestCase as BaseTestCase
from django.test import RequestFactory
from permissions import PermissionsRegistry as BasePermissionsRegistry
class PermissionsRegistry(BasePermissionsRegistry):
def _get_model_instance(self, model, **kwargs):
return model(**kwargs)
class Model:
d... | from django.test import TestCase as BaseTestCase
from django.test import RequestFactory
from permissions import PermissionsRegistry as BasePermissionsRegistry
class PermissionsRegistry(BasePermissionsRegistry):
def _get_model_instance(self, model, **kwargs):
return model(**kwargs)
class Model:
d... | <commit_before>from django.test import TestCase as BaseTestCase
from django.test import RequestFactory
from permissions import PermissionsRegistry as BasePermissionsRegistry
class PermissionsRegistry(BasePermissionsRegistry):
def _get_model_instance(self, model, **kwargs):
return model(**kwargs)
clas... |
80264289fa7fc4085069df011cd8499c64767dc5 | elang/tools/pre-commit.py | elang/tools/pre-commit.py | #
# Pre-commit check
#
import pipes
import sys
def main():
git_pipe = pipes.Template()
git_pipe.prepend('git diff --cached --name-status', '.-')
diff_output = git_pipe.open('files', 'r')
lines = diff_output.readlines()
exit_code = 0
for line in lines:
line = line.rstrip()... | #
# Pre-commit check
#
import pipes
import sys
EXCLUDE_DIRS = [
'base/',
'build/',
'testing/',
'third_party/',
]
def shouldCheck(path):
for dir in EXCLUDE_DIRS:
if path.startswith(dir):
return False
return True
def main():
git_pipe = pipes.Templat... | Exclude base/, build/, third_party/ and tools/ from cpplint. | tools: Exclude base/, build/, third_party/ and tools/ from cpplint.
| Python | apache-2.0 | eval1749/elang,eval1749/elang,eval1749/elang,eval1749/elang,eval1749/elang | #
# Pre-commit check
#
import pipes
import sys
def main():
git_pipe = pipes.Template()
git_pipe.prepend('git diff --cached --name-status', '.-')
diff_output = git_pipe.open('files', 'r')
lines = diff_output.readlines()
exit_code = 0
for line in lines:
line = line.rstrip()... | #
# Pre-commit check
#
import pipes
import sys
EXCLUDE_DIRS = [
'base/',
'build/',
'testing/',
'third_party/',
]
def shouldCheck(path):
for dir in EXCLUDE_DIRS:
if path.startswith(dir):
return False
return True
def main():
git_pipe = pipes.Templat... | <commit_before>#
# Pre-commit check
#
import pipes
import sys
def main():
git_pipe = pipes.Template()
git_pipe.prepend('git diff --cached --name-status', '.-')
diff_output = git_pipe.open('files', 'r')
lines = diff_output.readlines()
exit_code = 0
for line in lines:
line ... | #
# Pre-commit check
#
import pipes
import sys
EXCLUDE_DIRS = [
'base/',
'build/',
'testing/',
'third_party/',
]
def shouldCheck(path):
for dir in EXCLUDE_DIRS:
if path.startswith(dir):
return False
return True
def main():
git_pipe = pipes.Templat... | #
# Pre-commit check
#
import pipes
import sys
def main():
git_pipe = pipes.Template()
git_pipe.prepend('git diff --cached --name-status', '.-')
diff_output = git_pipe.open('files', 'r')
lines = diff_output.readlines()
exit_code = 0
for line in lines:
line = line.rstrip()... | <commit_before>#
# Pre-commit check
#
import pipes
import sys
def main():
git_pipe = pipes.Template()
git_pipe.prepend('git diff --cached --name-status', '.-')
diff_output = git_pipe.open('files', 'r')
lines = diff_output.readlines()
exit_code = 0
for line in lines:
line ... |
cefaa6c8f0fd3c26be2bf6fba75d01b2f5095a34 | strapmin/widgets.py | strapmin/widgets.py | from django import forms
from django.forms.util import flatatt
from django.template.loader import render_to_string
from django.utils.encoding import force_text
from django.utils.safestring import mark_safe
class RichTextEditorWidget(forms.Textarea):
class Media:
js = ('admin/js/ckeditor/ckeditor.... | from django import forms
from django.template.loader import render_to_string
from django.utils.encoding import force_text
from django.utils.safestring import mark_safe
try:
from django.forms.utils import flatatt
except ImportError:
from django.forms.util import flatatt
class RichTextEditorWidget... | Fix flatatt import path for Django 1.9 | Fix flatatt import path for Django 1.9
| Python | bsd-2-clause | knyghty/strapmin,knyghty/strapmin,knyghty/strapmin | from django import forms
from django.forms.util import flatatt
from django.template.loader import render_to_string
from django.utils.encoding import force_text
from django.utils.safestring import mark_safe
class RichTextEditorWidget(forms.Textarea):
class Media:
js = ('admin/js/ckeditor/ckeditor.... | from django import forms
from django.template.loader import render_to_string
from django.utils.encoding import force_text
from django.utils.safestring import mark_safe
try:
from django.forms.utils import flatatt
except ImportError:
from django.forms.util import flatatt
class RichTextEditorWidget... | <commit_before>from django import forms
from django.forms.util import flatatt
from django.template.loader import render_to_string
from django.utils.encoding import force_text
from django.utils.safestring import mark_safe
class RichTextEditorWidget(forms.Textarea):
class Media:
js = ('admin/js/cke... | from django import forms
from django.template.loader import render_to_string
from django.utils.encoding import force_text
from django.utils.safestring import mark_safe
try:
from django.forms.utils import flatatt
except ImportError:
from django.forms.util import flatatt
class RichTextEditorWidget... | from django import forms
from django.forms.util import flatatt
from django.template.loader import render_to_string
from django.utils.encoding import force_text
from django.utils.safestring import mark_safe
class RichTextEditorWidget(forms.Textarea):
class Media:
js = ('admin/js/ckeditor/ckeditor.... | <commit_before>from django import forms
from django.forms.util import flatatt
from django.template.loader import render_to_string
from django.utils.encoding import force_text
from django.utils.safestring import mark_safe
class RichTextEditorWidget(forms.Textarea):
class Media:
js = ('admin/js/cke... |
61909686132143db127deb31d582e44f5b198729 | project/gym_app/admin.py | project/gym_app/admin.py | from django.contrib import admin
from gym_app.models import Task, Athlete, PersonalTrainer, BodyScreening, WorkoutPlan, Tracker, MailBox, Message
from django.contrib.auth.models import Permission
# Register your models here.
admin.site.register(Task)
admin.site.register(Permission)
admin.site.register(Athlete)
admin.s... | from django.contrib import admin
from gym_app.models import Task
from django.contrib.auth.models import Permission
# Register your models here.
admin.site.register(Task)
admin.site.register(Permission)
| Remove permission to edit tables | Remove permission to edit tables
| Python | mit | brunoliveira8/managyment,brunoliveira8/managyment,brunoliveira8/managyment | from django.contrib import admin
from gym_app.models import Task, Athlete, PersonalTrainer, BodyScreening, WorkoutPlan, Tracker, MailBox, Message
from django.contrib.auth.models import Permission
# Register your models here.
admin.site.register(Task)
admin.site.register(Permission)
admin.site.register(Athlete)
admin.s... | from django.contrib import admin
from gym_app.models import Task
from django.contrib.auth.models import Permission
# Register your models here.
admin.site.register(Task)
admin.site.register(Permission)
| <commit_before>from django.contrib import admin
from gym_app.models import Task, Athlete, PersonalTrainer, BodyScreening, WorkoutPlan, Tracker, MailBox, Message
from django.contrib.auth.models import Permission
# Register your models here.
admin.site.register(Task)
admin.site.register(Permission)
admin.site.register(A... | from django.contrib import admin
from gym_app.models import Task
from django.contrib.auth.models import Permission
# Register your models here.
admin.site.register(Task)
admin.site.register(Permission)
| from django.contrib import admin
from gym_app.models import Task, Athlete, PersonalTrainer, BodyScreening, WorkoutPlan, Tracker, MailBox, Message
from django.contrib.auth.models import Permission
# Register your models here.
admin.site.register(Task)
admin.site.register(Permission)
admin.site.register(Athlete)
admin.s... | <commit_before>from django.contrib import admin
from gym_app.models import Task, Athlete, PersonalTrainer, BodyScreening, WorkoutPlan, Tracker, MailBox, Message
from django.contrib.auth.models import Permission
# Register your models here.
admin.site.register(Task)
admin.site.register(Permission)
admin.site.register(A... |
752cc60f8c41d098ff8772ed400ac3ae209d9e0f | lib/exp/featx/__init__.py | lib/exp/featx/__init__.py | __all__ = []
from lib.exp.featx.base import Feats
from lib.exp.tools.slider import Slider
from lib.exp.tools.video import Video
from lib.exp.prepare import Prepare
class Featx(Feats):
def __init__(self, root, name):
Feats.__init__(self, root, name)
def get_slide_feats(self):
ss = Slider(self... | __all__ = []
from lib.exp.featx.base import Feats
from lib.exp.tools.slider import Slider
from lib.exp.tools.video import Video
from lib.exp.pre import Reducer
class Featx(Feats):
def __init__(self, root, name):
Feats.__init__(self, root, name)
def get_slide_feats(self):
ss = Slider(self.roo... | Use `reducer` to replace `prepare` | Use `reducer` to replace `prepare`
| Python | agpl-3.0 | speed-of-light/pyslider | __all__ = []
from lib.exp.featx.base import Feats
from lib.exp.tools.slider import Slider
from lib.exp.tools.video import Video
from lib.exp.prepare import Prepare
class Featx(Feats):
def __init__(self, root, name):
Feats.__init__(self, root, name)
def get_slide_feats(self):
ss = Slider(self... | __all__ = []
from lib.exp.featx.base import Feats
from lib.exp.tools.slider import Slider
from lib.exp.tools.video import Video
from lib.exp.pre import Reducer
class Featx(Feats):
def __init__(self, root, name):
Feats.__init__(self, root, name)
def get_slide_feats(self):
ss = Slider(self.roo... | <commit_before>__all__ = []
from lib.exp.featx.base import Feats
from lib.exp.tools.slider import Slider
from lib.exp.tools.video import Video
from lib.exp.prepare import Prepare
class Featx(Feats):
def __init__(self, root, name):
Feats.__init__(self, root, name)
def get_slide_feats(self):
s... | __all__ = []
from lib.exp.featx.base import Feats
from lib.exp.tools.slider import Slider
from lib.exp.tools.video import Video
from lib.exp.pre import Reducer
class Featx(Feats):
def __init__(self, root, name):
Feats.__init__(self, root, name)
def get_slide_feats(self):
ss = Slider(self.roo... | __all__ = []
from lib.exp.featx.base import Feats
from lib.exp.tools.slider import Slider
from lib.exp.tools.video import Video
from lib.exp.prepare import Prepare
class Featx(Feats):
def __init__(self, root, name):
Feats.__init__(self, root, name)
def get_slide_feats(self):
ss = Slider(self... | <commit_before>__all__ = []
from lib.exp.featx.base import Feats
from lib.exp.tools.slider import Slider
from lib.exp.tools.video import Video
from lib.exp.prepare import Prepare
class Featx(Feats):
def __init__(self, root, name):
Feats.__init__(self, root, name)
def get_slide_feats(self):
s... |
159e1e210480c0037b3a550e70b77dbfce34bbca | ptyme/ptyme.py | ptyme/ptyme.py | #!/bin/env python3
from sys import argv
def main():
parseArgs()
print("Nope.")
print(argv)
def parseArgs():
if len(argv) > 1:
time = argv[1].split('h')
print(time)
if 'm' not in time[0] and 'n' not in time[0]:
hours = time[0]
else:
house = 0
... | #!/bin/env python3
from sys import argv
def main():
parseArgs()
print("Nope.")
print(argv)
# go through via characters
def parseArgsChar():
pass()
# while this works, it only works when _h_m_s format
# might want to not do that
def parseArgs():
if len(argv) > 1:
time = argv[1].split('h')... | Update current parse, add alt parse frame | Update current parse, add alt parse frame
| Python | mit | jabocg/ptyme | #!/bin/env python3
from sys import argv
def main():
parseArgs()
print("Nope.")
print(argv)
def parseArgs():
if len(argv) > 1:
time = argv[1].split('h')
print(time)
if 'm' not in time[0] and 'n' not in time[0]:
hours = time[0]
else:
house = 0
... | #!/bin/env python3
from sys import argv
def main():
parseArgs()
print("Nope.")
print(argv)
# go through via characters
def parseArgsChar():
pass()
# while this works, it only works when _h_m_s format
# might want to not do that
def parseArgs():
if len(argv) > 1:
time = argv[1].split('h')... | <commit_before>#!/bin/env python3
from sys import argv
def main():
parseArgs()
print("Nope.")
print(argv)
def parseArgs():
if len(argv) > 1:
time = argv[1].split('h')
print(time)
if 'm' not in time[0] and 'n' not in time[0]:
hours = time[0]
else:
... | #!/bin/env python3
from sys import argv
def main():
parseArgs()
print("Nope.")
print(argv)
# go through via characters
def parseArgsChar():
pass()
# while this works, it only works when _h_m_s format
# might want to not do that
def parseArgs():
if len(argv) > 1:
time = argv[1].split('h')... | #!/bin/env python3
from sys import argv
def main():
parseArgs()
print("Nope.")
print(argv)
def parseArgs():
if len(argv) > 1:
time = argv[1].split('h')
print(time)
if 'm' not in time[0] and 'n' not in time[0]:
hours = time[0]
else:
house = 0
... | <commit_before>#!/bin/env python3
from sys import argv
def main():
parseArgs()
print("Nope.")
print(argv)
def parseArgs():
if len(argv) > 1:
time = argv[1].split('h')
print(time)
if 'm' not in time[0] and 'n' not in time[0]:
hours = time[0]
else:
... |
dff5a8650c5d7ed5b5bab12b36ac5d61541dbb4e | python/day3.py | python/day3.py | import sys
def read_sides(line):
return map(int, line.split())
def valid_triangle((a, b, c)):
return a + b > c and b + c > a and a + c > b
if __name__ == '__main__':
print len(filter(valid_triangle, map(read_sides, sys.stdin)))
| import sys
import itertools
def grouper(iterable, n, fillvalue=None):
args = [iter(iterable)] * n
return itertools.izip_longest(fillvalue=fillvalue, *args)
def transpose(xs):
return zip(*xs)
def read_sides(line):
return map(int, line.split())
def valid_triangle((a, b, c)):
return a + b > c a... | Implement part 2 of day 3 Python solution. | Implement part 2 of day 3 Python solution.
| Python | mit | jonathanj/advent2016 | import sys
def read_sides(line):
return map(int, line.split())
def valid_triangle((a, b, c)):
return a + b > c and b + c > a and a + c > b
if __name__ == '__main__':
print len(filter(valid_triangle, map(read_sides, sys.stdin)))
Implement part 2 of day 3 Python solution. | import sys
import itertools
def grouper(iterable, n, fillvalue=None):
args = [iter(iterable)] * n
return itertools.izip_longest(fillvalue=fillvalue, *args)
def transpose(xs):
return zip(*xs)
def read_sides(line):
return map(int, line.split())
def valid_triangle((a, b, c)):
return a + b > c a... | <commit_before>import sys
def read_sides(line):
return map(int, line.split())
def valid_triangle((a, b, c)):
return a + b > c and b + c > a and a + c > b
if __name__ == '__main__':
print len(filter(valid_triangle, map(read_sides, sys.stdin)))
<commit_msg>Implement part 2 of day 3 Python solution.<comm... | import sys
import itertools
def grouper(iterable, n, fillvalue=None):
args = [iter(iterable)] * n
return itertools.izip_longest(fillvalue=fillvalue, *args)
def transpose(xs):
return zip(*xs)
def read_sides(line):
return map(int, line.split())
def valid_triangle((a, b, c)):
return a + b > c a... | import sys
def read_sides(line):
return map(int, line.split())
def valid_triangle((a, b, c)):
return a + b > c and b + c > a and a + c > b
if __name__ == '__main__':
print len(filter(valid_triangle, map(read_sides, sys.stdin)))
Implement part 2 of day 3 Python solution.import sys
import itertools
de... | <commit_before>import sys
def read_sides(line):
return map(int, line.split())
def valid_triangle((a, b, c)):
return a + b > c and b + c > a and a + c > b
if __name__ == '__main__':
print len(filter(valid_triangle, map(read_sides, sys.stdin)))
<commit_msg>Implement part 2 of day 3 Python solution.<comm... |
65f0ef0ae523059db6ecf3856c9e2695cad81d38 | montage/__init__.py | montage/__init__.py | from commands import *
from wrappers import *
__version__ = '0.9.1'
| from commands import *
from wrappers import *
__version__ = '0.9.1'
# Check whether Montage is installed
installed = False
for dir in os.environ['PATH'].split(':'):
if os.path.exists(dir + '/mProject'):
installed = True
break
if not installed:
raise Exception("Montage commands are not in your... | Check whether Montage commands are available | Check whether Montage commands are available
| Python | bsd-3-clause | astrofrog/montage-wrapper,astrofrog/python-montage,astrofrog/montage-wrapper,jat255/montage-wrapper,vterron/montage-wrapper,astropy/montage-wrapper | from commands import *
from wrappers import *
__version__ = '0.9.1'
Check whether Montage commands are available | from commands import *
from wrappers import *
__version__ = '0.9.1'
# Check whether Montage is installed
installed = False
for dir in os.environ['PATH'].split(':'):
if os.path.exists(dir + '/mProject'):
installed = True
break
if not installed:
raise Exception("Montage commands are not in your... | <commit_before>from commands import *
from wrappers import *
__version__ = '0.9.1'
<commit_msg>Check whether Montage commands are available<commit_after> | from commands import *
from wrappers import *
__version__ = '0.9.1'
# Check whether Montage is installed
installed = False
for dir in os.environ['PATH'].split(':'):
if os.path.exists(dir + '/mProject'):
installed = True
break
if not installed:
raise Exception("Montage commands are not in your... | from commands import *
from wrappers import *
__version__ = '0.9.1'
Check whether Montage commands are availablefrom commands import *
from wrappers import *
__version__ = '0.9.1'
# Check whether Montage is installed
installed = False
for dir in os.environ['PATH'].split(':'):
if os.path.exists(dir + '/mProject')... | <commit_before>from commands import *
from wrappers import *
__version__ = '0.9.1'
<commit_msg>Check whether Montage commands are available<commit_after>from commands import *
from wrappers import *
__version__ = '0.9.1'
# Check whether Montage is installed
installed = False
for dir in os.environ['PATH'].split(':'):... |
a2d77c167ea8ae3a62183a56b10cd121dc476481 | openfisca_france/conf/cache_blacklist.py | openfisca_france/conf/cache_blacklist.py | # When using openfisca for a large population, having too many variables in cache make openfisca performances drop.
# The following variables are intermadiate results and do not need to be cached in those usecases.
cache_blacklist = set([
'aide_logement_loyer_retenu',
'aide_logement_charges',
'aide_logement_R0',
'... | # When using openfisca for a large population, having too many variables in cache make openfisca performances drop.
# The following variables are intermadiate results and do not need to be cached in those usecases.
cache_blacklist = set([
'aide_logement_loyer_retenu',
'aide_logement_charges',
'aide_logement_R0',
'... | Add intermediary variables in cache blacklist | Add intermediary variables in cache blacklist
| Python | agpl-3.0 | antoinearnoud/openfisca-france,antoinearnoud/openfisca-france,sgmap/openfisca-france,sgmap/openfisca-france | # When using openfisca for a large population, having too many variables in cache make openfisca performances drop.
# The following variables are intermadiate results and do not need to be cached in those usecases.
cache_blacklist = set([
'aide_logement_loyer_retenu',
'aide_logement_charges',
'aide_logement_R0',
'... | # When using openfisca for a large population, having too many variables in cache make openfisca performances drop.
# The following variables are intermadiate results and do not need to be cached in those usecases.
cache_blacklist = set([
'aide_logement_loyer_retenu',
'aide_logement_charges',
'aide_logement_R0',
'... | <commit_before># When using openfisca for a large population, having too many variables in cache make openfisca performances drop.
# The following variables are intermadiate results and do not need to be cached in those usecases.
cache_blacklist = set([
'aide_logement_loyer_retenu',
'aide_logement_charges',
'aide_l... | # When using openfisca for a large population, having too many variables in cache make openfisca performances drop.
# The following variables are intermadiate results and do not need to be cached in those usecases.
cache_blacklist = set([
'aide_logement_loyer_retenu',
'aide_logement_charges',
'aide_logement_R0',
'... | # When using openfisca for a large population, having too many variables in cache make openfisca performances drop.
# The following variables are intermadiate results and do not need to be cached in those usecases.
cache_blacklist = set([
'aide_logement_loyer_retenu',
'aide_logement_charges',
'aide_logement_R0',
'... | <commit_before># When using openfisca for a large population, having too many variables in cache make openfisca performances drop.
# The following variables are intermadiate results and do not need to be cached in those usecases.
cache_blacklist = set([
'aide_logement_loyer_retenu',
'aide_logement_charges',
'aide_l... |
7a453a7c289bf72a84e69d5f69389afa2f492588 | winthrop/__init__.py | winthrop/__init__.py | __version_info__ = (0, 6, 0, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environme... | __version_info__ = (0, 7, 0, 'dev')
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environm... | Bump version number on dev to 0.7 | Bump version number on dev to 0.7
| Python | apache-2.0 | Princeton-CDH/winthrop-django,Princeton-CDH/winthrop-django,Princeton-CDH/winthrop-django | __version_info__ = (0, 6, 0, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environme... | __version_info__ = (0, 7, 0, 'dev')
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environm... | <commit_before>__version_info__ = (0, 6, 0, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the tem... | __version_info__ = (0, 7, 0, 'dev')
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environm... | __version_info__ = (0, 6, 0, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environme... | <commit_before>__version_info__ = (0, 6, 0, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the tem... |
f34330817414f72494aec359c169e5d6d9d1568f | examples/quotes/quotes.py | examples/quotes/quotes.py | import sys
print(sys.version_info)
import random
import time
import networkzero as nw0
quotes = [
"Humpty Dumpty sat on a wall",
"Hickory Dickory Dock",
"Baa Baa Black Sheep",
"Old King Cole was a merry old sould",
]
my_name = input("Name: ")
nw0.advertise(my_name)
while True:
services = [(name,... | import sys
print(sys.version_info)
import random
import time
import networkzero as nw0
quotes = [
"Humpty Dumpty sat on a wall",
"Hickory Dickory Dock",
"Baa Baa Black Sheep",
"Old King Cole was a merry old sould",
]
def main(address_pattern=None):
my_name = input("Name: ")
nw0.advertise(my_n... | Allow for a wildcard address | Allow for a wildcard address
| Python | mit | tjguk/networkzero,tjguk/networkzero,tjguk/networkzero | import sys
print(sys.version_info)
import random
import time
import networkzero as nw0
quotes = [
"Humpty Dumpty sat on a wall",
"Hickory Dickory Dock",
"Baa Baa Black Sheep",
"Old King Cole was a merry old sould",
]
my_name = input("Name: ")
nw0.advertise(my_name)
while True:
services = [(name,... | import sys
print(sys.version_info)
import random
import time
import networkzero as nw0
quotes = [
"Humpty Dumpty sat on a wall",
"Hickory Dickory Dock",
"Baa Baa Black Sheep",
"Old King Cole was a merry old sould",
]
def main(address_pattern=None):
my_name = input("Name: ")
nw0.advertise(my_n... | <commit_before>import sys
print(sys.version_info)
import random
import time
import networkzero as nw0
quotes = [
"Humpty Dumpty sat on a wall",
"Hickory Dickory Dock",
"Baa Baa Black Sheep",
"Old King Cole was a merry old sould",
]
my_name = input("Name: ")
nw0.advertise(my_name)
while True:
ser... | import sys
print(sys.version_info)
import random
import time
import networkzero as nw0
quotes = [
"Humpty Dumpty sat on a wall",
"Hickory Dickory Dock",
"Baa Baa Black Sheep",
"Old King Cole was a merry old sould",
]
def main(address_pattern=None):
my_name = input("Name: ")
nw0.advertise(my_n... | import sys
print(sys.version_info)
import random
import time
import networkzero as nw0
quotes = [
"Humpty Dumpty sat on a wall",
"Hickory Dickory Dock",
"Baa Baa Black Sheep",
"Old King Cole was a merry old sould",
]
my_name = input("Name: ")
nw0.advertise(my_name)
while True:
services = [(name,... | <commit_before>import sys
print(sys.version_info)
import random
import time
import networkzero as nw0
quotes = [
"Humpty Dumpty sat on a wall",
"Hickory Dickory Dock",
"Baa Baa Black Sheep",
"Old King Cole was a merry old sould",
]
my_name = input("Name: ")
nw0.advertise(my_name)
while True:
ser... |
6fe391b2e2f9b88a6835a6636a5d58810852ab5e | pyhole/tests/test_log.py | pyhole/tests/test_log.py | # Copyright 2011-2016 Josh Kearney
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | # Copyright 2011-2016 Josh Kearney
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | Use setup_logger properly in tests. | Use setup_logger properly in tests.
| Python | apache-2.0 | jk0/pyhole,jk0/pyhole,jk0/pyhole | # Copyright 2011-2016 Josh Kearney
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | # Copyright 2011-2016 Josh Kearney
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | <commit_before># Copyright 2011-2016 Josh Kearney
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2011-2016 Josh Kearney
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | # Copyright 2011-2016 Josh Kearney
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | <commit_before># Copyright 2011-2016 Josh Kearney
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
f868a9181d659c2440a50e6e325ad2ae5b99f5c8 | project_recalculate/models/resource_calendar.py | project_recalculate/models/resource_calendar.py | # -*- coding: utf-8 -*-
# See README.rst file on addon root folder for license details
from openerp import models, api
from datetime import datetime, timedelta
class ResourceCalendar(models.Model):
_inherit = 'resource.calendar'
@api.v7
def get_working_days_of_date(self, cr, uid, id, start_dt=None, end_... | # -*- coding: utf-8 -*-
# See README.rst file on addon root folder for license details
from openerp import models, api
from datetime import datetime, timedelta
class ResourceCalendar(models.Model):
_inherit = 'resource.calendar'
@api.v7
def get_working_days_of_date(self, cr, uid, id, start_dt=None, end_... | Define UTC as tz in get_working_days_of_date method | [FIX] Define UTC as tz in get_working_days_of_date method
| Python | agpl-3.0 | Endika/project,NeovaHealth/project-service,OCA/project-service,Antiun/project,eezee-it/project-service,Antiun/project-service,acsone/project-service,dreispt/project-service,xpansa/project-service,ddico/project,acsone/project,akretion/project-service,sergiocorato/project-service,dreispt/project | # -*- coding: utf-8 -*-
# See README.rst file on addon root folder for license details
from openerp import models, api
from datetime import datetime, timedelta
class ResourceCalendar(models.Model):
_inherit = 'resource.calendar'
@api.v7
def get_working_days_of_date(self, cr, uid, id, start_dt=None, end_... | # -*- coding: utf-8 -*-
# See README.rst file on addon root folder for license details
from openerp import models, api
from datetime import datetime, timedelta
class ResourceCalendar(models.Model):
_inherit = 'resource.calendar'
@api.v7
def get_working_days_of_date(self, cr, uid, id, start_dt=None, end_... | <commit_before># -*- coding: utf-8 -*-
# See README.rst file on addon root folder for license details
from openerp import models, api
from datetime import datetime, timedelta
class ResourceCalendar(models.Model):
_inherit = 'resource.calendar'
@api.v7
def get_working_days_of_date(self, cr, uid, id, star... | # -*- coding: utf-8 -*-
# See README.rst file on addon root folder for license details
from openerp import models, api
from datetime import datetime, timedelta
class ResourceCalendar(models.Model):
_inherit = 'resource.calendar'
@api.v7
def get_working_days_of_date(self, cr, uid, id, start_dt=None, end_... | # -*- coding: utf-8 -*-
# See README.rst file on addon root folder for license details
from openerp import models, api
from datetime import datetime, timedelta
class ResourceCalendar(models.Model):
_inherit = 'resource.calendar'
@api.v7
def get_working_days_of_date(self, cr, uid, id, start_dt=None, end_... | <commit_before># -*- coding: utf-8 -*-
# See README.rst file on addon root folder for license details
from openerp import models, api
from datetime import datetime, timedelta
class ResourceCalendar(models.Model):
_inherit = 'resource.calendar'
@api.v7
def get_working_days_of_date(self, cr, uid, id, star... |
1a830d0581f2baed76cb48eeee5f32d465737657 | src/artgraph/plugins/infobox.py | src/artgraph/plugins/infobox.py | from artgraph.node import NodeTypes
from artgraph.plugins import Plugin
class InfoboxPlugin(Plugin):
def __init__(self, node):
self._node = node
@staticmethod
def get_target_node_type():
return NodeTypes.ARTIST
def get_nodes(self):
from artgraph.node import Node, N... | from artgraph.node import NodeTypes
from artgraph.plugins import Plugin
class InfoboxPlugin(Plugin):
def __init__(self, node):
self._node = node
@staticmethod
def get_target_node_type():
return NodeTypes.ARTIST
def get_nodes(self):
from artgraph.node import Node, N... | Check if there are associated acts before querying for them | Check if there are associated acts before querying for them | Python | mit | dMaggot/ArtistGraph | from artgraph.node import NodeTypes
from artgraph.plugins import Plugin
class InfoboxPlugin(Plugin):
def __init__(self, node):
self._node = node
@staticmethod
def get_target_node_type():
return NodeTypes.ARTIST
def get_nodes(self):
from artgraph.node import Node, N... | from artgraph.node import NodeTypes
from artgraph.plugins import Plugin
class InfoboxPlugin(Plugin):
def __init__(self, node):
self._node = node
@staticmethod
def get_target_node_type():
return NodeTypes.ARTIST
def get_nodes(self):
from artgraph.node import Node, N... | <commit_before>from artgraph.node import NodeTypes
from artgraph.plugins import Plugin
class InfoboxPlugin(Plugin):
def __init__(self, node):
self._node = node
@staticmethod
def get_target_node_type():
return NodeTypes.ARTIST
def get_nodes(self):
from artgraph.node... | from artgraph.node import NodeTypes
from artgraph.plugins import Plugin
class InfoboxPlugin(Plugin):
def __init__(self, node):
self._node = node
@staticmethod
def get_target_node_type():
return NodeTypes.ARTIST
def get_nodes(self):
from artgraph.node import Node, N... | from artgraph.node import NodeTypes
from artgraph.plugins import Plugin
class InfoboxPlugin(Plugin):
def __init__(self, node):
self._node = node
@staticmethod
def get_target_node_type():
return NodeTypes.ARTIST
def get_nodes(self):
from artgraph.node import Node, N... | <commit_before>from artgraph.node import NodeTypes
from artgraph.plugins import Plugin
class InfoboxPlugin(Plugin):
def __init__(self, node):
self._node = node
@staticmethod
def get_target_node_type():
return NodeTypes.ARTIST
def get_nodes(self):
from artgraph.node... |
a5441719e8f12cc16189b2ca110c878decfed120 | airflow/operators/mysql_operator.py | airflow/operators/mysql_operator.py | import logging
from airflow.hooks import MySqlHook
from airflow.models import BaseOperator
from airflow.utils import apply_defaults
class MySqlOperator(BaseOperator):
"""
Executes sql code in a specific MySQL database
:param mysql_conn_id: reference to a specific mysql database
:type mysql_conn_id: ... | import logging
from airflow.hooks import MySqlHook
from airflow.models import BaseOperator
from airflow.utils import apply_defaults
class MySqlOperator(BaseOperator):
"""
Executes sql code in a specific MySQL database
:param mysql_conn_id: reference to a specific mysql database
:type mysql_conn_id: ... | Allow auto-commit option for Mysql Operator | Allow auto-commit option for Mysql Operator
| Python | apache-2.0 | jlowin/airflow,lxneng/incubator-airflow,cjqian/incubator-airflow,dhuang/incubator-airflow,gritlogic/incubator-airflow,forevernull/incubator-airflow,modsy/incubator-airflow,jesusfcr/airflow,ronfung/incubator-airflow,nathanielvarona/airflow,holygits/incubator-airflow,akosel/incubator-airflow,wxiang7/airflow,fenglu-g/incu... | import logging
from airflow.hooks import MySqlHook
from airflow.models import BaseOperator
from airflow.utils import apply_defaults
class MySqlOperator(BaseOperator):
"""
Executes sql code in a specific MySQL database
:param mysql_conn_id: reference to a specific mysql database
:type mysql_conn_id: ... | import logging
from airflow.hooks import MySqlHook
from airflow.models import BaseOperator
from airflow.utils import apply_defaults
class MySqlOperator(BaseOperator):
"""
Executes sql code in a specific MySQL database
:param mysql_conn_id: reference to a specific mysql database
:type mysql_conn_id: ... | <commit_before>import logging
from airflow.hooks import MySqlHook
from airflow.models import BaseOperator
from airflow.utils import apply_defaults
class MySqlOperator(BaseOperator):
"""
Executes sql code in a specific MySQL database
:param mysql_conn_id: reference to a specific mysql database
:type ... | import logging
from airflow.hooks import MySqlHook
from airflow.models import BaseOperator
from airflow.utils import apply_defaults
class MySqlOperator(BaseOperator):
"""
Executes sql code in a specific MySQL database
:param mysql_conn_id: reference to a specific mysql database
:type mysql_conn_id: ... | import logging
from airflow.hooks import MySqlHook
from airflow.models import BaseOperator
from airflow.utils import apply_defaults
class MySqlOperator(BaseOperator):
"""
Executes sql code in a specific MySQL database
:param mysql_conn_id: reference to a specific mysql database
:type mysql_conn_id: ... | <commit_before>import logging
from airflow.hooks import MySqlHook
from airflow.models import BaseOperator
from airflow.utils import apply_defaults
class MySqlOperator(BaseOperator):
"""
Executes sql code in a specific MySQL database
:param mysql_conn_id: reference to a specific mysql database
:type ... |
9f5f59783fa29cf376f975864af1b3a9325cadd0 | tests/test_utils.py | tests/test_utils.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import types
from os.path import abspath, dirname, join
from epubcheck import utils, samples
TEST_DIR = abspath(dirname(samples.__file__))
def test_utils_java_version():
assert utils.java_version().startswith('java version')
def test_epubcheck_he... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import types
from os.path import abspath, dirname, join
from epubcheck import utils, samples
TEST_DIR = abspath(dirname(samples.__file__))
def test_utils_java_version():
assert utils.java_version().startswith('java version')
def test_epubcheck_he... | Fix unit test failing on case sensitivity | Fix unit test failing on case sensitivity
| Python | bsd-2-clause | titusz/epubcheck | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import types
from os.path import abspath, dirname, join
from epubcheck import utils, samples
TEST_DIR = abspath(dirname(samples.__file__))
def test_utils_java_version():
assert utils.java_version().startswith('java version')
def test_epubcheck_he... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import types
from os.path import abspath, dirname, join
from epubcheck import utils, samples
TEST_DIR = abspath(dirname(samples.__file__))
def test_utils_java_version():
assert utils.java_version().startswith('java version')
def test_epubcheck_he... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
import types
from os.path import abspath, dirname, join
from epubcheck import utils, samples
TEST_DIR = abspath(dirname(samples.__file__))
def test_utils_java_version():
assert utils.java_version().startswith('java version')
def te... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import types
from os.path import abspath, dirname, join
from epubcheck import utils, samples
TEST_DIR = abspath(dirname(samples.__file__))
def test_utils_java_version():
assert utils.java_version().startswith('java version')
def test_epubcheck_he... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import types
from os.path import abspath, dirname, join
from epubcheck import utils, samples
TEST_DIR = abspath(dirname(samples.__file__))
def test_utils_java_version():
assert utils.java_version().startswith('java version')
def test_epubcheck_he... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
import types
from os.path import abspath, dirname, join
from epubcheck import utils, samples
TEST_DIR = abspath(dirname(samples.__file__))
def test_utils_java_version():
assert utils.java_version().startswith('java version')
def te... |
21d9b2f89a7eb9a6801a48c2586cc360e6be47c3 | LTA_to_UVFITS.py | LTA_to_UVFITS.py | def lta_to_uvfits():
lta_files = glob.glob('*.lta*')
#flag_files = glob.glob('*.FLAGS*')
for i in range(len(lta_files)):
lta_file_name = lta_files[i]
uvfits_file_name = lta_file_name +'.UVFITS'
spam.convert_lta_to_uvfits( lta_file_name, uvfits_file_name )
| def lta_to_uvfits():
lta_files = glob.glob('*.lta*')
#flag_files = glob.glob('*.FLAGS*')
for i in range(len(lta_files)):
lta_file_name = lta_files[i]
uvfits_file_name = lta_file_name +'.UVFITS'
spam.convert_lta_to_uvfits( lta_file_name, uvfits_file_name )
return lta_files
| Return LTA files to use as argument in main thread code | Return LTA files to use as argument in main thread code
| Python | mit | NCRA-TIFR/gadpu,NCRA-TIFR/gadpu | def lta_to_uvfits():
lta_files = glob.glob('*.lta*')
#flag_files = glob.glob('*.FLAGS*')
for i in range(len(lta_files)):
lta_file_name = lta_files[i]
uvfits_file_name = lta_file_name +'.UVFITS'
spam.convert_lta_to_uvfits( lta_file_name, uvfits_file_name )
Return LTA files to use as argument in main thread cod... | def lta_to_uvfits():
lta_files = glob.glob('*.lta*')
#flag_files = glob.glob('*.FLAGS*')
for i in range(len(lta_files)):
lta_file_name = lta_files[i]
uvfits_file_name = lta_file_name +'.UVFITS'
spam.convert_lta_to_uvfits( lta_file_name, uvfits_file_name )
return lta_files
| <commit_before>def lta_to_uvfits():
lta_files = glob.glob('*.lta*')
#flag_files = glob.glob('*.FLAGS*')
for i in range(len(lta_files)):
lta_file_name = lta_files[i]
uvfits_file_name = lta_file_name +'.UVFITS'
spam.convert_lta_to_uvfits( lta_file_name, uvfits_file_name )
<commit_msg>Return LTA files to use as ... | def lta_to_uvfits():
lta_files = glob.glob('*.lta*')
#flag_files = glob.glob('*.FLAGS*')
for i in range(len(lta_files)):
lta_file_name = lta_files[i]
uvfits_file_name = lta_file_name +'.UVFITS'
spam.convert_lta_to_uvfits( lta_file_name, uvfits_file_name )
return lta_files
| def lta_to_uvfits():
lta_files = glob.glob('*.lta*')
#flag_files = glob.glob('*.FLAGS*')
for i in range(len(lta_files)):
lta_file_name = lta_files[i]
uvfits_file_name = lta_file_name +'.UVFITS'
spam.convert_lta_to_uvfits( lta_file_name, uvfits_file_name )
Return LTA files to use as argument in main thread cod... | <commit_before>def lta_to_uvfits():
lta_files = glob.glob('*.lta*')
#flag_files = glob.glob('*.FLAGS*')
for i in range(len(lta_files)):
lta_file_name = lta_files[i]
uvfits_file_name = lta_file_name +'.UVFITS'
spam.convert_lta_to_uvfits( lta_file_name, uvfits_file_name )
<commit_msg>Return LTA files to use as ... |
dee7b02d0cdd6969b4228086ab9af77ad1da60ef | asymmetric_jwt_auth/models.py | asymmetric_jwt_auth/models.py | from django.conf import settings
from django.db import models
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from cryptography.hazmat.primitives.serialization import load_ssh_public_key
from cryptography.hazmat.backends import default_backend
def validate_public_key(val... | from django.conf import settings
from django.db import models
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from cryptography.hazmat.primitives.serialization import load_pem_public_key, load_ssh_public_key
from cryptography.hazmat.backends import default_backend
def va... | Allow PEM format keys through validation | Allow PEM format keys through validation
| Python | isc | crgwbr/asymmetric_jwt_auth,crgwbr/asymmetric_jwt_auth | from django.conf import settings
from django.db import models
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from cryptography.hazmat.primitives.serialization import load_ssh_public_key
from cryptography.hazmat.backends import default_backend
def validate_public_key(val... | from django.conf import settings
from django.db import models
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from cryptography.hazmat.primitives.serialization import load_pem_public_key, load_ssh_public_key
from cryptography.hazmat.backends import default_backend
def va... | <commit_before>from django.conf import settings
from django.db import models
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from cryptography.hazmat.primitives.serialization import load_ssh_public_key
from cryptography.hazmat.backends import default_backend
def validate... | from django.conf import settings
from django.db import models
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from cryptography.hazmat.primitives.serialization import load_pem_public_key, load_ssh_public_key
from cryptography.hazmat.backends import default_backend
def va... | from django.conf import settings
from django.db import models
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from cryptography.hazmat.primitives.serialization import load_ssh_public_key
from cryptography.hazmat.backends import default_backend
def validate_public_key(val... | <commit_before>from django.conf import settings
from django.db import models
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from cryptography.hazmat.primitives.serialization import load_ssh_public_key
from cryptography.hazmat.backends import default_backend
def validate... |
f03a8fa100aeb5944402ae3b2761c0373fb6a29d | como/settings.py | como/settings.py | # -*- coding: utf-8 -*-
"""
como.settings - some global variables
"""
import os
from paxo.util import DEBUG_MODE
LOCATION_CODES = [
'1C', '2Z', '4H', '5K', '8H', '5D', '7J', 'CK', 'E', 'EE',
'F', 'FC', 'G8', 'GQ', 'PT', 'CY', 'QT', 'QP', 'RN', 'RM',
'SG', 'UV', 'U2', 'V7', 'VM', 'W8', 'WQ', 'XA', 'XB', '... | # -*- coding: utf-8 -*-
"""
como.settings - some global variables
"""
import os
from paxo.util import DEBUG_MODE
LOCATION_CODES = [
'1C', '2Z', '4H', '5K', '8H', '5D', '7J', 'CK', 'E', 'EE',
'F', 'FC', 'G8', 'GQ', 'PT', 'CY', 'QT', 'QP', 'RN', 'RM',
'SG', 'UV', 'U2', 'V7', 'VM', 'W8', 'WQ', 'XA', 'XB', '... | Update server url with https | Update server url with https
| Python | bsd-3-clause | cwoebker/como | # -*- coding: utf-8 -*-
"""
como.settings - some global variables
"""
import os
from paxo.util import DEBUG_MODE
LOCATION_CODES = [
'1C', '2Z', '4H', '5K', '8H', '5D', '7J', 'CK', 'E', 'EE',
'F', 'FC', 'G8', 'GQ', 'PT', 'CY', 'QT', 'QP', 'RN', 'RM',
'SG', 'UV', 'U2', 'V7', 'VM', 'W8', 'WQ', 'XA', 'XB', '... | # -*- coding: utf-8 -*-
"""
como.settings - some global variables
"""
import os
from paxo.util import DEBUG_MODE
LOCATION_CODES = [
'1C', '2Z', '4H', '5K', '8H', '5D', '7J', 'CK', 'E', 'EE',
'F', 'FC', 'G8', 'GQ', 'PT', 'CY', 'QT', 'QP', 'RN', 'RM',
'SG', 'UV', 'U2', 'V7', 'VM', 'W8', 'WQ', 'XA', 'XB', '... | <commit_before># -*- coding: utf-8 -*-
"""
como.settings - some global variables
"""
import os
from paxo.util import DEBUG_MODE
LOCATION_CODES = [
'1C', '2Z', '4H', '5K', '8H', '5D', '7J', 'CK', 'E', 'EE',
'F', 'FC', 'G8', 'GQ', 'PT', 'CY', 'QT', 'QP', 'RN', 'RM',
'SG', 'UV', 'U2', 'V7', 'VM', 'W8', 'WQ'... | # -*- coding: utf-8 -*-
"""
como.settings - some global variables
"""
import os
from paxo.util import DEBUG_MODE
LOCATION_CODES = [
'1C', '2Z', '4H', '5K', '8H', '5D', '7J', 'CK', 'E', 'EE',
'F', 'FC', 'G8', 'GQ', 'PT', 'CY', 'QT', 'QP', 'RN', 'RM',
'SG', 'UV', 'U2', 'V7', 'VM', 'W8', 'WQ', 'XA', 'XB', '... | # -*- coding: utf-8 -*-
"""
como.settings - some global variables
"""
import os
from paxo.util import DEBUG_MODE
LOCATION_CODES = [
'1C', '2Z', '4H', '5K', '8H', '5D', '7J', 'CK', 'E', 'EE',
'F', 'FC', 'G8', 'GQ', 'PT', 'CY', 'QT', 'QP', 'RN', 'RM',
'SG', 'UV', 'U2', 'V7', 'VM', 'W8', 'WQ', 'XA', 'XB', '... | <commit_before># -*- coding: utf-8 -*-
"""
como.settings - some global variables
"""
import os
from paxo.util import DEBUG_MODE
LOCATION_CODES = [
'1C', '2Z', '4H', '5K', '8H', '5D', '7J', 'CK', 'E', 'EE',
'F', 'FC', 'G8', 'GQ', 'PT', 'CY', 'QT', 'QP', 'RN', 'RM',
'SG', 'UV', 'U2', 'V7', 'VM', 'W8', 'WQ'... |
5aef0b64477248f6cdadfd864a6d05cbc6939f09 | trex/serializers.py | trex/serializers.py | # -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <[email protected]>
#
# See LICENSE comming with the source of 'trex' for details.
#
from rest_framework.serializers import HyperlinkedModelSerializer
from trex.models.project import Project, Entry
class ProjectSerializer(HyperlinkedModelSerializer):
class... | # -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <[email protected]>
#
# See LICENSE comming with the source of 'trex' for details.
#
from rest_framework.serializers import (
HyperlinkedModelSerializer, HyperlinkedIdentityField,
)
from trex.models.project import Project, Entry
class ProjectSerializer(Hype... | Use HyperlinkedIdentityField for entries in ProjectDetailSerializer | Use HyperlinkedIdentityField for entries in ProjectDetailSerializer
| Python | mit | bjoernricks/trex,bjoernricks/trex | # -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <[email protected]>
#
# See LICENSE comming with the source of 'trex' for details.
#
from rest_framework.serializers import HyperlinkedModelSerializer
from trex.models.project import Project, Entry
class ProjectSerializer(HyperlinkedModelSerializer):
class... | # -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <[email protected]>
#
# See LICENSE comming with the source of 'trex' for details.
#
from rest_framework.serializers import (
HyperlinkedModelSerializer, HyperlinkedIdentityField,
)
from trex.models.project import Project, Entry
class ProjectSerializer(Hype... | <commit_before># -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <[email protected]>
#
# See LICENSE comming with the source of 'trex' for details.
#
from rest_framework.serializers import HyperlinkedModelSerializer
from trex.models.project import Project, Entry
class ProjectSerializer(HyperlinkedModelSerializ... | # -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <[email protected]>
#
# See LICENSE comming with the source of 'trex' for details.
#
from rest_framework.serializers import (
HyperlinkedModelSerializer, HyperlinkedIdentityField,
)
from trex.models.project import Project, Entry
class ProjectSerializer(Hype... | # -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <[email protected]>
#
# See LICENSE comming with the source of 'trex' for details.
#
from rest_framework.serializers import HyperlinkedModelSerializer
from trex.models.project import Project, Entry
class ProjectSerializer(HyperlinkedModelSerializer):
class... | <commit_before># -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <[email protected]>
#
# See LICENSE comming with the source of 'trex' for details.
#
from rest_framework.serializers import HyperlinkedModelSerializer
from trex.models.project import Project, Entry
class ProjectSerializer(HyperlinkedModelSerializ... |
90ab0bfbac851a52f0e48f5186a727692e699a6f | geodj/youtube.py | geodj/youtube.py | from gdata.youtube.service import YouTubeService, YouTubeVideoQuery
class YoutubeMusic:
def __init__(self):
self.service = YouTubeService()
def search(self, artist):
query = YouTubeVideoQuery()
query.vq = artist
query.orderby = 'viewCount'
query.racy = 'exclude'
... | from gdata.youtube.service import YouTubeService, YouTubeVideoQuery
from django.utils.encoding import smart_str
class YoutubeMusic:
def __init__(self):
self.service = YouTubeService()
def search(self, artist):
query = YouTubeVideoQuery()
query.vq = artist
query.orderby = 'viewC... | Use smart_str and include artist in results | Use smart_str and include artist in results
| Python | mit | 6/GeoDJ,6/GeoDJ | from gdata.youtube.service import YouTubeService, YouTubeVideoQuery
class YoutubeMusic:
def __init__(self):
self.service = YouTubeService()
def search(self, artist):
query = YouTubeVideoQuery()
query.vq = artist
query.orderby = 'viewCount'
query.racy = 'exclude'
... | from gdata.youtube.service import YouTubeService, YouTubeVideoQuery
from django.utils.encoding import smart_str
class YoutubeMusic:
def __init__(self):
self.service = YouTubeService()
def search(self, artist):
query = YouTubeVideoQuery()
query.vq = artist
query.orderby = 'viewC... | <commit_before>from gdata.youtube.service import YouTubeService, YouTubeVideoQuery
class YoutubeMusic:
def __init__(self):
self.service = YouTubeService()
def search(self, artist):
query = YouTubeVideoQuery()
query.vq = artist
query.orderby = 'viewCount'
query.racy = 'e... | from gdata.youtube.service import YouTubeService, YouTubeVideoQuery
from django.utils.encoding import smart_str
class YoutubeMusic:
def __init__(self):
self.service = YouTubeService()
def search(self, artist):
query = YouTubeVideoQuery()
query.vq = artist
query.orderby = 'viewC... | from gdata.youtube.service import YouTubeService, YouTubeVideoQuery
class YoutubeMusic:
def __init__(self):
self.service = YouTubeService()
def search(self, artist):
query = YouTubeVideoQuery()
query.vq = artist
query.orderby = 'viewCount'
query.racy = 'exclude'
... | <commit_before>from gdata.youtube.service import YouTubeService, YouTubeVideoQuery
class YoutubeMusic:
def __init__(self):
self.service = YouTubeService()
def search(self, artist):
query = YouTubeVideoQuery()
query.vq = artist
query.orderby = 'viewCount'
query.racy = 'e... |
8815507f8e334238d269468e08c22f4415e58528 | spacy/lang/es/__init__.py | spacy/lang/es/__init__.py | # coding: utf8
from __future__ import unicode_literals
from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS
from .tag_map import TAG_MAP
from .stop_words import STOP_WORDS
from .lemmatizer import LOOKUP
from ..tokenizer_exceptions import BASE_EXCEPTIONS
from ...language import Language
from ...lemmatizerlookup impo... | # coding: utf8
from __future__ import unicode_literals
from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS
from .tag_map import TAG_MAP
from .stop_words import STOP_WORDS
from .lemmatizer import LOOKUP
from ..tokenizer_exceptions import BASE_EXCEPTIONS
from ...language import Language
from ...lemmatizerlookup impo... | Move SpanishDefaults out of Language class, for pickle | Move SpanishDefaults out of Language class, for pickle
| Python | mit | recognai/spaCy,explosion/spaCy,spacy-io/spaCy,spacy-io/spaCy,honnibal/spaCy,honnibal/spaCy,spacy-io/spaCy,spacy-io/spaCy,recognai/spaCy,aikramer2/spaCy,honnibal/spaCy,aikramer2/spaCy,spacy-io/spaCy,recognai/spaCy,aikramer2/spaCy,explosion/spaCy,recognai/spaCy,explosion/spaCy,spacy-io/spaCy,explosion/spaCy,aikramer2/spa... | # coding: utf8
from __future__ import unicode_literals
from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS
from .tag_map import TAG_MAP
from .stop_words import STOP_WORDS
from .lemmatizer import LOOKUP
from ..tokenizer_exceptions import BASE_EXCEPTIONS
from ...language import Language
from ...lemmatizerlookup impo... | # coding: utf8
from __future__ import unicode_literals
from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS
from .tag_map import TAG_MAP
from .stop_words import STOP_WORDS
from .lemmatizer import LOOKUP
from ..tokenizer_exceptions import BASE_EXCEPTIONS
from ...language import Language
from ...lemmatizerlookup impo... | <commit_before># coding: utf8
from __future__ import unicode_literals
from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS
from .tag_map import TAG_MAP
from .stop_words import STOP_WORDS
from .lemmatizer import LOOKUP
from ..tokenizer_exceptions import BASE_EXCEPTIONS
from ...language import Language
from ...lemmat... | # coding: utf8
from __future__ import unicode_literals
from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS
from .tag_map import TAG_MAP
from .stop_words import STOP_WORDS
from .lemmatizer import LOOKUP
from ..tokenizer_exceptions import BASE_EXCEPTIONS
from ...language import Language
from ...lemmatizerlookup impo... | # coding: utf8
from __future__ import unicode_literals
from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS
from .tag_map import TAG_MAP
from .stop_words import STOP_WORDS
from .lemmatizer import LOOKUP
from ..tokenizer_exceptions import BASE_EXCEPTIONS
from ...language import Language
from ...lemmatizerlookup impo... | <commit_before># coding: utf8
from __future__ import unicode_literals
from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS
from .tag_map import TAG_MAP
from .stop_words import STOP_WORDS
from .lemmatizer import LOOKUP
from ..tokenizer_exceptions import BASE_EXCEPTIONS
from ...language import Language
from ...lemmat... |
13da95de0f2fb17ec6cbf005be33db3b3d348831 | motivation_text/models.py | motivation_text/models.py | from django.db import models
from patient.models import Patient
from django.utils.encoding import smart_unicode
class MotivationText(models.Model):
patient = models.ForeignKey(Patient, null=False)
text = models.TextField(default='', blank=False)
time_created = models.DateTimeField(null=False, auto_now_ad... | from django.db import models
from patient.models import Patient
from django.utils.encoding import smart_unicode
class MotivationText(models.Model):
patient = models.ForeignKey(Patient, null=False)
text = models.TextField(default='', blank=False)
time_created = models.DateTimeField(null=False, auto_now_ad... | Improve unicode for motivational texts | Improve unicode for motivational texts
| Python | mit | sigurdsa/angelika-api | from django.db import models
from patient.models import Patient
from django.utils.encoding import smart_unicode
class MotivationText(models.Model):
patient = models.ForeignKey(Patient, null=False)
text = models.TextField(default='', blank=False)
time_created = models.DateTimeField(null=False, auto_now_ad... | from django.db import models
from patient.models import Patient
from django.utils.encoding import smart_unicode
class MotivationText(models.Model):
patient = models.ForeignKey(Patient, null=False)
text = models.TextField(default='', blank=False)
time_created = models.DateTimeField(null=False, auto_now_ad... | <commit_before>from django.db import models
from patient.models import Patient
from django.utils.encoding import smart_unicode
class MotivationText(models.Model):
patient = models.ForeignKey(Patient, null=False)
text = models.TextField(default='', blank=False)
time_created = models.DateTimeField(null=Fal... | from django.db import models
from patient.models import Patient
from django.utils.encoding import smart_unicode
class MotivationText(models.Model):
patient = models.ForeignKey(Patient, null=False)
text = models.TextField(default='', blank=False)
time_created = models.DateTimeField(null=False, auto_now_ad... | from django.db import models
from patient.models import Patient
from django.utils.encoding import smart_unicode
class MotivationText(models.Model):
patient = models.ForeignKey(Patient, null=False)
text = models.TextField(default='', blank=False)
time_created = models.DateTimeField(null=False, auto_now_ad... | <commit_before>from django.db import models
from patient.models import Patient
from django.utils.encoding import smart_unicode
class MotivationText(models.Model):
patient = models.ForeignKey(Patient, null=False)
text = models.TextField(default='', blank=False)
time_created = models.DateTimeField(null=Fal... |
f42ba1bebb0e7f92222d8a66f94e2550b4dde9e1 | helpers/custom_filters.py | helpers/custom_filters.py | import json
def strslice(s, length):
if not isinstance(s, basestring):
s = str(s)
return s[:length]
def urlencode(s):
if isinstance(s, unicode):
s = s.encode('utf-8')
import urllib
return urllib.quote(s)
def json_filter(data):
return json.dumps(data)
def datetimeformat(value,... | import json
def strslice(s, length):
if not isinstance(s, basestring):
s = str(s)
return s[:length]
def urlencode(s):
if isinstance(s, unicode):
s = s.encode('utf-8')
import urllib
return urllib.quote(s)
def json_filter(data):
return json.dumps(data)
def datetimeformat(value,... | Add a neattime custom filter to give me pretty times. | Add a neattime custom filter to give me pretty times. | Python | agpl-3.0 | watchcat/cbu-rotterdam,codeforamerica/Change-By-Us,watchcat/cbu-rotterdam,watchcat/cbu-rotterdam,localprojects/Change-By-Us,watchcat/cbu-rotterdam,localprojects/Change-By-Us,codeforeurope/Change-By-Us,codeforeurope/Change-By-Us,watchcat/cbu-rotterdam,codeforeurope/Change-By-Us,codeforamerica/Change-By-Us,codeforeurope/... | import json
def strslice(s, length):
if not isinstance(s, basestring):
s = str(s)
return s[:length]
def urlencode(s):
if isinstance(s, unicode):
s = s.encode('utf-8')
import urllib
return urllib.quote(s)
def json_filter(data):
return json.dumps(data)
def datetimeformat(value,... | import json
def strslice(s, length):
if not isinstance(s, basestring):
s = str(s)
return s[:length]
def urlencode(s):
if isinstance(s, unicode):
s = s.encode('utf-8')
import urllib
return urllib.quote(s)
def json_filter(data):
return json.dumps(data)
def datetimeformat(value,... | <commit_before>import json
def strslice(s, length):
if not isinstance(s, basestring):
s = str(s)
return s[:length]
def urlencode(s):
if isinstance(s, unicode):
s = s.encode('utf-8')
import urllib
return urllib.quote(s)
def json_filter(data):
return json.dumps(data)
def dateti... | import json
def strslice(s, length):
if not isinstance(s, basestring):
s = str(s)
return s[:length]
def urlencode(s):
if isinstance(s, unicode):
s = s.encode('utf-8')
import urllib
return urllib.quote(s)
def json_filter(data):
return json.dumps(data)
def datetimeformat(value,... | import json
def strslice(s, length):
if not isinstance(s, basestring):
s = str(s)
return s[:length]
def urlencode(s):
if isinstance(s, unicode):
s = s.encode('utf-8')
import urllib
return urllib.quote(s)
def json_filter(data):
return json.dumps(data)
def datetimeformat(value,... | <commit_before>import json
def strslice(s, length):
if not isinstance(s, basestring):
s = str(s)
return s[:length]
def urlencode(s):
if isinstance(s, unicode):
s = s.encode('utf-8')
import urllib
return urllib.quote(s)
def json_filter(data):
return json.dumps(data)
def dateti... |
3af22fd5583ee110f731b9e1ebecba67ebee2bd4 | sendwithus/exceptions.py | sendwithus/exceptions.py | class SendwithusError(Exception):
"""Base class for Sendwithus API errors"""
class AuthenticationError(SendwithusError):
"""API Authentication Failed"""
class APIError(SendwithusError):
"""4xx - Invalid Request (Client error)"""
class ServerError(SendwithusError):
"""5xx - Failed Request (Server e... | class SendwithusError(Exception):
"""Base class for Sendwithus API errors"""
def __init__(self, content=None):
self.content = content
class AuthenticationError(SendwithusError):
"""API Authentication Failed"""
class APIError(SendwithusError):
"""4xx - Invalid Request (Client error)"""
cla... | Add a constructor to SendwithusError that stores content | Add a constructor to SendwithusError that stores content
| Python | apache-2.0 | sendwithus/sendwithus_python | class SendwithusError(Exception):
"""Base class for Sendwithus API errors"""
class AuthenticationError(SendwithusError):
"""API Authentication Failed"""
class APIError(SendwithusError):
"""4xx - Invalid Request (Client error)"""
class ServerError(SendwithusError):
"""5xx - Failed Request (Server e... | class SendwithusError(Exception):
"""Base class for Sendwithus API errors"""
def __init__(self, content=None):
self.content = content
class AuthenticationError(SendwithusError):
"""API Authentication Failed"""
class APIError(SendwithusError):
"""4xx - Invalid Request (Client error)"""
cla... | <commit_before>class SendwithusError(Exception):
"""Base class for Sendwithus API errors"""
class AuthenticationError(SendwithusError):
"""API Authentication Failed"""
class APIError(SendwithusError):
"""4xx - Invalid Request (Client error)"""
class ServerError(SendwithusError):
"""5xx - Failed Re... | class SendwithusError(Exception):
"""Base class for Sendwithus API errors"""
def __init__(self, content=None):
self.content = content
class AuthenticationError(SendwithusError):
"""API Authentication Failed"""
class APIError(SendwithusError):
"""4xx - Invalid Request (Client error)"""
cla... | class SendwithusError(Exception):
"""Base class for Sendwithus API errors"""
class AuthenticationError(SendwithusError):
"""API Authentication Failed"""
class APIError(SendwithusError):
"""4xx - Invalid Request (Client error)"""
class ServerError(SendwithusError):
"""5xx - Failed Request (Server e... | <commit_before>class SendwithusError(Exception):
"""Base class for Sendwithus API errors"""
class AuthenticationError(SendwithusError):
"""API Authentication Failed"""
class APIError(SendwithusError):
"""4xx - Invalid Request (Client error)"""
class ServerError(SendwithusError):
"""5xx - Failed Re... |
d13db6f3466629df7d3aa8d2dc7eb31a9ec1f8b4 | app/settings.py | app/settings.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Flask application default config:
# http://flask.pocoo.org/docs/config/#configuring-from-files
# https://github.com/mbr/flask-appconfig
project_name = u'Ninhursag'
class Default(object):
APP_NAME = project_name
DEBUG = False
TESTING = False
# Serve... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Flask application default config:
# http://flask.pocoo.org/docs/config/#configuring-from-files
# https://github.com/mbr/flask-appconfig
project_name = u'Ninhursag'
class Default(object):
APP_NAME = project_name
DEBUG = False
TESTING = False
# Serve... | Use localhost:5000 for the dev server by default. | Use localhost:5000 for the dev server by default.
| Python | mit | peterhil/ninhursag,peterhil/ninhursag,peterhil/ninhursag,peterhil/ninhursag | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Flask application default config:
# http://flask.pocoo.org/docs/config/#configuring-from-files
# https://github.com/mbr/flask-appconfig
project_name = u'Ninhursag'
class Default(object):
APP_NAME = project_name
DEBUG = False
TESTING = False
# Serve... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Flask application default config:
# http://flask.pocoo.org/docs/config/#configuring-from-files
# https://github.com/mbr/flask-appconfig
project_name = u'Ninhursag'
class Default(object):
APP_NAME = project_name
DEBUG = False
TESTING = False
# Serve... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Flask application default config:
# http://flask.pocoo.org/docs/config/#configuring-from-files
# https://github.com/mbr/flask-appconfig
project_name = u'Ninhursag'
class Default(object):
APP_NAME = project_name
DEBUG = False
TESTING = Fal... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Flask application default config:
# http://flask.pocoo.org/docs/config/#configuring-from-files
# https://github.com/mbr/flask-appconfig
project_name = u'Ninhursag'
class Default(object):
APP_NAME = project_name
DEBUG = False
TESTING = False
# Serve... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Flask application default config:
# http://flask.pocoo.org/docs/config/#configuring-from-files
# https://github.com/mbr/flask-appconfig
project_name = u'Ninhursag'
class Default(object):
APP_NAME = project_name
DEBUG = False
TESTING = False
# Serve... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Flask application default config:
# http://flask.pocoo.org/docs/config/#configuring-from-files
# https://github.com/mbr/flask-appconfig
project_name = u'Ninhursag'
class Default(object):
APP_NAME = project_name
DEBUG = False
TESTING = Fal... |
93512f1837a4e72752d4ffa07ac49e1f2cd5a7f6 | opensimplex_test.py | opensimplex_test.py | import random
import time
from PIL import Image # Depends on the Pillow lib
from opensimplex import OpenSimplexNoise
WIDTH = 512
HEIGHT = 512
FEATURE_SIZE = 24
def main():
random.seed(time.time())
seed = random.randint(0, 100000)
simplex = OpenSimplexNoise(seed)
im = Image.new('L', (WIDTH, HEIGHT))
... |
from PIL import Image # Depends on the Pillow lib
from opensimplex import OpenSimplexNoise
WIDTH = 512
HEIGHT = 512
FEATURE_SIZE = 24
def main():
simplex = OpenSimplexNoise()
im = Image.new('L', (WIDTH, HEIGHT))
for y in range(0, HEIGHT):
for x in range(0, WIDTH):
#value = simplex.n... | Use default seed for the test. | Use default seed for the test.
| Python | mit | lmas/opensimplex,antiface/opensimplex | import random
import time
from PIL import Image # Depends on the Pillow lib
from opensimplex import OpenSimplexNoise
WIDTH = 512
HEIGHT = 512
FEATURE_SIZE = 24
def main():
random.seed(time.time())
seed = random.randint(0, 100000)
simplex = OpenSimplexNoise(seed)
im = Image.new('L', (WIDTH, HEIGHT))
... |
from PIL import Image # Depends on the Pillow lib
from opensimplex import OpenSimplexNoise
WIDTH = 512
HEIGHT = 512
FEATURE_SIZE = 24
def main():
simplex = OpenSimplexNoise()
im = Image.new('L', (WIDTH, HEIGHT))
for y in range(0, HEIGHT):
for x in range(0, WIDTH):
#value = simplex.n... | <commit_before>import random
import time
from PIL import Image # Depends on the Pillow lib
from opensimplex import OpenSimplexNoise
WIDTH = 512
HEIGHT = 512
FEATURE_SIZE = 24
def main():
random.seed(time.time())
seed = random.randint(0, 100000)
simplex = OpenSimplexNoise(seed)
im = Image.new('L', (WI... |
from PIL import Image # Depends on the Pillow lib
from opensimplex import OpenSimplexNoise
WIDTH = 512
HEIGHT = 512
FEATURE_SIZE = 24
def main():
simplex = OpenSimplexNoise()
im = Image.new('L', (WIDTH, HEIGHT))
for y in range(0, HEIGHT):
for x in range(0, WIDTH):
#value = simplex.n... | import random
import time
from PIL import Image # Depends on the Pillow lib
from opensimplex import OpenSimplexNoise
WIDTH = 512
HEIGHT = 512
FEATURE_SIZE = 24
def main():
random.seed(time.time())
seed = random.randint(0, 100000)
simplex = OpenSimplexNoise(seed)
im = Image.new('L', (WIDTH, HEIGHT))
... | <commit_before>import random
import time
from PIL import Image # Depends on the Pillow lib
from opensimplex import OpenSimplexNoise
WIDTH = 512
HEIGHT = 512
FEATURE_SIZE = 24
def main():
random.seed(time.time())
seed = random.randint(0, 100000)
simplex = OpenSimplexNoise(seed)
im = Image.new('L', (WI... |
9249dc161e9fdd64e15a42f644232c43cb6875b2 | src/dependenpy/plugins.py | src/dependenpy/plugins.py | # -*- coding: utf-8 -*-
"""dependenpy plugins module."""
try:
from archan import Provider, Argument, DSM as ArchanDSM
from .dsm import DSM as DependenpyDSM
from .helpers import guess_depth
class InternalDependencies(Provider):
"""Dependenpy provider for Archan."""
identifier = 'depen... | # -*- coding: utf-8 -*-
"""dependenpy plugins module."""
try:
from archan import Provider, Argument, DesignStructureMatrix as ArchanDSM
from .dsm import DSM as DependenpyDSM
from .helpers import guess_depth
class InternalDependencies(Provider):
"""Dependenpy provider for Archan."""
i... | Update archan provider for archan 3.0 | Update archan provider for archan 3.0
| Python | isc | Pawamoy/dependenpy,Pawamoy/dependenpy | # -*- coding: utf-8 -*-
"""dependenpy plugins module."""
try:
from archan import Provider, Argument, DSM as ArchanDSM
from .dsm import DSM as DependenpyDSM
from .helpers import guess_depth
class InternalDependencies(Provider):
"""Dependenpy provider for Archan."""
identifier = 'depen... | # -*- coding: utf-8 -*-
"""dependenpy plugins module."""
try:
from archan import Provider, Argument, DesignStructureMatrix as ArchanDSM
from .dsm import DSM as DependenpyDSM
from .helpers import guess_depth
class InternalDependencies(Provider):
"""Dependenpy provider for Archan."""
i... | <commit_before># -*- coding: utf-8 -*-
"""dependenpy plugins module."""
try:
from archan import Provider, Argument, DSM as ArchanDSM
from .dsm import DSM as DependenpyDSM
from .helpers import guess_depth
class InternalDependencies(Provider):
"""Dependenpy provider for Archan."""
iden... | # -*- coding: utf-8 -*-
"""dependenpy plugins module."""
try:
from archan import Provider, Argument, DesignStructureMatrix as ArchanDSM
from .dsm import DSM as DependenpyDSM
from .helpers import guess_depth
class InternalDependencies(Provider):
"""Dependenpy provider for Archan."""
i... | # -*- coding: utf-8 -*-
"""dependenpy plugins module."""
try:
from archan import Provider, Argument, DSM as ArchanDSM
from .dsm import DSM as DependenpyDSM
from .helpers import guess_depth
class InternalDependencies(Provider):
"""Dependenpy provider for Archan."""
identifier = 'depen... | <commit_before># -*- coding: utf-8 -*-
"""dependenpy plugins module."""
try:
from archan import Provider, Argument, DSM as ArchanDSM
from .dsm import DSM as DependenpyDSM
from .helpers import guess_depth
class InternalDependencies(Provider):
"""Dependenpy provider for Archan."""
iden... |
5da820b85f9e55a54639856bdd698c35b866833c | fireplace/cards/gvg/neutral_epic.py | fireplace/cards/gvg/neutral_epic.py | from ..utils import *
##
# Minions
# Hobgoblin
class GVG_104:
def OWN_MINION_SUMMON(self, minion):
if minion.atk == 1:
return [Buff(minion, "GVG_104a")]
| from ..utils import *
##
# Minions
# Hobgoblin
class GVG_104:
def OWN_CARD_PLAYED(self, card):
if card.type == CardType.MINION and card.atk == 1:
return [Buff(card, "GVG_104a")]
| Fix Hobgoblin to trigger only on cards played | Fix Hobgoblin to trigger only on cards played
| Python | agpl-3.0 | smallnamespace/fireplace,jleclanche/fireplace,liujimj/fireplace,Meerkov/fireplace,amw2104/fireplace,butozerca/fireplace,oftc-ftw/fireplace,Ragowit/fireplace,NightKev/fireplace,smallnamespace/fireplace,Meerkov/fireplace,liujimj/fireplace,butozerca/fireplace,Ragowit/fireplace,beheh/fireplace,oftc-ftw/fireplace,amw2104/fi... | from ..utils import *
##
# Minions
# Hobgoblin
class GVG_104:
def OWN_MINION_SUMMON(self, minion):
if minion.atk == 1:
return [Buff(minion, "GVG_104a")]
Fix Hobgoblin to trigger only on cards played | from ..utils import *
##
# Minions
# Hobgoblin
class GVG_104:
def OWN_CARD_PLAYED(self, card):
if card.type == CardType.MINION and card.atk == 1:
return [Buff(card, "GVG_104a")]
| <commit_before>from ..utils import *
##
# Minions
# Hobgoblin
class GVG_104:
def OWN_MINION_SUMMON(self, minion):
if minion.atk == 1:
return [Buff(minion, "GVG_104a")]
<commit_msg>Fix Hobgoblin to trigger only on cards played<commit_after> | from ..utils import *
##
# Minions
# Hobgoblin
class GVG_104:
def OWN_CARD_PLAYED(self, card):
if card.type == CardType.MINION and card.atk == 1:
return [Buff(card, "GVG_104a")]
| from ..utils import *
##
# Minions
# Hobgoblin
class GVG_104:
def OWN_MINION_SUMMON(self, minion):
if minion.atk == 1:
return [Buff(minion, "GVG_104a")]
Fix Hobgoblin to trigger only on cards playedfrom ..utils import *
##
# Minions
# Hobgoblin
class GVG_104:
def OWN_CARD_PLAYED(self, card):
if card.type... | <commit_before>from ..utils import *
##
# Minions
# Hobgoblin
class GVG_104:
def OWN_MINION_SUMMON(self, minion):
if minion.atk == 1:
return [Buff(minion, "GVG_104a")]
<commit_msg>Fix Hobgoblin to trigger only on cards played<commit_after>from ..utils import *
##
# Minions
# Hobgoblin
class GVG_104:
def OW... |
48b2460c718af88e8140b108d4a9acd9258ade8c | gargoyle/__init__.py | gargoyle/__init__.py | try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
| __import__('pkg_resources').declare_namespace(__name__)
| Change to vanilla namespace package | Change to vanilla namespace package
| Python | apache-2.0 | disqus/gutter,disqus/gutter,kalail/gutter,kalail/gutter,kalail/gutter | try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
Change to vanilla namespace package | __import__('pkg_resources').declare_namespace(__name__)
| <commit_before>try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
<commit_msg>Change to vanilla namespace package<commit_after> | __import__('pkg_resources').declare_namespace(__name__)
| try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
Change to vanilla namespace package__import__('pkg_resources').declare_namespace(__name__)
| <commit_before>try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
<commit_msg>Change to vanilla namespace package<commit_after>__import__('pkg_resources').declare_namespace(__name__)
|
c083481eed1578551daab7ece2e34b3ff4aece82 | accelerator/migrations/0044_add_sitetree_sidenav_toggle.py | accelerator/migrations/0044_add_sitetree_sidenav_toggle.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2019-03-20 18:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accelerator', '0043_remove_exclude_fields'),
]
operations = [
migrations.Re... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2019-03-20 18:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accelerator', '0043_remove_exclude_fields'),
]
help_text = 'Show the new-style side ... | Fix style on migration - waste of time, but whatever | Fix style on migration - waste of time, but whatever
| Python | mit | masschallenge/django-accelerator,masschallenge/django-accelerator | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2019-03-20 18:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accelerator', '0043_remove_exclude_fields'),
]
operations = [
migrations.Re... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2019-03-20 18:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accelerator', '0043_remove_exclude_fields'),
]
help_text = 'Show the new-style side ... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2019-03-20 18:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accelerator', '0043_remove_exclude_fields'),
]
operations = [
... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2019-03-20 18:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accelerator', '0043_remove_exclude_fields'),
]
help_text = 'Show the new-style side ... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2019-03-20 18:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accelerator', '0043_remove_exclude_fields'),
]
operations = [
migrations.Re... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2019-03-20 18:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accelerator', '0043_remove_exclude_fields'),
]
operations = [
... |
9cc4ce152ba8d683db1371a963dae2621f1b8fc6 | dbaas/dbaas/celeryconfig.py | dbaas/dbaas/celeryconfig.py | import os
REDIS_PORT = os.getenv('DBAAS_NOTIFICATION_BROKER_PORT', '6379')
BROKER_URL = os.getenv(
'DBAAS_NOTIFICATION_BROKER_URL', 'redis://localhost:%s/0' % REDIS_PORT)
CELERYD_TASK_TIME_LIMIT = 10800
CELERY_TRACK_STARTED = True
CELERY_IGNORE_RESULT = False
CELERY_RESULT_BACKEND = 'djcelery.backends.cache:CacheB... | import os
from django.conf import settings
REDIS_PORT = os.getenv('DBAAS_NOTIFICATION_BROKER_PORT', '6379')
BROKER_URL = os.getenv(
'DBAAS_NOTIFICATION_BROKER_URL', 'redis://{}:{}/0'.format(settings.REDIS_HOST, REDIS_PORT))
CELERYD_TASK_TIME_LIMIT = 10800
CELERY_TRACK_STARTED = True
CELERY_IGNORE_RESULT = False
C... | Fix celery config to respect the host configured on settings | Fix celery config to respect the host configured on settings
| Python | bsd-3-clause | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | import os
REDIS_PORT = os.getenv('DBAAS_NOTIFICATION_BROKER_PORT', '6379')
BROKER_URL = os.getenv(
'DBAAS_NOTIFICATION_BROKER_URL', 'redis://localhost:%s/0' % REDIS_PORT)
CELERYD_TASK_TIME_LIMIT = 10800
CELERY_TRACK_STARTED = True
CELERY_IGNORE_RESULT = False
CELERY_RESULT_BACKEND = 'djcelery.backends.cache:CacheB... | import os
from django.conf import settings
REDIS_PORT = os.getenv('DBAAS_NOTIFICATION_BROKER_PORT', '6379')
BROKER_URL = os.getenv(
'DBAAS_NOTIFICATION_BROKER_URL', 'redis://{}:{}/0'.format(settings.REDIS_HOST, REDIS_PORT))
CELERYD_TASK_TIME_LIMIT = 10800
CELERY_TRACK_STARTED = True
CELERY_IGNORE_RESULT = False
C... | <commit_before>import os
REDIS_PORT = os.getenv('DBAAS_NOTIFICATION_BROKER_PORT', '6379')
BROKER_URL = os.getenv(
'DBAAS_NOTIFICATION_BROKER_URL', 'redis://localhost:%s/0' % REDIS_PORT)
CELERYD_TASK_TIME_LIMIT = 10800
CELERY_TRACK_STARTED = True
CELERY_IGNORE_RESULT = False
CELERY_RESULT_BACKEND = 'djcelery.backen... | import os
from django.conf import settings
REDIS_PORT = os.getenv('DBAAS_NOTIFICATION_BROKER_PORT', '6379')
BROKER_URL = os.getenv(
'DBAAS_NOTIFICATION_BROKER_URL', 'redis://{}:{}/0'.format(settings.REDIS_HOST, REDIS_PORT))
CELERYD_TASK_TIME_LIMIT = 10800
CELERY_TRACK_STARTED = True
CELERY_IGNORE_RESULT = False
C... | import os
REDIS_PORT = os.getenv('DBAAS_NOTIFICATION_BROKER_PORT', '6379')
BROKER_URL = os.getenv(
'DBAAS_NOTIFICATION_BROKER_URL', 'redis://localhost:%s/0' % REDIS_PORT)
CELERYD_TASK_TIME_LIMIT = 10800
CELERY_TRACK_STARTED = True
CELERY_IGNORE_RESULT = False
CELERY_RESULT_BACKEND = 'djcelery.backends.cache:CacheB... | <commit_before>import os
REDIS_PORT = os.getenv('DBAAS_NOTIFICATION_BROKER_PORT', '6379')
BROKER_URL = os.getenv(
'DBAAS_NOTIFICATION_BROKER_URL', 'redis://localhost:%s/0' % REDIS_PORT)
CELERYD_TASK_TIME_LIMIT = 10800
CELERY_TRACK_STARTED = True
CELERY_IGNORE_RESULT = False
CELERY_RESULT_BACKEND = 'djcelery.backen... |
a8ec60daaee52603a1c3bab879a5eee9f0fd931b | ddd/dataobjects/datatype.py | ddd/dataobjects/datatype.py | '''
Created on 24.04.2016
@author: killian
'''
from objects import dddobject,DataObject
from conversions import DddConversion
@dddobject('datatype')
class DddDatatype(DataObject):
def __init__(self,basetype='',conversion=None,unit='-',constant=False):
self.basetype=basetype
if not conversion:
... | '''
Created on 24.04.2016
@author: killian
'''
from objects import dddobject,DataObject
from conversions import DddConversion
@dddobject('datatype')
class DddDatatype(DataObject):
def __init__(self,basetype='',bitsize=8,signed=False,conversion=None,unit='-',constant=False):
self.basetype=basetype
... | Split basetype of DddDatatype into basetype,bitsize,signed | Split basetype of DddDatatype into basetype,bitsize,signed | Python | mit | toesus/ddd,Sauci/ddd,toesus/ddd,Sauci/ddd,Sauci/ddd | '''
Created on 24.04.2016
@author: killian
'''
from objects import dddobject,DataObject
from conversions import DddConversion
@dddobject('datatype')
class DddDatatype(DataObject):
def __init__(self,basetype='',conversion=None,unit='-',constant=False):
self.basetype=basetype
if not conversion:
... | '''
Created on 24.04.2016
@author: killian
'''
from objects import dddobject,DataObject
from conversions import DddConversion
@dddobject('datatype')
class DddDatatype(DataObject):
def __init__(self,basetype='',bitsize=8,signed=False,conversion=None,unit='-',constant=False):
self.basetype=basetype
... | <commit_before>'''
Created on 24.04.2016
@author: killian
'''
from objects import dddobject,DataObject
from conversions import DddConversion
@dddobject('datatype')
class DddDatatype(DataObject):
def __init__(self,basetype='',conversion=None,unit='-',constant=False):
self.basetype=basetype
if not ... | '''
Created on 24.04.2016
@author: killian
'''
from objects import dddobject,DataObject
from conversions import DddConversion
@dddobject('datatype')
class DddDatatype(DataObject):
def __init__(self,basetype='',bitsize=8,signed=False,conversion=None,unit='-',constant=False):
self.basetype=basetype
... | '''
Created on 24.04.2016
@author: killian
'''
from objects import dddobject,DataObject
from conversions import DddConversion
@dddobject('datatype')
class DddDatatype(DataObject):
def __init__(self,basetype='',conversion=None,unit='-',constant=False):
self.basetype=basetype
if not conversion:
... | <commit_before>'''
Created on 24.04.2016
@author: killian
'''
from objects import dddobject,DataObject
from conversions import DddConversion
@dddobject('datatype')
class DddDatatype(DataObject):
def __init__(self,basetype='',conversion=None,unit='-',constant=False):
self.basetype=basetype
if not ... |
6bd59ef149ec32f7d0a64ea2ad50a2729aceb6f5 | fluent_contents/models/mixins.py | fluent_contents/models/mixins.py | from django.core.cache import cache
class CachedModelMixin(object):
"""
Mixin to add cache expiration to a model.
"""
clear_cache_on_add = False
def save(self, *args, **kwargs):
is_new = not self.pk or self._state.adding
super(CachedModelMixin, self).save(*args, **kwargs)
... | from django.core.cache import cache
class CachedModelMixin(object):
"""
Mixin to add cache expiration to a model.
"""
clear_cache_on_add = False
def save(self, *args, **kwargs):
is_new = not self.pk or self._state.adding
super(CachedModelMixin, self).save(*args, **kwargs)
... | Make sure our CachedModelMixin.delete() also returns the collector results | Make sure our CachedModelMixin.delete() also returns the collector results
| Python | apache-2.0 | edoburu/django-fluent-contents,django-fluent/django-fluent-contents,edoburu/django-fluent-contents,edoburu/django-fluent-contents,django-fluent/django-fluent-contents,django-fluent/django-fluent-contents | from django.core.cache import cache
class CachedModelMixin(object):
"""
Mixin to add cache expiration to a model.
"""
clear_cache_on_add = False
def save(self, *args, **kwargs):
is_new = not self.pk or self._state.adding
super(CachedModelMixin, self).save(*args, **kwargs)
... | from django.core.cache import cache
class CachedModelMixin(object):
"""
Mixin to add cache expiration to a model.
"""
clear_cache_on_add = False
def save(self, *args, **kwargs):
is_new = not self.pk or self._state.adding
super(CachedModelMixin, self).save(*args, **kwargs)
... | <commit_before>from django.core.cache import cache
class CachedModelMixin(object):
"""
Mixin to add cache expiration to a model.
"""
clear_cache_on_add = False
def save(self, *args, **kwargs):
is_new = not self.pk or self._state.adding
super(CachedModelMixin, self).save(*args, **k... | from django.core.cache import cache
class CachedModelMixin(object):
"""
Mixin to add cache expiration to a model.
"""
clear_cache_on_add = False
def save(self, *args, **kwargs):
is_new = not self.pk or self._state.adding
super(CachedModelMixin, self).save(*args, **kwargs)
... | from django.core.cache import cache
class CachedModelMixin(object):
"""
Mixin to add cache expiration to a model.
"""
clear_cache_on_add = False
def save(self, *args, **kwargs):
is_new = not self.pk or self._state.adding
super(CachedModelMixin, self).save(*args, **kwargs)
... | <commit_before>from django.core.cache import cache
class CachedModelMixin(object):
"""
Mixin to add cache expiration to a model.
"""
clear_cache_on_add = False
def save(self, *args, **kwargs):
is_new = not self.pk or self._state.adding
super(CachedModelMixin, self).save(*args, **k... |
a88f0ab8be669f573f2869617717653bb008e11b | sheldon/bot.py | sheldon/bot.py | # -*- coding: utf-8 -*-
"""
@author: Lises team
@contact: [email protected]
@license: The MIT license
Copyright (C) 2015
"""
__author__ = 'Lises team'
__version__ = '0.1'
__email__ = '[email protected]'
class Sheldon():
pass
class Plugin():
pass
class Adapter():
pass | # -*- coding: utf-8 -*-
"""
@author: Lises team
@contact: [email protected]
@license: The MIT license
Copyright (C) 2015
"""
# Python 2 compatibility
if sys.version_info[0] == 2:
# Exceptions for bot
from exceptions import *
# Tool for loading plugins and adapters
from modules import *
# To... | Update structure of Sheldon class | Update structure of Sheldon class
| Python | mit | lises/sheldon | # -*- coding: utf-8 -*-
"""
@author: Lises team
@contact: [email protected]
@license: The MIT license
Copyright (C) 2015
"""
__author__ = 'Lises team'
__version__ = '0.1'
__email__ = '[email protected]'
class Sheldon():
pass
class Plugin():
pass
class Adapter():
passUpdate structure of Shel... | # -*- coding: utf-8 -*-
"""
@author: Lises team
@contact: [email protected]
@license: The MIT license
Copyright (C) 2015
"""
# Python 2 compatibility
if sys.version_info[0] == 2:
# Exceptions for bot
from exceptions import *
# Tool for loading plugins and adapters
from modules import *
# To... | <commit_before># -*- coding: utf-8 -*-
"""
@author: Lises team
@contact: [email protected]
@license: The MIT license
Copyright (C) 2015
"""
__author__ = 'Lises team'
__version__ = '0.1'
__email__ = '[email protected]'
class Sheldon():
pass
class Plugin():
pass
class Adapter():
pass<commit_m... | # -*- coding: utf-8 -*-
"""
@author: Lises team
@contact: [email protected]
@license: The MIT license
Copyright (C) 2015
"""
# Python 2 compatibility
if sys.version_info[0] == 2:
# Exceptions for bot
from exceptions import *
# Tool for loading plugins and adapters
from modules import *
# To... | # -*- coding: utf-8 -*-
"""
@author: Lises team
@contact: [email protected]
@license: The MIT license
Copyright (C) 2015
"""
__author__ = 'Lises team'
__version__ = '0.1'
__email__ = '[email protected]'
class Sheldon():
pass
class Plugin():
pass
class Adapter():
passUpdate structure of Shel... | <commit_before># -*- coding: utf-8 -*-
"""
@author: Lises team
@contact: [email protected]
@license: The MIT license
Copyright (C) 2015
"""
__author__ = 'Lises team'
__version__ = '0.1'
__email__ = '[email protected]'
class Sheldon():
pass
class Plugin():
pass
class Adapter():
pass<commit_m... |
3b47c9ec6950819b99588dcb29978d5cb8761cad | midi/examples/printmidiin.py | midi/examples/printmidiin.py | import pyb
from mid.midiin import MidiIn
def midi_printer(msg):
print(tuple(msg))
def loop(midiin):
while True:
midiin.poll()
pyb.udelay(500)
uart = py.UART(2, 31250)
midiin = MidiIn(uart, callback=midi_printer)
loop(midiin)
| import pyb
from midi.midiin import MidiIn
def midi_printer(msg):
print(tuple(msg))
def loop(midiin):
while True:
midiin.poll()
pyb.udelay(50)
uart = pyb.UART(2, 31250)
midiin = MidiIn(uart, callback=midi_printer)
loop(midiin)
| Fix wrong module names and lower poll interval to 50 ms | Fix wrong module names and lower poll interval to 50 ms
| Python | mit | SpotlightKid/micropython-stm-lib | import pyb
from mid.midiin import MidiIn
def midi_printer(msg):
print(tuple(msg))
def loop(midiin):
while True:
midiin.poll()
pyb.udelay(500)
uart = py.UART(2, 31250)
midiin = MidiIn(uart, callback=midi_printer)
loop(midiin)
Fix wrong module names and lower poll interval to 50 ms | import pyb
from midi.midiin import MidiIn
def midi_printer(msg):
print(tuple(msg))
def loop(midiin):
while True:
midiin.poll()
pyb.udelay(50)
uart = pyb.UART(2, 31250)
midiin = MidiIn(uart, callback=midi_printer)
loop(midiin)
| <commit_before>import pyb
from mid.midiin import MidiIn
def midi_printer(msg):
print(tuple(msg))
def loop(midiin):
while True:
midiin.poll()
pyb.udelay(500)
uart = py.UART(2, 31250)
midiin = MidiIn(uart, callback=midi_printer)
loop(midiin)
<commit_msg>Fix wrong module names and lower poll i... | import pyb
from midi.midiin import MidiIn
def midi_printer(msg):
print(tuple(msg))
def loop(midiin):
while True:
midiin.poll()
pyb.udelay(50)
uart = pyb.UART(2, 31250)
midiin = MidiIn(uart, callback=midi_printer)
loop(midiin)
| import pyb
from mid.midiin import MidiIn
def midi_printer(msg):
print(tuple(msg))
def loop(midiin):
while True:
midiin.poll()
pyb.udelay(500)
uart = py.UART(2, 31250)
midiin = MidiIn(uart, callback=midi_printer)
loop(midiin)
Fix wrong module names and lower poll interval to 50 msimport pyb
... | <commit_before>import pyb
from mid.midiin import MidiIn
def midi_printer(msg):
print(tuple(msg))
def loop(midiin):
while True:
midiin.poll()
pyb.udelay(500)
uart = py.UART(2, 31250)
midiin = MidiIn(uart, callback=midi_printer)
loop(midiin)
<commit_msg>Fix wrong module names and lower poll i... |
caa4dcdcf7e936f352eea22513433d8f8deca2ab | sahara/tests/unit/utils/test_hashabledict.py | sahara/tests/unit/utils/test_hashabledict.py | # Copyright (c) 2013 Hortonworks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | # Copyright (c) 2013 Hortonworks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | Improve unit test for HashableDict | Improve unit test for HashableDict
We have HashableDict introduced to network info storing, but hash
function of this implementation was never tested in unit tests.
Change-Id: Id48c9172ca63e19b397dc131d85ed631874142cd
| Python | apache-2.0 | openstack/sahara,esikachev/sahara-backup,ekasitk/sahara,henaras/sahara,egafford/sahara,tellesnobrega/sahara,ekasitk/sahara,egafford/sahara,henaras/sahara,zhangjunli177/sahara,zhangjunli177/sahara,esikachev/sahara-backup,esikachev/sahara-backup,openstack/sahara,henaras/sahara,ekasitk/sahara,crobby/sahara,crobby/sahara,c... | # Copyright (c) 2013 Hortonworks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | # Copyright (c) 2013 Hortonworks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | <commit_before># Copyright (c) 2013 Hortonworks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | # Copyright (c) 2013 Hortonworks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | # Copyright (c) 2013 Hortonworks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | <commit_before># Copyright (c) 2013 Hortonworks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
1a4e634c001e1734ae0a2a881624ab10073865cd | virtool/app_init.py | virtool/app_init.py | import coloredlogs
import logging.handlers
from argparse import ArgumentParser
def get_args():
parser = ArgumentParser()
parser.add_argument(
"-H", "--host",
dest="host",
help="hostname to listen on"
)
parser.add_argument(
"-p", "--port",
dest="port",
... | import coloredlogs
import logging.handlers
from argparse import ArgumentParser
def get_args():
parser = ArgumentParser()
parser.add_argument(
"-H", "--host",
dest="host",
help="hostname to listen on"
)
parser.add_argument(
"-p", "--port",
dest="port",
... | Add --dev command line arg | Add --dev command line arg
| Python | mit | igboyes/virtool,virtool/virtool,virtool/virtool,igboyes/virtool | import coloredlogs
import logging.handlers
from argparse import ArgumentParser
def get_args():
parser = ArgumentParser()
parser.add_argument(
"-H", "--host",
dest="host",
help="hostname to listen on"
)
parser.add_argument(
"-p", "--port",
dest="port",
... | import coloredlogs
import logging.handlers
from argparse import ArgumentParser
def get_args():
parser = ArgumentParser()
parser.add_argument(
"-H", "--host",
dest="host",
help="hostname to listen on"
)
parser.add_argument(
"-p", "--port",
dest="port",
... | <commit_before>import coloredlogs
import logging.handlers
from argparse import ArgumentParser
def get_args():
parser = ArgumentParser()
parser.add_argument(
"-H", "--host",
dest="host",
help="hostname to listen on"
)
parser.add_argument(
"-p", "--port",
dest... | import coloredlogs
import logging.handlers
from argparse import ArgumentParser
def get_args():
parser = ArgumentParser()
parser.add_argument(
"-H", "--host",
dest="host",
help="hostname to listen on"
)
parser.add_argument(
"-p", "--port",
dest="port",
... | import coloredlogs
import logging.handlers
from argparse import ArgumentParser
def get_args():
parser = ArgumentParser()
parser.add_argument(
"-H", "--host",
dest="host",
help="hostname to listen on"
)
parser.add_argument(
"-p", "--port",
dest="port",
... | <commit_before>import coloredlogs
import logging.handlers
from argparse import ArgumentParser
def get_args():
parser = ArgumentParser()
parser.add_argument(
"-H", "--host",
dest="host",
help="hostname to listen on"
)
parser.add_argument(
"-p", "--port",
dest... |
821f1ef9f7eae6d146248b5a212812fee4996cfd | django_website/settings/docs.py | django_website/settings/docs.py | from django_website.settings.www import *
PREPEND_WWW = False
APPEND_SLASH = True
TEMPLATE_CONTEXT_PROCESSORS += ["django.core.context_processors.request"]
ROOT_URLCONF = 'django_website.urls.docs'
CACHE_MIDDLEWARE_KEY_PREFIX = 'djangodocs'
_has_ddt = 'debug_toolbar' in INSTALLED_APPS
INSTALLED_APPS = [
'django_w... | from django_website.settings.www import *
PREPEND_WWW = False
APPEND_SLASH = True
TEMPLATE_CONTEXT_PROCESSORS += ["django.core.context_processors.request"]
ROOT_URLCONF = 'django_website.urls.docs'
CACHE_MIDDLEWARE_KEY_PREFIX = 'djangodocs'
_has_ddt = 'debug_toolbar' in INSTALLED_APPS
INSTALLED_APPS = [
'django_w... | Use Whoosh in prod for now. | Use Whoosh in prod for now.
| Python | bsd-3-clause | khkaminska/djangoproject.com,relekang/djangoproject.com,rmoorman/djangoproject.com,rmoorman/djangoproject.com,khkaminska/djangoproject.com,hassanabidpk/djangoproject.com,alawnchen/djangoproject.com,khkaminska/djangoproject.com,relekang/djangoproject.com,nanuxbe/django,xavierdutreilh/djangoproject.com,vxvinh1511/djangop... | from django_website.settings.www import *
PREPEND_WWW = False
APPEND_SLASH = True
TEMPLATE_CONTEXT_PROCESSORS += ["django.core.context_processors.request"]
ROOT_URLCONF = 'django_website.urls.docs'
CACHE_MIDDLEWARE_KEY_PREFIX = 'djangodocs'
_has_ddt = 'debug_toolbar' in INSTALLED_APPS
INSTALLED_APPS = [
'django_w... | from django_website.settings.www import *
PREPEND_WWW = False
APPEND_SLASH = True
TEMPLATE_CONTEXT_PROCESSORS += ["django.core.context_processors.request"]
ROOT_URLCONF = 'django_website.urls.docs'
CACHE_MIDDLEWARE_KEY_PREFIX = 'djangodocs'
_has_ddt = 'debug_toolbar' in INSTALLED_APPS
INSTALLED_APPS = [
'django_w... | <commit_before>from django_website.settings.www import *
PREPEND_WWW = False
APPEND_SLASH = True
TEMPLATE_CONTEXT_PROCESSORS += ["django.core.context_processors.request"]
ROOT_URLCONF = 'django_website.urls.docs'
CACHE_MIDDLEWARE_KEY_PREFIX = 'djangodocs'
_has_ddt = 'debug_toolbar' in INSTALLED_APPS
INSTALLED_APPS = ... | from django_website.settings.www import *
PREPEND_WWW = False
APPEND_SLASH = True
TEMPLATE_CONTEXT_PROCESSORS += ["django.core.context_processors.request"]
ROOT_URLCONF = 'django_website.urls.docs'
CACHE_MIDDLEWARE_KEY_PREFIX = 'djangodocs'
_has_ddt = 'debug_toolbar' in INSTALLED_APPS
INSTALLED_APPS = [
'django_w... | from django_website.settings.www import *
PREPEND_WWW = False
APPEND_SLASH = True
TEMPLATE_CONTEXT_PROCESSORS += ["django.core.context_processors.request"]
ROOT_URLCONF = 'django_website.urls.docs'
CACHE_MIDDLEWARE_KEY_PREFIX = 'djangodocs'
_has_ddt = 'debug_toolbar' in INSTALLED_APPS
INSTALLED_APPS = [
'django_w... | <commit_before>from django_website.settings.www import *
PREPEND_WWW = False
APPEND_SLASH = True
TEMPLATE_CONTEXT_PROCESSORS += ["django.core.context_processors.request"]
ROOT_URLCONF = 'django_website.urls.docs'
CACHE_MIDDLEWARE_KEY_PREFIX = 'djangodocs'
_has_ddt = 'debug_toolbar' in INSTALLED_APPS
INSTALLED_APPS = ... |
cdc6390ec88a14b339cb336fcc0d77e747aae99a | sieve/sieve.py | sieve/sieve.py | def sieve(n):
if n < 2:
return []
not_prime = set()
prime = [2]
for i in range(3, n+1, 2):
if i not in not_prime:
prime.append(i)
not_prime.update(range(i*i, n+1, i))
return prime
| def sieve(n):
return list(primes(n))
def primes(n):
if n < 2:
raise StopIteration
yield 2
not_prime = set()
for i in range(3, n+1, 2):
if i not in not_prime:
not_prime.update(range(i*i, n+1, i))
yield i
| Revert back to a generator - it's actually slight faster | Revert back to a generator - it's actually slight faster
| Python | agpl-3.0 | CubicComet/exercism-python-solutions | def sieve(n):
if n < 2:
return []
not_prime = set()
prime = [2]
for i in range(3, n+1, 2):
if i not in not_prime:
prime.append(i)
not_prime.update(range(i*i, n+1, i))
return prime
Revert back to a generator - it's actually slight faster | def sieve(n):
return list(primes(n))
def primes(n):
if n < 2:
raise StopIteration
yield 2
not_prime = set()
for i in range(3, n+1, 2):
if i not in not_prime:
not_prime.update(range(i*i, n+1, i))
yield i
| <commit_before>def sieve(n):
if n < 2:
return []
not_prime = set()
prime = [2]
for i in range(3, n+1, 2):
if i not in not_prime:
prime.append(i)
not_prime.update(range(i*i, n+1, i))
return prime
<commit_msg>Revert back to a generator - it's actually slight fas... | def sieve(n):
return list(primes(n))
def primes(n):
if n < 2:
raise StopIteration
yield 2
not_prime = set()
for i in range(3, n+1, 2):
if i not in not_prime:
not_prime.update(range(i*i, n+1, i))
yield i
| def sieve(n):
if n < 2:
return []
not_prime = set()
prime = [2]
for i in range(3, n+1, 2):
if i not in not_prime:
prime.append(i)
not_prime.update(range(i*i, n+1, i))
return prime
Revert back to a generator - it's actually slight fasterdef sieve(n):
return... | <commit_before>def sieve(n):
if n < 2:
return []
not_prime = set()
prime = [2]
for i in range(3, n+1, 2):
if i not in not_prime:
prime.append(i)
not_prime.update(range(i*i, n+1, i))
return prime
<commit_msg>Revert back to a generator - it's actually slight fas... |
b32900269b3f8c701702e74734ffe248c521fa73 | dooblr/transformers/__init__.py | dooblr/transformers/__init__.py | from influxdbclient import InfluxDBClient, InfluxDBClientError, DooblrInfluxDBError
__all__ = ["InfluxDBClient", "InfluxDBClientError", "DooblrInfluxDBError"]
| from dooblr.transformers.influxdbclient import InfluxDBClient, InfluxDBClientError, DooblrInfluxDBError
__all__ = ["InfluxDBClient", "InfluxDBClientError", "DooblrInfluxDBError"]
| Fix py3 'relative' import error. | Fix py3 'relative' import error.
| Python | isc | makerslocal/dooblr | from influxdbclient import InfluxDBClient, InfluxDBClientError, DooblrInfluxDBError
__all__ = ["InfluxDBClient", "InfluxDBClientError", "DooblrInfluxDBError"]
Fix py3 'relative' import error. | from dooblr.transformers.influxdbclient import InfluxDBClient, InfluxDBClientError, DooblrInfluxDBError
__all__ = ["InfluxDBClient", "InfluxDBClientError", "DooblrInfluxDBError"]
| <commit_before>from influxdbclient import InfluxDBClient, InfluxDBClientError, DooblrInfluxDBError
__all__ = ["InfluxDBClient", "InfluxDBClientError", "DooblrInfluxDBError"]
<commit_msg>Fix py3 'relative' import error.<commit_after> | from dooblr.transformers.influxdbclient import InfluxDBClient, InfluxDBClientError, DooblrInfluxDBError
__all__ = ["InfluxDBClient", "InfluxDBClientError", "DooblrInfluxDBError"]
| from influxdbclient import InfluxDBClient, InfluxDBClientError, DooblrInfluxDBError
__all__ = ["InfluxDBClient", "InfluxDBClientError", "DooblrInfluxDBError"]
Fix py3 'relative' import error.from dooblr.transformers.influxdbclient import InfluxDBClient, InfluxDBClientError, DooblrInfluxDBError
__all__ = ["InfluxDBCli... | <commit_before>from influxdbclient import InfluxDBClient, InfluxDBClientError, DooblrInfluxDBError
__all__ = ["InfluxDBClient", "InfluxDBClientError", "DooblrInfluxDBError"]
<commit_msg>Fix py3 'relative' import error.<commit_after>from dooblr.transformers.influxdbclient import InfluxDBClient, InfluxDBClientError, Doo... |
288127c575c7672e3a41d7ada360d56a4853f279 | scripts/examples/14-WiFi-Shield/fw_update.py | scripts/examples/14-WiFi-Shield/fw_update.py | # WINC Firmware Update Script.
#
# This script updates the ATWINC1500 WiFi module firmware.
# Copy the firmware image to uSD card before running this script.
# NOTE: Firmware version 19.5.2 does NOT support ATWINC1500-MR210PA.
import network
# Init wlan module in Download mode.
wlan = network.WINC(mode=network.WINC.M... | # WINC Firmware Update Script.
#
# This script updates the ATWINC1500 WiFi module firmware.
# Copy the firmware image to uSD card before running this script.
# NOTE: Older fimware versions are no longer supported by the host driver.
# NOTE: The latest firmware (19.6.1) only works on ATWINC1500-MR210PB.
import network
... | Update WiFi firmware update script. | Update WiFi firmware update script.
| Python | mit | openmv/openmv,openmv/openmv,openmv/openmv,kwagyeman/openmv,iabdalkader/openmv,iabdalkader/openmv,kwagyeman/openmv,iabdalkader/openmv,kwagyeman/openmv,openmv/openmv,kwagyeman/openmv,iabdalkader/openmv | # WINC Firmware Update Script.
#
# This script updates the ATWINC1500 WiFi module firmware.
# Copy the firmware image to uSD card before running this script.
# NOTE: Firmware version 19.5.2 does NOT support ATWINC1500-MR210PA.
import network
# Init wlan module in Download mode.
wlan = network.WINC(mode=network.WINC.M... | # WINC Firmware Update Script.
#
# This script updates the ATWINC1500 WiFi module firmware.
# Copy the firmware image to uSD card before running this script.
# NOTE: Older fimware versions are no longer supported by the host driver.
# NOTE: The latest firmware (19.6.1) only works on ATWINC1500-MR210PB.
import network
... | <commit_before># WINC Firmware Update Script.
#
# This script updates the ATWINC1500 WiFi module firmware.
# Copy the firmware image to uSD card before running this script.
# NOTE: Firmware version 19.5.2 does NOT support ATWINC1500-MR210PA.
import network
# Init wlan module in Download mode.
wlan = network.WINC(mode... | # WINC Firmware Update Script.
#
# This script updates the ATWINC1500 WiFi module firmware.
# Copy the firmware image to uSD card before running this script.
# NOTE: Older fimware versions are no longer supported by the host driver.
# NOTE: The latest firmware (19.6.1) only works on ATWINC1500-MR210PB.
import network
... | # WINC Firmware Update Script.
#
# This script updates the ATWINC1500 WiFi module firmware.
# Copy the firmware image to uSD card before running this script.
# NOTE: Firmware version 19.5.2 does NOT support ATWINC1500-MR210PA.
import network
# Init wlan module in Download mode.
wlan = network.WINC(mode=network.WINC.M... | <commit_before># WINC Firmware Update Script.
#
# This script updates the ATWINC1500 WiFi module firmware.
# Copy the firmware image to uSD card before running this script.
# NOTE: Firmware version 19.5.2 does NOT support ATWINC1500-MR210PA.
import network
# Init wlan module in Download mode.
wlan = network.WINC(mode... |
8f80099062a03fcf6be783f3e5260882f704ec22 | scss/tests/test_files.py | scss/tests/test_files.py | from __future__ import absolute_import
import glob
import os.path
import pytest
from scss import Scss
HERE = os.path.join(os.path.split(__file__)[0], 'files')
@pytest.mark.parametrize(
('scss_fn', 'css_fn'), [
(scss_fn, os.path.splitext(scss_fn)[0] + '.css')
for scss_fn in glob.glob(os.path.joi... | from __future__ import absolute_import
import glob
import os.path
import pytest
from scss import Scss
HERE = os.path.join(os.path.split(__file__)[0], 'files')
@pytest.mark.parametrize(
('scss_fn', 'css_fn'), [
(scss_fn, os.path.splitext(scss_fn)[0] + '.css')
for scss_fn in glob.glob(os.path.joi... | Swap the test-file assertion, to make output more sensible. | Swap the test-file assertion, to make output more sensible.
| Python | mit | cpfair/pyScss,cpfair/pyScss,Kronuz/pyScss,hashamali/pyScss,hashamali/pyScss,Kronuz/pyScss,Kronuz/pyScss,hashamali/pyScss,Kronuz/pyScss,cpfair/pyScss | from __future__ import absolute_import
import glob
import os.path
import pytest
from scss import Scss
HERE = os.path.join(os.path.split(__file__)[0], 'files')
@pytest.mark.parametrize(
('scss_fn', 'css_fn'), [
(scss_fn, os.path.splitext(scss_fn)[0] + '.css')
for scss_fn in glob.glob(os.path.joi... | from __future__ import absolute_import
import glob
import os.path
import pytest
from scss import Scss
HERE = os.path.join(os.path.split(__file__)[0], 'files')
@pytest.mark.parametrize(
('scss_fn', 'css_fn'), [
(scss_fn, os.path.splitext(scss_fn)[0] + '.css')
for scss_fn in glob.glob(os.path.joi... | <commit_before>from __future__ import absolute_import
import glob
import os.path
import pytest
from scss import Scss
HERE = os.path.join(os.path.split(__file__)[0], 'files')
@pytest.mark.parametrize(
('scss_fn', 'css_fn'), [
(scss_fn, os.path.splitext(scss_fn)[0] + '.css')
for scss_fn in glob.g... | from __future__ import absolute_import
import glob
import os.path
import pytest
from scss import Scss
HERE = os.path.join(os.path.split(__file__)[0], 'files')
@pytest.mark.parametrize(
('scss_fn', 'css_fn'), [
(scss_fn, os.path.splitext(scss_fn)[0] + '.css')
for scss_fn in glob.glob(os.path.joi... | from __future__ import absolute_import
import glob
import os.path
import pytest
from scss import Scss
HERE = os.path.join(os.path.split(__file__)[0], 'files')
@pytest.mark.parametrize(
('scss_fn', 'css_fn'), [
(scss_fn, os.path.splitext(scss_fn)[0] + '.css')
for scss_fn in glob.glob(os.path.joi... | <commit_before>from __future__ import absolute_import
import glob
import os.path
import pytest
from scss import Scss
HERE = os.path.join(os.path.split(__file__)[0], 'files')
@pytest.mark.parametrize(
('scss_fn', 'css_fn'), [
(scss_fn, os.path.splitext(scss_fn)[0] + '.css')
for scss_fn in glob.g... |
d9cdde787439d022e8c0504666cd4809a8243fe6 | oscar/management/commands/oscar_send_alerts.py | oscar/management/commands/oscar_send_alerts.py | import logging
from django.utils.translation import ugettext_lazy as _
from django.core.management.base import BaseCommand
from oscar.apps.customer.alerts import utils
logger = logging.getLogger(__name__)
class Command(BaseCommand):
"""
Check stock records of products for availability and send out alerts
... | import logging
from django.utils.translation import ugettext_lazy as _
from django.core.management.base import BaseCommand
from oscar.apps.customer.alerts import utils
logger = logging.getLogger(__name__)
class Command(BaseCommand):
"""
Check stock records of products for availability and send out alerts
... | Correct typo in help string | Correct typo in help string
| Python | bsd-3-clause | ka7eh/django-oscar,pdonadeo/django-oscar,itbabu/django-oscar,anentropic/django-oscar,sasha0/django-oscar,michaelkuty/django-oscar,amirrpp/django-oscar,amirrpp/django-oscar,Idematica/django-oscar,jinnykoo/wuyisj,okfish/django-oscar,bschuon/django-oscar,MatthewWilkes/django-oscar,DrOctogon/unwash_ecom,manevant/django-osc... | import logging
from django.utils.translation import ugettext_lazy as _
from django.core.management.base import BaseCommand
from oscar.apps.customer.alerts import utils
logger = logging.getLogger(__name__)
class Command(BaseCommand):
"""
Check stock records of products for availability and send out alerts
... | import logging
from django.utils.translation import ugettext_lazy as _
from django.core.management.base import BaseCommand
from oscar.apps.customer.alerts import utils
logger = logging.getLogger(__name__)
class Command(BaseCommand):
"""
Check stock records of products for availability and send out alerts
... | <commit_before>import logging
from django.utils.translation import ugettext_lazy as _
from django.core.management.base import BaseCommand
from oscar.apps.customer.alerts import utils
logger = logging.getLogger(__name__)
class Command(BaseCommand):
"""
Check stock records of products for availability and se... | import logging
from django.utils.translation import ugettext_lazy as _
from django.core.management.base import BaseCommand
from oscar.apps.customer.alerts import utils
logger = logging.getLogger(__name__)
class Command(BaseCommand):
"""
Check stock records of products for availability and send out alerts
... | import logging
from django.utils.translation import ugettext_lazy as _
from django.core.management.base import BaseCommand
from oscar.apps.customer.alerts import utils
logger = logging.getLogger(__name__)
class Command(BaseCommand):
"""
Check stock records of products for availability and send out alerts
... | <commit_before>import logging
from django.utils.translation import ugettext_lazy as _
from django.core.management.base import BaseCommand
from oscar.apps.customer.alerts import utils
logger = logging.getLogger(__name__)
class Command(BaseCommand):
"""
Check stock records of products for availability and se... |
7b3267b2bae436e0580e2a229a64bd8d6a04bc1f | manila_ui/local/local_settings.d/_90_manila_shares.py | manila_ui/local/local_settings.d/_90_manila_shares.py | # Copyright 2016 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | # Copyright 2016 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | Define the default policy file | Define the default policy file
This change ensures that the default policy file for Manila API access
is defined by default, so that operators can deploy their own policy
more easily.
Change-Id: Ie890766ea2a274791393304cdfe532e024171195
| Python | apache-2.0 | openstack/manila-ui,openstack/manila-ui,openstack/manila-ui | # Copyright 2016 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | # Copyright 2016 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | <commit_before># Copyright 2016 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | # Copyright 2016 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | # Copyright 2016 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | <commit_before># Copyright 2016 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
fd90fc7ce0c8a8070966e4a8273c69b8c13955d3 | masters/master.tryserver.webrtc/master_site_config.py | masters/master.tryserver.webrtc/master_site_config.py | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""ActiveMaster definition."""
from config_bootstrap import Master
class WebRTCTryServer(Master.Master4):
project_name = 'WebRTC Try Server'
master_por... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""ActiveMaster definition."""
from config_bootstrap import Master
class WebRTCTryServer(Master.Master4):
project_name = 'WebRTC Try Server'
master_por... | Make trybots use HEAD instead of LKGR | WebRTC: Make trybots use HEAD instead of LKGR
It's about time we make this change, which turned out
to be very simple.
Review URL: https://codereview.chromium.org/776233003
git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@293261 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | eunchong/build,eunchong/build,eunchong/build,eunchong/build | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""ActiveMaster definition."""
from config_bootstrap import Master
class WebRTCTryServer(Master.Master4):
project_name = 'WebRTC Try Server'
master_por... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""ActiveMaster definition."""
from config_bootstrap import Master
class WebRTCTryServer(Master.Master4):
project_name = 'WebRTC Try Server'
master_por... | <commit_before># Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""ActiveMaster definition."""
from config_bootstrap import Master
class WebRTCTryServer(Master.Master4):
project_name = 'WebRTC Try Serve... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""ActiveMaster definition."""
from config_bootstrap import Master
class WebRTCTryServer(Master.Master4):
project_name = 'WebRTC Try Server'
master_por... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""ActiveMaster definition."""
from config_bootstrap import Master
class WebRTCTryServer(Master.Master4):
project_name = 'WebRTC Try Server'
master_por... | <commit_before># Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""ActiveMaster definition."""
from config_bootstrap import Master
class WebRTCTryServer(Master.Master4):
project_name = 'WebRTC Try Serve... |
d611341f95bc95fa3c3e42d7e830be1c2baea9b1 | moksha/api/streams/datastream.py | moksha/api/streams/datastream.py | import logging
from datetime import timedelta
from twisted.internet.task import LoopingCall
from moksha.hub.hub import MokshaHub
log = logging.getLogger('moksha.hub')
class DataStream(object):
""" The parent DataStream class. """
def __init__(self):
self.hub = MokshaHub()
def send_message(self... | import logging
from datetime import timedelta
from twisted.internet.task import LoopingCall
from moksha.hub.hub import MokshaHub
log = logging.getLogger('moksha.hub')
class DataStream(object):
""" The parent DataStream class. """
def __init__(self):
self.hub = MokshaHub()
def send_message(self... | Enable a 'now' property for the PollingDataStream | Enable a 'now' property for the PollingDataStream
| Python | apache-2.0 | ralphbean/moksha,ralphbean/moksha,mokshaproject/moksha,pombredanne/moksha,lmacken/moksha,mokshaproject/moksha,ralphbean/moksha,mokshaproject/moksha,pombredanne/moksha,pombredanne/moksha,lmacken/moksha,mokshaproject/moksha,pombredanne/moksha,lmacken/moksha | import logging
from datetime import timedelta
from twisted.internet.task import LoopingCall
from moksha.hub.hub import MokshaHub
log = logging.getLogger('moksha.hub')
class DataStream(object):
""" The parent DataStream class. """
def __init__(self):
self.hub = MokshaHub()
def send_message(self... | import logging
from datetime import timedelta
from twisted.internet.task import LoopingCall
from moksha.hub.hub import MokshaHub
log = logging.getLogger('moksha.hub')
class DataStream(object):
""" The parent DataStream class. """
def __init__(self):
self.hub = MokshaHub()
def send_message(self... | <commit_before>import logging
from datetime import timedelta
from twisted.internet.task import LoopingCall
from moksha.hub.hub import MokshaHub
log = logging.getLogger('moksha.hub')
class DataStream(object):
""" The parent DataStream class. """
def __init__(self):
self.hub = MokshaHub()
def se... | import logging
from datetime import timedelta
from twisted.internet.task import LoopingCall
from moksha.hub.hub import MokshaHub
log = logging.getLogger('moksha.hub')
class DataStream(object):
""" The parent DataStream class. """
def __init__(self):
self.hub = MokshaHub()
def send_message(self... | import logging
from datetime import timedelta
from twisted.internet.task import LoopingCall
from moksha.hub.hub import MokshaHub
log = logging.getLogger('moksha.hub')
class DataStream(object):
""" The parent DataStream class. """
def __init__(self):
self.hub = MokshaHub()
def send_message(self... | <commit_before>import logging
from datetime import timedelta
from twisted.internet.task import LoopingCall
from moksha.hub.hub import MokshaHub
log = logging.getLogger('moksha.hub')
class DataStream(object):
""" The parent DataStream class. """
def __init__(self):
self.hub = MokshaHub()
def se... |
d88a6afddcc9ac90b1fb2327d4df4ece29f1c031 | docs/plans/wordpress/mysql_boot.py | docs/plans/wordpress/mysql_boot.py | #!/usr/bin/env python
import sys
import os
import simplejson as json
f = open("bootconf.json", "r")
vals_dict = json.load(f)
f.close()
os.putenv('DEBIAN_FRONTEND', 'noninteractive')
os.putenv('TERM', 'dumb')
password=vals_dict['dbpassword']
dbname=vals_dict['dbname']
commands = []
commands.append('sudo -E apt-get ... | #!/usr/bin/env python
import sys
import os
import simplejson as json
f = open("bootconf.json", "r")
vals_dict = json.load(f)
f.close()
os.putenv('DEBIAN_FRONTEND', 'noninteractive')
os.putenv('TERM', 'dumb')
password=vals_dict['dbpassword']
dbname=vals_dict['dbname']
commands = []
commands.append('sudo -E apt-get ... | Add create and delete permissions to mysql user in wordpress example | Add create and delete permissions to mysql user in wordpress example
| Python | apache-2.0 | buzztroll/cloudinit.d,nimbusproject/cloudinit.d,buzztroll/cloudinit.d,nimbusproject/cloudinit.d | #!/usr/bin/env python
import sys
import os
import simplejson as json
f = open("bootconf.json", "r")
vals_dict = json.load(f)
f.close()
os.putenv('DEBIAN_FRONTEND', 'noninteractive')
os.putenv('TERM', 'dumb')
password=vals_dict['dbpassword']
dbname=vals_dict['dbname']
commands = []
commands.append('sudo -E apt-get ... | #!/usr/bin/env python
import sys
import os
import simplejson as json
f = open("bootconf.json", "r")
vals_dict = json.load(f)
f.close()
os.putenv('DEBIAN_FRONTEND', 'noninteractive')
os.putenv('TERM', 'dumb')
password=vals_dict['dbpassword']
dbname=vals_dict['dbname']
commands = []
commands.append('sudo -E apt-get ... | <commit_before>#!/usr/bin/env python
import sys
import os
import simplejson as json
f = open("bootconf.json", "r")
vals_dict = json.load(f)
f.close()
os.putenv('DEBIAN_FRONTEND', 'noninteractive')
os.putenv('TERM', 'dumb')
password=vals_dict['dbpassword']
dbname=vals_dict['dbname']
commands = []
commands.append('s... | #!/usr/bin/env python
import sys
import os
import simplejson as json
f = open("bootconf.json", "r")
vals_dict = json.load(f)
f.close()
os.putenv('DEBIAN_FRONTEND', 'noninteractive')
os.putenv('TERM', 'dumb')
password=vals_dict['dbpassword']
dbname=vals_dict['dbname']
commands = []
commands.append('sudo -E apt-get ... | #!/usr/bin/env python
import sys
import os
import simplejson as json
f = open("bootconf.json", "r")
vals_dict = json.load(f)
f.close()
os.putenv('DEBIAN_FRONTEND', 'noninteractive')
os.putenv('TERM', 'dumb')
password=vals_dict['dbpassword']
dbname=vals_dict['dbname']
commands = []
commands.append('sudo -E apt-get ... | <commit_before>#!/usr/bin/env python
import sys
import os
import simplejson as json
f = open("bootconf.json", "r")
vals_dict = json.load(f)
f.close()
os.putenv('DEBIAN_FRONTEND', 'noninteractive')
os.putenv('TERM', 'dumb')
password=vals_dict['dbpassword']
dbname=vals_dict['dbname']
commands = []
commands.append('s... |
68b499ea6b73232b3b8a860b3c8b808a1736b733 | myfedora/controllers/template.py | myfedora/controllers/template.py | from ${package}.lib.base import *
class TemplateController(BaseController):
def view(self, url):
"""By default, the final controller tried to fulfill the request
when no other routes match. It may be used to display a template
when all else fails, e.g.::
def view(self, url):
... | from myfedora.lib.base import *
class TemplateController(BaseController):
def view(self, url):
"""By default, the final controller tried to fulfill the request
when no other routes match. It may be used to display a template
when all else fails, e.g.::
def view(self, url):
... | Fix a busted import statement in our TemplateController | Fix a busted import statement in our TemplateController
| Python | agpl-3.0 | Fale/fedora-packages,fedora-infra/fedora-packages,fedora-infra/fedora-packages,Fale/fedora-packages,Fale/fedora-packages,fedora-infra/fedora-packages,fedora-infra/fedora-packages | from ${package}.lib.base import *
class TemplateController(BaseController):
def view(self, url):
"""By default, the final controller tried to fulfill the request
when no other routes match. It may be used to display a template
when all else fails, e.g.::
def view(self, url):
... | from myfedora.lib.base import *
class TemplateController(BaseController):
def view(self, url):
"""By default, the final controller tried to fulfill the request
when no other routes match. It may be used to display a template
when all else fails, e.g.::
def view(self, url):
... | <commit_before>from ${package}.lib.base import *
class TemplateController(BaseController):
def view(self, url):
"""By default, the final controller tried to fulfill the request
when no other routes match. It may be used to display a template
when all else fails, e.g.::
def vie... | from myfedora.lib.base import *
class TemplateController(BaseController):
def view(self, url):
"""By default, the final controller tried to fulfill the request
when no other routes match. It may be used to display a template
when all else fails, e.g.::
def view(self, url):
... | from ${package}.lib.base import *
class TemplateController(BaseController):
def view(self, url):
"""By default, the final controller tried to fulfill the request
when no other routes match. It may be used to display a template
when all else fails, e.g.::
def view(self, url):
... | <commit_before>from ${package}.lib.base import *
class TemplateController(BaseController):
def view(self, url):
"""By default, the final controller tried to fulfill the request
when no other routes match. It may be used to display a template
when all else fails, e.g.::
def vie... |
3b5c26db02a3b895af8c6da9ef9e5b79274a6857 | spectator/core/migrations/0003_set_creator_slug.py | spectator/core/migrations/0003_set_creator_slug.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-11-01 09:03
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('spectator_core', '0002_creator_slug'),
]
operations = [
migrations.AddField(
... | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-11-01 09:03
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('spectator_core', '0002_creator_slug'),
]
operations = [
migrations.AlterField... | Fix error in Creator migration | Fix error in Creator migration
Due to manually tweaking old migrations.
Tests in django-hines were complaining about the migration trying
to add Creator.slug a second time.
| Python | mit | philgyford/django-spectator,philgyford/django-spectator,philgyford/django-spectator | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-11-01 09:03
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('spectator_core', '0002_creator_slug'),
]
operations = [
migrations.AddField(
... | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-11-01 09:03
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('spectator_core', '0002_creator_slug'),
]
operations = [
migrations.AlterField... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-11-01 09:03
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('spectator_core', '0002_creator_slug'),
]
operations = [
migrat... | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-11-01 09:03
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('spectator_core', '0002_creator_slug'),
]
operations = [
migrations.AlterField... | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-11-01 09:03
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('spectator_core', '0002_creator_slug'),
]
operations = [
migrations.AddField(
... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-11-01 09:03
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('spectator_core', '0002_creator_slug'),
]
operations = [
migrat... |
926ddeb63f0366a59f14adbab5421ccb7f78f144 | exercises/book-store/example.py | exercises/book-store/example.py | BOOK_PRICE = 8
def _group_price(size):
discounts = [0, .05, .1, .2, .25]
if not (0 < size <= 5):
raise ValueError('size must be in 1..' + len(discounts))
return 8 * size * (1 - discounts[size - 1])
def calculate_total(books, price_so_far=0.):
if not books:
return price_so_far
gr... | BOOK_PRICE = 8
def _group_price(size):
discounts = [0, .05, .1, .2, .25]
if not (0 < size <= 5):
raise ValueError('size must be in 1..' + len(discounts))
return BOOK_PRICE * size * (1 - discounts[size - 1])
def calculate_total(books, price_so_far=0.):
if not books:
return price_so_fa... | Use book price constant in calculation | book-store: Use book price constant in calculation
| Python | mit | N-Parsons/exercism-python,pheanex/xpython,jmluy/xpython,behrtam/xpython,exercism/xpython,smalley/python,exercism/xpython,exercism/python,N-Parsons/exercism-python,smalley/python,pheanex/xpython,jmluy/xpython,exercism/python,behrtam/xpython | BOOK_PRICE = 8
def _group_price(size):
discounts = [0, .05, .1, .2, .25]
if not (0 < size <= 5):
raise ValueError('size must be in 1..' + len(discounts))
return 8 * size * (1 - discounts[size - 1])
def calculate_total(books, price_so_far=0.):
if not books:
return price_so_far
gr... | BOOK_PRICE = 8
def _group_price(size):
discounts = [0, .05, .1, .2, .25]
if not (0 < size <= 5):
raise ValueError('size must be in 1..' + len(discounts))
return BOOK_PRICE * size * (1 - discounts[size - 1])
def calculate_total(books, price_so_far=0.):
if not books:
return price_so_fa... | <commit_before>BOOK_PRICE = 8
def _group_price(size):
discounts = [0, .05, .1, .2, .25]
if not (0 < size <= 5):
raise ValueError('size must be in 1..' + len(discounts))
return 8 * size * (1 - discounts[size - 1])
def calculate_total(books, price_so_far=0.):
if not books:
return price... | BOOK_PRICE = 8
def _group_price(size):
discounts = [0, .05, .1, .2, .25]
if not (0 < size <= 5):
raise ValueError('size must be in 1..' + len(discounts))
return BOOK_PRICE * size * (1 - discounts[size - 1])
def calculate_total(books, price_so_far=0.):
if not books:
return price_so_fa... | BOOK_PRICE = 8
def _group_price(size):
discounts = [0, .05, .1, .2, .25]
if not (0 < size <= 5):
raise ValueError('size must be in 1..' + len(discounts))
return 8 * size * (1 - discounts[size - 1])
def calculate_total(books, price_so_far=0.):
if not books:
return price_so_far
gr... | <commit_before>BOOK_PRICE = 8
def _group_price(size):
discounts = [0, .05, .1, .2, .25]
if not (0 < size <= 5):
raise ValueError('size must be in 1..' + len(discounts))
return 8 * size * (1 - discounts[size - 1])
def calculate_total(books, price_so_far=0.):
if not books:
return price... |
a220a62e4444e75974ad28915e7216a276f60c9c | test_valid_object_file.py | test_valid_object_file.py | from astropy.table import Table
from astropy.coordinates import ICRS, name_resolve
from astropy import units as u
TABLE_NAME = 'feder_object_list.csv'
MAX_SEP = 5 # arcsec
def test_table_can_be_read_and_coords_good():
objs = Table.read(TABLE_NAME, format='ascii', delimiter=',')
columns = ['object', 'ra', 'd... | from astropy.table import Table
from astropy.coordinates import ICRS, name_resolve
from astropy import units as u
TABLE_NAME = 'feder_object_list.csv'
MAX_SEP = 5 # arcsec
# increase timeout so that the Travis builds succeed
name_resolve.NAME_RESOLVE_TIMEOUT.set(30)
def test_table_can_be_read_and_coords_good():
... | Increase timeout for satrapy name lookups | Increase timeout for satrapy name lookups
| Python | bsd-2-clause | mwcraig/feder-object-list | from astropy.table import Table
from astropy.coordinates import ICRS, name_resolve
from astropy import units as u
TABLE_NAME = 'feder_object_list.csv'
MAX_SEP = 5 # arcsec
def test_table_can_be_read_and_coords_good():
objs = Table.read(TABLE_NAME, format='ascii', delimiter=',')
columns = ['object', 'ra', 'd... | from astropy.table import Table
from astropy.coordinates import ICRS, name_resolve
from astropy import units as u
TABLE_NAME = 'feder_object_list.csv'
MAX_SEP = 5 # arcsec
# increase timeout so that the Travis builds succeed
name_resolve.NAME_RESOLVE_TIMEOUT.set(30)
def test_table_can_be_read_and_coords_good():
... | <commit_before>from astropy.table import Table
from astropy.coordinates import ICRS, name_resolve
from astropy import units as u
TABLE_NAME = 'feder_object_list.csv'
MAX_SEP = 5 # arcsec
def test_table_can_be_read_and_coords_good():
objs = Table.read(TABLE_NAME, format='ascii', delimiter=',')
columns = ['ob... | from astropy.table import Table
from astropy.coordinates import ICRS, name_resolve
from astropy import units as u
TABLE_NAME = 'feder_object_list.csv'
MAX_SEP = 5 # arcsec
# increase timeout so that the Travis builds succeed
name_resolve.NAME_RESOLVE_TIMEOUT.set(30)
def test_table_can_be_read_and_coords_good():
... | from astropy.table import Table
from astropy.coordinates import ICRS, name_resolve
from astropy import units as u
TABLE_NAME = 'feder_object_list.csv'
MAX_SEP = 5 # arcsec
def test_table_can_be_read_and_coords_good():
objs = Table.read(TABLE_NAME, format='ascii', delimiter=',')
columns = ['object', 'ra', 'd... | <commit_before>from astropy.table import Table
from astropy.coordinates import ICRS, name_resolve
from astropy import units as u
TABLE_NAME = 'feder_object_list.csv'
MAX_SEP = 5 # arcsec
def test_table_can_be_read_and_coords_good():
objs = Table.read(TABLE_NAME, format='ascii', delimiter=',')
columns = ['ob... |
5cd3b53f677fd6ab6e77bee5b7d42cf2ac85e47f | feincms/apps.py | feincms/apps.py | # flake8: noqa
from feincms.content.application.models import *
| def __getattr__(key):
# Work around Django 3.2's autoloading of *.apps modules (AppConfig
# autodiscovery)
if key in {
"ApplicationContent",
"app_reverse",
"app_reverse_lazy",
"permalink",
"UnpackTemplateResponse",
"standalone",
"unpack",
}:
... | Add a workaround for the AppConfig autodiscovery crashes with Django 3.2 | Add a workaround for the AppConfig autodiscovery crashes with Django 3.2
| Python | bsd-3-clause | mjl/feincms,feincms/feincms,mjl/feincms,feincms/feincms,feincms/feincms,mjl/feincms | # flake8: noqa
from feincms.content.application.models import *
Add a workaround for the AppConfig autodiscovery crashes with Django 3.2 | def __getattr__(key):
# Work around Django 3.2's autoloading of *.apps modules (AppConfig
# autodiscovery)
if key in {
"ApplicationContent",
"app_reverse",
"app_reverse_lazy",
"permalink",
"UnpackTemplateResponse",
"standalone",
"unpack",
}:
... | <commit_before># flake8: noqa
from feincms.content.application.models import *
<commit_msg>Add a workaround for the AppConfig autodiscovery crashes with Django 3.2<commit_after> | def __getattr__(key):
# Work around Django 3.2's autoloading of *.apps modules (AppConfig
# autodiscovery)
if key in {
"ApplicationContent",
"app_reverse",
"app_reverse_lazy",
"permalink",
"UnpackTemplateResponse",
"standalone",
"unpack",
}:
... | # flake8: noqa
from feincms.content.application.models import *
Add a workaround for the AppConfig autodiscovery crashes with Django 3.2def __getattr__(key):
# Work around Django 3.2's autoloading of *.apps modules (AppConfig
# autodiscovery)
if key in {
"ApplicationContent",
"app_reverse",... | <commit_before># flake8: noqa
from feincms.content.application.models import *
<commit_msg>Add a workaround for the AppConfig autodiscovery crashes with Django 3.2<commit_after>def __getattr__(key):
# Work around Django 3.2's autoloading of *.apps modules (AppConfig
# autodiscovery)
if key in {
"Ap... |
f29630aa08bfc86953f40f0b3166a0b9a074122c | csft/__info__.py | csft/__info__.py | # -*- coding:utf-8 -*-
"""
Information about this package.
"""
__author__ = 'Yan QiDong'
__version__ = '0.2.2'
__email__ = '[email protected]'
__url__ = 'https://github.com/yanqd0/csft'
__copyright__ = 'Copyright (C) 2017 ' + __author__
__license__ = 'MIT License'
| # -*- coding:utf-8 -*-
"""
Information about this package.
"""
__author__ = 'Yan QiDong'
__version__ = '0.2.1'
__email__ = '[email protected]'
__url__ = 'https://github.com/yanqd0/csft'
__copyright__ = 'Copyright (C) 2017 ' + __author__
__license__ = 'MIT License'
| Revert "Update version to 0.2.2" | Revert "Update version to 0.2.2"
This reverts commit 028a8722df2f6df6ca308430c672e651a57bd771.
| Python | mit | yanqd0/csft | # -*- coding:utf-8 -*-
"""
Information about this package.
"""
__author__ = 'Yan QiDong'
__version__ = '0.2.2'
__email__ = '[email protected]'
__url__ = 'https://github.com/yanqd0/csft'
__copyright__ = 'Copyright (C) 2017 ' + __author__
__license__ = 'MIT License'
Revert "Update version to 0.2.2"
This reverts commi... | # -*- coding:utf-8 -*-
"""
Information about this package.
"""
__author__ = 'Yan QiDong'
__version__ = '0.2.1'
__email__ = '[email protected]'
__url__ = 'https://github.com/yanqd0/csft'
__copyright__ = 'Copyright (C) 2017 ' + __author__
__license__ = 'MIT License'
| <commit_before># -*- coding:utf-8 -*-
"""
Information about this package.
"""
__author__ = 'Yan QiDong'
__version__ = '0.2.2'
__email__ = '[email protected]'
__url__ = 'https://github.com/yanqd0/csft'
__copyright__ = 'Copyright (C) 2017 ' + __author__
__license__ = 'MIT License'
<commit_msg>Revert "Update version to... | # -*- coding:utf-8 -*-
"""
Information about this package.
"""
__author__ = 'Yan QiDong'
__version__ = '0.2.1'
__email__ = '[email protected]'
__url__ = 'https://github.com/yanqd0/csft'
__copyright__ = 'Copyright (C) 2017 ' + __author__
__license__ = 'MIT License'
| # -*- coding:utf-8 -*-
"""
Information about this package.
"""
__author__ = 'Yan QiDong'
__version__ = '0.2.2'
__email__ = '[email protected]'
__url__ = 'https://github.com/yanqd0/csft'
__copyright__ = 'Copyright (C) 2017 ' + __author__
__license__ = 'MIT License'
Revert "Update version to 0.2.2"
This reverts commi... | <commit_before># -*- coding:utf-8 -*-
"""
Information about this package.
"""
__author__ = 'Yan QiDong'
__version__ = '0.2.2'
__email__ = '[email protected]'
__url__ = 'https://github.com/yanqd0/csft'
__copyright__ = 'Copyright (C) 2017 ' + __author__
__license__ = 'MIT License'
<commit_msg>Revert "Update version to... |
65e4aba86730525a75e915fe61eb15b681817cc3 | app/commander.py | app/commander.py | import rethinkdb as r
class Commander:
def process_message(self, message):
return "I got your message"
| import re
import rethinkdb as r
class Commander:
def process_message(self, message):
return self.parse_message(message)
def parse_message(self, message):
stripped_message = message.strip()
commander_match = re.match(r'commander\s*(.*)',
stripped_me... | Add parsing for adding message | Add parsing for adding message
| Python | mit | henryfjordan/incident-commander | import rethinkdb as r
class Commander:
def process_message(self, message):
return "I got your message"
Add parsing for adding message | import re
import rethinkdb as r
class Commander:
def process_message(self, message):
return self.parse_message(message)
def parse_message(self, message):
stripped_message = message.strip()
commander_match = re.match(r'commander\s*(.*)',
stripped_me... | <commit_before>import rethinkdb as r
class Commander:
def process_message(self, message):
return "I got your message"
<commit_msg>Add parsing for adding message<commit_after> | import re
import rethinkdb as r
class Commander:
def process_message(self, message):
return self.parse_message(message)
def parse_message(self, message):
stripped_message = message.strip()
commander_match = re.match(r'commander\s*(.*)',
stripped_me... | import rethinkdb as r
class Commander:
def process_message(self, message):
return "I got your message"
Add parsing for adding messageimport re
import rethinkdb as r
class Commander:
def process_message(self, message):
return self.parse_message(message)
def parse_message(self, message)... | <commit_before>import rethinkdb as r
class Commander:
def process_message(self, message):
return "I got your message"
<commit_msg>Add parsing for adding message<commit_after>import re
import rethinkdb as r
class Commander:
def process_message(self, message):
return self.parse_message(messa... |
a28826a0b57742d3cb2ac57c0a17b37f2afff302 | homedisplay/control_milight/management/commands/listen_433.py | homedisplay/control_milight/management/commands/listen_433.py | from control_milight.utils import process_automatic_trigger
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
import serial
import time
class Command(BaseCommand):
args = ''
help = 'Listen for 433MHz radio messages'
ITEM_MAP = {
"5236713": "kitchen"... | from control_milight.utils import process_automatic_trigger
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
import serial
import time
import logging
logger = logging.getLogger("%s.%s" % ("homecontroller", __name__))
class Command(BaseCommand):
args = ''
help ... | Use logging. Remove hardcoded settings | Use logging. Remove hardcoded settings
| Python | bsd-3-clause | ojarva/home-info-display,ojarva/home-info-display,ojarva/home-info-display,ojarva/home-info-display | from control_milight.utils import process_automatic_trigger
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
import serial
import time
class Command(BaseCommand):
args = ''
help = 'Listen for 433MHz radio messages'
ITEM_MAP = {
"5236713": "kitchen"... | from control_milight.utils import process_automatic_trigger
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
import serial
import time
import logging
logger = logging.getLogger("%s.%s" % ("homecontroller", __name__))
class Command(BaseCommand):
args = ''
help ... | <commit_before>from control_milight.utils import process_automatic_trigger
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
import serial
import time
class Command(BaseCommand):
args = ''
help = 'Listen for 433MHz radio messages'
ITEM_MAP = {
"5236... | from control_milight.utils import process_automatic_trigger
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
import serial
import time
import logging
logger = logging.getLogger("%s.%s" % ("homecontroller", __name__))
class Command(BaseCommand):
args = ''
help ... | from control_milight.utils import process_automatic_trigger
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
import serial
import time
class Command(BaseCommand):
args = ''
help = 'Listen for 433MHz radio messages'
ITEM_MAP = {
"5236713": "kitchen"... | <commit_before>from control_milight.utils import process_automatic_trigger
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
import serial
import time
class Command(BaseCommand):
args = ''
help = 'Listen for 433MHz radio messages'
ITEM_MAP = {
"5236... |
65f7c62ec30ca7e3d811e146b00cc75bec783129 | fbmsgbot/models/template.py | fbmsgbot/models/template.py | from attachment import Button
import json
class Template(object):
"""
Facebook Messenger message
model for structured messages
"""
button_type = 'button'
generic_type = 'generic'
receipt_type = 'receipt'
def __init__(self, type, **kwargs):
self.type = type
self.kwargs... | from attachment import Button
import json
class Template(object):
"""
Facebook Messenger message
model for structured messages
"""
button_type = 'button'
generic_type = 'generic'
receipt_type = 'receipt'
def __init__(self, type, **kwargs):
self.type = type
self.kwargs... | Remove conversion to json string | Remove conversion to json string
| Python | mit | ben-cunningham/python-messenger-bot,ben-cunningham/pybot | from attachment import Button
import json
class Template(object):
"""
Facebook Messenger message
model for structured messages
"""
button_type = 'button'
generic_type = 'generic'
receipt_type = 'receipt'
def __init__(self, type, **kwargs):
self.type = type
self.kwargs... | from attachment import Button
import json
class Template(object):
"""
Facebook Messenger message
model for structured messages
"""
button_type = 'button'
generic_type = 'generic'
receipt_type = 'receipt'
def __init__(self, type, **kwargs):
self.type = type
self.kwargs... | <commit_before>from attachment import Button
import json
class Template(object):
"""
Facebook Messenger message
model for structured messages
"""
button_type = 'button'
generic_type = 'generic'
receipt_type = 'receipt'
def __init__(self, type, **kwargs):
self.type = type
... | from attachment import Button
import json
class Template(object):
"""
Facebook Messenger message
model for structured messages
"""
button_type = 'button'
generic_type = 'generic'
receipt_type = 'receipt'
def __init__(self, type, **kwargs):
self.type = type
self.kwargs... | from attachment import Button
import json
class Template(object):
"""
Facebook Messenger message
model for structured messages
"""
button_type = 'button'
generic_type = 'generic'
receipt_type = 'receipt'
def __init__(self, type, **kwargs):
self.type = type
self.kwargs... | <commit_before>from attachment import Button
import json
class Template(object):
"""
Facebook Messenger message
model for structured messages
"""
button_type = 'button'
generic_type = 'generic'
receipt_type = 'receipt'
def __init__(self, type, **kwargs):
self.type = type
... |
c2fe4483ba70f0ca37b4713a51baf0804a68accd | lms/djangoapps/course_wiki/plugins/markdownedx/wiki_plugin.py | lms/djangoapps/course_wiki/plugins/markdownedx/wiki_plugin.py | # -*- coding: utf-8 -*-
from wiki.core.plugins.base import BasePlugin
from wiki.core.plugins import registry as plugin_registry
from course_wiki.plugins.markdownedx import mdx_mathjax, mdx_video
class ExtendMarkdownPlugin(BasePlugin):
"""
This plugin simply loads all of the markdown extensions we use in edX... | # -*- coding: utf-8 -*-
from wiki.core.plugins.base import BasePlugin
from wiki.core.plugins import registry as plugin_registry
from course_wiki.plugins.markdownedx import mdx_mathjax, mdx_video
class ExtendMarkdownPlugin(BasePlugin):
"""
This plugin simply loads all of the markdown extensions we use in edX... | Fix PEP8: E126 continuation line over-indented | Fix PEP8: E126 continuation line over-indented
for hanging indent
| Python | agpl-3.0 | IndonesiaX/edx-platform,mbareta/edx-platform-ft,proversity-org/edx-platform,IONISx/edx-platform,Edraak/edx-platform,doganov/edx-platform,shabab12/edx-platform,lduarte1991/edx-platform,deepsrijit1105/edx-platform,pomegranited/edx-platform,prarthitm/edxplatform,fintech-circle/edx-platform,prarthitm/edxplatform,waheedahme... | # -*- coding: utf-8 -*-
from wiki.core.plugins.base import BasePlugin
from wiki.core.plugins import registry as plugin_registry
from course_wiki.plugins.markdownedx import mdx_mathjax, mdx_video
class ExtendMarkdownPlugin(BasePlugin):
"""
This plugin simply loads all of the markdown extensions we use in edX... | # -*- coding: utf-8 -*-
from wiki.core.plugins.base import BasePlugin
from wiki.core.plugins import registry as plugin_registry
from course_wiki.plugins.markdownedx import mdx_mathjax, mdx_video
class ExtendMarkdownPlugin(BasePlugin):
"""
This plugin simply loads all of the markdown extensions we use in edX... | <commit_before># -*- coding: utf-8 -*-
from wiki.core.plugins.base import BasePlugin
from wiki.core.plugins import registry as plugin_registry
from course_wiki.plugins.markdownedx import mdx_mathjax, mdx_video
class ExtendMarkdownPlugin(BasePlugin):
"""
This plugin simply loads all of the markdown extension... | # -*- coding: utf-8 -*-
from wiki.core.plugins.base import BasePlugin
from wiki.core.plugins import registry as plugin_registry
from course_wiki.plugins.markdownedx import mdx_mathjax, mdx_video
class ExtendMarkdownPlugin(BasePlugin):
"""
This plugin simply loads all of the markdown extensions we use in edX... | # -*- coding: utf-8 -*-
from wiki.core.plugins.base import BasePlugin
from wiki.core.plugins import registry as plugin_registry
from course_wiki.plugins.markdownedx import mdx_mathjax, mdx_video
class ExtendMarkdownPlugin(BasePlugin):
"""
This plugin simply loads all of the markdown extensions we use in edX... | <commit_before># -*- coding: utf-8 -*-
from wiki.core.plugins.base import BasePlugin
from wiki.core.plugins import registry as plugin_registry
from course_wiki.plugins.markdownedx import mdx_mathjax, mdx_video
class ExtendMarkdownPlugin(BasePlugin):
"""
This plugin simply loads all of the markdown extension... |
089d7a26f527e7a38ed00348f8b9c644d0b5134b | tests/test_metric_expression.py | tests/test_metric_expression.py | from datetime import datetime
import json
import unittest
from pypercube.cube import Cube
from pypercube.cube import Query
from pypercube.metric import Metric
from pypercube.expression import EventExpression
from pypercube.expression import Sum
from tests import MockResponse
from tests import mock_get
class TestEve... | from datetime import datetime
import json
import unittest
from pypercube.cube import Cube
from pypercube.cube import Query
from pypercube.metric import Metric
from pypercube.expression import EventExpression
from pypercube.expression import Sum
from tests import MockResponse
from tests import mock_get
class TestMet... | Fix metric expression test name. | Fix metric expression test name.
| Python | bsd-3-clause | sbuss/pypercube | from datetime import datetime
import json
import unittest
from pypercube.cube import Cube
from pypercube.cube import Query
from pypercube.metric import Metric
from pypercube.expression import EventExpression
from pypercube.expression import Sum
from tests import MockResponse
from tests import mock_get
class TestEve... | from datetime import datetime
import json
import unittest
from pypercube.cube import Cube
from pypercube.cube import Query
from pypercube.metric import Metric
from pypercube.expression import EventExpression
from pypercube.expression import Sum
from tests import MockResponse
from tests import mock_get
class TestMet... | <commit_before>from datetime import datetime
import json
import unittest
from pypercube.cube import Cube
from pypercube.cube import Query
from pypercube.metric import Metric
from pypercube.expression import EventExpression
from pypercube.expression import Sum
from tests import MockResponse
from tests import mock_get
... | from datetime import datetime
import json
import unittest
from pypercube.cube import Cube
from pypercube.cube import Query
from pypercube.metric import Metric
from pypercube.expression import EventExpression
from pypercube.expression import Sum
from tests import MockResponse
from tests import mock_get
class TestMet... | from datetime import datetime
import json
import unittest
from pypercube.cube import Cube
from pypercube.cube import Query
from pypercube.metric import Metric
from pypercube.expression import EventExpression
from pypercube.expression import Sum
from tests import MockResponse
from tests import mock_get
class TestEve... | <commit_before>from datetime import datetime
import json
import unittest
from pypercube.cube import Cube
from pypercube.cube import Query
from pypercube.metric import Metric
from pypercube.expression import EventExpression
from pypercube.expression import Sum
from tests import MockResponse
from tests import mock_get
... |
4e704ab26f4ed326dd4ca1c04e1355b619109d09 | tests/test_wfgenerator.py | tests/test_wfgenerator.py | import pytest
from nlppln import WorkflowGenerator
class TestWFGenerator(object):
@pytest.fixture
def wf(self):
return WorkflowGenerator()
def test_steps_in_library(self, wf):
assert len(wf.steps_library) > 0
| import pytest
from nlppln import WorkflowGenerator
class TestWFGenerator(object):
@pytest.fixture
def wf(self):
return WorkflowGenerator()
def test_steps_in_library(self, wf):
assert len(wf.steps_library.steps) > 0
| Fix reference to new StepsLibrary object | Fix reference to new StepsLibrary object
| Python | apache-2.0 | WhatWorksWhenForWhom/nlppln,WhatWorksWhenForWhom/nlppln,WhatWorksWhenForWhom/nlppln | import pytest
from nlppln import WorkflowGenerator
class TestWFGenerator(object):
@pytest.fixture
def wf(self):
return WorkflowGenerator()
def test_steps_in_library(self, wf):
assert len(wf.steps_library) > 0
Fix reference to new StepsLibrary object | import pytest
from nlppln import WorkflowGenerator
class TestWFGenerator(object):
@pytest.fixture
def wf(self):
return WorkflowGenerator()
def test_steps_in_library(self, wf):
assert len(wf.steps_library.steps) > 0
| <commit_before>import pytest
from nlppln import WorkflowGenerator
class TestWFGenerator(object):
@pytest.fixture
def wf(self):
return WorkflowGenerator()
def test_steps_in_library(self, wf):
assert len(wf.steps_library) > 0
<commit_msg>Fix reference to new StepsLibrary object<commit_afte... | import pytest
from nlppln import WorkflowGenerator
class TestWFGenerator(object):
@pytest.fixture
def wf(self):
return WorkflowGenerator()
def test_steps_in_library(self, wf):
assert len(wf.steps_library.steps) > 0
| import pytest
from nlppln import WorkflowGenerator
class TestWFGenerator(object):
@pytest.fixture
def wf(self):
return WorkflowGenerator()
def test_steps_in_library(self, wf):
assert len(wf.steps_library) > 0
Fix reference to new StepsLibrary objectimport pytest
from nlppln import Workf... | <commit_before>import pytest
from nlppln import WorkflowGenerator
class TestWFGenerator(object):
@pytest.fixture
def wf(self):
return WorkflowGenerator()
def test_steps_in_library(self, wf):
assert len(wf.steps_library) > 0
<commit_msg>Fix reference to new StepsLibrary object<commit_afte... |
351e88dd95db81418cc6d2deb4a943e2659292bc | wsgi.py | wsgi.py | import os
import sys
import site
VIRTUALENV="venv"
# Get site root from this file's location:
SITE_ROOT=os.path.abspath(os.path.dirname(__file__))
# Add virtualenv path to site package root:
site.addsitedir(os.path.join(SITE_ROOT, VIRTUALENV, "lib/python2.7/site-packages"))
site.addsitedir(os.path.join(SITE_ROOT, VI... | import os
# celery should now be available (on the virtualenv path)
import djcelery
djcelery.setup_loader()
# Point Django to settings file:
os.environ['DJANGO_SETTINGS_MODULE'] = 'toolkit.settings'
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
| Remove virtualenv setup from WSGI entrypoint | Remove virtualenv setup from WSGI entrypoint
Handle it in front end server instead.
| Python | agpl-3.0 | BenMotz/cubetoolkit,BenMotz/cubetoolkit,BenMotz/cubetoolkit,BenMotz/cubetoolkit | import os
import sys
import site
VIRTUALENV="venv"
# Get site root from this file's location:
SITE_ROOT=os.path.abspath(os.path.dirname(__file__))
# Add virtualenv path to site package root:
site.addsitedir(os.path.join(SITE_ROOT, VIRTUALENV, "lib/python2.7/site-packages"))
site.addsitedir(os.path.join(SITE_ROOT, VI... | import os
# celery should now be available (on the virtualenv path)
import djcelery
djcelery.setup_loader()
# Point Django to settings file:
os.environ['DJANGO_SETTINGS_MODULE'] = 'toolkit.settings'
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
| <commit_before>import os
import sys
import site
VIRTUALENV="venv"
# Get site root from this file's location:
SITE_ROOT=os.path.abspath(os.path.dirname(__file__))
# Add virtualenv path to site package root:
site.addsitedir(os.path.join(SITE_ROOT, VIRTUALENV, "lib/python2.7/site-packages"))
site.addsitedir(os.path.joi... | import os
# celery should now be available (on the virtualenv path)
import djcelery
djcelery.setup_loader()
# Point Django to settings file:
os.environ['DJANGO_SETTINGS_MODULE'] = 'toolkit.settings'
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
| import os
import sys
import site
VIRTUALENV="venv"
# Get site root from this file's location:
SITE_ROOT=os.path.abspath(os.path.dirname(__file__))
# Add virtualenv path to site package root:
site.addsitedir(os.path.join(SITE_ROOT, VIRTUALENV, "lib/python2.7/site-packages"))
site.addsitedir(os.path.join(SITE_ROOT, VI... | <commit_before>import os
import sys
import site
VIRTUALENV="venv"
# Get site root from this file's location:
SITE_ROOT=os.path.abspath(os.path.dirname(__file__))
# Add virtualenv path to site package root:
site.addsitedir(os.path.join(SITE_ROOT, VIRTUALENV, "lib/python2.7/site-packages"))
site.addsitedir(os.path.joi... |
da5ca6baf75b2230e3e8a62066bebaa96a16bf3d | test/server.py | test/server.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Server used for tests
"""
import sys
import os
# ensure sys knows about pyqode.core in the test env
sys.path.insert(0, os.getcwd())
from pyqode.core import backend
if __name__ == '__main__':
print('Server started')
print(sys.path)
print(os.getcwd())
ba... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Server used for tests
"""
import sys
import os
# ensure sys knows about pyqode.core in the test env
sys.path.insert(0, os.getcwd())
sys.path.insert(0, os.path.abspath(".."))
from pyqode.core import backend
if __name__ == '__main__':
print('Server started')
pri... | Fix test suite on travis (restore previous path config) | Fix test suite on travis (restore previous path config)
| Python | mit | pyQode/pyqode.core,zwadar/pyqode.core,pyQode/pyqode.core | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Server used for tests
"""
import sys
import os
# ensure sys knows about pyqode.core in the test env
sys.path.insert(0, os.getcwd())
from pyqode.core import backend
if __name__ == '__main__':
print('Server started')
print(sys.path)
print(os.getcwd())
ba... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Server used for tests
"""
import sys
import os
# ensure sys knows about pyqode.core in the test env
sys.path.insert(0, os.getcwd())
sys.path.insert(0, os.path.abspath(".."))
from pyqode.core import backend
if __name__ == '__main__':
print('Server started')
pri... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Server used for tests
"""
import sys
import os
# ensure sys knows about pyqode.core in the test env
sys.path.insert(0, os.getcwd())
from pyqode.core import backend
if __name__ == '__main__':
print('Server started')
print(sys.path)
print(os.g... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Server used for tests
"""
import sys
import os
# ensure sys knows about pyqode.core in the test env
sys.path.insert(0, os.getcwd())
sys.path.insert(0, os.path.abspath(".."))
from pyqode.core import backend
if __name__ == '__main__':
print('Server started')
pri... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Server used for tests
"""
import sys
import os
# ensure sys knows about pyqode.core in the test env
sys.path.insert(0, os.getcwd())
from pyqode.core import backend
if __name__ == '__main__':
print('Server started')
print(sys.path)
print(os.getcwd())
ba... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Server used for tests
"""
import sys
import os
# ensure sys knows about pyqode.core in the test env
sys.path.insert(0, os.getcwd())
from pyqode.core import backend
if __name__ == '__main__':
print('Server started')
print(sys.path)
print(os.g... |
9a81d58bfb1088c8c6286c65150cd13c54c0b4c5 | wagtail/wagtailredirects/middleware.py | wagtail/wagtailredirects/middleware.py | from django import http
from wagtail.wagtailredirects import models
# Originally pinched from: https://github.com/django/django/blob/master/django/contrib/redirects/middleware.py
class RedirectMiddleware(object):
def process_response(self, request, response):
# No need to check for a redirect for non-404... | from django import http
from wagtail.wagtailredirects import models
# Originally pinched from: https://github.com/django/django/blob/master/django/contrib/redirects/middleware.py
class RedirectMiddleware(object):
def process_response(self, request, response):
# No need to check for a redirect for non-404... | Refactor out a bare except: statement | Refactor out a bare except: statement
It now catches `Redirect.DoesNotExist`, returning the normal 404 page if
no redirect is found. Any other exception should not be caught here.
| Python | bsd-3-clause | rjsproxy/wagtail,jnns/wagtail,chrxr/wagtail,Klaudit/wagtail,iansprice/wagtail,kaedroho/wagtail,wagtail/wagtail,mixxorz/wagtail,kurtrwall/wagtail,kurtrwall/wagtail,FlipperPA/wagtail,chrxr/wagtail,mayapurmedia/wagtail,JoshBarr/wagtail,Klaudit/wagtail,torchbox/wagtail,nrsimha/wagtail,nimasmi/wagtail,iansprice/wagtail,hams... | from django import http
from wagtail.wagtailredirects import models
# Originally pinched from: https://github.com/django/django/blob/master/django/contrib/redirects/middleware.py
class RedirectMiddleware(object):
def process_response(self, request, response):
# No need to check for a redirect for non-404... | from django import http
from wagtail.wagtailredirects import models
# Originally pinched from: https://github.com/django/django/blob/master/django/contrib/redirects/middleware.py
class RedirectMiddleware(object):
def process_response(self, request, response):
# No need to check for a redirect for non-404... | <commit_before>from django import http
from wagtail.wagtailredirects import models
# Originally pinched from: https://github.com/django/django/blob/master/django/contrib/redirects/middleware.py
class RedirectMiddleware(object):
def process_response(self, request, response):
# No need to check for a redir... | from django import http
from wagtail.wagtailredirects import models
# Originally pinched from: https://github.com/django/django/blob/master/django/contrib/redirects/middleware.py
class RedirectMiddleware(object):
def process_response(self, request, response):
# No need to check for a redirect for non-404... | from django import http
from wagtail.wagtailredirects import models
# Originally pinched from: https://github.com/django/django/blob/master/django/contrib/redirects/middleware.py
class RedirectMiddleware(object):
def process_response(self, request, response):
# No need to check for a redirect for non-404... | <commit_before>from django import http
from wagtail.wagtailredirects import models
# Originally pinched from: https://github.com/django/django/blob/master/django/contrib/redirects/middleware.py
class RedirectMiddleware(object):
def process_response(self, request, response):
# No need to check for a redir... |
60efbb9b6b70036b72f3c756139524c4ca7698d2 | carepoint/models/cph/fdb_gcn_seq.py | carepoint/models/cph/fdb_gcn_seq.py | # -*- coding: utf-8 -*-
# © 2015-TODAY LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from carepoint import Carepoint
from sqlalchemy import (Column,
Integer,
String,
Boolean,
)
class Fd... | # -*- coding: utf-8 -*-
# © 2015-TODAY LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from carepoint import Carepoint
from sqlalchemy import (Column,
Integer,
String,
Boolean,
ForeignKey,
... | Add foreign keys for form and route in Fdb Gcn Seq in carepoint cph | Add foreign keys for form and route in Fdb Gcn Seq in carepoint cph
| Python | mit | laslabs/Python-Carepoint | # -*- coding: utf-8 -*-
# © 2015-TODAY LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from carepoint import Carepoint
from sqlalchemy import (Column,
Integer,
String,
Boolean,
)
class Fd... | # -*- coding: utf-8 -*-
# © 2015-TODAY LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from carepoint import Carepoint
from sqlalchemy import (Column,
Integer,
String,
Boolean,
ForeignKey,
... | <commit_before># -*- coding: utf-8 -*-
# © 2015-TODAY LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from carepoint import Carepoint
from sqlalchemy import (Column,
Integer,
String,
Boolean,
... | # -*- coding: utf-8 -*-
# © 2015-TODAY LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from carepoint import Carepoint
from sqlalchemy import (Column,
Integer,
String,
Boolean,
ForeignKey,
... | # -*- coding: utf-8 -*-
# © 2015-TODAY LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from carepoint import Carepoint
from sqlalchemy import (Column,
Integer,
String,
Boolean,
)
class Fd... | <commit_before># -*- coding: utf-8 -*-
# © 2015-TODAY LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from carepoint import Carepoint
from sqlalchemy import (Column,
Integer,
String,
Boolean,
... |
628d777e3751ec8e38f1b98f558799b28cda1569 | src/services/TemperatureMonitor/TemperatureMonitor.py | src/services/TemperatureMonitor/TemperatureMonitor.py | import sys
from src.TemperatureMonitor import TemperatureMonitor
from src.temperature import TemperatureSensor
SENSOR_ADDRESS = 0x48
tempMonitor = TemperatureMonitor(TemperatureSensor(SENSOR_ADDRESS), observers=sys.argv[1:])
tempMonitor.run()
| import sys
from src.TemperatureMonitor import TemperatureMonitor
from src.temperature import TemperatureSensor
import argparse
parser = argparse.ArgumentParser(description='Broadcast temperatures to URLs')
parser.add_argument('observers', metavar='N', type=str, nargs='+',
help='the observers', def... | Allow Control of Interval and Observers | Allow Control of Interval and Observers
| Python | mit | IAPark/PITherm | import sys
from src.TemperatureMonitor import TemperatureMonitor
from src.temperature import TemperatureSensor
SENSOR_ADDRESS = 0x48
tempMonitor = TemperatureMonitor(TemperatureSensor(SENSOR_ADDRESS), observers=sys.argv[1:])
tempMonitor.run()
Allow Control of Interval and Observers | import sys
from src.TemperatureMonitor import TemperatureMonitor
from src.temperature import TemperatureSensor
import argparse
parser = argparse.ArgumentParser(description='Broadcast temperatures to URLs')
parser.add_argument('observers', metavar='N', type=str, nargs='+',
help='the observers', def... | <commit_before>import sys
from src.TemperatureMonitor import TemperatureMonitor
from src.temperature import TemperatureSensor
SENSOR_ADDRESS = 0x48
tempMonitor = TemperatureMonitor(TemperatureSensor(SENSOR_ADDRESS), observers=sys.argv[1:])
tempMonitor.run()
<commit_msg>Allow Control of Interval and Observers<commit_... | import sys
from src.TemperatureMonitor import TemperatureMonitor
from src.temperature import TemperatureSensor
import argparse
parser = argparse.ArgumentParser(description='Broadcast temperatures to URLs')
parser.add_argument('observers', metavar='N', type=str, nargs='+',
help='the observers', def... | import sys
from src.TemperatureMonitor import TemperatureMonitor
from src.temperature import TemperatureSensor
SENSOR_ADDRESS = 0x48
tempMonitor = TemperatureMonitor(TemperatureSensor(SENSOR_ADDRESS), observers=sys.argv[1:])
tempMonitor.run()
Allow Control of Interval and Observersimport sys
from src.TemperatureMon... | <commit_before>import sys
from src.TemperatureMonitor import TemperatureMonitor
from src.temperature import TemperatureSensor
SENSOR_ADDRESS = 0x48
tempMonitor = TemperatureMonitor(TemperatureSensor(SENSOR_ADDRESS), observers=sys.argv[1:])
tempMonitor.run()
<commit_msg>Allow Control of Interval and Observers<commit_... |
f8c9cb7d353680f48146d0b37e01ac6761ad7904 | example/bayesian-dark-knowledge/random_num_generator_bug.py | example/bayesian-dark-knowledge/random_num_generator_bug.py | import mxnet as mx
import mxnet.ndarray as nd
for i in range(1000):
noise = mx.random.normal(0,10,(i,i),ctx=mx.gpu()) | import mxnet as mx
mx.random.normal(0,10,(3,3), ctx=mx.gpu()).asnumpy() | Update Bug for Normal Genrator | Update Bug for Normal Genrator
| Python | apache-2.0 | sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet | import mxnet as mx
import mxnet.ndarray as nd
for i in range(1000):
noise = mx.random.normal(0,10,(i,i),ctx=mx.gpu())Update Bug for Normal Genrator | import mxnet as mx
mx.random.normal(0,10,(3,3), ctx=mx.gpu()).asnumpy() | <commit_before>import mxnet as mx
import mxnet.ndarray as nd
for i in range(1000):
noise = mx.random.normal(0,10,(i,i),ctx=mx.gpu())<commit_msg>Update Bug for Normal Genrator<commit_after> | import mxnet as mx
mx.random.normal(0,10,(3,3), ctx=mx.gpu()).asnumpy() | import mxnet as mx
import mxnet.ndarray as nd
for i in range(1000):
noise = mx.random.normal(0,10,(i,i),ctx=mx.gpu())Update Bug for Normal Genratorimport mxnet as mx
mx.random.normal(0,10,(3,3), ctx=mx.gpu()).asnumpy() | <commit_before>import mxnet as mx
import mxnet.ndarray as nd
for i in range(1000):
noise = mx.random.normal(0,10,(i,i),ctx=mx.gpu())<commit_msg>Update Bug for Normal Genrator<commit_after>import mxnet as mx
mx.random.normal(0,10,(3,3), ctx=mx.gpu()).asnumpy() |
b77956a993f7f703626dbc9fc85003d6840b24fe | partner_compassion/models/partner_bank_compassion.py | partner_compassion/models/partner_bank_compassion.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014-2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Steve Ferry
#
# The licence is in the file __manifest__.py
#
###############... | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014-2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Steve Ferry
#
# The licence is in the file __manifest__.py
#
###############... | FIX only post message if a partner is existent | FIX only post message if a partner is existent
| Python | agpl-3.0 | CompassionCH/compassion-switzerland,eicher31/compassion-switzerland,eicher31/compassion-switzerland,eicher31/compassion-switzerland,ecino/compassion-switzerland,ecino/compassion-switzerland,CompassionCH/compassion-switzerland,ecino/compassion-switzerland,CompassionCH/compassion-switzerland | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014-2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Steve Ferry
#
# The licence is in the file __manifest__.py
#
###############... | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014-2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Steve Ferry
#
# The licence is in the file __manifest__.py
#
###############... | <commit_before># -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014-2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Steve Ferry
#
# The licence is in the file __manifest__.py
#
... | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014-2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Steve Ferry
#
# The licence is in the file __manifest__.py
#
###############... | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014-2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Steve Ferry
#
# The licence is in the file __manifest__.py
#
###############... | <commit_before># -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014-2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Steve Ferry
#
# The licence is in the file __manifest__.py
#
... |
031d31c65b66dafe15470aeefe6b2a3240bb4969 | pysis/__init__.py | pysis/__init__.py | # -*- coding: utf-8 -*-
import os
ISIS_ROOT = os.environ.get('ISISROOT')
if ISIS_ROOT is None:
print 'Warning! ISISROOT is not defined. Bitch.'
(ISIS_VERSION, ISIS_VERSION_MAJOR, ISIS_VERSION_MINOR,
ISIS_VERSION_PATCH, ISIS_VERSION_BUILD) = 5 * (None,)
else:
with open(filename) as _f:
ISI... | # -*- coding: utf-8 -*-
import os, sys
ISIS_ROOT = os.environ.get('ISISROOT')
if ISIS_ROOT is None:
sys.stderr.write('Warning! ISISROOT is not defined. Bitch.\n')
(ISIS_VERSION, ISIS_VERSION_MAJOR, ISIS_VERSION_MINOR,
ISIS_VERSION_PATCH, ISIS_VERSION_BUILD) = 5 * (None,)
else:
with open(filename)... | Write warning to std err instead. | Write warning to std err instead.
| Python | bsd-3-clause | wtolson/pysis,wtolson/pysis,michaelaye/Pysis,michaelaye/Pysis | # -*- coding: utf-8 -*-
import os
ISIS_ROOT = os.environ.get('ISISROOT')
if ISIS_ROOT is None:
print 'Warning! ISISROOT is not defined. Bitch.'
(ISIS_VERSION, ISIS_VERSION_MAJOR, ISIS_VERSION_MINOR,
ISIS_VERSION_PATCH, ISIS_VERSION_BUILD) = 5 * (None,)
else:
with open(filename) as _f:
ISI... | # -*- coding: utf-8 -*-
import os, sys
ISIS_ROOT = os.environ.get('ISISROOT')
if ISIS_ROOT is None:
sys.stderr.write('Warning! ISISROOT is not defined. Bitch.\n')
(ISIS_VERSION, ISIS_VERSION_MAJOR, ISIS_VERSION_MINOR,
ISIS_VERSION_PATCH, ISIS_VERSION_BUILD) = 5 * (None,)
else:
with open(filename)... | <commit_before># -*- coding: utf-8 -*-
import os
ISIS_ROOT = os.environ.get('ISISROOT')
if ISIS_ROOT is None:
print 'Warning! ISISROOT is not defined. Bitch.'
(ISIS_VERSION, ISIS_VERSION_MAJOR, ISIS_VERSION_MINOR,
ISIS_VERSION_PATCH, ISIS_VERSION_BUILD) = 5 * (None,)
else:
with open(filename) as ... | # -*- coding: utf-8 -*-
import os, sys
ISIS_ROOT = os.environ.get('ISISROOT')
if ISIS_ROOT is None:
sys.stderr.write('Warning! ISISROOT is not defined. Bitch.\n')
(ISIS_VERSION, ISIS_VERSION_MAJOR, ISIS_VERSION_MINOR,
ISIS_VERSION_PATCH, ISIS_VERSION_BUILD) = 5 * (None,)
else:
with open(filename)... | # -*- coding: utf-8 -*-
import os
ISIS_ROOT = os.environ.get('ISISROOT')
if ISIS_ROOT is None:
print 'Warning! ISISROOT is not defined. Bitch.'
(ISIS_VERSION, ISIS_VERSION_MAJOR, ISIS_VERSION_MINOR,
ISIS_VERSION_PATCH, ISIS_VERSION_BUILD) = 5 * (None,)
else:
with open(filename) as _f:
ISI... | <commit_before># -*- coding: utf-8 -*-
import os
ISIS_ROOT = os.environ.get('ISISROOT')
if ISIS_ROOT is None:
print 'Warning! ISISROOT is not defined. Bitch.'
(ISIS_VERSION, ISIS_VERSION_MAJOR, ISIS_VERSION_MINOR,
ISIS_VERSION_PATCH, ISIS_VERSION_BUILD) = 5 * (None,)
else:
with open(filename) as ... |
040324578680a26f3816aef6f05a731be54a377d | pyroSAR/tests/test_dev_config.py | pyroSAR/tests/test_dev_config.py | import pytest
from pyroSAR._dev_config import Storage, LOOKUP, URL, STORAGE
class TestStorage:
def test_insert(self):
storage = Storage(a=1, b=2)
assert storage.a == 1
assert storage.b == 2
class TestLookup:
def test_suffix(self):
assert LOOKUP.snap.suffix[0]['Apply-Orbit-Fil... | import pytest
from pyroSAR._dev_config import Storage, LOOKUP, URL, STORAGE
class TestStorage:
def test_insert(self):
storage = Storage(a=1, b=2)
assert storage.a == 1
assert storage.b == 2
class TestLookup:
def test_suffix(self):
assert LOOKUP.snap.suffix['Apply-Orbit-File']... | Update due to changes in LOOKUP. | Update due to changes in LOOKUP.
| Python | mit | johntruckenbrodt/pyroSAR,johntruckenbrodt/pyroSAR | import pytest
from pyroSAR._dev_config import Storage, LOOKUP, URL, STORAGE
class TestStorage:
def test_insert(self):
storage = Storage(a=1, b=2)
assert storage.a == 1
assert storage.b == 2
class TestLookup:
def test_suffix(self):
assert LOOKUP.snap.suffix[0]['Apply-Orbit-Fil... | import pytest
from pyroSAR._dev_config import Storage, LOOKUP, URL, STORAGE
class TestStorage:
def test_insert(self):
storage = Storage(a=1, b=2)
assert storage.a == 1
assert storage.b == 2
class TestLookup:
def test_suffix(self):
assert LOOKUP.snap.suffix['Apply-Orbit-File']... | <commit_before>import pytest
from pyroSAR._dev_config import Storage, LOOKUP, URL, STORAGE
class TestStorage:
def test_insert(self):
storage = Storage(a=1, b=2)
assert storage.a == 1
assert storage.b == 2
class TestLookup:
def test_suffix(self):
assert LOOKUP.snap.suffix[0]['... | import pytest
from pyroSAR._dev_config import Storage, LOOKUP, URL, STORAGE
class TestStorage:
def test_insert(self):
storage = Storage(a=1, b=2)
assert storage.a == 1
assert storage.b == 2
class TestLookup:
def test_suffix(self):
assert LOOKUP.snap.suffix['Apply-Orbit-File']... | import pytest
from pyroSAR._dev_config import Storage, LOOKUP, URL, STORAGE
class TestStorage:
def test_insert(self):
storage = Storage(a=1, b=2)
assert storage.a == 1
assert storage.b == 2
class TestLookup:
def test_suffix(self):
assert LOOKUP.snap.suffix[0]['Apply-Orbit-Fil... | <commit_before>import pytest
from pyroSAR._dev_config import Storage, LOOKUP, URL, STORAGE
class TestStorage:
def test_insert(self):
storage = Storage(a=1, b=2)
assert storage.a == 1
assert storage.b == 2
class TestLookup:
def test_suffix(self):
assert LOOKUP.snap.suffix[0]['... |
63afb46b7a39881c3a3655af645d5414bdd730ea | edumed/forum.py | edumed/forum.py | from pybb.permissions import DefaultPermissionHandler
class ForumPermissionHandler(DefaultPermissionHandler):
def may_post_as_admin(self, user):
""" return True if `user` may post as admin """
return False
| from pybb.permissions import DefaultPermissionHandler
class ForumPermissionHandler(DefaultPermissionHandler):
def may_post_as_admin(self, user):
""" return True if `user` may post as admin """
return False
def may_create_topic(self, user, forum):
""" return True if `user` is allowed t... | Allow for authenticated non super users to create posts and topics | Allow for authenticated non super users to create posts and topics
| Python | agpl-3.0 | fnp/edumed,fnp/edumed,fnp/edumed | from pybb.permissions import DefaultPermissionHandler
class ForumPermissionHandler(DefaultPermissionHandler):
def may_post_as_admin(self, user):
""" return True if `user` may post as admin """
return False
Allow for authenticated non super users to create posts and topics | from pybb.permissions import DefaultPermissionHandler
class ForumPermissionHandler(DefaultPermissionHandler):
def may_post_as_admin(self, user):
""" return True if `user` may post as admin """
return False
def may_create_topic(self, user, forum):
""" return True if `user` is allowed t... | <commit_before>from pybb.permissions import DefaultPermissionHandler
class ForumPermissionHandler(DefaultPermissionHandler):
def may_post_as_admin(self, user):
""" return True if `user` may post as admin """
return False
<commit_msg>Allow for authenticated non super users to create posts and topic... | from pybb.permissions import DefaultPermissionHandler
class ForumPermissionHandler(DefaultPermissionHandler):
def may_post_as_admin(self, user):
""" return True if `user` may post as admin """
return False
def may_create_topic(self, user, forum):
""" return True if `user` is allowed t... | from pybb.permissions import DefaultPermissionHandler
class ForumPermissionHandler(DefaultPermissionHandler):
def may_post_as_admin(self, user):
""" return True if `user` may post as admin """
return False
Allow for authenticated non super users to create posts and topicsfrom pybb.permissions impo... | <commit_before>from pybb.permissions import DefaultPermissionHandler
class ForumPermissionHandler(DefaultPermissionHandler):
def may_post_as_admin(self, user):
""" return True if `user` may post as admin """
return False
<commit_msg>Allow for authenticated non super users to create posts and topic... |
ff63299cde0fe34fe3bfdac16593e1a0a989bec4 | Hydv2/ScreenTools.py | Hydv2/ScreenTools.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
__author__ = 'Olivier Larrieu'
from gtk import gdk
class ScreenProperties(object):
"""
Usefull to get basic screen informations
"""
@classmethod
def screen_dimension(cls):
"""
Return a dic with the screen height and screen width
... | #!/usr/bin/env python
# -*- coding:utf-8 -*-
__author__ = 'Olivier Larrieu'
class ScreenProperties(object):
"""
Usefull to get basic screen informations
"""
@classmethod
def screen_dimension(cls):
"""
Return a dic with the screen height and screen width
"""
f... | Use Xlib instead of gtk to get screen width and screen height This limit dependances | Use Xlib instead of gtk to get screen width and screen height
This limit dependances
| Python | artistic-2.0 | OlivierLarrieu/HYDV2_EFL,OlivierLarrieu/HYDV2_EFL,OlivierLarrieu/HYDV2_EFL,OlivierLarrieu/HYDV2_EFL | #!/usr/bin/env python
# -*- coding:utf-8 -*-
__author__ = 'Olivier Larrieu'
from gtk import gdk
class ScreenProperties(object):
"""
Usefull to get basic screen informations
"""
@classmethod
def screen_dimension(cls):
"""
Return a dic with the screen height and screen width
... | #!/usr/bin/env python
# -*- coding:utf-8 -*-
__author__ = 'Olivier Larrieu'
class ScreenProperties(object):
"""
Usefull to get basic screen informations
"""
@classmethod
def screen_dimension(cls):
"""
Return a dic with the screen height and screen width
"""
f... | <commit_before>#!/usr/bin/env python
# -*- coding:utf-8 -*-
__author__ = 'Olivier Larrieu'
from gtk import gdk
class ScreenProperties(object):
"""
Usefull to get basic screen informations
"""
@classmethod
def screen_dimension(cls):
"""
Return a dic with the screen height an... | #!/usr/bin/env python
# -*- coding:utf-8 -*-
__author__ = 'Olivier Larrieu'
class ScreenProperties(object):
"""
Usefull to get basic screen informations
"""
@classmethod
def screen_dimension(cls):
"""
Return a dic with the screen height and screen width
"""
f... | #!/usr/bin/env python
# -*- coding:utf-8 -*-
__author__ = 'Olivier Larrieu'
from gtk import gdk
class ScreenProperties(object):
"""
Usefull to get basic screen informations
"""
@classmethod
def screen_dimension(cls):
"""
Return a dic with the screen height and screen width
... | <commit_before>#!/usr/bin/env python
# -*- coding:utf-8 -*-
__author__ = 'Olivier Larrieu'
from gtk import gdk
class ScreenProperties(object):
"""
Usefull to get basic screen informations
"""
@classmethod
def screen_dimension(cls):
"""
Return a dic with the screen height an... |
7ce51c694e44e8503acd86de0f90dbc4078f4b82 | user_deletion/managers.py | user_deletion/managers.py | from dateutil.relativedelta import relativedelta
from django.apps import apps
from django.utils import timezone
user_deletion_config = apps.get_app_config('user_deletion')
class UserDeletionManagerMixin:
def users_to_notify(self):
"""Finds all users who have been inactive and not yet notified."""
... | from dateutil.relativedelta import relativedelta
from django.apps import apps
from django.utils import timezone
user_deletion_config = apps.get_app_config('user_deletion')
class UserDeletionManagerMixin:
def users_to_notify(self):
"""Finds all users who have been inactive and not yet notified."""
... | Use threshold for time boundary in manager | Use threshold for time boundary in manager
| Python | bsd-2-clause | incuna/django-user-deletion | from dateutil.relativedelta import relativedelta
from django.apps import apps
from django.utils import timezone
user_deletion_config = apps.get_app_config('user_deletion')
class UserDeletionManagerMixin:
def users_to_notify(self):
"""Finds all users who have been inactive and not yet notified."""
... | from dateutil.relativedelta import relativedelta
from django.apps import apps
from django.utils import timezone
user_deletion_config = apps.get_app_config('user_deletion')
class UserDeletionManagerMixin:
def users_to_notify(self):
"""Finds all users who have been inactive and not yet notified."""
... | <commit_before>from dateutil.relativedelta import relativedelta
from django.apps import apps
from django.utils import timezone
user_deletion_config = apps.get_app_config('user_deletion')
class UserDeletionManagerMixin:
def users_to_notify(self):
"""Finds all users who have been inactive and not yet noti... | from dateutil.relativedelta import relativedelta
from django.apps import apps
from django.utils import timezone
user_deletion_config = apps.get_app_config('user_deletion')
class UserDeletionManagerMixin:
def users_to_notify(self):
"""Finds all users who have been inactive and not yet notified."""
... | from dateutil.relativedelta import relativedelta
from django.apps import apps
from django.utils import timezone
user_deletion_config = apps.get_app_config('user_deletion')
class UserDeletionManagerMixin:
def users_to_notify(self):
"""Finds all users who have been inactive and not yet notified."""
... | <commit_before>from dateutil.relativedelta import relativedelta
from django.apps import apps
from django.utils import timezone
user_deletion_config = apps.get_app_config('user_deletion')
class UserDeletionManagerMixin:
def users_to_notify(self):
"""Finds all users who have been inactive and not yet noti... |
58f8f4881a9e97206ddf49ea6cfb7f48dd34bfb3 | example/urls.py | example/urls.py | from django.conf.urls import url
from django.views.generic import TemplateView
urlpatterns = [
url(r"^$", TemplateView.as_view(template_name="homepage.html")),
url(r"^remote.html$", TemplateView.as_view(template_name="remote.html"), name="remote.html"),
]
| from django.urls import path, re_path
from django.views.generic import TemplateView
urlpatterns = [
path('', TemplateView.as_view(template_name="homepage.html")),
re_path(r"^remote.html$", TemplateView.as_view(template_name="remote.html"), name="remote.html"),
]
| Upgrade code to Python 3.6+, Django 2.2 and remove deprecations | Upgrade code to Python 3.6+, Django 2.2 and remove deprecations
| Python | bsd-3-clause | bashu/django-fancybox,bashu/django-fancybox | from django.conf.urls import url
from django.views.generic import TemplateView
urlpatterns = [
url(r"^$", TemplateView.as_view(template_name="homepage.html")),
url(r"^remote.html$", TemplateView.as_view(template_name="remote.html"), name="remote.html"),
]
Upgrade code to Python 3.6+, Django 2.2 and remove depr... | from django.urls import path, re_path
from django.views.generic import TemplateView
urlpatterns = [
path('', TemplateView.as_view(template_name="homepage.html")),
re_path(r"^remote.html$", TemplateView.as_view(template_name="remote.html"), name="remote.html"),
]
| <commit_before>from django.conf.urls import url
from django.views.generic import TemplateView
urlpatterns = [
url(r"^$", TemplateView.as_view(template_name="homepage.html")),
url(r"^remote.html$", TemplateView.as_view(template_name="remote.html"), name="remote.html"),
]
<commit_msg>Upgrade code to Python 3.6+,... | from django.urls import path, re_path
from django.views.generic import TemplateView
urlpatterns = [
path('', TemplateView.as_view(template_name="homepage.html")),
re_path(r"^remote.html$", TemplateView.as_view(template_name="remote.html"), name="remote.html"),
]
| from django.conf.urls import url
from django.views.generic import TemplateView
urlpatterns = [
url(r"^$", TemplateView.as_view(template_name="homepage.html")),
url(r"^remote.html$", TemplateView.as_view(template_name="remote.html"), name="remote.html"),
]
Upgrade code to Python 3.6+, Django 2.2 and remove depr... | <commit_before>from django.conf.urls import url
from django.views.generic import TemplateView
urlpatterns = [
url(r"^$", TemplateView.as_view(template_name="homepage.html")),
url(r"^remote.html$", TemplateView.as_view(template_name="remote.html"), name="remote.html"),
]
<commit_msg>Upgrade code to Python 3.6+,... |
9912974a283912acd31fa4ee85de2fb44c2cf862 | nn/model.py | nn/model.py | import abc
import tensorflow as tf
class Model(metaclass=abc.ABCMeta):
@abc.astractmethod
def __init__(self, **hyperparameters_and_initial_parameters):
return NotImplemented
@abc.astractmethod
def train(self, *input_tensors) -> tf.Tensor: # scalar loss
return NotImplemented
@abc.astractmethod
d... | import abc
import tensorflow as tf
class Model(metaclass=abc.ABCMeta):
@abc.astractmethod
def __init__(self, **hyperparameters_and_initial_parameters):
return NotImplemented
@abc.astractmethod
def train(self, *input_tensors) -> tf.Operation: # training operation
return NotImplemented
@abc.astract... | Fix type annotation for Model.train() | Fix type annotation for Model.train()
| Python | unlicense | raviqqe/tensorflow-extenteten,raviqqe/tensorflow-extenteten | import abc
import tensorflow as tf
class Model(metaclass=abc.ABCMeta):
@abc.astractmethod
def __init__(self, **hyperparameters_and_initial_parameters):
return NotImplemented
@abc.astractmethod
def train(self, *input_tensors) -> tf.Tensor: # scalar loss
return NotImplemented
@abc.astractmethod
d... | import abc
import tensorflow as tf
class Model(metaclass=abc.ABCMeta):
@abc.astractmethod
def __init__(self, **hyperparameters_and_initial_parameters):
return NotImplemented
@abc.astractmethod
def train(self, *input_tensors) -> tf.Operation: # training operation
return NotImplemented
@abc.astract... | <commit_before>import abc
import tensorflow as tf
class Model(metaclass=abc.ABCMeta):
@abc.astractmethod
def __init__(self, **hyperparameters_and_initial_parameters):
return NotImplemented
@abc.astractmethod
def train(self, *input_tensors) -> tf.Tensor: # scalar loss
return NotImplemented
@abc.as... | import abc
import tensorflow as tf
class Model(metaclass=abc.ABCMeta):
@abc.astractmethod
def __init__(self, **hyperparameters_and_initial_parameters):
return NotImplemented
@abc.astractmethod
def train(self, *input_tensors) -> tf.Operation: # training operation
return NotImplemented
@abc.astract... | import abc
import tensorflow as tf
class Model(metaclass=abc.ABCMeta):
@abc.astractmethod
def __init__(self, **hyperparameters_and_initial_parameters):
return NotImplemented
@abc.astractmethod
def train(self, *input_tensors) -> tf.Tensor: # scalar loss
return NotImplemented
@abc.astractmethod
d... | <commit_before>import abc
import tensorflow as tf
class Model(metaclass=abc.ABCMeta):
@abc.astractmethod
def __init__(self, **hyperparameters_and_initial_parameters):
return NotImplemented
@abc.astractmethod
def train(self, *input_tensors) -> tf.Tensor: # scalar loss
return NotImplemented
@abc.as... |
33775cd9e740ac70e9213c37825077516e683e55 | pyatv/support/device_info.py | pyatv/support/device_info.py | """Lookup methods for device data."""
import re
from pyatv.const import DeviceModel
_MODEL_LIST = {
"AppleTV2,1": DeviceModel.Gen2,
"AppleTV3,1": DeviceModel.Gen3,
"AppleTV3,2": DeviceModel.Gen3,
"AppleTV5,3": DeviceModel.Gen4,
"AppleTV6,2": DeviceModel.Gen4K,
}
# Incomplete list here!
_VERSIO... | """Lookup methods for device data."""
import re
from pyatv.const import DeviceModel
_MODEL_LIST = {
"AppleTV2,1": DeviceModel.Gen2,
"AppleTV3,1": DeviceModel.Gen3,
"AppleTV3,2": DeviceModel.Gen3,
"AppleTV5,3": DeviceModel.Gen4,
"AppleTV6,2": DeviceModel.Gen4K,
}
# Incomplete list here!
_VERSIO... | Add tvOS 13.4 build number | mrp: Add tvOS 13.4 build number
| Python | mit | postlund/pyatv,postlund/pyatv | """Lookup methods for device data."""
import re
from pyatv.const import DeviceModel
_MODEL_LIST = {
"AppleTV2,1": DeviceModel.Gen2,
"AppleTV3,1": DeviceModel.Gen3,
"AppleTV3,2": DeviceModel.Gen3,
"AppleTV5,3": DeviceModel.Gen4,
"AppleTV6,2": DeviceModel.Gen4K,
}
# Incomplete list here!
_VERSIO... | """Lookup methods for device data."""
import re
from pyatv.const import DeviceModel
_MODEL_LIST = {
"AppleTV2,1": DeviceModel.Gen2,
"AppleTV3,1": DeviceModel.Gen3,
"AppleTV3,2": DeviceModel.Gen3,
"AppleTV5,3": DeviceModel.Gen4,
"AppleTV6,2": DeviceModel.Gen4K,
}
# Incomplete list here!
_VERSIO... | <commit_before>"""Lookup methods for device data."""
import re
from pyatv.const import DeviceModel
_MODEL_LIST = {
"AppleTV2,1": DeviceModel.Gen2,
"AppleTV3,1": DeviceModel.Gen3,
"AppleTV3,2": DeviceModel.Gen3,
"AppleTV5,3": DeviceModel.Gen4,
"AppleTV6,2": DeviceModel.Gen4K,
}
# Incomplete lis... | """Lookup methods for device data."""
import re
from pyatv.const import DeviceModel
_MODEL_LIST = {
"AppleTV2,1": DeviceModel.Gen2,
"AppleTV3,1": DeviceModel.Gen3,
"AppleTV3,2": DeviceModel.Gen3,
"AppleTV5,3": DeviceModel.Gen4,
"AppleTV6,2": DeviceModel.Gen4K,
}
# Incomplete list here!
_VERSIO... | """Lookup methods for device data."""
import re
from pyatv.const import DeviceModel
_MODEL_LIST = {
"AppleTV2,1": DeviceModel.Gen2,
"AppleTV3,1": DeviceModel.Gen3,
"AppleTV3,2": DeviceModel.Gen3,
"AppleTV5,3": DeviceModel.Gen4,
"AppleTV6,2": DeviceModel.Gen4K,
}
# Incomplete list here!
_VERSIO... | <commit_before>"""Lookup methods for device data."""
import re
from pyatv.const import DeviceModel
_MODEL_LIST = {
"AppleTV2,1": DeviceModel.Gen2,
"AppleTV3,1": DeviceModel.Gen3,
"AppleTV3,2": DeviceModel.Gen3,
"AppleTV5,3": DeviceModel.Gen4,
"AppleTV6,2": DeviceModel.Gen4K,
}
# Incomplete lis... |
694a85c71c315ccdb3e2f2946f86ce95936ee684 | sahara_dashboard/api/__init__.py | sahara_dashboard/api/__init__.py | from sahara_dashboard.api import sahara
__all__ = [
"sahara"
]
| # 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 under the... | Add licensing info in source file. | Add licensing info in source file.
[H102 H103] Source code should be licensed under the Apache 2.0 license.
All source files should have the licensing header.
Change-Id: I4f9ead44b5efa3616086f5a62a2e0e68854baf44
| Python | apache-2.0 | openstack/sahara-dashboard,openstack/sahara-dashboard,openstack/sahara-dashboard,openstack/sahara-dashboard | from sahara_dashboard.api import sahara
__all__ = [
"sahara"
]
Add licensing info in source file.
[H102 H103] Source code should be licensed under the Apache 2.0 license.
All source files should have the licensing header.
Change-Id: I4f9ead44b5efa3616086f5a62a2e0e68854baf44 | # 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 under the... | <commit_before>from sahara_dashboard.api import sahara
__all__ = [
"sahara"
]
<commit_msg>Add licensing info in source file.
[H102 H103] Source code should be licensed under the Apache 2.0 license.
All source files should have the licensing header.
Change-Id: I4f9ead44b5efa3616086f5a62a2e0e68854baf44<commit_afte... | # 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 under the... | from sahara_dashboard.api import sahara
__all__ = [
"sahara"
]
Add licensing info in source file.
[H102 H103] Source code should be licensed under the Apache 2.0 license.
All source files should have the licensing header.
Change-Id: I4f9ead44b5efa3616086f5a62a2e0e68854baf44# Licensed under the Apache License, Ve... | <commit_before>from sahara_dashboard.api import sahara
__all__ = [
"sahara"
]
<commit_msg>Add licensing info in source file.
[H102 H103] Source code should be licensed under the Apache 2.0 license.
All source files should have the licensing header.
Change-Id: I4f9ead44b5efa3616086f5a62a2e0e68854baf44<commit_afte... |
3016872091618c78f60e17338f5581856a17f7af | endpoints/tests/test_utils.py | endpoints/tests/test_utils.py | from utils.testcase import EndpointTestCase
from rest_framework import status
from rest_framework.test import APIClient
from django.utils.translation import ugettext_lazy as _
import sure
class TestUtils(EndpointTestCase):
def test_fail_authentication(self):
client = APIClient()
client.credentia... | from utils.testcase import EndpointTestCase
from rest_framework import status
from rest_framework.test import APIClient
from django.utils.translation import ugettext_lazy as _
import sure
class TestUtils(EndpointTestCase):
def test_fail_authentication(self):
client = APIClient()
client.credentia... | Add test for no HTTP_AUTHORIZATION header at all | Add test for no HTTP_AUTHORIZATION header at all
| Python | mit | Amoki/Amoki-Music,Amoki/Amoki-Music,Amoki/Amoki-Music | from utils.testcase import EndpointTestCase
from rest_framework import status
from rest_framework.test import APIClient
from django.utils.translation import ugettext_lazy as _
import sure
class TestUtils(EndpointTestCase):
def test_fail_authentication(self):
client = APIClient()
client.credentia... | from utils.testcase import EndpointTestCase
from rest_framework import status
from rest_framework.test import APIClient
from django.utils.translation import ugettext_lazy as _
import sure
class TestUtils(EndpointTestCase):
def test_fail_authentication(self):
client = APIClient()
client.credentia... | <commit_before>from utils.testcase import EndpointTestCase
from rest_framework import status
from rest_framework.test import APIClient
from django.utils.translation import ugettext_lazy as _
import sure
class TestUtils(EndpointTestCase):
def test_fail_authentication(self):
client = APIClient()
c... | from utils.testcase import EndpointTestCase
from rest_framework import status
from rest_framework.test import APIClient
from django.utils.translation import ugettext_lazy as _
import sure
class TestUtils(EndpointTestCase):
def test_fail_authentication(self):
client = APIClient()
client.credentia... | from utils.testcase import EndpointTestCase
from rest_framework import status
from rest_framework.test import APIClient
from django.utils.translation import ugettext_lazy as _
import sure
class TestUtils(EndpointTestCase):
def test_fail_authentication(self):
client = APIClient()
client.credentia... | <commit_before>from utils.testcase import EndpointTestCase
from rest_framework import status
from rest_framework.test import APIClient
from django.utils.translation import ugettext_lazy as _
import sure
class TestUtils(EndpointTestCase):
def test_fail_authentication(self):
client = APIClient()
c... |
5e2943b8e17ee753ddfafd1420c9e8155c496aba | example/tests/test_parsers.py | example/tests/test_parsers.py | import json
from django.test import TestCase
from io import BytesIO
from rest_framework_json_api.parsers import JSONParser
class TestJSONParser(TestCase):
def setUp(self):
class MockRequest(object):
def __init__(self):
self.method = 'GET'
request = MockRequest()
... | import json
from io import BytesIO
from django.test import TestCase
from rest_framework.exceptions import ParseError
from rest_framework_json_api.parsers import JSONParser
class TestJSONParser(TestCase):
def setUp(self):
class MockRequest(object):
def __init__(self):
self.m... | Test case for parsing invalid data. | Test case for parsing invalid data.
| Python | bsd-2-clause | django-json-api/rest_framework_ember,Instawork/django-rest-framework-json-api,leo-naeka/django-rest-framework-json-api,abdulhaq-e/django-rest-framework-json-api,django-json-api/django-rest-framework-json-api,django-json-api/django-rest-framework-json-api | import json
from django.test import TestCase
from io import BytesIO
from rest_framework_json_api.parsers import JSONParser
class TestJSONParser(TestCase):
def setUp(self):
class MockRequest(object):
def __init__(self):
self.method = 'GET'
request = MockRequest()
... | import json
from io import BytesIO
from django.test import TestCase
from rest_framework.exceptions import ParseError
from rest_framework_json_api.parsers import JSONParser
class TestJSONParser(TestCase):
def setUp(self):
class MockRequest(object):
def __init__(self):
self.m... | <commit_before>import json
from django.test import TestCase
from io import BytesIO
from rest_framework_json_api.parsers import JSONParser
class TestJSONParser(TestCase):
def setUp(self):
class MockRequest(object):
def __init__(self):
self.method = 'GET'
request = Mo... | import json
from io import BytesIO
from django.test import TestCase
from rest_framework.exceptions import ParseError
from rest_framework_json_api.parsers import JSONParser
class TestJSONParser(TestCase):
def setUp(self):
class MockRequest(object):
def __init__(self):
self.m... | import json
from django.test import TestCase
from io import BytesIO
from rest_framework_json_api.parsers import JSONParser
class TestJSONParser(TestCase):
def setUp(self):
class MockRequest(object):
def __init__(self):
self.method = 'GET'
request = MockRequest()
... | <commit_before>import json
from django.test import TestCase
from io import BytesIO
from rest_framework_json_api.parsers import JSONParser
class TestJSONParser(TestCase):
def setUp(self):
class MockRequest(object):
def __init__(self):
self.method = 'GET'
request = Mo... |
4ee53117aa32b1ead7c979a49d7cb5709e18d8cc | dbaas/workflow/steps/util/deploy/check_dns.py | dbaas/workflow/steps/util/deploy/check_dns.py | # -*- coding: utf-8 -*-
import logging
from util import full_stack
from util import check_nslookup
from util import get_credentials_for
from dbaas_dnsapi.models import DatabaseInfraDNSList
from dbaas_credentials.models import CredentialType
from ..base import BaseStep
from ....exceptions.error_codes import DBAAS_0005
... | # -*- coding: utf-8 -*-
import logging
from util import full_stack
from util import check_nslookup
from util import get_credentials_for
from dbaas_dnsapi.models import DatabaseInfraDNSList
from dbaas_credentials.models import CredentialType
from ..base import BaseStep
from ....exceptions.error_codes import DBAAS_0005
... | Remove comment from check nslookup | Remove comment from check nslookup
| Python | bsd-3-clause | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | # -*- coding: utf-8 -*-
import logging
from util import full_stack
from util import check_nslookup
from util import get_credentials_for
from dbaas_dnsapi.models import DatabaseInfraDNSList
from dbaas_credentials.models import CredentialType
from ..base import BaseStep
from ....exceptions.error_codes import DBAAS_0005
... | # -*- coding: utf-8 -*-
import logging
from util import full_stack
from util import check_nslookup
from util import get_credentials_for
from dbaas_dnsapi.models import DatabaseInfraDNSList
from dbaas_credentials.models import CredentialType
from ..base import BaseStep
from ....exceptions.error_codes import DBAAS_0005
... | <commit_before># -*- coding: utf-8 -*-
import logging
from util import full_stack
from util import check_nslookup
from util import get_credentials_for
from dbaas_dnsapi.models import DatabaseInfraDNSList
from dbaas_credentials.models import CredentialType
from ..base import BaseStep
from ....exceptions.error_codes impo... | # -*- coding: utf-8 -*-
import logging
from util import full_stack
from util import check_nslookup
from util import get_credentials_for
from dbaas_dnsapi.models import DatabaseInfraDNSList
from dbaas_credentials.models import CredentialType
from ..base import BaseStep
from ....exceptions.error_codes import DBAAS_0005
... | # -*- coding: utf-8 -*-
import logging
from util import full_stack
from util import check_nslookup
from util import get_credentials_for
from dbaas_dnsapi.models import DatabaseInfraDNSList
from dbaas_credentials.models import CredentialType
from ..base import BaseStep
from ....exceptions.error_codes import DBAAS_0005
... | <commit_before># -*- coding: utf-8 -*-
import logging
from util import full_stack
from util import check_nslookup
from util import get_credentials_for
from dbaas_dnsapi.models import DatabaseInfraDNSList
from dbaas_credentials.models import CredentialType
from ..base import BaseStep
from ....exceptions.error_codes impo... |
d2b4ec50442a00df85ef525cc82aca971b72eb86 | erpnext/patches/v11_0/rename_field_max_days_allowed.py | erpnext/patches/v11_0/rename_field_max_days_allowed.py | import frappe
from frappe.model.utils.rename_field import rename_field
def execute():
frappe.reload_doc("hr", "doctype", "leave_type")
frappe.db.sql_ddl("""ALTER table `tabLeave Type` modify max_days_allowed int(8) NOT NULL""")
rename_field("Leave Type", "max_days_allowed", "max_continuous_days_allowed")
| import frappe
def execute():
frappe.db.sql("""
UPDATE `tabLeave Type`
SET max_days_allowed = '0'
WHERE trim(coalesce(max_days_allowed, '')) = ''
""")
frappe.db.sql_ddl("""ALTER table `tabLeave Type` modify max_days_allowed int(8) NOT NULL""")
| Set null values to '0' before changing column type | [fix] Set null values to '0' before changing column type
| Python | agpl-3.0 | gsnbng/erpnext,gsnbng/erpnext,gsnbng/erpnext,gsnbng/erpnext | import frappe
from frappe.model.utils.rename_field import rename_field
def execute():
frappe.reload_doc("hr", "doctype", "leave_type")
frappe.db.sql_ddl("""ALTER table `tabLeave Type` modify max_days_allowed int(8) NOT NULL""")
rename_field("Leave Type", "max_days_allowed", "max_continuous_days_allowed")
[fix] Set... | import frappe
def execute():
frappe.db.sql("""
UPDATE `tabLeave Type`
SET max_days_allowed = '0'
WHERE trim(coalesce(max_days_allowed, '')) = ''
""")
frappe.db.sql_ddl("""ALTER table `tabLeave Type` modify max_days_allowed int(8) NOT NULL""")
| <commit_before>import frappe
from frappe.model.utils.rename_field import rename_field
def execute():
frappe.reload_doc("hr", "doctype", "leave_type")
frappe.db.sql_ddl("""ALTER table `tabLeave Type` modify max_days_allowed int(8) NOT NULL""")
rename_field("Leave Type", "max_days_allowed", "max_continuous_days_allow... | import frappe
def execute():
frappe.db.sql("""
UPDATE `tabLeave Type`
SET max_days_allowed = '0'
WHERE trim(coalesce(max_days_allowed, '')) = ''
""")
frappe.db.sql_ddl("""ALTER table `tabLeave Type` modify max_days_allowed int(8) NOT NULL""")
| import frappe
from frappe.model.utils.rename_field import rename_field
def execute():
frappe.reload_doc("hr", "doctype", "leave_type")
frappe.db.sql_ddl("""ALTER table `tabLeave Type` modify max_days_allowed int(8) NOT NULL""")
rename_field("Leave Type", "max_days_allowed", "max_continuous_days_allowed")
[fix] Set... | <commit_before>import frappe
from frappe.model.utils.rename_field import rename_field
def execute():
frappe.reload_doc("hr", "doctype", "leave_type")
frappe.db.sql_ddl("""ALTER table `tabLeave Type` modify max_days_allowed int(8) NOT NULL""")
rename_field("Leave Type", "max_days_allowed", "max_continuous_days_allow... |
d3a2e344caa34f763f7e46710db5b9ddefe73c55 | doc/mkapidoc.py | doc/mkapidoc.py | #!/usr/bin/env python
# Generates the *public* API documentation.
# Remember to hide your private parts, people!
import os, re, sys
project = 'Exscript'
base_dir = os.path.join('..', 'src', project)
doc_dir = 'api'
# Create the documentation directory.
if not os.path.exists(doc_dir):
os.makedirs(doc_dir)
# Gen... | #!/usr/bin/env python
# Generates the *public* API documentation.
# Remember to hide your private parts, people!
import os, re, sys
project = 'Exscript'
base_dir = os.path.join('..', 'src', project)
doc_dir = 'api'
# Create the documentation directory.
if not os.path.exists(doc_dir):
os.makedirs(doc_dir)
# Gen... | Hide StreamAnalyzer and OsGuesser from the API docs. | Hide StreamAnalyzer and OsGuesser from the API docs.
| Python | mit | maximumG/exscript,knipknap/exscript,knipknap/exscript,maximumG/exscript | #!/usr/bin/env python
# Generates the *public* API documentation.
# Remember to hide your private parts, people!
import os, re, sys
project = 'Exscript'
base_dir = os.path.join('..', 'src', project)
doc_dir = 'api'
# Create the documentation directory.
if not os.path.exists(doc_dir):
os.makedirs(doc_dir)
# Gen... | #!/usr/bin/env python
# Generates the *public* API documentation.
# Remember to hide your private parts, people!
import os, re, sys
project = 'Exscript'
base_dir = os.path.join('..', 'src', project)
doc_dir = 'api'
# Create the documentation directory.
if not os.path.exists(doc_dir):
os.makedirs(doc_dir)
# Gen... | <commit_before>#!/usr/bin/env python
# Generates the *public* API documentation.
# Remember to hide your private parts, people!
import os, re, sys
project = 'Exscript'
base_dir = os.path.join('..', 'src', project)
doc_dir = 'api'
# Create the documentation directory.
if not os.path.exists(doc_dir):
os.makedirs(... | #!/usr/bin/env python
# Generates the *public* API documentation.
# Remember to hide your private parts, people!
import os, re, sys
project = 'Exscript'
base_dir = os.path.join('..', 'src', project)
doc_dir = 'api'
# Create the documentation directory.
if not os.path.exists(doc_dir):
os.makedirs(doc_dir)
# Gen... | #!/usr/bin/env python
# Generates the *public* API documentation.
# Remember to hide your private parts, people!
import os, re, sys
project = 'Exscript'
base_dir = os.path.join('..', 'src', project)
doc_dir = 'api'
# Create the documentation directory.
if not os.path.exists(doc_dir):
os.makedirs(doc_dir)
# Gen... | <commit_before>#!/usr/bin/env python
# Generates the *public* API documentation.
# Remember to hide your private parts, people!
import os, re, sys
project = 'Exscript'
base_dir = os.path.join('..', 'src', project)
doc_dir = 'api'
# Create the documentation directory.
if not os.path.exists(doc_dir):
os.makedirs(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.