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 |
|---|---|---|---|---|---|---|---|---|
d8022125bf02affc2e8a015c9639f896c2de2d77 | Add new version | dangoldin/python-tools | clean_kindle_quote.py | clean_kindle_quote.py | import sys
replacement_map = {
' "' : '"',
' .' : '.',
' ,' : ',',
' - ': '-',
' : ': ':',
' ? ': '?',
}
for line in sys.stdin:
for k, v in replacement_map.iteritems():
line = line.replace(k, v)
print(line)
| import sys
print "\n".join(line.replace(' "','"').replace(' .','.').replace(' ,',',').replace(' - ','-') for line in sys.stdin)
| mit | Python |
21ae00b1d268611d4090dd44888e6b1d0c92bc95 | Fix #61 - Disable buffering in redirectOutputAndCallFun function, also switch to 'wb' mode. | MozillaSecurity/funfuzz,nth10sd/funfuzz,MozillaSecurity/funfuzz,nth10sd/funfuzz,MozillaSecurity/funfuzz,nth10sd/funfuzz | util/forkJoin.py | util/forkJoin.py | #!/usr/bin/env python
import multiprocessing
import os
import sys
# Call |fun| in a bunch of separate processes, then wait for them all to finish.
# fun is called with someArgs, plus an additional argument with a numeric ID.
# |fun| must be a top-level function (not a closure) so it can be pickled on Windows.
def fo... | #!/usr/bin/env python
import multiprocessing
import os
import sys
# Call |fun| in a bunch of separate processes, then wait for them all to finish.
# fun is called with someArgs, plus an additional argument with a numeric ID.
# |fun| must be a top-level function (not a closure) so it can be pickled on Windows.
def fo... | mpl-2.0 | Python |
4c8052389b6024256614c133bb3f68c84243c378 | Add station-sensor link filtering by data type. | qubs/data-centre,qubs/data-centre,qubs/climate-data-api,qubs/climate-data-api | climate_data/admin.py | climate_data/admin.py | # Copyright 2016 the Queen's University Biological Station
# 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 la... | # Copyright 2016 the Queen's University Biological Station
# 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 la... | apache-2.0 | Python |
94a5d6335ff5bccb69abbb4841f53eda5c0047eb | Update join-contracts tool | hackaugusto/raiden,hackaugusto/raiden | tools/join-contracts.py | tools/join-contracts.py | #!/usr/bin/env python
import json
import os
import click
import re
import sys
from click.types import File
IMPORT_RE = re.compile(r'^import +["\'](?P<contract>[^"\']+.sol)["\'];$')
"""
Utility to join solidity contracts into a single output file by recursively
resolving imports.
example usage:
$ cd raiden/smart_c... | #!/usr/bin/env python
import os
import click
import re
import sys
from click.types import File
IMPORT_RE = re.compile(r'^import +["\'](?P<contract>[^"\']+.sol)["\'];$')
"""
Utility to join solidity contracts into a single output file by recursively
resolving imports.
example usage:
$ cd raiden/smart_contracts
$ ... | mit | Python |
e74aff75148f211825f6d00138e537541fe20497 | Fix modules sorting | refnode/django-material,afifnz/django-material,pombredanne/django-material,koopauy/django-material,MonsterKiller/django-material,lukasgarcya/django-material,lukasgarcya/django-material,thiagoramos-luizalabs/django-material,Axelio/django-material,barseghyanartur/django-material,refnode/django-material,koopauy/django-mat... | material/frontend/registry.py | material/frontend/registry.py | class Registry(object):
def __init__(self):
self._registry = {}
def modules(self):
return sorted([module for module in self._registry.values()],
key=lambda module: (module.order, module.slug))
def installed_modules(self):
return [module for module in self.modu... | class Registry(object):
def __init__(self):
self._registry = {}
def modules(self):
return sorted([module for module in self._registry.values()],
key=lambda module: module.order)
def installed_modules(self):
return [module for module in self.modules()
... | bsd-3-clause | Python |
ea64c0c865048cee8c0c778d1e81c5a38a24b6ab | Check if the bot has a nickname already | Didero/DideRobot | IrcMessage.py | IrcMessage.py | import time
class IrcMessage(object):
"""Parses incoming messages into usable parts like the command trigger"""
def __init__(self, messageType, bot, user=None, source=None, rawText=""):
self.createdAt = time.time()
#MessageType is what kind of message it is. A 'say', 'action' or 'quit', for instance
self.mess... | import time
class IrcMessage(object):
"""Parses incoming messages into usable parts like the command trigger"""
def __init__(self, messageType, bot, user=None, source=None, rawText=""):
self.createdAt = time.time()
#MessageType is what kind of message it is. A 'say', 'action' or 'quit', for instance
self.mess... | mit | Python |
974db26e49b7d03fc90fa7ec5cb49bf1053ee736 | Fix incorrect visualization of MapR versions | tellesnobrega/sahara,openstack/sahara,tellesnobrega/sahara,egafford/sahara,openstack/sahara,egafford/sahara | sahara/plugins/mapr/versions/version_handler_factory.py | sahara/plugins/mapr/versions/version_handler_factory.py | # Copyright (c) 2015, MapR Technologies
#
# 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... | # Copyright (c) 2015, MapR Technologies
#
# 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... | apache-2.0 | Python |
cb620f90064d45978dcd696daf4b50091cf5c6f5 | add a regression test case that file path w/o dir prefix passed to anyconfig.backend.base.ensure_outdir_exists | pmquang/python-anyconfig,ssato/python-anyconfig,ssato/python-anyconfig,pmquang/python-anyconfig | anyconfig/backend/tests/base.py | anyconfig/backend/tests/base.py | #
# Copyright (C) 2012 - 2015 Satoru SATOH <ssato @ redhat.com>
# License: MIT
#
# pylint: disable=missing-docstring, protected-access, invalid-name
import os
import os.path
import unittest
import anyconfig.backend.base as TT # stands for test target
import anyconfig.mergeabledict
import anyconfig.tests.common
clas... | #
# Copyright (C) 2012 - 2015 Satoru SATOH <ssato @ redhat.com>
# License: MIT
#
# pylint: disable=missing-docstring, protected-access
import os
import os.path
import unittest
import anyconfig.backend.base as TT # stands for test target
import anyconfig.mergeabledict
import anyconfig.tests.common
class Test00(unitt... | mit | Python |
30dbf7ab08a8fa9f4af38f40b99d528a59e38e52 | enable context aware commits (#112) | googleapis/google-cloud-java,googleapis/google-cloud-java,googleapis/google-cloud-java | java-datalabeling/synth.py | java-datalabeling/synth.py | # Copyright 2018 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | # Copyright 2018 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 | Python |
86989ac7b6932020792d5f452660045ffc996cb3 | Refactor operator_hours instance | ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend | cla_backend/apps/legalaid/utils/sla.py | cla_backend/apps/legalaid/utils/sla.py | # -*- coding: utf-8 -*-
from datetime import timedelta
from django.utils import timezone
from django.conf import settings
from cla_common.call_centre_availability import SLOT_INTERVAL_MINS, OpeningHours, \
available_days, on_sunday, on_bank_holiday
operator_hours = OpeningHours(**settings.OPERATOR_HOURS)
def i... | # -*- coding: utf-8 -*-
from datetime import timedelta
from django.utils import timezone
from django.conf import settings
from cla_common.call_centre_availability import SLOT_INTERVAL_MINS, \
OpeningHours, available_days, time_slots, on_sunday, on_bank_holiday
def is_in_business_hours(dt):
if not dt.tzinfo:
... | mit | Python |
f204068cca037dfd0e7d55bc77b7f3cd211e8642 | Add back missing backslash | yourcelf/btb,yourcelf/btb,yourcelf/btb,yourcelf/btb,yourcelf/btb | scanblog/scanning/management/commands/fixuploadperms.py | scanblog/scanning/management/commands/fixuploadperms.py | import os
from django.core.management.base import BaseCommand
from django.conf import settings
class Command(BaseCommand):
args = ''
help = "Set all permissions in the uploads directory for deploy."
def handle(self, *args, **kwargs):
for dirname in (os.path.join(settings.MEDIA_ROOT, settings.UPLO... | import os
from django.core.management.base import BaseCommand
from django.conf import settings
class Command(BaseCommand):
args = ''
help = "Set all permissions in the uploads directory for deploy."
def handle(self, *args, **kwargs):
for dirname in (os.path.join(settings.MEDIA_ROOT, settings.UPLO... | agpl-3.0 | Python |
a96144e64e53cbc338cfc2a48c28d182ab9d1e36 | Make /signup render the landing page | sbuss/voteswap,sbuss/voteswap,sbuss/voteswap,sbuss/voteswap | voteswap/urls.py | voteswap/urls.py | """voteswap URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/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-ba... | """voteswap URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/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-ba... | mit | Python |
87182a9096dd996546bf6db345894b5ead003cb3 | fix initial add_fake_data call | who-emro/meerkat_abacus,meerkat-code/meerkat_abacus,meerkat-code/meerkat_abacus | meerkat_abacus/orchestrate.py | meerkat_abacus/orchestrate.py | from time import sleep
import celery
import logging
import pytz
from datetime import datetime, timedelta
import raven
from meerkat_abacus import tasks
from meerkat_abacus import celeryconfig
from meerkat_abacus import config
from meerkat_abacus import util
from meerkat_abacus import data_management
from meerkat_abacus... | from time import sleep
import celery
import logging
import pytz
from datetime import datetime, timedelta
import raven
from meerkat_abacus import tasks
from meerkat_abacus import celeryconfig
from meerkat_abacus import config
from meerkat_abacus import util
from meerkat_abacus import data_management
from meerkat_abacus... | mit | Python |
b8fe7dfada5acdf47e696a7781f61b3d114c5385 | change filter to everything not completed, skipped, or denied | CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend | api/v2/views/machine_request.py | api/v2/views/machine_request.py | from core.models import MachineRequest
from core.email import send_denied_resource_email
from web.emails import resource_request_email
from django.db.models import Q
from api.v2.serializers.details import MachineRequestSerializer,\
UserMachineRequestSerializer
from api.v2.views.base import BaseRequestViewSet
cl... | from core.models import MachineRequest
from core.email import send_denied_resource_email
from web.emails import resource_request_email
from django.db.models import Q
from api.v2.serializers.details import MachineRequestSerializer,\
UserMachineRequestSerializer
from api.v2.views.base import BaseRequestViewSet
cl... | apache-2.0 | Python |
0e19c91b1d29d83ffea841a62def08cff4452f9d | Fix mypy errors | OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft | packages/grid/backend/alembic/versions/2021-09-06_bb642928e749.py | packages/grid/backend/alembic/versions/2021-09-06_bb642928e749.py | """empty message
Revision ID: bb642928e749
Revises: cd246fe6ff78
Create Date: 2021-09-06 21:01:14.987905
"""
# third party
from alembic import op # type: ignore
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "bb642928e749"
down_revision = "cd246fe6ff78"
branch_labels = None
depends_on =... | """empty message
Revision ID: bb642928e749
Revises: cd246fe6ff78
Create Date: 2021-09-06 21:01:14.987905
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "bb642928e749"
down_revision = "cd246fe6ff78"
branch_labels = None
depends_on = None
def upgrade() -> None... | apache-2.0 | Python |
3abeaab9e3e16607f428a007ccab0b79fdd9525c | Modify SERVER_EMAIL setting | kz26/uchicago-hvz,kz26/uchicago-hvz,kz26/uchicago-hvz | uchicagohvz/production_settings.py | uchicagohvz/production_settings.py | from local_settings import *
DEBUG = False
ALLOWED_HOSTS = ['uchicagohvz.org']
ADMINS = (
('Administrator', 'admin@uchicagohvz.org'),
)
SERVER_EMAIL = 'noreply@uchicagohvz.org'
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'pos... | from local_settings import *
DEBUG = False
ALLOWED_HOSTS = ['uchicagohvz.org']
ADMINS = (
('Administrator', 'admin@uchicagohvz.org'),
)
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.... | mit | Python |
f572a34291308cb8ab4120dfc98464a973ce5c14 | Fix test_query_old!!!!!!!!!!!!!!!!! | anushbmx/kitsune,NewPresident1/kitsune,MikkCZ/kitsune,philipp-sumo/kitsune,MikkCZ/kitsune,turtleloveshoes/kitsune,rlr/kitsune,chirilo/kitsune,safwanrahman/kitsune,H1ghT0p/kitsune,H1ghT0p/kitsune,anushbmx/kitsune,iDTLabssl/kitsune,safwanrahman/kitsune,philipp-sumo/kitsune,rlr/kitsune,MziRintu/kitsune,rlr/kitsune,iDTLabs... | apps/users/tests/test_api.py | apps/users/tests/test_api.py | import json
from nose import SkipTest
from nose.tools import eq_
from sumo.helpers import urlparams
from sumo.tests import TestCase
from sumo.urlresolvers import reverse
from users.tests import user
class UsernamesTests(TestCase):
"""Test the usernames API method."""
fixtures = ['users.json']
url = rev... | import json
from nose import SkipTest
from nose.tools import eq_
from sumo.helpers import urlparams
from sumo.tests import TestCase
from sumo.urlresolvers import reverse
from users.tests import user
class UsernamesTests(TestCase):
"""Test the usernames API method."""
fixtures = ['users.json']
url = rev... | bsd-3-clause | Python |
3234d929d22d7504d89753ce6351d0efe1bfa8ac | Add Execption for invalid Integer | yasn77/whitepy | whitepy/lexer.py | whitepy/lexer.py | from .lexerconstants import *
from .ws_token import Tokeniser
class IntError(ValueError):
'''Exception when invalid integer is found'''
class Lexer(object):
def __init__(self, line):
self.line = line
self.pos = 0
self.tokens = []
def _get_int(self):
token = Tokeniser()
... | from .lexerconstants import *
from .ws_token import Tokeniser
class Lexer(object):
def __init__(self, line):
self.line = line
self.pos = 0
self.tokens = []
def _get_int(self):
token = Tokeniser()
if self.line[-1] == '\n':
const = 'INT'
token.sca... | apache-2.0 | Python |
f17bcf7fb2cc73585cac02016317fdd651089615 | print added9 | krishnanmuthaiahpillai/jkconnect_monitor | jkconnect_monitor/jk_db.py | jkconnect_monitor/jk_db.py | import json
def parse_data(data_dump):
#print data_dump
parsed_input = json.loads(data_dump)
print parsed_input
if __name__ == '__main__':
# test1.py executed as script
# do something
parse_data(data_dump)
| import json
def parse_data(data_dump):
#print data_dump
#parsed_input = json.loads(data_dump)
print parsed_input
if __name__ == '__main__':
# test1.py executed as script
# do something
parse_data(data_dump)
| mit | Python |
5fdc072fa826c3fac5e24b6d585dd0cb305144e4 | Update DeleteNetworkAcl | jhajek/euca2ools,vasiliykochergin/euca2ools,gholms/euca2ools,vasiliykochergin/euca2ools,gholms/euca2ools,nagyistoce/euca2ools,nagyistoce/euca2ools,jhajek/euca2ools | euca2ools/commands/ec2/deletenetworkacl.py | euca2ools/commands/ec2/deletenetworkacl.py | # Copyright 2013-2014 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of conditions ... | # Copyright 2009-2013 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of conditions ... | bsd-2-clause | Python |
066ed38164a2e09eb3334e869bfa4dff43533cc4 | Corrige un import oublié. | dezede/dezede,dezede/dezede,dezede/dezede,dezede/dezede | common/utils/cache.py | common/utils/cache.py | # coding: utf-8
from __future__ import unicode_literals
from django.core.cache import cache
def get_user_lock_cache_key(user):
return 'dossiers__export_en_cours__%s' % user.username
def is_user_locked(user):
return cache.get(get_user_lock_cache_key(user), False)
def lock_user(user):
cache.set(get_use... | # coding: utf-8
from django.core.cache import cache
def get_user_lock_cache_key(user):
return 'dossiers__export_en_cours__%s' % user.username
def is_user_locked(user):
return cache.get(get_user_lock_cache_key(user), False)
def lock_user(user):
cache.set(get_user_lock_cache_key(user), True)
def unlo... | bsd-3-clause | Python |
9847922a9dc24d00136851f6da2a0317f8463e88 | Add compatibility with IPython | tylermenezes/PyJobTools | PyJobTools.py | PyJobTools.py | import traceback
import datetime
import sys
from os import path
class _rlog:
def __init__(self):
self.log_stream = None
def open(self, file):
self.log_stream = open(file, 'a')
try:
mainname = sys.modules['__main__'].__file__
except:
mainname = "(undefin... | import traceback
import datetime
import sys
from os import path
class _rlog:
def __init__(self):
self.log_stream = None
def open(self, file):
self.log_stream = open(file, 'a')
try:
mainname = sys.modules['__main__'].__file__
except:
mainname = "(undefin... | artistic-2.0 | Python |
57201f9489775c7adf1758ea7d98a2fa07b96aaf | fix bad import | Agi-dev/pylaas_core | tests/fixtures/data_sets/service/dummy_adapter/dummy_adapter.py | tests/fixtures/data_sets/service/dummy_adapter/dummy_adapter.py | from pylaas_core.abstract.abstract_service import AbstractService
class DummyAdapter(AbstractService):
pass
| from abstract.abstract_service import AbstractService
class DummyAdapter(AbstractService):
pass
| mit | Python |
be82b0516ab702e861e3cf88e7ccc0fcf2d45db9 | test checking config links | ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo | addons/base_setup/tests/test_res_config_doc_links.py | addons/base_setup/tests/test_res_config_doc_links.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import HttpCase, tagged
import re
@tagged('-standard', 'external', 'post_install', '-at_install') # nightly is not a real tag
class TestResConfigDocLinks(HttpCase):
"""
Parse the 'res_con... | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import HttpCase, tagged
import re
@tagged('nightly', 'post_install', '-at_install')
class TestResConfigDocLinks(HttpCase):
"""
Parse the 'res_config' view to extract all documentation lin... | agpl-3.0 | Python |
215986bce5e2c0913405cd23a058835358b8cca1 | Apply suggestions from code review | github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql | python/ql/test/experimental/dataflow/variable-capture/nonlocal.py | python/ql/test/experimental/dataflow/variable-capture/nonlocal.py | # Here we test writing to a captured variable via the `nonlocal` keyword (see `out`).
# We also test reading one captured variable and writing the value to another (see `through`).
# All functions starting with "test_" should run and execute `print("OK")` exactly once.
# This can be checked by running validTest.py.
i... | # Here we test writing to a captured variable via the `nonlocal` keyword (see `out`).
# We also test reading one captured variable and writing the value to another (see `through`).
# All functions starting with "test_" should run and execute `print("OK")` exactly once.
# This can be checked by running validTest.py.
i... | mit | Python |
4b0d97006b0044f726198e55d9fc0faab553701c | add test | simpsojo/emcaster,fish55/emcaster,simpsojo/emcaster,fish55/emcaster,fish55/emcaster,simpsojo/emcaster | EmcasterTest/SmokeTest.py | EmcasterTest/SmokeTest.py | import clr
clr.AddReference("Emcaster")
clr.AddReference("EmcasterTest")
clr.AddReference("nunit.framework")
from Emcaster.Sockets import *
from EmcasterTest import *
from System.Threading import *
from NUnit.Framework import *
Startup.Init();
receiveSocket = PgmSubscriber("224.0.0.23", 40001)
socke... | import clr
clr.AddReference("Emcaster")
clr.AddReference("EmcasterTest")
clr.AddReference("nunit.framework")
from Emcaster.Sockets import *
from EmcasterTest import *
from System.Threading import *
from NUnit.Framework import *
Startup.Init();
receiveSocket = PgmSubscriber("224.0.0.23", 40001)
socke... | bsd-3-clause | Python |
8638aca2fab33d931d2687b51c3e377fe22309f4 | modify code style for test function | changsiyao/mousestyles,berkeley-stat222/mousestyles,togawa28/mousestyles | mousestyles/tests/test_kde.py | mousestyles/tests/test_kde.py | import numpy as np
from scipy.stats.distributions import norm
from mousestyles.kde import kde
def test_kde():
pdf = kde(x=np.array([2, 3, 1, 0]), x_grid=np.linspace(0, 5, 10))
assert (type(pdf) == np.ndarray)
assert all([item >= 0 for item in pdf])
assert (len(pdf) == 10)
x1 = np.concatenate([norm... | # coding: utf-8
import numpy as np
from scipy.stats.distributions import norm
from mousestyles.kde import kde
def test_kde():
pdf = kde(x = np.array([2,3,1,0]), x_grid=np.linspace(0, 5, 10))
assert (type(pdf) == np.ndarray)
assert all([item >= 0 for item in pdf])
assert (len(pdf) == 10)
x1 = np.con... | bsd-2-clause | Python |
a37d2861e1a16002d170f24e0c94a1841afdb829 | Update version to 0.08 | sot/Ska.Numpy | Ska/Numpy/version.py | Ska/Numpy/version.py | version = '0.08'
_versplit = version.replace('dev', '').split('.')
major = int(_versplit[0])
minor = int(_versplit[1])
if len(_versplit) < 3:
bugfix = 0
else:
bugfix = int(_versplit[2])
del _versplit
release = not version.endswith('dev')
def _get_git_devstr():
"""Determines the number of revisions in th... | version = '0.07'
_versplit = version.replace('dev', '').split('.')
major = int(_versplit[0])
minor = int(_versplit[1])
if len(_versplit) < 3:
bugfix = 0
else:
bugfix = int(_versplit[2])
del _versplit
release = not version.endswith('dev')
def _get_git_devstr():
"""Determines the number of revisions in th... | bsd-3-clause | Python |
4ae584601aac45c3b6f1bdd2fe8bfe86852e3384 | simplify exception name to AccountingError | dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,gmimano/commcaretest,gmimano/commcaretest,gmimano/commcaretest,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,SEL-Columbia/... | corehq/apps/accounting/exceptions.py | corehq/apps/accounting/exceptions.py | class AccountingError(Exception):
pass
class LineItemError(Exception):
pass
class InvoiceError(Exception):
pass
class CreditLineError(Exception):
pass
| class HQAccountingSetupError(Exception):
pass
class LineItemError(Exception):
pass
class InvoiceError(Exception):
pass
class CreditLineError(Exception):
pass
| bsd-3-clause | Python |
f9ffa12c383f5addfa90b0790d74b784cf335cd4 | edit in download.py | AP-Elektronica-ICT/ServerManagement.bak,AP-Elektronica-ICT/ServerManagement | Software/download.py | Software/download.py | """
download.py: tool to eat CPU cycles
download.py is copyright 2015 Jeroen Doggen.
"""
import time
import urllib
import os
attempts = 0
limit = 1000
while attempts < limit:
""" Download a file in a loop -> causes a high server load"""
attempts += 1
try:
#urllib.urlretrieve("http://google.com/index.htm... | """
download.py: tool to eat CPU cycles
download.py is copyright 2015 Jeroen Doggen.
"""
import time
import urllib
attempts = 0
limit = 1000
while attempts < limit:
""" Download a file in a loop -> causes a high server load"""
attempts += 1
try:
#urllib.urlretrieve("http://google.com/index.html", filena... | mit | Python |
9353017af03100d71d5dde4022cb0f98e024d976 | Remove print statement | jrg365/gpytorch,jrg365/gpytorch,jrg365/gpytorch | gpytorch/random_variables/gaussian_random_variable.py | gpytorch/random_variables/gaussian_random_variable.py | from .random_variable import RandomVariable
from torch.autograd import Variable
from gpytorch.lazy import LazyVariable
class GaussianRandomVariable(RandomVariable):
def __init__(self, mean, covar):
"""
Constructs a multivariate Gaussian random variable, based on mean and covariance
Can be ... | from .random_variable import RandomVariable
from torch.autograd import Variable
from gpytorch.lazy import LazyVariable
class GaussianRandomVariable(RandomVariable):
def __init__(self, mean, covar):
"""
Constructs a multivariate Gaussian random variable, based on mean and covariance
Can be ... | mit | Python |
5c6f75a929cba5cff29cca98713253b728d59997 | remove forgotten non used and broken imports | dimddev/NetCatKS | NetCatKS/DProtocol/api/public/__init__.py | NetCatKS/DProtocol/api/public/__init__.py | __author__ = 'dimd'
from NetCatKS.DProtocol.api.implementors.subscribers import DProtocolSubscriber, DProtocolXMLSubscriber
from NetCatKS.DProtocol.api.public.dynamic import DynamicProtocol
from NetCatKS.DProtocol.api.public.storage import ProtocolStorage
from NetCatKS.DProtocol.api.public.actions import BaseProtocol... | __author__ = 'dimd'
from NetCatKS.DProtocol.api.implementors.subscribers import DProtocolSubscriber, DProtocolXMLSubscriber
from NetCatKS.DProtocol.api.implementors.tdo import DynamicTDO, IDynamicTDO
from NetCatKS.DProtocol.api.public.dynamic import DynamicProtocol
from NetCatKS.DProtocol.api.public.storage import Pr... | bsd-2-clause | Python |
1c13f19c3928e0b50cefa2cd6ae7b518f52dc977 | Bump version to 16.02 | PolyJIT/benchbuild,PolyJIT/benchbuild,PolyJIT/benchbuild,PolyJIT/benchbuild | benchbuild/projects/benchbuild/sevenz.py | benchbuild/projects/benchbuild/sevenz.py | from os import path
from benchbuild.utils.wrapping import wrap
from benchbuild.projects.benchbuild.group import BenchBuildGroup
from benchbuild.utils.compiler import lt_clang, lt_clang_cxx
from benchbuild.utils.downloader import Wget
from benchbuild.utils.run import run
from benchbuild.utils.cmd import make, tar, cp
f... | from os import path
from benchbuild.utils.wrapping import wrap
from benchbuild.projects.benchbuild.group import BenchBuildGroup
from benchbuild.utils.compiler import lt_clang, lt_clang_cxx
from benchbuild.utils.downloader import Wget
from benchbuild.utils.run import run
from benchbuild.utils.cmd import make, tar, cp
f... | mit | Python |
aff5242b7513cd6463b4f2a4bfd79c31fbdc27c5 | Add support for taskflow defined in package | Kitware/cumulus,Kitware/cumulus | cumulus/taskflow/utility/__init__.py | cumulus/taskflow/utility/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2016 Kitware 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 cop... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2016 Kitware 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 cop... | apache-2.0 | Python |
fd507caa83f7d107896c4dd860d8ae68eaab02a4 | Add some body tests | Benoss/django-elasticsearch-debug-toolbar,Benoss/django-elasticsearch-debug-toolbar,Benoss/django-elasticsearch-debug-toolbar | elastic_panel/test/test_toolbar.py | elastic_panel/test/test_toolbar.py | import unittest
from django.conf import settings
settings.configure()
from elastic_panel import panel
class ElasticQueryInfo:
def __init__(self, method, full_url, path, body, status_code, response, duration):
if not body:
body = b'' # Python 3 TypeError if None
self.method = method
... | import unittest
from django.conf import settings
settings.configure()
from elastic_panel import panel
class ImportTest(unittest.TestCase):
def test_something(self):
self.assertEqual(True, True)
if __name__ == '__main__':
unittest.main()
| mit | Python |
72ed2d20b9daf48f8c8307519927191285e38832 | Clean up economy code | shashwatak/tannenbaum | economy.py | economy.py | #!/usr/bin/python
from twitter import TwitterStream, OAuth
from credentials import CONSUMER_KEY, CONSUMER_SECRET
ACCESS_TOKEN = "68374651-On3ObzwpFDGLuctRa1uk5ekFXTlYz3oDwW4efJigq"
ACCESS_TOKEN_SECRET = "eQGJ3piUtvtPYrAiW7HrMxxg6oGYjdEB5lHR1tioN3E0C"
class Economy:
def run(self):
stream = TwitterStream(auth=O... | #!/usr/bin/python
from twitter import TwitterStream, OAuth
from credentials import CONSUMER_KEY, CONSUMER_SECRET
ACCESS_TOKEN = "68374651-On3ObzwpFDGLuctRa1uk5ekFXTlYz3oDwW4efJigq"
ACCESS_TOKEN_SECRET = "eQGJ3piUtvtPYrAiW7HrMxxg6oGYjdEB5lHR1tioN3E0C"
class Economy:
def run(self):
stream = TwitterStream(auth=O... | artistic-2.0 | Python |
8acba7d68c101d8c3d7bc8a3a20950a554456336 | Initialize kafka listening | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/change_feed/tests/utils.py | corehq/apps/change_feed/tests/utils.py | from __future__ import absolute_import
from __future__ import unicode_literals
import uuid
from django.conf import settings
from kafka import KafkaConsumer
from kafka.common import KafkaUnavailableError
from nose.tools import nottest
from corehq.util.test_utils import trap_extra_setup
@nottest
def get_test_kafka_cons... | from __future__ import absolute_import
from __future__ import unicode_literals
import uuid
from django.conf import settings
from kafka import KafkaConsumer
from kafka.common import KafkaUnavailableError
from nose.tools import nottest
from corehq.util.test_utils import trap_extra_setup
@nottest
def get_test_kafka_cons... | bsd-3-clause | Python |
86f4dd09157a31ba8356d6346ad5047183ee7e03 | use server_date to filter device log records | dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/ex-submodules/phonelog/tasks.py | corehq/ex-submodules/phonelog/tasks.py | from datetime import datetime, timedelta
from celery.schedules import crontab
from celery.task import periodic_task
from django.conf import settings
from phonelog.models import DeviceReportEntry
@periodic_task(run_every=crontab(minute=0, hour=0), queue=getattr(settings, 'CELERY_PERIODIC_QUEUE', 'celery'))
def purge_o... | from datetime import datetime, timedelta
from celery.schedules import crontab
from celery.task import periodic_task
from django.conf import settings
from phonelog.models import DeviceReportEntry
@periodic_task(run_every=crontab(minute=0, hour=0), queue=getattr(settings, 'CELERY_PERIODIC_QUEUE', 'celery'))
def purge_o... | bsd-3-clause | Python |
a9e3f210023a70e41e5d677c0f26172aec747188 | fix import tests (#23914) | LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack | var/spack/repos/builtin/packages/py-applicationinsights/package.py | var/spack/repos/builtin/packages/py-applicationinsights/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class PyApplicationinsights(PythonPackage):
"""This project extends the Application Insights API surface to support
... | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class PyApplicationinsights(PythonPackage):
"""This project extends the Application Insights API surface to support
... | lgpl-2.1 | Python |
75d41215c39ea6fdaf89d9552ed0e3d160dbcb5a | Fix future import | MTG/pycompmusic | compmusic/extractors/makam/scoreanalysis.py | compmusic/extractors/makam/scoreanalysis.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from tomato.symbolic.symbtranalyzer import SymbTrAnalyzer
import compmusic
from compmusic import dunya
from settings import token
dunya.set_token(token)
class ScoreAnalysis(compmusic.extractors.ExtractorModule):
_version = "0.1"
_sourcetype = "s... | # -*- coding: utf-8 -*-
__author__ = 'sertansenturk'
from __future__ import print_function
from tomato.symbolic.symbtranalyzer import SymbTrAnalyzer
import compmusic
from compmusic import dunya
from settings import token
dunya.set_token(token)
class ScoreAnalysis(compmusic.extractors.ExtractorModule):
_versio... | agpl-3.0 | Python |
90a0d3fb6c0de824fefde4303d184041f4fb6589 | fix import | googlefonts/gftools,googlefonts/gftools | Lib/gftools/fix.py | Lib/gftools/fix.py | """
Functions to fix fonts so they conform to the Google Fonts
specification
https://github.com/googlefonts/gf-docs/tree/master/Spec
"""
from fontTools.ttLib import TTFont, newTable
from fontTools.ttLib.tables import ttProgram
__all__ = ["add_dummy_dsig", "fix_unhinted_font", "fix_hinted_font"]
def add_dummy_dsig(t... | """
Functions to fix fonts so they conform to the Google Fonts
specification
https://github.com/googlefonts/gf-docs/tree/master/Spec
"""
from fontTools.ttLib import TTFont, newTable
from fontTools.ttLib.tables import ttProgram
__all__ = ["add_dummy_dsig", "fix_unhinted_font", "fix_hinted_font"]
def add_dummy_dsig(t... | apache-2.0 | Python |
50155021602d8796f35011f52a2eef72048973f0 | update to use new symtable interface | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Lib/test/test_symtable.py | Lib/test/test_symtable.py | from test_support import verify
import _symtable
symbols = _symtable.symtable("def f(x): return x", "?", "exec")
verify(symbols[0].name == "global")
verify(len([ste for ste in symbols.values() if ste.name == "f"]) == 1)
| from test_support import verify
import _symtable
symbols, scopes = _symtable.symtable("def f(x): return x", "?", "exec")
verify(symbols.has_key(0))
verify(scopes.has_key(0))
| mit | Python |
3efc95713085292e57f29e47b453f2f7503da112 | fix imports | liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin | apps/offlineevents/templatetags/offlineevent_tags.py | apps/offlineevents/templatetags/offlineevent_tags.py | from django import template
from adhocracy4.phases.models import Phase
from apps.offlineevents.models import OfflineEvent
register = template.Library()
@register.assignment_tag
def phases_and_offlineevents_sorted(project):
phases = list(project.phases)
events = list(OfflineEvent.objects.filter(project=proje... | from django import template
from adhocracy4.phases.models import Phase
from apps.offlineevents.models import OfflineEvent
register = template.Library()
@register.assignment_tag
def phases_and_offlineevents_sorted(project):
phases = list(project.phases)
events = list(OfflineEvent.objects.filter(project=pro... | agpl-3.0 | Python |
8843625801c0f49ca528a66763e22b29b98d33b7 | Update and add more cli options | musevlt/zap | zap2/__main__.py | zap2/__main__.py | # -*- coding: utf-8 -*-
import argparse
import logging
import sys
from .version import __version__, __description__
from .zap import process, CFTYPE_OPTIONS
def main():
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
description=__description__
)
... | # -*- coding: utf-8 -*-
import argparse
import logging
import sys
from .version import __version__, __description__
from .zap import process, CFTYPE_OPTIONS
def main():
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
description=__description__
)
... | mit | Python |
676207f838ee63036e01b6b4a96a5294117d27e9 | Replace deprecated arguments of RequestContext | openstack/zaqar,openstack/zaqar,openstack/zaqar,openstack/zaqar | zaqar/context.py | zaqar/context.py | # Copyright 2011 OpenStack Foundation
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | # Copyright 2011 OpenStack Foundation
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | apache-2.0 | Python |
2bfa1c88c0708d16fc93e4ae4ae96ab1eae9b691 | Add descriptive message to assertJsonContains and allow value to be []. | bueda/django-comrade | comrade/test/base.py | comrade/test/base.py | from django import test
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.core.cache import cache
from nose.tools import eq_, ok_
import json
import mockito
class BaseTest(test.TestCase):
fixtures = ['dev']
... | from django import test
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.core.cache import cache
from nose.tools import eq_, ok_
import json
import mockito
class BaseTest(test.TestCase):
fixtures = ['dev']
... | mit | Python |
6381bcb701f070e8f8c8d3c1be64b538f22c46d8 | fix bug related to internal edges in mesh merge faces | compas-dev/compas | src/compas/datastructures/mesh/core/operations/merge.py | src/compas/datastructures/mesh/core/operations/merge.py | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
__all__ = ['mesh_merge_faces']
def mesh_merge_faces(mesh, faces):
"""Merge two faces of a mesh over their shared edge.
Parameters
----------
mesh : :class:`compas.datastructures.Mesh`
fa... | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
__all__ = ['mesh_merge_faces']
def mesh_merge_faces(mesh, faces):
"""Merge two faces of a mesh over their shared edge.
Parameters
----------
mesh : :class:`compas.datastructures.Mesh`
fa... | mit | Python |
9bf8273ca6ff22513089c72e71844c4feacda961 | make JSONCharField available from jsonfield module directly | philippeowagner/django-jsonfield,rocketrip/django-jsonfield,natgeo/django-jsonfield,hanuprateek/django-jsonfield,bradjasper/django-jsonfield,Natgeoed/django-jsonfield,thenewguy/django-jsonfield,dmkoch/django-jsonfield,kazmiruk/django-jsonfield,SpazioDati/django-jsonfield,velfimov/django-jsonfield,anvil8/django-jsonfiel... | jsonfield/__init__.py | jsonfield/__init__.py | from fields import JSONField, JSONCharField | from fields import JSONField | mit | Python |
194ac08e6da0d1f2b8b25a47430dc3f4d530c768 | Make docstring correction | dls-controls/pymalcolm,dls-controls/pymalcolm,dls-controls/pymalcolm | malcolm/core/mapmeta.py | malcolm/core/mapmeta.py | from collections import OrderedDict
from loggable import Loggable
from malcolm.core.attributemeta import AttributeMeta
class MapMeta(Loggable):
"""An object containing a set of AttributeMeta objects"""
def __init__(self, name):
super(MapMeta, self).__init__(logger_name=name)
self.name = nam... | from collections import OrderedDict
from loggable import Loggable
from malcolm.core.attributemeta import AttributeMeta
class MapMeta(Loggable):
"""An object containing a set of AttributeMeta objects"""
def __init__(self, name):
super(MapMeta, self).__init__(logger_name=name)
self.name = nam... | apache-2.0 | Python |
2bf3370907a982bca9f02745c6336544c5a2b168 | Bump version to v3.9.1 | rainmattertech/pykiteconnect | kiteconnect/__version__.py | kiteconnect/__version__.py | __title__ = "kiteconnect"
__description__ = "The official Python client for the Kite Connect trading API"
__url__ = "https://kite.trade"
__download_url__ = "https://github.com/zerodhatech/pykiteconnect"
__version__ = "3.9.1"
__author__ = "Zerodha Technology Pvt ltd. (India)"
__author_email__ = "talk@zerodha.tech"
__lic... | __title__ = "kiteconnect"
__description__ = "The official Python client for the Kite Connect trading API"
__url__ = "https://kite.trade"
__download_url__ = "https://github.com/zerodhatech/pykiteconnect"
__version__ = "3.9.0"
__author__ = "Zerodha Technology Pvt ltd. (India)"
__author_email__ = "talk@zerodha.tech"
__lic... | mit | Python |
9d0ea4eaf8269350fabc3415545bebf4da4137a7 | Fix passing invalid None to multiprocessing Process class. | 4degrees/segue | source/segue/backend/processor/background.py | source/segue/backend/processor/background.py | # :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
import multiprocessing
from .base import Processor
class BackgroundProcessor(Processor):
'''Local background processor.'''
def process(self, command, args=None, kw=None):
'''Process *command*... | # :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
import multiprocessing
from .base import Processor
class BackgroundProcessor(Processor):
'''Local background processor.'''
def process(self, command, args=None, kw=None):
'''Process *command*... | apache-2.0 | Python |
2cea4b2d4beba74e4a71c1bfd64dd47a069143f0 | Fix migration | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | bluebottle/geo/migrations/0019_auto_20201229_1051.py | bluebottle/geo/migrations/0019_auto_20201229_1051.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2020-12-29 09:51
from __future__ import unicode_literals
from bluebottle.clients import properties
from bluebottle.utils.utils import get_languages
from django.db import migrations
def migrate_to_office_regions(apps, schema_editor):
Location = apps.get_mo... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2020-12-29 09:51
from __future__ import unicode_literals
from bluebottle.clients import properties
from bluebottle.utils.utils import get_languages
from django.db import migrations
def migrate_to_office_regions(apps, schema_editor):
Location = apps.get_mo... | bsd-3-clause | Python |
bcf38079b17c135ecca245171952b230e7cd0f30 | change cleaner action | muchu1983/104_cameo,muchu1983/104_cameo | cameo/cleaner.py | cameo/cleaner.py | # -*- coding: utf-8 -*-
"""
Copyright (C) 2015, MuChu Hsu
Contributed by Muchu Hsu (muchu1983@gmail.com)
This file is part of BSD license
<https://opensource.org/licenses/BSD-3-Clause>
"""
import shutil
import os
import stat
"""
清理不需要的資料
"""
class CleanerForINDIEGOGO:
def __init__(self):
self.strBased... | # -*- coding: utf-8 -*-
"""
Copyright (C) 2015, MuChu Hsu
Contributed by Muchu Hsu (muchu1983@gmail.com)
This file is part of BSD license
<https://opensource.org/licenses/BSD-3-Clause>
"""
import shutil
import os
import stat
"""
清理不需要的資料
"""
class CleanerForINDIEGOGO:
def __init__(self):
self.strBased... | bsd-3-clause | Python |
ca383e8b3b0d21a087e18ef439f2d4830259e8fa | Fix PIL label rendering shadow | akshayaurora/kivy,akshayaurora/kivy,rnixx/kivy,kivy/kivy,kivy/kivy,matham/kivy,rnixx/kivy,akshayaurora/kivy,matham/kivy,kivy/kivy,rnixx/kivy,matham/kivy,matham/kivy | kivy/core/text/text_pil.py | kivy/core/text/text_pil.py | '''
Text PIL: Draw text with PIL
'''
__all__ = ('LabelPIL', )
from PIL import Image, ImageFont, ImageDraw
from kivy.compat import text_type
from kivy.core.text import LabelBase
from kivy.core.image import ImageData
# used for fetching extends before creature image surface
default_font = ImageFont.load_default()
... | '''
Text PIL: Draw text with PIL
'''
__all__ = ('LabelPIL', )
from PIL import Image, ImageFont, ImageDraw
from kivy.compat import text_type
from kivy.core.text import LabelBase
from kivy.core.image import ImageData
# used for fetching extends before creature image surface
default_font = ImageFont.load_default()
... | mit | Python |
368c8c4eedc723453eed63a30cae33ddc5fe6756 | call start in sys.exit(start()) instead of start() | celebdor/kuryr-libnetwork,celebdor/kuryr-libnetwork,celebdor/kuryr-libnetwork | kuryr_libnetwork/server.py | kuryr_libnetwork/server.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 | Python |
b421f56bdb0974158582f2e3c28deafb5c2e1f58 | Replace OpenERP by Odoo | BT-jmichaud/l10n-switzerland,brain-tec/l10n-switzerland,brain-tec/l10n-switzerland,brain-tec/l10n-switzerland | l10n_ch_zip/__openerp__.py | l10n_ch_zip/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author Nicolas Bessi. Copyright Camptocamp SA
# Contributor: WinGo SA
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all... | # -*- coding: utf-8 -*-
##############################################################################
#
# Author Nicolas Bessi. Copyright Camptocamp SA
# Contributor: WinGo SA
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all... | agpl-3.0 | Python |
34334bdb85644a5553ba36af5dc98942ea5fbf21 | Add docstring to launch_control package | Linaro/lava-server,Linaro/lava-server,OSSystems/lava-server,OSSystems/lava-server,Linaro/lava-server,Linaro/lava-server,OSSystems/lava-server | launch_control/__init__.py | launch_control/__init__.py | # This file is part of the ARM Validation Dashboard Project.
# for the Linaro organization (http://linaro.org/)
#
# For more details see:
# https://blueprints.launchpad.net/ubuntu/+spec/arm-m-validation-dashboard
"""
Public API for Launch Control.
Please see one of the available packages for more information.
"""
... | # This file is part of the ARM Validation Dashboard Project.
# for the Linaro organization (http://linaro.org/)
#
# For more details see:
# https://blueprints.launchpad.net/ubuntu/+spec/arm-m-validation-dashboard
__version__ = "0.0.1"
| agpl-3.0 | Python |
5b889086e8a7405db585fa9ee28972bc949925e0 | bump version | inovasolutions/django-knowledge,legrostdg/django-knowledge,RDXT/django-knowledge,CantemoInternal/django-knowledge,7wonders/django-knowledge,zapier/django-knowledge,legrostdg/django-knowledge,CantemoInternal/django-knowledge,inovasolutions/django-knowledge,zapier/django-knowledge,zapier/django-knowledge,RDXT/django-know... | knowledge/__init__.py | knowledge/__init__.py | VERSION = (0, 1, 2)
| VERSION = (0, 1, 1)
| isc | Python |
00d96667b42b5bf12c47125ed44d2d954d633864 | Build types added for all classes in featgen | laisrael/Game-Tools-NPC-Generator | featgen.py | featgen.py | import random
def generate(myrace, myclass, mystats, infeats, inlevel):
if infeats != "rand":
return infeats
# elif myclass == "Barbarian":
# #Barbarian strength build
#Human Bonus Feat) Toughness
#1) Power Attack
#3) Improved Initiative
#5) Endurance
#7) Diehard
#9) Improved Critical (main w... | import random
def generate(myrace, myclass, mystats, infeats, inlevel):
if infeats != "rand":
return infeats
# elif myclass == "Barbarian":
# #Barbarian strength build
#Human Bonus Feat) Toughness
#1) Power Attack
#3) Improved Initiative
#5) Endurance
#7) Diehard
#9) Improved Critical (main w... | mit | Python |
abc3d7ec7cee3a0b92a683becbefa6af8be98824 | test configuration should not log pecan at debug level | ceph/ceph-installer,ceph/mariner-installer,ceph/ceph-installer,ceph/ceph-installer | mariner/tests/config.py | mariner/tests/config.py | # Server Specific Configurations
server = {
'port': '8080',
'host': '0.0.0.0'
}
# Pecan Application Configurations
app = {
'root': 'mariner.controllers.root.RootController',
'modules': ['mariner'],
'debug': False,
}
logging = {
'root': {'level': 'INFO', 'handlers': ['console']},
'loggers':... | # Server Specific Configurations
server = {
'port': '8080',
'host': '0.0.0.0'
}
# Pecan Application Configurations
app = {
'root': 'mariner.controllers.root.RootController',
'modules': ['mariner'],
'debug': False,
}
logging = {
'root': {'level': 'INFO', 'handlers': ['console']},
'loggers':... | mit | Python |
042a0fb7673da11f6c2bcbf50866754a8fac6851 | update jpush app key and master key | xlui/KinectProject,xlui/KinectProject,xlui/KinectProject,xlui/KinectProject | Server/conf.py | Server/conf.py | # please input config variables here
# variables for mysql.py
host = 'localhost'
database = 'user_info'
table = 'account'
username = 'kinect'
password = 'kinect'
# variables for push.py
app_key = u'01d93632e5886f1145431c1e'
master_secret = u'6a7f9e8c5c248d00b401dca6'
| # please input config variables here
# variables for mysql.py
host = 'localhost'
database = 'user_info'
table = 'account'
username = 'kinect'
password = 'kinect'
# variables for push.py
app_key = u'bb46127fd9ff41bf4d8f5bec'
master_secret = u'8934d8ec72156d2f3dc4e785'
| apache-2.0 | Python |
4d24d0c59abe919e2898afd056233c9b54af60f0 | Fix boards_web_static template tag in other envs | jessamynsmith/boards-backend,jessamynsmith/boards-backend,GetBlimp/boards-backend | blimp_boards/utils/templatetags/boards_web_static.py | blimp_boards/utils/templatetags/boards_web_static.py | from django import template
from django.conf import settings
from django.utils.six.moves.urllib.parse import urljoin
register = template.Library()
@register.simple_tag(takes_context=True)
def boards_web_static(context, path):
if settings.ENVIRONMENT != 'DEVELOPMENT':
request = context['request']
... | from django import template
from django.conf import settings
from django.utils.six.moves.urllib.parse import urljoin
register = template.Library()
@register.simple_tag(takes_context=True)
def boards_web_static(context, path):
if settings.ENVIRONMENT != 'DEVELOPMENT':
request = context['request']
... | agpl-3.0 | Python |
c443db0618310c1f743b5d9bb0399d407212d295 | Update constants.py | lmcro/letsencrypt,letsencrypt/letsencrypt,lmcro/letsencrypt,letsencrypt/letsencrypt,stweil/letsencrypt,stweil/letsencrypt | certbot-nginx/certbot_nginx/constants.py | certbot-nginx/certbot_nginx/constants.py | """nginx plugin constants."""
import pkg_resources
import platform
if(platform.system() == ('FreeBSD' or 'Darwin')):
server_root_tmp = "/usr/local/etc/nginx"
else:
server_root_tmp = "/etc/nginx"
CLI_DEFAULTS = dict(
server_root=server_root_tmp
ctl="nginx",
)
"""CLI defaults."""
MOD_SSL_CONF_DEST... | """nginx plugin constants."""
import pkg_resources
CLI_DEFAULTS = dict(
server_root="/etc/nginx",
ctl="nginx",
)
"""CLI defaults."""
MOD_SSL_CONF_DEST = "options-ssl-nginx.conf"
"""Name of the mod_ssl config file as saved in `IConfig.config_dir`."""
MOD_SSL_CONF_SRC = pkg_resources.resource_filename(
"... | apache-2.0 | Python |
ba9535e7758508a84c548b07995b4fc63e3386f0 | add docstrings and remove unused sorted list from split_list() | BradleyMoore/Algorithms | algorithms/sorting/mergesort.py | algorithms/sorting/mergesort.py | import sys
def mergesort(unsorted):
"""Takes an unsorted list as imput and return a sorted list."""
sorted = []
# if length of list is <= 1 it is already sorted
if len(unsorted) <= 1:
return unsorted
# split list into 2 halves
left, right = split_list(unsorted)
# sort and merge ... | import sys
def mergesort(unsorted):
sorted = []
# if length of list is <= 1 it is already sorted
if len(unsorted) <= 1:
return unsorted
left, right = split_list(unsorted)
sorted = merge(left, right)
return sorted
def split_list(unsorted):
mid = len(unsorted) / 2
left = un... | mit | Python |
7846eb47bd3cd8d309260f3ba2185d497509ea4d | fix test_report_qweb_signer - tests were causing travis to stall | OCA/reporting-engine,OCA/reporting-engine,OCA/reporting-engine,OCA/reporting-engine | report_qweb_pdf_watermark/tests/test_report_qweb_pdf_watermark.py | report_qweb_pdf_watermark/tests/test_report_qweb_pdf_watermark.py | # -*- coding: utf-8 -*-
# © 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from PIL import Image
from odoo.tests.common import HttpCase
class TestReportQwebPdfWatermark(HttpCase):
def test_report_qweb_pdf_watermark(self):
Image.init()
# with ou... | # -*- coding: utf-8 -*-
# © 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from PIL import Image
from openerp.tests.common import HttpCase
class TestReportQwebPdfWatermark(HttpCase):
def test_report_qweb_pdf_watermark(self):
Image.init()
# with... | agpl-3.0 | Python |
697be9d6ae24f267f317478eaf962796f456da1f | add dev server setting to prod | marthaurion/blog_django,marthaurion/blog_django,marthaurion/blog_django | blog_django/settings/prod.py | blog_django/settings/prod.py | from .base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
AWS_CLOUDFRONT_DOMAIN = "d34zzkuru6phz2.cloudfront.net"
#AWS_CLOUDFRONT_DOMAIN = "media.codebecauseican.com"
STATICFILES_LOCATION = 'static'
STATIC_URL = "https://%s/%s/" % (AWS_CLOUDFRONT_DOMAIN, STATICFILES_LOCATION... | from .base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
AWS_CLOUDFRONT_DOMAIN = "d34zzkuru6phz2.cloudfront.net"
#AWS_CLOUDFRONT_DOMAIN = "media.codebecauseican.com"
STATICFILES_LOCATION = 'static'
STATIC_URL = "https://%s/%s/" % (AWS_CLOUDFRONT_DOMAIN, STATICFILES_LOCATION... | mit | Python |
ca6c2e2c95dab1a34ce8514103ef87bfb5a07e95 | Make spelling more consistent | khalim19/gimp-plugin-export-layers,khalim19/gimp-plugin-export-layers | export_layers/pygimplib/pgutils.py | export_layers/pygimplib/pgutils.py | #
# This file is part of pygimplib.
#
# Copyright (C) 2014, 2015 khalim19 <khalim19@gmail.com>
#
# pygimplib is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your optio... | #
# This file is part of pygimplib.
#
# Copyright (C) 2014, 2015 khalim19 <khalim19@gmail.com>
#
# pygimplib is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your optio... | bsd-3-clause | Python |
89e4f70dd59ec4a3cccfab2dc73612f7d73f27f1 | change order validation | Gebesa-Dev/Addons-gebesa | account_invoice_sale_data/models/sale_order.py | account_invoice_sale_data/models/sale_order.py | # -*- coding: utf-8 -*-
# © <YEAR(S)> <AUTHOR(S)>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import _, api, fields, models
class SaleOrder(models.Model):
_inherit = 'sale.order'
geb_invoice_status = fields.Selection(
[('no_invoice', _('No invoice')),
(... | # -*- coding: utf-8 -*-
# © <YEAR(S)> <AUTHOR(S)>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import _, api, fields, models
class SaleOrder(models.Model):
_inherit = 'sale.order'
geb_invoice_status = fields.Selection(
[('no_invoice', _('No invoice')),
(... | agpl-3.0 | Python |
cb1af2160952c7065e236d2cd544f46e5b252e92 | ADD dependency of l10n_ar_invoice for account summary | maljac/odoo-addons,adhoc-dev/odoo-addons,syci/ingadhoc-odoo-addons,dvitme/odoo-addons,ingadhoc/account-payment,jorsea/odoo-addons,ingadhoc/stock,jorsea/odoo-addons,ingadhoc/account-financial-tools,sysadminmatmoz/ingadhoc,levkar/odoo-addons,syci/ingadhoc-odoo-addons,ingadhoc/partner,ingadhoc/product,ClearCorp/account-fi... | account_partner_account_summary/__openerp__.py | account_partner_account_summary/__openerp__.py | # -*- coding: utf-8 -*-
{
'name': 'Partner Account Summary',
'version': '1.0',
'description': """Partner Account Summary""",
'category': 'Aeroo Reporting',
'author': 'Ingenieria ADHOC',
'website': 'www.ingadhoc.com',
'depends': [
'sale',
'report_aeroo',
'l10n_ar_invoi... | # -*- coding: utf-8 -*-
{
'name': 'Partner Account Summary',
'version': '1.0',
'description': """Partner Account Summary""",
'category': 'Aeroo Reporting',
'author': 'Ingenieria ADHOC',
'website': 'www.ingadhoc.com',
'depends': [
'sale',
'report_aeroo',
],
'data':... | agpl-3.0 | Python |
5ec49eac47a43e57a6ea9bddba3cc2259b4e1400 | Complete bin sol | bowen0701/algorithms_data_structures | lc0191_number_of_1_bits.py | lc0191_number_of_1_bits.py | """Leetcode 191. Number of 1 Bits
Easy
URL: https://leetcode.com/problems/number-of-1-bits/
Write a function that takes an unsigned integer and return the number of '1' bits
it has (also known as the Hamming weight).
Example 1:
Input: 00000000000000000000000000001011
Output: 3
Explanation: The input binary string 00... | """Leetcode 191. Number of 1 Bits
Easy
URL: https://leetcode.com/problems/number-of-1-bits/
Write a function that takes an unsigned integer and return the number of '1' bits
it has (also known as the Hamming weight).
Example 1:
Input: 00000000000000000000000000001011
Output: 3
Explanation: The input binary string 00... | bsd-2-clause | Python |
ffe634288286ff383074c656c2067e7f2c1b104e | fix channels dialog | spesmilo/electrum,pooler/electrum-ltc,wakiyamap/electrum-mona,spesmilo/electrum,vialectrum/vialectrum,wakiyamap/electrum-mona,wakiyamap/electrum-mona,spesmilo/electrum,pooler/electrum-ltc,spesmilo/electrum,vialectrum/vialectrum,pooler/electrum-ltc,pooler/electrum-ltc,wakiyamap/electrum-mona,vialectrum/vialectrum | gui/kivy/uix/dialogs/lightning_channels.py | gui/kivy/uix/dialogs/lightning_channels.py | from kivy.lang import Builder
from kivy.factory import Factory
from kivy.clock import Clock
import electrum.lightning as lightning
Builder.load_string('''
<LightningChannelItem@CardItem>
channelId: '<channelId not set>'
Label:
text: root.channelId
<LightningChannelsDialog@Popup>:
name: 'lightning_... | from kivy.lang import Builder
from kivy.factory import Factory
Builder.load_string('''
<LightningChannelItem@CardItem>
channelId: '<channelId not set>'
Label:
text: root.channelId
<LightningChannelsDialog@Popup>:
name: 'lightning_channels'
BoxLayout:
orientation: 'vertical'
spa... | mit | Python |
9017d35e73e9a94b553392b538290b8e2345fbfb | Fix velbus climate current temp (#62329) | rohitranjan1991/home-assistant,rohitranjan1991/home-assistant,toddeye/home-assistant,home-assistant/home-assistant,w1ll1am23/home-assistant,toddeye/home-assistant,rohitranjan1991/home-assistant,GenericStudent/home-assistant,mezz64/home-assistant,nkgilley/home-assistant,w1ll1am23/home-assistant,GenericStudent/home-assis... | homeassistant/components/velbus/climate.py | homeassistant/components/velbus/climate.py | """Support for Velbus thermostat."""
from __future__ import annotations
from typing import Any
from velbusaio.channels import Temperature as VelbusTemp
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
HVAC_MODE_HEAT,
SUPPORT_PRESET_MODE,
SUPP... | """Support for Velbus thermostat."""
from __future__ import annotations
from typing import Any
from velbusaio.channels import Temperature as VelbusTemp
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
HVAC_MODE_HEAT,
SUPPORT_PRESET_MODE,
SUPP... | apache-2.0 | Python |
2deacd64942d608284e3382dd52afd28bb421355 | Convert pickle to JSON | scel-hawaii/data-gateway,scel-hawaii/data-gateway | gateway.py | gateway.py | #!/usr/bin/env python
from xbee import ZigBee
import serial
import datetime
import logging
import sys
import os
import json
class XBeeGateway:
def initialize(self):
print "Setup"
self.callbacks = []
def register_callback(self, callback):
self.callbacks.push()
def setup(self):
... | #!/usr/bin/env python
from xbee import ZigBee
import serial
import datetime
import pickle
import logging
import sys
import os
class XBeeGateway:
def initialize(self):
print "Setup"
self.callbacks = []
def register_callback(self, callback):
self.callbacks.push()
def setup(self):
... | mit | Python |
f8c0c61b01ea38f350a8857115b1634183b9503d | add text for humans @ Home banners | brasilcomvc/brasilcomvc,brasilcomvc/brasilcomvc,brasilcomvc/brasilcomvc | brasilcomvc/portal/models.py | brasilcomvc/portal/models.py | # coding: utf8
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.template.defaultfilters import striptags, truncatechars
from imagekit.models import ProcessedImageField
from imagekit.processors import ResizeToFill
def projec... | # coding: utf8
from __future__ import unicode_literals
from django.db import models
from imagekit.models import ProcessedImageField
from imagekit.processors import ResizeToFill
def project_img_upload_to(instance, filename):
return 'homebanners/{}/image.jpeg'.format(instance.id)
class HomeBanner(models.Model):
... | apache-2.0 | Python |
e0d49b2799cbd26a6aa5a09eb7a8bfbab96789ac | add - date fields to definition | rfaulkner/easyML,rfaulkner/easyML,rfaulkner/easyML,rfaulkner/easyML | versus/schema/schema.py | versus/schema/schema.py | """
Ryan Faulkner, 2014
Schema definitions for sqlalchemy
"""
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class User(Base):
__tablename__ = 'Users'
id = Column(Integer, primary_key=True)
name = Column(String)
ful... | """
Ryan Faulkner, 2014
Schema definitions for sqlalchemy
"""
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class User(Base):
__tablename__ = 'Users'
id = Column(Integer, primary_key=True)
name = Column(String)
ful... | bsd-3-clause | Python |
07176ef23023ad3060b5e7f35cba85fa0f47eec3 | remove registering color as cloud command | rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh | cloudmesh_cmd3/plugins/cm_shell_color.py | cloudmesh_cmd3/plugins/cm_shell_color.py | from __future__ import print_function
from cmd3.shell import command
from cloudmesh.config.cm_config import cm_config
from cloudmesh_common.logger import LOGGER
from cmd3.console import Console
log = LOGGER(__file__)
class cm_shell_color:
def activate_cm_shell_yaml(self):
self.cm_config = cm_config()
... | from __future__ import print_function
from cmd3.shell import command
from cloudmesh.config.cm_config import cm_config
from cloudmesh_common.logger import LOGGER
from cmd3.console import Console
log = LOGGER(__file__)
class cm_shell_color:
def activate_cm_shell_yaml(self):
self.cm_config = cm_config()
... | apache-2.0 | Python |
eebb0a0e637f95a79da9f8d2b0cd7f227005c425 | Add additional exception catch. | catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult | devil/devil/android/crash_handler.py | devil/devil/android/crash_handler.py | # Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
from devil import base_error
from devil.android import device_errors
logger = logging.getLogger(__name__)
def RetryOnSystemCrash(f, device... | # Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
from devil import base_error
from devil.android import device_errors
logger = logging.getLogger(__name__)
def RetryOnSystemCrash(f, device... | bsd-3-clause | Python |
517d25cf79c4d04661309ab7b3ab0638a2f968ee | Use SystemRandom to generate security-viable randomness | docbleach/DocBleach-Web,docbleach/DocBleach-Web,docbleach/DocBleach-Web,docbleach/DocBleach-Web | api/docbleach/utils/__init__.py | api/docbleach/utils/__init__.py | import os
import string
from random import SystemRandom
cryptogen = SystemRandom()
def secure_uuid():
"""
Strength: 6*3 random characters from a list of 62, approx. 64^18 possible
strings, or 2^100. Should be enough to prevent a successful bruteforce, as
download links are only valid for 3 hours
... | import os
import random
import string
def secure_uuid():
"""
Strength: 6*3 random characters from a list of 62, approx. 64^18 possible
strings, or 2^100. Should be enough to prevent a successful bruteforce, as
download links are only valid for 3 hours
:return:
"""
return id_generator() + "... | mit | Python |
072294d1d00e4404213eb00b0d37e3ce1d926fe9 | Bump to version 4.0.18 | tainstr/misura.canon,tainstr/misura.canon | misura/canon/version.py | misura/canon/version.py | __version__ = '4.0.18'
| __version__ = '4.0.17'
| mit | Python |
c09f9c9f2b7268a13bb4e47684294d2003642b21 | load gunicorn build | nnsnodnb/django-mbaas,nnsnodnb/django-mbaas,nnsnodnb/django-mbaas | mbaas/wsgi.py | mbaas/wsgi.py | # coding: utf-8
"""
WSGI config for mbaas project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
import re
def load_env():
try:
with open('.env') as f:
... | # coding: utf-8
"""
WSGI config for mbaas project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault... | apache-2.0 | Python |
4cfdb3bd6bae0b566305240b2e990444219a489d | fix migration conflict | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | custom/icds_reports/migrations/0179_location_deprecation_columns.py | custom/icds_reports/migrations/0179_location_deprecation_columns.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.28 on 2020-03-25 17:11
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('icds_reports', '0184_auto_20200421_2017'),
]
operations = [
migrations.RunSQL('ALT... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.28 on 2020-03-25 17:11
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('icds_reports', '0178_rebuild_chm_view'),
]
operations = [
migrations.RunSQL('ALTER... | bsd-3-clause | Python |
14dc9b725cc38157d3ab52c5a7b896ea14325a9b | update log path | matthiasr/logformat,matthiasr/logformat,matthiasr/logformat | handler.py | handler.py | #!/usr/bin/env python
from bottle import get, request, response, static_file, run
from logformat import chatlog, DirectoryListing
#from admin import admin_page, admin_post, auth
import time
import os
def getdirname(path):
# FIXME: determine automatically
return os.path.join('/srv/www/logs',path.lstrip('/'))
@... | #!/usr/bin/env python
from bottle import get, request, response, static_file, run
from logformat import chatlog, DirectoryListing
#from admin import admin_page, admin_post, auth
import time
import os
def getdirname(path):
# FIXME: determine automatically
return os.path.join('/var/www/logs',path.lstrip('/'))
@... | mit | Python |
a4df3f966e232e8327522a3db32870f5dcea0c03 | Add deprecated fallback for SSLMiddleware. | traxxas/cartridge,traxxas/cartridge,Parisson/cartridge,Kniyl/cartridge,syaiful6/cartridge,jaywink/cartridge-reservable,wbtuomela/cartridge,syaiful6/cartridge,ryneeverett/cartridge,wbtuomela/cartridge,dsanders11/cartridge,wbtuomela/cartridge,dsanders11/cartridge,wyzex/cartridge,jaywink/cartridge-reservable,Parisson/cart... | cartridge/shop/middleware.py | cartridge/shop/middleware.py |
from mezzanine.conf import settings
from cartridge.shop.models import Cart
class SSLRedirect(object):
def __init__(self):
old = ("SHOP_SSL_ENABLED", "SHOP_FORCE_HOST", "SHOP_FORCE_SSL_VIEWS")
for name in old:
try:
getattr(settings, name)
except AttributeE... |
from mezzanine.conf import settings
from cartridge.shop.models import Cart
class ShopMiddleware(object):
def __init__(self):
old = ("SHOP_SSL_ENABLED", "SHOP_FORCE_HOST", "SHOP_FORCE_SSL_VIEWS")
for name in old:
try:
getattr(settings, name)
except Attribu... | bsd-2-clause | Python |
8682c761c4a4c2c73623878fb4203693ad35ccfe | Convert animation.Runner.fps into a property | rec/BiblioPixel,ManiacalLabs/BiblioPixel,ManiacalLabs/BiblioPixel,ManiacalLabs/BiblioPixel,ManiacalLabs/BiblioPixel,rec/BiblioPixel,rec/BiblioPixel,rec/BiblioPixel | bibliopixel/animation/runner.py | bibliopixel/animation/runner.py | from .. util import log
from .. project import attributes, load
class Runner(object):
def __init__(self, *, amt=1, fps=None, sleep_time=0, max_steps=0,
until_complete=False, max_cycles=0, seconds=None,
threaded=False, main=None, **kwds):
attributes.check(kwds, 'run')
... | from .. util import log
from .. project import attributes, load
class Runner(object):
def __init__(self, *, amt=1, fps=None, sleep_time=0, max_steps=0,
until_complete=False, max_cycles=0, seconds=None,
threaded=False, main=None, **kwds):
attributes.check(kwds, 'run')
... | mit | Python |
fce4eb7063f196905007686930b47d64e5261b29 | Add rpm_key as an alternative module to rpm | MatrixCrawler/ansible-lint,dataxu/ansible-lint,willthames/ansible-lint | lib/ansiblelint/rules/CommandsInsteadOfModulesRule.py | lib/ansiblelint/rules/CommandsInsteadOfModulesRule.py | # Copyright (c) 2013-2014 Will Thames <will@thames.id.au>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify... | # Copyright (c) 2013-2014 Will Thames <will@thames.id.au>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify... | mit | Python |
5385437203f9f5daaa0fa08738c8ccae05d7ce51 | Add visit choices. | BridgeCityBicycleCoop/workstand,BridgeCityBicycleCoop/workstand,BridgeCityBicycleCoop/workstand,BridgeCityBicycleCoop/workstand | bikeshop_project/core/models.py | bikeshop_project/core/models.py | from django.db import models
from django.utils import timezone
class Membership(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
modified_at = models.DateTimeField(auto_now=True)
renewed_at = models.DateTimeField(default=timezone.now)
member = models.OneToOneField(
'registra... | from django.db import models
from django.utils import timezone
class Membership(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
modified_at = models.DateTimeField(auto_now=True)
renewed_at = models.DateTimeField(default=timezone.now)
member = models.OneToOneField(
'registra... | mit | Python |
67026225ddb27602cd1aca7702470bb7a81fb283 | fix skelet3d is not in pipy | mjirik/lisa,mjirik/lisa | lisa/update_stable.py | lisa/update_stable.py | #! /usr/bin/python
# -*- coding: utf-8 -*-
import subprocess
import logging
logger = logging.getLogger(__name__)
def update():
# update submodules codes
print ('Updating submodules')
try:
#import pdb; pdb.set_trace()
subprocess.call('git pull', shell=True)
subprocess.call('... | #! /usr/bin/python
# -*- coding: utf-8 -*-
import subprocess
import logging
logger = logging.getLogger(__name__)
def update():
# update submodules codes
print ('Updating submodules')
try:
#import pdb; pdb.set_trace()
subprocess.call('git pull', shell=True)
subprocess.call('... | bsd-3-clause | Python |
29506a867c3f33bfd6d15fcc26f44e72fa17de87 | Bump to version 0.2.2 | kizkoh/wsgi_status,kizkoh/wsgi_status | wsgi_status/__init__.py | wsgi_status/__init__.py | # -*- coding: utf-8 -*-
version_info = (0, 2, 2)
__version__ = ".".join([str(v) for v in version_info])
| # -*- coding: utf-8 -*-
version_info = (0, 2, 1)
__version__ = ".".join([str(v) for v in version_info])
| mit | Python |
0f2f64f1bea3d74022bff66ae5395ed44bfadb6f | Fix flake error | ismailsunni/healthsites,ismailsunni/healthsites,ismailsunni/healthsites,ismailsunni/healthsites | django_project/core/settings/prod_docker.py | django_project/core/settings/prod_docker.py | from .prod import * # noqa
import os
print os.environ
ALLOWED_HOSTS = ['*']
ADMINS = (('Tim Sutton', 'tim@kartoza.com'), )
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': os.environ['DATABASE_NAME'],
'USER': os.environ['DATABASE_USERNAME'],
'... | from .prod import * # noqa
#from .dev import * # noqa
import os
print os.environ
ALLOWED_HOSTS = ['*']
ADMINS = (('Tim Sutton', 'tim@kartoza.com'), )
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': os.environ['DATABASE_NAME'],
'USER': os.environ['DA... | bsd-2-clause | Python |
fdf014fb0602cbba476b0e35d451f43e86be7cdc | Fix wrong db name for travis. | AIFDR/inasafe-django,timlinux/inasafe-django,timlinux/inasafe-django,AIFDR/inasafe-django,AIFDR/inasafe-django,timlinux/inasafe-django,AIFDR/inasafe-django,timlinux/inasafe-django | django_project/core/settings/test_travis.py | django_project/core/settings/test_travis.py | # -*- coding: utf-8 -*-
from .test import * # noqa
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'test_db',
'USER': 'postgres',
'PASSWORD': '',
'HOST': 'localhost',
# Set to empty string for default.
'PORT': '',
}... | # -*- coding: utf-8 -*-
from .test import * # noqa
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'gis',
'USER': 'postgres',
'PASSWORD': '',
'HOST': 'localhost',
# Set to empty string for default.
'PORT': '',
}
}
| bsd-2-clause | Python |
b152e32c131786f96bc1fa598bccfa5aee56a3bd | fix on clearcache | bauzaar/django-zilla,bauzaar/django-zilla | django_zilla/utils/management/commands/flushcache.py | django_zilla/utils/management/commands/flushcache.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, division
from django.core.management.base import BaseCommand
from django.core import cache
from django.db import transaction
from django_zilla.utils import redis_utils
class Command(BaseCommand):
help = 'Flush cache'
@transaction.atomic()
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, division
from django.core.management.base import BaseCommand
from django.core.cache import cache
from django.db import transaction
from django_zilla.utils import redis_utils
class Command(BaseCommand):
help = 'Flush cache'
@transaction.atomic(... | bsd-3-clause | Python |
72c8a2413c43ced14317568e4830c20fddf23d2f | add logging config | kaczmarj/neurodocker,kaczmarj/neurodocker | neurodocker/__init__.py | neurodocker/__init__.py | # Author: Jakub Kaczmarzyk <jakubk@mit.edu>
from __future__ import absolute_import
import logging
import sys
LOG_FORMAT = '[NEURODOCKER %(asctime)s %(levelname)s]: %(message)s'
logging.basicConfig(stream=sys.stdout, datefmt='%H:%M:%S', level=logging.INFO,
format=LOG_FORMAT)
from neurodocker imp... | # Author: Jakub Kaczmarzyk <jakubk@mit.edu>
from __future__ import absolute_import
from neurodocker import interfaces
SUPPORTED_SOFTWARE = {'ants': interfaces.ANTs,
'freesurfer': interfaces.FreeSurfer,
'fsl': interfaces.FSL,
'miniconda': interfaces.Mi... | apache-2.0 | Python |
f801a17353e61904087dc1e54920041464bcfbb8 | Fix running service resource instance | konradko/cnav-bot,konradko/cnav-bot | cnavbot/messaging/service.py | cnavbot/messaging/service.py | from multiprocessing import Process
from cnavbot.utils import logger
from cnavbot.messaging import pubsub
class Resource(object):
topics = {}
def __init__(self, publisher, *args, **kwargs):
self.publisher = publisher
def run(publisher):
raise NotImplementedError()
class Service(object... | from multiprocessing import Process
from cnavbot.utils import logger
from cnavbot.messaging import pubsub
class Resource(object):
topics = {}
def __init__(self, publisher, *args, **kwargs):
self.publisher = publisher
def run(publisher):
raise NotImplementedError()
class Service(object... | mit | Python |
6fc6e218ab9d7fa6f49056aaa02f7426778763e2 | Update settings | mghpcc-projects/user_level_slurm_reservations,mghpcc-projects/user_level_slurm_reservations | common/hil_slurm_settings.py | common/hil_slurm_settings.py | """
MassOpenCloud / Hardware Isolation Layer (HIL)
Slurm / HIL Control Settings
May 2017, Tim Donahue tpd001@gmail.com
"""
DEBUG = True
SLURM_INSTALL_DIR = '/usr/bin/'
HIL_SLURMCTLD_PROLOG_LOGFILE = '/var/log/ulsr/ulsr_prolog.log'
HIL_MONITOR_LOGFILE = '/var/log/ulsr/ulsr_monitor.log'
HIL_ENDPOINT = "http://10.0.... | """
MassOpenCloud / Hardware Isolation Layer (HIL)
Slurm / HIL Control Settings
May 2017, Tim Donahue tpd001@gmail.com
"""
DEBUG = True
SLURM_INSTALL_DIR = '/usr/bin/'
HIL_SLURMCTLD_PROLOG_LOGFILE = '/var/log/moc_hil_ulsr/hil_prolog.log'
HIL_MONITOR_LOGFILE = '/var/log/moc_hil_ulsr/hil_monitor.log'
HIL_ENDPOINT =... | mit | Python |
6ce469eed5d54e33278f96ef8443cc502c1d31cf | Unravel excludes for python3 | jkbrzt/nose-pattern-exclude,jakubroztocil/nose-pattern-exclude | nose_pattern_exclude.py | nose_pattern_exclude.py | import os
import logging
from fnmatch import fnmatch
from nose.plugins import Plugin
class NosePatternExclude(Plugin):
def options(self, parser, env=os.environ):
super(NosePatternExclude, self).options(parser, env)
parser.add_option(
'--exclude-path',
action='append',
... | import os
import logging
from fnmatch import fnmatch
from nose.plugins import Plugin
class NosePatternExclude(Plugin):
def options(self, parser, env=os.environ):
super(NosePatternExclude, self).options(parser, env)
parser.add_option(
'--exclude-path',
action='append',
... | bsd-3-clause | Python |
bbc9aaf205fcab08841cde477f80bdf9a859cede | Fix copy paste in upper air declarative example | ShawnMurd/MetPy,ahaberlie/MetPy,Unidata/MetPy,dopplershift/MetPy,Unidata/MetPy,dopplershift/MetPy,ahaberlie/MetPy | examples/plots/upperair_declarative.py | examples/plots/upperair_declarative.py | # Copyright (c) 2019 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""
===========================================
Upper Air Analysis using Declarative Syntax
===========================================
The MetPy declarative syntax allows for a sim... | # Copyright (c) 2019 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""
=========================================
Surface Analysis using Declarative Syntax
=========================================
The MetPy declarative syntax allows for a simplifie... | bsd-3-clause | Python |
d7624defd7d05e721aeb0ccd074c7172c51295bf | Fix mypy and regex flag | lilydjwg/nvchecker | nvchecker_source/git.py | nvchecker_source/git.py | # MIT licensed
# Copyright (c) 2020 Felix Yan <felixonmars@archlinux.org>, et al.
import re
from .cmd import run_cmd # type: ignore
async def get_version(
name, conf, *, cache, keymanager=None
):
git = conf['git']
cmd = f"git ls-remote -t --refs {git}"
data = await cache.get(cmd, run_cmd)
regex = "(?<=refs/... | # MIT licensed
# Copyright (c) 2020 Felix Yan <felixonmars@archlinux.org>, et al.
import re
from nvchecker_source.cmd import run_cmd
async def get_version(
name, conf, *, cache, keymanager=None
):
git = conf['git']
cmd = f"git ls-remote -t --refs {git}"
data = await cache.get(cmd, run_cmd)
regex = "(?<=refs... | mit | Python |
3ae8ccc4f8ae478559f3aefc8dc44e289cbef79a | Fix subprocess encoding | MrS0m30n3/youtube-dl-gui,ukazap/youtube-dl-gui,MrS0m30n3/youtube-dl-gui,dstftw/youtube-dl-gui,pr0d1r2/youtube-dl-gui,dstftw/youtube-dl-gui,Sofronio/youtube-dl-gui,ukazap/youtube-dl-gui,pr0d1r2/youtube-dl-gui,Sofronio/youtube-dl-gui | youtube_dl_gui/Utils.py | youtube_dl_gui/Utils.py | #! /usr/bin/env python
import os
import sys
import locale
def remove_empty_items(array):
return [x for x in array if x != '']
def remove_spaces(string):
return string.replace(' ', '')
def string_to_array(string, char=' '):
return string.split(char)
def preferredencoding():
try:
pref = locale.getprefe... | #! /usr/bin/env python
import os
import sys
def remove_empty_items(array):
return [x for x in array if x != '']
def remove_spaces(string):
return string.replace(' ', '')
def string_to_array(string, char=' '):
return string.split(char)
def get_encoding():
if sys.platform == 'win32':
return sys.getfi... | unlicense | Python |
0ebc7cb4ff444cc751c9aa25316042792f9f74ab | Use a shebang | leapp-to/snactor | examples/actors/create_container/create_container.py | examples/actors/create_container/create_container.py | #!/usr/bin/python
import sys
import json
import shlex
from subprocess import Popen, PIPE
def _execute(cmd):
return Popen(shlex.split(cmd), stdout=PIPE, stderr=PIPE).communicate()
def _build_cmd(source_path, name, version, force, exposed_ports):
good_mounts = ['bin', 'etc', 'home', 'lib', 'lib64', 'media',
... | import sys
import json
import shlex
from subprocess import Popen, PIPE
def _execute(cmd):
return Popen(shlex.split(cmd), stdout=PIPE, stderr=PIPE).communicate()
def _build_cmd(source_path, name, version, force, exposed_ports):
good_mounts = ['bin', 'etc', 'home', 'lib', 'lib64', 'media',
... | apache-2.0 | Python |
ab9805a645c6683b516004a0892f84638185d68c | add api | Coderhypo/makinami | app/api/poj.py | app/api/poj.py | #!/usr/bin/env python
# coding=utf-8
# 提供POJ相关API的实现
import pymongo
from flask.ext import restful
from app import api
import config
class POJProblem(restful.Resource):
def get(self, problem_id):
client = pymongo.MongoClient(config.MONGO_URI)
db = client[config.MONGO_DATABASE]
p... | #!/usr/bin/env python
# coding=utf-8
# 提供POJ相关API的实现
import pymongo
from flask.ext import restful
from app import api
import config
class POJProblem(restful.Resource):
def get(self, problem_id):
client = pymongo.MongoClient(config.MONGO_URI)
db = client[config.MONGO_PROBLEMS_DATABASE]
... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.