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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1b44d54c7f1af5e7dca1ca5c05e4e248c180ccb3 | students/models.py | students/models.py | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
class WhitelistedUsername(models.Model):
# TODO: change this username field to only allow usernames matching the UCT
# student number regex
username = models.CharField(max_length=50)
def ... | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
class WhitelistedUsername(models.Model):
# TODO: change this username field to only allow usernames matching the UCT
# student number regex
username = models.CharField(max_length=50)
def ... | Add __str__ method to pretty print the Booking model. | Add __str__ method to pretty print the Booking model.
| Python | mit | muhummadPatel/raspied,muhummadPatel/raspied,muhummadPatel/raspied | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
class WhitelistedUsername(models.Model):
# TODO: change this username field to only allow usernames matching the UCT
# student number regex
username = models.CharField(max_length=50)
def ... | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
class WhitelistedUsername(models.Model):
# TODO: change this username field to only allow usernames matching the UCT
# student number regex
username = models.CharField(max_length=50)
def ... | <commit_before>from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
class WhitelistedUsername(models.Model):
# TODO: change this username field to only allow usernames matching the UCT
# student number regex
username = models.CharField(max_lengt... | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
class WhitelistedUsername(models.Model):
# TODO: change this username field to only allow usernames matching the UCT
# student number regex
username = models.CharField(max_length=50)
def ... | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
class WhitelistedUsername(models.Model):
# TODO: change this username field to only allow usernames matching the UCT
# student number regex
username = models.CharField(max_length=50)
def ... | <commit_before>from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
class WhitelistedUsername(models.Model):
# TODO: change this username field to only allow usernames matching the UCT
# student number regex
username = models.CharField(max_lengt... |
2f57fd6422c68657b10b0b26118b9598f30cb27a | dash/orgs/migrations/0019_resctructure_org_config.py | dash/orgs/migrations/0019_resctructure_org_config.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-03-07 08:24
from __future__ import unicode_literals
import json
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('orgs', '0018_auto_20170301_0914'),
]
def migrate_api_token_and_common_org_conf... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-03-07 08:24
from __future__ import unicode_literals
import json
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('orgs', '0018_auto_20170301_0914'),
]
def migrate_api_token_and_common_org_conf... | Check config if not null in migrations | Check config if not null in migrations
| Python | bsd-3-clause | rapidpro/dash,rapidpro/dash | # -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-03-07 08:24
from __future__ import unicode_literals
import json
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('orgs', '0018_auto_20170301_0914'),
]
def migrate_api_token_and_common_org_conf... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-03-07 08:24
from __future__ import unicode_literals
import json
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('orgs', '0018_auto_20170301_0914'),
]
def migrate_api_token_and_common_org_conf... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-03-07 08:24
from __future__ import unicode_literals
import json
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('orgs', '0018_auto_20170301_0914'),
]
def migrate_api_token_and_... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-03-07 08:24
from __future__ import unicode_literals
import json
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('orgs', '0018_auto_20170301_0914'),
]
def migrate_api_token_and_common_org_conf... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-03-07 08:24
from __future__ import unicode_literals
import json
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('orgs', '0018_auto_20170301_0914'),
]
def migrate_api_token_and_common_org_conf... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-03-07 08:24
from __future__ import unicode_literals
import json
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('orgs', '0018_auto_20170301_0914'),
]
def migrate_api_token_and_... |
e45005c72cecd54a40e57a3aef92a3fc353f5227 | flask_limiter/errors.py | flask_limiter/errors.py | """errors and exceptions."""
from flask.wrappers import Response
from werkzeug import exceptions
from .typing import Optional
from .wrappers import Limit
class RateLimitExceeded(exceptions.TooManyRequests):
"""Exception raised when a rate limit is hit."""
def __init__(self, limit: Limit, response: Optional... | """errors and exceptions."""
from flask.wrappers import Response
from werkzeug import exceptions
from .typing import Optional
from .wrappers import Limit
class RateLimitExceeded(exceptions.TooManyRequests):
"""Exception raised when a rate limit is hit."""
def __init__(self, limit: Limit, response: Optional... | Fix missing default value for RateLimitExceeded constructor | Fix missing default value for RateLimitExceeded constructor
| Python | mit | alisaifee/flask-limiter,alisaifee/flask-limiter | """errors and exceptions."""
from flask.wrappers import Response
from werkzeug import exceptions
from .typing import Optional
from .wrappers import Limit
class RateLimitExceeded(exceptions.TooManyRequests):
"""Exception raised when a rate limit is hit."""
def __init__(self, limit: Limit, response: Optional... | """errors and exceptions."""
from flask.wrappers import Response
from werkzeug import exceptions
from .typing import Optional
from .wrappers import Limit
class RateLimitExceeded(exceptions.TooManyRequests):
"""Exception raised when a rate limit is hit."""
def __init__(self, limit: Limit, response: Optional... | <commit_before>"""errors and exceptions."""
from flask.wrappers import Response
from werkzeug import exceptions
from .typing import Optional
from .wrappers import Limit
class RateLimitExceeded(exceptions.TooManyRequests):
"""Exception raised when a rate limit is hit."""
def __init__(self, limit: Limit, res... | """errors and exceptions."""
from flask.wrappers import Response
from werkzeug import exceptions
from .typing import Optional
from .wrappers import Limit
class RateLimitExceeded(exceptions.TooManyRequests):
"""Exception raised when a rate limit is hit."""
def __init__(self, limit: Limit, response: Optional... | """errors and exceptions."""
from flask.wrappers import Response
from werkzeug import exceptions
from .typing import Optional
from .wrappers import Limit
class RateLimitExceeded(exceptions.TooManyRequests):
"""Exception raised when a rate limit is hit."""
def __init__(self, limit: Limit, response: Optional... | <commit_before>"""errors and exceptions."""
from flask.wrappers import Response
from werkzeug import exceptions
from .typing import Optional
from .wrappers import Limit
class RateLimitExceeded(exceptions.TooManyRequests):
"""Exception raised when a rate limit is hit."""
def __init__(self, limit: Limit, res... |
47c6c9b4c7d0b86bc47ac0177d8f91e7bf4c72fe | akwriters/urls.py | akwriters/urls.py | from django.urls import include, path
from django.contrib import admin
from django.views.generic import TemplateView
urlpatterns = [
# Examples:
# url(r'^$', 'akwriters.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
path('', TemplateView.as_view(template_name='index.html'), name='i... | from django.urls import include, path
from django.contrib import admin
from django.views.generic import TemplateView,RedirectView
urlpatterns = [
# Examples:
# url(r'^$', 'akwriters.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
path('', RedirectView.as_view(pattern_name='forum:ind... | Bring the forum to the foreground | Bring the forum to the foreground
The default landing page is now the forum, to hopefully encourage people to use it
| Python | mit | Kromey/fbxnano,Kromey/akwriters,Kromey/fbxnano,Kromey/akwriters,Kromey/fbxnano,Kromey/akwriters,Kromey/fbxnano,Kromey/akwriters | from django.urls import include, path
from django.contrib import admin
from django.views.generic import TemplateView
urlpatterns = [
# Examples:
# url(r'^$', 'akwriters.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
path('', TemplateView.as_view(template_name='index.html'), name='i... | from django.urls import include, path
from django.contrib import admin
from django.views.generic import TemplateView,RedirectView
urlpatterns = [
# Examples:
# url(r'^$', 'akwriters.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
path('', RedirectView.as_view(pattern_name='forum:ind... | <commit_before>from django.urls import include, path
from django.contrib import admin
from django.views.generic import TemplateView
urlpatterns = [
# Examples:
# url(r'^$', 'akwriters.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
path('', TemplateView.as_view(template_name='index.... | from django.urls import include, path
from django.contrib import admin
from django.views.generic import TemplateView,RedirectView
urlpatterns = [
# Examples:
# url(r'^$', 'akwriters.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
path('', RedirectView.as_view(pattern_name='forum:ind... | from django.urls import include, path
from django.contrib import admin
from django.views.generic import TemplateView
urlpatterns = [
# Examples:
# url(r'^$', 'akwriters.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
path('', TemplateView.as_view(template_name='index.html'), name='i... | <commit_before>from django.urls import include, path
from django.contrib import admin
from django.views.generic import TemplateView
urlpatterns = [
# Examples:
# url(r'^$', 'akwriters.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
path('', TemplateView.as_view(template_name='index.... |
9fd4c69ac1dc4644c35687423dd4fe3e2f73fe63 | mistral/tests/unit/engine/actions/test_fake_action.py | mistral/tests/unit/engine/actions/test_fake_action.py | # -*- coding: utf-8 -*-
#
# Copyright 2013 - StackStorm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | # -*- coding: utf-8 -*-
#
# Copyright 2013 - StackStorm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | Correct fake action test name | Correct fake action test name
Change-Id: Ibb2322139fd8d7f3365d3522afde622def910fe9
| Python | apache-2.0 | openstack/mistral,StackStorm/mistral,TimurNurlygayanov/mistral,dennybaa/mistral,openstack/mistral,StackStorm/mistral,dennybaa/mistral | # -*- coding: utf-8 -*-
#
# Copyright 2013 - StackStorm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | # -*- coding: utf-8 -*-
#
# Copyright 2013 - StackStorm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | <commit_before># -*- coding: utf-8 -*-
#
# Copyright 2013 - StackStorm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | # -*- coding: utf-8 -*-
#
# Copyright 2013 - StackStorm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | # -*- coding: utf-8 -*-
#
# Copyright 2013 - StackStorm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | <commit_before># -*- coding: utf-8 -*-
#
# Copyright 2013 - StackStorm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... |
784136c8e04c67ae5a6f4b027096ee94b4c57ee9 | py_naca0020_3d_openfoam/processing.py | py_naca0020_3d_openfoam/processing.py | """
This module contains processing functions.
"""
import numpy as np
import pandas as pd
import os
def load_force_coeffs(steady=False):
"""
Load force coefficients from file. If steady, the file from the `0`
directory is used, and the last values are returned. Otherwise, arrays are
loaded from the la... | """
This module contains processing functions.
"""
import numpy as np
import pandas as pd
import os
def load_force_coeffs(steady=False):
"""
Load force coefficients from file. If steady, the file from the `0`
directory is used, and the last values are returned. Otherwise, arrays are
loaded from the la... | Add function for loading sampled set | Add function for loading sampled set
| Python | mit | petebachant/actuatorLine-3D-turbinesFoam,petebachant/NACA0020-3D-OpenFOAM,petebachant/NACA0020-3D-OpenFOAM,petebachant/NACA0020-3D-OpenFOAM,petebachant/actuatorLine-3D-turbinesFoam,petebachant/actuatorLine-3D-turbinesFoam | """
This module contains processing functions.
"""
import numpy as np
import pandas as pd
import os
def load_force_coeffs(steady=False):
"""
Load force coefficients from file. If steady, the file from the `0`
directory is used, and the last values are returned. Otherwise, arrays are
loaded from the la... | """
This module contains processing functions.
"""
import numpy as np
import pandas as pd
import os
def load_force_coeffs(steady=False):
"""
Load force coefficients from file. If steady, the file from the `0`
directory is used, and the last values are returned. Otherwise, arrays are
loaded from the la... | <commit_before>"""
This module contains processing functions.
"""
import numpy as np
import pandas as pd
import os
def load_force_coeffs(steady=False):
"""
Load force coefficients from file. If steady, the file from the `0`
directory is used, and the last values are returned. Otherwise, arrays are
loa... | """
This module contains processing functions.
"""
import numpy as np
import pandas as pd
import os
def load_force_coeffs(steady=False):
"""
Load force coefficients from file. If steady, the file from the `0`
directory is used, and the last values are returned. Otherwise, arrays are
loaded from the la... | """
This module contains processing functions.
"""
import numpy as np
import pandas as pd
import os
def load_force_coeffs(steady=False):
"""
Load force coefficients from file. If steady, the file from the `0`
directory is used, and the last values are returned. Otherwise, arrays are
loaded from the la... | <commit_before>"""
This module contains processing functions.
"""
import numpy as np
import pandas as pd
import os
def load_force_coeffs(steady=False):
"""
Load force coefficients from file. If steady, the file from the `0`
directory is used, and the last values are returned. Otherwise, arrays are
loa... |
fb0f5e5e9ae0473bed1387bd4151055614b2d5c5 | alerte_blanche.py | alerte_blanche.py | import os
from flask import Flask
from flask import jsonify
from flask import request
app = Flask(__name__)
FLASK_DEBUG = os.environ.get('FLASK_DEBUG', False)
@app.route("/version")
def ping():
version_dict = {
"version": "0.0.1",
"debug": bool(FLASK_DEBUG),
}
return jsonify(version_d... | import os
from flask import Flask
from flask import jsonify
from flask import request
from flask import session
app = Flask(__name__)
app.secret_key = b'\xb5\xf2v\xba\x8d\x1b\x86\xabO\xc9\x8e\x1a<m\x17mC1\xf4<\x18\xbeR\xd1'
FLASK_DEBUG = os.environ.get('FLASK_DEBUG', False)
USERS = [{
"id": 1,
"email": "... | Add dummy implementation for login" | Add dummy implementation for login"
| Python | mit | HackQC2017-BoltTeam/alerte-blanche-api | import os
from flask import Flask
from flask import jsonify
from flask import request
app = Flask(__name__)
FLASK_DEBUG = os.environ.get('FLASK_DEBUG', False)
@app.route("/version")
def ping():
version_dict = {
"version": "0.0.1",
"debug": bool(FLASK_DEBUG),
}
return jsonify(version_d... | import os
from flask import Flask
from flask import jsonify
from flask import request
from flask import session
app = Flask(__name__)
app.secret_key = b'\xb5\xf2v\xba\x8d\x1b\x86\xabO\xc9\x8e\x1a<m\x17mC1\xf4<\x18\xbeR\xd1'
FLASK_DEBUG = os.environ.get('FLASK_DEBUG', False)
USERS = [{
"id": 1,
"email": "... | <commit_before>import os
from flask import Flask
from flask import jsonify
from flask import request
app = Flask(__name__)
FLASK_DEBUG = os.environ.get('FLASK_DEBUG', False)
@app.route("/version")
def ping():
version_dict = {
"version": "0.0.1",
"debug": bool(FLASK_DEBUG),
}
return js... | import os
from flask import Flask
from flask import jsonify
from flask import request
from flask import session
app = Flask(__name__)
app.secret_key = b'\xb5\xf2v\xba\x8d\x1b\x86\xabO\xc9\x8e\x1a<m\x17mC1\xf4<\x18\xbeR\xd1'
FLASK_DEBUG = os.environ.get('FLASK_DEBUG', False)
USERS = [{
"id": 1,
"email": "... | import os
from flask import Flask
from flask import jsonify
from flask import request
app = Flask(__name__)
FLASK_DEBUG = os.environ.get('FLASK_DEBUG', False)
@app.route("/version")
def ping():
version_dict = {
"version": "0.0.1",
"debug": bool(FLASK_DEBUG),
}
return jsonify(version_d... | <commit_before>import os
from flask import Flask
from flask import jsonify
from flask import request
app = Flask(__name__)
FLASK_DEBUG = os.environ.get('FLASK_DEBUG', False)
@app.route("/version")
def ping():
version_dict = {
"version": "0.0.1",
"debug": bool(FLASK_DEBUG),
}
return js... |
6d23f3bd1ccd45a6e739264e8d041282e6baaf0b | hassio/dock/util.py | hassio/dock/util.py | """HassIO docker utilitys."""
import re
from ..const import ARCH_AARCH64, ARCH_ARMHF, ARCH_I386, ARCH_AMD64
RESIN_BASE_IMAGE = {
ARCH_ARMHF: "resin/armhf-alpine:3.5",
ARCH_AARCH64: "resin/aarch64-alpine:3.5",
ARCH_I386: "resin/i386-alpine:3.5",
ARCH_AMD64: "resin/amd64-alpine:3.5",
}
TMPL_IMAGE = re... | """HassIO docker utilitys."""
import re
from ..const import ARCH_AARCH64, ARCH_ARMHF, ARCH_I386, ARCH_AMD64
RESIN_BASE_IMAGE = {
ARCH_ARMHF: "homeassistant/armhf-base:latest",
ARCH_AARCH64: "homeassistant/aarch64-base:latest",
ARCH_I386: "homeassistant/i386-base:latest",
ARCH_AMD64: "homeassistant/am... | Use our new base image | Use our new base image | Python | bsd-3-clause | pvizeli/hassio,pvizeli/hassio | """HassIO docker utilitys."""
import re
from ..const import ARCH_AARCH64, ARCH_ARMHF, ARCH_I386, ARCH_AMD64
RESIN_BASE_IMAGE = {
ARCH_ARMHF: "resin/armhf-alpine:3.5",
ARCH_AARCH64: "resin/aarch64-alpine:3.5",
ARCH_I386: "resin/i386-alpine:3.5",
ARCH_AMD64: "resin/amd64-alpine:3.5",
}
TMPL_IMAGE = re... | """HassIO docker utilitys."""
import re
from ..const import ARCH_AARCH64, ARCH_ARMHF, ARCH_I386, ARCH_AMD64
RESIN_BASE_IMAGE = {
ARCH_ARMHF: "homeassistant/armhf-base:latest",
ARCH_AARCH64: "homeassistant/aarch64-base:latest",
ARCH_I386: "homeassistant/i386-base:latest",
ARCH_AMD64: "homeassistant/am... | <commit_before>"""HassIO docker utilitys."""
import re
from ..const import ARCH_AARCH64, ARCH_ARMHF, ARCH_I386, ARCH_AMD64
RESIN_BASE_IMAGE = {
ARCH_ARMHF: "resin/armhf-alpine:3.5",
ARCH_AARCH64: "resin/aarch64-alpine:3.5",
ARCH_I386: "resin/i386-alpine:3.5",
ARCH_AMD64: "resin/amd64-alpine:3.5",
}
... | """HassIO docker utilitys."""
import re
from ..const import ARCH_AARCH64, ARCH_ARMHF, ARCH_I386, ARCH_AMD64
RESIN_BASE_IMAGE = {
ARCH_ARMHF: "homeassistant/armhf-base:latest",
ARCH_AARCH64: "homeassistant/aarch64-base:latest",
ARCH_I386: "homeassistant/i386-base:latest",
ARCH_AMD64: "homeassistant/am... | """HassIO docker utilitys."""
import re
from ..const import ARCH_AARCH64, ARCH_ARMHF, ARCH_I386, ARCH_AMD64
RESIN_BASE_IMAGE = {
ARCH_ARMHF: "resin/armhf-alpine:3.5",
ARCH_AARCH64: "resin/aarch64-alpine:3.5",
ARCH_I386: "resin/i386-alpine:3.5",
ARCH_AMD64: "resin/amd64-alpine:3.5",
}
TMPL_IMAGE = re... | <commit_before>"""HassIO docker utilitys."""
import re
from ..const import ARCH_AARCH64, ARCH_ARMHF, ARCH_I386, ARCH_AMD64
RESIN_BASE_IMAGE = {
ARCH_ARMHF: "resin/armhf-alpine:3.5",
ARCH_AARCH64: "resin/aarch64-alpine:3.5",
ARCH_I386: "resin/i386-alpine:3.5",
ARCH_AMD64: "resin/amd64-alpine:3.5",
}
... |
6f0dc07d16162095553590a3fc66f1c90098cf88 | config_sample.py | config_sample.py | # App
APP_NAME = 'uchan'
SITE_NAME = 'µchan'
SITE_URL = 'http://127.0.0.1'
DEBUG = True
DEFAULT_NAME = 'Anonymous'
SHOW_BOARDS_AT_TOP = True
# Flask
DATABASE_CONNECT_STRING = 'postgresql+psycopg2://postgres:postgres@127.0.0.1:5432/unichan'
DATABASE_POOL_SIZE = 5
# Generate with `import os` `os.urandom(32)`
SECRET_KE... | # App
APP_NAME = 'uchan'
SITE_NAME = 'µchan'
SITE_URL = 'http://127.0.0.1'
DEBUG = True
# Flask
DATABASE_CONNECT_STRING = 'postgresql+psycopg2://postgres:postgres@127.0.0.1:5432/unichan'
DATABASE_POOL_SIZE = 5
# Generate with `import os` `os.urandom(32)`
SECRET_KEY = None
| Update config sample to remove unused config items | Update config sample to remove unused config items
| Python | mit | Floens/uchan,Floens/uchan,Floens/uchan,Floens/uchan,Floens/uchan | # App
APP_NAME = 'uchan'
SITE_NAME = 'µchan'
SITE_URL = 'http://127.0.0.1'
DEBUG = True
DEFAULT_NAME = 'Anonymous'
SHOW_BOARDS_AT_TOP = True
# Flask
DATABASE_CONNECT_STRING = 'postgresql+psycopg2://postgres:postgres@127.0.0.1:5432/unichan'
DATABASE_POOL_SIZE = 5
# Generate with `import os` `os.urandom(32)`
SECRET_KE... | # App
APP_NAME = 'uchan'
SITE_NAME = 'µchan'
SITE_URL = 'http://127.0.0.1'
DEBUG = True
# Flask
DATABASE_CONNECT_STRING = 'postgresql+psycopg2://postgres:postgres@127.0.0.1:5432/unichan'
DATABASE_POOL_SIZE = 5
# Generate with `import os` `os.urandom(32)`
SECRET_KEY = None
| <commit_before># App
APP_NAME = 'uchan'
SITE_NAME = 'µchan'
SITE_URL = 'http://127.0.0.1'
DEBUG = True
DEFAULT_NAME = 'Anonymous'
SHOW_BOARDS_AT_TOP = True
# Flask
DATABASE_CONNECT_STRING = 'postgresql+psycopg2://postgres:postgres@127.0.0.1:5432/unichan'
DATABASE_POOL_SIZE = 5
# Generate with `import os` `os.urandom... | # App
APP_NAME = 'uchan'
SITE_NAME = 'µchan'
SITE_URL = 'http://127.0.0.1'
DEBUG = True
# Flask
DATABASE_CONNECT_STRING = 'postgresql+psycopg2://postgres:postgres@127.0.0.1:5432/unichan'
DATABASE_POOL_SIZE = 5
# Generate with `import os` `os.urandom(32)`
SECRET_KEY = None
| # App
APP_NAME = 'uchan'
SITE_NAME = 'µchan'
SITE_URL = 'http://127.0.0.1'
DEBUG = True
DEFAULT_NAME = 'Anonymous'
SHOW_BOARDS_AT_TOP = True
# Flask
DATABASE_CONNECT_STRING = 'postgresql+psycopg2://postgres:postgres@127.0.0.1:5432/unichan'
DATABASE_POOL_SIZE = 5
# Generate with `import os` `os.urandom(32)`
SECRET_KE... | <commit_before># App
APP_NAME = 'uchan'
SITE_NAME = 'µchan'
SITE_URL = 'http://127.0.0.1'
DEBUG = True
DEFAULT_NAME = 'Anonymous'
SHOW_BOARDS_AT_TOP = True
# Flask
DATABASE_CONNECT_STRING = 'postgresql+psycopg2://postgres:postgres@127.0.0.1:5432/unichan'
DATABASE_POOL_SIZE = 5
# Generate with `import os` `os.urandom... |
21d062ef148b75d00dba6c2873a627e87723e93b | PyFVCOM/__init__.py | PyFVCOM/__init__.py | """
The FVCOM Python toolbox (PyFVCOM)
"""
__version__ = '2.1.3'
__author__ = 'Pierre Cazenave'
__credits__ = ['Pierre Cazenave', 'Michael Bedington', 'Ricardo Torres']
__license__ = 'MIT'
__maintainer__ = 'Pierre Cazenave'
__email__ = 'pica@pml.ac.uk'
import inspect
import sys
from warnings import warn
# Import ev... | """
The FVCOM Python toolbox (PyFVCOM)
"""
__version__ = '2.1.3'
__author__ = 'Pierre Cazenave'
__credits__ = ['Pierre Cazenave', 'Michael Bedington', 'Ricardo Torres']
__license__ = 'MIT'
__maintainer__ = 'Pierre Cazenave'
__email__ = 'pica@pml.ac.uk'
import inspect
import sys
from warnings import warn
# Import ev... | Remove the old coast import. | Remove the old coast import.
| Python | mit | pwcazenave/PyFVCOM | """
The FVCOM Python toolbox (PyFVCOM)
"""
__version__ = '2.1.3'
__author__ = 'Pierre Cazenave'
__credits__ = ['Pierre Cazenave', 'Michael Bedington', 'Ricardo Torres']
__license__ = 'MIT'
__maintainer__ = 'Pierre Cazenave'
__email__ = 'pica@pml.ac.uk'
import inspect
import sys
from warnings import warn
# Import ev... | """
The FVCOM Python toolbox (PyFVCOM)
"""
__version__ = '2.1.3'
__author__ = 'Pierre Cazenave'
__credits__ = ['Pierre Cazenave', 'Michael Bedington', 'Ricardo Torres']
__license__ = 'MIT'
__maintainer__ = 'Pierre Cazenave'
__email__ = 'pica@pml.ac.uk'
import inspect
import sys
from warnings import warn
# Import ev... | <commit_before>"""
The FVCOM Python toolbox (PyFVCOM)
"""
__version__ = '2.1.3'
__author__ = 'Pierre Cazenave'
__credits__ = ['Pierre Cazenave', 'Michael Bedington', 'Ricardo Torres']
__license__ = 'MIT'
__maintainer__ = 'Pierre Cazenave'
__email__ = 'pica@pml.ac.uk'
import inspect
import sys
from warnings import wa... | """
The FVCOM Python toolbox (PyFVCOM)
"""
__version__ = '2.1.3'
__author__ = 'Pierre Cazenave'
__credits__ = ['Pierre Cazenave', 'Michael Bedington', 'Ricardo Torres']
__license__ = 'MIT'
__maintainer__ = 'Pierre Cazenave'
__email__ = 'pica@pml.ac.uk'
import inspect
import sys
from warnings import warn
# Import ev... | """
The FVCOM Python toolbox (PyFVCOM)
"""
__version__ = '2.1.3'
__author__ = 'Pierre Cazenave'
__credits__ = ['Pierre Cazenave', 'Michael Bedington', 'Ricardo Torres']
__license__ = 'MIT'
__maintainer__ = 'Pierre Cazenave'
__email__ = 'pica@pml.ac.uk'
import inspect
import sys
from warnings import warn
# Import ev... | <commit_before>"""
The FVCOM Python toolbox (PyFVCOM)
"""
__version__ = '2.1.3'
__author__ = 'Pierre Cazenave'
__credits__ = ['Pierre Cazenave', 'Michael Bedington', 'Ricardo Torres']
__license__ = 'MIT'
__maintainer__ = 'Pierre Cazenave'
__email__ = 'pica@pml.ac.uk'
import inspect
import sys
from warnings import wa... |
d1c18841d8a028f76283b9779da61d482df75973 | plumeria/plugins/youtube.py | plumeria/plugins/youtube.py | from plumeria.api.youtube import YouTube
from plumeria.command import commands, CommandError, channel_only
from plumeria.message import Response
from plumeria.util.ratelimit import rate_limit
youtube = YouTube()
@commands.register('youtube', 'yt', 'ytsearch', cost=2, category='Search')
@channel_only
@rate_limit()
as... | from plumeria.api.youtube import YouTube
from plumeria.command import commands, CommandError, channel_only
from plumeria.message import Response
from plumeria.util.ratelimit import rate_limit
youtube = YouTube()
@commands.register('youtube', 'yt', 'ytsearch', cost=2, category='Search')
@rate_limit()
async def yt(mes... | Allow YouTube plugin to be used in PMs. | Allow YouTube plugin to be used in PMs.
| Python | mit | sk89q/Plumeria,sk89q/Plumeria,sk89q/Plumeria | from plumeria.api.youtube import YouTube
from plumeria.command import commands, CommandError, channel_only
from plumeria.message import Response
from plumeria.util.ratelimit import rate_limit
youtube = YouTube()
@commands.register('youtube', 'yt', 'ytsearch', cost=2, category='Search')
@channel_only
@rate_limit()
as... | from plumeria.api.youtube import YouTube
from plumeria.command import commands, CommandError, channel_only
from plumeria.message import Response
from plumeria.util.ratelimit import rate_limit
youtube = YouTube()
@commands.register('youtube', 'yt', 'ytsearch', cost=2, category='Search')
@rate_limit()
async def yt(mes... | <commit_before>from plumeria.api.youtube import YouTube
from plumeria.command import commands, CommandError, channel_only
from plumeria.message import Response
from plumeria.util.ratelimit import rate_limit
youtube = YouTube()
@commands.register('youtube', 'yt', 'ytsearch', cost=2, category='Search')
@channel_only
@... | from plumeria.api.youtube import YouTube
from plumeria.command import commands, CommandError, channel_only
from plumeria.message import Response
from plumeria.util.ratelimit import rate_limit
youtube = YouTube()
@commands.register('youtube', 'yt', 'ytsearch', cost=2, category='Search')
@rate_limit()
async def yt(mes... | from plumeria.api.youtube import YouTube
from plumeria.command import commands, CommandError, channel_only
from plumeria.message import Response
from plumeria.util.ratelimit import rate_limit
youtube = YouTube()
@commands.register('youtube', 'yt', 'ytsearch', cost=2, category='Search')
@channel_only
@rate_limit()
as... | <commit_before>from plumeria.api.youtube import YouTube
from plumeria.command import commands, CommandError, channel_only
from plumeria.message import Response
from plumeria.util.ratelimit import rate_limit
youtube = YouTube()
@commands.register('youtube', 'yt', 'ytsearch', cost=2, category='Search')
@channel_only
@... |
96b4040e3508d55abf1857209e9820cff7ab3478 | geotrek/feedback/management/commands/erase_emails.py | geotrek/feedback/management/commands/erase_emails.py | import logging
from datetime import timedelta
from django.core.management.base import BaseCommand
from django.utils import timezone
from geotrek.feedback.models import Report
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = "Erase emails older than 1 year from feedbacks."
# def add_... | import logging
from datetime import timedelta
from django.core.management.base import BaseCommand
from django.utils import timezone
from geotrek.feedback.models import Report
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = "Erase emails older than 1 year from feedbacks."
def add_ar... | Add options dry-run mode and days | Add options dry-run mode and days
| Python | bsd-2-clause | makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin | import logging
from datetime import timedelta
from django.core.management.base import BaseCommand
from django.utils import timezone
from geotrek.feedback.models import Report
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = "Erase emails older than 1 year from feedbacks."
# def add_... | import logging
from datetime import timedelta
from django.core.management.base import BaseCommand
from django.utils import timezone
from geotrek.feedback.models import Report
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = "Erase emails older than 1 year from feedbacks."
def add_ar... | <commit_before>import logging
from datetime import timedelta
from django.core.management.base import BaseCommand
from django.utils import timezone
from geotrek.feedback.models import Report
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = "Erase emails older than 1 year from feedbacks."
... | import logging
from datetime import timedelta
from django.core.management.base import BaseCommand
from django.utils import timezone
from geotrek.feedback.models import Report
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = "Erase emails older than 1 year from feedbacks."
def add_ar... | import logging
from datetime import timedelta
from django.core.management.base import BaseCommand
from django.utils import timezone
from geotrek.feedback.models import Report
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = "Erase emails older than 1 year from feedbacks."
# def add_... | <commit_before>import logging
from datetime import timedelta
from django.core.management.base import BaseCommand
from django.utils import timezone
from geotrek.feedback.models import Report
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = "Erase emails older than 1 year from feedbacks."
... |
94cd1300a4ccf66488120092dfe880eabc7f06df | tests/test_dump.py | tests/test_dump.py | """ Testing gitwash dumper
"""
from os.path import join as pjoin, dirname, split as psplit
import shutil
from tempfile import mkdtemp
from subprocess import call
from nose.tools import assert_true, assert_equal, assert_raises
def test_dumper():
downpath, _ = psplit(dirname(__file__))
exe_pth = pjoin(downpat... | """ Testing gitwash dumper
"""
from os.path import join as pjoin, dirname, split as psplit
import shutil
from tempfile import mkdtemp
from subprocess import call
from nose.tools import assert_true, assert_equal, assert_raises
_downpath, _ = psplit(dirname(__file__))
EXE_PTH = pjoin(_downpath, 'gitwash_dumper.py')
TM... | TEST - setup teardown for test | TEST - setup teardown for test
| Python | bsd-2-clause | QuLogic/gitwash,QuLogic/gitwash | """ Testing gitwash dumper
"""
from os.path import join as pjoin, dirname, split as psplit
import shutil
from tempfile import mkdtemp
from subprocess import call
from nose.tools import assert_true, assert_equal, assert_raises
def test_dumper():
downpath, _ = psplit(dirname(__file__))
exe_pth = pjoin(downpat... | """ Testing gitwash dumper
"""
from os.path import join as pjoin, dirname, split as psplit
import shutil
from tempfile import mkdtemp
from subprocess import call
from nose.tools import assert_true, assert_equal, assert_raises
_downpath, _ = psplit(dirname(__file__))
EXE_PTH = pjoin(_downpath, 'gitwash_dumper.py')
TM... | <commit_before>""" Testing gitwash dumper
"""
from os.path import join as pjoin, dirname, split as psplit
import shutil
from tempfile import mkdtemp
from subprocess import call
from nose.tools import assert_true, assert_equal, assert_raises
def test_dumper():
downpath, _ = psplit(dirname(__file__))
exe_pth ... | """ Testing gitwash dumper
"""
from os.path import join as pjoin, dirname, split as psplit
import shutil
from tempfile import mkdtemp
from subprocess import call
from nose.tools import assert_true, assert_equal, assert_raises
_downpath, _ = psplit(dirname(__file__))
EXE_PTH = pjoin(_downpath, 'gitwash_dumper.py')
TM... | """ Testing gitwash dumper
"""
from os.path import join as pjoin, dirname, split as psplit
import shutil
from tempfile import mkdtemp
from subprocess import call
from nose.tools import assert_true, assert_equal, assert_raises
def test_dumper():
downpath, _ = psplit(dirname(__file__))
exe_pth = pjoin(downpat... | <commit_before>""" Testing gitwash dumper
"""
from os.path import join as pjoin, dirname, split as psplit
import shutil
from tempfile import mkdtemp
from subprocess import call
from nose.tools import assert_true, assert_equal, assert_raises
def test_dumper():
downpath, _ = psplit(dirname(__file__))
exe_pth ... |
8c9cc7f3e8d39007eab076c1bb34715d37716fc9 | tests/test_rmap.py | tests/test_rmap.py | from skrt.utils import rmap
def test_list():
list_ = [1, 2, 3, 4, 5]
assert rmap(list_, lambda x: x**2, int) == [1, 4, 9, 16, 25]
def test_tuple():
tuple_ = (1, 2, 3, 4, 5)
assert rmap(tuple_, lambda x: x**2, int) == (1, 4, 9, 16, 25)
def test_set():
set_ = {1, 2, 3, 4, 5}
assert rmap(set_... | from skrt.utils import rmap
def square(x):
return x ** 2
def test_list():
list_ = [1, 2, 3, 4, 5]
assert rmap(list_, square, int) == [1, 4, 9, 16, 25]
def test_tuple():
tuple_ = (1, 2, 3, 4, 5)
assert rmap(tuple_, square, int) == (1, 4, 9, 16, 25)
def test_set():
set_ = {1, 2, 3, 4, 5}
... | Add complex test for rmap | Add complex test for rmap
| Python | mit | nvander1/skrt | from skrt.utils import rmap
def test_list():
list_ = [1, 2, 3, 4, 5]
assert rmap(list_, lambda x: x**2, int) == [1, 4, 9, 16, 25]
def test_tuple():
tuple_ = (1, 2, 3, 4, 5)
assert rmap(tuple_, lambda x: x**2, int) == (1, 4, 9, 16, 25)
def test_set():
set_ = {1, 2, 3, 4, 5}
assert rmap(set_... | from skrt.utils import rmap
def square(x):
return x ** 2
def test_list():
list_ = [1, 2, 3, 4, 5]
assert rmap(list_, square, int) == [1, 4, 9, 16, 25]
def test_tuple():
tuple_ = (1, 2, 3, 4, 5)
assert rmap(tuple_, square, int) == (1, 4, 9, 16, 25)
def test_set():
set_ = {1, 2, 3, 4, 5}
... | <commit_before>from skrt.utils import rmap
def test_list():
list_ = [1, 2, 3, 4, 5]
assert rmap(list_, lambda x: x**2, int) == [1, 4, 9, 16, 25]
def test_tuple():
tuple_ = (1, 2, 3, 4, 5)
assert rmap(tuple_, lambda x: x**2, int) == (1, 4, 9, 16, 25)
def test_set():
set_ = {1, 2, 3, 4, 5}
a... | from skrt.utils import rmap
def square(x):
return x ** 2
def test_list():
list_ = [1, 2, 3, 4, 5]
assert rmap(list_, square, int) == [1, 4, 9, 16, 25]
def test_tuple():
tuple_ = (1, 2, 3, 4, 5)
assert rmap(tuple_, square, int) == (1, 4, 9, 16, 25)
def test_set():
set_ = {1, 2, 3, 4, 5}
... | from skrt.utils import rmap
def test_list():
list_ = [1, 2, 3, 4, 5]
assert rmap(list_, lambda x: x**2, int) == [1, 4, 9, 16, 25]
def test_tuple():
tuple_ = (1, 2, 3, 4, 5)
assert rmap(tuple_, lambda x: x**2, int) == (1, 4, 9, 16, 25)
def test_set():
set_ = {1, 2, 3, 4, 5}
assert rmap(set_... | <commit_before>from skrt.utils import rmap
def test_list():
list_ = [1, 2, 3, 4, 5]
assert rmap(list_, lambda x: x**2, int) == [1, 4, 9, 16, 25]
def test_tuple():
tuple_ = (1, 2, 3, 4, 5)
assert rmap(tuple_, lambda x: x**2, int) == (1, 4, 9, 16, 25)
def test_set():
set_ = {1, 2, 3, 4, 5}
a... |
00fe6161c7c26d25f52fa6cf374c3fd767cf7cf7 | conllu/compat.py | conllu/compat.py | from io import StringIO
try:
from contextlib import redirect_stdout
except ImportError:
import contextlib
import sys
@contextlib.contextmanager
def redirect_stdout(target):
original = sys.stdout
sys.stdout = target
yield
sys.stdout = original
def string_to_file(str... | from io import StringIO
from contextlib import redirect_stdout
def string_to_file(string):
return StringIO(text(string) if string else None)
def capture_print(func, args=None):
f = StringIO()
with redirect_stdout(f):
if args:
func(args)
else:
func()
return f.g... | Remove special case for redirect_stdout. | Remove special case for redirect_stdout.
| Python | mit | EmilStenstrom/conllu | from io import StringIO
try:
from contextlib import redirect_stdout
except ImportError:
import contextlib
import sys
@contextlib.contextmanager
def redirect_stdout(target):
original = sys.stdout
sys.stdout = target
yield
sys.stdout = original
def string_to_file(str... | from io import StringIO
from contextlib import redirect_stdout
def string_to_file(string):
return StringIO(text(string) if string else None)
def capture_print(func, args=None):
f = StringIO()
with redirect_stdout(f):
if args:
func(args)
else:
func()
return f.g... | <commit_before>from io import StringIO
try:
from contextlib import redirect_stdout
except ImportError:
import contextlib
import sys
@contextlib.contextmanager
def redirect_stdout(target):
original = sys.stdout
sys.stdout = target
yield
sys.stdout = original
def str... | from io import StringIO
from contextlib import redirect_stdout
def string_to_file(string):
return StringIO(text(string) if string else None)
def capture_print(func, args=None):
f = StringIO()
with redirect_stdout(f):
if args:
func(args)
else:
func()
return f.g... | from io import StringIO
try:
from contextlib import redirect_stdout
except ImportError:
import contextlib
import sys
@contextlib.contextmanager
def redirect_stdout(target):
original = sys.stdout
sys.stdout = target
yield
sys.stdout = original
def string_to_file(str... | <commit_before>from io import StringIO
try:
from contextlib import redirect_stdout
except ImportError:
import contextlib
import sys
@contextlib.contextmanager
def redirect_stdout(target):
original = sys.stdout
sys.stdout = target
yield
sys.stdout = original
def str... |
dc755e07516e1cbbcd01f01e8be59abf8f1a6329 | humfrey/update/management/commands/update_dataset.py | humfrey/update/management/commands/update_dataset.py | import base64
import datetime
import os
import pickle
from lxml import etree
import redis
from django.core.management.base import BaseCommand
from django.conf import settings
from humfrey.update.longliving.updater import Updater
class Command(BaseCommand):
def handle(self, *args, **options):
config_file... | import base64
import datetime
import os
import pickle
from lxml import etree
import redis
from django.core.management.base import BaseCommand
from django.conf import settings
from humfrey.update.longliving.updater import Updater
class Command(BaseCommand):
def handle(self, *args, **options):
config_file... | Update trigger can now be specified on the command line as the second argument, and the module can now be run as a script. | Update trigger can now be specified on the command line as the second argument, and the module can now be run as a script.
| Python | bsd-3-clause | ox-it/humfrey,ox-it/humfrey,ox-it/humfrey | import base64
import datetime
import os
import pickle
from lxml import etree
import redis
from django.core.management.base import BaseCommand
from django.conf import settings
from humfrey.update.longliving.updater import Updater
class Command(BaseCommand):
def handle(self, *args, **options):
config_file... | import base64
import datetime
import os
import pickle
from lxml import etree
import redis
from django.core.management.base import BaseCommand
from django.conf import settings
from humfrey.update.longliving.updater import Updater
class Command(BaseCommand):
def handle(self, *args, **options):
config_file... | <commit_before>import base64
import datetime
import os
import pickle
from lxml import etree
import redis
from django.core.management.base import BaseCommand
from django.conf import settings
from humfrey.update.longliving.updater import Updater
class Command(BaseCommand):
def handle(self, *args, **options):
... | import base64
import datetime
import os
import pickle
from lxml import etree
import redis
from django.core.management.base import BaseCommand
from django.conf import settings
from humfrey.update.longliving.updater import Updater
class Command(BaseCommand):
def handle(self, *args, **options):
config_file... | import base64
import datetime
import os
import pickle
from lxml import etree
import redis
from django.core.management.base import BaseCommand
from django.conf import settings
from humfrey.update.longliving.updater import Updater
class Command(BaseCommand):
def handle(self, *args, **options):
config_file... | <commit_before>import base64
import datetime
import os
import pickle
from lxml import etree
import redis
from django.core.management.base import BaseCommand
from django.conf import settings
from humfrey.update.longliving.updater import Updater
class Command(BaseCommand):
def handle(self, *args, **options):
... |
0c42fdc90e3d4dfcf0a1b353be1abbe34e820f85 | bills/tests.py | bills/tests.py | from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from opencivicdata.models import Bill, LegislativeSession, Person
from tot import settings
from preferences.models import Preferences
BILL_FULL_FIELDS = ('a... | from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from preferences.models import Preferences
class BillViewTests(StaticLiveServerTestCase):
fixtures = ['fl_testdata.json']
def setUp(self):
... | Remove failing test for now | Remove failing test for now
| Python | mit | jamesturk/tot,jamesturk/tot,jamesturk/tot,jamesturk/tot,jamesturk/tot | from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from opencivicdata.models import Bill, LegislativeSession, Person
from tot import settings
from preferences.models import Preferences
BILL_FULL_FIELDS = ('a... | from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from preferences.models import Preferences
class BillViewTests(StaticLiveServerTestCase):
fixtures = ['fl_testdata.json']
def setUp(self):
... | <commit_before>from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from opencivicdata.models import Bill, LegislativeSession, Person
from tot import settings
from preferences.models import Preferences
BILL_FU... | from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from preferences.models import Preferences
class BillViewTests(StaticLiveServerTestCase):
fixtures = ['fl_testdata.json']
def setUp(self):
... | from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from opencivicdata.models import Bill, LegislativeSession, Person
from tot import settings
from preferences.models import Preferences
BILL_FULL_FIELDS = ('a... | <commit_before>from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from opencivicdata.models import Bill, LegislativeSession, Person
from tot import settings
from preferences.models import Preferences
BILL_FU... |
e4ea9426a75828c6fce924b895ee3e4603595dc7 | tests/templates/components/test_radios_with_images.py | tests/templates/components/test_radios_with_images.py | import json
from importlib import metadata
from packaging.version import Version
def test_govuk_frontend_jinja_overrides_on_design_system_v3():
with open("package.json") as package_file:
package_json = json.load(package_file)
govuk_frontend_version = Version(package_json["dependencies"]["govuk-fr... | import json
from importlib import metadata
from packaging.version import Version
def test_govuk_frontend_jinja_overrides_on_design_system_v3():
with open("package.json") as package_file:
package_json = json.load(package_file)
govuk_frontend_version = Version(package_json["dependencies"]["govuk-fr... | Update test for GOVUK Frontend libraries parity | Update test for GOVUK Frontend libraries parity
| Python | mit | alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin | import json
from importlib import metadata
from packaging.version import Version
def test_govuk_frontend_jinja_overrides_on_design_system_v3():
with open("package.json") as package_file:
package_json = json.load(package_file)
govuk_frontend_version = Version(package_json["dependencies"]["govuk-fr... | import json
from importlib import metadata
from packaging.version import Version
def test_govuk_frontend_jinja_overrides_on_design_system_v3():
with open("package.json") as package_file:
package_json = json.load(package_file)
govuk_frontend_version = Version(package_json["dependencies"]["govuk-fr... | <commit_before>import json
from importlib import metadata
from packaging.version import Version
def test_govuk_frontend_jinja_overrides_on_design_system_v3():
with open("package.json") as package_file:
package_json = json.load(package_file)
govuk_frontend_version = Version(package_json["dependenc... | import json
from importlib import metadata
from packaging.version import Version
def test_govuk_frontend_jinja_overrides_on_design_system_v3():
with open("package.json") as package_file:
package_json = json.load(package_file)
govuk_frontend_version = Version(package_json["dependencies"]["govuk-fr... | import json
from importlib import metadata
from packaging.version import Version
def test_govuk_frontend_jinja_overrides_on_design_system_v3():
with open("package.json") as package_file:
package_json = json.load(package_file)
govuk_frontend_version = Version(package_json["dependencies"]["govuk-fr... | <commit_before>import json
from importlib import metadata
from packaging.version import Version
def test_govuk_frontend_jinja_overrides_on_design_system_v3():
with open("package.json") as package_file:
package_json = json.load(package_file)
govuk_frontend_version = Version(package_json["dependenc... |
e0ae123f3e1c17b112bbcc6020c661d252c0afd9 | tox_run_command.py | tox_run_command.py | import tox.config
from tox import hookimpl
def getargvlist(reader, command):
return tox.config._ArgvlistReader.getargvlist(reader, command)
@hookimpl
def tox_addoption(parser):
parser.add_argument('--run-command', help='run this command instead of configured commands')
@hookimpl
def tox_configure(config):... | import tox.config
from tox import hookimpl
def getargvlist(reader, command):
return tox.config._ArgvlistReader.getargvlist(reader, command)
@hookimpl
def tox_addoption(parser):
parser.add_argument('--run-command', help='run this command instead of configured commands')
@hookimpl
def tox_configure(config):... | Use the environment in envlist instead of the contant py27 | Use the environment in envlist instead of the contant py27
| Python | apache-2.0 | dstanek/tox-run-command | import tox.config
from tox import hookimpl
def getargvlist(reader, command):
return tox.config._ArgvlistReader.getargvlist(reader, command)
@hookimpl
def tox_addoption(parser):
parser.add_argument('--run-command', help='run this command instead of configured commands')
@hookimpl
def tox_configure(config):... | import tox.config
from tox import hookimpl
def getargvlist(reader, command):
return tox.config._ArgvlistReader.getargvlist(reader, command)
@hookimpl
def tox_addoption(parser):
parser.add_argument('--run-command', help='run this command instead of configured commands')
@hookimpl
def tox_configure(config):... | <commit_before>import tox.config
from tox import hookimpl
def getargvlist(reader, command):
return tox.config._ArgvlistReader.getargvlist(reader, command)
@hookimpl
def tox_addoption(parser):
parser.add_argument('--run-command', help='run this command instead of configured commands')
@hookimpl
def tox_con... | import tox.config
from tox import hookimpl
def getargvlist(reader, command):
return tox.config._ArgvlistReader.getargvlist(reader, command)
@hookimpl
def tox_addoption(parser):
parser.add_argument('--run-command', help='run this command instead of configured commands')
@hookimpl
def tox_configure(config):... | import tox.config
from tox import hookimpl
def getargvlist(reader, command):
return tox.config._ArgvlistReader.getargvlist(reader, command)
@hookimpl
def tox_addoption(parser):
parser.add_argument('--run-command', help='run this command instead of configured commands')
@hookimpl
def tox_configure(config):... | <commit_before>import tox.config
from tox import hookimpl
def getargvlist(reader, command):
return tox.config._ArgvlistReader.getargvlist(reader, command)
@hookimpl
def tox_addoption(parser):
parser.add_argument('--run-command', help='run this command instead of configured commands')
@hookimpl
def tox_con... |
8fdd6f8c2eb463b4d7bf9bb7372d141b97af8f1f | tviserrys/views.py | tviserrys/views.py | from django.http import HttpResponse, HttpResponseRedirect
from django.views.generic import View
from django.utils.decorators import method_decorator
from django.template import RequestContext, loader
from django.core.exceptions import PermissionDenied
from django.contrib.auth.decorators import login_required
from djan... | from django.http import HttpResponse, HttpResponseRedirect
from django.views.generic import View
from django.utils.decorators import method_decorator
from django.template import RequestContext, loader
from django.core.exceptions import PermissionDenied
from django.contrib.auth.decorators import login_required
from djan... | Add TviitForm into main View | Add TviitForm into main View
| Python | mit | DeWaster/Tviserrys,DeWaster/Tviserrys | from django.http import HttpResponse, HttpResponseRedirect
from django.views.generic import View
from django.utils.decorators import method_decorator
from django.template import RequestContext, loader
from django.core.exceptions import PermissionDenied
from django.contrib.auth.decorators import login_required
from djan... | from django.http import HttpResponse, HttpResponseRedirect
from django.views.generic import View
from django.utils.decorators import method_decorator
from django.template import RequestContext, loader
from django.core.exceptions import PermissionDenied
from django.contrib.auth.decorators import login_required
from djan... | <commit_before>from django.http import HttpResponse, HttpResponseRedirect
from django.views.generic import View
from django.utils.decorators import method_decorator
from django.template import RequestContext, loader
from django.core.exceptions import PermissionDenied
from django.contrib.auth.decorators import login_req... | from django.http import HttpResponse, HttpResponseRedirect
from django.views.generic import View
from django.utils.decorators import method_decorator
from django.template import RequestContext, loader
from django.core.exceptions import PermissionDenied
from django.contrib.auth.decorators import login_required
from djan... | from django.http import HttpResponse, HttpResponseRedirect
from django.views.generic import View
from django.utils.decorators import method_decorator
from django.template import RequestContext, loader
from django.core.exceptions import PermissionDenied
from django.contrib.auth.decorators import login_required
from djan... | <commit_before>from django.http import HttpResponse, HttpResponseRedirect
from django.views.generic import View
from django.utils.decorators import method_decorator
from django.template import RequestContext, loader
from django.core.exceptions import PermissionDenied
from django.contrib.auth.decorators import login_req... |
31b7ad0eaf4f74503a970e0cee303eb3bc5ea460 | charity_server.py | charity_server.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 30 01:14:12 2017
@author: colm
"""
from flask import Flask, jsonify
from parse_likecharity import refresh_charities
import threading
refresh_rate = 24 * 60 * 60 #Seconds
# variables that are accessible from anywhere
payload = {}
# lock to control... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 30 01:14:12 2017
@author: colm
"""
from flask import Flask, jsonify
from parse_likecharity import refresh_charities
import threading
from datetime import datetime
refresh_rate = 24 * 60 * 60 #Seconds
start_time = datetime.now()
# variables that a... | Switch to datetime based on calls for updates. | Switch to datetime based on calls for updates.
| Python | mit | colmcoughlan/alchemy-server | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 30 01:14:12 2017
@author: colm
"""
from flask import Flask, jsonify
from parse_likecharity import refresh_charities
import threading
refresh_rate = 24 * 60 * 60 #Seconds
# variables that are accessible from anywhere
payload = {}
# lock to control... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 30 01:14:12 2017
@author: colm
"""
from flask import Flask, jsonify
from parse_likecharity import refresh_charities
import threading
from datetime import datetime
refresh_rate = 24 * 60 * 60 #Seconds
start_time = datetime.now()
# variables that a... | <commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 30 01:14:12 2017
@author: colm
"""
from flask import Flask, jsonify
from parse_likecharity import refresh_charities
import threading
refresh_rate = 24 * 60 * 60 #Seconds
# variables that are accessible from anywhere
payload = {}
# ... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 30 01:14:12 2017
@author: colm
"""
from flask import Flask, jsonify
from parse_likecharity import refresh_charities
import threading
from datetime import datetime
refresh_rate = 24 * 60 * 60 #Seconds
start_time = datetime.now()
# variables that a... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 30 01:14:12 2017
@author: colm
"""
from flask import Flask, jsonify
from parse_likecharity import refresh_charities
import threading
refresh_rate = 24 * 60 * 60 #Seconds
# variables that are accessible from anywhere
payload = {}
# lock to control... | <commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 30 01:14:12 2017
@author: colm
"""
from flask import Flask, jsonify
from parse_likecharity import refresh_charities
import threading
refresh_rate = 24 * 60 * 60 #Seconds
# variables that are accessible from anywhere
payload = {}
# ... |
855c65b15b9490830e997fc2d8ce5c033eecbddb | logger.py | logger.py | #! /usr/bin/env python
# logger.py
"""Log the serial output from the Arduino to a text file.
"""
import sys
import serial
from datetime import datetime
def log_serial(filename, device='/dev/ttyACM0', baud=9600):
ser = serial.Serial(device, baud)
outfile = open(filename, 'w')
try:
while True:
... | #! /usr/bin/env python
# logger.py
"""Log the serial output from the Arduino to a text file.
"""
import sys
import serial
from datetime import datetime
def log_serial(filename, device='/dev/ttyACM0', baud=9600):
ser = serial.Serial(device, baud)
outfile = open(filename, 'a')
try:
while True:
... | Append instead of truncating log file | Append instead of truncating log file
| Python | mit | wapcaplet/ardiff | #! /usr/bin/env python
# logger.py
"""Log the serial output from the Arduino to a text file.
"""
import sys
import serial
from datetime import datetime
def log_serial(filename, device='/dev/ttyACM0', baud=9600):
ser = serial.Serial(device, baud)
outfile = open(filename, 'w')
try:
while True:
... | #! /usr/bin/env python
# logger.py
"""Log the serial output from the Arduino to a text file.
"""
import sys
import serial
from datetime import datetime
def log_serial(filename, device='/dev/ttyACM0', baud=9600):
ser = serial.Serial(device, baud)
outfile = open(filename, 'a')
try:
while True:
... | <commit_before>#! /usr/bin/env python
# logger.py
"""Log the serial output from the Arduino to a text file.
"""
import sys
import serial
from datetime import datetime
def log_serial(filename, device='/dev/ttyACM0', baud=9600):
ser = serial.Serial(device, baud)
outfile = open(filename, 'w')
try:
w... | #! /usr/bin/env python
# logger.py
"""Log the serial output from the Arduino to a text file.
"""
import sys
import serial
from datetime import datetime
def log_serial(filename, device='/dev/ttyACM0', baud=9600):
ser = serial.Serial(device, baud)
outfile = open(filename, 'a')
try:
while True:
... | #! /usr/bin/env python
# logger.py
"""Log the serial output from the Arduino to a text file.
"""
import sys
import serial
from datetime import datetime
def log_serial(filename, device='/dev/ttyACM0', baud=9600):
ser = serial.Serial(device, baud)
outfile = open(filename, 'w')
try:
while True:
... | <commit_before>#! /usr/bin/env python
# logger.py
"""Log the serial output from the Arduino to a text file.
"""
import sys
import serial
from datetime import datetime
def log_serial(filename, device='/dev/ttyACM0', baud=9600):
ser = serial.Serial(device, baud)
outfile = open(filename, 'w')
try:
w... |
f5ba363de4777e2d594261214913f5d480cb04b6 | Heuristics/AbstactHeuristic.py | Heuristics/AbstactHeuristic.py | from abc import ABC, abstractmethod
import random as random
class AbstractHeuristic(ABC):
@abstractmethod
def calculate(self, solution):
pass
def calculateCost(self, dataset, solution):
cost = 0
i = 0
cost += dataset.getValueXY(0, solution[0])
for i in range(0, ... | from abc import ABC, abstractmethod
import random as random
class AbstractHeuristic(ABC):
@abstractmethod
def calculate(self, solution):
pass
def calculateCost(self, dataset, solution):
cost = 0
i = 0
cost += dataset.getValueXY(0, solution[0])
for i in range(0, ... | Fix on function generate random solution | Fix on function generate random solution
| Python | mit | DiegoReiriz/MetaHeuristics,DiegoReiriz/MetaHeuristics | from abc import ABC, abstractmethod
import random as random
class AbstractHeuristic(ABC):
@abstractmethod
def calculate(self, solution):
pass
def calculateCost(self, dataset, solution):
cost = 0
i = 0
cost += dataset.getValueXY(0, solution[0])
for i in range(0, ... | from abc import ABC, abstractmethod
import random as random
class AbstractHeuristic(ABC):
@abstractmethod
def calculate(self, solution):
pass
def calculateCost(self, dataset, solution):
cost = 0
i = 0
cost += dataset.getValueXY(0, solution[0])
for i in range(0, ... | <commit_before>from abc import ABC, abstractmethod
import random as random
class AbstractHeuristic(ABC):
@abstractmethod
def calculate(self, solution):
pass
def calculateCost(self, dataset, solution):
cost = 0
i = 0
cost += dataset.getValueXY(0, solution[0])
for... | from abc import ABC, abstractmethod
import random as random
class AbstractHeuristic(ABC):
@abstractmethod
def calculate(self, solution):
pass
def calculateCost(self, dataset, solution):
cost = 0
i = 0
cost += dataset.getValueXY(0, solution[0])
for i in range(0, ... | from abc import ABC, abstractmethod
import random as random
class AbstractHeuristic(ABC):
@abstractmethod
def calculate(self, solution):
pass
def calculateCost(self, dataset, solution):
cost = 0
i = 0
cost += dataset.getValueXY(0, solution[0])
for i in range(0, ... | <commit_before>from abc import ABC, abstractmethod
import random as random
class AbstractHeuristic(ABC):
@abstractmethod
def calculate(self, solution):
pass
def calculateCost(self, dataset, solution):
cost = 0
i = 0
cost += dataset.getValueXY(0, solution[0])
for... |
703b67c2ac1753133c00d5cd4a859752830b578a | kokekunster/urls.py | kokekunster/urls.py | """kokekunster URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | """kokekunster URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | Set homepage to first semester fysmat | Set homepage to first semester fysmat
| Python | mit | afriestad/WikiLinks,afriestad/WikiLinks,afriestad/WikiLinks | """kokekunster URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | """kokekunster URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | <commit_before>"""kokekunster URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, nam... | """kokekunster URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | """kokekunster URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | <commit_before>"""kokekunster URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, nam... |
9de5a1935ceb3f39b17807096c800cdf01b219bf | Scripts/multi_process_files.py | Scripts/multi_process_files.py | #!/usr/bin/python
from joblib import Parallel, delayed
import multiprocessing
import os
from subprocess import call
inputpath = '/data/amnh/darwin/images'
segment_exe = '/home/luis_ibanez/bin/darwin-notes-image-processing/Release/Segmentation/ImageToEdges'
def handle_file(filename):
call([segment_exe, filename])... | #!/usr/bin/python
from joblib import Parallel, delayed
import multiprocessing
import os
from subprocess import call
# inputpath = '/data/amnh/darwin/images'
# segment_exe = '/home/luis_ibanez/bin/darwin-notes-image-processing/Release/Segmentation/ImageToEdges'
inputpath = '/home/ibanez/data/amnh/darwin_notes/images'
... | Fix paths for local execution different from cloud server. | Fix paths for local execution different from cloud server.
| Python | apache-2.0 | HackTheStacks/darwin-notes-image-processing,HackTheStacks/darwin-notes-image-processing | #!/usr/bin/python
from joblib import Parallel, delayed
import multiprocessing
import os
from subprocess import call
inputpath = '/data/amnh/darwin/images'
segment_exe = '/home/luis_ibanez/bin/darwin-notes-image-processing/Release/Segmentation/ImageToEdges'
def handle_file(filename):
call([segment_exe, filename])... | #!/usr/bin/python
from joblib import Parallel, delayed
import multiprocessing
import os
from subprocess import call
# inputpath = '/data/amnh/darwin/images'
# segment_exe = '/home/luis_ibanez/bin/darwin-notes-image-processing/Release/Segmentation/ImageToEdges'
inputpath = '/home/ibanez/data/amnh/darwin_notes/images'
... | <commit_before>#!/usr/bin/python
from joblib import Parallel, delayed
import multiprocessing
import os
from subprocess import call
inputpath = '/data/amnh/darwin/images'
segment_exe = '/home/luis_ibanez/bin/darwin-notes-image-processing/Release/Segmentation/ImageToEdges'
def handle_file(filename):
call([segment_... | #!/usr/bin/python
from joblib import Parallel, delayed
import multiprocessing
import os
from subprocess import call
# inputpath = '/data/amnh/darwin/images'
# segment_exe = '/home/luis_ibanez/bin/darwin-notes-image-processing/Release/Segmentation/ImageToEdges'
inputpath = '/home/ibanez/data/amnh/darwin_notes/images'
... | #!/usr/bin/python
from joblib import Parallel, delayed
import multiprocessing
import os
from subprocess import call
inputpath = '/data/amnh/darwin/images'
segment_exe = '/home/luis_ibanez/bin/darwin-notes-image-processing/Release/Segmentation/ImageToEdges'
def handle_file(filename):
call([segment_exe, filename])... | <commit_before>#!/usr/bin/python
from joblib import Parallel, delayed
import multiprocessing
import os
from subprocess import call
inputpath = '/data/amnh/darwin/images'
segment_exe = '/home/luis_ibanez/bin/darwin-notes-image-processing/Release/Segmentation/ImageToEdges'
def handle_file(filename):
call([segment_... |
8e58b413801a0dbbcd3e48a5ef94201a24af7e8e | are_there_spiders/are_there_spiders/custom_storages.py | are_there_spiders/are_there_spiders/custom_storages.py | from django.contrib.staticfiles.storage import CachedFilesMixin
from pipeline.storage import PipelineMixin
from storages.backends.s3boto import S3BotoStorage
class S3PipelineStorage(PipelineMixin, CachedFilesMixin, S3BotoStorage):
pass
| import urllib
import urlparse
from django.contrib.staticfiles.storage import CachedFilesMixin
from pipeline.storage import PipelineMixin
from storages.backends.s3boto import S3BotoStorage
# CachedFilesMixin doesn't play well with Boto and S3. It over-quotes things,
# causing erratic failures. So we subclass.
# (Se... | Revert "Improvement to custom storage." | Revert "Improvement to custom storage."
This reverts commit 6f185ac7398f30653dff9403d5ebf5539d222f4c.
| Python | mit | wlonk/are_there_spiders,wlonk/are_there_spiders,wlonk/are_there_spiders | from django.contrib.staticfiles.storage import CachedFilesMixin
from pipeline.storage import PipelineMixin
from storages.backends.s3boto import S3BotoStorage
class S3PipelineStorage(PipelineMixin, CachedFilesMixin, S3BotoStorage):
pass
Revert "Improvement to custom storage."
This reverts commit 6f185ac7398f30... | import urllib
import urlparse
from django.contrib.staticfiles.storage import CachedFilesMixin
from pipeline.storage import PipelineMixin
from storages.backends.s3boto import S3BotoStorage
# CachedFilesMixin doesn't play well with Boto and S3. It over-quotes things,
# causing erratic failures. So we subclass.
# (Se... | <commit_before>from django.contrib.staticfiles.storage import CachedFilesMixin
from pipeline.storage import PipelineMixin
from storages.backends.s3boto import S3BotoStorage
class S3PipelineStorage(PipelineMixin, CachedFilesMixin, S3BotoStorage):
pass
<commit_msg>Revert "Improvement to custom storage."
This re... | import urllib
import urlparse
from django.contrib.staticfiles.storage import CachedFilesMixin
from pipeline.storage import PipelineMixin
from storages.backends.s3boto import S3BotoStorage
# CachedFilesMixin doesn't play well with Boto and S3. It over-quotes things,
# causing erratic failures. So we subclass.
# (Se... | from django.contrib.staticfiles.storage import CachedFilesMixin
from pipeline.storage import PipelineMixin
from storages.backends.s3boto import S3BotoStorage
class S3PipelineStorage(PipelineMixin, CachedFilesMixin, S3BotoStorage):
pass
Revert "Improvement to custom storage."
This reverts commit 6f185ac7398f30... | <commit_before>from django.contrib.staticfiles.storage import CachedFilesMixin
from pipeline.storage import PipelineMixin
from storages.backends.s3boto import S3BotoStorage
class S3PipelineStorage(PipelineMixin, CachedFilesMixin, S3BotoStorage):
pass
<commit_msg>Revert "Improvement to custom storage."
This re... |
7c09368b3322144c9cb2b0e18f0b4264acb88eb7 | blaze/__init__.py | blaze/__init__.py |
# build the blaze namespace with selected functions
from constructors import array, open
from datashape import dshape
|
# build the blaze namespace with selected functions
from constructors import array, open
from datashape import dshape
def test(verbosity=1, xunitfile=None, exit=False):
"""
Runs the full Blaze test suite, outputting
the results of the tests to sys.stdout.
This uses nose tests to discover which tests... | Add a nose-based blaze.test() function as a placeholder | Add a nose-based blaze.test() function as a placeholder
Hopefully we find something better, but this at least gives
us behavior similar to NumPy as a start.
| Python | bsd-3-clause | AbhiAgarwal/blaze,dwillmer/blaze,mrocklin/blaze,jdmcbr/blaze,mwiebe/blaze,mwiebe/blaze,ChinaQuants/blaze,xlhtc007/blaze,markflorisson/blaze-core,ContinuumIO/blaze,dwillmer/blaze,cpcloud/blaze,FrancescAlted/blaze,cowlicks/blaze,maxalbert/blaze,caseyclements/blaze,aterrel/blaze,cowlicks/blaze,ChinaQuants/blaze,FrancescAl... |
# build the blaze namespace with selected functions
from constructors import array, open
from datashape import dshape
Add a nose-based blaze.test() function as a placeholder
Hopefully we find something better, but this at least gives
us behavior similar to NumPy as a start. |
# build the blaze namespace with selected functions
from constructors import array, open
from datashape import dshape
def test(verbosity=1, xunitfile=None, exit=False):
"""
Runs the full Blaze test suite, outputting
the results of the tests to sys.stdout.
This uses nose tests to discover which tests... | <commit_before>
# build the blaze namespace with selected functions
from constructors import array, open
from datashape import dshape
<commit_msg>Add a nose-based blaze.test() function as a placeholder
Hopefully we find something better, but this at least gives
us behavior similar to NumPy as a start.<commit_after> |
# build the blaze namespace with selected functions
from constructors import array, open
from datashape import dshape
def test(verbosity=1, xunitfile=None, exit=False):
"""
Runs the full Blaze test suite, outputting
the results of the tests to sys.stdout.
This uses nose tests to discover which tests... |
# build the blaze namespace with selected functions
from constructors import array, open
from datashape import dshape
Add a nose-based blaze.test() function as a placeholder
Hopefully we find something better, but this at least gives
us behavior similar to NumPy as a start.
# build the blaze namespace with selected ... | <commit_before>
# build the blaze namespace with selected functions
from constructors import array, open
from datashape import dshape
<commit_msg>Add a nose-based blaze.test() function as a placeholder
Hopefully we find something better, but this at least gives
us behavior similar to NumPy as a start.<commit_after>
#... |
018172a47450eb5500d330803a2e5a7429891016 | migrations/versions/177_add_run_state_eas_folderstatus.py | migrations/versions/177_add_run_state_eas_folderstatus.py | """add run state to eas folders
Revision ID: 2b9dd6f7593a
Revises: 48a1991e5dbd
Create Date: 2015-05-28 00:47:47.636511
"""
# revision identifiers, used by Alembic.
revision = '2b9dd6f7593a'
down_revision = '48a1991e5dbd'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('easfoldersy... | """add run state to eas folders
Revision ID: 2b9dd6f7593a
Revises: 48a1991e5dbd
Create Date: 2015-05-28 00:47:47.636511
"""
# revision identifiers, used by Alembic.
revision = '2b9dd6f7593a'
down_revision = '48a1991e5dbd'
from alembic import op
import sqlalchemy as sa
def upgrade():
from inbox.ignition import... | Update migration 177 to check for table existence first | Update migration 177 to check for table existence first
| Python | agpl-3.0 | ErinCall/sync-engine,wakermahmud/sync-engine,Eagles2F/sync-engine,closeio/nylas,gale320/sync-engine,nylas/sync-engine,Eagles2F/sync-engine,nylas/sync-engine,jobscore/sync-engine,jobscore/sync-engine,ErinCall/sync-engine,wakermahmud/sync-engine,wakermahmud/sync-engine,closeio/nylas,wakermahmud/sync-engine,jobscore/sync-... | """add run state to eas folders
Revision ID: 2b9dd6f7593a
Revises: 48a1991e5dbd
Create Date: 2015-05-28 00:47:47.636511
"""
# revision identifiers, used by Alembic.
revision = '2b9dd6f7593a'
down_revision = '48a1991e5dbd'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('easfoldersy... | """add run state to eas folders
Revision ID: 2b9dd6f7593a
Revises: 48a1991e5dbd
Create Date: 2015-05-28 00:47:47.636511
"""
# revision identifiers, used by Alembic.
revision = '2b9dd6f7593a'
down_revision = '48a1991e5dbd'
from alembic import op
import sqlalchemy as sa
def upgrade():
from inbox.ignition import... | <commit_before>"""add run state to eas folders
Revision ID: 2b9dd6f7593a
Revises: 48a1991e5dbd
Create Date: 2015-05-28 00:47:47.636511
"""
# revision identifiers, used by Alembic.
revision = '2b9dd6f7593a'
down_revision = '48a1991e5dbd'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_colu... | """add run state to eas folders
Revision ID: 2b9dd6f7593a
Revises: 48a1991e5dbd
Create Date: 2015-05-28 00:47:47.636511
"""
# revision identifiers, used by Alembic.
revision = '2b9dd6f7593a'
down_revision = '48a1991e5dbd'
from alembic import op
import sqlalchemy as sa
def upgrade():
from inbox.ignition import... | """add run state to eas folders
Revision ID: 2b9dd6f7593a
Revises: 48a1991e5dbd
Create Date: 2015-05-28 00:47:47.636511
"""
# revision identifiers, used by Alembic.
revision = '2b9dd6f7593a'
down_revision = '48a1991e5dbd'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('easfoldersy... | <commit_before>"""add run state to eas folders
Revision ID: 2b9dd6f7593a
Revises: 48a1991e5dbd
Create Date: 2015-05-28 00:47:47.636511
"""
# revision identifiers, used by Alembic.
revision = '2b9dd6f7593a'
down_revision = '48a1991e5dbd'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_colu... |
4597935c29ec9cd2679254dbb8ee648ab5b2d75e | busshaming/api.py | busshaming/api.py | from rest_framework import mixins, serializers, viewsets
from .models import Route, Trip
class TripSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Trip
fields = ('id', 'gtfs_trip_id', 'version', 'route', 'trip_headsign', 'trip_short_name', 'direction', 'wheelchair_accessib... | from rest_framework import filters, mixins, serializers, viewsets
from .models import Route, Trip
class TripSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Trip
fields = ('id', 'gtfs_trip_id', 'version', 'route', 'trip_headsign', 'trip_short_name', 'direction', 'wheelchair... | Add search feature to the Route API. | Add search feature to the Route API.
| Python | mit | katharosada/bus-shaming,katharosada/bus-shaming,katharosada/bus-shaming,katharosada/bus-shaming,katharosada/bus-shaming | from rest_framework import mixins, serializers, viewsets
from .models import Route, Trip
class TripSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Trip
fields = ('id', 'gtfs_trip_id', 'version', 'route', 'trip_headsign', 'trip_short_name', 'direction', 'wheelchair_accessib... | from rest_framework import filters, mixins, serializers, viewsets
from .models import Route, Trip
class TripSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Trip
fields = ('id', 'gtfs_trip_id', 'version', 'route', 'trip_headsign', 'trip_short_name', 'direction', 'wheelchair... | <commit_before>from rest_framework import mixins, serializers, viewsets
from .models import Route, Trip
class TripSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Trip
fields = ('id', 'gtfs_trip_id', 'version', 'route', 'trip_headsign', 'trip_short_name', 'direction', 'whee... | from rest_framework import filters, mixins, serializers, viewsets
from .models import Route, Trip
class TripSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Trip
fields = ('id', 'gtfs_trip_id', 'version', 'route', 'trip_headsign', 'trip_short_name', 'direction', 'wheelchair... | from rest_framework import mixins, serializers, viewsets
from .models import Route, Trip
class TripSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Trip
fields = ('id', 'gtfs_trip_id', 'version', 'route', 'trip_headsign', 'trip_short_name', 'direction', 'wheelchair_accessib... | <commit_before>from rest_framework import mixins, serializers, viewsets
from .models import Route, Trip
class TripSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Trip
fields = ('id', 'gtfs_trip_id', 'version', 'route', 'trip_headsign', 'trip_short_name', 'direction', 'whee... |
7d59df357c34f910914baa0bb030e1ec3793f980 | capnp/__init__.py | capnp/__init__.py | """A python library wrapping the Cap'n Proto C++ library
Example Usage::
import capnp
addressbook = capnp.load('addressbook.capnp')
# Building
message = capnp.MallocMessageBuilder()
addressBook = message.initRoot(addressbook.AddressBook)
people = addressBook.init('people', 2)
alice ... | """A python library wrapping the Cap'n Proto C++ library
Example Usage::
import capnp
addressbook = capnp.load('addressbook.capnp')
# Building
message = capnp.MallocMessageBuilder()
addressBook = message.initRoot(addressbook.AddressBook)
people = addressBook.init('people', 2)
alice ... | Add _capnp for original Cython module. Meant for testing. | Add _capnp for original Cython module. Meant for testing.
| Python | bsd-2-clause | SymbiFlow/pycapnp,rcrowder/pycapnp,rcrowder/pycapnp,rcrowder/pycapnp,SymbiFlow/pycapnp,jparyani/pycapnp,tempbottle/pycapnp,jparyani/pycapnp,tempbottle/pycapnp,SymbiFlow/pycapnp,rcrowder/pycapnp,tempbottle/pycapnp,jparyani/pycapnp,tempbottle/pycapnp,jparyani/pycapnp,SymbiFlow/pycapnp | """A python library wrapping the Cap'n Proto C++ library
Example Usage::
import capnp
addressbook = capnp.load('addressbook.capnp')
# Building
message = capnp.MallocMessageBuilder()
addressBook = message.initRoot(addressbook.AddressBook)
people = addressBook.init('people', 2)
alice ... | """A python library wrapping the Cap'n Proto C++ library
Example Usage::
import capnp
addressbook = capnp.load('addressbook.capnp')
# Building
message = capnp.MallocMessageBuilder()
addressBook = message.initRoot(addressbook.AddressBook)
people = addressBook.init('people', 2)
alice ... | <commit_before>"""A python library wrapping the Cap'n Proto C++ library
Example Usage::
import capnp
addressbook = capnp.load('addressbook.capnp')
# Building
message = capnp.MallocMessageBuilder()
addressBook = message.initRoot(addressbook.AddressBook)
people = addressBook.init('people',... | """A python library wrapping the Cap'n Proto C++ library
Example Usage::
import capnp
addressbook = capnp.load('addressbook.capnp')
# Building
message = capnp.MallocMessageBuilder()
addressBook = message.initRoot(addressbook.AddressBook)
people = addressBook.init('people', 2)
alice ... | """A python library wrapping the Cap'n Proto C++ library
Example Usage::
import capnp
addressbook = capnp.load('addressbook.capnp')
# Building
message = capnp.MallocMessageBuilder()
addressBook = message.initRoot(addressbook.AddressBook)
people = addressBook.init('people', 2)
alice ... | <commit_before>"""A python library wrapping the Cap'n Proto C++ library
Example Usage::
import capnp
addressbook = capnp.load('addressbook.capnp')
# Building
message = capnp.MallocMessageBuilder()
addressBook = message.initRoot(addressbook.AddressBook)
people = addressBook.init('people',... |
085697bbf2bc4507cdacca04a24eda318940133d | amivapi/settings.py | amivapi/settings.py | """Default settings for all environments.
These settings will be extended by additional config files in ROOT/config.
Run `python manage.py create_config` to create such a config file.
"""
from os.path import abspath, dirname, join
# Custom
ROOT_DIR = abspath(join(dirname(__file__), ".."))
EMAIL_REGEX = '^[a-zA-Z0-9_... | """Default settings for all environments.
These settings will be extended by additional config files in ROOT/config.
Run `python manage.py create_config` to create such a config file.
"""
from os.path import abspath, dirname, join
# Custom
ROOT_DIR = abspath(join(dirname(__file__), ".."))
EMAIL_REGEX = '^[a-zA-Z0-9_... | Revert "Change DATE_FORMAT to be equivalent to datetime.isoformat()" | Revert "Change DATE_FORMAT to be equivalent to datetime.isoformat()"
This reverts commit 2085cf0c103df44c500bae9bccdc2ce16cd8710f.
See discussion of the original commit https://github.com/amiv-eth/amivapi/commit/2085cf0c103df44c500bae9bccdc2ce16cd8710f
| Python | agpl-3.0 | amiv-eth/amivapi,amiv-eth/amivapi,amiv-eth/amivapi | """Default settings for all environments.
These settings will be extended by additional config files in ROOT/config.
Run `python manage.py create_config` to create such a config file.
"""
from os.path import abspath, dirname, join
# Custom
ROOT_DIR = abspath(join(dirname(__file__), ".."))
EMAIL_REGEX = '^[a-zA-Z0-9_... | """Default settings for all environments.
These settings will be extended by additional config files in ROOT/config.
Run `python manage.py create_config` to create such a config file.
"""
from os.path import abspath, dirname, join
# Custom
ROOT_DIR = abspath(join(dirname(__file__), ".."))
EMAIL_REGEX = '^[a-zA-Z0-9_... | <commit_before>"""Default settings for all environments.
These settings will be extended by additional config files in ROOT/config.
Run `python manage.py create_config` to create such a config file.
"""
from os.path import abspath, dirname, join
# Custom
ROOT_DIR = abspath(join(dirname(__file__), ".."))
EMAIL_REGEX ... | """Default settings for all environments.
These settings will be extended by additional config files in ROOT/config.
Run `python manage.py create_config` to create such a config file.
"""
from os.path import abspath, dirname, join
# Custom
ROOT_DIR = abspath(join(dirname(__file__), ".."))
EMAIL_REGEX = '^[a-zA-Z0-9_... | """Default settings for all environments.
These settings will be extended by additional config files in ROOT/config.
Run `python manage.py create_config` to create such a config file.
"""
from os.path import abspath, dirname, join
# Custom
ROOT_DIR = abspath(join(dirname(__file__), ".."))
EMAIL_REGEX = '^[a-zA-Z0-9_... | <commit_before>"""Default settings for all environments.
These settings will be extended by additional config files in ROOT/config.
Run `python manage.py create_config` to create such a config file.
"""
from os.path import abspath, dirname, join
# Custom
ROOT_DIR = abspath(join(dirname(__file__), ".."))
EMAIL_REGEX ... |
18ffd356559525909a87f2f06398b9cad861acf9 | addic7ed_cli/request.py | addic7ed_cli/request.py |
try:
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
import requests
from pyquery import PyQuery
__all__ = ['session']
class Response(object):
def __init__(self, response):
self._response = response
self._query = None
def __getattr__(self, name):
... |
try:
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
import requests
from pyquery import PyQuery
from addic7ed_cli.error import Error
__all__ = ['session']
class Response(object):
def __init__(self, response):
self._response = response
self._query = No... | Fix occasional error when querying addic7ed | Fix occasional error when querying addic7ed
| Python | mit | BenoitZugmeyer/addic7ed-cli,BenoitZugmeyer/addic7ed-cli |
try:
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
import requests
from pyquery import PyQuery
__all__ = ['session']
class Response(object):
def __init__(self, response):
self._response = response
self._query = None
def __getattr__(self, name):
... |
try:
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
import requests
from pyquery import PyQuery
from addic7ed_cli.error import Error
__all__ = ['session']
class Response(object):
def __init__(self, response):
self._response = response
self._query = No... | <commit_before>
try:
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
import requests
from pyquery import PyQuery
__all__ = ['session']
class Response(object):
def __init__(self, response):
self._response = response
self._query = None
def __getattr_... |
try:
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
import requests
from pyquery import PyQuery
from addic7ed_cli.error import Error
__all__ = ['session']
class Response(object):
def __init__(self, response):
self._response = response
self._query = No... |
try:
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
import requests
from pyquery import PyQuery
__all__ = ['session']
class Response(object):
def __init__(self, response):
self._response = response
self._query = None
def __getattr__(self, name):
... | <commit_before>
try:
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
import requests
from pyquery import PyQuery
__all__ = ['session']
class Response(object):
def __init__(self, response):
self._response = response
self._query = None
def __getattr_... |
d61714022eb191294373519e41d6c1ec3252ed39 | organizer/forms.py | organizer/forms.py | from django import forms
from django.core.exceptions import ValidationError
from .models import Tag
class TagForm(forms.Form):
name = forms.CharField(max_length=31)
slug = forms.SlugField(
max_length=31,
help_text='A label for URL config')
def clean_name(self):
return self.cleane... | from django import forms
from django.core.exceptions import ValidationError
from .models import Tag
class TagForm(forms.ModelForm):
class Meta:
model = Tag
fields = '__all__'
def clean_name(self):
return self.cleaned_data['name'].lower()
def clean_slug(self):
new_slug = ... | Refactor TagForm to inherit ModelForm. | Ch07: Refactor TagForm to inherit ModelForm.
| Python | bsd-2-clause | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | from django import forms
from django.core.exceptions import ValidationError
from .models import Tag
class TagForm(forms.Form):
name = forms.CharField(max_length=31)
slug = forms.SlugField(
max_length=31,
help_text='A label for URL config')
def clean_name(self):
return self.cleane... | from django import forms
from django.core.exceptions import ValidationError
from .models import Tag
class TagForm(forms.ModelForm):
class Meta:
model = Tag
fields = '__all__'
def clean_name(self):
return self.cleaned_data['name'].lower()
def clean_slug(self):
new_slug = ... | <commit_before>from django import forms
from django.core.exceptions import ValidationError
from .models import Tag
class TagForm(forms.Form):
name = forms.CharField(max_length=31)
slug = forms.SlugField(
max_length=31,
help_text='A label for URL config')
def clean_name(self):
ret... | from django import forms
from django.core.exceptions import ValidationError
from .models import Tag
class TagForm(forms.ModelForm):
class Meta:
model = Tag
fields = '__all__'
def clean_name(self):
return self.cleaned_data['name'].lower()
def clean_slug(self):
new_slug = ... | from django import forms
from django.core.exceptions import ValidationError
from .models import Tag
class TagForm(forms.Form):
name = forms.CharField(max_length=31)
slug = forms.SlugField(
max_length=31,
help_text='A label for URL config')
def clean_name(self):
return self.cleane... | <commit_before>from django import forms
from django.core.exceptions import ValidationError
from .models import Tag
class TagForm(forms.Form):
name = forms.CharField(max_length=31)
slug = forms.SlugField(
max_length=31,
help_text='A label for URL config')
def clean_name(self):
ret... |
1c05408187b0a93407be5500381c654ea5c3af11 | pyluos/modules/l0_servo.py | pyluos/modules/l0_servo.py | from .module import Module, interact
from .gpio import Pwm
class L0Servo(Module):
def __init__(self, id, alias, robot):
Module.__init__(self, 'L0Servo', id, alias, robot)
self.pwm_1 = Pwm('p1', self, max=180.0)
self.pwm_2 = Pwm('p2', self, max=180.0)
self.pwm_3 = Pwm('p3', self, m... | from .module import Module, interact
from .gpio import Pwm
class PositionServo(object):
def __init__(self, alias, delegate, default= 0.0, min=0.0, max=180.0):
self._pos = None
self._pwm = Pwm(alias, delegate, default, min, max)
@property
def target_position(self):
return self._pos... | Improve l0 servo api with target_position accessor. | Improve l0 servo api with target_position accessor.
| Python | mit | pollen/pyrobus | from .module import Module, interact
from .gpio import Pwm
class L0Servo(Module):
def __init__(self, id, alias, robot):
Module.__init__(self, 'L0Servo', id, alias, robot)
self.pwm_1 = Pwm('p1', self, max=180.0)
self.pwm_2 = Pwm('p2', self, max=180.0)
self.pwm_3 = Pwm('p3', self, m... | from .module import Module, interact
from .gpio import Pwm
class PositionServo(object):
def __init__(self, alias, delegate, default= 0.0, min=0.0, max=180.0):
self._pos = None
self._pwm = Pwm(alias, delegate, default, min, max)
@property
def target_position(self):
return self._pos... | <commit_before>from .module import Module, interact
from .gpio import Pwm
class L0Servo(Module):
def __init__(self, id, alias, robot):
Module.__init__(self, 'L0Servo', id, alias, robot)
self.pwm_1 = Pwm('p1', self, max=180.0)
self.pwm_2 = Pwm('p2', self, max=180.0)
self.pwm_3 = Pw... | from .module import Module, interact
from .gpio import Pwm
class PositionServo(object):
def __init__(self, alias, delegate, default= 0.0, min=0.0, max=180.0):
self._pos = None
self._pwm = Pwm(alias, delegate, default, min, max)
@property
def target_position(self):
return self._pos... | from .module import Module, interact
from .gpio import Pwm
class L0Servo(Module):
def __init__(self, id, alias, robot):
Module.__init__(self, 'L0Servo', id, alias, robot)
self.pwm_1 = Pwm('p1', self, max=180.0)
self.pwm_2 = Pwm('p2', self, max=180.0)
self.pwm_3 = Pwm('p3', self, m... | <commit_before>from .module import Module, interact
from .gpio import Pwm
class L0Servo(Module):
def __init__(self, id, alias, robot):
Module.__init__(self, 'L0Servo', id, alias, robot)
self.pwm_1 = Pwm('p1', self, max=180.0)
self.pwm_2 = Pwm('p2', self, max=180.0)
self.pwm_3 = Pw... |
a1bb113dc30de7afe20146311a99b3454de0056e | STC_Path_Testing/commission.py | STC_Path_Testing/commission.py | class Commission(object):
def __init__(self, locks, stocks, barrels):
self.locks = locks
self.stocks = stocks
self.barrels = barrels
@property
def bonus(self):
if self.locks == -1:
return "Terminate"
if self.locks < 1 or self.locks > 70:
retu... | class Commission(object):
def __init__(self, locks, stocks, barrels):
self.locks = locks
self.stocks = stocks
self.barrels = barrels
@property
def bonus(self):
if self.locks == -1:
return "Terminate"
if self.locks < 1 or self.locks > 70:
retu... | Fix PEP8: W292 no newline at end of file | Fix PEP8: W292 no newline at end of file
| Python | mit | aweimeow/STC-Path-Testing | class Commission(object):
def __init__(self, locks, stocks, barrels):
self.locks = locks
self.stocks = stocks
self.barrels = barrels
@property
def bonus(self):
if self.locks == -1:
return "Terminate"
if self.locks < 1 or self.locks > 70:
retu... | class Commission(object):
def __init__(self, locks, stocks, barrels):
self.locks = locks
self.stocks = stocks
self.barrels = barrels
@property
def bonus(self):
if self.locks == -1:
return "Terminate"
if self.locks < 1 or self.locks > 70:
retu... | <commit_before>class Commission(object):
def __init__(self, locks, stocks, barrels):
self.locks = locks
self.stocks = stocks
self.barrels = barrels
@property
def bonus(self):
if self.locks == -1:
return "Terminate"
if self.locks < 1 or self.locks > 70:
... | class Commission(object):
def __init__(self, locks, stocks, barrels):
self.locks = locks
self.stocks = stocks
self.barrels = barrels
@property
def bonus(self):
if self.locks == -1:
return "Terminate"
if self.locks < 1 or self.locks > 70:
retu... | class Commission(object):
def __init__(self, locks, stocks, barrels):
self.locks = locks
self.stocks = stocks
self.barrels = barrels
@property
def bonus(self):
if self.locks == -1:
return "Terminate"
if self.locks < 1 or self.locks > 70:
retu... | <commit_before>class Commission(object):
def __init__(self, locks, stocks, barrels):
self.locks = locks
self.stocks = stocks
self.barrels = barrels
@property
def bonus(self):
if self.locks == -1:
return "Terminate"
if self.locks < 1 or self.locks > 70:
... |
ae21001fea38e9b8e4af34654c48b415e419f319 | core/utils.py | core/utils.py | from django.utils.duration import _get_duration_components
from datetime import timedelta
def duration_string_from_delta(delta):
seconds = delta.total_seconds()
split = str(seconds/3600).split('.')
print split
hours = int(split[0])
minutes = int(float('.'+split[1])*60)
string = '{}:{:02d}'.... | from django.utils.duration import _get_duration_components
from datetime import timedelta
def duration_string_from_delta(delta):
seconds = delta.total_seconds()
split = str(seconds/3600).split('.')
hours = int(split[0])
minutes = int(float('.'+split[1])*60)
string = '{}:{:02d}'.format(hours, mi... | Remove debugging print statement, opps | Remove debugging print statement, opps
| Python | bsd-2-clause | muhleder/timestrap,muhleder/timestrap,overshard/timestrap,cdubz/timestrap,Leahelisabeth/timestrap,Leahelisabeth/timestrap,Leahelisabeth/timestrap,cdubz/timestrap,Leahelisabeth/timestrap,overshard/timestrap,muhleder/timestrap,cdubz/timestrap,overshard/timestrap | from django.utils.duration import _get_duration_components
from datetime import timedelta
def duration_string_from_delta(delta):
seconds = delta.total_seconds()
split = str(seconds/3600).split('.')
print split
hours = int(split[0])
minutes = int(float('.'+split[1])*60)
string = '{}:{:02d}'.... | from django.utils.duration import _get_duration_components
from datetime import timedelta
def duration_string_from_delta(delta):
seconds = delta.total_seconds()
split = str(seconds/3600).split('.')
hours = int(split[0])
minutes = int(float('.'+split[1])*60)
string = '{}:{:02d}'.format(hours, mi... | <commit_before>from django.utils.duration import _get_duration_components
from datetime import timedelta
def duration_string_from_delta(delta):
seconds = delta.total_seconds()
split = str(seconds/3600).split('.')
print split
hours = int(split[0])
minutes = int(float('.'+split[1])*60)
string... | from django.utils.duration import _get_duration_components
from datetime import timedelta
def duration_string_from_delta(delta):
seconds = delta.total_seconds()
split = str(seconds/3600).split('.')
hours = int(split[0])
minutes = int(float('.'+split[1])*60)
string = '{}:{:02d}'.format(hours, mi... | from django.utils.duration import _get_duration_components
from datetime import timedelta
def duration_string_from_delta(delta):
seconds = delta.total_seconds()
split = str(seconds/3600).split('.')
print split
hours = int(split[0])
minutes = int(float('.'+split[1])*60)
string = '{}:{:02d}'.... | <commit_before>from django.utils.duration import _get_duration_components
from datetime import timedelta
def duration_string_from_delta(delta):
seconds = delta.total_seconds()
split = str(seconds/3600).split('.')
print split
hours = int(split[0])
minutes = int(float('.'+split[1])*60)
string... |
34bf8d82580b83b1e0409db8636877a22203996b | cryptex/trade.py | cryptex/trade.py | class Trade(object):
BUY = 0
SELL = 1
def __init__(self, trade_id, trade_type, base_currency, counter_currency,
time, order_id, amount, price, fee=None):
self.trade_id = trade_id
self.trade_type = trade_type
self.base_currency = base_currency
self.counter_currency = c... | class Trade(object):
BUY = 0
SELL = 1
def __init__(self, trade_id, trade_type, base_currency, counter_currency,
time, order_id, amount, price, fee=None):
self.trade_id = trade_id
self.trade_type = trade_type
self.base_currency = base_currency
self.counter_currency = c... | Remove magic number check in Trade str method | Remove magic number check in Trade str method
| Python | mit | coink/cryptex | class Trade(object):
BUY = 0
SELL = 1
def __init__(self, trade_id, trade_type, base_currency, counter_currency,
time, order_id, amount, price, fee=None):
self.trade_id = trade_id
self.trade_type = trade_type
self.base_currency = base_currency
self.counter_currency = c... | class Trade(object):
BUY = 0
SELL = 1
def __init__(self, trade_id, trade_type, base_currency, counter_currency,
time, order_id, amount, price, fee=None):
self.trade_id = trade_id
self.trade_type = trade_type
self.base_currency = base_currency
self.counter_currency = c... | <commit_before>class Trade(object):
BUY = 0
SELL = 1
def __init__(self, trade_id, trade_type, base_currency, counter_currency,
time, order_id, amount, price, fee=None):
self.trade_id = trade_id
self.trade_type = trade_type
self.base_currency = base_currency
self.count... | class Trade(object):
BUY = 0
SELL = 1
def __init__(self, trade_id, trade_type, base_currency, counter_currency,
time, order_id, amount, price, fee=None):
self.trade_id = trade_id
self.trade_type = trade_type
self.base_currency = base_currency
self.counter_currency = c... | class Trade(object):
BUY = 0
SELL = 1
def __init__(self, trade_id, trade_type, base_currency, counter_currency,
time, order_id, amount, price, fee=None):
self.trade_id = trade_id
self.trade_type = trade_type
self.base_currency = base_currency
self.counter_currency = c... | <commit_before>class Trade(object):
BUY = 0
SELL = 1
def __init__(self, trade_id, trade_type, base_currency, counter_currency,
time, order_id, amount, price, fee=None):
self.trade_id = trade_id
self.trade_type = trade_type
self.base_currency = base_currency
self.count... |
c1de3bddb7e440064f15fd2a340cfea41f9e7be4 | heltour/tournament/management/commands/cleanupcomments.py | heltour/tournament/management/commands/cleanupcomments.py | import random
import string
from django.core.management import BaseCommand
from django.utils import timezone
from heltour.tournament.models import *
from django_comments.models import Comment
from django.contrib.contenttypes.models import ContentType
class Command(BaseCommand):
help = "Removes ALL emails from the... | import random
import string
from datetime import datetime
from django.core.management import BaseCommand
from django.utils import timezone
from heltour.tournament.models import *
from django_comments.models import Comment
from django.contrib.contenttypes.models import ContentType
class Command(BaseCommand):
help ... | Remove all moderator made comments before 2021/01/01 | Remove all moderator made comments before 2021/01/01
| Python | mit | cyanfish/heltour,cyanfish/heltour,cyanfish/heltour,cyanfish/heltour | import random
import string
from django.core.management import BaseCommand
from django.utils import timezone
from heltour.tournament.models import *
from django_comments.models import Comment
from django.contrib.contenttypes.models import ContentType
class Command(BaseCommand):
help = "Removes ALL emails from the... | import random
import string
from datetime import datetime
from django.core.management import BaseCommand
from django.utils import timezone
from heltour.tournament.models import *
from django_comments.models import Comment
from django.contrib.contenttypes.models import ContentType
class Command(BaseCommand):
help ... | <commit_before>import random
import string
from django.core.management import BaseCommand
from django.utils import timezone
from heltour.tournament.models import *
from django_comments.models import Comment
from django.contrib.contenttypes.models import ContentType
class Command(BaseCommand):
help = "Removes ALL ... | import random
import string
from datetime import datetime
from django.core.management import BaseCommand
from django.utils import timezone
from heltour.tournament.models import *
from django_comments.models import Comment
from django.contrib.contenttypes.models import ContentType
class Command(BaseCommand):
help ... | import random
import string
from django.core.management import BaseCommand
from django.utils import timezone
from heltour.tournament.models import *
from django_comments.models import Comment
from django.contrib.contenttypes.models import ContentType
class Command(BaseCommand):
help = "Removes ALL emails from the... | <commit_before>import random
import string
from django.core.management import BaseCommand
from django.utils import timezone
from heltour.tournament.models import *
from django_comments.models import Comment
from django.contrib.contenttypes.models import ContentType
class Command(BaseCommand):
help = "Removes ALL ... |
eaa907d5d8e4bb4e8514c719b3c11a4a30442694 | vpr/muxes/logic/mux2/tests/test_mux2.py | vpr/muxes/logic/mux2/tests/test_mux2.py | # Simple tests for an adder module
import cocotb
from cocotb.triggers import Timer
from cocotb.result import TestFailure
#from adder_model import adder_model
#import random
@cocotb.test()
def mux2_test(dut):
"""Test for MUX2 options"""
opts = [(x,y,z, x&~z | y&z) for x in [0,1] for y in [0,1] for z in [0,1]]
... | import cocotb
from cocotb.triggers import Timer
from cocotb.result import TestFailure
from cocotb.regression import TestFactory
@cocotb.coroutine
def mux2_basic_test(dut, inputs=(1,0,0)):
"""Test for MUX2 options"""
yield Timer(2)
I0, I1, S0 = inputs
dut.I0 = I0
dut.I1 = I1
dut.S0 = S0
if ... | Use factory to iterate over permutations | Use factory to iterate over permutations
Signed-off-by: Jeffrey Elms <23ce84ca7a7de9dc17ad8e8b0bbd717d4f9f9884@freshred.net>
| Python | isc | SymbiFlow/symbiflow-arch-defs,SymbiFlow/symbiflow-arch-defs | # Simple tests for an adder module
import cocotb
from cocotb.triggers import Timer
from cocotb.result import TestFailure
#from adder_model import adder_model
#import random
@cocotb.test()
def mux2_test(dut):
"""Test for MUX2 options"""
opts = [(x,y,z, x&~z | y&z) for x in [0,1] for y in [0,1] for z in [0,1]]
... | import cocotb
from cocotb.triggers import Timer
from cocotb.result import TestFailure
from cocotb.regression import TestFactory
@cocotb.coroutine
def mux2_basic_test(dut, inputs=(1,0,0)):
"""Test for MUX2 options"""
yield Timer(2)
I0, I1, S0 = inputs
dut.I0 = I0
dut.I1 = I1
dut.S0 = S0
if ... | <commit_before># Simple tests for an adder module
import cocotb
from cocotb.triggers import Timer
from cocotb.result import TestFailure
#from adder_model import adder_model
#import random
@cocotb.test()
def mux2_test(dut):
"""Test for MUX2 options"""
opts = [(x,y,z, x&~z | y&z) for x in [0,1] for y in [0,1] f... | import cocotb
from cocotb.triggers import Timer
from cocotb.result import TestFailure
from cocotb.regression import TestFactory
@cocotb.coroutine
def mux2_basic_test(dut, inputs=(1,0,0)):
"""Test for MUX2 options"""
yield Timer(2)
I0, I1, S0 = inputs
dut.I0 = I0
dut.I1 = I1
dut.S0 = S0
if ... | # Simple tests for an adder module
import cocotb
from cocotb.triggers import Timer
from cocotb.result import TestFailure
#from adder_model import adder_model
#import random
@cocotb.test()
def mux2_test(dut):
"""Test for MUX2 options"""
opts = [(x,y,z, x&~z | y&z) for x in [0,1] for y in [0,1] for z in [0,1]]
... | <commit_before># Simple tests for an adder module
import cocotb
from cocotb.triggers import Timer
from cocotb.result import TestFailure
#from adder_model import adder_model
#import random
@cocotb.test()
def mux2_test(dut):
"""Test for MUX2 options"""
opts = [(x,y,z, x&~z | y&z) for x in [0,1] for y in [0,1] f... |
ea2bf30629dd7986d0e20041c8633897b2b1a324 | main.py | main.py | import argparse
import io
#Define commmand line arguments which can be passed to main.py
#Currently irrelevant, but could be useful later
def initialize_argument_parser():
parser = argparse.ArgumentParser(description='Simulate Indian health solutions')
parser.add_argument('-s', '--solution', dest='solution',
... | import argparse
import io
#Define commmand line arguments which can be passed to main.py
#Currently irrelevant, but could be useful later
def initialize_argument_parser():
parser = argparse.ArgumentParser(description='Simulate Indian health solutions')
parser.add_argument('-s', '--solution', dest='solution',
... | Put many demos in demonstrate_queries() | Put many demos in demonstrate_queries()
| Python | bsd-3-clause | rkawauchi/IHK,rkawauchi/IHK | import argparse
import io
#Define commmand line arguments which can be passed to main.py
#Currently irrelevant, but could be useful later
def initialize_argument_parser():
parser = argparse.ArgumentParser(description='Simulate Indian health solutions')
parser.add_argument('-s', '--solution', dest='solution',
... | import argparse
import io
#Define commmand line arguments which can be passed to main.py
#Currently irrelevant, but could be useful later
def initialize_argument_parser():
parser = argparse.ArgumentParser(description='Simulate Indian health solutions')
parser.add_argument('-s', '--solution', dest='solution',
... | <commit_before>import argparse
import io
#Define commmand line arguments which can be passed to main.py
#Currently irrelevant, but could be useful later
def initialize_argument_parser():
parser = argparse.ArgumentParser(description='Simulate Indian health solutions')
parser.add_argument('-s', '--solution', des... | import argparse
import io
#Define commmand line arguments which can be passed to main.py
#Currently irrelevant, but could be useful later
def initialize_argument_parser():
parser = argparse.ArgumentParser(description='Simulate Indian health solutions')
parser.add_argument('-s', '--solution', dest='solution',
... | import argparse
import io
#Define commmand line arguments which can be passed to main.py
#Currently irrelevant, but could be useful later
def initialize_argument_parser():
parser = argparse.ArgumentParser(description='Simulate Indian health solutions')
parser.add_argument('-s', '--solution', dest='solution',
... | <commit_before>import argparse
import io
#Define commmand line arguments which can be passed to main.py
#Currently irrelevant, but could be useful later
def initialize_argument_parser():
parser = argparse.ArgumentParser(description='Simulate Indian health solutions')
parser.add_argument('-s', '--solution', des... |
d385d7405b0e08184fa055622c787469f39386cf | main.py | main.py | # -*- coding: utf-8 -*-
#
# The main application file
#
from webapp2 import WSGIApplication
from helpers.config import load_config
# Explicitly import controller classes
from controllers import root
__author__ = "YOUR NAME"
__website__ = "http://example.com"
__email__ = "you@example.com"
__licence__ = "MIT"
__ve... | # -*- coding: utf-8 -*-
#
# The main application file
#
# Add 3rd-party library folder in to system path
import sys
sys.path.insert(0, 'lib')
from webapp2 import WSGIApplication
from helpers.config import load_config
# Explicitly import controller classes
from controllers import root
__author__ = "YOUR NAME"
__we... | Add 3rd-party library folder in to system path | Add 3rd-party library folder in to system path
| Python | mit | opendatapress/open_data_press,opendatapress/open_data_press,opendatapress/open_data_press | # -*- coding: utf-8 -*-
#
# The main application file
#
from webapp2 import WSGIApplication
from helpers.config import load_config
# Explicitly import controller classes
from controllers import root
__author__ = "YOUR NAME"
__website__ = "http://example.com"
__email__ = "you@example.com"
__licence__ = "MIT"
__ve... | # -*- coding: utf-8 -*-
#
# The main application file
#
# Add 3rd-party library folder in to system path
import sys
sys.path.insert(0, 'lib')
from webapp2 import WSGIApplication
from helpers.config import load_config
# Explicitly import controller classes
from controllers import root
__author__ = "YOUR NAME"
__we... | <commit_before># -*- coding: utf-8 -*-
#
# The main application file
#
from webapp2 import WSGIApplication
from helpers.config import load_config
# Explicitly import controller classes
from controllers import root
__author__ = "YOUR NAME"
__website__ = "http://example.com"
__email__ = "you@example.com"
__licence... | # -*- coding: utf-8 -*-
#
# The main application file
#
# Add 3rd-party library folder in to system path
import sys
sys.path.insert(0, 'lib')
from webapp2 import WSGIApplication
from helpers.config import load_config
# Explicitly import controller classes
from controllers import root
__author__ = "YOUR NAME"
__we... | # -*- coding: utf-8 -*-
#
# The main application file
#
from webapp2 import WSGIApplication
from helpers.config import load_config
# Explicitly import controller classes
from controllers import root
__author__ = "YOUR NAME"
__website__ = "http://example.com"
__email__ = "you@example.com"
__licence__ = "MIT"
__ve... | <commit_before># -*- coding: utf-8 -*-
#
# The main application file
#
from webapp2 import WSGIApplication
from helpers.config import load_config
# Explicitly import controller classes
from controllers import root
__author__ = "YOUR NAME"
__website__ = "http://example.com"
__email__ = "you@example.com"
__licence... |
7c1623513151a3c1d81cd42f00efbb8a1b7d09fc | board/signals.py | board/signals.py | from django.contrib.sessions.models import Session
from django.dispatch import receiver
from django.utils.translation import ugettext as _
from account.signals import email_confirmation_sent, user_signed_up
from board.models import Board, Notification
from board.utils import treedict
@receiver(email_confirmation_sen... | from django.contrib.sessions.models import Session
from django.dispatch import receiver
from django.utils.translation import ugettext as _
from account.models import EmailAddress
from account.signals import email_confirmation_sent, password_changed, user_signed_up
from board.models import Board, Notification
from boar... | Set user.email_address.verified as true when user changed his password | Set user.email_address.verified as true when user changed his password
| Python | mit | devunt/hydrocarbon,devunt/hydrocarbon,devunt/hydrocarbon | from django.contrib.sessions.models import Session
from django.dispatch import receiver
from django.utils.translation import ugettext as _
from account.signals import email_confirmation_sent, user_signed_up
from board.models import Board, Notification
from board.utils import treedict
@receiver(email_confirmation_sen... | from django.contrib.sessions.models import Session
from django.dispatch import receiver
from django.utils.translation import ugettext as _
from account.models import EmailAddress
from account.signals import email_confirmation_sent, password_changed, user_signed_up
from board.models import Board, Notification
from boar... | <commit_before>from django.contrib.sessions.models import Session
from django.dispatch import receiver
from django.utils.translation import ugettext as _
from account.signals import email_confirmation_sent, user_signed_up
from board.models import Board, Notification
from board.utils import treedict
@receiver(email_c... | from django.contrib.sessions.models import Session
from django.dispatch import receiver
from django.utils.translation import ugettext as _
from account.models import EmailAddress
from account.signals import email_confirmation_sent, password_changed, user_signed_up
from board.models import Board, Notification
from boar... | from django.contrib.sessions.models import Session
from django.dispatch import receiver
from django.utils.translation import ugettext as _
from account.signals import email_confirmation_sent, user_signed_up
from board.models import Board, Notification
from board.utils import treedict
@receiver(email_confirmation_sen... | <commit_before>from django.contrib.sessions.models import Session
from django.dispatch import receiver
from django.utils.translation import ugettext as _
from account.signals import email_confirmation_sent, user_signed_up
from board.models import Board, Notification
from board.utils import treedict
@receiver(email_c... |
2f27a175ffa777d4fe2aad41396e9da3f2c70216 | nbs/utils/validators.py | nbs/utils/validators.py | # -*- coding: utf-8-*-
def validate_cuit(cuit):
"from: http://python.org.ar/pyar/Recetario/ValidarCuit by Mariano Reingart"
# validaciones minimas
if len(cuit) != 13 or cuit[2] != "-" or cuit [11] != "-":
return False
base = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2]
cuit = cuit.replace("-", "")
... | # -*- coding: utf-8-*-
import re
def validate_cuit(cuit):
"""
Validates CUIT (Argentina) - Clave Única de Identificación Triebutaria
from: http://python.org.ar/pyar/Recetario/ValidarCuit by Mariano Reingart
"""
cuit = str(cuit).replace("-", "") # normalize
# validaciones minimas
if not re.m... | Add cbu validator to utils module | Add cbu validator to utils module
| Python | mit | coyotevz/nobix-app | # -*- coding: utf-8-*-
def validate_cuit(cuit):
"from: http://python.org.ar/pyar/Recetario/ValidarCuit by Mariano Reingart"
# validaciones minimas
if len(cuit) != 13 or cuit[2] != "-" or cuit [11] != "-":
return False
base = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2]
cuit = cuit.replace("-", "")
... | # -*- coding: utf-8-*-
import re
def validate_cuit(cuit):
"""
Validates CUIT (Argentina) - Clave Única de Identificación Triebutaria
from: http://python.org.ar/pyar/Recetario/ValidarCuit by Mariano Reingart
"""
cuit = str(cuit).replace("-", "") # normalize
# validaciones minimas
if not re.m... | <commit_before># -*- coding: utf-8-*-
def validate_cuit(cuit):
"from: http://python.org.ar/pyar/Recetario/ValidarCuit by Mariano Reingart"
# validaciones minimas
if len(cuit) != 13 or cuit[2] != "-" or cuit [11] != "-":
return False
base = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2]
cuit = cuit.repla... | # -*- coding: utf-8-*-
import re
def validate_cuit(cuit):
"""
Validates CUIT (Argentina) - Clave Única de Identificación Triebutaria
from: http://python.org.ar/pyar/Recetario/ValidarCuit by Mariano Reingart
"""
cuit = str(cuit).replace("-", "") # normalize
# validaciones minimas
if not re.m... | # -*- coding: utf-8-*-
def validate_cuit(cuit):
"from: http://python.org.ar/pyar/Recetario/ValidarCuit by Mariano Reingart"
# validaciones minimas
if len(cuit) != 13 or cuit[2] != "-" or cuit [11] != "-":
return False
base = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2]
cuit = cuit.replace("-", "")
... | <commit_before># -*- coding: utf-8-*-
def validate_cuit(cuit):
"from: http://python.org.ar/pyar/Recetario/ValidarCuit by Mariano Reingart"
# validaciones minimas
if len(cuit) != 13 or cuit[2] != "-" or cuit [11] != "-":
return False
base = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2]
cuit = cuit.repla... |
228b53836e9569fa901de341d7486f85152e67f9 | txircd/modules/rfc/cmode_t.py | txircd/modules/rfc/cmode_t.py | from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import IMode, IModuleData, Mode, ModuleData
from txircd.utils import ModeType
from zope.interface import implements
class TopicLockMode(ModuleData, Mode):
implements(IPlugin, IModuleData, IMode)
name = "TopicLoc... | from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import IMode, IModuleData, Mode, ModuleData
from txircd.utils import ModeType
from zope.interface import implements
class TopicLockMode(ModuleData, Mode):
implements(IPlugin, IModuleData, IMode)
name = "TopicLoc... | Fix non-chanops not being able to query the topic | Fix non-chanops not being able to query the topic
| Python | bsd-3-clause | Heufneutje/txircd,ElementalAlchemist/txircd | from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import IMode, IModuleData, Mode, ModuleData
from txircd.utils import ModeType
from zope.interface import implements
class TopicLockMode(ModuleData, Mode):
implements(IPlugin, IModuleData, IMode)
name = "TopicLoc... | from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import IMode, IModuleData, Mode, ModuleData
from txircd.utils import ModeType
from zope.interface import implements
class TopicLockMode(ModuleData, Mode):
implements(IPlugin, IModuleData, IMode)
name = "TopicLoc... | <commit_before>from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import IMode, IModuleData, Mode, ModuleData
from txircd.utils import ModeType
from zope.interface import implements
class TopicLockMode(ModuleData, Mode):
implements(IPlugin, IModuleData, IMode)
n... | from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import IMode, IModuleData, Mode, ModuleData
from txircd.utils import ModeType
from zope.interface import implements
class TopicLockMode(ModuleData, Mode):
implements(IPlugin, IModuleData, IMode)
name = "TopicLoc... | from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import IMode, IModuleData, Mode, ModuleData
from txircd.utils import ModeType
from zope.interface import implements
class TopicLockMode(ModuleData, Mode):
implements(IPlugin, IModuleData, IMode)
name = "TopicLoc... | <commit_before>from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import IMode, IModuleData, Mode, ModuleData
from txircd.utils import ModeType
from zope.interface import implements
class TopicLockMode(ModuleData, Mode):
implements(IPlugin, IModuleData, IMode)
n... |
46b5b03385d26589a97b6ab156fffd3b1b10fa5b | secretstorage/exceptions.py | secretstorage/exceptions.py | # SecretStorage module for Python
# Access passwords using the SecretService DBus API
# Author: Dmitry Shachnev, 2012
# License: BSD
"""All secretstorage functions may raise various exceptions when
something goes wrong. All exceptions derive from base
:exc:`SecretStorageException` class."""
class SecretStorageExcepti... | # SecretStorage module for Python
# Access passwords using the SecretService DBus API
# Author: Dmitry Shachnev, 2012
# License: BSD
"""All secretstorage functions may raise various exceptions when
something goes wrong. All exceptions derive from base
:exc:`SecretStorageException` class."""
class SecretStorageExcepti... | Make SecretServiceNotAvailableException a subclass of SecretStorageException | Make SecretServiceNotAvailableException a subclass of SecretStorageException
| Python | bsd-3-clause | mitya57/secretstorage | # SecretStorage module for Python
# Access passwords using the SecretService DBus API
# Author: Dmitry Shachnev, 2012
# License: BSD
"""All secretstorage functions may raise various exceptions when
something goes wrong. All exceptions derive from base
:exc:`SecretStorageException` class."""
class SecretStorageExcepti... | # SecretStorage module for Python
# Access passwords using the SecretService DBus API
# Author: Dmitry Shachnev, 2012
# License: BSD
"""All secretstorage functions may raise various exceptions when
something goes wrong. All exceptions derive from base
:exc:`SecretStorageException` class."""
class SecretStorageExcepti... | <commit_before># SecretStorage module for Python
# Access passwords using the SecretService DBus API
# Author: Dmitry Shachnev, 2012
# License: BSD
"""All secretstorage functions may raise various exceptions when
something goes wrong. All exceptions derive from base
:exc:`SecretStorageException` class."""
class Secre... | # SecretStorage module for Python
# Access passwords using the SecretService DBus API
# Author: Dmitry Shachnev, 2012
# License: BSD
"""All secretstorage functions may raise various exceptions when
something goes wrong. All exceptions derive from base
:exc:`SecretStorageException` class."""
class SecretStorageExcepti... | # SecretStorage module for Python
# Access passwords using the SecretService DBus API
# Author: Dmitry Shachnev, 2012
# License: BSD
"""All secretstorage functions may raise various exceptions when
something goes wrong. All exceptions derive from base
:exc:`SecretStorageException` class."""
class SecretStorageExcepti... | <commit_before># SecretStorage module for Python
# Access passwords using the SecretService DBus API
# Author: Dmitry Shachnev, 2012
# License: BSD
"""All secretstorage functions may raise various exceptions when
something goes wrong. All exceptions derive from base
:exc:`SecretStorageException` class."""
class Secre... |
a21fbdff2e04fd6e3cfbac7e75ccb03c81506a1f | server.py | server.py | import flask
app = flask.Flask(__name__)
def make_tour():
tour = {
'id': 1,
'name': 'Test Tour',
'route': [
{
'description': 'This is a description of this place.',
'photos': ['photo1.jpg', 'photo2.jpg'],
'coordinate': (3, 4),
}, {
'coordinate': (2, 3),
}, {
'coordinate': (4, 1)
... | import flask
app = flask.Flask(__name__)
def make_tour():
tour = {
'id': 1,
'name': 'Test Tour',
'waypoints': [
(5, 2),
(2, 3),
(1, 4),
(4, 4)
],
'landmarks': [
{
'name': 'A Place',
'description': 'This is a description of this place.',
'photos': ['photo1.jpg', 'photo2.jpg'],
... | Add waypoint list and landmark names | Add waypoint list and landmark names
| Python | mit | wtg/RPI_Tours_Server | import flask
app = flask.Flask(__name__)
def make_tour():
tour = {
'id': 1,
'name': 'Test Tour',
'route': [
{
'description': 'This is a description of this place.',
'photos': ['photo1.jpg', 'photo2.jpg'],
'coordinate': (3, 4),
}, {
'coordinate': (2, 3),
}, {
'coordinate': (4, 1)
... | import flask
app = flask.Flask(__name__)
def make_tour():
tour = {
'id': 1,
'name': 'Test Tour',
'waypoints': [
(5, 2),
(2, 3),
(1, 4),
(4, 4)
],
'landmarks': [
{
'name': 'A Place',
'description': 'This is a description of this place.',
'photos': ['photo1.jpg', 'photo2.jpg'],
... | <commit_before>import flask
app = flask.Flask(__name__)
def make_tour():
tour = {
'id': 1,
'name': 'Test Tour',
'route': [
{
'description': 'This is a description of this place.',
'photos': ['photo1.jpg', 'photo2.jpg'],
'coordinate': (3, 4),
}, {
'coordinate': (2, 3),
}, {
'coordin... | import flask
app = flask.Flask(__name__)
def make_tour():
tour = {
'id': 1,
'name': 'Test Tour',
'waypoints': [
(5, 2),
(2, 3),
(1, 4),
(4, 4)
],
'landmarks': [
{
'name': 'A Place',
'description': 'This is a description of this place.',
'photos': ['photo1.jpg', 'photo2.jpg'],
... | import flask
app = flask.Flask(__name__)
def make_tour():
tour = {
'id': 1,
'name': 'Test Tour',
'route': [
{
'description': 'This is a description of this place.',
'photos': ['photo1.jpg', 'photo2.jpg'],
'coordinate': (3, 4),
}, {
'coordinate': (2, 3),
}, {
'coordinate': (4, 1)
... | <commit_before>import flask
app = flask.Flask(__name__)
def make_tour():
tour = {
'id': 1,
'name': 'Test Tour',
'route': [
{
'description': 'This is a description of this place.',
'photos': ['photo1.jpg', 'photo2.jpg'],
'coordinate': (3, 4),
}, {
'coordinate': (2, 3),
}, {
'coordin... |
69b4a3aae4ea0ff8ab07a955c2e113cb1a275525 | setup3.py | setup3.py | import os.path
from setuptools import setup
from setupbase import (setup_args, find_scripts, find_packages)
setup_args['entry_points'] = find_scripts(True, suffix='3')
setup_args['packages'] = find_packages()
def main():
setup(use_2to3 = True, **setup_args)
if __name__ == "__main__":
main()
| import os.path
from setuptools import setup
from setupbase import (setup_args, find_scripts, find_packages, find_package_data)
setup_args['entry_points'] = find_scripts(True, suffix='3')
setup_args['packages'] = find_packages()
setup_args['package_data'] = find_package_data()
def main():
setup(use_2to3 = Tru... | Add notebook resources to Python 3 build process. | Add notebook resources to Python 3 build process.
| Python | bsd-3-clause | ipython/ipython,ipython/ipython | import os.path
from setuptools import setup
from setupbase import (setup_args, find_scripts, find_packages)
setup_args['entry_points'] = find_scripts(True, suffix='3')
setup_args['packages'] = find_packages()
def main():
setup(use_2to3 = True, **setup_args)
if __name__ == "__main__":
main()
Add note... | import os.path
from setuptools import setup
from setupbase import (setup_args, find_scripts, find_packages, find_package_data)
setup_args['entry_points'] = find_scripts(True, suffix='3')
setup_args['packages'] = find_packages()
setup_args['package_data'] = find_package_data()
def main():
setup(use_2to3 = Tru... | <commit_before>import os.path
from setuptools import setup
from setupbase import (setup_args, find_scripts, find_packages)
setup_args['entry_points'] = find_scripts(True, suffix='3')
setup_args['packages'] = find_packages()
def main():
setup(use_2to3 = True, **setup_args)
if __name__ == "__main__":
... | import os.path
from setuptools import setup
from setupbase import (setup_args, find_scripts, find_packages, find_package_data)
setup_args['entry_points'] = find_scripts(True, suffix='3')
setup_args['packages'] = find_packages()
setup_args['package_data'] = find_package_data()
def main():
setup(use_2to3 = Tru... | import os.path
from setuptools import setup
from setupbase import (setup_args, find_scripts, find_packages)
setup_args['entry_points'] = find_scripts(True, suffix='3')
setup_args['packages'] = find_packages()
def main():
setup(use_2to3 = True, **setup_args)
if __name__ == "__main__":
main()
Add note... | <commit_before>import os.path
from setuptools import setup
from setupbase import (setup_args, find_scripts, find_packages)
setup_args['entry_points'] = find_scripts(True, suffix='3')
setup_args['packages'] = find_packages()
def main():
setup(use_2to3 = True, **setup_args)
if __name__ == "__main__":
... |
72af62bdf9339c880b0cc0f1e1002cf1961e962b | rule.py | rule.py | class PriceRule:
"""PriceRule is a rule that triggers when a stock price satisfies a condition.
The condition is usually greater, equal or lesser than a given value.
"""
def __init__(self, symbol, condition):
self.symbol = symbol
self.condition = condition
def matches(self, exchan... | class PriceRule:
"""PriceRule is a rule that triggers when a stock price satisfies a condition.
The condition is usually greater, equal or lesser than a given value.
"""
def __init__(self, symbol, condition):
self.symbol = symbol
self.condition = condition
def matches(self, exchan... | Add matches method to AndRule class. | Add matches method to AndRule class.
| Python | mit | bsmukasa/stock_alerter | class PriceRule:
"""PriceRule is a rule that triggers when a stock price satisfies a condition.
The condition is usually greater, equal or lesser than a given value.
"""
def __init__(self, symbol, condition):
self.symbol = symbol
self.condition = condition
def matches(self, exchan... | class PriceRule:
"""PriceRule is a rule that triggers when a stock price satisfies a condition.
The condition is usually greater, equal or lesser than a given value.
"""
def __init__(self, symbol, condition):
self.symbol = symbol
self.condition = condition
def matches(self, exchan... | <commit_before>class PriceRule:
"""PriceRule is a rule that triggers when a stock price satisfies a condition.
The condition is usually greater, equal or lesser than a given value.
"""
def __init__(self, symbol, condition):
self.symbol = symbol
self.condition = condition
def match... | class PriceRule:
"""PriceRule is a rule that triggers when a stock price satisfies a condition.
The condition is usually greater, equal or lesser than a given value.
"""
def __init__(self, symbol, condition):
self.symbol = symbol
self.condition = condition
def matches(self, exchan... | class PriceRule:
"""PriceRule is a rule that triggers when a stock price satisfies a condition.
The condition is usually greater, equal or lesser than a given value.
"""
def __init__(self, symbol, condition):
self.symbol = symbol
self.condition = condition
def matches(self, exchan... | <commit_before>class PriceRule:
"""PriceRule is a rule that triggers when a stock price satisfies a condition.
The condition is usually greater, equal or lesser than a given value.
"""
def __init__(self, symbol, condition):
self.symbol = symbol
self.condition = condition
def match... |
7198133cf9d24f3d29d300366951b7eac8b2547f | alburnum/maas/viscera/users.py | alburnum/maas/viscera/users.py | """Objects for users."""
__all__ = [
"User",
"Users",
]
from . import (
check,
Object,
ObjectField,
ObjectSet,
ObjectType,
)
class UsersType(ObjectType):
"""Metaclass for `Users`."""
def __iter__(cls):
return map(cls._object, cls._handler.read())
def create(cls, use... | """Objects for users."""
__all__ = [
"User",
"Users",
]
from . import (
check,
Object,
ObjectField,
ObjectSet,
ObjectType,
)
class UsersType(ObjectType):
"""Metaclass for `Users`."""
def __iter__(cls):
return map(cls._object, cls._handler.read())
def create(cls, use... | Change to is_superuser and make email optional. | Change to is_superuser and make email optional.
| Python | agpl-3.0 | blakerouse/python-libmaas,alburnum/alburnum-maas-client | """Objects for users."""
__all__ = [
"User",
"Users",
]
from . import (
check,
Object,
ObjectField,
ObjectSet,
ObjectType,
)
class UsersType(ObjectType):
"""Metaclass for `Users`."""
def __iter__(cls):
return map(cls._object, cls._handler.read())
def create(cls, use... | """Objects for users."""
__all__ = [
"User",
"Users",
]
from . import (
check,
Object,
ObjectField,
ObjectSet,
ObjectType,
)
class UsersType(ObjectType):
"""Metaclass for `Users`."""
def __iter__(cls):
return map(cls._object, cls._handler.read())
def create(cls, use... | <commit_before>"""Objects for users."""
__all__ = [
"User",
"Users",
]
from . import (
check,
Object,
ObjectField,
ObjectSet,
ObjectType,
)
class UsersType(ObjectType):
"""Metaclass for `Users`."""
def __iter__(cls):
return map(cls._object, cls._handler.read())
def ... | """Objects for users."""
__all__ = [
"User",
"Users",
]
from . import (
check,
Object,
ObjectField,
ObjectSet,
ObjectType,
)
class UsersType(ObjectType):
"""Metaclass for `Users`."""
def __iter__(cls):
return map(cls._object, cls._handler.read())
def create(cls, use... | """Objects for users."""
__all__ = [
"User",
"Users",
]
from . import (
check,
Object,
ObjectField,
ObjectSet,
ObjectType,
)
class UsersType(ObjectType):
"""Metaclass for `Users`."""
def __iter__(cls):
return map(cls._object, cls._handler.read())
def create(cls, use... | <commit_before>"""Objects for users."""
__all__ = [
"User",
"Users",
]
from . import (
check,
Object,
ObjectField,
ObjectSet,
ObjectType,
)
class UsersType(ObjectType):
"""Metaclass for `Users`."""
def __iter__(cls):
return map(cls._object, cls._handler.read())
def ... |
ef03459429ba878f7c8f0e1d75f716d829250628 | flaggen.py | flaggen.py | import random
def random_color():
colors = ['white', 'black',
'#cc0033', #red
'#ffcc00', #yellow
'#009933', #green
'#003399', #blue
]
return random.choice(colors)
class Flag:
def __init__(self, **kwargs):
self.mode = kwargs.get(... | import random
class Flag:
def __init__(self, **kwargs):
self.mode = kwargs.get('mode', self.random_mode())
self.bg = kwargs.get('bg', self.random_color())
if self.mode == 'plain':
pass
elif self.mode == 'quarters':
self.quarterpanels = kwargs.get('quarterpan... | Refactor Random Color as Flag Method | Refactor Random Color as Flag Method
| Python | mit | Eylrid/flaggen | import random
def random_color():
colors = ['white', 'black',
'#cc0033', #red
'#ffcc00', #yellow
'#009933', #green
'#003399', #blue
]
return random.choice(colors)
class Flag:
def __init__(self, **kwargs):
self.mode = kwargs.get(... | import random
class Flag:
def __init__(self, **kwargs):
self.mode = kwargs.get('mode', self.random_mode())
self.bg = kwargs.get('bg', self.random_color())
if self.mode == 'plain':
pass
elif self.mode == 'quarters':
self.quarterpanels = kwargs.get('quarterpan... | <commit_before>import random
def random_color():
colors = ['white', 'black',
'#cc0033', #red
'#ffcc00', #yellow
'#009933', #green
'#003399', #blue
]
return random.choice(colors)
class Flag:
def __init__(self, **kwargs):
self.mod... | import random
class Flag:
def __init__(self, **kwargs):
self.mode = kwargs.get('mode', self.random_mode())
self.bg = kwargs.get('bg', self.random_color())
if self.mode == 'plain':
pass
elif self.mode == 'quarters':
self.quarterpanels = kwargs.get('quarterpan... | import random
def random_color():
colors = ['white', 'black',
'#cc0033', #red
'#ffcc00', #yellow
'#009933', #green
'#003399', #blue
]
return random.choice(colors)
class Flag:
def __init__(self, **kwargs):
self.mode = kwargs.get(... | <commit_before>import random
def random_color():
colors = ['white', 'black',
'#cc0033', #red
'#ffcc00', #yellow
'#009933', #green
'#003399', #blue
]
return random.choice(colors)
class Flag:
def __init__(self, **kwargs):
self.mod... |
6bb7ba60f217f8a6dd470d084a664cbf65274681 | software/src/services/open_rocket_simulations.py | software/src/services/open_rocket_simulations.py | import os
JAR_FILE = "/openrocket.jar"
os.environ['CLASSPATH'] = os.getcwd() + JAR_FILE
from jnius import autoclass
class OpenRocketSimulations:
ENTRY_CLASS = 'TeamRocket'
ROCKET_FILE = 'teamrocket.ork'
def __init__(self):
TeamRocket = autoclass(self.ENTRY_CLASS)
self.simulation_file = Tea... | import os
from jnius import autoclass
JAR_FILE = "/openrocket.jar"
os.environ['CLASSPATH'] = os.getcwd() + JAR_FILE
class OpenRocketSimulations:
ENTRY_CLASS = 'TeamRocket'
ROCKET_FILE = 'teamrocket.ork'
def __init__(self):
TeamRocket = autoclass(self.ENTRY_CLASS)
self.simulation_file = Te... | Move specificication of classpath below imports | Move specificication of classpath below imports
| Python | mit | team-rocket-vuw/base-station,team-rocket-vuw/base-station,team-rocket-vuw/base-station,team-rocket-vuw/base-station | import os
JAR_FILE = "/openrocket.jar"
os.environ['CLASSPATH'] = os.getcwd() + JAR_FILE
from jnius import autoclass
class OpenRocketSimulations:
ENTRY_CLASS = 'TeamRocket'
ROCKET_FILE = 'teamrocket.ork'
def __init__(self):
TeamRocket = autoclass(self.ENTRY_CLASS)
self.simulation_file = Tea... | import os
from jnius import autoclass
JAR_FILE = "/openrocket.jar"
os.environ['CLASSPATH'] = os.getcwd() + JAR_FILE
class OpenRocketSimulations:
ENTRY_CLASS = 'TeamRocket'
ROCKET_FILE = 'teamrocket.ork'
def __init__(self):
TeamRocket = autoclass(self.ENTRY_CLASS)
self.simulation_file = Te... | <commit_before>import os
JAR_FILE = "/openrocket.jar"
os.environ['CLASSPATH'] = os.getcwd() + JAR_FILE
from jnius import autoclass
class OpenRocketSimulations:
ENTRY_CLASS = 'TeamRocket'
ROCKET_FILE = 'teamrocket.ork'
def __init__(self):
TeamRocket = autoclass(self.ENTRY_CLASS)
self.simula... | import os
from jnius import autoclass
JAR_FILE = "/openrocket.jar"
os.environ['CLASSPATH'] = os.getcwd() + JAR_FILE
class OpenRocketSimulations:
ENTRY_CLASS = 'TeamRocket'
ROCKET_FILE = 'teamrocket.ork'
def __init__(self):
TeamRocket = autoclass(self.ENTRY_CLASS)
self.simulation_file = Te... | import os
JAR_FILE = "/openrocket.jar"
os.environ['CLASSPATH'] = os.getcwd() + JAR_FILE
from jnius import autoclass
class OpenRocketSimulations:
ENTRY_CLASS = 'TeamRocket'
ROCKET_FILE = 'teamrocket.ork'
def __init__(self):
TeamRocket = autoclass(self.ENTRY_CLASS)
self.simulation_file = Tea... | <commit_before>import os
JAR_FILE = "/openrocket.jar"
os.environ['CLASSPATH'] = os.getcwd() + JAR_FILE
from jnius import autoclass
class OpenRocketSimulations:
ENTRY_CLASS = 'TeamRocket'
ROCKET_FILE = 'teamrocket.ork'
def __init__(self):
TeamRocket = autoclass(self.ENTRY_CLASS)
self.simula... |
8a36070c76d1552e2d2e61c1e5c47202cc28b329 | basket/news/backends/common.py | basket/news/backends/common.py | from functools import wraps
from time import time
from django_statsd.clients import statsd
class UnauthorizedException(Exception):
"""Failure to log into the email server."""
pass
class NewsletterException(Exception):
"""Error when trying to talk to the the email server."""
def __init__(self, msg=... | from functools import wraps
from time import time
from django_statsd.clients import statsd
class UnauthorizedException(Exception):
"""Failure to log into the email server."""
pass
class NewsletterException(Exception):
"""Error when trying to talk to the the email server."""
def __init__(self, msg=... | Refactor the timing decorator to be less confusing | Refactor the timing decorator to be less confusing
Also means that we don't have to ignore a flake8 error.
| Python | mpl-2.0 | glogiotatidis/basket,glogiotatidis/basket,glogiotatidis/basket | from functools import wraps
from time import time
from django_statsd.clients import statsd
class UnauthorizedException(Exception):
"""Failure to log into the email server."""
pass
class NewsletterException(Exception):
"""Error when trying to talk to the the email server."""
def __init__(self, msg=... | from functools import wraps
from time import time
from django_statsd.clients import statsd
class UnauthorizedException(Exception):
"""Failure to log into the email server."""
pass
class NewsletterException(Exception):
"""Error when trying to talk to the the email server."""
def __init__(self, msg=... | <commit_before>from functools import wraps
from time import time
from django_statsd.clients import statsd
class UnauthorizedException(Exception):
"""Failure to log into the email server."""
pass
class NewsletterException(Exception):
"""Error when trying to talk to the the email server."""
def __in... | from functools import wraps
from time import time
from django_statsd.clients import statsd
class UnauthorizedException(Exception):
"""Failure to log into the email server."""
pass
class NewsletterException(Exception):
"""Error when trying to talk to the the email server."""
def __init__(self, msg=... | from functools import wraps
from time import time
from django_statsd.clients import statsd
class UnauthorizedException(Exception):
"""Failure to log into the email server."""
pass
class NewsletterException(Exception):
"""Error when trying to talk to the the email server."""
def __init__(self, msg=... | <commit_before>from functools import wraps
from time import time
from django_statsd.clients import statsd
class UnauthorizedException(Exception):
"""Failure to log into the email server."""
pass
class NewsletterException(Exception):
"""Error when trying to talk to the the email server."""
def __in... |
da50aa9369efbf1d9ae246c40463ae9275857cba | opps/core/models/published.py | opps/core/models/published.py | #!/usr/bin/env python
from django.db import models
from django.utils.translation import ugettext_lazy as _
from datetime import datetime
class PublisherMnager(models.Manager):
def all_published(self):
return super(PublisherMnager, self).get_query_set().filter(
date_available__lte=datetim... | #!/usr/bin/env python
from django.db import models
from django.utils.translation import ugettext_lazy as _
from datetime import datetime
class PublishedMnager(models.Manager):
def all_published(self):
return super(PublisherMnager, self).get_query_set().filter(
date_available__lte=datetim... | Change name manager Publisher to Published | Change name manager Publisher to Published
| Python | mit | jeanmask/opps,YACOWS/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,williamroot/opps,williamroot/opps,jeanmask/opps,opps/opps,YACOWS/opps,opps/opps,opps/opps,williamroot/opps,opps/opps,YACOWS/opps,jeanmask/opps | #!/usr/bin/env python
from django.db import models
from django.utils.translation import ugettext_lazy as _
from datetime import datetime
class PublisherMnager(models.Manager):
def all_published(self):
return super(PublisherMnager, self).get_query_set().filter(
date_available__lte=datetim... | #!/usr/bin/env python
from django.db import models
from django.utils.translation import ugettext_lazy as _
from datetime import datetime
class PublishedMnager(models.Manager):
def all_published(self):
return super(PublisherMnager, self).get_query_set().filter(
date_available__lte=datetim... | <commit_before>#!/usr/bin/env python
from django.db import models
from django.utils.translation import ugettext_lazy as _
from datetime import datetime
class PublisherMnager(models.Manager):
def all_published(self):
return super(PublisherMnager, self).get_query_set().filter(
date_availab... | #!/usr/bin/env python
from django.db import models
from django.utils.translation import ugettext_lazy as _
from datetime import datetime
class PublishedMnager(models.Manager):
def all_published(self):
return super(PublisherMnager, self).get_query_set().filter(
date_available__lte=datetim... | #!/usr/bin/env python
from django.db import models
from django.utils.translation import ugettext_lazy as _
from datetime import datetime
class PublisherMnager(models.Manager):
def all_published(self):
return super(PublisherMnager, self).get_query_set().filter(
date_available__lte=datetim... | <commit_before>#!/usr/bin/env python
from django.db import models
from django.utils.translation import ugettext_lazy as _
from datetime import datetime
class PublisherMnager(models.Manager):
def all_published(self):
return super(PublisherMnager, self).get_query_set().filter(
date_availab... |
775cd06b3e99cef9c777a907fc69c5c20380bb75 | raspicam/camera.py | raspicam/camera.py | import logging
# import picamera
# import picamera.array
from abc import ABCMeta, abstractmethod
import cv2
LOG = logging.getLogger(__name__)
class Camera(metaclass=ABCMeta):
@abstractmethod
def frame_generator(self):
raise NotImplementedError('Not yet implemented')
class USBCam(Camera):
def... | import logging
# import picamera
# import picamera.array
from abc import ABCMeta, abstractmethod
import cv2
LOG = logging.getLogger(__name__)
class Camera(metaclass=ABCMeta):
@abstractmethod
def frame_generator(self):
raise NotImplementedError('Not yet implemented')
class USBCam(Camera):
def... | Allow the USB index to be modified | Allow the USB index to be modified
| Python | mit | exhuma/raspicam,exhuma/raspicam,exhuma/raspicam | import logging
# import picamera
# import picamera.array
from abc import ABCMeta, abstractmethod
import cv2
LOG = logging.getLogger(__name__)
class Camera(metaclass=ABCMeta):
@abstractmethod
def frame_generator(self):
raise NotImplementedError('Not yet implemented')
class USBCam(Camera):
def... | import logging
# import picamera
# import picamera.array
from abc import ABCMeta, abstractmethod
import cv2
LOG = logging.getLogger(__name__)
class Camera(metaclass=ABCMeta):
@abstractmethod
def frame_generator(self):
raise NotImplementedError('Not yet implemented')
class USBCam(Camera):
def... | <commit_before>import logging
# import picamera
# import picamera.array
from abc import ABCMeta, abstractmethod
import cv2
LOG = logging.getLogger(__name__)
class Camera(metaclass=ABCMeta):
@abstractmethod
def frame_generator(self):
raise NotImplementedError('Not yet implemented')
class USBCam(Ca... | import logging
# import picamera
# import picamera.array
from abc import ABCMeta, abstractmethod
import cv2
LOG = logging.getLogger(__name__)
class Camera(metaclass=ABCMeta):
@abstractmethod
def frame_generator(self):
raise NotImplementedError('Not yet implemented')
class USBCam(Camera):
def... | import logging
# import picamera
# import picamera.array
from abc import ABCMeta, abstractmethod
import cv2
LOG = logging.getLogger(__name__)
class Camera(metaclass=ABCMeta):
@abstractmethod
def frame_generator(self):
raise NotImplementedError('Not yet implemented')
class USBCam(Camera):
def... | <commit_before>import logging
# import picamera
# import picamera.array
from abc import ABCMeta, abstractmethod
import cv2
LOG = logging.getLogger(__name__)
class Camera(metaclass=ABCMeta):
@abstractmethod
def frame_generator(self):
raise NotImplementedError('Not yet implemented')
class USBCam(Ca... |
c2562a8cb2e3d5d3f68604c32d4db7e62422e7a5 | pathvalidate/_symbol.py | pathvalidate/_symbol.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import, unicode_literals
import re
from ._common import _preprocess, ascii_symbol_list, is_not_null_string, unprintable_ascii_char_list
from .error import InvalidCharError
__RE_SYMBOL = re.com... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import, unicode_literals
import re
from ._common import _preprocess, ascii_symbol_list, unprintable_ascii_char_list
from .error import InvalidCharError
__RE_SYMBOL = re.compile(
"[{}]".for... | Remove an import that no longer used | Remove an import that no longer used
| Python | mit | thombashi/pathvalidate | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import, unicode_literals
import re
from ._common import _preprocess, ascii_symbol_list, is_not_null_string, unprintable_ascii_char_list
from .error import InvalidCharError
__RE_SYMBOL = re.com... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import, unicode_literals
import re
from ._common import _preprocess, ascii_symbol_list, unprintable_ascii_char_list
from .error import InvalidCharError
__RE_SYMBOL = re.compile(
"[{}]".for... | <commit_before># encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import, unicode_literals
import re
from ._common import _preprocess, ascii_symbol_list, is_not_null_string, unprintable_ascii_char_list
from .error import InvalidCharError
__RE_... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import, unicode_literals
import re
from ._common import _preprocess, ascii_symbol_list, unprintable_ascii_char_list
from .error import InvalidCharError
__RE_SYMBOL = re.compile(
"[{}]".for... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import, unicode_literals
import re
from ._common import _preprocess, ascii_symbol_list, is_not_null_string, unprintable_ascii_char_list
from .error import InvalidCharError
__RE_SYMBOL = re.com... | <commit_before># encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import, unicode_literals
import re
from ._common import _preprocess, ascii_symbol_list, is_not_null_string, unprintable_ascii_char_list
from .error import InvalidCharError
__RE_... |
0e8a5e56c53fed0834982a50b96be0a587a18fcb | pebble_tool/__init__.py | pebble_tool/__init__.py | from __future__ import absolute_import, print_function
__author__ = 'katharine'
import argparse
import logging
import sys
from .commands.base import register_children
from .commands import repl, install, screenshot, logs, account, timeline
from .commands.sdk import build, emulator, create, convert
from .exceptions im... | from __future__ import absolute_import, print_function
__author__ = 'katharine'
import argparse
import logging
import sys
from .commands.base import register_children
from .commands.sdk import build, create
from .commands import install, logs, screenshot, timeline, account, repl
from .commands.sdk import convert, emu... | Change the order of the subcommands. | Change the order of the subcommands.
| Python | mit | gregoiresage/pebble-tool,pebble/pebble-tool,pebble/pebble-tool,pebble/pebble-tool,gregoiresage/pebble-tool,gregoiresage/pebble-tool,pebble/pebble-tool,gregoiresage/pebble-tool | from __future__ import absolute_import, print_function
__author__ = 'katharine'
import argparse
import logging
import sys
from .commands.base import register_children
from .commands import repl, install, screenshot, logs, account, timeline
from .commands.sdk import build, emulator, create, convert
from .exceptions im... | from __future__ import absolute_import, print_function
__author__ = 'katharine'
import argparse
import logging
import sys
from .commands.base import register_children
from .commands.sdk import build, create
from .commands import install, logs, screenshot, timeline, account, repl
from .commands.sdk import convert, emu... | <commit_before>from __future__ import absolute_import, print_function
__author__ = 'katharine'
import argparse
import logging
import sys
from .commands.base import register_children
from .commands import repl, install, screenshot, logs, account, timeline
from .commands.sdk import build, emulator, create, convert
from... | from __future__ import absolute_import, print_function
__author__ = 'katharine'
import argparse
import logging
import sys
from .commands.base import register_children
from .commands.sdk import build, create
from .commands import install, logs, screenshot, timeline, account, repl
from .commands.sdk import convert, emu... | from __future__ import absolute_import, print_function
__author__ = 'katharine'
import argparse
import logging
import sys
from .commands.base import register_children
from .commands import repl, install, screenshot, logs, account, timeline
from .commands.sdk import build, emulator, create, convert
from .exceptions im... | <commit_before>from __future__ import absolute_import, print_function
__author__ = 'katharine'
import argparse
import logging
import sys
from .commands.base import register_children
from .commands import repl, install, screenshot, logs, account, timeline
from .commands.sdk import build, emulator, create, convert
from... |
e487761b9eecdc426565db06398d24dac540d4b4 | sigal/plugins/copyright.py | sigal/plugins/copyright.py | # -*- coding: utf-8 -*-
"""Plugin which add a copyright to the image.
Settings:
- ``copyright``: the copyright text.
TODO: Add more settings (font, size, ...)
"""
import logging
from PIL import ImageDraw
from sigal import signals
logger = logging.getLogger(__name__)
def add_copyright(img, settings=None):
l... | # -*- coding: utf-8 -*-
"""Plugin which add a copyright to the image.
Settings:
- ``copyright``: the copyright text.
- ``copyright_text_font``: the copyright text font - either system/user font-name or absolute path to font.tff file.
If no font is specified, or specified font is not found,... | Update to allow more settings for font, color, position | Update to allow more settings for font, color, position
- copyright_text_font: a system or user font name, or absolute path to
.ttf file
- copyright_text_font_size: font size used when
copyright_text_font is set
- copyright_text_color: text color
- copyright_text_position: a 2 tuple (x,y) specifying coordinates of top... | Python | mit | jasuarez/sigal,xouillet/sigal,jasuarez/sigal,jdn06/sigal,kontza/sigal,jdn06/sigal,xouillet/sigal,saimn/sigal,cbosdo/sigal,cbosdo/sigal,xouillet/sigal,elaOnMars/sigal,Ferada/sigal,t-animal/sigal,elaOnMars/sigal,Ferada/sigal,kontza/sigal,jdn06/sigal,cbosdo/sigal,kontza/sigal,Ferada/sigal,saimn/sigal,franek/sigal,t-animal... | # -*- coding: utf-8 -*-
"""Plugin which add a copyright to the image.
Settings:
- ``copyright``: the copyright text.
TODO: Add more settings (font, size, ...)
"""
import logging
from PIL import ImageDraw
from sigal import signals
logger = logging.getLogger(__name__)
def add_copyright(img, settings=None):
l... | # -*- coding: utf-8 -*-
"""Plugin which add a copyright to the image.
Settings:
- ``copyright``: the copyright text.
- ``copyright_text_font``: the copyright text font - either system/user font-name or absolute path to font.tff file.
If no font is specified, or specified font is not found,... | <commit_before># -*- coding: utf-8 -*-
"""Plugin which add a copyright to the image.
Settings:
- ``copyright``: the copyright text.
TODO: Add more settings (font, size, ...)
"""
import logging
from PIL import ImageDraw
from sigal import signals
logger = logging.getLogger(__name__)
def add_copyright(img, settin... | # -*- coding: utf-8 -*-
"""Plugin which add a copyright to the image.
Settings:
- ``copyright``: the copyright text.
- ``copyright_text_font``: the copyright text font - either system/user font-name or absolute path to font.tff file.
If no font is specified, or specified font is not found,... | # -*- coding: utf-8 -*-
"""Plugin which add a copyright to the image.
Settings:
- ``copyright``: the copyright text.
TODO: Add more settings (font, size, ...)
"""
import logging
from PIL import ImageDraw
from sigal import signals
logger = logging.getLogger(__name__)
def add_copyright(img, settings=None):
l... | <commit_before># -*- coding: utf-8 -*-
"""Plugin which add a copyright to the image.
Settings:
- ``copyright``: the copyright text.
TODO: Add more settings (font, size, ...)
"""
import logging
from PIL import ImageDraw
from sigal import signals
logger = logging.getLogger(__name__)
def add_copyright(img, settin... |
7f3c086a953f91ec7f351c56a4f07f38dc0b9eb3 | exampleCourse/elements/course_element/course_element.py | exampleCourse/elements/course_element/course_element.py | import random
import chevron
def get_dependencies(element_html, element_index, data):
return {
'styles': ['course_element.css'],
'scripts': ['course_element.js']
}
def render(element_html, element_index, data):
html_params = { 'number': random.random() }
with open('course_element.musta... | import random
import chevron
def render(element_html, element_index, data):
html_params = { 'number': random.random() }
with open('course_element.mustache','r') as f:
return chevron.render(f, html_params).strip()
| Remove unneeded get_dependencies from course element | Remove unneeded get_dependencies from course element
| Python | agpl-3.0 | parasgithub/PrairieLearn,rbessick5/PrairieLearn,tbretl/PrairieLearn,parasgithub/PrairieLearn,jakebailey/PrairieLearn,parasgithub/PrairieLearn,tbretl/PrairieLearn,rbessick5/PrairieLearn,jakebailey/PrairieLearn,jakebailey/PrairieLearn,rbessick5/PrairieLearn,mwest1066/PrairieLearn,mwest1066/PrairieLearn,parasgithub/Prairi... | import random
import chevron
def get_dependencies(element_html, element_index, data):
return {
'styles': ['course_element.css'],
'scripts': ['course_element.js']
}
def render(element_html, element_index, data):
html_params = { 'number': random.random() }
with open('course_element.musta... | import random
import chevron
def render(element_html, element_index, data):
html_params = { 'number': random.random() }
with open('course_element.mustache','r') as f:
return chevron.render(f, html_params).strip()
| <commit_before>import random
import chevron
def get_dependencies(element_html, element_index, data):
return {
'styles': ['course_element.css'],
'scripts': ['course_element.js']
}
def render(element_html, element_index, data):
html_params = { 'number': random.random() }
with open('cours... | import random
import chevron
def render(element_html, element_index, data):
html_params = { 'number': random.random() }
with open('course_element.mustache','r') as f:
return chevron.render(f, html_params).strip()
| import random
import chevron
def get_dependencies(element_html, element_index, data):
return {
'styles': ['course_element.css'],
'scripts': ['course_element.js']
}
def render(element_html, element_index, data):
html_params = { 'number': random.random() }
with open('course_element.musta... | <commit_before>import random
import chevron
def get_dependencies(element_html, element_index, data):
return {
'styles': ['course_element.css'],
'scripts': ['course_element.js']
}
def render(element_html, element_index, data):
html_params = { 'number': random.random() }
with open('cours... |
cebfd01451a2d78217bffd171ab3bcccbabf895f | zerodb/collective/indexing/indexer.py | zerodb/collective/indexing/indexer.py | from zope.interface import implements
#from Products.Archetypes.CatalogMultiplex import CatalogMultiplex
#from Products.CMFCore.CMFCatalogAware import CMFCatalogAware
from zerodb.collective.indexing.interfaces import IIndexQueueProcessor
# container to hold references to the original and "monkeyed" indexing methods
#... | from zope.interface import implements
from zerodb.collective.indexing.interfaces import IIndexQueueProcessor
class IPortalCatalogQueueProcessor(IIndexQueueProcessor):
""" an index queue processor for the standard portal catalog via
the `CatalogMultiplex` and `CMFCatalogAware` mixin classes """
class Por... | Remove unused code for monkeyed methods | Remove unused code for monkeyed methods
| Python | agpl-3.0 | zero-db/zerodb,zerodb/zerodb,zero-db/zerodb,zerodb/zerodb | from zope.interface import implements
#from Products.Archetypes.CatalogMultiplex import CatalogMultiplex
#from Products.CMFCore.CMFCatalogAware import CMFCatalogAware
from zerodb.collective.indexing.interfaces import IIndexQueueProcessor
# container to hold references to the original and "monkeyed" indexing methods
#... | from zope.interface import implements
from zerodb.collective.indexing.interfaces import IIndexQueueProcessor
class IPortalCatalogQueueProcessor(IIndexQueueProcessor):
""" an index queue processor for the standard portal catalog via
the `CatalogMultiplex` and `CMFCatalogAware` mixin classes """
class Por... | <commit_before>from zope.interface import implements
#from Products.Archetypes.CatalogMultiplex import CatalogMultiplex
#from Products.CMFCore.CMFCatalogAware import CMFCatalogAware
from zerodb.collective.indexing.interfaces import IIndexQueueProcessor
# container to hold references to the original and "monkeyed" ind... | from zope.interface import implements
from zerodb.collective.indexing.interfaces import IIndexQueueProcessor
class IPortalCatalogQueueProcessor(IIndexQueueProcessor):
""" an index queue processor for the standard portal catalog via
the `CatalogMultiplex` and `CMFCatalogAware` mixin classes """
class Por... | from zope.interface import implements
#from Products.Archetypes.CatalogMultiplex import CatalogMultiplex
#from Products.CMFCore.CMFCatalogAware import CMFCatalogAware
from zerodb.collective.indexing.interfaces import IIndexQueueProcessor
# container to hold references to the original and "monkeyed" indexing methods
#... | <commit_before>from zope.interface import implements
#from Products.Archetypes.CatalogMultiplex import CatalogMultiplex
#from Products.CMFCore.CMFCatalogAware import CMFCatalogAware
from zerodb.collective.indexing.interfaces import IIndexQueueProcessor
# container to hold references to the original and "monkeyed" ind... |
7f8e5913f493582608712244cbfff0bf8d658c51 | chainerrl/misc/batch_states.py | chainerrl/misc/batch_states.py | import chainer
def batch_states(states, xp, phi):
"""The default method for making batch of observations.
Args:
states (list): list of observations from an environment.
xp (module): numpy or cupy
phi (callable): Feature extractor applied to observations
Return:
the object... | import chainer
def batch_states(states, xp, phi):
"""The default method for making batch of observations.
Args:
states (list): list of observations from an environment.
xp (module): numpy or cupy
phi (callable): Feature extractor applied to observations
Return:
the object... | Fix error of chainer v3 on chainer.cuda.cupy | Fix error of chainer v3 on chainer.cuda.cupy
| Python | mit | toslunar/chainerrl,toslunar/chainerrl | import chainer
def batch_states(states, xp, phi):
"""The default method for making batch of observations.
Args:
states (list): list of observations from an environment.
xp (module): numpy or cupy
phi (callable): Feature extractor applied to observations
Return:
the object... | import chainer
def batch_states(states, xp, phi):
"""The default method for making batch of observations.
Args:
states (list): list of observations from an environment.
xp (module): numpy or cupy
phi (callable): Feature extractor applied to observations
Return:
the object... | <commit_before>import chainer
def batch_states(states, xp, phi):
"""The default method for making batch of observations.
Args:
states (list): list of observations from an environment.
xp (module): numpy or cupy
phi (callable): Feature extractor applied to observations
Return:
... | import chainer
def batch_states(states, xp, phi):
"""The default method for making batch of observations.
Args:
states (list): list of observations from an environment.
xp (module): numpy or cupy
phi (callable): Feature extractor applied to observations
Return:
the object... | import chainer
def batch_states(states, xp, phi):
"""The default method for making batch of observations.
Args:
states (list): list of observations from an environment.
xp (module): numpy or cupy
phi (callable): Feature extractor applied to observations
Return:
the object... | <commit_before>import chainer
def batch_states(states, xp, phi):
"""The default method for making batch of observations.
Args:
states (list): list of observations from an environment.
xp (module): numpy or cupy
phi (callable): Feature extractor applied to observations
Return:
... |
46aaaf4f2323ec25e87f88ed80435288a31d5b13 | armstrong/apps/series/admin.py | armstrong/apps/series/admin.py | from django.contrib import admin
from django.contrib.contenttypes import generic
from . import models
class SeriesNodeInline(generic.GenericTabularInline):
model = models.SeriesNode
class SeriesAdmin(admin.ModelAdmin):
model = models.Series
inlines = [
SeriesNodeInline,
]
prepopulated... | from django.contrib import admin
from . import models
class SeriesAdmin(admin.ModelAdmin):
model = models.Series
prepopulated_fields = {
'slug': ('title', ),
}
admin.site.register(models.Series, SeriesAdmin)
| Remove all of the SeriesNode inline stuff (doesn't work yet) | Remove all of the SeriesNode inline stuff (doesn't work yet)
| Python | apache-2.0 | armstrong/armstrong.apps.series,armstrong/armstrong.apps.series | from django.contrib import admin
from django.contrib.contenttypes import generic
from . import models
class SeriesNodeInline(generic.GenericTabularInline):
model = models.SeriesNode
class SeriesAdmin(admin.ModelAdmin):
model = models.Series
inlines = [
SeriesNodeInline,
]
prepopulated... | from django.contrib import admin
from . import models
class SeriesAdmin(admin.ModelAdmin):
model = models.Series
prepopulated_fields = {
'slug': ('title', ),
}
admin.site.register(models.Series, SeriesAdmin)
| <commit_before>from django.contrib import admin
from django.contrib.contenttypes import generic
from . import models
class SeriesNodeInline(generic.GenericTabularInline):
model = models.SeriesNode
class SeriesAdmin(admin.ModelAdmin):
model = models.Series
inlines = [
SeriesNodeInline,
]
... | from django.contrib import admin
from . import models
class SeriesAdmin(admin.ModelAdmin):
model = models.Series
prepopulated_fields = {
'slug': ('title', ),
}
admin.site.register(models.Series, SeriesAdmin)
| from django.contrib import admin
from django.contrib.contenttypes import generic
from . import models
class SeriesNodeInline(generic.GenericTabularInline):
model = models.SeriesNode
class SeriesAdmin(admin.ModelAdmin):
model = models.Series
inlines = [
SeriesNodeInline,
]
prepopulated... | <commit_before>from django.contrib import admin
from django.contrib.contenttypes import generic
from . import models
class SeriesNodeInline(generic.GenericTabularInline):
model = models.SeriesNode
class SeriesAdmin(admin.ModelAdmin):
model = models.Series
inlines = [
SeriesNodeInline,
]
... |
509cbe502cf9a6fd6c0f86469656c01edd4eddf1 | pygments/styles/igor.py | pygments/styles/igor.py | from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic
class IgorStyle(Style):
default_style = ""
styles = {
Comment: 'italic #FF0000',
Keyword: '#0000FF',
Name.Function: ... | from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic
class IgorStyle(Style):
"""
Pygments version of the official colors for Igor Pro procedures.
"""
default_style = ""
styles = {
Comment: 'italic ... | Add class comment and a custom color for the decorator | Add class comment and a custom color for the decorator
| Python | bsd-2-clause | aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygmen... | from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic
class IgorStyle(Style):
default_style = ""
styles = {
Comment: 'italic #FF0000',
Keyword: '#0000FF',
Name.Function: ... | from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic
class IgorStyle(Style):
"""
Pygments version of the official colors for Igor Pro procedures.
"""
default_style = ""
styles = {
Comment: 'italic ... | <commit_before>from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic
class IgorStyle(Style):
default_style = ""
styles = {
Comment: 'italic #FF0000',
Keyword: '#0000FF',
Name.Func... | from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic
class IgorStyle(Style):
"""
Pygments version of the official colors for Igor Pro procedures.
"""
default_style = ""
styles = {
Comment: 'italic ... | from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic
class IgorStyle(Style):
default_style = ""
styles = {
Comment: 'italic #FF0000',
Keyword: '#0000FF',
Name.Function: ... | <commit_before>from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic
class IgorStyle(Style):
default_style = ""
styles = {
Comment: 'italic #FF0000',
Keyword: '#0000FF',
Name.Func... |
f5e547ed6ef642406e771a62796d738649c31a0f | python/FlatFileTable.py | python/FlatFileTable.py | #!/usr/bin/env python
import sys, itertools
def record_generator(filename, sep="\t", skip_n_lines=0):
"""Given a file with field headers on the first line and records on subsequent lines,
generates a dictionary for each line keyed by the header fields"""
fin = open(filename)
for i in range(skip_n_lines):... | #!/usr/bin/env python
import sys, itertools
def record_generator(filename, sep="\t", skip_n_lines=0, skip_until_regex_line=""):
"""Given a file with field headers on the first line and records on subsequent lines,
generates a dictionary for each line keyed by the header fields"""
fin = open(filename)
if ... | Add ability for flat file table parsing module to skip ahead to first occurence of a regular expression (use case: consistently parsing DepthOfCoverage output for histogram section of file across file format changes) | Add ability for flat file table parsing module to skip ahead to first occurence of a regular expression (use case: consistently parsing DepthOfCoverage output for histogram section of file across file format changes)
git-svn-id: 4561c0a8f080806b19201efb9525134c00b76d40@2377 348d0f76-0448-11de-a6fe-93d51630548a
| Python | mit | iontorrent/Torrent-Variant-Caller-stable,iontorrent/Torrent-Variant-Caller-stable,iontorrent/Torrent-Variant-Caller-stable,iontorrent/Torrent-Variant-Caller-stable,iontorrent/Torrent-Variant-Caller-stable,iontorrent/Torrent-Variant-Caller-stable,iontorrent/Torrent-Variant-Caller-stable,iontorrent/Torrent-Variant-Caller... | #!/usr/bin/env python
import sys, itertools
def record_generator(filename, sep="\t", skip_n_lines=0):
"""Given a file with field headers on the first line and records on subsequent lines,
generates a dictionary for each line keyed by the header fields"""
fin = open(filename)
for i in range(skip_n_lines):... | #!/usr/bin/env python
import sys, itertools
def record_generator(filename, sep="\t", skip_n_lines=0, skip_until_regex_line=""):
"""Given a file with field headers on the first line and records on subsequent lines,
generates a dictionary for each line keyed by the header fields"""
fin = open(filename)
if ... | <commit_before>#!/usr/bin/env python
import sys, itertools
def record_generator(filename, sep="\t", skip_n_lines=0):
"""Given a file with field headers on the first line and records on subsequent lines,
generates a dictionary for each line keyed by the header fields"""
fin = open(filename)
for i in range... | #!/usr/bin/env python
import sys, itertools
def record_generator(filename, sep="\t", skip_n_lines=0, skip_until_regex_line=""):
"""Given a file with field headers on the first line and records on subsequent lines,
generates a dictionary for each line keyed by the header fields"""
fin = open(filename)
if ... | #!/usr/bin/env python
import sys, itertools
def record_generator(filename, sep="\t", skip_n_lines=0):
"""Given a file with field headers on the first line and records on subsequent lines,
generates a dictionary for each line keyed by the header fields"""
fin = open(filename)
for i in range(skip_n_lines):... | <commit_before>#!/usr/bin/env python
import sys, itertools
def record_generator(filename, sep="\t", skip_n_lines=0):
"""Given a file with field headers on the first line and records on subsequent lines,
generates a dictionary for each line keyed by the header fields"""
fin = open(filename)
for i in range... |
20079bf375149bb0e8646a2d81dd800028f49faa | captura/views.py | captura/views.py | from django.contrib.auth.decorators import user_passes_test, login_required
from django.shortcuts import render
from perfiles_usuario.utils import is_capturista
from estudios_socioeconomicos.models import Estudio
@login_required
#@user_passes_test(is_capturista)
def capturista_dashboard(request):
"""View to rende... | from django.contrib.auth.decorators import user_passes_test, login_required
from django.shortcuts import render
from perfiles_usuario.utils import is_capturista
from estudios_socioeconomicos.models import Estudio
@login_required
@user_passes_test(is_capturista)
def capturista_dashboard(request):
"""View to render... | Add more comments in capturist dashboard view | Add more comments in capturist dashboard view
| Python | mit | erikiado/jp2_online,erikiado/jp2_online,erikiado/jp2_online | from django.contrib.auth.decorators import user_passes_test, login_required
from django.shortcuts import render
from perfiles_usuario.utils import is_capturista
from estudios_socioeconomicos.models import Estudio
@login_required
#@user_passes_test(is_capturista)
def capturista_dashboard(request):
"""View to rende... | from django.contrib.auth.decorators import user_passes_test, login_required
from django.shortcuts import render
from perfiles_usuario.utils import is_capturista
from estudios_socioeconomicos.models import Estudio
@login_required
@user_passes_test(is_capturista)
def capturista_dashboard(request):
"""View to render... | <commit_before>from django.contrib.auth.decorators import user_passes_test, login_required
from django.shortcuts import render
from perfiles_usuario.utils import is_capturista
from estudios_socioeconomicos.models import Estudio
@login_required
#@user_passes_test(is_capturista)
def capturista_dashboard(request):
"... | from django.contrib.auth.decorators import user_passes_test, login_required
from django.shortcuts import render
from perfiles_usuario.utils import is_capturista
from estudios_socioeconomicos.models import Estudio
@login_required
@user_passes_test(is_capturista)
def capturista_dashboard(request):
"""View to render... | from django.contrib.auth.decorators import user_passes_test, login_required
from django.shortcuts import render
from perfiles_usuario.utils import is_capturista
from estudios_socioeconomicos.models import Estudio
@login_required
#@user_passes_test(is_capturista)
def capturista_dashboard(request):
"""View to rende... | <commit_before>from django.contrib.auth.decorators import user_passes_test, login_required
from django.shortcuts import render
from perfiles_usuario.utils import is_capturista
from estudios_socioeconomicos.models import Estudio
@login_required
#@user_passes_test(is_capturista)
def capturista_dashboard(request):
"... |
7e59dc64a8aad61016c0b3f05b467bc4a3e02f57 | deploy/generate_production_ini.py | deploy/generate_production_ini.py | """
Based on environment variables make a config file (production.ini) for our encoded application.
"""
import os
from dcicutils.deployment_utils import Deployer
class FourfrontDeployer(Deployer):
_MY_DIR = os.path.dirname(__file__)
TEMPLATE_DIR = os.path.join(_MY_DIR, "ini_files")
PYPROJECT_FILE_NAME = ... | """
Based on environment variables make a config file (production.ini) for our encoded application.
"""
import os
from dcicutils.deployment_utils import BasicLegacyFourfrontIniFileManager
class FourfrontDeployer(BasicLegacyFourfrontIniFileManager):
_MY_DIR = os.path.dirname(__file__)
TEMPLATE_DIR = os.path.j... | Adjust deployer to use new class name for ini file management. | Adjust deployer to use new class name for ini file management.
| Python | mit | 4dn-dcic/fourfront,4dn-dcic/fourfront,4dn-dcic/fourfront,4dn-dcic/fourfront | """
Based on environment variables make a config file (production.ini) for our encoded application.
"""
import os
from dcicutils.deployment_utils import Deployer
class FourfrontDeployer(Deployer):
_MY_DIR = os.path.dirname(__file__)
TEMPLATE_DIR = os.path.join(_MY_DIR, "ini_files")
PYPROJECT_FILE_NAME = ... | """
Based on environment variables make a config file (production.ini) for our encoded application.
"""
import os
from dcicutils.deployment_utils import BasicLegacyFourfrontIniFileManager
class FourfrontDeployer(BasicLegacyFourfrontIniFileManager):
_MY_DIR = os.path.dirname(__file__)
TEMPLATE_DIR = os.path.j... | <commit_before>"""
Based on environment variables make a config file (production.ini) for our encoded application.
"""
import os
from dcicutils.deployment_utils import Deployer
class FourfrontDeployer(Deployer):
_MY_DIR = os.path.dirname(__file__)
TEMPLATE_DIR = os.path.join(_MY_DIR, "ini_files")
PYPROJE... | """
Based on environment variables make a config file (production.ini) for our encoded application.
"""
import os
from dcicutils.deployment_utils import BasicLegacyFourfrontIniFileManager
class FourfrontDeployer(BasicLegacyFourfrontIniFileManager):
_MY_DIR = os.path.dirname(__file__)
TEMPLATE_DIR = os.path.j... | """
Based on environment variables make a config file (production.ini) for our encoded application.
"""
import os
from dcicutils.deployment_utils import Deployer
class FourfrontDeployer(Deployer):
_MY_DIR = os.path.dirname(__file__)
TEMPLATE_DIR = os.path.join(_MY_DIR, "ini_files")
PYPROJECT_FILE_NAME = ... | <commit_before>"""
Based on environment variables make a config file (production.ini) for our encoded application.
"""
import os
from dcicutils.deployment_utils import Deployer
class FourfrontDeployer(Deployer):
_MY_DIR = os.path.dirname(__file__)
TEMPLATE_DIR = os.path.join(_MY_DIR, "ini_files")
PYPROJE... |
c4669c8fbaefc0a6e727d6423925f673e7c0a618 | scripts/examples/02-Board-Control/timer_control.py | scripts/examples/02-Board-Control/timer_control.py | # Timer Control Example
#
# This example shows how to use a timer for callbacks.
import time
from pyb import Pin, Timer, LED
blue_led = LED(3)
# we will receive the timer object when being called
# Note: functions that allocate memory are Not allowed in callbacks
def tick(timer):
blue_led.toggle()
... | # Timer Control Example
#
# This example shows how to use a timer for callbacks.
import time
from pyb import Pin, Timer, LED
blue_led = LED(3)
# we will receive the timer object when being called
# Note: functions that allocate memory are Not allowed in callbacks
def tick(timer):
blue_led.toggle()
... | Update timer test script to use non-reserved timer. | Update timer test script to use non-reserved timer.
| Python | mit | iabdalkader/openmv,kwagyeman/openmv,kwagyeman/openmv,openmv/openmv,iabdalkader/openmv,kwagyeman/openmv,kwagyeman/openmv,openmv/openmv,openmv/openmv,openmv/openmv,iabdalkader/openmv,iabdalkader/openmv | # Timer Control Example
#
# This example shows how to use a timer for callbacks.
import time
from pyb import Pin, Timer, LED
blue_led = LED(3)
# we will receive the timer object when being called
# Note: functions that allocate memory are Not allowed in callbacks
def tick(timer):
blue_led.toggle()
... | # Timer Control Example
#
# This example shows how to use a timer for callbacks.
import time
from pyb import Pin, Timer, LED
blue_led = LED(3)
# we will receive the timer object when being called
# Note: functions that allocate memory are Not allowed in callbacks
def tick(timer):
blue_led.toggle()
... | <commit_before># Timer Control Example
#
# This example shows how to use a timer for callbacks.
import time
from pyb import Pin, Timer, LED
blue_led = LED(3)
# we will receive the timer object when being called
# Note: functions that allocate memory are Not allowed in callbacks
def tick(timer):
blue... | # Timer Control Example
#
# This example shows how to use a timer for callbacks.
import time
from pyb import Pin, Timer, LED
blue_led = LED(3)
# we will receive the timer object when being called
# Note: functions that allocate memory are Not allowed in callbacks
def tick(timer):
blue_led.toggle()
... | # Timer Control Example
#
# This example shows how to use a timer for callbacks.
import time
from pyb import Pin, Timer, LED
blue_led = LED(3)
# we will receive the timer object when being called
# Note: functions that allocate memory are Not allowed in callbacks
def tick(timer):
blue_led.toggle()
... | <commit_before># Timer Control Example
#
# This example shows how to use a timer for callbacks.
import time
from pyb import Pin, Timer, LED
blue_led = LED(3)
# we will receive the timer object when being called
# Note: functions that allocate memory are Not allowed in callbacks
def tick(timer):
blue... |
e19357bb91bf3ae794dc239340c68b82d569698d | bmi_ilamb/config.py | bmi_ilamb/config.py | """Reads and parses a configuration file for the ILAMB BMI."""
from os.path import join
import yaml
ilamb_root_key = 'ilamb_root'
model_root_key = 'model_root'
class Configuration(object):
def __init__(self):
self._config = {}
def load(self, filename):
with open(filename, 'r') as fp:
... | """Reads and parses a configuration file for the ILAMB BMI."""
from os.path import join
import yaml
ilamb_root_key = 'ilamb_root'
model_root_key = 'model_root'
models_key = 'models'
class Configuration(object):
def __init__(self):
self._config = {}
def load(self, filename):
with open(file... | Add ability to pass 'models' argument to ilamb-run | Add ability to pass 'models' argument to ilamb-run
This is needed to benchmark individual models instead of all the
models under the directory specified by `model_root`.
| Python | mit | permamodel/bmi-ilamb | """Reads and parses a configuration file for the ILAMB BMI."""
from os.path import join
import yaml
ilamb_root_key = 'ilamb_root'
model_root_key = 'model_root'
class Configuration(object):
def __init__(self):
self._config = {}
def load(self, filename):
with open(filename, 'r') as fp:
... | """Reads and parses a configuration file for the ILAMB BMI."""
from os.path import join
import yaml
ilamb_root_key = 'ilamb_root'
model_root_key = 'model_root'
models_key = 'models'
class Configuration(object):
def __init__(self):
self._config = {}
def load(self, filename):
with open(file... | <commit_before>"""Reads and parses a configuration file for the ILAMB BMI."""
from os.path import join
import yaml
ilamb_root_key = 'ilamb_root'
model_root_key = 'model_root'
class Configuration(object):
def __init__(self):
self._config = {}
def load(self, filename):
with open(filename, '... | """Reads and parses a configuration file for the ILAMB BMI."""
from os.path import join
import yaml
ilamb_root_key = 'ilamb_root'
model_root_key = 'model_root'
models_key = 'models'
class Configuration(object):
def __init__(self):
self._config = {}
def load(self, filename):
with open(file... | """Reads and parses a configuration file for the ILAMB BMI."""
from os.path import join
import yaml
ilamb_root_key = 'ilamb_root'
model_root_key = 'model_root'
class Configuration(object):
def __init__(self):
self._config = {}
def load(self, filename):
with open(filename, 'r') as fp:
... | <commit_before>"""Reads and parses a configuration file for the ILAMB BMI."""
from os.path import join
import yaml
ilamb_root_key = 'ilamb_root'
model_root_key = 'model_root'
class Configuration(object):
def __init__(self):
self._config = {}
def load(self, filename):
with open(filename, '... |
14b8bbf0cade0c31d521e42c6c4c9b57bafaa12a | src/amber/hokuyo/hokuyo.py | src/amber/hokuyo/hokuyo.py | import logging.config
import sys
import os
import time
import serial
from amber.hokuyo.hokuyo_common import HokuyoController
from amber.tools import serial_port, config
__author__ = 'paoolo'
LOGGER_NAME = 'AmberPipes'
pwd = os.path.dirname(os.path.abspath(__file__))
config.add_config_ini('%s/hokuyo.ini' % pwd)
log... | import logging.config
import sys
import os
import serial
from amber.hokuyo.hokuyo_common import HokuyoController
from amber.tools import serial_port, config
__author__ = 'paoolo'
LOGGER_NAME = 'AmberPipes'
pwd = os.path.dirname(os.path.abspath(__file__))
config.add_config_ini('%s/hokuyo.ini' % pwd)
logging.config.... | Remove auto start in loop with "while True". | Remove auto start in loop with "while True".
| Python | mit | showmen15/testEEE,showmen15/testEEE | import logging.config
import sys
import os
import time
import serial
from amber.hokuyo.hokuyo_common import HokuyoController
from amber.tools import serial_port, config
__author__ = 'paoolo'
LOGGER_NAME = 'AmberPipes'
pwd = os.path.dirname(os.path.abspath(__file__))
config.add_config_ini('%s/hokuyo.ini' % pwd)
log... | import logging.config
import sys
import os
import serial
from amber.hokuyo.hokuyo_common import HokuyoController
from amber.tools import serial_port, config
__author__ = 'paoolo'
LOGGER_NAME = 'AmberPipes'
pwd = os.path.dirname(os.path.abspath(__file__))
config.add_config_ini('%s/hokuyo.ini' % pwd)
logging.config.... | <commit_before>import logging.config
import sys
import os
import time
import serial
from amber.hokuyo.hokuyo_common import HokuyoController
from amber.tools import serial_port, config
__author__ = 'paoolo'
LOGGER_NAME = 'AmberPipes'
pwd = os.path.dirname(os.path.abspath(__file__))
config.add_config_ini('%s/hokuyo.... | import logging.config
import sys
import os
import serial
from amber.hokuyo.hokuyo_common import HokuyoController
from amber.tools import serial_port, config
__author__ = 'paoolo'
LOGGER_NAME = 'AmberPipes'
pwd = os.path.dirname(os.path.abspath(__file__))
config.add_config_ini('%s/hokuyo.ini' % pwd)
logging.config.... | import logging.config
import sys
import os
import time
import serial
from amber.hokuyo.hokuyo_common import HokuyoController
from amber.tools import serial_port, config
__author__ = 'paoolo'
LOGGER_NAME = 'AmberPipes'
pwd = os.path.dirname(os.path.abspath(__file__))
config.add_config_ini('%s/hokuyo.ini' % pwd)
log... | <commit_before>import logging.config
import sys
import os
import time
import serial
from amber.hokuyo.hokuyo_common import HokuyoController
from amber.tools import serial_port, config
__author__ = 'paoolo'
LOGGER_NAME = 'AmberPipes'
pwd = os.path.dirname(os.path.abspath(__file__))
config.add_config_ini('%s/hokuyo.... |
e2533f5afe00af4ef39c853f919f597f89225b2b | uml-to-cpp.py | uml-to-cpp.py | # Copyright (C) 2017 Bran Seals. All rights reserved.
# Created: 2017-06-05
from UmlClass import UmlClass
print("== UML to CPP ==")
print("Create or modify C++ header and implementation files by plaintext UML.")
#print("Enter a UML filename: ") # file import currently disabled
umlFile = open("UML.txt", 'r')
# TODO: c... | # Copyright (C) 2017 Bran Seals. All rights reserved.
# Created: 2017-06-05
from UmlClass import UmlClass
print("[ UML to CPP ]")
print("Create or modify C++ header and implementation files by plaintext UML.")
print("> Attempting to create files...")
#print("Enter a UML filename: ") # file import currently disabled
um... | Fix false bug flag by allowing empty lines | Fix false bug flag by allowing empty lines
| Python | mit | BranSeals/uml-to-cpp | # Copyright (C) 2017 Bran Seals. All rights reserved.
# Created: 2017-06-05
from UmlClass import UmlClass
print("== UML to CPP ==")
print("Create or modify C++ header and implementation files by plaintext UML.")
#print("Enter a UML filename: ") # file import currently disabled
umlFile = open("UML.txt", 'r')
# TODO: c... | # Copyright (C) 2017 Bran Seals. All rights reserved.
# Created: 2017-06-05
from UmlClass import UmlClass
print("[ UML to CPP ]")
print("Create or modify C++ header and implementation files by plaintext UML.")
print("> Attempting to create files...")
#print("Enter a UML filename: ") # file import currently disabled
um... | <commit_before># Copyright (C) 2017 Bran Seals. All rights reserved.
# Created: 2017-06-05
from UmlClass import UmlClass
print("== UML to CPP ==")
print("Create or modify C++ header and implementation files by plaintext UML.")
#print("Enter a UML filename: ") # file import currently disabled
umlFile = open("UML.txt",... | # Copyright (C) 2017 Bran Seals. All rights reserved.
# Created: 2017-06-05
from UmlClass import UmlClass
print("[ UML to CPP ]")
print("Create or modify C++ header and implementation files by plaintext UML.")
print("> Attempting to create files...")
#print("Enter a UML filename: ") # file import currently disabled
um... | # Copyright (C) 2017 Bran Seals. All rights reserved.
# Created: 2017-06-05
from UmlClass import UmlClass
print("== UML to CPP ==")
print("Create or modify C++ header and implementation files by plaintext UML.")
#print("Enter a UML filename: ") # file import currently disabled
umlFile = open("UML.txt", 'r')
# TODO: c... | <commit_before># Copyright (C) 2017 Bran Seals. All rights reserved.
# Created: 2017-06-05
from UmlClass import UmlClass
print("== UML to CPP ==")
print("Create or modify C++ header and implementation files by plaintext UML.")
#print("Enter a UML filename: ") # file import currently disabled
umlFile = open("UML.txt",... |
45572b53f66f8c8656664026f0a2e1bb0aa209c5 | doc/fake_cffi.py | doc/fake_cffi.py | """Mock module for Sphinx autodoc."""
class FFI(object):
def cdef(self, _):
pass
def dlopen(self, _):
return self
SFC_GET_FORMAT_INFO = NotImplemented
| """Mock module for Sphinx autodoc."""
class FFI(object):
def cdef(self, _):
pass
def dlopen(self, _):
return self
def string(self, _):
return b'not implemented'
def sf_version_string(self):
return NotImplemented
SFC_GET_FORMAT_INFO = NotImplemented
| Add missing member functions in fake CFFI class | DOC: Add missing member functions in fake CFFI class
PR #160 introduced those calls on module load, which broke the Sphinx
autodoc generation.
| Python | bsd-3-clause | mgeier/PySoundFile | """Mock module for Sphinx autodoc."""
class FFI(object):
def cdef(self, _):
pass
def dlopen(self, _):
return self
SFC_GET_FORMAT_INFO = NotImplemented
DOC: Add missing member functions in fake CFFI class
PR #160 introduced those calls on module load, which broke the Sphinx
autodoc gene... | """Mock module for Sphinx autodoc."""
class FFI(object):
def cdef(self, _):
pass
def dlopen(self, _):
return self
def string(self, _):
return b'not implemented'
def sf_version_string(self):
return NotImplemented
SFC_GET_FORMAT_INFO = NotImplemented
| <commit_before>"""Mock module for Sphinx autodoc."""
class FFI(object):
def cdef(self, _):
pass
def dlopen(self, _):
return self
SFC_GET_FORMAT_INFO = NotImplemented
<commit_msg>DOC: Add missing member functions in fake CFFI class
PR #160 introduced those calls on module load, which br... | """Mock module for Sphinx autodoc."""
class FFI(object):
def cdef(self, _):
pass
def dlopen(self, _):
return self
def string(self, _):
return b'not implemented'
def sf_version_string(self):
return NotImplemented
SFC_GET_FORMAT_INFO = NotImplemented
| """Mock module for Sphinx autodoc."""
class FFI(object):
def cdef(self, _):
pass
def dlopen(self, _):
return self
SFC_GET_FORMAT_INFO = NotImplemented
DOC: Add missing member functions in fake CFFI class
PR #160 introduced those calls on module load, which broke the Sphinx
autodoc gene... | <commit_before>"""Mock module for Sphinx autodoc."""
class FFI(object):
def cdef(self, _):
pass
def dlopen(self, _):
return self
SFC_GET_FORMAT_INFO = NotImplemented
<commit_msg>DOC: Add missing member functions in fake CFFI class
PR #160 introduced those calls on module load, which br... |
e51b5f859c50724952a378680e0b971432a1c918 | examples/python/insert_event.py | examples/python/insert_event.py | from gi.repository import Zeitgeist, GObject
import time
log = Zeitgeist.Log.get_default()
mainloop = GObject.MainLoop()
def on_events_inserted(log, time_range, events):
print "==="
ev = Zeitgeist.Event();
ev.set_property("interpretation", "foo://Interp");
ev.set_property("timestamp", time.time()*1000);
ev.debug... | from gi.repository import Zeitgeist, GObject
import time
log = Zeitgeist.Log.get_default()
mainloop = GObject.MainLoop()
def on_events_inserted(log, time_range, events):
print events
ev = Zeitgeist.Event();
ev.set_property("interpretation", "foo://Interp");
ev.set_property("timestamp", time.time()*1000);
ev.debu... | Remove debug prints from tests | Remove debug prints from tests
| Python | lgpl-2.1 | freedesktop-unofficial-mirror/zeitgeist__zeitgeist,freedesktop-unofficial-mirror/zeitgeist__zeitgeist,freedesktop-unofficial-mirror/zeitgeist__zeitgeist,freedesktop-unofficial-mirror/zeitgeist__zeitgeist,freedesktop-unofficial-mirror/zeitgeist__zeitgeist | from gi.repository import Zeitgeist, GObject
import time
log = Zeitgeist.Log.get_default()
mainloop = GObject.MainLoop()
def on_events_inserted(log, time_range, events):
print "==="
ev = Zeitgeist.Event();
ev.set_property("interpretation", "foo://Interp");
ev.set_property("timestamp", time.time()*1000);
ev.debug... | from gi.repository import Zeitgeist, GObject
import time
log = Zeitgeist.Log.get_default()
mainloop = GObject.MainLoop()
def on_events_inserted(log, time_range, events):
print events
ev = Zeitgeist.Event();
ev.set_property("interpretation", "foo://Interp");
ev.set_property("timestamp", time.time()*1000);
ev.debu... | <commit_before>from gi.repository import Zeitgeist, GObject
import time
log = Zeitgeist.Log.get_default()
mainloop = GObject.MainLoop()
def on_events_inserted(log, time_range, events):
print "==="
ev = Zeitgeist.Event();
ev.set_property("interpretation", "foo://Interp");
ev.set_property("timestamp", time.time()*... | from gi.repository import Zeitgeist, GObject
import time
log = Zeitgeist.Log.get_default()
mainloop = GObject.MainLoop()
def on_events_inserted(log, time_range, events):
print events
ev = Zeitgeist.Event();
ev.set_property("interpretation", "foo://Interp");
ev.set_property("timestamp", time.time()*1000);
ev.debu... | from gi.repository import Zeitgeist, GObject
import time
log = Zeitgeist.Log.get_default()
mainloop = GObject.MainLoop()
def on_events_inserted(log, time_range, events):
print "==="
ev = Zeitgeist.Event();
ev.set_property("interpretation", "foo://Interp");
ev.set_property("timestamp", time.time()*1000);
ev.debug... | <commit_before>from gi.repository import Zeitgeist, GObject
import time
log = Zeitgeist.Log.get_default()
mainloop = GObject.MainLoop()
def on_events_inserted(log, time_range, events):
print "==="
ev = Zeitgeist.Event();
ev.set_property("interpretation", "foo://Interp");
ev.set_property("timestamp", time.time()*... |
7021aabe068f546adb10b8f741656c423cb7eb5a | sale_order_mass_confirm/wizard/sale_order_confirm.py | sale_order_mass_confirm/wizard/sale_order_confirm.py | # -*- coding: utf-8 -*-
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, models
class SaleOrderConfirmWizard(models.TransientModel):
_name = "sale.order.confirm.wizard"
_description = "Wizard - Sale Order Confirm"
... | # -*- coding: utf-8 -*-
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models, api
class SaleOrderConfirmWizard(models.TransientModel):
_name = "sale.order.confirm.wizard"
_description = "Wizard - Sale Order Confirm"
... | Make sure only Sales Order with state in 'draft' or 'sent' is confirmed (state 'canceled' will not be confirmed) | Make sure only Sales Order with state in 'draft' or 'sent' is confirmed (state 'canceled' will not be confirmed)
| Python | agpl-3.0 | VitalPet/addons-onestein,VitalPet/addons-onestein,VitalPet/addons-onestein | # -*- coding: utf-8 -*-
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, models
class SaleOrderConfirmWizard(models.TransientModel):
_name = "sale.order.confirm.wizard"
_description = "Wizard - Sale Order Confirm"
... | # -*- coding: utf-8 -*-
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models, api
class SaleOrderConfirmWizard(models.TransientModel):
_name = "sale.order.confirm.wizard"
_description = "Wizard - Sale Order Confirm"
... | <commit_before># -*- coding: utf-8 -*-
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, models
class SaleOrderConfirmWizard(models.TransientModel):
_name = "sale.order.confirm.wizard"
_description = "Wizard - Sale ... | # -*- coding: utf-8 -*-
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models, api
class SaleOrderConfirmWizard(models.TransientModel):
_name = "sale.order.confirm.wizard"
_description = "Wizard - Sale Order Confirm"
... | # -*- coding: utf-8 -*-
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, models
class SaleOrderConfirmWizard(models.TransientModel):
_name = "sale.order.confirm.wizard"
_description = "Wizard - Sale Order Confirm"
... | <commit_before># -*- coding: utf-8 -*-
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, models
class SaleOrderConfirmWizard(models.TransientModel):
_name = "sale.order.confirm.wizard"
_description = "Wizard - Sale ... |
027fa84469e17ec4b8948de095388ec94ea40941 | api/identifiers/serializers.py | api/identifiers/serializers.py | from rest_framework import serializers as ser
from api.base.serializers import JSONAPISerializer, LinksField, RelationshipField
class IdentifierSerializer(JSONAPISerializer):
category = ser.CharField(read_only=True)
identifier = LinksField({
'self': 'get_identifiers'
})
referent = Relations... | from rest_framework import serializers as ser
from api.base.serializers import JSONAPISerializer, LinksField, RelationshipField
class IdentifierSerializer(JSONAPISerializer):
category = ser.CharField(read_only=True)
identifier = LinksField({
'self': 'get_identifiers'
})
referent = Relations... | Add get_absolute_url method to serializer | Add get_absolute_url method to serializer
| Python | apache-2.0 | abought/osf.io,mfraezz/osf.io,leb2dg/osf.io,cwisecarver/osf.io,DanielSBrown/osf.io,rdhyee/osf.io,CenterForOpenScience/osf.io,mluke93/osf.io,saradbowman/osf.io,cwisecarver/osf.io,aaxelb/osf.io,felliott/osf.io,CenterForOpenScience/osf.io,kwierman/osf.io,brianjgeiger/osf.io,wearpants/osf.io,samchrisinger/osf.io,chennan47/... | from rest_framework import serializers as ser
from api.base.serializers import JSONAPISerializer, LinksField, RelationshipField
class IdentifierSerializer(JSONAPISerializer):
category = ser.CharField(read_only=True)
identifier = LinksField({
'self': 'get_identifiers'
})
referent = Relations... | from rest_framework import serializers as ser
from api.base.serializers import JSONAPISerializer, LinksField, RelationshipField
class IdentifierSerializer(JSONAPISerializer):
category = ser.CharField(read_only=True)
identifier = LinksField({
'self': 'get_identifiers'
})
referent = Relations... | <commit_before>from rest_framework import serializers as ser
from api.base.serializers import JSONAPISerializer, LinksField, RelationshipField
class IdentifierSerializer(JSONAPISerializer):
category = ser.CharField(read_only=True)
identifier = LinksField({
'self': 'get_identifiers'
})
refer... | from rest_framework import serializers as ser
from api.base.serializers import JSONAPISerializer, LinksField, RelationshipField
class IdentifierSerializer(JSONAPISerializer):
category = ser.CharField(read_only=True)
identifier = LinksField({
'self': 'get_identifiers'
})
referent = Relations... | from rest_framework import serializers as ser
from api.base.serializers import JSONAPISerializer, LinksField, RelationshipField
class IdentifierSerializer(JSONAPISerializer):
category = ser.CharField(read_only=True)
identifier = LinksField({
'self': 'get_identifiers'
})
referent = Relations... | <commit_before>from rest_framework import serializers as ser
from api.base.serializers import JSONAPISerializer, LinksField, RelationshipField
class IdentifierSerializer(JSONAPISerializer):
category = ser.CharField(read_only=True)
identifier = LinksField({
'self': 'get_identifiers'
})
refer... |
13a6808c49474cf8d67240fbfda9c6273e1bfa2b | project/settings_live_base.py | project/settings_live_base.py | from project.settings import *
DEBUG = False
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'skeleton',
'USER': 'skeleton',
'PASSWORD': 'skeleton',
'HOST': 'localhost',
'PORT': '5432',
}
}
MEDIA_RO... | from project.settings import *
DEBUG = False
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'skeleton',
'USER': 'skeleton',
'PASSWORD': 'skeleton',
'HOST': 'localhost',
'PORT': '5432',
'CONN_MAX... | Add CONN_MAX_AGE setting because it makes a huge difference on busy sites | Add CONN_MAX_AGE setting because it makes a huge difference on busy sites
| Python | bsd-3-clause | praekelt/jmbo-skeleton,praekelt/jmbo-skeleton,praekelt/jmbo-skeleton | from project.settings import *
DEBUG = False
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'skeleton',
'USER': 'skeleton',
'PASSWORD': 'skeleton',
'HOST': 'localhost',
'PORT': '5432',
}
}
MEDIA_RO... | from project.settings import *
DEBUG = False
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'skeleton',
'USER': 'skeleton',
'PASSWORD': 'skeleton',
'HOST': 'localhost',
'PORT': '5432',
'CONN_MAX... | <commit_before>from project.settings import *
DEBUG = False
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'skeleton',
'USER': 'skeleton',
'PASSWORD': 'skeleton',
'HOST': 'localhost',
'PORT': '5432',
... | from project.settings import *
DEBUG = False
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'skeleton',
'USER': 'skeleton',
'PASSWORD': 'skeleton',
'HOST': 'localhost',
'PORT': '5432',
'CONN_MAX... | from project.settings import *
DEBUG = False
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'skeleton',
'USER': 'skeleton',
'PASSWORD': 'skeleton',
'HOST': 'localhost',
'PORT': '5432',
}
}
MEDIA_RO... | <commit_before>from project.settings import *
DEBUG = False
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'skeleton',
'USER': 'skeleton',
'PASSWORD': 'skeleton',
'HOST': 'localhost',
'PORT': '5432',
... |
47d612aeab78e8d3ceeee8a4769485356194ab81 | lib/custom_data/character_loader_new.py | lib/custom_data/character_loader_new.py | """This module loads character data from XML files and stores them in
CharacterData objects that can be read by the game engine.
Attributes:
CHARACTER_LIST_PATH (String): The filepath for the text file which
lists the paths to all of the characters' XML files.
Each path is separated by a new-line.
... | """This module loads character data from XML files and stores them in
CharacterData objects that can be read by the game engine.
Attributes:
CHARACTER_LIST_PATH (String): The filepath for the text file which
lists the paths to all of the characters' XML files.
Each path is separated by a new-line.
... | Add constant for Character Schema file path | Add constant for Character Schema file path
| Python | unlicense | MarquisLP/Sidewalk-Champion | """This module loads character data from XML files and stores them in
CharacterData objects that can be read by the game engine.
Attributes:
CHARACTER_LIST_PATH (String): The filepath for the text file which
lists the paths to all of the characters' XML files.
Each path is separated by a new-line.
... | """This module loads character data from XML files and stores them in
CharacterData objects that can be read by the game engine.
Attributes:
CHARACTER_LIST_PATH (String): The filepath for the text file which
lists the paths to all of the characters' XML files.
Each path is separated by a new-line.
... | <commit_before>"""This module loads character data from XML files and stores them in
CharacterData objects that can be read by the game engine.
Attributes:
CHARACTER_LIST_PATH (String): The filepath for the text file which
lists the paths to all of the characters' XML files.
Each path is separated ... | """This module loads character data from XML files and stores them in
CharacterData objects that can be read by the game engine.
Attributes:
CHARACTER_LIST_PATH (String): The filepath for the text file which
lists the paths to all of the characters' XML files.
Each path is separated by a new-line.
... | """This module loads character data from XML files and stores them in
CharacterData objects that can be read by the game engine.
Attributes:
CHARACTER_LIST_PATH (String): The filepath for the text file which
lists the paths to all of the characters' XML files.
Each path is separated by a new-line.
... | <commit_before>"""This module loads character data from XML files and stores them in
CharacterData objects that can be read by the game engine.
Attributes:
CHARACTER_LIST_PATH (String): The filepath for the text file which
lists the paths to all of the characters' XML files.
Each path is separated ... |
84acc00a3f6d09b4212b6728667af583b45e5a99 | km_api/know_me/tests/serializers/test_profile_list_serializer.py | km_api/know_me/tests/serializers/test_profile_list_serializer.py | from know_me import serializers
def test_serialize(profile_factory):
"""
Test serializing a profile.
"""
profile = profile_factory()
serializer = serializers.ProfileListSerializer(profile)
expected = {
'id': profile.id,
'name': profile.name,
'quote': profile.quote,
... | from know_me import serializers
def test_create(user_factory):
"""
Saving a serializer containing valid data should create a new
profile.
"""
user = user_factory()
data = {
'name': 'John',
'quote': "Hi, I'm John",
'welcome_message': 'This is my profile.',
}
ser... | Add test for creating profile from serializer. | Add test for creating profile from serializer.
| Python | apache-2.0 | knowmetools/km-api,knowmetools/km-api,knowmetools/km-api,knowmetools/km-api | from know_me import serializers
def test_serialize(profile_factory):
"""
Test serializing a profile.
"""
profile = profile_factory()
serializer = serializers.ProfileListSerializer(profile)
expected = {
'id': profile.id,
'name': profile.name,
'quote': profile.quote,
... | from know_me import serializers
def test_create(user_factory):
"""
Saving a serializer containing valid data should create a new
profile.
"""
user = user_factory()
data = {
'name': 'John',
'quote': "Hi, I'm John",
'welcome_message': 'This is my profile.',
}
ser... | <commit_before>from know_me import serializers
def test_serialize(profile_factory):
"""
Test serializing a profile.
"""
profile = profile_factory()
serializer = serializers.ProfileListSerializer(profile)
expected = {
'id': profile.id,
'name': profile.name,
'quote': pro... | from know_me import serializers
def test_create(user_factory):
"""
Saving a serializer containing valid data should create a new
profile.
"""
user = user_factory()
data = {
'name': 'John',
'quote': "Hi, I'm John",
'welcome_message': 'This is my profile.',
}
ser... | from know_me import serializers
def test_serialize(profile_factory):
"""
Test serializing a profile.
"""
profile = profile_factory()
serializer = serializers.ProfileListSerializer(profile)
expected = {
'id': profile.id,
'name': profile.name,
'quote': profile.quote,
... | <commit_before>from know_me import serializers
def test_serialize(profile_factory):
"""
Test serializing a profile.
"""
profile = profile_factory()
serializer = serializers.ProfileListSerializer(profile)
expected = {
'id': profile.id,
'name': profile.name,
'quote': pro... |
a14b51a2aeaf23daf4b72658de3f40ebd49f6223 | interrupted_bubble_sort/interrupted_bubble_sort.py | interrupted_bubble_sort/interrupted_bubble_sort.py | """
Solution to code eval interrupted bubble sort:
https://www.codeeval.com/open_challenges/158/
"""
import sys
def bubble_sort(inputL):
"""One iteration of bubble sort."""
for num in xrange(len(inputL)-1):
if inputL[num+1] < inputL[num]:
inputL[num+1], inputL[num] = inputL[num], inputL[nu... | """
Solution to code eval interrupted bubble sort:
https://www.codeeval.com/open_challenges/158/
"""
import sys
def bubble_sort(inputL):
"""One iteration of bubble sort."""
for num in xrange(len(inputL)-1):
if inputL[num+1] < inputL[num]:
inputL[num+1], inputL[num] = inputL[num], inputL[nu... | Change list copy to list() | Change list copy to list()
| Python | mit | bm5w/codeeval | """
Solution to code eval interrupted bubble sort:
https://www.codeeval.com/open_challenges/158/
"""
import sys
def bubble_sort(inputL):
"""One iteration of bubble sort."""
for num in xrange(len(inputL)-1):
if inputL[num+1] < inputL[num]:
inputL[num+1], inputL[num] = inputL[num], inputL[nu... | """
Solution to code eval interrupted bubble sort:
https://www.codeeval.com/open_challenges/158/
"""
import sys
def bubble_sort(inputL):
"""One iteration of bubble sort."""
for num in xrange(len(inputL)-1):
if inputL[num+1] < inputL[num]:
inputL[num+1], inputL[num] = inputL[num], inputL[nu... | <commit_before>"""
Solution to code eval interrupted bubble sort:
https://www.codeeval.com/open_challenges/158/
"""
import sys
def bubble_sort(inputL):
"""One iteration of bubble sort."""
for num in xrange(len(inputL)-1):
if inputL[num+1] < inputL[num]:
inputL[num+1], inputL[num] = inputL[... | """
Solution to code eval interrupted bubble sort:
https://www.codeeval.com/open_challenges/158/
"""
import sys
def bubble_sort(inputL):
"""One iteration of bubble sort."""
for num in xrange(len(inputL)-1):
if inputL[num+1] < inputL[num]:
inputL[num+1], inputL[num] = inputL[num], inputL[nu... | """
Solution to code eval interrupted bubble sort:
https://www.codeeval.com/open_challenges/158/
"""
import sys
def bubble_sort(inputL):
"""One iteration of bubble sort."""
for num in xrange(len(inputL)-1):
if inputL[num+1] < inputL[num]:
inputL[num+1], inputL[num] = inputL[num], inputL[nu... | <commit_before>"""
Solution to code eval interrupted bubble sort:
https://www.codeeval.com/open_challenges/158/
"""
import sys
def bubble_sort(inputL):
"""One iteration of bubble sort."""
for num in xrange(len(inputL)-1):
if inputL[num+1] < inputL[num]:
inputL[num+1], inputL[num] = inputL[... |
8c1b7f8a5a7403e464938aa0aa6876557ec6a2b3 | daphne/server.py | daphne/server.py | import time
from twisted.internet import reactor
from .http_protocol import HTTPFactory
class Server(object):
def __init__(self, channel_layer, host="127.0.0.1", port=8000):
self.channel_layer = channel_layer
self.host = host
self.port = port
def run(self):
self.factory = HT... | import time
from twisted.internet import reactor
from .http_protocol import HTTPFactory
class Server(object):
def __init__(self, channel_layer, host="127.0.0.1", port=8000, signal_handlers=True):
self.channel_layer = channel_layer
self.host = host
self.port = port
self.signal_han... | Allow signal handlers to be disabled to run in subthread | Allow signal handlers to be disabled to run in subthread
| Python | bsd-3-clause | django/daphne,maikhoepfel/daphne | import time
from twisted.internet import reactor
from .http_protocol import HTTPFactory
class Server(object):
def __init__(self, channel_layer, host="127.0.0.1", port=8000):
self.channel_layer = channel_layer
self.host = host
self.port = port
def run(self):
self.factory = HT... | import time
from twisted.internet import reactor
from .http_protocol import HTTPFactory
class Server(object):
def __init__(self, channel_layer, host="127.0.0.1", port=8000, signal_handlers=True):
self.channel_layer = channel_layer
self.host = host
self.port = port
self.signal_han... | <commit_before>import time
from twisted.internet import reactor
from .http_protocol import HTTPFactory
class Server(object):
def __init__(self, channel_layer, host="127.0.0.1", port=8000):
self.channel_layer = channel_layer
self.host = host
self.port = port
def run(self):
se... | import time
from twisted.internet import reactor
from .http_protocol import HTTPFactory
class Server(object):
def __init__(self, channel_layer, host="127.0.0.1", port=8000, signal_handlers=True):
self.channel_layer = channel_layer
self.host = host
self.port = port
self.signal_han... | import time
from twisted.internet import reactor
from .http_protocol import HTTPFactory
class Server(object):
def __init__(self, channel_layer, host="127.0.0.1", port=8000):
self.channel_layer = channel_layer
self.host = host
self.port = port
def run(self):
self.factory = HT... | <commit_before>import time
from twisted.internet import reactor
from .http_protocol import HTTPFactory
class Server(object):
def __init__(self, channel_layer, host="127.0.0.1", port=8000):
self.channel_layer = channel_layer
self.host = host
self.port = port
def run(self):
se... |
84ff87fc4ac0e334b2516f7d12944a5eac74964e | blinkylib/blinkytape.py | blinkylib/blinkytape.py | import blinkycolor
import serial
class BlinkyTape(object):
def __init__(self, port, baud_rate = 115200, pixel_count = 60):
self._serial = serial.Serial(port, baud_rate)
self._pixel_count = pixel_count
self._pixels = [blinkycolor.BLACK] * self._pixel_count
@property
def pixel_count(... | import blinkycolor
import serial
class BlinkyTape(object):
def __init__(self, port, baud_rate = 115200, pixel_count = 60):
self._serial = serial.Serial(port, baud_rate)
self._pixel_count = pixel_count
self._pixels = [blinkycolor.BLACK] * self._pixel_count
@property
def pixel_count(... | Change update value to produce less thrash on embedded side | Change update value to produce less thrash on embedded side
| Python | mit | jonspeicher/blinkyfun | import blinkycolor
import serial
class BlinkyTape(object):
def __init__(self, port, baud_rate = 115200, pixel_count = 60):
self._serial = serial.Serial(port, baud_rate)
self._pixel_count = pixel_count
self._pixels = [blinkycolor.BLACK] * self._pixel_count
@property
def pixel_count(... | import blinkycolor
import serial
class BlinkyTape(object):
def __init__(self, port, baud_rate = 115200, pixel_count = 60):
self._serial = serial.Serial(port, baud_rate)
self._pixel_count = pixel_count
self._pixels = [blinkycolor.BLACK] * self._pixel_count
@property
def pixel_count(... | <commit_before>import blinkycolor
import serial
class BlinkyTape(object):
def __init__(self, port, baud_rate = 115200, pixel_count = 60):
self._serial = serial.Serial(port, baud_rate)
self._pixel_count = pixel_count
self._pixels = [blinkycolor.BLACK] * self._pixel_count
@property
d... | import blinkycolor
import serial
class BlinkyTape(object):
def __init__(self, port, baud_rate = 115200, pixel_count = 60):
self._serial = serial.Serial(port, baud_rate)
self._pixel_count = pixel_count
self._pixels = [blinkycolor.BLACK] * self._pixel_count
@property
def pixel_count(... | import blinkycolor
import serial
class BlinkyTape(object):
def __init__(self, port, baud_rate = 115200, pixel_count = 60):
self._serial = serial.Serial(port, baud_rate)
self._pixel_count = pixel_count
self._pixels = [blinkycolor.BLACK] * self._pixel_count
@property
def pixel_count(... | <commit_before>import blinkycolor
import serial
class BlinkyTape(object):
def __init__(self, port, baud_rate = 115200, pixel_count = 60):
self._serial = serial.Serial(port, baud_rate)
self._pixel_count = pixel_count
self._pixels = [blinkycolor.BLACK] * self._pixel_count
@property
d... |
ea7919f5e8de2d045df91fdda892757613ef3211 | qregexeditor/api/quick_ref.py | qregexeditor/api/quick_ref.py | """
Contains the quick reference widget
"""
import re
from pyqode.qt import QtWidgets
from .forms import quick_ref_ui
class QuickRefWidget(QtWidgets.QWidget):
def __init__(self, parent=None):
super(QuickRefWidget, self).__init__(parent)
self.ui = quick_ref_ui.Ui_Form()
self.ui.setupUi(self)... | """
Contains the quick reference widget
"""
import re
from pyqode.qt import QtCore, QtWidgets
from .forms import quick_ref_ui
class QuickRefWidget(QtWidgets.QWidget):
def __init__(self, parent=None):
super(QuickRefWidget, self).__init__(parent)
self.ui = quick_ref_ui.Ui_Form()
self.ui.setup... | Add zoom in/out action to the text edit context menu | Add zoom in/out action to the text edit context menu
Fix #5
| Python | mit | ColinDuquesnoy/QRegexEditor | """
Contains the quick reference widget
"""
import re
from pyqode.qt import QtWidgets
from .forms import quick_ref_ui
class QuickRefWidget(QtWidgets.QWidget):
def __init__(self, parent=None):
super(QuickRefWidget, self).__init__(parent)
self.ui = quick_ref_ui.Ui_Form()
self.ui.setupUi(self)... | """
Contains the quick reference widget
"""
import re
from pyqode.qt import QtCore, QtWidgets
from .forms import quick_ref_ui
class QuickRefWidget(QtWidgets.QWidget):
def __init__(self, parent=None):
super(QuickRefWidget, self).__init__(parent)
self.ui = quick_ref_ui.Ui_Form()
self.ui.setup... | <commit_before>"""
Contains the quick reference widget
"""
import re
from pyqode.qt import QtWidgets
from .forms import quick_ref_ui
class QuickRefWidget(QtWidgets.QWidget):
def __init__(self, parent=None):
super(QuickRefWidget, self).__init__(parent)
self.ui = quick_ref_ui.Ui_Form()
self.u... | """
Contains the quick reference widget
"""
import re
from pyqode.qt import QtCore, QtWidgets
from .forms import quick_ref_ui
class QuickRefWidget(QtWidgets.QWidget):
def __init__(self, parent=None):
super(QuickRefWidget, self).__init__(parent)
self.ui = quick_ref_ui.Ui_Form()
self.ui.setup... | """
Contains the quick reference widget
"""
import re
from pyqode.qt import QtWidgets
from .forms import quick_ref_ui
class QuickRefWidget(QtWidgets.QWidget):
def __init__(self, parent=None):
super(QuickRefWidget, self).__init__(parent)
self.ui = quick_ref_ui.Ui_Form()
self.ui.setupUi(self)... | <commit_before>"""
Contains the quick reference widget
"""
import re
from pyqode.qt import QtWidgets
from .forms import quick_ref_ui
class QuickRefWidget(QtWidgets.QWidget):
def __init__(self, parent=None):
super(QuickRefWidget, self).__init__(parent)
self.ui = quick_ref_ui.Ui_Form()
self.u... |
65b4c081c3a66ccd373062f8e7c1d63295c8d8d1 | cache_relation/app_settings.py | cache_relation/app_settings.py | # Default cache duration
CACHE_RELATION_DEFAULT_DURATION = 60 * 60 * 24 * 3
| from django.conf import settings
# Default cache timeout
CACHE_RELATION_DEFAULT_DURATION = getattr(
settings,
'CACHE_RELATION_DEFAULT_DURATION',
60 * 60 * 24 * 3,
)
| Allow global settings to override. | Allow global settings to override.
Signed-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@playfire.com>
| Python | bsd-3-clause | thread/django-sensible-caching,playfire/django-cache-toolbox,lamby/django-sensible-caching,lamby/django-cache-toolbox | # Default cache duration
CACHE_RELATION_DEFAULT_DURATION = 60 * 60 * 24 * 3
Allow global settings to override.
Signed-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@playfire.com> | from django.conf import settings
# Default cache timeout
CACHE_RELATION_DEFAULT_DURATION = getattr(
settings,
'CACHE_RELATION_DEFAULT_DURATION',
60 * 60 * 24 * 3,
)
| <commit_before># Default cache duration
CACHE_RELATION_DEFAULT_DURATION = 60 * 60 * 24 * 3
<commit_msg>Allow global settings to override.
Signed-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@playfire.com><commit_after> | from django.conf import settings
# Default cache timeout
CACHE_RELATION_DEFAULT_DURATION = getattr(
settings,
'CACHE_RELATION_DEFAULT_DURATION',
60 * 60 * 24 * 3,
)
| # Default cache duration
CACHE_RELATION_DEFAULT_DURATION = 60 * 60 * 24 * 3
Allow global settings to override.
Signed-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@playfire.com>from django.conf import settings
# Default cache timeout
CACHE_RELATION_DEFAULT_DURATION = getattr(
settings,
'CACHE_R... | <commit_before># Default cache duration
CACHE_RELATION_DEFAULT_DURATION = 60 * 60 * 24 * 3
<commit_msg>Allow global settings to override.
Signed-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@playfire.com><commit_after>from django.conf import settings
# Default cache timeout
CACHE_RELATION_DEFAULT_DURAT... |
3f9e0d0b013a2b652aefdacc6c1b54e26af48b16 | cmain.py | cmain.py | #
# This program provides a simple command line to query population statistics.
# Author: Tay Joc Cing
# Date: 20 Mar 2015
#
import sys
import os
from country import Country
from datamanager import DataManager
from dispatcher import CommandDispatcher
from constants import *
sys.path.append(os.getcwd() + "/classes")
... | #
# This program provides a simple command line to query population statistics.
# Author: Tay Joc Cing
# Date: 20 Mar 2015
#
import sys
import os
sys.path.append(os.getcwd() + "/classes")
from country import Country
from datamanager import DataManager
from dispatcher import CommandDispatcher
from constants import *
... | Store current working directory before import | Store current working directory before import
| Python | mit | joccing/geoguru,joccing/geoguru | #
# This program provides a simple command line to query population statistics.
# Author: Tay Joc Cing
# Date: 20 Mar 2015
#
import sys
import os
from country import Country
from datamanager import DataManager
from dispatcher import CommandDispatcher
from constants import *
sys.path.append(os.getcwd() + "/classes")
... | #
# This program provides a simple command line to query population statistics.
# Author: Tay Joc Cing
# Date: 20 Mar 2015
#
import sys
import os
sys.path.append(os.getcwd() + "/classes")
from country import Country
from datamanager import DataManager
from dispatcher import CommandDispatcher
from constants import *
... | <commit_before>#
# This program provides a simple command line to query population statistics.
# Author: Tay Joc Cing
# Date: 20 Mar 2015
#
import sys
import os
from country import Country
from datamanager import DataManager
from dispatcher import CommandDispatcher
from constants import *
sys.path.append(os.getcwd()... | #
# This program provides a simple command line to query population statistics.
# Author: Tay Joc Cing
# Date: 20 Mar 2015
#
import sys
import os
sys.path.append(os.getcwd() + "/classes")
from country import Country
from datamanager import DataManager
from dispatcher import CommandDispatcher
from constants import *
... | #
# This program provides a simple command line to query population statistics.
# Author: Tay Joc Cing
# Date: 20 Mar 2015
#
import sys
import os
from country import Country
from datamanager import DataManager
from dispatcher import CommandDispatcher
from constants import *
sys.path.append(os.getcwd() + "/classes")
... | <commit_before>#
# This program provides a simple command line to query population statistics.
# Author: Tay Joc Cing
# Date: 20 Mar 2015
#
import sys
import os
from country import Country
from datamanager import DataManager
from dispatcher import CommandDispatcher
from constants import *
sys.path.append(os.getcwd()... |
f33bdb8313180fd3f2eae3d8b30783755c7d33ec | euler/solutions/solution_14.py | euler/solutions/solution_14.py | """Longest Collatz sequence
The following iterative sequence is defined for the set of positive integers:
n -> n/2 (n is even)
n -> 3n + 1 (n is odd)
Using the rule above and starting with 13, we generate the following sequence:
13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1
It can be seen that this sequence ... | """Longest Collatz sequence
The following iterative sequence is defined for the set of positive integers:
n -> n/2 (n is even)
n -> 3n + 1 (n is odd)
Using the rule above and starting with 13, we generate the following sequence:
13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1
It can be seen that this sequence ... | Add solution for problem 14 | Add solution for problem 14
Longest Collatz sequence
| Python | mit | rlucioni/project-euler | """Longest Collatz sequence
The following iterative sequence is defined for the set of positive integers:
n -> n/2 (n is even)
n -> 3n + 1 (n is odd)
Using the rule above and starting with 13, we generate the following sequence:
13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1
It can be seen that this sequence ... | """Longest Collatz sequence
The following iterative sequence is defined for the set of positive integers:
n -> n/2 (n is even)
n -> 3n + 1 (n is odd)
Using the rule above and starting with 13, we generate the following sequence:
13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1
It can be seen that this sequence ... | <commit_before>"""Longest Collatz sequence
The following iterative sequence is defined for the set of positive integers:
n -> n/2 (n is even)
n -> 3n + 1 (n is odd)
Using the rule above and starting with 13, we generate the following sequence:
13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1
It can be seen that... | """Longest Collatz sequence
The following iterative sequence is defined for the set of positive integers:
n -> n/2 (n is even)
n -> 3n + 1 (n is odd)
Using the rule above and starting with 13, we generate the following sequence:
13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1
It can be seen that this sequence ... | """Longest Collatz sequence
The following iterative sequence is defined for the set of positive integers:
n -> n/2 (n is even)
n -> 3n + 1 (n is odd)
Using the rule above and starting with 13, we generate the following sequence:
13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1
It can be seen that this sequence ... | <commit_before>"""Longest Collatz sequence
The following iterative sequence is defined for the set of positive integers:
n -> n/2 (n is even)
n -> 3n + 1 (n is odd)
Using the rule above and starting with 13, we generate the following sequence:
13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1
It can be seen that... |
ef5d3c61acdb7538b4338351b8902802142e03a5 | tests/bindings/python/scoring/test-scoring_result.py | tests/bindings/python/scoring/test-scoring_result.py | #!@PYTHON_EXECUTABLE@
#ckwg +5
# Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
# KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
# Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
def test_import():
try:
import vistk.pipeline_util.bake
except... | #!@PYTHON_EXECUTABLE@
#ckwg +5
# Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
# KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
# Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
def test_import():
try:
import vistk.pipeline_util.bake
except... | Update Python tests for scoring_result | Update Python tests for scoring_result
| Python | bsd-3-clause | linus-sherrill/sprokit,mathstuf/sprokit,Kitware/sprokit,linus-sherrill/sprokit,linus-sherrill/sprokit,linus-sherrill/sprokit,mathstuf/sprokit,Kitware/sprokit,Kitware/sprokit,Kitware/sprokit,mathstuf/sprokit,mathstuf/sprokit | #!@PYTHON_EXECUTABLE@
#ckwg +5
# Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
# KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
# Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
def test_import():
try:
import vistk.pipeline_util.bake
except... | #!@PYTHON_EXECUTABLE@
#ckwg +5
# Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
# KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
# Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
def test_import():
try:
import vistk.pipeline_util.bake
except... | <commit_before>#!@PYTHON_EXECUTABLE@
#ckwg +5
# Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
# KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
# Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
def test_import():
try:
import vistk.pipeline_util.... | #!@PYTHON_EXECUTABLE@
#ckwg +5
# Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
# KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
# Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
def test_import():
try:
import vistk.pipeline_util.bake
except... | #!@PYTHON_EXECUTABLE@
#ckwg +5
# Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
# KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
# Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
def test_import():
try:
import vistk.pipeline_util.bake
except... | <commit_before>#!@PYTHON_EXECUTABLE@
#ckwg +5
# Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
# KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
# Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
def test_import():
try:
import vistk.pipeline_util.... |
498ab0c125180ba89987e797d0094adc02019a8f | numba/exttypes/utils.py | numba/exttypes/utils.py | "Simple utilities related to extension types"
#------------------------------------------------------------------------
# Read state from extension types
#------------------------------------------------------------------------
def get_attributes_type(py_class):
"Return the attribute struct type of the numba exte... | "Simple utilities related to extension types"
#------------------------------------------------------------------------
# Read state from extension types
#------------------------------------------------------------------------
def get_attributes_type(py_class):
"Return the attribute struct type of the numba exte... | Add utility to iterate over numba base classes | Add utility to iterate over numba base classes
| Python | bsd-2-clause | jriehl/numba,cpcloud/numba,stuartarchibald/numba,numba/numba,GaZ3ll3/numba,pombredanne/numba,ssarangi/numba,ssarangi/numba,gdementen/numba,gmarkall/numba,pitrou/numba,shiquanwang/numba,numba/numba,seibert/numba,pitrou/numba,sklam/numba,shiquanwang/numba,IntelLabs/numba,seibert/numba,gdementen/numba,stuartarchibald/numb... | "Simple utilities related to extension types"
#------------------------------------------------------------------------
# Read state from extension types
#------------------------------------------------------------------------
def get_attributes_type(py_class):
"Return the attribute struct type of the numba exte... | "Simple utilities related to extension types"
#------------------------------------------------------------------------
# Read state from extension types
#------------------------------------------------------------------------
def get_attributes_type(py_class):
"Return the attribute struct type of the numba exte... | <commit_before>"Simple utilities related to extension types"
#------------------------------------------------------------------------
# Read state from extension types
#------------------------------------------------------------------------
def get_attributes_type(py_class):
"Return the attribute struct type of... | "Simple utilities related to extension types"
#------------------------------------------------------------------------
# Read state from extension types
#------------------------------------------------------------------------
def get_attributes_type(py_class):
"Return the attribute struct type of the numba exte... | "Simple utilities related to extension types"
#------------------------------------------------------------------------
# Read state from extension types
#------------------------------------------------------------------------
def get_attributes_type(py_class):
"Return the attribute struct type of the numba exte... | <commit_before>"Simple utilities related to extension types"
#------------------------------------------------------------------------
# Read state from extension types
#------------------------------------------------------------------------
def get_attributes_type(py_class):
"Return the attribute struct type of... |
fb26c402c433ac3358dbaadfb71762cfaf506a34 | jp2_online/settings/production.py | jp2_online/settings/production.py | # -*- coding: utf-8 -*-
from .base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
ALLOWED_HOSTS = ['138.197.197.47', 'junipero.erikiado.com']
CORS_ORIGIN_WHITELIST = ('138.197.197.47', 'junipero.erikiado.com')
STATIC_ROOT = os.path.join(BASE_DIR, "../static/") | # -*- coding: utf-8 -*-
from .base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
ALLOWED_HOSTS = [
'138.197.197.47',
'junipero.erikiado.com',
'basededatos.educacionintegral.org']
CORS_ORIGIN_WHITELIST = (
'138.197.197.47',
'junipero.erikiado.com',
'b... | Add subdomain for educacion integral | Add subdomain for educacion integral
| Python | mit | erikiado/jp2_online,erikiado/jp2_online,erikiado/jp2_online | # -*- coding: utf-8 -*-
from .base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
ALLOWED_HOSTS = ['138.197.197.47', 'junipero.erikiado.com']
CORS_ORIGIN_WHITELIST = ('138.197.197.47', 'junipero.erikiado.com')
STATIC_ROOT = os.path.join(BASE_DIR, "../static/")Add subdomain ... | # -*- coding: utf-8 -*-
from .base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
ALLOWED_HOSTS = [
'138.197.197.47',
'junipero.erikiado.com',
'basededatos.educacionintegral.org']
CORS_ORIGIN_WHITELIST = (
'138.197.197.47',
'junipero.erikiado.com',
'b... | <commit_before># -*- coding: utf-8 -*-
from .base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
ALLOWED_HOSTS = ['138.197.197.47', 'junipero.erikiado.com']
CORS_ORIGIN_WHITELIST = ('138.197.197.47', 'junipero.erikiado.com')
STATIC_ROOT = os.path.join(BASE_DIR, "../static/"... | # -*- coding: utf-8 -*-
from .base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
ALLOWED_HOSTS = [
'138.197.197.47',
'junipero.erikiado.com',
'basededatos.educacionintegral.org']
CORS_ORIGIN_WHITELIST = (
'138.197.197.47',
'junipero.erikiado.com',
'b... | # -*- coding: utf-8 -*-
from .base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
ALLOWED_HOSTS = ['138.197.197.47', 'junipero.erikiado.com']
CORS_ORIGIN_WHITELIST = ('138.197.197.47', 'junipero.erikiado.com')
STATIC_ROOT = os.path.join(BASE_DIR, "../static/")Add subdomain ... | <commit_before># -*- coding: utf-8 -*-
from .base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
ALLOWED_HOSTS = ['138.197.197.47', 'junipero.erikiado.com']
CORS_ORIGIN_WHITELIST = ('138.197.197.47', 'junipero.erikiado.com')
STATIC_ROOT = os.path.join(BASE_DIR, "../static/"... |
fb35425fe36635d3c649eeffa925d7bc9ff08b31 | grep/__main__.py | grep/__main__.py |
"""
grep_redone, version 0.9
Search files for a pattern or string, optionally do this recursively.
usage: grep_redone [-rnfe] [SEARCH_TERM]
Arguments:
SEARCH_TERM The string to search for.
Options:
-h --help Display this page.
-r Do a recursive search.
-f Display... |
"""
grep_redone, version 0.9
Search files for a pattern or string, optionally do this recursively.
usage: grep_redone [-rnfe] [SEARCH_TERM]
Arguments:
SEARCH_TERM The string to search for.
Options:
-h --help Display this page.
-r Do a recursive search.
-f Display... | Fix passing the search_term parameter to Searcher | Fix passing the search_term parameter to Searcher
| Python | bsd-2-clause | florianbegusch/simple_grep,florianbegusch/simple_grep |
"""
grep_redone, version 0.9
Search files for a pattern or string, optionally do this recursively.
usage: grep_redone [-rnfe] [SEARCH_TERM]
Arguments:
SEARCH_TERM The string to search for.
Options:
-h --help Display this page.
-r Do a recursive search.
-f Display... |
"""
grep_redone, version 0.9
Search files for a pattern or string, optionally do this recursively.
usage: grep_redone [-rnfe] [SEARCH_TERM]
Arguments:
SEARCH_TERM The string to search for.
Options:
-h --help Display this page.
-r Do a recursive search.
-f Display... | <commit_before>
"""
grep_redone, version 0.9
Search files for a pattern or string, optionally do this recursively.
usage: grep_redone [-rnfe] [SEARCH_TERM]
Arguments:
SEARCH_TERM The string to search for.
Options:
-h --help Display this page.
-r Do a recursive search.
-f ... |
"""
grep_redone, version 0.9
Search files for a pattern or string, optionally do this recursively.
usage: grep_redone [-rnfe] [SEARCH_TERM]
Arguments:
SEARCH_TERM The string to search for.
Options:
-h --help Display this page.
-r Do a recursive search.
-f Display... |
"""
grep_redone, version 0.9
Search files for a pattern or string, optionally do this recursively.
usage: grep_redone [-rnfe] [SEARCH_TERM]
Arguments:
SEARCH_TERM The string to search for.
Options:
-h --help Display this page.
-r Do a recursive search.
-f Display... | <commit_before>
"""
grep_redone, version 0.9
Search files for a pattern or string, optionally do this recursively.
usage: grep_redone [-rnfe] [SEARCH_TERM]
Arguments:
SEARCH_TERM The string to search for.
Options:
-h --help Display this page.
-r Do a recursive search.
-f ... |
2ec894680f4af616ae531227e389c66535b8f143 | feeds.py | feeds.py | from webapp2 import RequestHandler, WSGIApplication
from src.news_feed import get_news_feed
class Feeds(RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.write('Editorials!')
news = get_news_feed()
for n in news:
self.response.write("\n\n{}\n{}\n{}\n{}".form... | from time import mktime
from datetime import datetime
from webapp2 import RequestHandler, WSGIApplication
from google.appengine.ext import ndb
from src.news_feed import get_news_feed
import hashlib
class Feeds(RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
news_list = get_new... | Add the newsitems to GAE NDB | Add the newsitems to GAE NDB
If not present, add the news item to the non relational database of google app
engine.
For deciding unique keys, md5 hashing using the news item title and date is
used.
Signed-off-by: Venkatesh Shukla <8349e50bec2939976da648e286d7e261bcd17fa3@iitbhu.ac.in>
| Python | mit | venkateshshukla/th-editorials-server | from webapp2 import RequestHandler, WSGIApplication
from src.news_feed import get_news_feed
class Feeds(RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.write('Editorials!')
news = get_news_feed()
for n in news:
self.response.write("\n\n{}\n{}\n{}\n{}".form... | from time import mktime
from datetime import datetime
from webapp2 import RequestHandler, WSGIApplication
from google.appengine.ext import ndb
from src.news_feed import get_news_feed
import hashlib
class Feeds(RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
news_list = get_new... | <commit_before>from webapp2 import RequestHandler, WSGIApplication
from src.news_feed import get_news_feed
class Feeds(RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.write('Editorials!')
news = get_news_feed()
for n in news:
self.response.write("\n\n{}\n{... | from time import mktime
from datetime import datetime
from webapp2 import RequestHandler, WSGIApplication
from google.appengine.ext import ndb
from src.news_feed import get_news_feed
import hashlib
class Feeds(RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
news_list = get_new... | from webapp2 import RequestHandler, WSGIApplication
from src.news_feed import get_news_feed
class Feeds(RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.write('Editorials!')
news = get_news_feed()
for n in news:
self.response.write("\n\n{}\n{}\n{}\n{}".form... | <commit_before>from webapp2 import RequestHandler, WSGIApplication
from src.news_feed import get_news_feed
class Feeds(RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.write('Editorials!')
news = get_news_feed()
for n in news:
self.response.write("\n\n{}\n{... |
096b9783dc5b8cb0f2a20e9d3d57d3897d36b1ff | charat2/views/guides.py | charat2/views/guides.py | import requests
def user_guide():
r = requests.get("http://drweeaboo.net/msparp/userguide/duplicateguide.html")
return r.text, r.status_code
| import requests
def user_guide():
r = requests.get("http://drweeaboo.net/msparp/userguide/duplicateguide.html")
r.encoding = r.apparent_encoding
return r.text, r.status_code
| Set response encoding based on apparent_encoding. | Set response encoding based on apparent_encoding.
Headers from drweeaboo.net incorrectly tell us ISO-8859-1.
| Python | agpl-3.0 | MSPARP/newparp,MSPARP/newparp,MSPARP/newparp | import requests
def user_guide():
r = requests.get("http://drweeaboo.net/msparp/userguide/duplicateguide.html")
return r.text, r.status_code
Set response encoding based on apparent_encoding.
Headers from drweeaboo.net incorrectly tell us ISO-8859-1. | import requests
def user_guide():
r = requests.get("http://drweeaboo.net/msparp/userguide/duplicateguide.html")
r.encoding = r.apparent_encoding
return r.text, r.status_code
| <commit_before>import requests
def user_guide():
r = requests.get("http://drweeaboo.net/msparp/userguide/duplicateguide.html")
return r.text, r.status_code
<commit_msg>Set response encoding based on apparent_encoding.
Headers from drweeaboo.net incorrectly tell us ISO-8859-1.<commit_after> | import requests
def user_guide():
r = requests.get("http://drweeaboo.net/msparp/userguide/duplicateguide.html")
r.encoding = r.apparent_encoding
return r.text, r.status_code
| import requests
def user_guide():
r = requests.get("http://drweeaboo.net/msparp/userguide/duplicateguide.html")
return r.text, r.status_code
Set response encoding based on apparent_encoding.
Headers from drweeaboo.net incorrectly tell us ISO-8859-1.import requests
def user_guide():
r = requests.get("htt... | <commit_before>import requests
def user_guide():
r = requests.get("http://drweeaboo.net/msparp/userguide/duplicateguide.html")
return r.text, r.status_code
<commit_msg>Set response encoding based on apparent_encoding.
Headers from drweeaboo.net incorrectly tell us ISO-8859-1.<commit_after>import requests
de... |
c6d1a929f747a76155cce73e8c1a1358cf226f0e | constellation_forms/__init__.py | constellation_forms/__init__.py | """
This module implements a forms system for creating, filling out, and
reviewing forms within an organization. This module depends on the
Constellation-Base package to function correctly.
Constellation Forms implements a fairly standard forms system. The
core features include:
* Click-to-Build form builder
* Form... | """
This module implements a forms system for creating, filling out, and
reviewing forms within an organization. This module depends on the
Constellation-Base package to function correctly.
Constellation Forms implements a fairly standard forms system. The
core features include:
* Click-to-Build form builder
* Form... | Update front page of the documentation | Update front page of the documentation
| Python | isc | ConstellationApps/Forms,ConstellationApps/Forms,ConstellationApps/Forms | """
This module implements a forms system for creating, filling out, and
reviewing forms within an organization. This module depends on the
Constellation-Base package to function correctly.
Constellation Forms implements a fairly standard forms system. The
core features include:
* Click-to-Build form builder
* Form... | """
This module implements a forms system for creating, filling out, and
reviewing forms within an organization. This module depends on the
Constellation-Base package to function correctly.
Constellation Forms implements a fairly standard forms system. The
core features include:
* Click-to-Build form builder
* Form... | <commit_before>"""
This module implements a forms system for creating, filling out, and
reviewing forms within an organization. This module depends on the
Constellation-Base package to function correctly.
Constellation Forms implements a fairly standard forms system. The
core features include:
* Click-to-Build form... | """
This module implements a forms system for creating, filling out, and
reviewing forms within an organization. This module depends on the
Constellation-Base package to function correctly.
Constellation Forms implements a fairly standard forms system. The
core features include:
* Click-to-Build form builder
* Form... | """
This module implements a forms system for creating, filling out, and
reviewing forms within an organization. This module depends on the
Constellation-Base package to function correctly.
Constellation Forms implements a fairly standard forms system. The
core features include:
* Click-to-Build form builder
* Form... | <commit_before>"""
This module implements a forms system for creating, filling out, and
reviewing forms within an organization. This module depends on the
Constellation-Base package to function correctly.
Constellation Forms implements a fairly standard forms system. The
core features include:
* Click-to-Build form... |
25724a77c19828d52cba2b6e682c67f67013590e | django_counter_field/fields.py | django_counter_field/fields.py | from django.db import models
class CounterField(models.IntegerField):
def __init__(self, *args, **kwargs):
kwargs['default'] = kwargs.get('default', 0)
super(CounterField, self).__init__(*args, **kwargs)
try:
from south.modelsinspector import add_introspection_rules
except ImportError:
pa... | from django.db import models
class CounterField(models.IntegerField):
"""
CounterField wraps the standard django IntegerField. It exists primarily to allow for easy validation of
counter fields. The default value of a counter field is 0.
"""
def __init__(self, *args, **kwargs):
kwargs['def... | Fix bug in introspection rule | Fix bug in introspection rule | Python | mit | kajic/django-counter-field | from django.db import models
class CounterField(models.IntegerField):
def __init__(self, *args, **kwargs):
kwargs['default'] = kwargs.get('default', 0)
super(CounterField, self).__init__(*args, **kwargs)
try:
from south.modelsinspector import add_introspection_rules
except ImportError:
pa... | from django.db import models
class CounterField(models.IntegerField):
"""
CounterField wraps the standard django IntegerField. It exists primarily to allow for easy validation of
counter fields. The default value of a counter field is 0.
"""
def __init__(self, *args, **kwargs):
kwargs['def... | <commit_before>from django.db import models
class CounterField(models.IntegerField):
def __init__(self, *args, **kwargs):
kwargs['default'] = kwargs.get('default', 0)
super(CounterField, self).__init__(*args, **kwargs)
try:
from south.modelsinspector import add_introspection_rules
except Impo... | from django.db import models
class CounterField(models.IntegerField):
"""
CounterField wraps the standard django IntegerField. It exists primarily to allow for easy validation of
counter fields. The default value of a counter field is 0.
"""
def __init__(self, *args, **kwargs):
kwargs['def... | from django.db import models
class CounterField(models.IntegerField):
def __init__(self, *args, **kwargs):
kwargs['default'] = kwargs.get('default', 0)
super(CounterField, self).__init__(*args, **kwargs)
try:
from south.modelsinspector import add_introspection_rules
except ImportError:
pa... | <commit_before>from django.db import models
class CounterField(models.IntegerField):
def __init__(self, *args, **kwargs):
kwargs['default'] = kwargs.get('default', 0)
super(CounterField, self).__init__(*args, **kwargs)
try:
from south.modelsinspector import add_introspection_rules
except Impo... |
afc94c1a1ebf14dbb393234233055915132a9fb8 | django_ethereum_events/apps.py | django_ethereum_events/apps.py | from django.apps import AppConfig
from django.conf import settings
class EthereumEventsConfig(AppConfig):
name = 'django_ethereum_events'
def ready(self):
super(EthereumEventsConfig, self).ready()
app.config_from_object('django.conf:settings')
app.autodiscover_tasks(lambda: settings.I... | from django.apps import AppConfig
from django.conf import settings
class EthereumEventsConfig(AppConfig):
name = 'django_ethereum_events'
| Fix for the previous commit (Celery app removal) | Fix for the previous commit (Celery app removal)
Haven't paid enough attention and missed what ready method does.
Removed the code. Libraries shouldn't do this - it's main project responsibility. | Python | mit | artemistomaras/django-ethereum-events,artemistomaras/django-ethereum-events | from django.apps import AppConfig
from django.conf import settings
class EthereumEventsConfig(AppConfig):
name = 'django_ethereum_events'
def ready(self):
super(EthereumEventsConfig, self).ready()
app.config_from_object('django.conf:settings')
app.autodiscover_tasks(lambda: settings.I... | from django.apps import AppConfig
from django.conf import settings
class EthereumEventsConfig(AppConfig):
name = 'django_ethereum_events'
| <commit_before>from django.apps import AppConfig
from django.conf import settings
class EthereumEventsConfig(AppConfig):
name = 'django_ethereum_events'
def ready(self):
super(EthereumEventsConfig, self).ready()
app.config_from_object('django.conf:settings')
app.autodiscover_tasks(lam... | from django.apps import AppConfig
from django.conf import settings
class EthereumEventsConfig(AppConfig):
name = 'django_ethereum_events'
| from django.apps import AppConfig
from django.conf import settings
class EthereumEventsConfig(AppConfig):
name = 'django_ethereum_events'
def ready(self):
super(EthereumEventsConfig, self).ready()
app.config_from_object('django.conf:settings')
app.autodiscover_tasks(lambda: settings.I... | <commit_before>from django.apps import AppConfig
from django.conf import settings
class EthereumEventsConfig(AppConfig):
name = 'django_ethereum_events'
def ready(self):
super(EthereumEventsConfig, self).ready()
app.config_from_object('django.conf:settings')
app.autodiscover_tasks(lam... |
36fb88bf5f60a656defaafc7626c373e59a70e05 | tests/util.py | tests/util.py | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import unicode_literals
import codecs
import contextlib
import functools
import os
class Env(object):
def __init__(self):
self.user = os.getenv('AWS_ACCESS_KEY_ID', None)
assert self.user, \
'Required environ... | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import unicode_literals
import codecs
import contextlib
import functools
import os
class Env(object):
def __init__(self):
# self.user = os.getenv('AWS_ACCESS_KEY_ID', None)
# assert self.user, \
# 'Required e... | Comment out assertion of environment variables(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY). When test fail, all environment variables appear in the error log in some case. Use credential file(~/.aws/credential) configuration for testing. | Comment out assertion of environment variables(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY).
When test fail, all environment variables appear in the error log in some case.
Use credential file(~/.aws/credential) configuration for testing.
| Python | mit | laughingman7743/PyAthenaJDBC,laughingman7743/PyAthenaJDBC | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import unicode_literals
import codecs
import contextlib
import functools
import os
class Env(object):
def __init__(self):
self.user = os.getenv('AWS_ACCESS_KEY_ID', None)
assert self.user, \
'Required environ... | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import unicode_literals
import codecs
import contextlib
import functools
import os
class Env(object):
def __init__(self):
# self.user = os.getenv('AWS_ACCESS_KEY_ID', None)
# assert self.user, \
# 'Required e... | <commit_before>#!/usr/bin/env python
from __future__ import absolute_import
from __future__ import unicode_literals
import codecs
import contextlib
import functools
import os
class Env(object):
def __init__(self):
self.user = os.getenv('AWS_ACCESS_KEY_ID', None)
assert self.user, \
'R... | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import unicode_literals
import codecs
import contextlib
import functools
import os
class Env(object):
def __init__(self):
# self.user = os.getenv('AWS_ACCESS_KEY_ID', None)
# assert self.user, \
# 'Required e... | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import unicode_literals
import codecs
import contextlib
import functools
import os
class Env(object):
def __init__(self):
self.user = os.getenv('AWS_ACCESS_KEY_ID', None)
assert self.user, \
'Required environ... | <commit_before>#!/usr/bin/env python
from __future__ import absolute_import
from __future__ import unicode_literals
import codecs
import contextlib
import functools
import os
class Env(object):
def __init__(self):
self.user = os.getenv('AWS_ACCESS_KEY_ID', None)
assert self.user, \
'R... |
c8bc1a79c3a82415e8ccad6395fcb0313d2c3685 | ffmpeg_process.py | ffmpeg_process.py | # coding: utf-8
import logging
import psutil
from subprocess import PIPE
class FfmpegProcess(object):
def __init__(self):
self._cmdline = None
self._process = None
self._paused = False
def run(self):
if not self._cmdline:
logging.debug('cmdline is not yet defined')... | # coding: utf-8
import logging
import psutil
from subprocess import PIPE
class FfmpegProcess(object):
def __init__(self):
self._cmdline = None
self._process = None
self._paused = False
def run(self):
if not self._cmdline:
logging.debug('cmdline is not yet defined')... | Fix type: NoneType --> bool | Fix type: NoneType --> bool
| Python | mit | dkrikun/ffmpeg-rcd | # coding: utf-8
import logging
import psutil
from subprocess import PIPE
class FfmpegProcess(object):
def __init__(self):
self._cmdline = None
self._process = None
self._paused = False
def run(self):
if not self._cmdline:
logging.debug('cmdline is not yet defined')... | # coding: utf-8
import logging
import psutil
from subprocess import PIPE
class FfmpegProcess(object):
def __init__(self):
self._cmdline = None
self._process = None
self._paused = False
def run(self):
if not self._cmdline:
logging.debug('cmdline is not yet defined')... | <commit_before># coding: utf-8
import logging
import psutil
from subprocess import PIPE
class FfmpegProcess(object):
def __init__(self):
self._cmdline = None
self._process = None
self._paused = False
def run(self):
if not self._cmdline:
logging.debug('cmdline is no... | # coding: utf-8
import logging
import psutil
from subprocess import PIPE
class FfmpegProcess(object):
def __init__(self):
self._cmdline = None
self._process = None
self._paused = False
def run(self):
if not self._cmdline:
logging.debug('cmdline is not yet defined')... | # coding: utf-8
import logging
import psutil
from subprocess import PIPE
class FfmpegProcess(object):
def __init__(self):
self._cmdline = None
self._process = None
self._paused = False
def run(self):
if not self._cmdline:
logging.debug('cmdline is not yet defined')... | <commit_before># coding: utf-8
import logging
import psutil
from subprocess import PIPE
class FfmpegProcess(object):
def __init__(self):
self._cmdline = None
self._process = None
self._paused = False
def run(self):
if not self._cmdline:
logging.debug('cmdline is no... |
6e80afd8f4317101a94f0d0114901da736f9912d | infect/infect.py | infect/infect.py | #!/usr/bin/env python
# coding: utf-8
import sys
import os
# import argparse
class Infect(object):
class Codes:
symlink = {
'success': 0,
'target_not_found': 1,
'destination_already_linked': 2,
'destination_exists': 3,
}
def __init__(self):
... | #!/usr/bin/env python
# coding: utf-8
import sys
import os
# import argparse
class Infect(object):
class Codes:
symlink = {
'success': 0,
'target_not_found': 1,
'destination_already_linked': 2,
'destination_exists': 3,
}
def __init__(self):
... | Add pragma: nocover to non-implemented methods | Add pragma: nocover to non-implemented methods
| Python | mit | thiderman/infect | #!/usr/bin/env python
# coding: utf-8
import sys
import os
# import argparse
class Infect(object):
class Codes:
symlink = {
'success': 0,
'target_not_found': 1,
'destination_already_linked': 2,
'destination_exists': 3,
}
def __init__(self):
... | #!/usr/bin/env python
# coding: utf-8
import sys
import os
# import argparse
class Infect(object):
class Codes:
symlink = {
'success': 0,
'target_not_found': 1,
'destination_already_linked': 2,
'destination_exists': 3,
}
def __init__(self):
... | <commit_before>#!/usr/bin/env python
# coding: utf-8
import sys
import os
# import argparse
class Infect(object):
class Codes:
symlink = {
'success': 0,
'target_not_found': 1,
'destination_already_linked': 2,
'destination_exists': 3,
}
def __i... | #!/usr/bin/env python
# coding: utf-8
import sys
import os
# import argparse
class Infect(object):
class Codes:
symlink = {
'success': 0,
'target_not_found': 1,
'destination_already_linked': 2,
'destination_exists': 3,
}
def __init__(self):
... | #!/usr/bin/env python
# coding: utf-8
import sys
import os
# import argparse
class Infect(object):
class Codes:
symlink = {
'success': 0,
'target_not_found': 1,
'destination_already_linked': 2,
'destination_exists': 3,
}
def __init__(self):
... | <commit_before>#!/usr/bin/env python
# coding: utf-8
import sys
import os
# import argparse
class Infect(object):
class Codes:
symlink = {
'success': 0,
'target_not_found': 1,
'destination_already_linked': 2,
'destination_exists': 3,
}
def __i... |
5e27b6166a205239b5d075f5568ca5edf86051cb | download-xflux.py | download-xflux.py | from sys import maxsize
import os
# There is similar code in ./debian/postinst. If you are changing this
# you probably want to change that too.
def download_xflux():
# Determines which is the appropriate executable for 32-bit
if maxsize == 2147483647:
print "Downloading 32-bit xflux ..."
url =... | from sys import maxsize
import os
# There is similar code in ./debian/postinst. If you are changing this
# you probably want to change that too.
def download_xflux():
# Determines which is the appropriate executable for 32-bit
if maxsize == 2147483647:
print("Downloading 32-bit xflux ...")
url ... | Make download script work with Python 3. | Make download script work with Python 3.
Closes #47. | Python | mit | xflux-gui/xflux-gui | from sys import maxsize
import os
# There is similar code in ./debian/postinst. If you are changing this
# you probably want to change that too.
def download_xflux():
# Determines which is the appropriate executable for 32-bit
if maxsize == 2147483647:
print "Downloading 32-bit xflux ..."
url =... | from sys import maxsize
import os
# There is similar code in ./debian/postinst. If you are changing this
# you probably want to change that too.
def download_xflux():
# Determines which is the appropriate executable for 32-bit
if maxsize == 2147483647:
print("Downloading 32-bit xflux ...")
url ... | <commit_before>from sys import maxsize
import os
# There is similar code in ./debian/postinst. If you are changing this
# you probably want to change that too.
def download_xflux():
# Determines which is the appropriate executable for 32-bit
if maxsize == 2147483647:
print "Downloading 32-bit xflux ...... | from sys import maxsize
import os
# There is similar code in ./debian/postinst. If you are changing this
# you probably want to change that too.
def download_xflux():
# Determines which is the appropriate executable for 32-bit
if maxsize == 2147483647:
print("Downloading 32-bit xflux ...")
url ... | from sys import maxsize
import os
# There is similar code in ./debian/postinst. If you are changing this
# you probably want to change that too.
def download_xflux():
# Determines which is the appropriate executable for 32-bit
if maxsize == 2147483647:
print "Downloading 32-bit xflux ..."
url =... | <commit_before>from sys import maxsize
import os
# There is similar code in ./debian/postinst. If you are changing this
# you probably want to change that too.
def download_xflux():
# Determines which is the appropriate executable for 32-bit
if maxsize == 2147483647:
print "Downloading 32-bit xflux ...... |
ce5b83d802e1b3aa40dc7de7ea7a5db61a91a210 | taarifa_backend/__init__.py | taarifa_backend/__init__.py | from flask import Flask
from flask.ext.mongoengine import MongoEngine
import logging
from os import environ
import urlparse
# configure the logging
logging.basicConfig(level='DEBUG',
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
app = Flask(__name__)
if environ.get('MONGOLAB_URI')... | from flask import Flask
from flask.ext.mongoengine import MongoEngine
import logging
from os import environ
import urlparse
# configure the logging
logging.basicConfig(level='DEBUG',
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
app = Flask(__name__)
if environ.get('MONGOLAB_URI')... | Allow overriding database name with DBNAME environment variable | Allow overriding database name with DBNAME environment variable
| Python | bsd-3-clause | taarifa/taarifa_backend,taarifa/taarifa_backend,taarifa/taarifa_backend,taarifa/taarifa_backend | from flask import Flask
from flask.ext.mongoengine import MongoEngine
import logging
from os import environ
import urlparse
# configure the logging
logging.basicConfig(level='DEBUG',
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
app = Flask(__name__)
if environ.get('MONGOLAB_URI')... | from flask import Flask
from flask.ext.mongoengine import MongoEngine
import logging
from os import environ
import urlparse
# configure the logging
logging.basicConfig(level='DEBUG',
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
app = Flask(__name__)
if environ.get('MONGOLAB_URI')... | <commit_before>from flask import Flask
from flask.ext.mongoengine import MongoEngine
import logging
from os import environ
import urlparse
# configure the logging
logging.basicConfig(level='DEBUG',
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
app = Flask(__name__)
if environ.get(... | from flask import Flask
from flask.ext.mongoengine import MongoEngine
import logging
from os import environ
import urlparse
# configure the logging
logging.basicConfig(level='DEBUG',
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
app = Flask(__name__)
if environ.get('MONGOLAB_URI')... | from flask import Flask
from flask.ext.mongoengine import MongoEngine
import logging
from os import environ
import urlparse
# configure the logging
logging.basicConfig(level='DEBUG',
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
app = Flask(__name__)
if environ.get('MONGOLAB_URI')... | <commit_before>from flask import Flask
from flask.ext.mongoengine import MongoEngine
import logging
from os import environ
import urlparse
# configure the logging
logging.basicConfig(level='DEBUG',
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
app = Flask(__name__)
if environ.get(... |
d50043e27e490528c3065603b6f9ad102fd5948e | ceraon/assets.py | ceraon/assets.py | # -*- coding: utf-8 -*-
"""Application assets."""
from flask_assets import Bundle, Environment
css = Bundle(
'libs/font-awesome/css/font-awesome.min.css',
'libs/bootstrap/dist/css/bootstrap.css',
'css/style.css',
filters='cssmin',
output='public/css/common.css'
)
js = Bundle(
'libs/jquery/dist... | # -*- coding: utf-8 -*-
"""Application assets."""
from flask_assets import Bundle, Environment
css = Bundle(
'libs/font-awesome/css/font-awesome.min.css',
'libs/bootstrap/dist/css/bootstrap.css',
'css/style.css',
filters='cssmin',
output='public/css/common.css'
)
js = Bundle(
'libs/jQuery/dist... | Revert "Renames jQuery to jquery." | Revert "Renames jQuery to jquery."
This reverts commit c1a1ad720326cd6c2877a89698534c9762d17df3.
| Python | bsd-3-clause | Rdbaker/Mealbound,Rdbaker/Mealbound,Rdbaker/Mealbound,Rdbaker/Mealbound,Rdbaker/Mealbound | # -*- coding: utf-8 -*-
"""Application assets."""
from flask_assets import Bundle, Environment
css = Bundle(
'libs/font-awesome/css/font-awesome.min.css',
'libs/bootstrap/dist/css/bootstrap.css',
'css/style.css',
filters='cssmin',
output='public/css/common.css'
)
js = Bundle(
'libs/jquery/dist... | # -*- coding: utf-8 -*-
"""Application assets."""
from flask_assets import Bundle, Environment
css = Bundle(
'libs/font-awesome/css/font-awesome.min.css',
'libs/bootstrap/dist/css/bootstrap.css',
'css/style.css',
filters='cssmin',
output='public/css/common.css'
)
js = Bundle(
'libs/jQuery/dist... | <commit_before># -*- coding: utf-8 -*-
"""Application assets."""
from flask_assets import Bundle, Environment
css = Bundle(
'libs/font-awesome/css/font-awesome.min.css',
'libs/bootstrap/dist/css/bootstrap.css',
'css/style.css',
filters='cssmin',
output='public/css/common.css'
)
js = Bundle(
'l... | # -*- coding: utf-8 -*-
"""Application assets."""
from flask_assets import Bundle, Environment
css = Bundle(
'libs/font-awesome/css/font-awesome.min.css',
'libs/bootstrap/dist/css/bootstrap.css',
'css/style.css',
filters='cssmin',
output='public/css/common.css'
)
js = Bundle(
'libs/jQuery/dist... | # -*- coding: utf-8 -*-
"""Application assets."""
from flask_assets import Bundle, Environment
css = Bundle(
'libs/font-awesome/css/font-awesome.min.css',
'libs/bootstrap/dist/css/bootstrap.css',
'css/style.css',
filters='cssmin',
output='public/css/common.css'
)
js = Bundle(
'libs/jquery/dist... | <commit_before># -*- coding: utf-8 -*-
"""Application assets."""
from flask_assets import Bundle, Environment
css = Bundle(
'libs/font-awesome/css/font-awesome.min.css',
'libs/bootstrap/dist/css/bootstrap.css',
'css/style.css',
filters='cssmin',
output='public/css/common.css'
)
js = Bundle(
'l... |
186567fdc127e5c08131ebbf49b76a7f7430de6a | pathvalidate/_common.py | pathvalidate/_common.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import dataproperty
from ._error import NullNameError
def _validate_null_string(text):
if dataproperty.is_empty_string(text):
raise NullNameE... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import dataproperty
from ._error import NullNameError
def _validate_null_string(text, error_msg="null name"):
if dataproperty.is_empty_string(text):
... | Change to modifiable error message | Change to modifiable error message
| Python | mit | thombashi/pathvalidate | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import dataproperty
from ._error import NullNameError
def _validate_null_string(text):
if dataproperty.is_empty_string(text):
raise NullNameE... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import dataproperty
from ._error import NullNameError
def _validate_null_string(text, error_msg="null name"):
if dataproperty.is_empty_string(text):
... | <commit_before># encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import dataproperty
from ._error import NullNameError
def _validate_null_string(text):
if dataproperty.is_empty_string(text):
... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import dataproperty
from ._error import NullNameError
def _validate_null_string(text, error_msg="null name"):
if dataproperty.is_empty_string(text):
... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import dataproperty
from ._error import NullNameError
def _validate_null_string(text):
if dataproperty.is_empty_string(text):
raise NullNameE... | <commit_before># encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import dataproperty
from ._error import NullNameError
def _validate_null_string(text):
if dataproperty.is_empty_string(text):
... |
d84a6f51b6431db78e1d894b99e48f346fbf8214 | accelerator/migrations/0019_add_deferred_user_role.py | accelerator/migrations/0019_add_deferred_user_role.py | # Generated by Django 2.2.10 on 2020-04-09 21:24
from django.db import migrations
def add_deferred_user_role(apps, schema_editor):
DEFERRED_MENTOR = 'Deferred Mentor'
UserRole = apps.get_model('accelerator', 'UserRole')
Program = apps.get_model('accelerator', 'Program')
ProgramRole = apps.get_model('... | # Generated by Django 2.2.10 on 2020-04-09 21:24
from django.db import migrations
def add_deferred_user_role(apps, schema_editor):
DEFERRED_MENTOR = 'Deferred Mentor'
UserRole = apps.get_model('accelerator', 'UserRole')
Program = apps.get_model('accelerator', 'Program')
ProgramRole = apps.get_model('... | Change the user role key from userv to name | [AC-7743] Change the user role key from userv to name
| Python | mit | masschallenge/django-accelerator,masschallenge/django-accelerator | # Generated by Django 2.2.10 on 2020-04-09 21:24
from django.db import migrations
def add_deferred_user_role(apps, schema_editor):
DEFERRED_MENTOR = 'Deferred Mentor'
UserRole = apps.get_model('accelerator', 'UserRole')
Program = apps.get_model('accelerator', 'Program')
ProgramRole = apps.get_model('... | # Generated by Django 2.2.10 on 2020-04-09 21:24
from django.db import migrations
def add_deferred_user_role(apps, schema_editor):
DEFERRED_MENTOR = 'Deferred Mentor'
UserRole = apps.get_model('accelerator', 'UserRole')
Program = apps.get_model('accelerator', 'Program')
ProgramRole = apps.get_model('... | <commit_before># Generated by Django 2.2.10 on 2020-04-09 21:24
from django.db import migrations
def add_deferred_user_role(apps, schema_editor):
DEFERRED_MENTOR = 'Deferred Mentor'
UserRole = apps.get_model('accelerator', 'UserRole')
Program = apps.get_model('accelerator', 'Program')
ProgramRole = a... | # Generated by Django 2.2.10 on 2020-04-09 21:24
from django.db import migrations
def add_deferred_user_role(apps, schema_editor):
DEFERRED_MENTOR = 'Deferred Mentor'
UserRole = apps.get_model('accelerator', 'UserRole')
Program = apps.get_model('accelerator', 'Program')
ProgramRole = apps.get_model('... | # Generated by Django 2.2.10 on 2020-04-09 21:24
from django.db import migrations
def add_deferred_user_role(apps, schema_editor):
DEFERRED_MENTOR = 'Deferred Mentor'
UserRole = apps.get_model('accelerator', 'UserRole')
Program = apps.get_model('accelerator', 'Program')
ProgramRole = apps.get_model('... | <commit_before># Generated by Django 2.2.10 on 2020-04-09 21:24
from django.db import migrations
def add_deferred_user_role(apps, schema_editor):
DEFERRED_MENTOR = 'Deferred Mentor'
UserRole = apps.get_model('accelerator', 'UserRole')
Program = apps.get_model('accelerator', 'Program')
ProgramRole = a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.