commit
stringlengths
40
40
old_file
stringlengths
4
150
new_file
stringlengths
4
150
old_contents
stringlengths
0
3.26k
new_contents
stringlengths
1
4.43k
subject
stringlengths
15
501
message
stringlengths
15
4.06k
lang
stringclasses
4 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
diff
stringlengths
0
4.35k
cee76d5c2216f6f42a54b28a753fe288accc40d7
corehq/apps/accounting/migrations/0026_auto_20180508_1956.py
corehq/apps/accounting/migrations/0026_auto_20180508_1956.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2018-05-08 19:56 from __future__ import unicode_literals from __future__ import absolute_import from django.db import migrations from corehq.sql_db.operations import HqRunPython def noop(*args, **kwargs): pass def _convert_emailed_to_array_field(apps, sc...
# -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2018-05-08 19:56 from __future__ import unicode_literals from __future__ import absolute_import from django.db import migrations from corehq.sql_db.operations import HqRunPython def noop(*args, **kwargs): pass def _convert_emailed_to_array_field(apps, sc...
Save record in migrations file
Save record in migrations file
Python
bsd-3-clause
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
--- +++ @@ -16,11 +16,13 @@ for record in BillingRecord.objects.all(): if record.emailed_to != '': record.emailed_to_list = record.emailed_to.split(',') + record.save() WireBillingRecord = apps.get_model('accounting', 'WireBillingRecord') for wirerecord in WireBilling...
f646fb88e793897cf827fd7d9484386a4bb08594
pages/tests/test_serializers.py
pages/tests/test_serializers.py
from mock import patch from django.test import TestCase from rest_framework.reverse import reverse from .. import serializers from . import factories from pages.utils import build_url class PageSerializerTest(TestCase): def expected_data(self, page): expected = { 'id': page.pk, '...
from rest_framework.reverse import reverse from user_management.models.tests.utils import APIRequestTestCase from .. import serializers from . import factories from pages.utils import build_url class PageSerializerTest(APIRequestTestCase): def setUp(self): self.request = self.create_request() sel...
Fix DeprecationWarnings for serializer context
Fix DeprecationWarnings for serializer context * Pass a context containing a request to every serializer Conflicts: pages/tests/test_serializers.py
Python
bsd-2-clause
incuna/feincms-pages-api
--- +++ @@ -1,18 +1,20 @@ -from mock import patch - -from django.test import TestCase from rest_framework.reverse import reverse +from user_management.models.tests.utils import APIRequestTestCase from .. import serializers from . import factories from pages.utils import build_url -class PageSerializerTest(T...
cf9b1805b55c567c5f5365d3f2f51f119304e6ba
AC_tools/__init__.py
AC_tools/__init__.py
# compatibility with both python 2 and 3 from __future__ import print_function from . plotting_REDUNDENT import * from . plotting import * from . variables import * from . AC_time import * from . planeflight import * from . generic import * from . core import * from . GEOSChem_bpch import * from . GEOSChem_nc import * ...
# compatibility with both python 2 and 3 from __future__ import print_function import numpy as np # AC_tools modules from . AC_time import * from . core import * from . generic import * from . GEOSChem_bpch import * from . GEOSChem_nc import * from . KPP import * from . planeflight import * from . plotting_REDUNDENT im...
Include integrator modules for KPP and SMVGEAR
Include integrator modules for KPP and SMVGEAR
Python
mit
tsherwen/AC_tools,tsherwen/AC_tools
--- +++ @@ -1,15 +1,19 @@ # compatibility with both python 2 and 3 from __future__ import print_function +import numpy as np +# AC_tools modules +from . AC_time import * +from . core import * +from . generic import * +from . GEOSChem_bpch import * +from . GEOSChem_nc import * +from . KPP import * +from . planefligh...
419131bba11cab27c36ef2b21199cdc3540cde16
byceps/services/shop/order/actions/revoke_ticket_bundles.py
byceps/services/shop/order/actions/revoke_ticket_bundles.py
""" byceps.services.shop.order.actions.revoke_ticket_bundles ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2014-2022 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from .....typing import UserID from ..transfer.action import ActionParameters from ..transfer.ord...
""" byceps.services.shop.order.actions.revoke_ticket_bundles ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2014-2022 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from .....typing import UserID from ..transfer.action import ActionParameters from ..transfer.ord...
Fix ticket bundle revocation order action
Fix ticket bundle revocation order action
Python
bsd-3-clause
homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps
--- +++ @@ -11,7 +11,7 @@ from ..transfer.action import ActionParameters from ..transfer.order import Order -from . import ticket +from . import ticket_bundle def revoke_ticket_bundles( @@ -21,4 +21,4 @@ parameters: ActionParameters, ) -> None: """Revoke all ticket bundles in this order.""" - t...
ece899be682b8713c27e5a4d6189c09afb722c5c
partner_firstname/migrations/12.0.1.0.0/pre-ir_config_param.py
partner_firstname/migrations/12.0.1.0.0/pre-ir_config_param.py
def store_ir_config_param(cr): """Prior to version 12.0 the default order of partner names was last_first. In order to retain this behaviour we store the config parameter if it is not present. """ cr.execute("SELECT 1 FROM ir_config_parameter " "WHERE name = 'partner_names_order'") ...
def store_ir_config_param(cr): """Prior to version 12.0 the default order of partner names was last_first. In order to retain this behaviour we store the config parameter if it is not present. """ cr.execute("SELECT 1 FROM ir_config_parameter " "WHERE key = 'partner_names_order'") ...
Fix migration script 12.0.1.0.0 of partner_firstname
[12.0] Fix migration script 12.0.1.0.0 of partner_firstname
Python
agpl-3.0
BT-rmartin/partner-contact,BT-rmartin/partner-contact,OCA/partner-contact,OCA/partner-contact
--- +++ @@ -4,7 +4,7 @@ store the config parameter if it is not present. """ cr.execute("SELECT 1 FROM ir_config_parameter " - "WHERE name = 'partner_names_order'") + "WHERE key = 'partner_names_order'") if not cr.fetchone(): cr.execute("INSERT INTO ir_config_p...
83d45c0fa64da347eec6b96f46c5eb1fbfe516d4
plugins/call_bad_permissions.py
plugins/call_bad_permissions.py
# -*- coding:utf-8 -*- # # Copyright 2014 Hewlett-Packard Development Company, L.P. # #    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...
# -*- coding:utf-8 -*- # # Copyright 2014 Hewlett-Packard Development Company, L.P. # #    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...
Fix bug with permissions matching
Fix bug with permissions matching
Python
apache-2.0
chair6/bandit,stackforge/bandit,austin987/bandit,pombredanne/bandit,stackforge/bandit,pombredanne/bandit
--- +++ @@ -24,7 +24,8 @@ if context.call_args_count == 2: mode = context.get_call_arg_at_position(1) - if mode is not None and (mode & stat.S_IWOTH or mode & stat.S_IXGRP): + if(mode is not None and type(mode) == int and + (mode & stat.S_IWOTH or mode &...
99cbd692ae6b7dab65aae9d77fd2d8333fe075e4
Lib/scipy_version.py
Lib/scipy_version.py
major = 0 minor = 3 micro = 3 #release_level = 'alpha' release_level='' from __cvs_version__ import cvs_version cvs_minor = cvs_version[-3] cvs_serial = cvs_version[-1] if release_level: scipy_version = '%(major)d.%(minor)d.%(micro)d_%(release_level)s'\ '_%(cvs_minor)d.%(cvs_serial)d' % (local...
major = 0 minor = 3 micro = 2 #release_level = 'alpha' release_level='' try: from __cvs_version__ import cvs_version cvs_minor = cvs_version[-3] cvs_serial = cvs_version[-1] except ImportError,msg: print msg cvs_minor = 0 cvs_serial = 0 if cvs_minor or cvs_serial: if release_level: ...
Handle missing __cvs_version__.py in a branch.
Handle missing __cvs_version__.py in a branch.
Python
bsd-3-clause
gef756/scipy,aman-iitj/scipy,jakevdp/scipy,efiring/scipy,Eric89GXL/scipy,WarrenWeckesser/scipy,zerothi/scipy,argriffing/scipy,futurulus/scipy,juliantaylor/scipy,tylerjereddy/scipy,fernand/scipy,ndchorley/scipy,fredrikw/scipy,niknow/scipy,nmayorov/scipy,nmayorov/scipy,Gillu13/scipy,WarrenWeckesser/scipy,mdhaber/scipy,wi...
--- +++ @@ -1,16 +1,29 @@ major = 0 minor = 3 -micro = 3 +micro = 2 #release_level = 'alpha' release_level='' -from __cvs_version__ import cvs_version -cvs_minor = cvs_version[-3] -cvs_serial = cvs_version[-1] +try: + from __cvs_version__ import cvs_version + cvs_minor = cvs_version[-3] + cvs_serial = ...
a895661f7ce1a814f308dbe8b5836a4cdb472c8c
cla_public/apps/base/filters.py
cla_public/apps/base/filters.py
import re from cla_public.apps.base import base @base.app_template_filter() def matches(value, pattern): return bool(re.search(pattern, value))
from cla_public.apps.base import base @base.app_template_filter() def test(value): return value
Revert "BE: Update custom template filter"
Revert "BE: Update custom template filter" This reverts commit ea0c0beb1d2aa0d5970b629ac06e6f9b9708bfdd.
Python
mit
ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public
--- +++ @@ -1,6 +1,5 @@ -import re from cla_public.apps.base import base @base.app_template_filter() -def matches(value, pattern): - return bool(re.search(pattern, value)) +def test(value): + return value
8e4e12b3c9d64a8c6771b9deb7613c3653f47656
rpihelper/transmission/tasks.py
rpihelper/transmission/tasks.py
# -*- coding: utf-8 -*- from rpihelper.celery import current_app, celery from rpihelper.dropboxclient.logic import Client as DropBoxClient from rpihelper.transmission.logic import ( transmissionrpc_client, transmissionrpc_add_torrent, ) __all__ = ( 'check_torrent_files', ) @celery.task def check_torrent_fil...
# -*- coding: utf-8 -*- from tempfile import NamedTemporaryFile from rpihelper.celery import current_app, celery from rpihelper.dropboxclient.logic import Client as DropBoxClient from rpihelper.transmission.logic import ( transmissionrpc_client, transmissionrpc_add_torrent, ) __all__ = ( 'check_torrent_files...
Fix transmission task for torrent files
Fix transmission task for torrent files
Python
mit
Gr1N/rpihelper,Gr1N/rpihelper
--- +++ @@ -1,4 +1,6 @@ # -*- coding: utf-8 -*- + +from tempfile import NamedTemporaryFile from rpihelper.celery import current_app, celery from rpihelper.dropboxclient.logic import Client as DropBoxClient @@ -20,10 +22,12 @@ dbc = DropBoxClient() for f in dbc.folder(current_app.config['TRANSMISSION_...
f672d140987614c5e4e80114cf28f2f6350be233
pyBattleship.py
pyBattleship.py
import boards def main(): playerDead = False enemyDead = False enemyBoard = boards.makeEnemyBoard() enemyLocations = boards.setupEnemyBoard() playerBoard = boards.makePlayerBoard() print("----BATTLESHIP----") boards.printBoards(enemyBoard, playerBoard) while not playerDea...
import boards def main(): MAX_HITS = 17 enemyDead = False playerDead = False hitsOnEnemy = 0 hitsOnPlayer = 0 turn = 1 enemyBoard = boards.makeEnemyBoard() enemyLocations = boards.setupEnemyBoard() playerBoard = boards.makePlayerBoard() print("----BATTLESHIP----") ...
Add player input evaluation, determines hit/miss
Add player input evaluation, determines hit/miss
Python
apache-2.0
awhittle3/pyBattleship
--- +++ @@ -1,26 +1,54 @@ import boards def main(): + MAX_HITS = 17 + enemyDead = False playerDead = False - enemyDead = False + hitsOnEnemy = 0 + hitsOnPlayer = 0 + turn = 1 enemyBoard = boards.makeEnemyBoard() enemyLocations = boards.setupEnemyBoard() playerBoard = bo...
a365d9a9021b9500475d4f54b7c29cede0064017
pynmea2/types/proprietary/grm.py
pynmea2/types/proprietary/grm.py
# Garmin from ... import nmea class GRM(nmea.ProprietarySentence): sentence_types = {} def __new__(_cls, manufacturer, data): name = manufacturer + data[0] cls = _cls.sentence_types.get(name, _cls) return super(GRM, cls).__new__(cls) class GRME(GRM): """ GARMIN Estim...
# Garmin from ... import nmea class GRM(nmea.ProprietarySentence): sentence_types = {} def __new__(_cls, manufacturer, data): name = manufacturer + data[0] cls = _cls.sentence_types.get(name, _cls) return super(GRM, cls).__new__(cls) def __init__(self, manufacturer, dat...
Add __init__ method to fix parsing
Add __init__ method to fix parsing Ported this init method from ubx.py. This has the effect of removing the sentence sub-type from the data list. Addresses issue #44
Python
mit
silentquasar/pynmea2,Knio/pynmea2
--- +++ @@ -9,6 +9,9 @@ cls = _cls.sentence_types.get(name, _cls) return super(GRM, cls).__new__(cls) + def __init__(self, manufacturer, data): + self.sentence_type = manufacturer + data[1] + super(GRM, self).__init__(manufacturer, data[2:]) class GRME(GRM): """ GARMIN Est...
12d04493f1bb9b79f2f4adf639fdb07619539305
catwatch/blueprints/admin/models.py
catwatch/blueprints/admin/models.py
from sqlalchemy import func from catwatch.blueprints.user.models import db, User from catwatch.blueprints.issue.models import Issue class Dashboard(object): @classmethod def group_and_count_users(cls): """ Perform a group by/count on all user types. :return: List of results "...
from sqlalchemy import func from catwatch.blueprints.user.models import db, User from catwatch.blueprints.issue.models import Issue class Dashboard(object): @classmethod def group_and_count_users(cls): """ Perform a group by/count on all user types. :return: List of results "...
Fix inaccurate docstring for dashboard issue count
Fix inaccurate docstring for dashboard issue count
Python
mit
nickjj/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask,z123/build-a-saas-app-with-flask,z123/build-a-saas-app-with-flask,z123/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask
--- +++ @@ -18,7 +18,7 @@ @classmethod def group_and_count_issues(cls): """ - Perform a group by/count on all user types. + Perform a group by/count on all issue types. :return: List of results """
76ca06c26d74aaad1f0773321fdd382b12addcdc
src/django_easyfilters/utils.py
src/django_easyfilters/utils.py
try: from django.db.models.constants import LOOKUP_SEP except ImportError: # Django < 1.5 fallback from django.db.models.sql.constants import LOOKUP_SEP from django.db.models.related import RelatedObject import six def python_2_unicode_compatible(klass): # Copied from Django 1.5 """ A decorator that de...
try: from django.db.models.constants import LOOKUP_SEP except ImportError: # Django < 1.5 fallback from django.db.models.sql.constants import LOOKUP_SEP from django.db.models.related import RelatedObject from six import PY3 def python_2_unicode_compatible(klass): # Copied from Django 1.5 """ A decorat...
Fix error handling in get_model_field (passthrough).
Fix error handling in get_model_field (passthrough).
Python
mit
ionelmc/django-easyfilters,ionelmc/django-easyfilters
--- +++ @@ -3,7 +3,8 @@ except ImportError: # Django < 1.5 fallback from django.db.models.sql.constants import LOOKUP_SEP from django.db.models.related import RelatedObject -import six +from six import PY3 + def python_2_unicode_compatible(klass): # Copied from Django 1.5 """ @@ -13,7 +14,7 @@ To ...
f7c7cf55b6536fd5646272b700ce42cc02936fbb
st2common/st2common/transport/__init__.py
st2common/st2common/transport/__init__.py
from st2common.transport import actionexecution, publishers __all__ = ['actionexecution', 'publishers']
from st2common.transport import actionexecution, publishers # TODO(manas) : Exchanges, Queues and RoutingKey design discussion pending. __all__ = ['actionexecution', 'publishers']
Add TODO to capture the fact that design discussion is pending.
Add TODO to capture the fact that design discussion is pending.
Python
apache-2.0
pixelrebel/st2,StackStorm/st2,pinterb/st2,jtopjian/st2,tonybaloney/st2,pinterb/st2,Itxaka/st2,emedvedev/st2,jtopjian/st2,lakshmi-kannan/st2,pixelrebel/st2,Plexxi/st2,alfasin/st2,nzlosh/st2,punalpatel/st2,StackStorm/st2,dennybaa/st2,Itxaka/st2,emedvedev/st2,dennybaa/st2,punalpatel/st2,armab/st2,StackStorm/st2,Plexxi/st2...
--- +++ @@ -1,3 +1,5 @@ from st2common.transport import actionexecution, publishers +# TODO(manas) : Exchanges, Queues and RoutingKey design discussion pending. + __all__ = ['actionexecution', 'publishers']
b04fcc4a11eec2df0e9b2f8057aff2d073684122
config/experiment_config_lib.py
config/experiment_config_lib.py
import itertools import string class ControllerConfig(object): _port_gen = itertools.count(8888) def __init__(self, cmdline="", address="127.0.0.1", port=None, nom_port=None): ''' Store metadata for the controller. - cmdline is an array of command line tokens. Note: if you need to pass in t...
import itertools import string class ControllerConfig(object): _port_gen = itertools.count(8888) def __init__(self, cmdline="", address="127.0.0.1", port=None): ''' Store metadata for the controller. - cmdline is an array of command line tokens. Note: if you need to pass in the address and ...
Remove nom_port from options. This should be infered by the controller name. Add a name member for that. For now, infer the controller from the commandline string'
Remove nom_port from options. This should be infered by the controller name. Add a name member for that. For now, infer the controller from the commandline string'
Python
apache-2.0
ucb-sts/sts,jmiserez/sts,ucb-sts/sts,jmiserez/sts
--- +++ @@ -4,7 +4,7 @@ class ControllerConfig(object): _port_gen = itertools.count(8888) - def __init__(self, cmdline="", address="127.0.0.1", port=None, nom_port=None): + def __init__(self, cmdline="", address="127.0.0.1", port=None): ''' Store metadata for the controller. - cmdline is an a...
6c86f7ef2ba5acdb387d154a618dd0f6bb65af6c
stacker/hooks/route53.py
stacker/hooks/route53.py
import logging logger = logging.getLogger(__name__) from aws_helper.connection import ConnectionManager from stacker.util import create_route53_zone def create_domain(region, namespace, mappings, parameters, **kwargs): conn = ConnectionManager(region) try: domain = parameters['BaseDomain'] exc...
import logging logger = logging.getLogger(__name__) from aws_helper.connection import ConnectionManager from stacker.util import create_route53_zone def create_domain(region, namespace, mappings, parameters, **kwargs): conn = ConnectionManager(region) domain = kwargs.get('domain', parameters.get('BaseDoma...
Allow creation of domains without BaseDomain
Allow creation of domains without BaseDomain Gives the hook the ability to parse args.
Python
bsd-2-clause
mhahn/stacker,mhahn/stacker,federicobaldo/stacker,EnTeQuAk/stacker,remind101/stacker,remind101/stacker
--- +++ @@ -10,10 +10,9 @@ def create_domain(region, namespace, mappings, parameters, **kwargs): conn = ConnectionManager(region) - try: - domain = parameters['BaseDomain'] - except KeyError: - logger.error("BaseDomain parameter not provided.") + domain = kwargs.get('domain', parameters...
a01be482c81641624d77f0bfe32ad6f884996aed
pydaqmx_helper/getDeviceName.py
pydaqmx_helper/getDeviceName.py
from PyDAQmx.DAQmxFunctions import * def getDeviceName(): buffer = create_string_buffer(1024) # Buffer will break if too many devices, like 10 or 15, make number 100 bigger if you have to b = c_ulong(1024) DAQmxGetSysDevNames(buffer, b) return a.value.decode('utf-8').split(',')[-1].strip()
from PyDAQmx.DAQmxFunctions import * def getDeviceName(): buffer = create_string_buffer(1024) # Buffer will break if too many devices, like 10 or 15, make number 100 bigger if you have to b = c_ulong(1024) DAQmxGetSysDevNames(a, b) return a.value.decode('utf-8').split(',')[-1].strip()
Revert "Reassign a variable following previous commit"
Revert "Reassign a variable following previous commit" This reverts commit 5c963691d3af4cddb0e3090a709110573ac97f6a.
Python
mit
MarcoForte/PyDAQmx_Helper
--- +++ @@ -4,5 +4,5 @@ buffer = create_string_buffer(1024) # Buffer will break if too many devices, like 10 or 15, make number 100 bigger if you have to b = c_ulong(1024) - DAQmxGetSysDevNames(buffer, b) + DAQmxGetSysDevNames(a, b) return a.value.decode('utf-8').split(',')[-1].strip()
415d0bc36e509303242d32c5fc2f994346cbdb3c
pastas/version.py
pastas/version.py
# This is the only location where the version will be written and changed. # Based on https://packaging.python.org/single_source_version/ __version__ = '0.15.0'
# This is the only location where the version will be written and changed. # Based on https://packaging.python.org/single_source_version/ __version__ = '0.16.0b'
Update dev branch to 0.16.0b
Update dev branch to 0.16.0b
Python
mit
pastas/pasta,pastas/pastas
--- +++ @@ -1,3 +1,3 @@ # This is the only location where the version will be written and changed. # Based on https://packaging.python.org/single_source_version/ -__version__ = '0.15.0' +__version__ = '0.16.0b'
1f1699bb7b8cf537b8d2e206ac0ff03b74d5b3a7
container_files/init/mldb_finish.py
container_files/init/mldb_finish.py
#!/usr/bin/env python # Copyright Datacratic 2016 # Author: Jean Raby <jean@datacratic.com> # This script is called by runsv when the mldb service exits. # See http://smarden.org/runit/runsv.8.html for more details. # Two arguments are given to ./finish: # The first one is ./run's exit code, or -1 if ./run didn't exit...
#!/usr/bin/env python # Copyright Datacratic 2016 # Author: Jean Raby <jean@datacratic.com> # This script is called by runsv when the mldb service exits. # See http://smarden.org/runit/runsv.8.html for more details. # Two arguments are given to ./finish: # The first one is ./run's exit code, or -1 if ./run didn't exit...
Add signal map and human readable description
Add signal map and human readable description
Python
apache-2.0
mldbai/mldb,mldbai/mldb,mldbai/mldb,mldbai/mldb,mldbai/mldb,mldbai/mldb,mldbai/mldb
--- +++ @@ -14,13 +14,30 @@ import os import sys +sigmap = { 4: "SIGILL: illegal instruction - internal error", + 6: "SIGABRT: abort(3) called - internal error", + 9: "SIGKILL: killed from outside, did we run out of memory (OOM killed?)", + 11: "SIGSEGV: segfault - internal error", +...
cec8a1d5afa936ce7df5bae8b7cead9564ac7b97
youmap/views.py
youmap/views.py
from django.views.generic import TemplateView from chickpea.models import Map class Home(TemplateView): template_name = "youmap/home.html" list_template_name = "chickpea/map_list.html" def get_context_data(self, **kwargs): maps = Map.objects.order_by('-modified_at')[:100] return { ...
from django.views.generic import TemplateView from chickpea.models import Map class Home(TemplateView): template_name = "youmap/home.html" list_template_name = "chickpea/map_list.html" def get_context_data(self, **kwargs): maps = Map.objects.order_by('-pk')[:100] return { "ma...
Order by modified_at create problem with endless_navigation and browser cache
Order by modified_at create problem with endless_navigation and browser cache Need to handle cache properly before
Python
agpl-3.0
diraol/umap
--- +++ @@ -8,7 +8,7 @@ list_template_name = "chickpea/map_list.html" def get_context_data(self, **kwargs): - maps = Map.objects.order_by('-modified_at')[:100] + maps = Map.objects.order_by('-pk')[:100] return { "maps": maps }
b6052b35235a09f508aa75012badc830df8bcfa0
sethji/views/sync.py
sethji/views/sync.py
# -*- coding: utf-8 -*- # from sethji.model.sync import SyncAws from sethji.views.account import requires_login from flask import Blueprint, redirect, url_for, flash, request mod = Blueprint('sync', __name__, url_prefix='/sync') @mod.route("/", methods=["POST"]) @requires_login def sync(): sync_aws = SyncAws()...
# -*- coding: utf-8 -*- # from sethji.model.sync import SyncAws from sethji.views.account import requires_login from flask import Blueprint, redirect, url_for, flash mod = Blueprint('sync', __name__, url_prefix='/sync') @mod.route("/", methods=["POST"]) @requires_login def sync(): sync_aws = SyncAws() sync...
Revert "Redirect to same page"
Revert "Redirect to same page" This reverts commit 1f49ee31c21e1bebefb3be9ecc9e4df7c115a5ef.
Python
mit
rohit01/sethji,rohit01/sethji,rohit01/sethji
--- +++ @@ -3,7 +3,7 @@ from sethji.model.sync import SyncAws from sethji.views.account import requires_login -from flask import Blueprint, redirect, url_for, flash, request +from flask import Blueprint, redirect, url_for, flash mod = Blueprint('sync', __name__, url_prefix='/sync') @@ -15,7 +15,7 @@ syn...
fa8e30c2b41e8078ca87a73cc90c2652c46b1ee0
corvus/console.py
corvus/console.py
import sys from corvus.client import Corvus def main(): corvus = Corvus() corvus.init_drive() total_sectors = corvus.get_drive_capacity(1) with open("image.bin", "wb") as f: for i in range(total_sectors): orig_data = corvus.read_sector_512(1, i) corvus.write_sector_512(1...
import sys from corvus.client import Corvus def backup(corvus, filename): total_sectors = corvus.get_drive_capacity(1) with open(filename, "wb") as f: for i in range(total_sectors): data = corvus.read_sector_512(1, i) f.write(''.join([ chr(d) for d in data ])) sys.st...
Add backup and restore functions
Add backup and restore functions
Python
bsd-3-clause
mnaberez/corvus
--- +++ @@ -1,20 +1,32 @@ import sys from corvus.client import Corvus + +def backup(corvus, filename): + total_sectors = corvus.get_drive_capacity(1) + with open(filename, "wb") as f: + for i in range(total_sectors): + data = corvus.read_sector_512(1, i) + f.write(''.join([ chr(d)...
adb4e5bcf08dc8703cbd5dbd651e1fef3afbbbad
simphony/__init__.py
simphony/__init__.py
# -*- coding: utf-8 -*- """SimPhoNy: Simulation framework for multi-scale phenomena in micro- and nanosystems. SimPhoNy is an EU-project funded by the 7th Framework Programme (Project number 604005) under the call NMP.2013.1.4-1: "Development of an integrated multi-scale modelling environment for nanomaterials and ...
# -*- coding: utf-8 -*- """SimPhoNy: Simulation framework for multi-scale phenomena in micro- and nanosystems. SimPhoNy is an EU-project funded by the 7th Framework Programme (Project number 604005) under the call NMP.2013.1.4-1: "Development of an integrated multi-scale modelling environment for nanomaterials and ...
Add 2016 to copyright notice
Add 2016 to copyright notice
Python
bsd-2-clause
simphony/simphony-common
--- +++ @@ -10,6 +10,6 @@ For more information see: http://www.simphony-project.eu/. -:copyright: (c) 2014, 2015 SimPhoNy Consortium +:copyright: (c) 2014, 2015, 2016 SimPhoNy Consortium :license: BSD, see LICENSE for more details. """
cdcecaad78b8acf1c067c5eb631e6c3ae7167c2c
elasticsearch_dsl/__init__.py
elasticsearch_dsl/__init__.py
from .query import Q from .filter import F from .aggs import A from .function import SF from .search import Search from .field import * from .document import DocType from .mapping import Mapping from .index import Index from .analysis import analyzer, token_filter, char_filter, tokenizer VERSION = (0, 0, 4, 'dev') __v...
from .query import Q from .filter import F from .aggs import A from .function import SF from .search import Search from .field import * from .document import DocType, MetaField from .mapping import Mapping from .index import Index from .analysis import analyzer, token_filter, char_filter, tokenizer VERSION = (0, 0, 4,...
Include MetaField in things importable from root
Include MetaField in things importable from root
Python
apache-2.0
sangheestyle/elasticsearch-dsl-py,3lnc/elasticsearch-dsl-py,elastic/elasticsearch-dsl-py,harshmaur/elasticsearch-dsl-py,solarissmoke/elasticsearch-dsl-py,Quiri/elasticsearch-dsl-py,harshit298/elasticsearch-dsl-py,f-santos/elasticsearch-dsl-py,reflection/elasticsearch-dsl-py,REVLWorld/elasticsearch-dsl-py,ziky90/elastic...
--- +++ @@ -4,7 +4,7 @@ from .function import SF from .search import Search from .field import * -from .document import DocType +from .document import DocType, MetaField from .mapping import Mapping from .index import Index from .analysis import analyzer, token_filter, char_filter, tokenizer
eac383015161f661de33a94dae958a21761071dc
zeus/run.py
zeus/run.py
#!/usr/bin/env python """ run.py makes it easy to start Flask's built-in development webserver. To start a development server, ensure all the necessary packages are installed: (I suggest setting up a Virtualenv for this) $ pip install -r requirements.txt < ... > $ python run.py * Running on http://127.0.0.1:5000/ ...
#!/usr/bin/env python """ run.py makes it easy to start Flask's built-in development webserver. To start a development server, ensure all the necessary packages are installed: (I suggest setting up a Virtualenv for this) $ pip install -r requirements.txt < ... > $ python run.py * Running on http://127.0.0.1:5000/ ...
Move all api routes into /api/
Move all api routes into /api/
Python
bsd-2-clause
nbroeking/OPLabs,jrahm/OPLabs,jrahm/OPLabs,ZachAnders/OPLabs,nbroeking/OPLabs,ZachAnders/OPLabs,ZachAnders/OPLabs,nbroeking/OPLabs,ZachAnders/OPLabs,nbroeking/OPLabs,nbroeking/OPLabs,jrahm/OPLabs,jrahm/OPLabs,ZachAnders/OPLabs,nbroeking/OPLabs,jrahm/OPLabs,jrahm/OPLabs,ZachAnders/OPLabs
--- +++ @@ -21,7 +21,7 @@ import config from rest_api.controller import rest_blueprint -app.register_blueprint(rest_blueprint) +app.register_blueprint(rest_blueprint, url_prefix="/api") if __name__ == "__main__": app.run()
b0231d8d8832559a2e5382c3e0ad47e6d6232761
src/oscar/apps/offer/signals.py
src/oscar/apps/offer/signals.py
from django.db.models.signals import post_delete from django.dispatch import receiver from oscar.core.loading import get_model ConditionalOffer = get_model('offer', 'ConditionalOffer') Condition = get_model('offer', 'Condition') Benefit = get_model('offer', 'Benefit') @receiver(post_delete, sender=ConditionalOffer)...
from django.db.models.signals import post_delete from django.dispatch import receiver from oscar.core.loading import get_model ConditionalOffer = get_model('offer', 'ConditionalOffer') Condition = get_model('offer', 'Condition') Benefit = get_model('offer', 'Benefit') @receiver(post_delete, sender=ConditionalOffer)...
Rename offer signal to remove unused conditions/benefits
Rename offer signal to remove unused conditions/benefits
Python
bsd-3-clause
sasha0/django-oscar,sasha0/django-oscar,sasha0/django-oscar,solarissmoke/django-oscar,solarissmoke/django-oscar,sonofatailor/django-oscar,django-oscar/django-oscar,solarissmoke/django-oscar,sasha0/django-oscar,sonofatailor/django-oscar,django-oscar/django-oscar,django-oscar/django-oscar,sonofatailor/django-oscar,solari...
--- +++ @@ -9,7 +9,7 @@ @receiver(post_delete, sender=ConditionalOffer) -def delete_related_useless_conditions_and_benefits(instance, **kwargs): +def delete_unused_related_conditions_and_benefits(instance, **kwargs): offer = instance # the object is no longer in the database condition_id = offer.con...
dda35a476f81be0deb67c1a45320d17dc927788b
smile_base/models/ir_config_parameter.py
smile_base/models/ir_config_parameter.py
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 Smile (<http://www.smile.fr>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 Smile (<http://www.smile.fr>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
Allow to override any config parameter via config file
[IMP] Allow to override any config parameter via config file
Python
agpl-3.0
chadyred/odoo_addons,chadyred/odoo_addons,ovnicraft/odoo_addons,bmya/odoo_addons,chadyred/odoo_addons,odoocn/odoo_addons,tiexinliu/odoo_addons,bmya/odoo_addons,odoocn/odoo_addons,ovnicraft/odoo_addons,tiexinliu/odoo_addons,ovnicraft/odoo_addons,odoocn/odoo_addons,tiexinliu/odoo_addons,bmya/odoo_addons
--- +++ @@ -27,8 +27,6 @@ @api.model def get_param(self, key, default=False): - if key == 'server.environment': - return tools.config.get('server.environment') or default - if key == 'max_upload_size': - return tools.config.get('max_upload_size') or default + if ...
a12ea60be17dabf837984e03162ebff152f0fd21
examples/project_one/input.py
examples/project_one/input.py
def read_file(filename): # Open the file file_obj = open(filename) # Iterate over lines in the file for line in file_obj: # Split line by spaces (creates a list) # Alternatives: split(',') numbers = line.split() if len(numbers) != 2: # Convert strings to nu...
def read_file(filename): # Open the file file_obj = open(filename) # Iterate over lines in the file for line in file_obj: # Split line by spaces (creates a list) # Alternatives: split(',') numbers = line.split() if len(numbers) != 2: # Convert strings to nu...
Use map for smarter iteration.
Use map for smarter iteration.
Python
mit
dokterbob/slf-programming-workshops,dokterbob/slf-programming-workshops,dokterbob/slf-programming-workshops,dokterbob/slf-programming-workshops
--- +++ @@ -12,17 +12,9 @@ if len(numbers) != 2: # Convert strings to numbers - numbers2 = [] - for number in numbers: - # Convert number to float - number = float(number) - - # Append to temperary list - numbers...
48da784fbf74d47f22f2527695b2d9de1528a484
flow_workflow/commands/submit_workflow.py
flow_workflow/commands/submit_workflow.py
from flow_workflow.commands.launch_base import LaunchWorkflowCommandBase from flow.configuration.inject.broker import BrokerConfiguration from flow.configuration.inject.redis_conf import RedisConfiguration from flow.configuration.inject.service_locator import ServiceLocatorConfiguration from twisted.internet import def...
from flow_workflow.commands.launch_base import LaunchWorkflowCommandBase from flow.configuration.inject.broker import BrokerConfiguration from flow.configuration.inject.redis_conf import RedisConfiguration from flow.configuration.inject.service_locator import ServiceLocatorConfiguration from twisted.internet import def...
Make submit workflow's local_workflow be False
Make submit workflow's local_workflow be False
Python
agpl-3.0
genome/flow-workflow,genome/flow-workflow,genome/flow-workflow
--- +++ @@ -12,7 +12,7 @@ ServiceLocatorConfiguration, ] - local_workflow = True + local_workflow = False def setup_services(self, net): pass
9f3f9229718694570d7b56fe6cd63478f59f0de5
us_ignite/common/tests/utils.py
us_ignite/common/tests/utils.py
from django.core.urlresolvers import reverse from django.contrib.messages.storage.base import BaseStorage, Message def get_login_url(url): """Returns an expected login URL.""" return ('%s?next=%s' % (reverse('auth_login'), url)) class TestMessagesBackend(BaseStorage): """ When unit testing a django ...
from django.contrib.auth.models import User, AnonymousUser from django.core.urlresolvers import reverse from django.contrib.messages.storage.base import BaseStorage, Message from django.test import client from mock import Mock def get_login_url(url): """Returns an expected login URL.""" return ('%s?next=%s'...
Add utilities to generate request doubles.
Add utilities to generate request doubles. The new ``get_request`` function is a helper used to generate request doubles the first argument is the ``method``, an optional user can be attached to the request.
Python
bsd-3-clause
us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite
--- +++ @@ -1,10 +1,38 @@ +from django.contrib.auth.models import User, AnonymousUser from django.core.urlresolvers import reverse from django.contrib.messages.storage.base import BaseStorage, Message + +from django.test import client + +from mock import Mock def get_login_url(url): """Returns an expected...
38221a3d8df945981f9595842871b5dae6a68c0f
user_management/models/tests/factories.py
user_management/models/tests/factories.py
import factory from django.contrib.auth import get_user_model class UserFactory(factory.DjangoModelFactory): FACTORY_FOR = get_user_model() name = factory.Sequence(lambda i: 'Test User {}'.format(i)) email = factory.Sequence(lambda i: 'email{}@example.com'.format(i)) password = factory.PostGeneration...
import factory from django.contrib.auth import get_user_model class UserFactory(factory.DjangoModelFactory): FACTORY_FOR = get_user_model() name = factory.Sequence(lambda i: 'Test User {}'.format(i)) email = factory.Sequence(lambda i: 'email{}@example.com'.format(i)) is_active = True @factory.po...
Add raw_password to Users in tests
Add raw_password to Users in tests
Python
bsd-2-clause
incuna/django-user-management,incuna/django-user-management
--- +++ @@ -7,4 +7,11 @@ FACTORY_FOR = get_user_model() name = factory.Sequence(lambda i: 'Test User {}'.format(i)) email = factory.Sequence(lambda i: 'email{}@example.com'.format(i)) - password = factory.PostGenerationMethodCall('set_password', None) + is_active = True + + @factory.post_gener...
39d377c462ac031203877a2c13df79be41c68585
tests/fileutils-tests.py
tests/fileutils-tests.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest from nose.tools import raises from spec_cleaner.fileutils import FileUtils from spec_cleaner import RpmException class TestFileutils(unittest.TestCase): """ We run few tests to ensure fileutils class works fine """ def setUp(self): ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest from nose.tools import raises from spec_cleaner.fileutils import FileUtils from spec_cleaner import RpmException class TestFileutils(unittest.TestCase): """ We run few tests to ensure fileutils class works fine """ def setUp(self): ...
Fix variable in testcase from previous commit change
Fix variable in testcase from previous commit change
Python
bsd-3-clause
plusky/spec-cleaner,plusky/spec-cleaner,plusky/spec-cleaner,plusky/spec-cleaner,plusky/spec-cleaner
--- +++ @@ -30,9 +30,9 @@ def test_open(self): self.fileutils.open('tests/fileutils-tests.py', 'r') self.fileutils.close() - self.assertEqual(None, self.fileutils._file) + self.assertEqual(None, self.fileutils.f) def test_open_datafile(self): self.fileutils.open_da...
cbaab510c92566ffdcc7eb65af0ec9cf1320f173
recipes/webrtc.py
recipes/webrtc.py
# Copyright (c) 2014 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 sys import recipe_util # pylint: disable=F0401 # This class doesn't need an __init__ method, so we disable the warning # pylint: disable=W0232...
# Copyright (c) 2014 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 sys import recipe_util # pylint: disable=F0401 # This class doesn't need an __init__ method, so we disable the warning # pylint: disable=W0232...
Switch WebRTC recipe to Git.
Switch WebRTC recipe to Git. BUG=412012 Review URL: https://codereview.chromium.org/765373002 git-svn-id: bd64dd6fa6f3f0ed0c0666d1018379882b742947@294546 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Python
bsd-3-clause
svn2github/chromium-depot-tools,svn2github/chromium-depot-tools,svn2github/chromium-depot-tools
--- +++ @@ -26,7 +26,6 @@ 'safesync_url': '', }, ], - 'auto': True, # Runs git auto-svn as a part of the fetch. 'with_branch_heads': True, } @@ -34,8 +33,8 @@ spec['target_os'] = props['target_os'].split(',') return { - 'type': 'gclient_git_svn', - ...
54ab41cb8c30ddd46154f23e89947286222616e1
raven/__init__.py
raven/__init__.py
""" raven ~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ __all__ = ('VERSION', 'Client', 'load') try: VERSION = __import__('pkg_resources') \ .get_distribution('raven').version except Exception as e: VERSION = 'unknow...
""" raven ~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import os import os.path from raven.base import * # NOQA from raven.conf import * # NOQA __all__ = ('VERSION', 'Client', 'load', 'get_version') try: VERSION = __import...
Add git sha to version if available
Add git sha to version if available
Python
bsd-3-clause
getsentry/raven-python,icereval/raven-python,inspirehep/raven-python,inspirehep/raven-python,dbravender/raven-python,hzy/raven-python,getsentry/raven-python,jmagnusson/raven-python,Goldmund-Wyldebeast-Wunderliebe/raven-python,icereval/raven-python,ewdurbin/raven-python,smarkets/raven-python,johansteffner/raven-python,j...
--- +++ @@ -6,7 +6,14 @@ :license: BSD, see LICENSE for more details. """ -__all__ = ('VERSION', 'Client', 'load') + +import os +import os.path +from raven.base import * # NOQA +from raven.conf import * # NOQA + + +__all__ = ('VERSION', 'Client', 'load', 'get_version') try: VERSION = __import__('pkg_res...
b58caeae59a5ab363b4b6b40cbd19004b40dd206
calvin/actorstore/systemactors/sensor/Distance.py
calvin/actorstore/systemactors/sensor/Distance.py
# -*- coding: utf-8 -*- # Copyright (c) 2015 Ericsson AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
# -*- coding: utf-8 -*- # Copyright (c) 2015 Ericsson AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
Fix a bug where periodic timers weren't removed when application was stopped. FIXME: Check up on the semantics of will/did_start, will_migrate, did_migrate, will_stop.
Fix a bug where periodic timers weren't removed when application was stopped. FIXME: Check up on the semantics of will/did_start, will_migrate, did_migrate, will_stop.
Python
apache-2.0
EricssonResearch/calvin-base,EricssonResearch/calvin-base,EricssonResearch/calvin-base,EricssonResearch/calvin-base
--- +++ @@ -41,6 +41,10 @@ def did_migrate(self): self.setup() + def will_end(self): + self['distance'].stop() + + @stateguard(lambda self: self['distance'].has_data()) @condition([], ['meters']) def measure(self):
3f88f20a8855dd38ef53b270621d15bf0df4d62c
scavenger/main.py
scavenger/main.py
import logging from time import time, sleep from .net_utils import * logger = logging.getLogger(__name__) def target_scaner(interface, min_interval=30): old_peers = {} while True: begin_time = time() peers = {} for ip, mac in arp_scaner(): peers[ip] = mac if ip...
import logging from time import time, sleep from .net_utils import * logger = logging.getLogger(__name__) logging.basicConfig(level=logging.INFO) def target_scaner(interface, min_interval=30): old_peers = {} while True: begin_time = time() peers = {} for ip, mac in arp_scaner(): ...
Set logging level to INFO
Set logging level to INFO
Python
mit
ThomasLee969/scavenger
--- +++ @@ -4,6 +4,7 @@ from .net_utils import * logger = logging.getLogger(__name__) +logging.basicConfig(level=logging.INFO) def target_scaner(interface, min_interval=30): old_peers = {}
f48cb4fd946c8fa4b6157b8e1ea9ad8b385bc67a
src/hades/bin/generate_config.py
src/hades/bin/generate_config.py
import os import sys from hades import constants from hades.common.cli import ArgumentParser, parser as common_parser from hades.config.generate import ConfigGenerator from hades.config.loader import load_config def main(): parser = ArgumentParser(parents=[common_parser]) parser.add_argument(dest='source', m...
import logging import os import sys from hades import constants from hades.common.cli import ArgumentParser, parser as common_parser from hades.config.generate import ConfigGenerator from hades.config.loader import load_config logger = logging.getLogger() def main(): parser = ArgumentParser(parents=[common_pars...
Use logger for hades-generate-config error messages
Use logger for hades-generate-config error messages
Python
mit
agdsn/hades,agdsn/hades,agdsn/hades,agdsn/hades,agdsn/hades
--- +++ @@ -1,3 +1,4 @@ +import logging import os import sys @@ -5,6 +6,8 @@ from hades.common.cli import ArgumentParser, parser as common_parser from hades.config.generate import ConfigGenerator from hades.config.loader import load_config + +logger = logging.getLogger() def main(): @@ -28,9 +31,8 @@ ...
295200dba8569a7a667de46a13c6e36ca757f5d5
quickstart/python/understand/example-2/create_joke_intent.6.x.py
quickstart/python/understand/example-2/create_joke_intent.6.x.py
# Download the helper library from https://www.twilio.com/docs/python/install from twilio.rest import Client # Your Account Sid and Auth Token from twilio.com/console account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' auth_token = 'your_auth_token' client = Client(account_sid, auth_token) # Create a new intent named ...
# Download the helper library from https://www.twilio.com/docs/python/install from twilio.rest import Client # Your Account Sid and Auth Token from twilio.com/console account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' auth_token = 'your_auth_token' client = Client(account_sid, auth_token) # Create a new task named 't...
Update console link, intent-->task in comments
Update console link, intent-->task in comments
Python
mit
TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets
--- +++ @@ -6,21 +6,21 @@ auth_token = 'your_auth_token' client = Client(account_sid, auth_token) -# Create a new intent named 'tell_a_joke' -# Replace 'UAXXX...' with your Assistant's unique SID https://www.twilio.com/console/assistant/list +# Create a new task named 'tell_a_joke' +# Replace 'UAXXX...' with your...
3df59e18a98be4da2ca2ed2d40a869d65696fe9b
src/helpers/utils.py
src/helpers/utils.py
from __future__ import unicode_literals from config import settings import os import re import string import pytz def clear_screen(): # Clear screen os.system(['clear', 'cls'][os.name == 'nt']) def print_obj(obj): for attr, val in obj.__dict__.iteritems(): print "{0}: {1}".format(attr, val) d...
from __future__ import unicode_literals from config import settings import os import re import string import pytz def clear_screen(): # Clear screen os.system(['clear', 'cls'][os.name == 'nt']) def print_obj(obj): for attr, val in obj.__dict__.iteritems(): print "{0}: {1}".format(attr, val) d...
Fix error in delta_minutes, use timedelta.total_seconds()/60 instead of timedelta.seconds/60.
Fix error in delta_minutes, use timedelta.total_seconds()/60 instead of timedelta.seconds/60.
Python
mit
lesh1k/VKStalk
--- +++ @@ -48,5 +48,5 @@ def delta_minutes(now, before): delta_datetime = now - before - minutes_ago = delta_datetime.seconds / 60 + minutes_ago = delta_datetime.total_seconds() / 60 return minutes_ago
e7962ec34a86fe464862ab81ec8cc8da14a732f6
models/weather.py
models/weather.py
from configparser import ConfigParser from googletrans import Translator import pyowm import logging import re logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO) logger = logging.getLogger(__name__) cfg = ConfigParser() cfg.read('config') api_key = cfg.get('auth', 'o...
from configparser import ConfigParser from googletrans import Translator import pyowm import logging import re logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO) logger = logging.getLogger(__name__) cfg = ConfigParser() cfg.read('config') api_key = cfg.get('auth', 'o...
Add Info to Weather Check
Add Info to Weather Check Add current weather status to weather check features.
Python
mit
iGene/igene_bot
--- +++ @@ -21,6 +21,6 @@ obs = owm.weather_at_place(trans) w = obs.get_weather() update.message.reply_text(location+'的天氣\n'+'溫度:'+str(w.get_temperature(unit='celsius')['temp'])+ - ' 濕度:'+str(w.get_humidity())) + ' 濕度:'+str(w.get_humidity())+' 天氣狀況:'+str(...
6cdb6ada40f28ecc7629ecdb5dd67c06f6013e88
router_monitor.py
router_monitor.py
import schedule, time, os, sys, urllib2, base64 from datetime import datetime def check_connection(): sys.stdout.write(datetime.now().strftime("%Y-%m-%d %H:%M:%S") + " Connection") hostname = "google.com" response = os.system("ping -c 1 " + hostname + " > /dev/null") if response == 0: print " is up" else: prin...
# python -u router_monitor.py >> router_log.txt 2>&1 & import schedule, time, os, sys, urllib2, base64 from datetime import datetime def check_connection(): sys.stdout.write(datetime.now().strftime("%Y-%m-%d %H:%M:%S") + " Connection") hostname = "google.com" response = os.system("ping -c 1 " + hostname + " > /dev/n...
Add usage comment and remove python version
Add usage comment and remove python version
Python
mit
danic85/router_monitor
--- +++ @@ -1,3 +1,4 @@ +# python -u router_monitor.py >> router_log.txt 2>&1 & import schedule, time, os, sys, urllib2, base64 from datetime import datetime def check_connection(): @@ -15,7 +16,6 @@ request.add_header("Authorization", "Basic %s" % base) result = urllib2.urlopen(request) -print sys.version ...
779639680e02fb4de920a95558eceecc2a55ab46
indra/bel/ndex_client.py
indra/bel/ndex_client.py
import requests import json import time #ndex_base_url = 'http://services.bigmech.ndexbio.org' ndex_base_url = 'http://52.37.175.128' def send_request(url_suffix, params): res = requests.post(ndex_base_url + url_suffix, data=json.dumps(params)) res_json = get_result(res) return res_json def get_result(re...
import requests import json import time ndex_base_url = 'http://general.bigmech.ndexbio.org:8082' #ndex_base_url = 'http://52.37.175.128' def send_request(url_suffix, params): res = requests.post(ndex_base_url + url_suffix, data=json.dumps(params)) res_json = get_result(res) return res_json def get_resul...
Add new URL for NDEx service
Add new URL for NDEx service
Python
bsd-2-clause
jmuhlich/indra,johnbachman/belpy,sorgerlab/indra,jmuhlich/indra,sorgerlab/belpy,bgyori/indra,johnbachman/indra,johnbachman/belpy,johnbachman/belpy,pvtodorov/indra,sorgerlab/belpy,pvtodorov/indra,sorgerlab/belpy,johnbachman/indra,sorgerlab/indra,bgyori/indra,johnbachman/indra,sorgerlab/indra,pvtodorov/indra,jmuhlich/ind...
--- +++ @@ -2,8 +2,8 @@ import json import time -#ndex_base_url = 'http://services.bigmech.ndexbio.org' -ndex_base_url = 'http://52.37.175.128' +ndex_base_url = 'http://general.bigmech.ndexbio.org:8082' +#ndex_base_url = 'http://52.37.175.128' def send_request(url_suffix, params): res = requests.post(ndex...
a2005d98cd81424a2a43277cae0595806751e9dc
swh/web/ui/controller/service.py
swh/web/ui/controller/service.py
# Copyright (C) 2015 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information from swh.web.ui.back import http, api_query from swh.core.json import SW...
# Copyright (C) 2015 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information from swh.web.ui.back import http, api_query from swh.core.json import SW...
Refactor - Simplify the call to api
Refactor - Simplify the call to api
Python
agpl-3.0
SoftwareHeritage/swh-web-ui,SoftwareHeritage/swh-web-ui,SoftwareHeritage/swh-web-ui
--- +++ @@ -26,12 +26,7 @@ def unserialize_result(res): if res.ok: output = res.content.decode('utf-8') - if output: - h_res = json.loads(output, cls=SWHJSONDecoder) - if h_res: - return h_res['found'] - return None ...
3db5c62d116399a0b26e8c68d3e4274d5a6bd17b
django_makemessages_xgettext/management/commands/makemessagesxgettext.py
django_makemessages_xgettext/management/commands/makemessagesxgettext.py
import django if django.get_version().startswith("1.8"): from django_makemessages_xgettext import django18_makemessagesxgettext Command = django18_makemessagesxgettext.Command else: from django_makemessages_xgettext import django17_makemessagesxgettext Command = django17_makemessagesxgettext.Command
import django if django.get_version().startswith("1.7"): from django_makemessages_xgettext import django17_makemessagesxgettext Command = django17_makemessagesxgettext.Command else: from django_makemessages_xgettext import django18_makemessagesxgettext Command = django18_makemessagesxgettext.Command
Support for django 1.9 and beyond!
Support for django 1.9 and beyond!
Python
bsd-3-clause
resulto-admin/django-makemessages-xgettext
--- +++ @@ -1,9 +1,8 @@ import django -if django.get_version().startswith("1.8"): +if django.get_version().startswith("1.7"): + from django_makemessages_xgettext import django17_makemessagesxgettext + Command = django17_makemessagesxgettext.Command +else: from django_makemessages_xgettext import django1...
50926966919fa5cf140e3f30815f86c93189cc49
percy/utils.py
percy/utils.py
from __future__ import print_function import sys import hashlib import base64 def print_error(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def to_unicode(content): # TODO: considering using the 'six' library for this, for now just do something simple. if sys.version_info >= (3,0): ret...
from __future__ import print_function import sys import hashlib import base64 def print_error(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def to_unicode(content): # TODO: considering using the 'six' library for this, for now just do something simple. if sys.version_info >= (3,0): ret...
Return serializable string from base64encode.
Return serializable string from base64encode.
Python
mit
percy/python-percy-client
--- +++ @@ -21,7 +21,7 @@ def base64encode(content): if _is_unicode(content): content = content.encode('utf-8') - return base64.b64encode(content) + return to_unicode(base64.b64encode(content)) def _is_unicode(content): if (sys.version_info >= (3,0) and isinstance(content, str)
c20fd19d10a77cda0c16fd5a4fa329a43933751f
src/commoner/profiles/models.py
src/commoner/profiles/models.py
from django.db import models from django.db.models import permalink from django.contrib.auth.models import User class Content(models.Model): commoner = models.ForeignKey(User) title = models.CharField(max_length=255, blank=True) url = models.URLField(max_length=255, blank=False) def __unicode__(self...
import urlparse from django.db import models from django.db.models import permalink from django.core.urlresolvers import reverse from django.contrib.auth.models import User from commoner.util import getBaseURL class Content(models.Model): commoner = models.ForeignKey(User) title = models.CharField(max_leng...
Support generating a completely absolute URL for the profile; added a display_name method to the Profile model.
Support generating a completely absolute URL for the profile; added a display_name method to the Profile model.
Python
agpl-3.0
cc-archive/commoner,cc-archive/commoner
--- +++ @@ -1,6 +1,11 @@ +import urlparse + from django.db import models from django.db.models import permalink +from django.core.urlresolvers import reverse from django.contrib.auth.models import User + +from commoner.util import getBaseURL class Content(models.Model): @@ -29,7 +34,16 @@ return ...
24e2e391dece37c245d8a459456f3e30cd2346a8
openxc/vehicle.py
openxc/vehicle.py
from .measurements import Measurement from .sinks.base import MeasurementNotifierSink class Vehicle(object): def __init__(self, source=None): self.sources = set() self.sinks = set() self.measurements = {} self.add_source(source) self.notifier = MeasurementNotifierSink() ...
from .measurements import Measurement from .sinks.base import MeasurementNotifierSink class Vehicle(object): def __init__(self, interface=None): self.sources = set() self.sinks = set() self.measurements = {} if interface is not None: self.add_source(interface) ...
Change constructor of Vehicle to accept an Interface instead of just Source.
Change constructor of Vehicle to accept an Interface instead of just Source.
Python
bsd-3-clause
openxc/openxc-python,openxc/openxc-python,openxc/openxc-python
--- +++ @@ -3,11 +3,14 @@ class Vehicle(object): - def __init__(self, source=None): + def __init__(self, interface=None): self.sources = set() self.sinks = set() self.measurements = {} - self.add_source(source) + + if interface is not None: + self.add_sou...
ffd429281ed6695457304646467a6d9e0a0301a4
src/nyc_trees/apps/core/tasks.py
src/nyc_trees/apps/core/tasks.py
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from celery import task from django.core.files.storage import default_storage @task(bind=True, max_retries=15, default_retry_delay=2) def wait_...
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from celery import task from django.core.files.storage import default_storage @task(bind=True, max_retries=15, default_retry_delay=2) def wait_...
Send RSVP email even if PDF doesn't exist
Send RSVP email even if PDF doesn't exist If the PDF can't be found on the disk after the maximum number of retries, return None, instead of raising an exception. This ensures that the RSVP email notification still sends even without the PDF attachment. Refs #1655
Python
agpl-3.0
azavea/nyc-trees,maurizi/nyc-trees,kdeloach/nyc-trees,azavea/nyc-trees,kdeloach/nyc-trees,azavea/nyc-trees,maurizi/nyc-trees,kdeloach/nyc-trees,kdeloach/nyc-trees,maurizi/nyc-trees,azavea/nyc-trees,kdeloach/nyc-trees,maurizi/nyc-trees,azavea/nyc-trees
--- +++ @@ -13,5 +13,7 @@ def wait_for_default_storage_file(self, filename): if default_storage.exists(filename): return filename + elif self.request.retries < self.max_retries: + self.retry() else: - self.retry() + return None
3bad6c23fad5525628db1c3c1b99f3f86c08db63
cloudmeta/apps/metadata/models.py
cloudmeta/apps/metadata/models.py
from django.db import models KEYTYPE_CHOICES = ( ('RSA', 'ssh-rsa'), ('DSA', 'ssh-dsa'), ('ECC-256', 'ecdsa-sha2-nistp256'), ('ECC-521', 'ecdsa-sha2-nistp521'), ) class Node(models.Model): name = models.CharField(unique=True, primary_key=True, max_length=256) hostname = models.CharField(blank=...
from django.db import models KEYTYPE_CHOICES = ( ('RSA', 'ssh-rsa'), ('DSA', 'ssh-dsa'), ('ECC-256', 'ecdsa-sha2-nistp256'), ('ECC-384', 'ecdsa-sha2-nistp384'), ('ECC-521', 'ecdsa-sha2-nistp521'), ) class Node(models.Model): name = models.CharField(unique=True, primary_key=True, max_length=256...
Allow ecdsa 384 bit keys too
Allow ecdsa 384 bit keys too
Python
agpl-3.0
bencord0/cloudmeta,bencord0/cloudmeta
--- +++ @@ -4,6 +4,7 @@ ('RSA', 'ssh-rsa'), ('DSA', 'ssh-dsa'), ('ECC-256', 'ecdsa-sha2-nistp256'), + ('ECC-384', 'ecdsa-sha2-nistp384'), ('ECC-521', 'ecdsa-sha2-nistp521'), )
6932164f20ced80ff6d08402b84aba954a983e2d
iota/commands/extended/get_transaction_objects.py
iota/commands/extended/get_transaction_objects.py
# coding=utf-8 from __future__ import absolute_import, division, print_function, \ unicode_literals from typing import Iterable, List, Optional import filters as f from iota import Transaction, TransactionHash from iota.commands.core import GetTrytesCommand from iota.commands import FilterCommand, RequestFilter ...
# coding=utf-8 from __future__ import absolute_import, division, print_function, \ unicode_literals from typing import Iterable, List, Optional import filters as f from iota import Transaction, TransactionHash from iota.commands.core import GetTrytesCommand from iota.commands import FilterCommand, RequestFilter ...
Use filter macro for request validation
Use filter macro for request validation StringifiedTrytesArray(Type) filter macro was introduced in #243. Becasue of this, no request filter test case is needed, hence the macro is covered already in other test cases.
Python
mit
iotaledger/iota.lib.py
--- +++ @@ -9,7 +9,7 @@ from iota import Transaction, TransactionHash from iota.commands.core import GetTrytesCommand from iota.commands import FilterCommand, RequestFilter -from iota.filters import Trytes +from iota.filters import StringifiedTrytesArray __all__ = [ 'GetTransactionObjectsCommand', @@ -20,7...
0a0ebdde63628d9504ac9834ef20b996ab595d7d
stock_quant_package_product_packaging/models/stock_move_line.py
stock_quant_package_product_packaging/models/stock_move_line.py
# Copyright 2019 Camptocamp SA # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) from odoo import models class StockMoveLine(models.Model): _inherit = "stock.move.line" def _action_done(self): res = super()._action_done() for line in self.filtered(lambda l: l.result_package_id):...
# Copyright 2019 Camptocamp SA # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) from odoo import models class StockMoveLine(models.Model): _inherit = "stock.move.line" def _action_done(self): res = super()._action_done() # _action_done in stock module sometimes delete a move li...
Fix "record does not exist" when validating move line
Fix "record does not exist" when validating move line When _action_done is called on a transfer, it may delete a part of the move lines. The extension of `_action_done()` that assigns a packaging fails with "Record does not exist or has been deleted". Check if the if lines still exist before writing on them.
Python
agpl-3.0
BT-ojossen/stock-logistics-workflow,OCA/stock-logistics-workflow,BT-ojossen/stock-logistics-workflow,OCA/stock-logistics-workflow
--- +++ @@ -8,6 +8,8 @@ def _action_done(self): res = super()._action_done() - for line in self.filtered(lambda l: l.result_package_id): + # _action_done in stock module sometimes delete a move line, we + # have to check if it still exists before reading/writing on it + for...
92d0a09cfb232270d04f82eccc451ee63bd7901a
dev/TOPSECRET/SirBot/lib/sirbot/shutdown.py
dev/TOPSECRET/SirBot/lib/sirbot/shutdown.py
# -*- coding: utf-8 -*- #script containing all pertinent tasks to prepare for software termination. #successful completion of this process at last runtime, will skip extra validation #steps on next run from json import dumps def shutdown(config,interinput=None,interoutput=None): #check for lingering runtime erro...
# -*- coding: utf-8 -*- #script containing all pertinent tasks to prepare for software termination. #successful completion of this process at last runtime, will skip extra validation #steps on next run def shutdown(config,interinput,interoutput): #check for lingering runtime errors #finishing writing log queu...
Revert "changes to config during runtime are now saved"
Revert "changes to config during runtime are now saved" This reverts commit e09a780da17bb2f97d20aafc2c007fe3fc3051bb.
Python
mit
SirRujak/SirBot
--- +++ @@ -4,19 +4,10 @@ #successful completion of this process at last runtime, will skip extra validation #steps on next run -from json import dumps - -def shutdown(config,interinput=None,interoutput=None): +def shutdown(config,interinput,interoutput): #check for lingering runtime errors #finishing w...
84af16cb5c6938fad4a10d248ec6e1ff20ec2306
neupy/__init__.py
neupy/__init__.py
""" NeuPy is the Artificial Neural Network library implemented in Python. """ __version__ = '0.2.2'
""" NeuPy is the Artificial Neural Network library implemented in Python. """ __version__ = '0.3.0dev1'
Set up version 0.3.0 dev 1.
Set up version 0.3.0 dev 1.
Python
mit
itdxer/neupy,itdxer/neupy,itdxer/neupy,itdxer/neupy
--- +++ @@ -3,4 +3,4 @@ """ -__version__ = '0.2.2' +__version__ = '0.3.0dev1'
411813bafe4b2af57aa7695f035e3e02b20ae85e
src/syntax/infix_coordination.py
src/syntax/infix_coordination.py
__author__ = 's7a' # All imports from nltk.tree import Tree # The infix coordination class class InfixCoordination: # Constructor for the infix coordination def __init__(self): self.has_infix_coordination = False self.result_string = "" # Break the tree def break_tree(self, tree): ...
__author__ = 's7a' # All imports from nltk.tree import Tree # The infix coordination class class InfixCoordination: # Constructor for the infix coordination def __init__(self): self.has_infix_coordination = False # Break the tree def break_tree(self, tree): self.has_infix_coordinati...
Change the rules for infix coordinario
Change the rules for infix coordinario
Python
mit
Somsubhra/Simplify,Somsubhra/Simplify,Somsubhra/Simplify
--- +++ @@ -10,27 +10,21 @@ # Constructor for the infix coordination def __init__(self): self.has_infix_coordination = False - self.result_string = "" # Break the tree def break_tree(self, tree): - t = Tree.fromstring(str(tree)) - self.has_infix_coordination = Fal...
b154eef7d36359d0fbcc11a165371d3a54f40682
libtbx_refresh.py
libtbx_refresh.py
from __future__ import division def run(): from dials.util.config import CompletionGenerator gen = CompletionGenerator() gen.generate() try: run() except Exception, e: pass
from __future__ import division def run(): from dials.util.config import CompletionGenerator gen = CompletionGenerator() gen.generate() try: run() except Exception, e: pass try: from glob import glob import os filenames = glob("extensions/*.pyc") if len(filenames) > 0: print "Cleaning up 'dials...
Delete *.pyc files from dials/extensions when doing libtbx.refresh
Delete *.pyc files from dials/extensions when doing libtbx.refresh
Python
bsd-3-clause
dials/dials,dials/dials,dials/dials,dials/dials,dials/dials
--- +++ @@ -9,3 +9,15 @@ run() except Exception, e: pass + +try: + from glob import glob + import os + filenames = glob("extensions/*.pyc") + if len(filenames) > 0: + print "Cleaning up 'dials/extensions':" + for filename in glob("extensions/*.pyc"): + print " Deleting %s" % filename + os.r...
89454b1e83e01a4d523b776f74429a81467762da
redis/utils.py
redis/utils.py
try: import hiredis HIREDIS_AVAILABLE = True except ImportError: HIREDIS_AVAILABLE = False def from_url(url, db=None, **kwargs): """ Returns an active Redis client generated from the given database URL. Will attempt to extract the database id from the path url fragment, if none is provide...
from contextlib import contextmanager try: import hiredis HIREDIS_AVAILABLE = True except ImportError: HIREDIS_AVAILABLE = False def from_url(url, db=None, **kwargs): """ Returns an active Redis client generated from the given database URL. Will attempt to extract the database id from the p...
Move import statement on top for PEP8 compliancy.
Move import statement on top for PEP8 compliancy.
Python
mit
MegaByte875/redis-py,fengshao0907/redis-py,sigma-random/redis-py,sunminghong/redis-py,garnertb/redis-py,softliumin/redis-py,sirk390/redis-py,barseghyanartur/redis-py,zhangyancoder/redis-py,LTD-Beget/redis-py,boyxuper/redis-py,barseghyanartur/redis-py,dmugtasimov/redis-py,LTD-Beget/redis-py,yuruidong/redis-py,sigma-rand...
--- +++ @@ -1,3 +1,6 @@ +from contextlib import contextmanager + + try: import hiredis HIREDIS_AVAILABLE = True @@ -16,7 +19,6 @@ return Redis.from_url(url, db, **kwargs) -from contextlib import contextmanager @contextmanager def pipeline(redis_obj): p = redis_obj.pipeline()
a42ffdcd34876bcd1df81ce00dbfd6426580bd82
gaphor/UML/classes/copypaste.py
gaphor/UML/classes/copypaste.py
import itertools from gaphor.diagram.copypaste import copy, copy_named_element from gaphor.UML import Association, Class, Interface, Operation @copy.register(Class) @copy.register(Interface) def copy_class(element): yield element.id, copy_named_element(element) for feature in itertools.chain( element...
import itertools from gaphor.diagram.copypaste import copy, copy_named_element from gaphor.UML import Association, Class, Enumeration, Interface, Operation @copy.register(Class) @copy.register(Interface) def copy_class(element): yield element.id, copy_named_element(element) for feature in itertools.chain( ...
Copy enumeration literals when pasting an Enumeration
Copy enumeration literals when pasting an Enumeration Signed-off-by: Dan Yeaw <2591e5f46f28d303f9dc027d475a5c60d8dea17a@yeaw.me>
Python
lgpl-2.1
amolenaar/gaphor,amolenaar/gaphor
--- +++ @@ -1,7 +1,7 @@ import itertools from gaphor.diagram.copypaste import copy, copy_named_element -from gaphor.UML import Association, Class, Interface, Operation +from gaphor.UML import Association, Class, Enumeration, Interface, Operation @copy.register(Class) @@ -16,6 +16,13 @@ @copy.register +d...
e72156f50b0bab241b90b0f0c53414529740acd6
ds_binary_heap.py
ds_binary_heap.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function class BinaryHeap(object): def __init__(self): # Put single zero as the 1st element, so that # integer division can be used in later methods. self.heap_ls = [0] self.current_...
from __future__ import absolute_import from __future__ import division from __future__ import print_function class BinaryHeap(object): def __init__(self): # Put single zero as the 1st element, so that # integer division can be used in later methods. self.heap_ls = [0] self.current_...
Add delete_min() and its helper func’s
Add delete_min() and its helper func’s
Python
bsd-2-clause
bowen0701/algorithms_data_structures
--- +++ @@ -22,6 +22,15 @@ self.current_size += 1 self._percolate_up(self.current_size) + def _percolate_down(self, i): + pass + + def _get_min_child(self, i): + pass + + def delete_min(self): + pass + def main(): pass
59536a70ef39e34a5aea57131492a475e05cd227
lg_cms_director/setup.py
lg_cms_director/setup.py
#!/usr/bin/env python from distutils.core import setup from catkin_pkg.packages import find_packages from catkin_pkg.python_setup import generate_distutils_setup d = generate_distutils_setup( packages=['trollius', 'pulsar'], package_dir={'': 'src'}, scripts=[], requires=[] ) setup(**d) # vim: tabsto...
#!/usr/bin/env python from distutils.core import setup from catkin_pkg.packages import find_packages from catkin_pkg.python_setup import generate_distutils_setup d = generate_distutils_setup( packages=find_packages('src'), package_dir={'': 'src'}, scripts=[], requires=[] ) setup(**d) # vim: tabstop=...
Revert to previous packaging of director's dependencies thx to @mvollrath
Revert to previous packaging of director's dependencies thx to @mvollrath
Python
apache-2.0
EndPointCorp/lg_ros_nodes,EndPointCorp/lg_ros_nodes,EndPointCorp/lg_ros_nodes,EndPointCorp/lg_ros_nodes,EndPointCorp/lg_ros_nodes,EndPointCorp/lg_ros_nodes
--- +++ @@ -5,7 +5,7 @@ from catkin_pkg.python_setup import generate_distutils_setup d = generate_distutils_setup( - packages=['trollius', 'pulsar'], + packages=find_packages('src'), package_dir={'': 'src'}, scripts=[], requires=[]
cc4a17db1e4ba81019ed312cbe324874430b9814
billybot/tests/test_billybot.py
billybot/tests/test_billybot.py
import time import datetime import unittest from unittest.mock import patch, call from billybot.billybot import MessageTriage class TestMessageTriage(unittest.TestCase): def setUp(self): self.thread1 = MessageTriage('USERID1', 'user1', 'Warren', 'testchanl') self.thread1.daemon = True s...
import time import datetime import unittest from unittest.mock import patch, call from billybot.billybot import MessageTriage class TestMessageTriage(unittest.TestCase): def setUp(self): self.thread1 = MessageTriage('USERID1', 'user1', 'Warren', 'testchanl') self.thread1.daemon = True s...
Use a lambda to add a time delay function onto the mocked run method
Use a lambda to add a time delay function onto the mocked run method
Python
mit
mosegontar/billybot
--- +++ @@ -29,5 +29,7 @@ @patch('billybot.billybot.MessageTriage.run') def test_run(self, mock_run): - print(self.thread1.start()) + mock_run.time_delay = lambda delay: time.sleep(delay) + mock_run.time_delay(5) + self.thread1.start() self.assertTrue(1 == 2)
4949b1051656566ce544a8240b0328a61259868a
migrations/versions/139_add_ns_index_to_contact_and_event.py
migrations/versions/139_add_ns_index_to_contact_and_event.py
"""Add compound index to Contact and Event Revision ID: 1fd7b3e0b662 Revises: 5305d4ae30b4 Create Date: 2015-02-17 18:11:30.726188 """ # revision identifiers, used by Alembic. revision = '1fd7b3e0b662' down_revision = '2d8a350b4885' from alembic import op def upgrade(): op.create_index( 'ix_contact_ns...
"""Add compound index to Contact and Event Revision ID: 1fd7b3e0b662 Revises: 5305d4ae30b4 Create Date: 2015-02-17 18:11:30.726188 """ # revision identifiers, used by Alembic. revision = '1fd7b3e0b662' down_revision = '5305d4ae30b4' from alembic import op def upgrade(): op.create_index( 'ix_contact_ns...
Fix migration history bug introduced with merge
Fix migration history bug introduced with merge
Python
agpl-3.0
wakermahmud/sync-engine,EthanBlackburn/sync-engine,Eagles2F/sync-engine,EthanBlackburn/sync-engine,gale320/sync-engine,wakermahmud/sync-engine,nylas/sync-engine,jobscore/sync-engine,nylas/sync-engine,jobscore/sync-engine,closeio/nylas,gale320/sync-engine,wakermahmud/sync-engine,closeio/nylas,PriviPK/privipk-sync-engine...
--- +++ @@ -8,7 +8,7 @@ # revision identifiers, used by Alembic. revision = '1fd7b3e0b662' -down_revision = '2d8a350b4885' +down_revision = '5305d4ae30b4' from alembic import op
de89049649fe720d45b271f519674845104f1941
flow_workflow/petri_net/future_nets/base.py
flow_workflow/petri_net/future_nets/base.py
from flow.petri_net.future_net import FutureNet from flow.petri_net.success_failure_net import SuccessFailureNet class SimplifiedSuccessFailureNet(FutureNet): def __init__(self, name=''): FutureNet.__init__(self, name=name) # Internal -- subclasses should connect to these self.internal_st...
from flow.petri_net.future_net import FutureNet from flow.petri_net.success_failure_net import SuccessFailureNet class GenomeNetBase(SuccessFailureNet): def __init__(self, name, operation_id, parent_operation_id=None): SuccessFailureNet.__init__(self, name=name) self.operation_id = operation_id ...
Make GenomeNetBase a SuccessFailureNet again
Make GenomeNetBase a SuccessFailureNet again
Python
agpl-3.0
genome/flow-workflow,genome/flow-workflow,genome/flow-workflow
--- +++ @@ -2,29 +2,8 @@ from flow.petri_net.success_failure_net import SuccessFailureNet -class SimplifiedSuccessFailureNet(FutureNet): - def __init__(self, name=''): - FutureNet.__init__(self, name=name) - - # Internal -- subclasses should connect to these - self.internal_start_transiti...
3486d3cb7122ba59c64d9af5b6eb6b12bc97e193
brew/utilities/efficiency.py
brew/utilities/efficiency.py
# -*- coding: utf-8 -*- from .sugar import sg_to_gu __all__ = [ u'calculate_brew_house_yield', ] def calculate_brew_house_yield(wort_volume, sg, grain_additions): """ Calculate Brew House Yield :param float wort_volume: The volume of the wort :param float sg: THe specific gravity of the wort ...
# -*- coding: utf-8 -*- from ..constants import GRAIN_TYPE_DME from ..constants import GRAIN_TYPE_LME from .sugar import sg_to_gu __all__ = [ u'calculate_brew_house_yield', ] def calculate_brew_house_yield(wort_volume, sg, grain_additions): """ Calculate Brew House Yield :param float wort_volume: T...
Clean up brew house yield calculator to deal with DME and LME additions
Clean up brew house yield calculator to deal with DME and LME additions
Python
mit
chrisgilmerproj/brewday,chrisgilmerproj/brewday
--- +++ @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- +from ..constants import GRAIN_TYPE_DME +from ..constants import GRAIN_TYPE_LME from .sugar import sg_to_gu __all__ = [ @@ -23,6 +25,13 @@ A better measure is to look at just the grains that needed to be steeped seperately and measure the specific gravi...
e65a8c057d9dbd156222542a0e544d294292de00
thinglang/lexer/symbols/base.py
thinglang/lexer/symbols/base.py
from thinglang.utils.type_descriptors import ValueType from thinglang.lexer.symbols import LexicalSymbol class LexicalQuote(LexicalSymbol): # " EMITTABLE = False @classmethod def next_operator_set(cls, current, original): if current is original: return {'"': LexicalQuote} ret...
from thinglang.utils.type_descriptors import ValueType from thinglang.lexer.symbols import LexicalSymbol class LexicalQuote(LexicalSymbol): # " EMITTABLE = False @classmethod def next_operator_set(cls, current, original): if current is original: return {'"': LexicalQuote} ret...
Use new resolver in LexicalID resolution
Use new resolver in LexicalID resolution
Python
mit
ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang
--- +++ @@ -47,6 +47,7 @@ class LexicalIdentifier(LexicalSymbol, ValueType): + def __init__(self, value): super(LexicalIdentifier, self).__init__(value) self.value = value @@ -54,8 +55,8 @@ def describe(self): return self.value - def evaluate(self, stack): - retur...
e559c897cec534c58ab7940e2623a1decfb4958a
numpy/distutils/command/install_clib.py
numpy/distutils/command/install_clib.py
import os from distutils.core import Command from numpy.distutils.misc_util import get_cmd class install_clib(Command): description = "Command to install installable C libraries" user_options = [] def initialize_options(self): self.install_dir = None self.outfiles = [] def finalize_o...
import os from distutils.core import Command from distutils.ccompiler import new_compiler from numpy.distutils.misc_util import get_cmd class install_clib(Command): description = "Command to install installable C libraries" user_options = [] def initialize_options(self): self.install_dir = None ...
Move import at the top of module.
Move import at the top of module.
Python
bsd-3-clause
jorisvandenbossche/numpy,MichaelAquilina/numpy,b-carter/numpy,sonnyhu/numpy,GrimDerp/numpy,dch312/numpy,githubmlai/numpy,astrofrog/numpy,brandon-rhodes/numpy,joferkington/numpy,CMartelLML/numpy,rajathkumarmp/numpy,ahaldane/numpy,MaPePeR/numpy,empeeu/numpy,pelson/numpy,nguyentu1602/numpy,jakirkham/numpy,jakirkham/numpy,...
--- +++ @@ -1,5 +1,6 @@ import os from distutils.core import Command +from distutils.ccompiler import new_compiler from numpy.distutils.misc_util import get_cmd class install_clib(Command): @@ -16,7 +17,6 @@ def run (self): # We need the compiler to get the library name -> filename association -...
1d96f8a1456d902fe5a9e6ce5410a41b1468a810
thinglang/parser/tokens/logic.py
thinglang/parser/tokens/logic.py
from thinglang.lexer.symbols.logic import LexicalEquality from thinglang.parser.tokens import BaseToken class Conditional(BaseToken): ADVANCE = False COMPARATORS = { LexicalEquality: lambda lhs, rhs: lhs == rhs } def __init__(self, slice): super(Conditional, self).__init__(slice) ...
from thinglang.lexer.symbols.logic import LexicalEquality from thinglang.parser.tokens import BaseToken class Conditional(BaseToken): ADVANCE = False def __init__(self, slice): super(Conditional, self).__init__(slice) _, self.value = slice def describe(self): return 'if {}'.form...
Complete migration from conditional to arithmetic operation
Complete migration from conditional to arithmetic operation
Python
mit
ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang
--- +++ @@ -5,24 +5,20 @@ class Conditional(BaseToken): ADVANCE = False - COMPARATORS = { - LexicalEquality: lambda lhs, rhs: lhs == rhs - } def __init__(self, slice): super(Conditional, self).__init__(slice) - _, self.lhs, self.comparator, self.rhs = slice - self.co...
1f4d1fb8e8923609aae8e90d186d4e0e3ca40329
notifications/rest/bindings/list-binding/list-binding.6.x.py
notifications/rest/bindings/list-binding/list-binding.6.x.py
# NOTE: This example uses the next generation Twilio helper library - for more # information on how to download and install this version, visit # https://www.twilio.com/docs/libraries/python from twilio.rest import Client from datetime import datetime # Your Account Sid and Auth Token from twilio.com/user/account acco...
# NOTE: This example uses the next generation Twilio helper library - for more # information on how to download and install this version, visit # https://www.twilio.com/docs/libraries/python from twilio.rest import Client from datetime import datetime # Your Account Sid and Auth Token from twilio.com/user/account acco...
Update .py list-binding API snippet with 'new user' tag
Update .py list-binding API snippet with 'new user' tag
Python
mit
TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,teoreteetik/api-snippets,teoreteetik/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,teoreteetik/api-snippets,TwilioDevEd/api-snippets,teoreteetik/api-snippets,teoreteetik/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snip...
--- +++ @@ -10,7 +10,7 @@ client = Client(account, token) bindings = client.notify.services("ISxxx").bindings.list( - tag="premium", + tag="new user", start_date=datetime.strptime("2015-08-25", "%Y-%m-%d") )
0d9085b0335fe52a8d9682d18c64b540e5a5e71e
tests/backends/gstreamer_test.py
tests/backends/gstreamer_test.py
import unittest import os from mopidy.models import Playlist, Track from mopidy.backends.gstreamer import GStreamerBackend from tests.backends.base import (BasePlaybackControllerTest, BaseCurrentPlaylistControllerTest) folder = os.path.dirname(__file__) folder = os.path.join(folder, ...
import unittest import os from mopidy.models import Playlist, Track from mopidy.backends.gstreamer import GStreamerBackend from tests.backends.base import (BasePlaybackControllerTest, BaseCurrentPlaylistControllerTest) folder = os.path.dirname(__file__) folder = os.path.join(folder, ...
Add test for mp3, ogg and flac support in gstreamer backend
Add test for mp3, ogg and flac support in gstreamer backend
Python
apache-2.0
vrs01/mopidy,jcass77/mopidy,kingosticks/mopidy,bacontext/mopidy,mokieyue/mopidy,jodal/mopidy,liamw9534/mopidy,mopidy/mopidy,liamw9534/mopidy,diandiankan/mopidy,jodal/mopidy,mokieyue/mopidy,pacificIT/mopidy,glogiotatidis/mopidy,quartz55/mopidy,adamcik/mopidy,jmarsik/mopidy,jcass77/mopidy,abarisain/mopidy,bencevans/mopid...
--- +++ @@ -24,5 +24,25 @@ backend_class = GStreamerBackend + def add_track(self, file): + uri = 'file://' + os.path.join(folder, file) + track = Track(uri=uri, id=1, length=4464) + self.backend.current_playlist.add(track) + + def test_play_mp3(self): + self.add_track('blank...
5606e8d56b7f6441eeb121795b0f400d65858b3b
tests/integration/test_fanout.py
tests/integration/test_fanout.py
import uuid import diesel from diesel.util.queue import Fanout class FanoutHarness(object): def setup(self): self.fan = Fanout() self.subscriber_data = {} for x in xrange(10): diesel.fork(self.subscriber) diesel.sleep() for i in xrange(10): self.fan...
import uuid import diesel from diesel.util.queue import Fanout from diesel.util.event import Countdown class FanoutHarness(object): def setup(self): self.done = Countdown(10) self.fan = Fanout() self.subscriber_data = {} for x in xrange(10): diesel.fork(self.subscriber...
Add "done" tracking for fanout test.
Add "done" tracking for fanout test.
Python
bsd-3-clause
dieseldev/diesel
--- +++ @@ -3,9 +3,11 @@ import diesel from diesel.util.queue import Fanout +from diesel.util.event import Countdown class FanoutHarness(object): def setup(self): + self.done = Countdown(10) self.fan = Fanout() self.subscriber_data = {} for x in xrange(10): @@ -13,13 +15,...
76deb311dbb981501a1fa2686ec2cf4c92d7b83b
taggit/admin.py
taggit/admin.py
from django.contrib import admin from taggit.models import Tag, TaggedItem class TaggedItemInline(admin.StackedInline): model = TaggedItem class TagAdmin(admin.ModelAdmin): inlines = [ TaggedItemInline ] ordering = ['name'] admin.site.register(Tag, TagAdmin)
from django.contrib import admin from taggit.models import Tag, TaggedItem class TaggedItemInline(admin.StackedInline): model = TaggedItem extra = 0 class TagAdmin(admin.ModelAdmin): inlines = [ TaggedItemInline ] ordering = ['name'] admin.site.register(Tag, TagAdmin)
Remove extra inlines from django-taggit
Remove extra inlines from django-taggit
Python
bsd-3-clause
theatlantic/django-taggit,theatlantic/django-taggit2,theatlantic/django-taggit2,theatlantic/django-taggit,decibyte/django-taggit,decibyte/django-taggit
--- +++ @@ -5,6 +5,7 @@ class TaggedItemInline(admin.StackedInline): model = TaggedItem + extra = 0 class TagAdmin(admin.ModelAdmin): inlines = [
1862317c3b463704c8264f71007e7b910772b44e
tests/test_pprint.py
tests/test_pprint.py
import pytest from mappyfile.pprint import PrettyPrinter def test_print_map(): mf = {} pp = PrettyPrinter() # expected txt = pp.pprint(mf) assert(expected == txt) def run_tests(): #pytest.main(["tests/test_pprint.py::test_print_map"]) pytest.main(["tests/test_pprint.py"]) if __name__ ...
import pytest from mappyfile.pprint import PrettyPrinter import mappyfile def test_format_list(): s = """ CLASS STYLE COLOR 173 216 230 END STYLE OUTLINECOLOR 2 2 2 WIDTH 1 LINECAP BUTT PATT...
Add pair list formatting test
Add pair list formatting test
Python
mit
Jenselme/mappyfile,geographika/mappyfile,geographika/mappyfile
--- +++ @@ -1,16 +1,43 @@ import pytest from mappyfile.pprint import PrettyPrinter +import mappyfile -def test_print_map(): - mf = {} - pp = PrettyPrinter() # expected - txt = pp.pprint(mf) - assert(expected == txt) +def test_format_list(): + + s = """ + CLASS + STYLE + ...
207bb83a7a41a36dbe27cb4b75f93fe0ae3a5625
sgext/util/aws.py
sgext/util/aws.py
# -*- coding: utf-8 -*- # # © 2011 SimpleGeo, Inc. All rights reserved. # Author: Paul Lathrop <paul@simplegeo.com> # """Utility functions for AWS-related tasks.""" from getpass import getpass import boto.pyami.config as boto_config def get_credentials(batch=False): """Return a tuple (key, secret) of AWS crede...
# -*- coding: utf-8 -*- # # © 2011 SimpleGeo, Inc. All rights reserved. # Author: Paul Lathrop <paul@simplegeo.com> # """Utility functions for AWS-related tasks.""" from getpass import getpass import boto.pyami.config as boto_config def get_credentials(batch=False): """Return a dictionary of AWS credentials. C...
Fix get_credentials so it returns a dict.
Fix get_credentials so it returns a dict.
Python
bsd-2-clause
simplegeo/clusto-sgext
--- +++ @@ -12,16 +12,17 @@ def get_credentials(batch=False): - """Return a tuple (key, secret) of AWS credentials. Credentials - are loaded via boto first (which checks the environment and a - couple well-known files). If boto cannot find any credentials, and - the 'batch' kwarg is set to False, thi...
20a92ff1ffe143193d95235c7a5ea8e9edb0df64
yowsup/layers/protocol_acks/protocolentities/ack_outgoing.py
yowsup/layers/protocol_acks/protocolentities/ack_outgoing.py
from yowsup.structs import ProtocolEntity, ProtocolTreeNode from .ack import AckProtocolEntity class OutgoingAckProtocolEntity(AckProtocolEntity): ''' <ack type="{{delivery | read}}" class="{{message | receipt | ?}}" id="{{MESSAGE_ID}} to={{TO_JID}}"> </ack> ''' def __init__(self, _id, _class, _ty...
from yowsup.structs import ProtocolEntity, ProtocolTreeNode from .ack import AckProtocolEntity class OutgoingAckProtocolEntity(AckProtocolEntity): ''' <ack type="{{delivery | read}}" class="{{message | receipt | ?}}" id="{{MESSAGE_ID}} to={{TO_JID}}"> </ack> <ack to="{{GROUP_JID}}" participant="{{JID}...
Include participant in outgoing ack
Include participant in outgoing ack
Python
mit
ongair/yowsup,biji/yowsup
--- +++ @@ -5,27 +5,36 @@ ''' <ack type="{{delivery | read}}" class="{{message | receipt | ?}}" id="{{MESSAGE_ID}} to={{TO_JID}}"> </ack> + + <ack to="{{GROUP_JID}}" participant="{{JID}}" id="{{MESSAGE_ID}}" class="receipt" type="{{read | }}"> + </ack> + ''' - def __init__(self, _id, _c...
30907bbfc1b6d38034867070075a28fd3c5d3c6b
{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/cli.py
{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/cli.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os os.environ["KIVY_NO_ARGS"] = "1" import click from {{cookiecutter.repo_name}} import {{cookiecutter.app_class_name}} @click.command() @click.option( '-l', '--language', help='Default language of the App', default='en', type=click.Choice(['en', 'es', '...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os os.environ["KIVY_NO_ARGS"] = "1" import click from {{cookiecutter.repo_name}}.{{cookiecutter.repo_name}} import {{cookiecutter.app_class_name}} @click.command() @click.option( '-l', '--language', help='Default language of the App', default='en', type=...
Use absolute path for app import
Use absolute path for app import
Python
mit
hackebrot/cookiedozer,hackebrot/cookiedozer
--- +++ @@ -6,7 +6,7 @@ import click -from {{cookiecutter.repo_name}} import {{cookiecutter.app_class_name}} +from {{cookiecutter.repo_name}}.{{cookiecutter.repo_name}} import {{cookiecutter.app_class_name}} @click.command()
f872bd95e9a26b326ea49922a373f90d73d0df2f
show_usbcamera.py
show_usbcamera.py
#! /usr/bin/env python # # Show the USB camera # # # External dependencies # import sys from PySide import QtGui import VisionToolkit as vtk # # Main application # if __name__ == '__main__' : application = QtGui.QApplication( sys.argv ) widget = vtk.UsbCameraWidget() widget.show() sys.exit( appli...
#! /usr/bin/env python # -*- coding:utf-8 -*- # # Show the images from a USB camera # # # External dependencies # import sys from PySide import QtGui import VisionToolkit as vtk # # Main application # if __name__ == '__main__' : application = QtGui.QApplication( sys.argv ) widget = vtk.UsbCameraWidget() ...
Change character coding and a comment.
Change character coding and a comment.
Python
mit
microy/StereoVision,microy/VisionToolkit,microy/StereoVision,microy/PyStereoVisionToolkit,microy/PyStereoVisionToolkit,microy/VisionToolkit
--- +++ @@ -1,8 +1,9 @@ #! /usr/bin/env python +# -*- coding:utf-8 -*- # -# Show the USB camera +# Show the images from a USB camera #
fc0ee0d418496f0ec8da01e8bd8e2d12024accaa
simulate_loads.py
simulate_loads.py
import random import itertools as it from sklearn.externals import joblib def simulate_loads(nfrag, ngt, q): loads = [1] * nfrag active = set(range(nfrag)) for k in range(1, len(loads)): i0, i1 = random.sample(active, k=2) active.remove(i0) active.remove(i1) active.add(len(l...
import pickle import random import itertools as it from sklearn.externals import joblib def simulate_loads(nfrag, ngt, q): loads = [1] * nfrag active = set(range(nfrag)) for k in range(1, len(loads)): i0, i1 = random.sample(active, k=2) active.remove(i0) active.remove(i1) ac...
Add main script to CSR simulations
Add main script to CSR simulations
Python
bsd-3-clause
jni/gala-scripts
--- +++ @@ -1,3 +1,4 @@ +import pickle import random import itertools as it from sklearn.externals import joblib @@ -27,3 +28,12 @@ joblib.delayed(simulate_loads)(n, 1000, q) for n, q in keys ) return dict(zip(keys, results)) + + +if __name__ == '__main__': + import sys + ...
bdae1f203f3d5d600dd62470dea3d2ddb3048b9d
turbustat/tests/test_wavelet.py
turbustat/tests/test_wavelet.py
# Licensed under an MIT open source license - see LICENSE ''' Test function for Wavelet ''' from unittest import TestCase import numpy as np import numpy.testing as npt from ..statistics import wt2D, Wavelet_Distance from ._testing_data import \ dataset1, dataset2, computed_data, computed_distances class tes...
# Licensed under an MIT open source license - see LICENSE ''' Test function for Wavelet ''' from unittest import TestCase import numpy as np import numpy.testing as npt from ..statistics import Wavelet, Wavelet_Distance from ._testing_data import \ dataset1, dataset2, computed_data, computed_distances class ...
Change class name in tests
Change class name in tests
Python
mit
e-koch/TurbuStat,Astroua/TurbuStat
--- +++ @@ -10,7 +10,7 @@ import numpy as np import numpy.testing as npt -from ..statistics import wt2D, Wavelet_Distance +from ..statistics import Wavelet, Wavelet_Distance from ._testing_data import \ dataset1, dataset2, computed_data, computed_distances @@ -22,8 +22,8 @@ self.dataset2 = datase...
293f44e211e4f26a0b7eca842dd2af515957a4bd
octavia/certificates/generator/cert_gen.py
octavia/certificates/generator/cert_gen.py
# Copyright (c) 2014 Rackspace US, Inc # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
# Copyright (c) 2014 Rackspace US, Inc # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
Add Cert+PK generation to Certificate Interface
Add Cert+PK generation to Certificate Interface Change-Id: I82aa573c7db13c7a491b18540379b234c1023eb9
Python
apache-2.0
openstack/octavia,openstack/octavia,openstack/octavia
--- +++ @@ -25,7 +25,8 @@ class CertGenerator(object): """Base Cert Generator Interface - A Certificate Generator is responsible for signing TLS certificates. + A Certificate Generator is responsible for generating private keys, + generating CSRs, and signing TLS certificates. """ @abc.ab...
44d103359cff312865f409ff34f528f63e441ef4
graphapi/views.py
graphapi/views.py
from simplekeys.verifier import verify_request from graphene_django.views import GraphQLView from django.conf import settings class KeyedGraphQLView(GraphQLView): graphiql_template = "graphene/graphiql-keyed.html" def get_response(self, request, data, show_graphiql=False): # check key only if we're n...
from simplekeys.verifier import verify_request from graphene_django.views import GraphQLView from django.conf import settings class KeyedGraphQLView(GraphQLView): graphiql_template = "graphene/graphiql-keyed.html" def get_response(self, request, data, show_graphiql=False): # check key only if we're n...
Revert "Reimplement using explicit variable lookup"
Revert "Reimplement using explicit variable lookup" This reverts commit 94683e6c
Python
mit
openstates/openstates.org,openstates/openstates.org,openstates/openstates.org,openstates/openstates.org
--- +++ @@ -8,11 +8,10 @@ def get_response(self, request, data, show_graphiql=False): # check key only if we're not handling a graphiql request - # if not show_graphiql: - # error = verify_request(request, 'graphapi') - # if error: - # print('graphapi/views:...
fc508462e3fa9b03f0ee55df21c44863fbd8bae0
tests/providers/phone_number.py
tests/providers/phone_number.py
# coding=utf-8 from __future__ import unicode_literals import unittest from faker import Factory from .. import string_types class TestJaJP(unittest.TestCase): """ Tests phone_number in the ja_JP locale """ def setUp(self): self.factory = Factory.create('ja') def test_phone_number(self): ...
# coding=utf-8 from __future__ import unicode_literals import unittest from faker import Factory from .. import string_types class TestJaJP(unittest.TestCase): """ Tests phone_number in the ja_JP locale """ def setUp(self): self.factory = Factory.create('ja') def test_phone_number(self): ...
Add the msisdn provider test
Add the msisdn provider test
Python
mit
joke2k/faker,danhuss/faker,joke2k/faker
--- +++ @@ -35,3 +35,21 @@ assert len(second) == 4 assert len(third) == 4 assert first in formats + + + +class TestMSISDN(unittest.TestCase): + """ Tests MSISDN in the pt_br locale """ + + def setUp(self): + self.factory = Factory.create('pt_br') + + def test_msi...
48081a925d5b69e18a1f04c74cbe98b590e77c5b
tests/unit/test_pylama_isort.py
tests/unit/test_pylama_isort.py
import os from isort.pylama_isort import Linter class TestLinter: instance = Linter() def test_allow(self): assert not self.instance.allow("test_case.pyc") assert not self.instance.allow("test_case.c") assert self.instance.allow("test_case.py") def test_run(self, src_dir, tmpdir...
import os from isort.pylama_isort import Linter class TestLinter: instance = Linter() def test_allow(self): assert not self.instance.allow("test_case.pyc") assert not self.instance.allow("test_case.c") assert self.instance.allow("test_case.py") def test_run(self, src_dir, tmpdir...
Add a test for skip functionality
Add a test for skip functionality
Python
mit
PyCQA/isort,PyCQA/isort
--- +++ @@ -17,3 +17,8 @@ incorrect = tmpdir.join("incorrect.py") incorrect.write("import b\nimport a\n") assert self.instance.run(str(incorrect)) + + def test_skip(self, src_dir, tmpdir): + incorrect = tmpdir.join("incorrect.py") + incorrect.write("# isort: skip_file\nimpo...
ca0d9e9651e51797ad317e54c58a174bcb351610
channels/__init__.py
channels/__init__.py
__version__ = "0.9" default_app_config = 'channels.apps.ChannelsConfig' DEFAULT_CHANNEL_LAYER = 'default' from .asgi import channel_layers # NOQA isort:skip from .channel import Channel, Group # NOQA isort:skip
__version__ = "0.9" default_app_config = 'channels.apps.ChannelsConfig' DEFAULT_CHANNEL_LAYER = 'default' try: from .asgi import channel_layers # NOQA isort:skip from .channel import Channel, Group # NOQA isort:skip except ImportError: # No django installed, allow vars to be read pass
Fix version import during pip install
Fix version import during pip install
Python
bsd-3-clause
raphael-boucher/channels,Coread/channels,Coread/channels,django/channels,Krukov/channels,andrewgodwin/channels,Krukov/channels,andrewgodwin/django-channels,raiderrobert/channels,linuxlewis/channels
--- +++ @@ -3,5 +3,8 @@ default_app_config = 'channels.apps.ChannelsConfig' DEFAULT_CHANNEL_LAYER = 'default' -from .asgi import channel_layers # NOQA isort:skip -from .channel import Channel, Group # NOQA isort:skip +try: + from .asgi import channel_layers # NOQA isort:skip + from .channel import Channe...
b7bb933b23b5b86a2555e5fdd8919f852960a4cb
firecares/firestation/management/commands/export-building-fires.py
firecares/firestation/management/commands/export-building-fires.py
from django.core.management.base import BaseCommand from firecares.firestation.models import FireDepartment class Command(BaseCommand): """ This command is used to export data that department heat maps visualize. """ help = 'Creates a sql file to export building fires from.' def handle(self, *ar...
from django.core.management.base import BaseCommand from firecares.firestation.models import FireDepartment class Command(BaseCommand): """ This command is used to export data that department heat maps visualize. """ help = 'Creates a sql file to export building fires from.' def handle(self, *ar...
Update export building fires script.
Update export building fires script.
Python
mit
FireCARES/firecares,FireCARES/firecares,FireCARES/firecares,FireCARES/firecares,FireCARES/firecares
--- +++ @@ -12,9 +12,8 @@ def handle(self, *args, **options): vals = FireDepartment.objects.filter(fdid__isnull=False, state__isnull=False).exclude(fdid__exact='') - sql = """ - \COPY (select alarm, a.inc_type, alarms,ff_death, oth_death, ST_X(geom) as x, st_y(geom) as y from buildingfir...
289be31dff1bbff200054e5acffc4d6640caaa97
civis/utils/_jobs.py
civis/utils/_jobs.py
from civis import APIClient from civis.futures import CivisFuture def run_job(job_id, api_key=None): """Run a job. Parameters ---------- job_id : str or int The ID of the job. api_key : str, optional Your Civis API key. If not given, the :envvar:`CIVIS_API_KEY` environment...
from civis import APIClient from civis.futures import CivisFuture def run_job(job_id, api_key=None): """Run a job. Parameters ---------- job_id : str or int The ID of the job. api_key : str, optional Your Civis API key. If not given, the :envvar:`CIVIS_API_KEY` environment...
Set poll_on_creation to False for run_job
Set poll_on_creation to False for run_job
Python
bsd-3-clause
civisanalytics/civis-python
--- +++ @@ -22,4 +22,5 @@ run = client.jobs.post_runs(job_id) return CivisFuture(client.jobs.get_runs, (job_id, run['id']), - api_key=api_key) + api_key=api_key, + poll_on_creation=False)
9ff64fa4fe884b8c255737c38e9e6d108f16aec9
vinotes/apps/api/permissions.py
vinotes/apps/api/permissions.py
from rest_framework import permissions class IsSameUserOrAdmin(permissions.BasePermission): """ Custom permissions to only allow same user or admins to view user details. """ def has_object_permission(self, request, view, user): return request.user == user or request.user.is_staff
from rest_framework import permissions class IsSameUserOrAdmin(permissions.BasePermission): """ Custom permission to only allow same user or admin to view user details. """ def has_object_permission(self, request, view, user): return request.user == user or request.user.is_staff
Update docstring for IsSameUserOrAdmin permission.
Update docstring for IsSameUserOrAdmin permission.
Python
unlicense
rcutmore/vinotes-api,rcutmore/vinotes-api
--- +++ @@ -3,7 +3,7 @@ class IsSameUserOrAdmin(permissions.BasePermission): """ - Custom permissions to only allow same user or admins to view user details. + Custom permission to only allow same user or admin to view user details. """ def has_object_permission(self, request, view, user): ...
0ac671d554f322524741a795f4a3250ef705f872
server/ec2spotmanager/migrations/0010_extend_instance_types.py
server/ec2spotmanager/migrations/0010_extend_instance_types.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2018-08-24 14:55 from __future__ import unicode_literals from django.db import migrations, models import ec2spotmanager.models class Migration(migrations.Migration): dependencies = [ ('ec2spotmanager', '0009_add_instance_size'), ] operati...
# -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2018-08-24 14:55 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ec2spotmanager', '0009_add_instance_size'), ] operations = [ migrations.Al...
Fix Flake8 error in migration.
Fix Flake8 error in migration.
Python
mpl-2.0
MozillaSecurity/FuzzManager,MozillaSecurity/FuzzManager,MozillaSecurity/FuzzManager,MozillaSecurity/FuzzManager
--- +++ @@ -3,7 +3,6 @@ from __future__ import unicode_literals from django.db import migrations, models -import ec2spotmanager.models class Migration(migrations.Migration):
0b3a414be19546df348ebca148362bf370c61c15
zerver/migrations/0127_disallow_chars_in_stream_and_user_name.py
zerver/migrations/0127_disallow_chars_in_stream_and_user_name.py
# -*- coding: utf-8 -*- from django.db import models, migrations from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor from django.db.migrations.state import StateApps from typing import Text def remove_special_chars_from_streamname(apps, schema_editor): # type: (StateApps, DatabaseSchemaE...
# -*- coding: utf-8 -*- from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('zerver', '0126_prereg_remove_users_without_realm'), ] operations = [ # There was a migration here, which wasn't ready for wide deployment # and was backed out. This ...
Revert "migrations: Replace special chars in stream & user names with space."
Revert "migrations: Replace special chars in stream & user names with space." This reverts commit acebd3a5e, as well as a subsequent fixup commit 0975bebac "quick fix: Fix migrations to be linear." These changes need more work and thought before they're ready to deploy on any large established Zulip server, such as z...
Python
apache-2.0
showell/zulip,andersk/zulip,tommyip/zulip,hackerkid/zulip,timabbott/zulip,synicalsyntax/zulip,brainwane/zulip,zulip/zulip,shubhamdhama/zulip,shubhamdhama/zulip,brainwane/zulip,jackrzhang/zulip,eeshangarg/zulip,rishig/zulip,rishig/zulip,eeshangarg/zulip,brainwane/zulip,rishig/zulip,zulip/zulip,rishig/zulip,eeshangarg/zu...
--- +++ @@ -1,39 +1,5 @@ # -*- coding: utf-8 -*- -from django.db import models, migrations -from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor -from django.db.migrations.state import StateApps -from typing import Text - -def remove_special_chars_from_streamname(apps, schema_editor): - ...
e28988724edcf2c4d6c0545eb9b8dba50169dc28
config/flask_prod.py
config/flask_prod.py
import os from rmc.config.flask_base import * import rmc.shared.secrets as s JS_DIR = 'js' DEBUG = False ENV = 'prod' GA_PROPERTY_ID = 'UA-35073503-1' LOG_DIR = '/home/rmc/logs' LOG_PATH = os.path.join(LOG_DIR, 'server/server.log') FB_APP_ID = '219309734863464' FB_APP_SECRET = s.FB_APP_SECRET_PROD
import os from rmc.config.flask_base import * import rmc.shared.secrets as s JS_DIR = 'js_prod' DEBUG = False ENV = 'prod' GA_PROPERTY_ID = 'UA-35073503-1' LOG_DIR = '/home/rmc/logs' LOG_PATH = os.path.join(LOG_DIR, 'server/server.log') FB_APP_ID = '219309734863464' FB_APP_SECRET = s.FB_APP_SECRET_PROD
Revert "Revert "Revert "do not use minified js on prod"""
Revert "Revert "Revert "do not use minified js on prod""" This reverts commit c7d03f4f8d4d50ce837cf0df446a52b24e891cee.
Python
mit
shakilkanji/rmc,MichalKononenko/rmc,rageandqq/rmc,UWFlow/rmc,JGulbronson/rmc,UWFlow/rmc,MichalKononenko/rmc,sachdevs/rmc,MichalKononenko/rmc,sachdevs/rmc,UWFlow/rmc,sachdevs/rmc,ccqi/rmc,ccqi/rmc,duaayousif/rmc,JGulbronson/rmc,JGulbronson/rmc,MichalKononenko/rmc,duaayousif/rmc,ccqi/rmc,shakilkanji/rmc,JGulbronson/rmc,M...
--- +++ @@ -3,7 +3,7 @@ from rmc.config.flask_base import * import rmc.shared.secrets as s -JS_DIR = 'js' +JS_DIR = 'js_prod' DEBUG = False ENV = 'prod' GA_PROPERTY_ID = 'UA-35073503-1'
1b9213f0ab0652da23f498799a19420313ec560b
examples/generate-manager-file.py
examples/generate-manager-file.py
#!/usr/bin/python import sys import telepathy from telepathy.interfaces import CONN_MGR_INTERFACE if len(sys.argv) >= 2: manager_name = sys.argv[1] else: manager_name = "haze" service_name = "org.freedesktop.Telepathy.ConnectionManager.%s" % manager_name object_path = "/org/freedesktop/Telepathy/ConnectionMana...
#!/usr/bin/python import sys import telepathy from telepathy.interfaces import CONN_MGR_INTERFACE if len(sys.argv) >= 2: manager_name = sys.argv[1] else: manager_name = "haze" service_name = "org.freedesktop.Telepathy.ConnectionManager.%s" % manager_name object_path = "/org/freedesktop/Telepathy/ConnectionMana...
Rename variables to less haze-specific alternatives
Rename variables to less haze-specific alternatives 20070831150511-4210b-48ed5b3cc7b1f15f42885c043a1b9678257902a7.gz
Python
lgpl-2.1
freedesktop-unofficial-mirror/telepathy__telepathy-python,epage/telepathy-python,detrout/telepathy-python,max-posedon/telepathy-python,PabloCastellano/telepathy-python,freedesktop-unofficial-mirror/telepathy__telepathy-python,max-posedon/telepathy-python,epage/telepathy-python,PabloCastellano/telepathy-python,detrout/t...
--- +++ @@ -10,17 +10,17 @@ service_name = "org.freedesktop.Telepathy.ConnectionManager.%s" % manager_name object_path = "/org/freedesktop/Telepathy/ConnectionManager/%s" % manager_name -haze = telepathy.client.ConnectionManager(service_name, object_path) -haze_mgr = haze[CONN_MGR_INTERFACE] +object = telepathy.c...
e1dc2c3e2515daf3aae51242221fab4fbd5c553f
aim/db/migration/alembic_migrations/versions/72fa5bce100b_tree_model.py
aim/db/migration/alembic_migrations/versions/72fa5bce100b_tree_model.py
# Copyright (c) 2016 Cisco Systems # 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 require...
# Copyright (c) 2016 Cisco Systems # 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 require...
Fix db migration for tree model
Fix db migration for tree model
Python
apache-2.0
noironetworks/aci-integration-module,noironetworks/aci-integration-module
--- +++ @@ -34,10 +34,10 @@ def upgrade(): op.create_table( 'aim_tenant_trees', - sa.Column('rn', sa.String(64), nullable=False), + sa.Column('tenant_rn', sa.String(64), nullable=False), sa.Column('root_full_hash', sa.String(64), nullable=False), sa.Column('tree', sa.Lar...
f2000016a9e2acd4cad28b1ea301620723140a4e
sheldon/bot.py
sheldon/bot.py
# -*- coding: utf-8 -*- """ @author: Seva Zhidkov @contact: zhidkovseva@gmail.com @license: The MIT license Copyright (C) 2015 """ from sheldon.adapter import * from sheldon.config import * from sheldon.exceptions import * from sheldon.manager import * from sheldon.storage import * from sheldon.utils import logger ...
# -*- coding: utf-8 -*- """ @author: Seva Zhidkov @contact: zhidkovseva@gmail.com @license: The MIT license Copyright (C) 2015 """ from sheldon.adapter import * from sheldon.config import * from sheldon.exceptions import * from sheldon.manager import * from sheldon.storage import * from sheldon.utils import logger ...
Change error status with config problems to critical
Change error status with config problems to critical
Python
mit
lises/sheldon
--- +++ @@ -49,5 +49,5 @@ else: self.config = Config() except Exception as error: - logger.error_message('Error with loading config:') - logger.error_message(str(error.__traceback__)) + logger.critical_message('Error with loading config:') + ...
450cbc7d0cb9a2477b80e94c874de1da4a00e431
source/services/rotten_tomatoes_service.py
source/services/rotten_tomatoes_service.py
import requests from bs4 import BeautifulSoup from source.models.rt_rating import RTRating class RottenTomatoesService: __URL = 'http://www.rottentomatoes.com/m/' __SEPERATOR = '_' def __init__(self, title): self.title = title def get_rt_rating(self): search_url = self.__URL + self...
import requests from bs4 import BeautifulSoup from source.models.rt_rating import RTRating class RottenTomatoesService: __URL = 'http://www.rottentomatoes.com/m/' __SEPERATOR = '_' def __init__(self, title): self.title = title def get_rt_rating(self): search_url = self.__URL + self...
Remove colon from title for RT search
Remove colon from title for RT search
Python
mit
jeremyrea/caterblu,jeremyrea/caterblu,jeremyrea/caterblu,jeremyrea/caterblu
--- +++ @@ -34,6 +34,7 @@ formatted_title = formatted_title.replace(' ', self.__SEPERATOR) formatted_title = formatted_title.replace('-', '') + formatted_title = formatted_title.replace(':', '') return formatted_title
ec244cc9c56fec571502529ef24af2ca18d9f5f5
spirit/templatetags/tags/utils/gravatar.py
spirit/templatetags/tags/utils/gravatar.py
#-*- coding: utf-8 -*- import hashlib from django.utils.http import urlencode, urlquote from .. import register @register.simple_tag() def get_gravatar_url(user, size, rating='g', default='identicon'): url = "http://www.gravatar.com/avatar/" hash = hashlib.md5(user.email.strip().lower()).hexdigest() d...
#-*- coding: utf-8 -*- import hashlib from django.utils.http import urlencode, urlquote from django.utils.encoding import force_bytes from .. import register @register.simple_tag() def get_gravatar_url(user, size, rating='g', default='identicon'): url = "http://www.gravatar.com/avatar/" hash = hashlib.md5...
Use django utils force_bytes to arguments of hashlib
Use django utils force_bytes to arguments of hashlib
Python
mit
alesdotio/Spirit,a-olszewski/Spirit,raybesiga/Spirit,a-olszewski/Spirit,dvreed/Spirit,ramaseshan/Spirit,adiyengar/Spirit,battlecat/Spirit,ramaseshan/Spirit,gogobook/Spirit,dvreed/Spirit,nitely/Spirit,mastak/Spirit,battlecat/Spirit,nitely/Spirit,a-olszewski/Spirit,alesdotio/Spirit,mastak/Spirit,alesdotio/Spirit,gogobook...
--- +++ @@ -4,6 +4,7 @@ import hashlib from django.utils.http import urlencode, urlquote +from django.utils.encoding import force_bytes from .. import register @@ -11,6 +12,6 @@ @register.simple_tag() def get_gravatar_url(user, size, rating='g', default='identicon'): url = "http://www.gravatar.com/ava...
85d71d8a5d7cdf34c12791b84c9f1bdec4ad1ed1
partner_compassion/wizards/portal_wizard.py
partner_compassion/wizards/portal_wizard.py
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2016 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emanuel Cino <ecino@compassion.ch> # # The licence is in the file __manifest__.py...
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2016 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emanuel Cino <ecino@compassion.ch> # # The licence is in the file __manifest__.py...
Fix bug, set notify_email to always after create portal user
Fix bug, set notify_email to always after create portal user
Python
agpl-3.0
ecino/compassion-switzerland,CompassionCH/compassion-switzerland,ecino/compassion-switzerland,CompassionCH/compassion-switzerland,CompassionCH/compassion-switzerland,eicher31/compassion-switzerland,eicher31/compassion-switzerland,eicher31/compassion-switzerland,ecino/compassion-switzerland
--- +++ @@ -39,7 +39,9 @@ 'groups_id': [(6, 0, [])], 'notify_email': 'none', } - return res_users.create(values) + res = res_users.create(values) + res.notify_email = 'always' + return res @api.multi def _send_email(self):
8e3beda427e2edc2bc7b8f7f96f8ef1c7dd571c7
downloads/urls.py
downloads/urls.py
from django.conf.urls import patterns, url from django.utils.translation import ugettext_lazy as _ from problems.models import UserSolution from .views import download_protected_file urlpatterns = patterns('', url(_(r'solutions/(?P<path>.*)$'), download_protected_file, dict(path_prefix='solutions/', mode...
from django.conf.urls import patterns, url from django.utils.translation import ugettext_lazy as _ from problems.models import UserSolution from .views import download_protected_file urlpatterns = patterns('', url(_(r'solutions/(?P<path>.*)$'), download_protected_file, dict(path_prefix='solutions/', mode...
Add view for displaying corrected solutions
downloads: Add view for displaying corrected solutions
Python
mit
matus-stehlik/roots,tbabej/roots,tbabej/roots,matus-stehlik/roots,rtrembecky/roots,matus-stehlik/roots,rtrembecky/roots,tbabej/roots,rtrembecky/roots
--- +++ @@ -9,4 +9,7 @@ url(_(r'solutions/(?P<path>.*)$'), download_protected_file, dict(path_prefix='solutions/', model_class=UserSolution), name='download_solution'), + url(_(r'corrected_solutions/(?P<path>.*)$'), download_protected_file, + dict(path_prefix='corrected_solutions/', m...
390851ce7c606e803094487e6278ea5620d26f3c
src/python/vff.py
src/python/vff.py
"""Show a command to edit fred files""" import os import sys from dotsite.paths import makepath, pwd def get_freds(paths): if not paths: paths = ['.'] result = set() for path in paths: path = makepath(path) if path.isdir(): result |= {p for p in path.files('fred*') i...
"""Show a command to edit fred files""" import os import sys from dotsite.paths import makepath, pwd def get_freds(paths): if not paths: paths = ['~/tmp'] result = set() for path in paths: path = makepath(path) if path.isdir(): result |= {p for p in path.files('fred*...
Put temp files in ~/tmp by default
Put temp files in ~/tmp by default
Python
mit
jalanb/jab,jalanb/dotjab,jalanb/jab,jalanb/dotjab
--- +++ @@ -9,7 +9,7 @@ def get_freds(paths): if not paths: - paths = ['.'] + paths = ['~/tmp'] result = set() for path in paths: path = makepath(path)
5dece3e052a1bebda6b1e1af63855399435f2e49
src/mailflow/settings.py
src/mailflow/settings.py
SQLALCHEMY_DATABASE_URI = "postgres://@/mailflow" SECRET_KEY = 'Chi6riup1gaetiengaShoh=Wey1pohph0ieDaes7eeph' INBOX_LOGIN_LENGTH = 16 INBOX_PASSWORD_LENGTH = 16 INBOX_PAGE_SIZE = 50 INBOX_HOST = 'mailflow.openpz.org' INBOX_PORT = 25 RAW_EMAIL_FOLDER = "/var/tmp" RABBITMQ_URI = 'amqp://mailflow:youneverguess@localho...
SQLALCHEMY_DATABASE_URI = "postgres://@/mailflow" SECRET_KEY = 'Chi6riup1gaetiengaShoh=Wey1pohph0ieDaes7eeph' INBOX_LOGIN_LENGTH = 16 INBOX_PASSWORD_LENGTH = 16 INBOX_PAGE_SIZE = 50 INBOX_HOST = 'mailflow.openpz.org' INBOX_PORT = 25 RAW_EMAIL_FOLDER = "/var/tmp" RABBITMQ_URI = 'amqp://mailflow:youneverguess@localho...
Set CSRF token expirtion time to 6 hours
Set CSRF token expirtion time to 6 hours
Python
apache-2.0
zzzombat/mailflow,zzzombat/mailflow
--- +++ @@ -13,3 +13,5 @@ RABBITMQ_URI = 'amqp://mailflow:youneverguess@localhost//mail' RABBITMQ_EXCHANGE_NAME = 'mail' RABBITMQ_MAIL_QUEUE_PREFIX = 'newmail' + +WTF_CSRF_TIME_LIMIT = 21600
a93b8986f1cd2c64b75abd9bf695ff6e44a85b29
scripts/travis_build_dependent_projects.py
scripts/travis_build_dependent_projects.py
# -*- coding: utf-8 -*- import os from travispy import travispy from travispy import TravisPy def main(): restarted = [] building = [] for domain in [travispy.PUBLIC, travispy.PRIVATE]: print "Enumerate repos on ", domain conn = TravisPy.github_auth(os.environ['GITHUB_KEY'], domain) ...
# -*- coding: utf-8 -*- import os from travispy import travispy from travispy import TravisPy def main(): restarted = [] building = [] for domain in [travispy.PUBLIC, travispy.PRIVATE]: print "Enumerate repos on ", domain conn = TravisPy.github_auth(os.environ['GITHUB_KEY'], domain) ...
Fix to Travis build script.
Fix to Travis build script.
Python
mit
dgnorth/drift,dgnorth/drift,dgnorth/drift
--- +++ @@ -19,7 +19,7 @@ for repo in repos: if not repo.active: continue - print u"Checking repo: {}\n{}".format(repo.slug, repo.description) + print u"Checking repo: {}\n{!r}".format(repo.slug, repo.description) try: build = ...
08d83313d2e077e760adc9a4bfd7c181d9f8a60a
cal_pipe/update_pipeline_paths.py
cal_pipe/update_pipeline_paths.py
''' Update EVLA pipeline variables to the current system. ''' def update_paths(pipe_dict, ms_path, pipepath): pipe_dict['ms_active'] = ms_path pipe_dict['SDM_name'] = ms_path[:-3] # Cutoff '.ms' pipe_dict['pipepath'] = pipepath return pipe_dict if __name__ == '__main__': import sys pipe...
''' Update EVLA pipeline variables to the current system. ''' def update_paths(pipe_dict, ms_path, pipepath): pipe_dict['ms_active'] = ms_path pipe_dict['SDM_name'] = ms_path[:-3] # Cutoff '.ms' pipe_dict['pipepath'] = pipepath return pipe_dict if __name__ == '__main__': import sys pipe...
Print out changed paths in pipeline file
Print out changed paths in pipeline file
Python
mit
e-koch/canfar_scripts,e-koch/canfar_scripts
--- +++ @@ -31,4 +31,9 @@ pipe_dict.sync() + print "Checking!" + print pipe_dict['ms_active'] + print pipe_dict['SDM_name'] + print pipe_dict['pipepath'] + pipe_dict.close()
cc08888a527dac321f88cbe9da27508aee62e51e
examples/lab/main.py
examples/lab/main.py
""" Copyright (c) Jupyter Development Team. Distributed under the terms of the Modified BSD License. """ import os from jinja2 import FileSystemLoader from notebook.base.handlers import IPythonHandler, FileFindHandler from notebook.notebookapp import NotebookApp from traitlets import Unicode class ExampleHandler(IPy...
""" Copyright (c) Jupyter Development Team. Distributed under the terms of the Modified BSD License. """ import os from jinja2 import FileSystemLoader from notebook.base.handlers import IPythonHandler, FileFindHandler from notebook.notebookapp import NotebookApp from traitlets import Unicode class ExampleHandler(IPy...
Enable terminals in the lab example
Enable terminals in the lab example
Python
bsd-3-clause
eskirk/jupyterlab,eskirk/jupyterlab,jupyter/jupyterlab,eskirk/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,charnpreetsingh185/jupyterlab,charnpreetsingh185/jupyterlab,charnpreetsingh185/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,eskirk/jupyterlab,charnpreetsingh185/jupyterlab,eskirk/jupyterlab,charnpreetsingh...
--- +++ @@ -16,7 +16,8 @@ def get(self): """Get the main page for the application's interface.""" return self.write(self.render_template("index.html", - static=self.static_url, base_url=self.base_url)) + static=self.static_url, base_url=self.base_url, + terminal...