commit
stringlengths
40
40
subject
stringlengths
4
1.73k
repos
stringlengths
5
127k
old_file
stringlengths
2
751
new_file
stringlengths
2
751
new_contents
stringlengths
1
8.98k
old_contents
stringlengths
0
6.59k
license
stringclasses
13 values
lang
stringclasses
23 values
2c1cbdfcb28595e945e6069501652f0869733549
Add future import for Py2.
INCF/pybids
bids/reports/report.py
bids/reports/report.py
"""Generate publication-quality data acquisition methods section from BIDS dataset. """ from __future__ import print_function from collections import Counter from bids.reports import utils class BIDSReport(object): """ Generates publication-quality data acquisition methods section from BIDS dataset. ...
"""Generate publication-quality data acquisition methods section from BIDS dataset. """ from collections import Counter from bids.reports import utils class BIDSReport(object): """ Generates publication-quality data acquisition methods section from BIDS dataset. """ def __init__(self, layout): ...
mit
Python
02f6e148627b90ce0f6b75a396cd00a58abb3248
Use UserStore in manage.py instead of User model.
waartaa/ircb
manage.py
manage.py
import asyncio from flask.ext.script import Command, Manager, Option from ircb.web.app import app from ircb.storeclient import NetworkStore from ircb.storeclient import UserStore from ircb.lib.async import coroutinize import ircb.stores import ircb.bouncer manager = Manager(app) class CreateUserCommand(Command): ...
import asyncio from flask.ext.script import Command, Manager, Option from ircb.web.app import app from ircb.models import get_session, User from ircb.storeclient import NetworkStore from ircb.lib.async import coroutinize import ircb.stores import ircb.bouncer manager = Manager(app) session = get_session() class Cre...
mit
Python
f817d49be68133a5783f371e09d8bbdcfa638c9f
make manage.py executable
mgax/mptracker,mgax/mptracker,mgax/mptracker,mgax/mptracker
manage.py
manage.py
#!/usr/bin/env python def main(): from mptracker.app import manager manager.run() if __name__ == '__main__': main()
def main(): from mptracker.app import manager manager.run() if __name__ == '__main__': main()
mit
Python
d5ec2cd468f185ba2f1c839eec7e969249f29c92
fix error on priority
iw3hxn/LibrERP,iw3hxn/LibrERP,iw3hxn/LibrERP,iw3hxn/LibrERP,iw3hxn/LibrERP
sale_subscriptions/models/__init__.py
sale_subscriptions/models/__init__.py
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2015 Didotech s.r.l. (<http://www.didotech.com>). # # This program is free software: you can redistribute it and/or modify # it under the term...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2015 Didotech s.r.l. (<http://www.didotech.com>). # # This program is free software: you can redistribute it and/or modify # it under the term...
agpl-3.0
Python
afe970f88d754338ed4c72bf0df1a78ed1d5933b
Fix flask script import
ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public
manage.py
manage.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging import os import subprocess import sys from flask.ext.script import Manager, Shell, Server from cla_public.app import create_app log = logging.getLogger(__name__) os.environ.setdefault('CLA_PUBLIC_CONFIG', 'config/base.py') app = create_app() manager = Ma...
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging import os import subprocess import sys from flask_script import Manager, Shell, Server from cla_public.app import create_app log = logging.getLogger(__name__) os.environ.setdefault('CLA_PUBLIC_CONFIG', 'config/base.py') app = create_app() manager = Manage...
mit
Python
874e0d04959899bda66951de08d8cc27cc772cad
fix bugs in create project user (esp when re-creating a user)
DrXyzzy/smc,sagemathinc/smc,tscholl2/smc,DrXyzzy/smc,DrXyzzy/smc,tscholl2/smc,sagemathinc/smc,tscholl2/smc,DrXyzzy/smc,sagemathinc/smc,sagemathinc/smc,tscholl2/smc,tscholl2/smc
salvus/scripts/create_project_user.py
salvus/scripts/create_project_user.py
#!/usr/bin/env python """ Create a user corresponding to a given project_id. create_storage_user.py [project-id] You should put the following in visudo: salvus ALL=(ALL) NOPASSWD: /usr/local/bin/create_project_user.py * """ import argparse, hashlib, os from subprocess import Popen, PIPE def uid...
#!/usr/bin/env python """ Create a user corresponding to a given project_id. create_storage_user.py [project-id] You should put the following in visudo: salvus ALL=(ALL) NOPASSWD: /usr/local/bin/create_project_user.py * """ import argparse, hashlib, os from subprocess import Popen, PIPE def uid...
agpl-3.0
Python
9fe5c064a5b3d55980d7fd5a39c3569ed83b451d
Change settings for tests
zostera/django-bootstrap4,zostera/django-bootstrap4
manage.py
manage.py
#!/usr/bin/env python import os import sys if __name__ == "__main__": settings = "tests.app.settings" if "test" in sys.argv else "demo.app.settings" os.environ.setdefault("DJANGO_SETTINGS_MODULE", settings) from django.core.management import execute_from_command_line execute_from_command_line(sys.arg...
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "demo.app.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
bsd-3-clause
Python
e08350dadf69577c06deadf96c6063c8a07dfac3
Standardize on single quotes.
pmdarrow/rest-api
manage.py
manage.py
#!/usr/bin/env python import os import sys if __name__ == '__main__': os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'rest_api.settings') try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that the...
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "rest_api.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that the...
mit
Python
088c1a80d3a8f5e9401632ba021626d36c982173
Add manager task to delete waterpoint resources
gwob/Maarifa,gwob/Maarifa,gwob/Maarifa,gwob/Maarifa,gwob/Maarifa
manage.py
manage.py
from flask.ext.script import Manager from taarifa_api import add_document, delete_documents from taarifa_waterpoints import app from taarifa_waterpoints.schemas import facility_schema manager = Manager(app) def check(response): data, _, _, status_code = response print "Succeeded" if status_code == 201 else ...
from flask.ext.script import Manager from taarifa_api import add_document from taarifa_waterpoints import app from taarifa_waterpoints.schemas import facility_schema manager = Manager(app) def check(response): data, _, _, status_code = response print "Succeeded" if status_code == 201 else "Failed", "with", ...
apache-2.0
Python
59e623be435365ee26e3d2280106505ccdf81b5f
Fix Issue #9
JackStouffer/Flask-Foundation,ahmadpriatama/Flask-Simple-Ecommerce,ahmadpriatama/Flask-Simple-Ecommerce,JackStouffer/Flask-Foundation
manage.py
manage.py
#!/usr/bin/env python import os from flask.ext.script import Manager, Server from flask.ext.script.commands import ShowUrls, Clean from appname import create_app from appname.models import db, User # default to dev config because no one should use this in # production anyway env = os.environ.get('APPNAME_ENV', 'dev'...
#!/usr/bin/env python import os from flask.ext.script import Manager, Server from flask.ext.script.commands import ShowUrls, Clean from appname import create_app from appname.models import db, User # default to dev config because no one should use this in # production anyway env = os.environ.get('APPNAME_ENV', 'dev'...
bsd-2-clause
Python
231623c348d791d34c02612c5df712abe978fa59
fix order of args in manage.py usage example
briancappello/flask-react-spa,briancappello/flask-react-spa,briancappello/flask-react-spa,briancappello/flask-react-spa,briancappello/flask-react-spa
manage.py
manage.py
#!/usr/bin/env python """ This script is equivalent to the following: FLASK_APP=wsgi.py FLASK_DEBUG=true flask (By default, always runs with FLASK_DEBUG=true, unless --env=prod is passed or FLASK_DEBUG is set to false, no or 0) USAGE: python manage.py [--env=prod] [--no-warn] COMMAND [OPTIONS] [ARGS] """ import argpa...
#!/usr/bin/env python """ This script is equivalent to the following: FLASK_APP=wsgi.py FLASK_DEBUG=true flask (By default, always runs with FLASK_DEBUG=true, unless --env=prod is passed or FLASK_DEBUG is set to false, no or 0) USAGE: python manage.py COMMAND [OPTIONS] [ARGS] [--env=prod] """ import argparse import o...
mit
Python
94f1cb970ff1c95c16665831e2ffcfbeb1b57947
Refactor testing
reubano/ckanny,reubano/ckanny
manage.py
manage.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ A script to manage development tasks """ from __future__ import ( absolute_import, division, print_function, with_statement, unicode_literals) from os import path as p from manager import Manager from subprocess import call manager = Manager() _basedir = p.d...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ A script to manage development tasks """ from __future__ import ( absolute_import, division, print_function, with_statement, unicode_literals) from os import path as p from manager import Manager from subprocess import call manager = Manager() _basedir = p.d...
mit
Python
c59c9b916c6c9a3c853ee2a37ab70821b4380c5d
add deploy function
superchilli/webapp,superchilli/webapp,superchilli/webapp,superchilli/webapp,superchilli/webapp
manage.py
manage.py
import os from app import create_app, db from app.models import User, Role, Permission, Post, Comment from flask_script import Manager, Shell from flask_migrate import Migrate, MigrateCommand app = create_app(os.environ.get('CONFIG') or 'default') manmager = Manager(app) migrate = Migrate(app, db) def make_shell_con...
import os from app import create_app, db from app.models import User, Role, Permission, Post, Comment from flask_script import Manager, Shell from flask_migrate import Migrate, MigrateCommand app = create_app(os.environ.get('CONFIG') or 'default') manmager = Manager(app) migrate = Migrate(app, db) def make_shell_con...
mit
Python
85eb10ea7c3982d36bdbaac3be44f4f286ec4eef
Rename loadmetadata command
DataViva/dataviva-api
manage.py
manage.py
from app import manager from app.scripts import LoadMetadataCommand, LoadScCourse manager.add_command('load_metadata', LoadMetadataCommand) manager.add_command('load_sc_course', LoadScCourse) manager.run()
from app import manager from app.scripts import LoadMetadataCommand, LoadScCourse manager.add_command('loadmetadata', LoadMetadataCommand) manager.add_command('load_sc_course', LoadScCourse) manager.run()
mit
Python
aafc076daf94281e8dc69dbe4f55e7fc0430613f
exit process if exception raised in _execute
genome/flow-core,genome/flow-core,genome/flow-core
flow/commands/base.py
flow/commands/base.py
from abc import ABCMeta, abstractmethod, abstractproperty from flow import exit_codes from flow.util.exit import exit_process from twisted.internet import reactor import logging LOG = logging.getLogger(__name__) class CommandBase(object): __metaclass__ = ABCMeta def __init__(self, exit_code=0): self...
from abc import ABCMeta, abstractmethod, abstractproperty from flow import exit_codes from flow.util.exit import exit_process from twisted.internet import reactor import logging LOG = logging.getLogger(__name__) class CommandBase(object): __metaclass__ = ABCMeta def __init__(self, exit_code=0): self...
agpl-3.0
Python
3ca95bfdfe8b4e68338f43de462e6b57e3fdf1a0
Remove excess whitespace
pypa/setuptools,pypa/setuptools,pypa/setuptools
setuptools/command/install_scripts.py
setuptools/command/install_scripts.py
from distutils.command.install_scripts import install_scripts \ as _install_scripts from pkg_resources import Distribution, PathMetadata, ensure_directory import os from distutils import log class install_scripts(_install_scripts): """Do normal script install, plus any egg_info wrapper scripts""" def ini...
from distutils.command.install_scripts import install_scripts \ as _install_scripts from pkg_resources import Distribution, PathMetadata, ensure_directory import os from distutils import log class install_scripts(_install_scripts): """Do normal script install, plus any egg_info wrapper scripts""" def ini...
mit
Python
bdacb243867e1d6cef3573fec383e9069e11523e
Add list with list test.
skk/eche
eche/tests/test_step1_raed_print.py
eche/tests/test_step1_raed_print.py
import pytest from eche.reader import read_str from eche.printer import print_str import math @pytest.mark.parametrize("test_input", [ '1', '-1', '0', str(math.pi), str(math.e) ]) def test_numbers(test_input): assert print_str(read_str(test_input)) == test_input @pytest.mark.parametrize("t...
import pytest from eche.reader import read_str from eche.printer import print_str import math @pytest.mark.parametrize("test_input", [ '1', '-1', '0', str(math.pi), str(math.e) ]) def test_numbers(test_input): assert print_str(read_str(test_input)) == test_input @pytest.mark.parametrize("t...
mit
Python
0f9940244834f3b9ba711dbb9b94fbd785ff0497
Implement the JournalFactory
TailorDev/django-tailordev-biblio,TailorDev/django-tailordev-biblio,TailorDev/django-tailordev-biblio,TailorDev/django-tailordev-biblio
td_biblio/factories.py
td_biblio/factories.py
# -*- coding: utf-8 -*- import factory import names from factory.django import DjangoModelFactory from . import models JOURNAL_CHOICES = [ ('Bioinformatics', 'Bioinformatics'), ('BMC Bioinf.', 'BMC Bioinformatics'), ('JACS', 'Journal of the American Chemical Society'), ('J. Comput. Chem.', 'Journal ...
# -*- coding: utf-8 -*- import names from factory.django import DjangoModelFactory from . import models class AbstractHuman(DjangoModelFactory): FACTORY_FOR = models.AbstractHuman ABSTRACT_FACTORY = True first_name = names.get_first_name() last_name = names.get_last_name() class AuthorFactory(Abs...
mit
Python
353a6a6afa1f5820f995eb96d382d81064bc058a
Support django-recaptcha2>=1.4.0 (#1631)
DMOJ/site,DMOJ/site,DMOJ/site,DMOJ/site
judge/jinja2/social.py
judge/jinja2/social.py
from django.template.loader import get_template from django.utils.safestring import mark_safe from django_social_share.templatetags.social_share import post_to_facebook_url, post_to_twitter_url from . import registry SHARES = [ ('post_to_twitter', 'django_social_share/templatetags/post_to_twitter.html', post_to_t...
from django.template.loader import get_template from django.utils.safestring import mark_safe from django_social_share.templatetags.social_share import post_to_facebook_url, post_to_twitter_url from . import registry SHARES = [ ('post_to_twitter', 'django_social_share/templatetags/post_to_twitter.html', post_to_t...
agpl-3.0
Python
c40bd3822637bfb51b3fa70fdae954b3dbf43868
test currently fails, because the settings are broke.
gabegaster/django-offlinecdn,gabegaster/django-offlinecdn
example/tests/test_functional.py
example/tests/test_functional.py
from selenium import webdriver import requests from bs4 import BeautifulSoup from django.test import LiveServerTestCase from django.template import Context, Template from django.template.base import VariableNode from offlinecdn.conf import settings class StaticTest(LiveServerTestCase): browser = None host = "...
from selenium import webdriver import requests from bs4 import BeautifulSoup from django.test import LiveServerTestCase from django.template import Context, Template from django.template.base import VariableNode from offlinecdn.conf import settings class StaticTest(LiveServerTestCase): browser = None host = "...
mit
Python
420a786fb9c5bf476e2c444b181161e75ca801f8
Move is_sticky field into post's advanced options
blancltd/glitter-news
glitter_news/admin.py
glitter_news/admin.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.contrib import admin from adminsortable.admin import SortableAdmin from glitter import block_admin from glitter.admin import GlitterAdminMixin, GlitterPagePublishedFilter from .models import Category, LatestN...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.contrib import admin from adminsortable.admin import SortableAdmin from glitter import block_admin from glitter.admin import GlitterAdminMixin, GlitterPagePublishedFilter from .models import Category, LatestN...
bsd-2-clause
Python
af04a42e20626896532798e0e0ff8f2e2ac16a7b
Fix the token in get refresh token
onitu/onitu,onitu/onitu,onitu/onitu
drivers/hubic/get_refresh_token.py
drivers/hubic/get_refresh_token.py
import requests import urllib import webbrowser import base64 # Python 3 compatibility try: raw_input except NameError: raw_input = input if __name__ == '__main__': client_id = "api_hubic_yExkTKwof2zteYA8kQG4gYFmnmHVJoNl" client_secret = ("CWN2NMOVwM4wjsg3RFRMmE6OpUNJhsADLaiduV4" ...
import requests import urllib import webbrowser import base64 # Python 3 compatibility try: raw_input except NameError: raw_input = input if __name__ == '__main__': client_id = "api_hubic_yExkTKwof2zteYA8kQG4gYFmnmHVJoNl" client_secret = "CWN2NMOVwM4wjsg3RFRMmE6OpUNJhsADLaiduV4" "9e7SpBsHDAKdtm5W...
mit
Python
39df099d0ec431eb2e3495964ab0dedb7d1ddcb2
Bump version to 0.0.1
msabramo/flake8-exact-pin
flake8_exact_pin.py
flake8_exact_pin.py
import ast import os import sys import tokenize __version__ = '0.0.1' EXACT_PIN_ERROR_CODE = 'P001' EXACT_PIN_ERROR_MESSAGE = 'exact pin found in install_requires' class ExactPinChecker(object): name = 'flake8-exact-pin' version = __version__ def __init__(self, tree, filename='(none)', builtins=None):...
import ast import os import sys import tokenize __version__ = '0.0.0' EXACT_PIN_ERROR_CODE = 'P001' EXACT_PIN_ERROR_MESSAGE = 'exact pin found in install_requires' class ExactPinChecker(object): name = 'flake8-exact-pin' version = __version__ def __init__(self, tree, filename='(none)', builtins=None):...
mit
Python
21e3edfb0fb8e42df3e3fadf6452d1b5ea1558da
Prepare v2.3.26.dev
LynxyssCZ/Flexget,qk4l/Flexget,jawilson/Flexget,drwyrm/Flexget,Flexget/Flexget,Danfocus/Flexget,jacobmetrick/Flexget,OmgOhnoes/Flexget,jawilson/Flexget,gazpachoking/Flexget,crawln45/Flexget,tarzasai/Flexget,crawln45/Flexget,tobinjt/Flexget,jawilson/Flexget,LynxyssCZ/Flexget,Danfocus/Flexget,tobinjt/Flexget,poulpito/Fle...
flexget/_version.py
flexget/_version.py
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
mit
Python
a7ff99b5931de945447b7f1a73af620f4206c837
Prepare v1.2.372.dev
drwyrm/Flexget,cvium/Flexget,sean797/Flexget,lildadou/Flexget,crawln45/Flexget,OmgOhnoes/Flexget,Flexget/Flexget,Pretagonist/Flexget,gazpachoking/Flexget,malkavi/Flexget,sean797/Flexget,tarzasai/Flexget,LynxyssCZ/Flexget,jawilson/Flexget,tsnoam/Flexget,qk4l/Flexget,crawln45/Flexget,antivirtel/Flexget,offbyone/Flexget,o...
flexget/_version.py
flexget/_version.py
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
mit
Python
98856f094fb63e36daae3b735ba650f87114ba13
Fix bugs in db module
xtfc/compytition,xtfc/compytition
compytition/db.py
compytition/db.py
import flask import sqlite3 from contextlib import closing from compytition import app def init(): with closing(sqlite3.connect(app.config['DATABASE'])) as db: with app.open_resource('schema.sql', mode='r') as f: db.cursor().executescript(f.read()) db.commit() def connect(): db = getattr(flask.g, 'db', None)...
import flask import sqlite3 from contextlib import closing from compytition import app def init(): with closing(connect()) as db: with app.open_resource('schema.sql', mode='r') as f: db.cursor().executescript(f.read()) db.commit() def connect(): db = getattr(flask.g, 'db', None) if db is None: db = sqlite...
mit
Python
9918b1e912d8a9a5d37366f2d02c6ca90d20ae60
Add missing request argument to call to get_safe_return_to()
ministryofjustice/django-zendesk-tickets,ministryofjustice/django-zendesk-tickets
zendesk_tickets/views.py
zendesk_tickets/views.py
from urllib.parse import urlparse from django.forms.forms import NON_FIELD_ERRORS from django.http import HttpResponseRedirect from django.shortcuts import render from django.template.response import TemplateResponse from django.utils.http import is_safe_url from django.utils.translation import ugettext as _ from requ...
from urllib.parse import urlparse from django.forms.forms import NON_FIELD_ERRORS from django.http import HttpResponseRedirect from django.shortcuts import render from django.template.response import TemplateResponse from django.utils.http import is_safe_url from django.utils.translation import ugettext as _ from requ...
mit
Python
480295fca4ff0c05fea4957f7971c54631f7557f
Put tests into top level functinos
jay-tyler/data-structures,jonathanstallings/data-structures
test_linked_list.py
test_linked_list.py
import pytest import linked_list as ll @pytest.fixture def base_llist(): return ll.linked_list([1, 2, 3]) def test_construct_from_iterable_valid(base_llist): expected_output = "(1, 2, 3)" assert base_llist.display() == expected_output def test_construct_from_nested_iterable_valid(): arg = ([1, 2, ...
import pytest import linked_list as ll @pytest.fixture def base_llist(): return ll.linked_list([1, 2, 3]) class TestConstructor(): def test_construct_from_iterable_valid(base_llist): expected_output = "(1, 2, 3)" assert base_llist.display() == expected_output def test_construct_from_nes...
mit
Python
1c63fbb040b5e9da9f1ffaa60277b6a7f26ceb83
Prepare v2.0.14.dev
dsemi/Flexget,tobinjt/Flexget,JorisDeRieck/Flexget,JorisDeRieck/Flexget,OmgOhnoes/Flexget,malkavi/Flexget,LynxyssCZ/Flexget,tarzasai/Flexget,qk4l/Flexget,drwyrm/Flexget,sean797/Flexget,malkavi/Flexget,crawln45/Flexget,malkavi/Flexget,Danfocus/Flexget,oxc/Flexget,LynxyssCZ/Flexget,ianstalk/Flexget,drwyrm/Flexget,jacobme...
flexget/_version.py
flexget/_version.py
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
mit
Python
05b4a20a5bfadfc748eb413f3368df81edb29002
Prepare v2.3.18.dev
tarzasai/Flexget,qk4l/Flexget,Danfocus/Flexget,crawln45/Flexget,OmgOhnoes/Flexget,LynxyssCZ/Flexget,qk4l/Flexget,JorisDeRieck/Flexget,OmgOhnoes/Flexget,malkavi/Flexget,Danfocus/Flexget,sean797/Flexget,dsemi/Flexget,Flexget/Flexget,JorisDeRieck/Flexget,jacobmetrick/Flexget,gazpachoking/Flexget,LynxyssCZ/Flexget,ianstalk...
flexget/_version.py
flexget/_version.py
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
mit
Python
8ba2589cbe02fd24c61a3edc61b37b564c0bf3d1
Prepare v1.2.307.dev
tsnoam/Flexget,tobinjt/Flexget,xfouloux/Flexget,drwyrm/Flexget,tsnoam/Flexget,ibrahimkarahan/Flexget,jawilson/Flexget,poulpito/Flexget,jawilson/Flexget,JorisDeRieck/Flexget,spencerjanssen/Flexget,OmgOhnoes/Flexget,qk4l/Flexget,ZefQ/Flexget,ibrahimkarahan/Flexget,crawln45/Flexget,cvium/Flexget,ratoaq2/Flexget,oxc/Flexge...
flexget/_version.py
flexget/_version.py
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
mit
Python
fd5aaa5012e2da4696d6d151166e28358aeba66d
hide gdr.ReadNpz
shmilee/gdpy3,shmilee/gdpy3,shmilee/gdpy3,shmilee/gdpy3
gdpy3/read/__init__.py
gdpy3/read/__init__.py
# -*- coding: utf-8 -*- # Copyright (c) 2017 shmilee r''' This is the subpackage ``read`` of package gdpy3. ''' __all__ = ['read', 'readnpz', 'readhdf5', 'readraw'] import os import sys import logging logging.basicConfig( stream=sys.stdout, level=logging.INFO, # format='[%(asctime)s %(name)s] %(lev...
# -*- coding: utf-8 -*- # Copyright (c) 2017 shmilee r''' This is the subpackage ``read`` of package gdpy3. ''' __all__ = ['read', 'readnpz', 'readhdf5', 'readraw'] import os import sys import logging from .readnpz import ReadNpz logging.basicConfig( stream=sys.stdout, level=logging.INFO, # format=...
mit
Python
ed14106def5eb06b66f96543580aee03db4e50ac
Bump version at HEAD to 2.4.0a0
tensorflow/tensorboard,tensorflow/tensorboard,tensorflow/tensorboard,tensorflow/tensorboard,tensorflow/tensorboard,tensorflow/tensorboard,tensorflow/tensorboard
tensorboard/version.py
tensorboard/version.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
Python
b098cd5bd6cca95b8888cbfa650cedd52bd1bbd9
Update __init__ to account for the new changes
ibab/tensorprob,tensorprob/tensorprob,ibab/tensorfit
tensorprob/__init__.py
tensorprob/__init__.py
from . import config from . import distributions from .model import Model from .scalar import Scalar from . import utilities __all__ = [ config, Model, Scalar, utilities ] __all__.extend(distributions.__all__)
from .model import Model
mit
Python
af279e8fd2a0d699f4c29d6a3e9be1e4aae29148
raise ValueError, not Assertion
jschneier/TwistedTorrent,jschneier/TwistedTorrent
twistedtorrent/utils.py
twistedtorrent/utils.py
import os import struct import socket def n_random(n): """Return a random byte string of length n -- cryptographically secure.""" return os.urandom(n) def decode_hosts_ports(peers_raw): """Decode a compact byte string of hosts and ports into a list of tuples. Peers_raw's length must be a multiple of 6...
import os import struct import socket def n_random(n): """Return a random byte string of length n -- cryptographically secure.""" return os.urandom(n) def decode_hosts_ports(peers_raw): """Decode a compact byte string of hosts and ports into a list of tuples. Peers_raw's length must be a multiple of 6...
mit
Python
fe8712706d41b8ecd0eaa8e7b50475ccbb203a40
Remove some unreachable code
matthiask/django-keyed-urls,matthiask/django-keyed-urls,matthiask/django-keyed-urls
keyed_urls/__init__.py
keyed_urls/__init__.py
VERSION = (0, 1, 1) __version__ = '.'.join(map(str, VERSION)) _none_type = 0xc0ffee def get_url(key, language=None): from django.conf import settings from django.core.cache import cache from django.utils.translation import get_language, override from keyed_urls.models import KeyedURL language =...
VERSION = (0, 1, 1) __version__ = '.'.join(map(str, VERSION)) _none_type = 0xc0ffee def get_url(key, language=None): from django.conf import settings from django.core.cache import cache from django.utils.translation import get_language, override from keyed_urls.models import KeyedURL language =...
bsd-3-clause
Python
8ec96abe905390190c5790bd79598f78eace84fe
clean up models (now it uses quokka-cart)
quokkaproject/quokka-fundraising,quokkaproject/quokka-fundraising
models.py
models.py
# coding: utf-8 from quokka.core.db import db from quokka.core.models import Publishable from quokka.modules.cart.models import BaseProduct class Campaign(BaseProduct): body = db.StringField(required=True) start_date = db.DateTimeField() end_date = db.DateTimeField() min_value = db.FloatField() m...
# coding: utf-8 from quokka.core.db import db from quokka.core.models import Publishable, Content #from quokka.modules.accounts.models import User class Campaign(Content): body = db.StringField(required=True) class Values(db.EmbeddedDocument): campaign = db.ReferenceField(Campaign) campaign_name = db.S...
mit
Python
3685efdb1b5811d58eac470a6995ab22191e654f
fix typo
atlefren/mineturer2,atlefren/mineturer2
models.py
models.py
# -*- coding: utf-8 -*- from datetime import datetime import hashlib from sqlalchemy import Column, Integer, String, DateTime, Date, Time, ForeignKey, Enum, Boolean from sqlalchemy.orm import relationship from database import Base class User(Base): __tablename__ = "users" __table_args__ = {'schema': 'minetur...
# -*- coding: utf-8 -*- from datetime import datetime import hashlib from sqlalchemy import Column, Integer, String, DateTime, Date, Time, ForeignKey, Enum, Boolean from sqlalchemy.orm import relationship from database import Base class User(Base): __tablename__ = "users" __table_args__ = {'schema': 'minetur...
mit
Python
4965edbc7dff21ba50f75e6dabc2ac4b60d9cec5
drop fatal error for voltadmin dr reset
VoltDB/voltdb,simonzhangsm/voltdb,deerwalk/voltdb,simonzhangsm/voltdb,VoltDB/voltdb,deerwalk/voltdb,simonzhangsm/voltdb,VoltDB/voltdb,deerwalk/voltdb,VoltDB/voltdb,deerwalk/voltdb,simonzhangsm/voltdb,simonzhangsm/voltdb,deerwalk/voltdb,simonzhangsm/voltdb,deerwalk/voltdb,VoltDB/voltdb,deerwalk/voltdb,simonzhangsm/voltd...
lib/python/voltcli/voltadmin.d/dr.py
lib/python/voltcli/voltadmin.d/dr.py
# This file is part of VoltDB. # Copyright (C) 2008-2017 VoltDB Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later ver...
# This file is part of VoltDB. # Copyright (C) 2008-2017 VoltDB Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later ver...
agpl-3.0
Python
221134b178bc4106bc39c7eb3120395c27473963
Add business name to csv output
aysent/yelp-photo-explorer
json2csv_business.py
json2csv_business.py
import json def main(): # print the header of output csv file print 'business_id,name,city,latitude,longitude' # for each entry in input json file print one csv row for line in open("data/yelp_academic_dataset_business.json"): input_json = json.loads(line) business_id = input_json['bu...
import json def main(): # print the header of output csv file print 'business_id,city,latitude,longitude' # for each entry in input json file print one csv row for line in open("data/yelp_academic_dataset_business.json"): input_json = json.loads(line) business_id = input_json['busines...
mit
Python
1b271f89751faa93a287470f6758d6c00362a24c
Remove broken test_stderr_logging test
facebook/mcrouter,facebook/mcrouter,facebook/mcrouter,facebook/mcrouter
mcrouter/test/test_logging_route.py
mcrouter/test/test_logging_route.py
# Copyright (c) 2015-present, Facebook, Inc. # # This source code is licensed under the MIT license found in the LICENSE # file in the root directory of this source tree. from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals...
# Copyright (c) 2015, Facebook, Inc. # # This source code is licensed under the MIT license found in the LICENSE # file in the root directory of this source tree. from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from m...
mit
Python
49d4d3fd5d040efb99bc487b9648e354a39df20d
Apply default cascade rules for firebird self-ref ForeignKeys.
obeattie/sqlalchemy,obeattie/sqlalchemy,obeattie/sqlalchemy
test/testlib/schema.py
test/testlib/schema.py
import testbase from testlib import testing schema = None __all__ = 'Table', 'Column', table_options = {} def Table(*args, **kw): """A schema.Table wrapper/hook for dialect-specific tweaks.""" global schema if schema is None: from sqlalchemy import schema test_opts = dict([(k,kw.pop(k)) for...
import testbase schema = None __all__ = 'Table', 'Column', table_options = {} def Table(*args, **kw): """A schema.Table wrapper/hook for dialect-specific tweaks.""" global schema if schema is None: from sqlalchemy import schema test_opts = dict([(k,kw.pop(k)) for k in kw.keys() ...
mit
Python
e37fe5195c0b7c62d1abbc0470550ea08445ba80
Fix reference error and add script for packing pypi package (#1172)
yangw1234/BigDL,intel-analytics/BigDL,intel-analytics/BigDL,intel-analytics/BigDL,yangw1234/BigDL,intel-analytics/BigDL,yangw1234/BigDL,yangw1234/BigDL
python/bigdl/dllib/utils/engine.py
python/bigdl/dllib/utils/engine.py
# # Copyright 2016 The BigDL Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
# # Copyright 2016 The BigDL Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
apache-2.0
Python
5bf2f696cd3ec96fd69a76b87a9d82454c421ee1
Fix division compatibility issue
kylejusticemagnuson/pyti
pyti/detrended_price_oscillator.py
pyti/detrended_price_oscillator.py
from __future__ import absolute_import import numpy as np from pyti import catch_errors from pyti.function_helper import fill_for_noncomputable_vals from six.moves import range def detrended_price_oscillator(data, period): """ Detrended Price Oscillator. Formula: DPO = DATA[i] - Avg(DATA[period/2 + 1...
from __future__ import absolute_import import numpy as np from pyti import catch_errors from pyti.function_helper import fill_for_noncomputable_vals from six.moves import range def detrended_price_oscillator(data, period): """ Detrended Price Oscillator. Formula: DPO = DATA[i] - Avg(DATA[period/2 + 1...
mit
Python
2f779d4d66cf71d46cfa59b379b1580bff5e59d8
Correct code explore params
JTCunning/sentry,BuildingLink/sentry,imankulov/sentry,TedaLIEz/sentry,ifduyue/sentry,gg7/sentry,zenefits/sentry,felixbuenemann/sentry,nicholasserra/sentry,1tush/sentry,wong2/sentry,Natim/sentry,wong2/sentry,songyi199111/sentry,Kryz/sentry,korealerts1/sentry,gg7/sentry,korealerts1/sentry,boneyao/sentry,songyi199111/sent...
src/sentry/web/frontend/explore_code.py
src/sentry/web/frontend/explore_code.py
""" sentry.web.frontend.explore_code ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from sentry.models import TagValue, Group from sentry.web.decorators import login_require...
""" sentry.web.frontend.explore_code ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from sentry.models import TagValue, Group from sentry.web.decorators import login_require...
bsd-3-clause
Python
4247fa7798d3de98a10e08189a93484a2bfe8eea
Fix requested changes
obsidianforensics/unfurl,obsidianforensics/unfurl
unfurl/parsers/parse_youtube.py
unfurl/parsers/parse_youtube.py
# Copyright 2020 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# Copyright 2020 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
Python
f6c511391025fe3a2541b07646b027fe57970d8a
use args
samphippen/python-minification
minify.py
minify.py
import inspect import sys #generates a skeleton class listing def generate_skeleton_class(class_name, class_type): class_dict = class_type.__dict__ class_text = "class " + class_name + ":\n" for key in class_dict: if key == "__init__" or not "__" in key: if type(class_dict[key]).__name...
import inspect #generates a skeleton class listing def generate_skeleton_class(class_name, class_type): class_dict = class_type.__dict__ class_text = "class " + class_name + ":\n" for key in class_dict: if key == "__init__" or not "__" in key: if type(class_dict[key]).__name__ != "func...
mit
Python
af3a1ed1b1114ab85b16a687e0ba29e787c0722b
Add route '/' with Hello World
byanofsky/bookmarks,byanofsky/bookmarks,byanofsky/bookmarks
bookmarks/bookmarks.py
bookmarks/bookmarks.py
from flask import Flask app = Flask(__name__) app.config.from_object(__name__) app.config.update(dict( SECRET_KEY='development key', USERNAME='admin', PASSWORD='default' )) @app.route('/', methods=['GET']) def front_page(): return 'Hello, World!'
from flask import Flask app = Flask(__name__) app.config.from_object(__name__) app.config.update(dict( SECRET_KEY='development key', USERNAME='admin', PASSWORD='default' ))
apache-2.0
Python
9b12b175c1ec17bae3f424ae9c5f386d1102ee79
Fix deleted building test failure
mapzen/vector-datasource,mapzen/vector-datasource,mapzen/vector-datasource
integration-test/842-normalize-building-kind.py
integration-test/842-normalize-building-kind.py
# https://www.openstreetmap.org/way/431358377 assert_has_feature( 16, 55897, 25449, 'buildings', { 'id': 431358377, 'kind': 'building', 'kind_detail': 'office' }) # http://www.openstreetmap.org/way/264768910 assert_has_feature( 16, 19298, 24633, 'buildings', { 'id': 264768910, 'kind': 'building', 'kind...
# https://www.openstreetmap.org/way/431358377 assert_has_feature( 16, 55897, 25449, 'buildings', { 'id': 431358377, 'kind': 'building', 'kind_detail': 'office' }) # http://www.openstreetmap.org/way/264768910 assert_has_feature( 16, 19298, 24633, 'buildings', { 'id': 264768910, 'kind': 'building', 'kind...
mit
Python
cd7145ebbb73d18b83df773907be0e7a413cff2d
Fix also allow_any
maruel/bin_pub,maruel/bin_pub,maruel/bin_pub
fix_inactive_policy.py
fix_inactive_policy.py
#!/usr/bin/env python # Copyright 2011 Marc-Antoine Ruel. All Rights Reserved. Use of this # source code is governed by a BSD-style license that can be found in the # LICENSE file. """Generates a diff to apply to /usr/share/polkit-1/actions to fix using gnome administrative applications from a NX (nomachine) session. ...
#!/usr/bin/env python # Copyright 2011 Marc-Antoine Ruel. All Rights Reserved. Use of this # source code is governed by a BSD-style license that can be found in the # LICENSE file. """Generates a diff to apply to /usr/share/polkit-1/actions to fix using gnome administrative applications from a NX (nomachine) session. ...
bsd-3-clause
Python
bea29e435849208753d6c7010a253a02682d9ab1
Make our merkle root extraction less error prone
c00w/bitHopper,c00w/bitHopper
bitHopper/util.py
bitHopper/util.py
""" Utility functions for bitHopper """ import json def validate_rpc(content): """ Validates that this is a valid rpc message for our purposes """ if type(content) != type({]): return False required = {'params':None, 'id':None, 'method':'getwork'} for key, value in required.items(): ...
""" Utility functions for bitHopper """ import json def validate_rpc(content): """ Validates that this is a valid rpc message for our purposes """ required = {'params':None, 'id':None, 'method':'getwork'} for key, value in required.items(): if key not in content: return False ...
mit
Python
60c2a6a72b5c13598061cc4ddc9f998f2aec6519
add interfaces to __init__.py in model
k2kobayashi/sprocket
sprocket/model/__init__.py
sprocket/model/__init__.py
from .GMM import GMMTrainer, GMMConvertor from .f0statistics import F0statistics from .gv import GV
mit
Python
d83b3749daa527b80ed41aa7d16eff72205ebf24
Bump version number
pfmoore/blist,DanielStutzbach/blist,DanielStutzbach/blist,pfmoore/blist
blist/__init__.py
blist/__init__.py
__version__ = '1.3.5' from blist._blist import * import collections if hasattr(collections, 'MutableSet'): # Only supported in Python 2.6+ from blist._sortedlist import sortedlist, sortedset, weaksortedlist, weaksortedset from blist._sorteddict import sorteddict from blist._btuple import btuple collecti...
__version__ = '1.3.4' from blist._blist import * import collections if hasattr(collections, 'MutableSet'): # Only supported in Python 2.6+ from blist._sortedlist import sortedlist, sortedset, weaksortedlist, weaksortedset from blist._sorteddict import sorteddict from blist._btuple import btuple collecti...
bsd-3-clause
Python
e80f93c98919a38e093336d35f4749746c1b92e0
return full url for links
kofrasa/flask-apputils
apputils/helpers.py
apputils/helpers.py
# -*- coding: utf-8 -*- from flask.globals import current_app as app from flask import g, url_for, get_flashed_messages from flaskext.htmlbuilder import html from jinja2.utils import Markup __all__ = [ 'static', 'get_flash', 'link_to', 'image_tag', 'style_tag', 'script_tag' ] def static(filen...
# -*- coding: utf-8 -*- from flask.globals import current_app as app from flask import g, url_for, get_flashed_messages from flaskext.htmlbuilder import html from jinja2.utils import Markup __all__ = [ 'static', 'get_flash', 'link_to', 'image_tag', 'style_tag', 'script_tag' ] def static(filen...
bsd-3-clause
Python
c7ef6ebcb7bd5c45f2180a31eea9f0b344724a06
Increase memcache ttl for all models
notapresent/rutracker_rss,notapresent/rutracker_rss,notapresent/rutracker_rss
models.py
models.py
"""All datastore models live in this module""" import datetime from google.appengine.ext import ndb class Torrent(ndb.Model): """A main model for representing an individual Torrent entry.""" title = ndb.StringProperty(indexed=False, required=True) btih = ndb.StringProperty(indexed=False, required=True) ...
"""All datastore models live in this module""" import datetime from google.appengine.ext import ndb class Torrent(ndb.Model): """A main model for representing an individual Torrent entry.""" title = ndb.StringProperty(indexed=False, required=True) btih = ndb.StringProperty(indexed=False, required=True) ...
apache-2.0
Python
ace46c39944c60457bd5c7fd64b1366846482587
fix typo
CIRCL/bgpranking-redis-api,CIRCL/bgpranking-redis-api,CIRCL/bgpranking-redis-api
example/export/day_ips/dump.py
example/export/day_ips/dump.py
#!/usr/bin/python # -*- coding: utf-8 -*- import redis import csv import argparse if __name__ == '__main__': parser = argparse.ArgumentParser(description='Dump on the disk the daily informations.') parser.add_argument('-f', '--full', action="store_true", default=False, help='Do a full dump (asn, b...
#!/usr/bin/python # -*- coding: utf-8 -*- import redis import csv import argparse if __name__ == '__main__': parser = argparse.ArgumentParser(description='Dump on the disk the daily informations.') parser.add_argument('-f', '--full', action="store_true", default=False, help='Do a full dump (asn, b...
bsd-2-clause
Python
fe4b10346a4e625ee3d286262b76f5a248e68a24
replace example sentence until I get around to adding a punctuation.py
explosion/spaCy,spacy-io/spaCy,aikramer2/spaCy,recognai/spaCy,explosion/spaCy,recognai/spaCy,aikramer2/spaCy,recognai/spaCy,spacy-io/spaCy,aikramer2/spaCy,explosion/spaCy,recognai/spaCy,explosion/spaCy,spacy-io/spaCy,explosion/spaCy,aikramer2/spaCy,honnibal/spaCy,aikramer2/spaCy,honnibal/spaCy,recognai/spaCy,honnibal/s...
spacy/tests/lang/ga/test_tokenizer.py
spacy/tests/lang/ga/test_tokenizer.py
# coding: utf8 from __future__ import unicode_literals import pytest GA_TOKEN_EXCEPTION_TESTS = [ ('Niall Ó Domhnaill, Rialtas na hÉireann 1977 (lch. 600).', ['Niall', 'O', 'Domhnaill', ',', 'Rialtas', 'na', 'hÉireann', '1977', '('. 'lch.', '600', ')', '.']), ('Daoine a bhfuil Gaeilge acu, m.sh. tusa agus mi...
# coding: utf8 from __future__ import unicode_literals import pytest GA_TOKEN_EXCEPTION_TESTS = [ ("B'fhearr fanacht as amharc", ["B'", "fhearr", "fanacht", "as", "amharc"]), ('Daoine a bhfuil Gaeilge acu, m.sh. tusa agus mise', ['Daoine', 'a', 'bhfuil', 'Gaeilge', 'acu', ',', 'm.sh.', 'tusa', 'agus', 'mise'...
mit
Python
08d00268a2e9980ef9b486d561c06585d252e601
Bump version
thombashi/sqlitebiter,thombashi/sqlitebiter
sqlitebiter/__version__.py
sqlitebiter/__version__.py
# encoding: utf-8 from datetime import datetime __author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__) __license__ = "MIT License" __version__ = "0.23.7" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
# encoding: utf-8 from datetime import datetime __author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__) __license__ = "MIT License" __version__ = "0.23.6" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
mit
Python
8e337b306f2dfe5f95a2343b0dd73508578599cc
comment in model. WHY DOCUMENT in model ?
heartstchr/monex,heartstchr/monex
blogapp/models.py
blogapp/models.py
from django.db import models # Create your models here. # from mongoengine import * from blongo.settings import DBNAME from django import forms connect(DBNAME) # Why Document? class Post(Document): title = StringField(max_length=120, required=True) content = StringField(max_length=500, required=True) l...
from django.db import models # Create your models here. # from mongoengine import * from blongo.settings import DBNAME from django import forms connect(DBNAME) class Post(Document): title = StringField(max_length=120, required=True) content = StringField(max_length=500, required=True) last_update = Date...
mit
Python
5051f49925e6d2a7281a7f46672d0c97c9c81e3b
Bump version to s31
prasannav7/ggrc-core,vladan-m/ggrc-core,NejcZupec/ggrc-core,selahssea/ggrc-core,plamut/ggrc-core,jmakov/ggrc-core,vladan-m/ggrc-core,hasanalom/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,josthkko/ggrc-core,VinnieJohns/ggrc-core,jmakov/ggrc-core,andrei-karalionak/ggrc-core,NejcZupec/ggrc-core,andrei-karalionak/gg...
src/ggrc/settings/default.py
src/ggrc/settings/default.py
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: dan@reciprocitylabs.com # Maintained By: dan@reciprocitylabs.com import os DEBUG = False TESTING = False # Flask-SQLAlchemy fix to be less than `...
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: dan@reciprocitylabs.com # Maintained By: dan@reciprocitylabs.com import os DEBUG = False TESTING = False # Flask-SQLAlchemy fix to be less than `...
apache-2.0
Python
b54292159c3af5239a150aede34fa07a4051d35f
Update __init__.py
keras-team/keras-cv,keras-team/keras-cv,keras-team/keras-cv
keras_cv/__init__.py
keras_cv/__init__.py
# Copyright 2022 The KerasCV Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
# Copyright 2022 The KerasCV Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
apache-2.0
Python
c4d14dd72ae0a5b80852ea1465c81a34751a07c7
test case for tutorial performance
rlpy/rlpy,silgon/rlpy,imanolarrieta/RL,BerkeleyAutomation/rlpy,silgon/rlpy,MDPvis/rlpy,imanolarrieta/RL,imanolarrieta/RL,BerkeleyAutomation/rlpy,rlpy/rlpy,MDPvis/rlpy,BerkeleyAutomation/rlpy,rlpy/rlpy,silgon/rlpy,MDPvis/rlpy
tests/test_cases.py
tests/test_cases.py
"""Nosetests for testing the use cases contained in the cases directory.""" import numpy as np from nose.tools import ok_, eq_ import glob from Tools.run import read_setting_content __copyright__ = "Copyright 2013, RLPy http://www.acl.mit.edu/RLPy" __credits__ = ["Alborz Geramifard", "Robert H. Klein", "Christoph Dan...
"""Nosetests for testing the use cases contained in the cases directory.""" import numpy as np from nose.tools import ok_, eq_ import glob from Tools.run import read_setting_content __copyright__ = "Copyright 2013, RLPy http://www.acl.mit.edu/RLPy" __credits__ = ["Alborz Geramifard", "Robert H. Klein", "Christoph Dan...
bsd-3-clause
Python
0fffb51d9ca0ec5b82e1f619cdbbceda68927b7e
fix test
syscoin/syscoin,syscoin/syscoin,syscoin/syscoin,syscoin/syscoin,syscoin/syscoin,syscoin/syscoin,syscoin/syscoin,syscoin/syscoin
test/functional/feature_asset_zdag.py
test/functional/feature_asset_zdag.py
#!/usr/bin/env python3 # Copyright (c) 2019-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import SyscoinTestFramework from test_framework.util import assert_equ...
#!/usr/bin/env python3 # Copyright (c) 2019-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import SyscoinTestFramework from test_framework.util import assert_equ...
mit
Python
643dd5baeaedb443c03e345208b0c07e8d07b6b0
Add edge case date tests for old style charts
guoguo12/billboard-charts,guoguo12/billboard-charts
tests/test_dates.py
tests/test_dates.py
import datetime import unittest import billboard from nose.tools import raises class DateTest(unittest.TestCase): def testDateRounding(self): """Checks that the Billboard website is rounding dates correctly: it should round up to the nearest date on which a chart was published. We used to...
import datetime import unittest import billboard from nose.tools import raises class DateTest(unittest.TestCase): def testDateRounding(self): """Checks that the Billboard website is rounding dates correctly: it should round up to the nearest date on which a chart was published. We used to...
mit
Python
ad554fd81b521dbcb2d958925237b8aea47df76a
Make ALLCHECKS vars tuples
jackstanek/BotBot,jackstanek/BotBot
botbot/schecks.py
botbot/schecks.py
"""Strict shared-folder permission checks""" import stat def file_groupreadable(path): """Check whether a given path has bad permissons.""" if not bool(stat.S_IRGRP & path.stat().mode): return 'PROB_FILE_NOT_GRPRD' def file_group_executable(path): """Check if a file should be group executable""" ...
"""Strict shared-folder permission checks""" import stat def file_groupreadable(path): """Check whether a given path has bad permissons.""" if not bool(stat.S_IRGRP & path.stat().mode): return 'PROB_FILE_NOT_GRPRD' def file_group_executable(path): """Check if a file should be group executable""" ...
mit
Python
ca5bdf759d969334cf140a3ed602b43ea84080ae
update click model
yosukesuzuki/url-shortner,yosukesuzuki/url-shortner,yosukesuzuki/url-shortner
models.py
models.py
import validators from google.appengine.api import datastore_errors from google.appengine.ext import ndb def domain_validator(prop, value): if validators.domain(value) is not True: raise datastore_errors.BadValueError(prop._name) return value.lower() class CustomDomain(ndb.Model): domain = ndb.S...
import validators from google.appengine.api import datastore_errors from google.appengine.ext import ndb def domain_validator(prop, value): if validators.domain(value) is not True: raise datastore_errors.BadValueError(prop._name) return value.lower() class CustomDomain(ndb.Model): domain = ndb.S...
bsd-2-clause
Python
81923331d94bbf6ab5315a6ec85e8009bf140e3c
Update channel fix.
morganbengtsson/microreader
models.py
models.py
import feedparser from peewee import * import lxml.html import xml.etree.ElementTree as ET from datetime import datetime from time import mktime db = SqliteDatabase('database.db') class BaseModel(Model): class Meta: database = db class Channel(BaseModel): title = TextField() updated = DateTimeField(default = da...
import feedparser from peewee import * import lxml.html import xml.etree.ElementTree as ET from datetime import datetime from time import mktime db = SqliteDatabase('database.db') class BaseModel(Model): class Meta: database = db class Channel(BaseModel): title = TextField() updated = DateTimeField(default = da...
mit
Python
86bc26946ce243490d8dbb466e2c7828e417e169
Update package dependency
stephenslab/dsc2,stephenslab/dsc2
src/setup.py
src/setup.py
#! /usr/bin/env python __author__ = "Gao Wang" __copyright__ = "Copyright 2016, Stephens lab" __email__ = "gaow@uchicago.edu" __license__ = "MIT" import sys _py_ver = sys.version_info if _py_ver.major == 2 or (_py_ver.major == 3 and (_py_ver.minor, _py_ver.micro) < (5, 0)): raise SystemError('Python 3.5 or higher i...
#! /usr/bin/env python __author__ = "Gao Wang" __copyright__ = "Copyright 2016, Stephens lab" __email__ = "gaow@uchicago.edu" __license__ = "MIT" from setuptools import setup from dsc import VERSION setup(name = "dsc", description = "Implementation of Dynamic Statistical Comparisons", author = ...
mit
Python
f8b70bf0e5997fcba0abb8ec4ce68075682fb49f
remove extraneous print
godber/pds3label
test/test_pds3label_simple_image_1.py
test/test_pds3label_simple_image_1.py
""" Tests for `pds3label` module. """ import pytest from pds3label import Pds3Label def test_based_integer(): f = 'test/data/simple_image_1.lbl' label = Pds3Label(f) assert label.infile == f assert label['RECORD_TYPE'] == 'FIXED_LENGTH' assert label['RECORD_BYTES'] == 824 assert label['LABEL_RE...
""" Tests for `pds3label` module. """ import pytest from pds3label import Pds3Label def test_based_integer(): f = 'test/data/simple_image_1.lbl' label = Pds3Label(f) assert label.infile == f print label assert label['RECORD_TYPE'] == 'FIXED_LENGTH' assert label['RECORD_BYTES'] == 824 assert...
mit
Python
2e48c756441678d17c72fc9b43d9d88329e21b5a
Update download URL
stub42/pytz,stub42/pytz,stub42/pytz,stub42/pytz
src/setup.py
src/setup.py
''' pytz setup script ''' import pytz, sys, os, os.path try: from setuptools import setup except ImportError: if sys.version_info[:2] == (2,3): print 'Python 2.3 install requires setuptools' print 'http://www.python.org/pypi/setuptools/' sys.exit(1) else: from distutils.cor...
''' pytz setup script ''' import pytz, sys, os, os.path try: from setuptools import setup except ImportError: if sys.version_info[:2] == (2,3): print 'Python 2.3 install requires setuptools' print 'http://www.python.org/pypi/setuptools/' sys.exit(1) else: from distutils.cor...
mit
Python
932a4ba682c07267f9ba28ebb7266f09e68fabf5
Add test declarations for test_init_new_round
ueg1990/pypoker
tests/test_table.py
tests/test_table.py
import unittest from pypoker import Table, Player, Game class TableTestCase(unittest.TestCase): ''' Tests for the Table class ''' def setUp(self): self.table = Table(50, 100, 2, 10, 100, 1000) def test_table_initialization(self): self.assertEqual([self.table.small_blind, self.table.b...
import unittest from pypoker import Table, Player, Game class TableTestCase(unittest.TestCase): ''' Tests for the Table class ''' def setUp(self): self.table = Table(50, 100, 2, 10, 100, 1000) def test_table_initialization(self): self.assertEqual([self.table.small_blind, self.table.b...
mit
Python
fdea8b1f076b18d6d3fc2ef09e9c444741a694f4
Remove unnecessary imports
Alweezy/cp2-bucketlist-api,Alweezy/cp2-bucketlist-api,Alweezy/cp2-bucketlist-api
manage.py
manage.py
import os from flask_script import Manager from flask_migrate import Migrate, MigrateCommand from app import db, create_app app = create_app(config_name=os.getenv('APP_SETTINGS')) migrate = Migrate(app, db) manager = Manager(app) manager.add_command('db', MigrateCommand) if __name__ == '__main__': manager.run(...
import os from flask_script import Manager from flask_migrate import Migrate, MigrateCommand from app import db, create_app from app import models app = create_app(config_name=os.getenv('APP_SETTINGS')) migrate = Migrate(app, db) manager = Manager(app) manager.add_command('db', MigrateCommand) if __name__ == '__ma...
mit
Python
ae10343f22b2ff94ee1dd7b9f6ee99bb15ae272e
change flask.ext. to flask_
matrixorz/firefly,halfcrazy/firefly,killpanda/firefly,python-cn/firefly,dongweiming/firefly,killpanda/firefly,Junnplus/firefly,halfcrazy/firefly,dongweiming/firefly,thcode/firefly,killpanda/firefly,ruitian/firefly,thcode/firefly,ruitian/firefly,thcode/firefly,Junnplus/firefly,thcode/firefly,matrixorz/firefly,Junnplus/f...
manage.py
manage.py
# coding=utf-8 from flask_script import Manager, Server from firefly import app manager = Manager(app) manager.add_command('runserver', Server( use_debugger=True, use_reloader=True, host='0.0.0.0') ) if __name__ == '__main__': manager.run()
# coding=utf-8 from flask.ext.script import Manager, Server from firefly import app manager = Manager(app) manager.add_command('runserver', Server( use_debugger=True, use_reloader=True, host='0.0.0.0') ) if __name__ == '__main__': manager.run()
mit
Python
a74a0c0f2066008586114fd5b0908f67c11c0334
Implement generic static file view
MarauderXtreme/sipa,agdsn/sipa,lukasjuhrich/sipa,agdsn/sipa,MarauderXtreme/sipa,lukasjuhrich/sipa,agdsn/sipa,agdsn/sipa,lukasjuhrich/sipa,lukasjuhrich/sipa,MarauderXtreme/sipa
sipa/blueprints/documents.py
sipa/blueprints/documents.py
# -*- coding: utf-8 -*- from flask import Blueprint, send_file, abort, send_from_directory, current_app from os.path import isfile, realpath, join from flask.views import View import os bp_documents = Blueprint('documents', __name__) class StaticFiles(View): def __init__(self, directory): self.directory...
# -*- coding: utf-8 -*- from flask import Blueprint, send_file, abort from os.path import isfile, realpath, join bp_documents = Blueprint('documents', __name__) @bp_documents.route('/images/<image>') def show_image(image): print("Trying to show image {}".format(image)) filename = realpath("content/images/{}...
mit
Python
c36a87300a83b8adbcf3d4f08b35dd84d515500f
Update __init__.py
rouxcode/django-cms-plugins,rouxcode/django-cms-plugins,rouxcode/django-cms-plugins
cmsplugins/__init__.py
cmsplugins/__init__.py
__version__ = '0.3.17' __author__ = 'alaric'
__version__ = '0.3.16' __author__ = 'alaric'
mit
Python
1755659c242d80be32b4186c28e51193d4f20286
Implement run_on_server
SheepDogInc/ssheepdog,SheepDogInc/ssheepdog,SheepDogInc/ssheepdog
ssheepdog.py
ssheepdog.py
""" ssheepdog is a public ssh key management tool for teams of programmers. Different people need different privileges to different servers. Ssheepdog allows you to specify these relationships in a simple json file and then sync the keys to the appropriate servers. """ import json from datetime import datetime from fab...
""" ssheepdog is a public ssh key management tool for teams of programmers. Different people need different privileges to different servers. Ssheepdog allows you to specify these relationships in a simple json file and then sync the keys to the appropriate servers. """ import json from datetime import datetime from fab...
bsd-3-clause
Python
e34a36812575635bb0c2a4c53682e1fa34a00919
Fix apidoc build step on Windows.
dart-archive/dart-sdk,dart-lang/sdk,dart-lang/sdk,dartino/dart-sdk,dart-lang/sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-ar...
utils/apidoc/apidoc.gyp
utils/apidoc/apidoc.gyp
# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. { 'variables': { # These variables are used in the creation of the .vcproj file on # Windows. ...
# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. { 'targets': [ { 'target_name': 'api_docs', 'type': 'none', 'dependencies': [ ...
bsd-3-clause
Python
d9c5d688e0d65dee049a440d1c465bfeb42413d1
fix get_unread()
BearlyKoalafied/GGGGobbler
msgcfg.py
msgcfg.py
import praw import configparser import settings CFG_FILE = "remote_config.ini" CFG_RESPONSE_MAIL_HEADER = "Config confirmed" CFG_RESPONSE_MAIL_HEADER_FAIL = "Config failed!" def read_ini(): cfg = configparser.ConfigParser() cfg.read(CFG_FILE) return cfg def check_messages(r): unread = r.unread() ...
import praw import configparser import settings CFG_FILE = "remote_config.ini" CFG_RESPONSE_MAIL_HEADER = "Config confirmed" CFG_RESPONSE_MAIL_HEADER_FAIL = "Config failed!" def read_ini(): cfg = configparser.ConfigParser() cfg.read(CFG_FILE) return cfg def check_messages(r): unread = r.get_unread()...
mit
Python
a513d106b07500fa388bfcea88022f5cc4b27989
Make myrial options mutually exclusive
uwescience/raco,uwescience/raco,uwescience/raco,uwescience/raco,uwescience/raco
myrial.py
myrial.py
#!/usr/bin/env python """Compile a Myrial program into a physical plan.""" import raco.myrial.interpreter as interpreter import raco.myrial.parser as parser import raco.scheme from raco import algebra import argparse import os import sys def print_pretty_plan(plan, indent=0): if isinstance(plan, algebra.DoWhil...
#!/usr/bin/env python """Compile a Myrial program into a physical plan.""" import raco.myrial.interpreter as interpreter import raco.myrial.parser as parser import raco.scheme from raco import algebra import argparse import os import sys def print_pretty_plan(plan, indent=0): if isinstance(plan, algebra.DoWhil...
bsd-3-clause
Python
49ea1ddc95917cef060e250c7a2f28e902b980fc
Change app ID in d2b to test client app ID
miedzinski/steamodd,Lagg/steamodd
steam/d2b.py
steam/d2b.py
""" Module for reading DOTA 2 (beta) data using the Steam API Copyright (c) 2010, Anthony Garcia <lagg@lavabit.com> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all ...
""" Module for reading DOTA 2 (beta) data using the Steam API Copyright (c) 2010, Anthony Garcia <lagg@lavabit.com> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all ...
isc
Python
a1b95f6b7fa1f61226b5082c94faf160224bd543
Update referee.py
jtokaz/checkio-mission-currency-style,jtokaz/checkio-mission-compare-functions,oduvan/checkio-mission-currency-style,oduvan/checkio-mission-currency-style,jtokaz/checkio-mission-compare-functions,jtokaz/checkio-mission-currency-style,jtokaz/checkio-mission-compare-functions,oduvan/checkio-mission-currency-style,jtokaz/...
verification/referee.py
verification/referee.py
""" CheckiOReferee is a base referee for checking you code. arguments: tests -- the dict contains tests in the specific structure. You can find an example in tests.py. cover_code -- is a wrapper for the user function and additional operations before give data in the user func...
""" CheckiOReferee is a base referee for checking you code. arguments: tests -- the dict contains tests in the specific structure. You can find an example in tests.py. cover_code -- is a wrapper for the user function and additional operations before give data in the user func...
mit
Python
28623e65e03de6a02c731098ff6981ce4d08223c
test case placeholder
Proteogenomics/trackhub-creator,Proteogenomics/trackhub-creator
tests/test_ensembl_species_service.py
tests/test_ensembl_species_service.py
# # Author    : Manuel Bernal Llinares # Project   : trackhub-creator # Timestamp : 04-07-2017 09:14 # --- # © 2017 Manuel Bernal Llinares <mbdebian@gmail.com> # All rights reserved. # """ Unit Tests for Ensembl Species Service """ import unittest # App modules import main_app from ensembl.service import Service fr...
# # Author    : Manuel Bernal Llinares # Project   : trackhub-creator # Timestamp : 04-07-2017 09:14 # --- # © 2017 Manuel Bernal Llinares <mbdebian@gmail.com> # All rights reserved. # """ Unit Tests for Ensembl Species Service """ import unittest # App modules import main_app from ensembl.service import Service fr...
apache-2.0
Python
0afc59be11152e40ec083f9cb0a40e02731593f1
Update AndroidSpeechRecognition.py
MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab
service/AndroidSpeechRecognition.py
service/AndroidSpeechRecognition.py
######################################### # AndroidSpeechRecognition.py # more info @: http://myrobotlab.org/service/AndroidSpeechRecognition ######################################### # start the service androidspeechrecognition = Runtime.start("androidspeechrecognition","AndroidSpeechRecognition") # start mouth mary...
######################################### # AndroidSpeechRecognition.py # more info @: http://myrobotlab.org/service/AndroidSpeechRecognition ######################################### # start the service androidspeechrecognition = Runtime.start("androidspeechrecognition","AndroidSpeechRecognition") # start mouth mary...
apache-2.0
Python
c49c553f0c3ad3d650e9c0b001ccdb0175a0b176
Bump version to v0.4.0
nehresma/gocardless-python
gocardless/__init__.py
gocardless/__init__.py
"""The GoCardless Python Client Library This module provides a wrapper around the GoCardless payments API, the interface to the api is provided by the :py:class:`gocardless.Client` object. See the documentation for that class for how to obtain a reference. By default the library will attempt to use the GoCardless pr...
"""The GoCardless Python Client Library This module provides a wrapper around the GoCardless payments API, the interface to the api is provided by the :py:class:`gocardless.Client` object. See the documentation for that class for how to obtain a reference. By default the library will attempt to use the GoCardless pr...
mit
Python
5093963016c2abf06554c03a189acb3681989ee7
Change showPostsWithTags to return correct params
ollien/Timpani,ollien/Timpani,ollien/Timpani
timpani/webserver/controllers/user.py
timpani/webserver/controllers/user.py
import flask import os.path import datetime from ... import auth from ... import blog from ... import configmanager from ... import settings from .. import webhelpers TEMPLATE_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../templates")) blueprint = flask.Blueprint("user", __name__, template_f...
import flask import os.path import datetime from ... import auth from ... import blog from ... import configmanager from ... import settings from .. import webhelpers TEMPLATE_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../templates")) blueprint = flask.Blueprint("user", __name__, template_f...
mit
Python
725d5c01506db3346f86e1f023ac5e13bbf7da63
Allow to select attributes
CodersOfTheNight/verata
grazer/core/parsing.py
grazer/core/parsing.py
import re import logging from functools import wraps logger = logging.getLogger("Parsing") def create_node(data): tag_part = r"(?P<tag>\w+)" attr_part = r"(?P<q>\[(?P<attr>\w+)=(\"|\')(?P<val>.+?)(\"|\')\])?" selector_part = r"(\{(?P<selector>\d+)\})?" attr_selector_part = r"(?P<as>\.(\w|[_])+)?" ...
import re import logging from functools import wraps logger = logging.getLogger("Parsing") def create_node(data): tag_part = r"(?P<tag>\w+)" attr_part = r"(?P<q>\[(?P<attr>\w+)=(\"|\')(?P<val>.+?)(\"|\')\])?" selector_part = r"(\{(?P<selector>\d+)\})?" p = tag_part + attr_part + selector_part pa...
mit
Python
e1fd7f3f35833e51760279b465334536de8a5bbd
Reduce noise - strip whitespace from etext lines
hugovk/Gutenberg,c-w/Gutenberg
gutenberg/beautify.py
gutenberg/beautify.py
# -*- coding: utf-8 -*- from terminators import HEADERS, FOOTERS import logging def get_metadata(lines, key, sep=':'): value = None for line in lines: if line.startswith(key + sep): value = line.split(sep)[1].strip() break if value is None: logging.warning('no %s fo...
# -*- coding: utf-8 -*- from terminators import HEADERS, FOOTERS import logging def get_metadata(lines, key, sep=':'): value = None for line in lines: if line.startswith(key + sep): value = line.split(sep)[1].strip() break if value is None: logging.warning('no %s fo...
apache-2.0
Python
5183861150da8cd119edda6b77595baa33fd5df6
Fix py2 unicode support for DOIs submitted to CN
sckott/habanero
habanero/cnrequest.py
habanero/cnrequest.py
import requests import json from .habanero_utils import switch_classes,make_ua from .cn_formats import * def CNRequest(url, ids = None, format = None, style = None, locale = None, **kwargs): should_split = False try: # Python 2 if isinstance(ids, (str, unicode)): should_split = True excep...
import requests import json from .habanero_utils import switch_classes,make_ua from .cn_formats import * def CNRequest(url, ids = None, format = None, style = None, locale = None, **kwargs): if(ids.__class__.__name__ == "str"): ids = ids.split() if(ids.__class__.__name__ == "int"): ids = [ids] ...
mit
Python
0d0b6b3ae90716dc109d214587289f168ac9a0df
Fix isort issues
KristianOellegaard/django-health-check,KristianOellegaard/django-health-check
health_check/views.py
health_check/views.py
import copy from concurrent.futures import ThreadPoolExecutor from django.http import JsonResponse from django.views.decorators.cache import never_cache from django.views.generic import TemplateView from health_check.plugins import plugin_dir class MainView(TemplateView): template_name = 'health_check/index.htm...
import copy from concurrent.futures import ThreadPoolExecutor from django.http import JsonResponse from django.views.decorators.cache import never_cache from django.views.generic import TemplateView from health_check.plugins import plugin_dir class MainView(TemplateView): template_name = 'health_check/index.ht...
mit
Python
ca38778054d47ae4afafbdd49fe54f462ff8dad8
Fix #180 -- Limit threads to number of active plugins (#181)
KristianOellegaard/django-health-check,KristianOellegaard/django-health-check
health_check/views.py
health_check/views.py
import copy from concurrent.futures import ThreadPoolExecutor from django.http import JsonResponse from django.views.decorators.cache import never_cache from django.views.generic import TemplateView from health_check.plugins import plugin_dir class MainView(TemplateView): template_name = 'health_check/index.htm...
import copy from concurrent.futures import ThreadPoolExecutor from django.http import JsonResponse from django.views.decorators.cache import never_cache from django.views.generic import TemplateView from health_check.plugins import plugin_dir class MainView(TemplateView): template_name = 'health_check/index.htm...
mit
Python
3a0c5e25b596bdb442b881ad541ec192e65047ff
Fix message type handling
mspanc/shippable-slack-notifier
notify.py
notify.py
import httplib, json, argparse, sys, os, subprocess def get_data_from_git(format_string, commit): return subprocess.check_output(['git', 'log', '-1', '--format=format:%s' % format_string, commit]) def get_author(commit): return get_data_from_git('%an <%ae>', commit) def get_date(commit): return get_data_from_g...
import httplib, json, argparse, sys, os, subprocess def get_data_from_git(format_string, commit): return subprocess.check_output(['git', 'log', '-1', '--format=format:%s' % format_string, commit]) def get_author(commit): return get_data_from_git('%an <%ae>', commit) def get_date(commit): return get_data_from_g...
mit
Python
3c31fe7df46a2dd0070384d2994d0fcdf56256b5
Update WiPy example
vshymanskyy/blynk-library-python
examples/hardware/PyCom_WiPy_1.0.py
examples/hardware/PyCom_WiPy_1.0.py
""" Blynk is a platform with iOS and Android apps to control Arduino, Raspberry Pi and the likes over the Internet. You can easily build graphic interfaces for all your projects by simply dragging and dropping widgets. Downloads, docs, tutorials: http://www.blynk.cc Sketch generator: http://examples.blyn...
""" Blynk is a platform with iOS and Android apps to control Arduino, Raspberry Pi and the likes over the Internet. You can easily build graphic interfaces for all your projects by simply dragging and dropping widgets. Downloads, docs, tutorials: http://www.blynk.cc Sketch generator: http://examples.blyn...
mit
Python
781d83a1016cd0cf765af4a90ae6a2a11017e923
save customer properties
lmzintgraf/MultiMAuS
experiments/result_handling.py
experiments/result_handling.py
from os.path import isdir, join, dirname, exists from os import mkdir import pickle import numpy as np FOLDER_RESULTS = join(dirname(__file__), 'results') FILE_RESULTS_IDX = join(FOLDER_RESULTS, 'curr_idx.txt') def get_result_idx(): for line in open(FILE_RESULTS_IDX): if line.strip(): # line contains e...
from os.path import isdir, join, dirname, exists from os import mkdir import pickle FOLDER_RESULTS = join(dirname(__file__), 'results') FILE_RESULTS_IDX = join(FOLDER_RESULTS, 'curr_idx.txt') def get_result_idx(): for line in open(FILE_RESULTS_IDX): if line.strip(): # line contains eol character(s) ...
mit
Python
20bfee483bfc1aa7dd5384e93439db0b45caec1b
bump version number
bashu/fluentcms-publishing,bashu/fluentcms-publishing,bashu/fluentcms-publishing
fluentcms_publishing/__init__.py
fluentcms_publishing/__init__.py
__version__ = "1.2.5" default_app_config = '%s.apps.AppConfig' % __name__
__version__ = "1.2.4" default_app_config = '%s.apps.AppConfig' % __name__
mit
Python
d0677920f04a4692ba8e47f269cd1689c38dda72
add climatology to the JSON output
akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem
htdocs/iemre/daily.py
htdocs/iemre/daily.py
#!/mesonet/python/bin/python import sys sys.path.insert(0, "../../scripts/iemre/") import os import cgi import constants import netCDF3 import mx.DateTime import simplejson form = cgi.FormContent() ts = mx.DateTime.strptime( form["date"][0], "%Y-%m-%d") lat = float( form["lat"][0] ) lon = float( form["lon"][0] ) form...
#!/mesonet/python/bin/python import sys sys.path.insert(0, "../../scripts/iemre/") import os import cgi import constants import netCDF3 import mx.DateTime import simplejson form = cgi.FormContent() ts = mx.DateTime.strptime( form["date"][0], "%Y-%m-%d") lat = float( form["lat"][0] ) lon = float( form["lon"][0] ) form...
mit
Python
6e5a8953eeccf7b66b79a6ca030b7da5a62e10cf
Fix unofficial using env var for config path
egnyte/gitlabform,egnyte/gitlabform
gitlabform/configuration/core.py
gitlabform/configuration/core.py
import os import logging import yaml from pathlib import Path class ConfigurationCore: config_from_file = None def __init__(self, config_path): try: # using this env var should be considered unofficial, we need this temporarily for backwards compatibility. # support for it ma...
import os import logging import yaml from pathlib import Path class ConfigurationCore: config_from_file = None def __init__(self, config_path=None): try: # using this env var should be considered unofficial, we need this temporarily for backwards compatibility. # support for ...
mit
Python
34535d771378f2f146e51ce82470daff2b1d2652
Fix not working setup
paulkramme/clitimer
clitimer.py
clitimer.py
#!/usr/bin/env python3.5 import time import sys silent = None timeinput = 0 einheit = '' def help(): print("Usage: " + sys.argv[0] + "time einheit [args]") print("--silent or -s for silent mode") print("--help or -h for help") print("Happy timing...") def timer(): global timeinput print("You...
#!/usr/bin/env python3.5 import time import sys silent = None timeinput = 0 einheit = "" def help(): print("Usage: " + sys.argv[0] + "time einheit [args]") print("--silent or -s for silent mode") print("--help or -h for help") print("Happy timing...") def timer(): print(timeinput) time.slee...
mit
Python
dd4f4dbb703aa508d2f35ac2b00b4aa50c534250
Add an utility function to grab password from keyboard or keyring.
jubalfh/cog,jubalfh/cog
cog/util.py
cog/util.py
# -*- coding: utf-8 -*- # Copyright (c) 2013, Activision Publishing, Inc. # the cog project is free software under 3-clause BSD licence # see the LICENCE file in the project root for copying terms # miscellaneous utility functions, mostly borrowed import os import sys import pwd import string import re import rando...
# -*- coding: utf-8 -*- # Copyright (c) 2013, Activision Publishing, Inc. # the cog project is free software under 3-clause BSD licence # see the LICENCE file in the project root for copying terms # miscellaneous utility functions, mostly borrowed import os import sys import pwd import string import re import rando...
bsd-3-clause
Python
813c06cb162a987cf6d947d8ed0d2433997dad0c
Improve no slack token failure message
datawire/quark,datawire/quark,datawire/quark,datawire/quark,datawire/quark,datawire/quark
examples/slack/gen-test/execute.py
examples/slack/gen-test/execute.py
# Test slack example lightly import os # Verify a slack token exists slack_token = None token_file = os.path.join(session.cwd, ".slack.token") try: slack_token = open(token_file).read() except IOError: pass if not slack_token: slack_token = os.environ.get("SLACK_TOKEN") if slack_token: with op...
# Test slack example lightly import os # Verify a slack token exists slack_token = None token_file = os.path.join(session.cwd, ".slack.token") try: slack_token = open(token_file).read() except IOError: pass if not slack_token: slack_token = os.environ.get("SLACK_TOKEN") if slack_token: with op...
apache-2.0
Python
fe9998821f2fdab428c6c86c246d4f69df03caae
add table names
bmwachajr/bucketlist
application/models.py
application/models.py
from flask_sqlalchemy import SQLAlchemy from application import app db = SQLAlchemy(app) class User(db.Model): """ Creates users on the system """ __tablename__ = "users" id = db.Column(db.Interger, primary_key=True) username = db.Column(db.String(80), unique=True) email = db.Column(db.String(1...
from flask_sqlalchemy import SQLAlchemy from application import app db = SQLAlchemy(app) class User(db.Model): """ Creates users on the system """ __tablename__ = "users" id = db.Column(db.Interger, primary_key=True) username = db.Column(db.String(80), unique=True) email = db.Column(db.String(1...
mit
Python