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
1ba0f715a0730dbc575bd1998f2edc69fab60fc5
project_task_add_very_high/__openerp__.py
project_task_add_very_high/__openerp__.py
# -*- coding: utf-8 -*- # Copyright 2016 Onestein (<http://www.onestein.eu>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Project Task Add Very High", "summary": "Adds an extra option 'Very High' on tasks", "version": "8.0.1.0.0", "author": "Onestein", "license": ...
# -*- coding: utf-8 -*- # Copyright 2016 Onestein (<http://www.onestein.eu>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Project Task Add Very High", "summary": "Adds an extra option 'Very High' on tasks", "version": "8.0.1.0.0", "author": "Onestein, Odoo Community A...
Add OCA in authors list
Add OCA in authors list
Python
agpl-3.0
ddico/project,OCA/project-service,dreispt/project-service,NeovaHealth/project-service,dreispt/project,acsone/project,acsone/project-service
--- +++ @@ -6,7 +6,7 @@ "name": "Project Task Add Very High", "summary": "Adds an extra option 'Very High' on tasks", "version": "8.0.1.0.0", - "author": "Onestein", + "author": "Onestein, Odoo Community Association (OCA)", "license": "AGPL-3", "category": "Project Management", "we...
729a814f976ceffba0092ba56efca8ccea06e6e6
apps/profiles/views.py
apps/profiles/views.py
from django.views.generic import DetailView, UpdateView from django.core.urlresolvers import reverse_lazy from braces.views import LoginRequiredMixin from .models import User from .forms import ProfileUpdateForm class ProfileDetailView(DetailView): ''' Displays the user profile information ''' model...
from django.views.generic import DetailView, UpdateView from django.core.urlresolvers import reverse_lazy from django.contrib import messages from django.utils.translation import ugettext_lazy as _ from braces.views import LoginRequiredMixin from .models import User from .forms import ProfileUpdateForm class Profil...
Add message on profile form save
Add message on profile form save
Python
mit
SoPR/horas,SoPR/horas,SoPR/horas,SoPR/horas
--- +++ @@ -1,5 +1,7 @@ from django.views.generic import DetailView, UpdateView from django.core.urlresolvers import reverse_lazy +from django.contrib import messages +from django.utils.translation import ugettext_lazy as _ from braces.views import LoginRequiredMixin @@ -28,3 +30,7 @@ def get_success_ur...
a662475e148b8ccd3186303cebdc0615ae2dab1b
asyncmongo/__init__.py
asyncmongo/__init__.py
#!/bin/env python # # Copyright 2010 bit.ly # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
#!/bin/env python # # Copyright 2010 bit.ly # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
Support Sort Order For TEXT Index
Support Sort Order For TEXT Index
Python
apache-2.0
RealGeeks/asyncmongo
--- +++ @@ -33,7 +33,7 @@ """Descending sort order.""" GEO2D = "2d" """Index specifier for a 2-dimensional `geospatial index`""" -TEXT = '{ $meta: "textScore" }' +TEXT = { $meta: "textScore" } """TEXT Index sort order.""" from errors import (Error, InterfaceError, AuthenticationError, DatabaseError, RSConnecti...
8c69e0e75454a5665ed2d428aba3c052b97b68b5
cmd2/constants.py
cmd2/constants.py
# # coding=utf-8 """Constants and definitions""" import re # Used for command parsing, tab completion and word breaks. Do not change. QUOTES = ['"', "'"] REDIRECTION_CHARS = ['|', '<', '>'] # Regular expression to match ANSI escape codes ANSI_ESCAPE_RE = re.compile(r'\x1b[^m]*m')
# # coding=utf-8 """Constants and definitions""" import re # Used for command parsing, tab completion and word breaks. Do not change. QUOTES = ['"', "'"] REDIRECTION_CHARS = ['|', '>'] # Regular expression to match ANSI escape codes ANSI_ESCAPE_RE = re.compile(r'\x1b[^m]*m')
Remove ‘<‘ from REDIRECTION_CHARS, it’s no longer used.
Remove ‘<‘ from REDIRECTION_CHARS, it’s no longer used.
Python
mit
python-cmd2/cmd2,python-cmd2/cmd2
--- +++ @@ -6,7 +6,7 @@ # Used for command parsing, tab completion and word breaks. Do not change. QUOTES = ['"', "'"] -REDIRECTION_CHARS = ['|', '<', '>'] +REDIRECTION_CHARS = ['|', '>'] # Regular expression to match ANSI escape codes ANSI_ESCAPE_RE = re.compile(r'\x1b[^m]*m')
1892fc910e2a23971248121b44ff120ddc118270
src/sentry/api/authentication.py
src/sentry/api/authentication.py
from __future__ import absolute_import from django.contrib.auth.models import AnonymousUser from django.utils.crypto import constant_time_compare from rest_framework.authentication import BasicAuthentication from rest_framework.exceptions import AuthenticationFailed from sentry.models import ApiKey, ProjectKey clas...
from __future__ import absolute_import from django.contrib.auth.models import AnonymousUser from django.utils.crypto import constant_time_compare from rest_framework.authentication import BasicAuthentication from rest_framework.exceptions import AuthenticationFailed from sentry.app import raven from sentry.models imp...
Add API key to context
Add API key to context
Python
bsd-3-clause
fotinakis/sentry,daevaorn/sentry,hongliang5623/sentry,ngonzalvez/sentry,looker/sentry,fuziontech/sentry,mitsuhiko/sentry,felixbuenemann/sentry,kevinlondon/sentry,BuildingLink/sentry,kevinlondon/sentry,Natim/sentry,wujuguang/sentry,ewdurbin/sentry,kevinastone/sentry,alexm92/sentry,ifduyue/sentry,zenefits/sentry,drcapule...
--- +++ @@ -5,6 +5,7 @@ from rest_framework.authentication import BasicAuthentication from rest_framework.exceptions import AuthenticationFailed +from sentry.app import raven from sentry.models import ApiKey, ProjectKey @@ -26,6 +27,10 @@ if not key.is_active: raise AuthenticationFailed...
b8850bd7d457ebb14220213d18a6aa779d64b547
nirum/validate.py
nirum/validate.py
""":mod:`nirum.validate` ~~~~~~~~~~~~~~~~~~~~~~~~ """ __all__ = 'validate_boxed_type', 'validate_record_type' def validate_boxed_type(boxed, type_hint): if not isinstance(boxed, type_hint): raise TypeError('{0} expected, found: {1}'.format(type_hint, ...
""":mod:`nirum.validate` ~~~~~~~~~~~~~~~~~~~~~~~~ """ __all__ = 'validate_boxed_type', 'validate_record_type' def validate_boxed_type(boxed, type_hint): if not isinstance(boxed, type_hint): raise TypeError('{0} expected, found: {1}'.format(type_hint, ...
Return its argument in validators
Return its argument in validators
Python
mit
spoqa/nirum-python,spoqa/nirum-python
--- +++ @@ -9,7 +9,7 @@ if not isinstance(boxed, type_hint): raise TypeError('{0} expected, found: {1}'.format(type_hint, type(boxed))) - return True + return boxed def validate_record_type(record): @@ -21,17 +21,16 @@ ...
cad5087328bd462d6db8758929d212c4b34fae6c
server_ui/glue.py
server_ui/glue.py
""" Glue some events together """ from django.conf import settings from django.core.urlresolvers import reverse from django.conf import settings from django.utils.translation import ugettext as _ import helios.views, helios.signals import views def vote_cast_send_message(user, voter, election, cast_vote, **kwargs)...
""" Glue some events together """ from django.conf import settings from django.core.urlresolvers import reverse from django.conf import settings from django.utils.translation import ugettext as _ import helios.views, helios.signals import views def vote_cast_send_message(user, voter, election, cast_vote, **kwargs)...
Add blank space in email message
Add blank space in email message
Python
apache-2.0
shirlei/helios-server,shirlei/helios-server,shirlei/helios-server,shirlei/helios-server,shirlei/helios-server
--- +++ @@ -16,13 +16,13 @@ # prepare the message subject = _("%(election_name)s - vote cast") % {'election_name' : election.name} - body = _('You have successfully cast a vote in\n\n%(election_name)s') % {'election_name' : election.name} + body = _('You have successfully cast a vote in\n\n%(election_name)s...
4bcfb45ef0934dcbcfc711bac1a01c7204e83231
pw_docgen/py/setup.py
pw_docgen/py/setup.py
# Copyright 2020 The Pigweed Authors # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of # the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
# Copyright 2020 The Pigweed Authors # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of # the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
Set Pillow version to 8.2.0
pw_docgen: Set Pillow version to 8.2.0 Version 8.3.0 has yet to be resolved DLL problems on windows. No-Docs-Update-Reason: Pip dep fix. Change-Id: I50deecd7c5d3a7f5eb01898e13e5ccb5bedfabf2 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/52041 Reviewed-by: Wyatt Hepler <cca3bedb37979eacd157a9...
Python
apache-2.0
google/pigweed,google/pigweed,google/pigweed,google/pigweed,google/pigweed,google/pigweed,google/pigweed,google/pigweed,google/pigweed,google/pigweed
--- +++ @@ -27,7 +27,8 @@ install_requires=[ 'sphinx >3', 'sphinx-rtd-theme', - + # Pillow 8.3.0 is broken on Windows. + 'Pillow >=6.2.2, <=8.2.0', # Diagram generation modules. 'sphinxcontrib-actdiag', 'sphinxcontrib-blockdiag',
1f884083b612637b64f26532c221b7341c3dda8c
services/voicedetection/voicedetection.py
services/voicedetection/voicedetection.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import angus.cloud conn = angus.connect() service = conn.services.get_service('voice_detection', version=1) job = service.process({'sound': open("./sound.wav", 'rb'), 'sensitivity':0.7}) print job.result
import angus.cloud conn = angus.connect() service = conn.services.get_service('voice_detection', version=1) job = service.process({'sound': open("./sound.wav", 'rb'), 'sensitivity':0.7}) print job.result
Clean script header in voice detection.
Clean script header in voice detection.
Python
apache-2.0
angus-ai/angus-doc,angus-ai/angus-doc,angus-ai/angus-doc
--- +++ @@ -1,6 +1,3 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - import angus.cloud conn = angus.connect()
93956645792f92cffc11f4e2c72a8df1b0b82a02
tests/runalldoctests.py
tests/runalldoctests.py
import doctest import glob import pkg_resources try: pkg_resources.require('OWSLib') except (ImportError, pkg_resources.DistributionNotFound): pass testfiles = glob.glob('*.txt') for file in testfiles: doctest.testfile(file)
import doctest import getopt import glob import sys import pkg_resources try: pkg_resources.require('OWSLib') except (ImportError, pkg_resources.DistributionNotFound): pass def run(pattern): if pattern is None: testfiles = glob.glob('*.txt') else: testfiles = glob.glob(pattern) fo...
Add option to pick single test file from the runner
Add option to pick single test file from the runner
Python
bsd-3-clause
menegon/OWSLib,QuLogic/OWSLib,jachym/OWSLib,kwilcox/OWSLib,robmcmullen/OWSLib,KeyproOy/OWSLib,geopython/OWSLib,jaygoldfinch/OWSLib,JuergenWeichand/OWSLib,geographika/OWSLib,daf/OWSLib,ocefpaf/OWSLib,daf/OWSLib,bird-house/OWSLib,tomkralidis/OWSLib,datagovuk/OWSLib,dblodgett-usgs/OWSLib,b-cube/OWSLib,gfusca/OWSLib,mbertr...
--- +++ @@ -1,5 +1,8 @@ import doctest +import getopt import glob +import sys + import pkg_resources try: @@ -7,8 +10,23 @@ except (ImportError, pkg_resources.DistributionNotFound): pass -testfiles = glob.glob('*.txt') +def run(pattern): + if pattern is None: + testfiles = glob.glob('*.txt') +...
5d190f8d3b228820d1a537f0ed2b584b8c09fbae
tests/test_container.py
tests/test_container.py
# coding: utf8 from common import * class TestContainers(TestCase): def test_unicode_filename(self): container = av.open(self.sandboxed(u'¢∞§¶•ªº.mov'), 'w')
# coding: utf8 from .common import * class TestContainers(TestCase): def test_unicode_filename(self): container = av.open(self.sandboxed(u'¢∞§¶•ªº.mov'), 'w')
Fix relative import in tests.
Fix relative import in tests.
Python
bsd-3-clause
mikeboers/PyAV,PyAV-Org/PyAV,PyAV-Org/PyAV,mikeboers/PyAV
--- +++ @@ -1,6 +1,6 @@ # coding: utf8 -from common import * +from .common import * class TestContainers(TestCase):
5b8a39dc0fc5e383c30451a819c8e1542fd6f7ed
OpenSearchInNewTab.py
OpenSearchInNewTab.py
import re from threading import Timer import sublime_plugin import sublime DEFAULT_NAME = 'Find Results' ALT_NAME_BASE = 'Find Results ' class OpenSearchInNewTab(sublime_plugin.EventListener): # set a bit changed name # so the tab won't be bothered # during new search def on_activated(self, view): ...
import re from threading import Timer import sublime_plugin import sublime DEFAULT_NAME = 'Find Results' ALT_NAME_BASE = 'Find Results ' class OpenSearchInNewTab(sublime_plugin.EventListener): # set a bit changed name # so the tab won't be bothered # during new search def on_activated(self, view): ...
Remove unnecessary scratch file flag
Remove unnecessary scratch file flag
Python
mit
everyonesdesign/OpenSearchInNewTab
--- +++ @@ -37,7 +37,6 @@ def update_view(self, view): view.set_name(self.get_alt_name(view)) - view.set_scratch(True) def is_search_view(self, view): name = view.name()
403a949a4b248076420d79ceb9d87983b1d26812
django_errordite/handlers.py
django_errordite/handlers.py
""" Django-aware exception handler for integration with Errordite. Adds django user and request information to the exception as appropriate. """ from errordite import ErrorditeHandler class DjangoErrorditeHandler(ErrorditeHandler): """ Django-aware Errordite handler than enriches logs with request info. ...
""" Django-aware exception handler for integration with Errordite. Adds django user and request information to the exception as appropriate. """ from errordite import ErrorditeHandler class DjangoErrorditeHandler(ErrorditeHandler): """ Django-aware Errordite handler than enriches logs with request info. ...
Return payload even if request arg is not passed in.
Return payload even if request arg is not passed in.
Python
bsd-2-clause
yunojuno/django-errordite
--- +++ @@ -20,7 +20,7 @@ ) if not hasattr(record, 'request'): - return + return payload rq = record.request payload['Url'] = rq.get_full_path()
0a96055a08b27d195920ad88141676b02937e029
django_pytest/test_runner.py
django_pytest/test_runner.py
class TestRunner(object): def __init__(self, verbosity=1, interactive=True, failfast=True, **kwargs): self.verbosity = verbosity self.interactive = interactive self.failfast = failfast def run_tests(self, test_labels): import pytest import sys if test_labels is ...
class TestRunner(object): def __init__(self, verbosity=1, interactive=True, failfast=True, **kwargs): self.verbosity = verbosity self.interactive = interactive self.failfast = failfast def run_tests(self, test_labels, extra_tests=None): import pytest import sys ...
Make run_tests a function to make it fully backwards compatible
Make run_tests a function to make it fully backwards compatible
Python
bsd-3-clause
0101/django-pytest,buchuki/django-pytest
--- +++ @@ -4,7 +4,7 @@ self.interactive = interactive self.failfast = failfast - def run_tests(self, test_labels): + def run_tests(self, test_labels, extra_tests=None): import pytest import sys @@ -12,6 +12,11 @@ print ('Not yet implemented: py.test is still...
61677883825eefcbdc2b1c943b1ce33b26def264
PrinterApplication.py
PrinterApplication.py
from Cura.Wx.WxApplication import WxApplication from Cura.Wx.MainWindow import MainWindow class PrinterApplication(WxApplication): def __init__(self): super(PrinterApplication, self).__init__() def run(self): window = MainWindow("Cura Printer") window.Show() super(Print...
from Cura.Wx.WxApplication import WxApplication from Cura.Wx.MainWindow import MainWindow class PrinterApplication(WxApplication): def __init__(self): super(PrinterApplication, self).__init__() def run(self): self._plugin_registry.loadPlugins({ "type": "StorageDevice" }) ...
Load all storage plugins in the printer application
Load all storage plugins in the printer application
Python
agpl-3.0
totalretribution/Cura,Curahelper/Cura,senttech/Cura,lo0ol/Ultimaker-Cura,markwal/Cura,fieldOfView/Cura,ynotstartups/Wanhao,ynotstartups/Wanhao,quillford/Cura,bq/Ultimaker-Cura,ad1217/Cura,derekhe/Cura,senttech/Cura,hmflash/Cura,Curahelper/Cura,lo0ol/Ultimaker-Cura,DeskboxBrazil/Cura,derekhe/Cura,DeskboxBrazil/Cura,tota...
--- +++ @@ -6,6 +6,8 @@ super(PrinterApplication, self).__init__() def run(self): + self._plugin_registry.loadPlugins({ "type": "StorageDevice" }) + window = MainWindow("Cura Printer") window.Show() super(PrinterApplication, self).run()
e6ef3a1c609de227bff34a811910f08b3e5e69c9
Lib/sandbox/pyem/__init__.py
Lib/sandbox/pyem/__init__.py
#! /usr/bin/env python # Last Change: Sat Jun 09 10:00 PM 2007 J from info import __doc__ from gauss_mix import GmParamError, GM from gmm_em import GmmParamError, GMM, EM #from online_em import OnGMM as _OnGMM #import examples as _examples __all__ = filter(lambda s:not s.startswith('_'), dir()) from numpy.testing i...
#! /usr/bin/env python # Last Change: Sun Jul 22 11:00 AM 2007 J raise ImportError( """pyem has been moved to scikits and renamed to em. Please install scikits.learn instead, and change your import to the following: from scickits.learn.machine import em.""") from info import __doc__ from gauss_mix import GmParamErr...
Raise an import error when importing pyem as it has been moved to scikits.
Raise an import error when importing pyem as it has been moved to scikits. git-svn-id: 003f22d385e25de9cff933a5ea4efd77cb5e7b28@3179 d6536bca-fef9-0310-8506-e4c0a848fbcf
Python
bsd-3-clause
scipy/scipy-svn,lesserwhirls/scipy-cwt,jasonmccampbell/scipy-refactor,lesserwhirls/scipy-cwt,lesserwhirls/scipy-cwt,scipy/scipy-svn,jasonmccampbell/scipy-refactor,scipy/scipy-svn,jasonmccampbell/scipy-refactor,scipy/scipy-svn,jasonmccampbell/scipy-refactor,lesserwhirls/scipy-cwt
--- +++ @@ -1,5 +1,11 @@ #! /usr/bin/env python -# Last Change: Sat Jun 09 10:00 PM 2007 J +# Last Change: Sun Jul 22 11:00 AM 2007 J + +raise ImportError( +"""pyem has been moved to scikits and renamed to em. Please install +scikits.learn instead, and change your import to the following: + +from scickits.learn.mach...
e7ee29f03dd83a795828de92aba654e9a7db3dd4
deflect/views.py
deflect/views.py
from __future__ import unicode_literals import base32_crockford import logging from django.db.models import F from django.http import Http404 from django.http import HttpResponsePermanentRedirect from django.shortcuts import get_object_or_404 from django.utils.timezone import now from .models import RedirectURL from...
from __future__ import unicode_literals import base32_crockford import logging from django.db.models import F from django.http import Http404 from django.http import HttpResponsePermanentRedirect from django.shortcuts import get_object_or_404 from django.utils.timezone import now from .models import RedirectURL from...
Improve comment and logging text
Improve comment and logging text
Python
bsd-3-clause
jbittel/django-deflect
--- +++ @@ -18,11 +18,14 @@ def redirect(request, url_path): """ + Given the path component of a short URL, update the URL's + statistics and redirect the user to the full destination + URL, including available Google Analytics parameters. """ try: id = base32_crockford.decode(url_...
dd1c220606a1d7a40b9d3def1acbbfd03a865004
docs/conf.py
docs/conf.py
import sys import os import sphinx_rtd_theme # Provide path to the python modules we want to run autodoc on sys.path.insert(0, os.path.abspath('../qp')) # Avoid imports that may be unsatisfied when running sphinx, see: # http://stackoverflow.com/questions/15889621/sphinx-how-to-exclude-imports-in-automodule#15912502 a...
import sys import os import sphinx_rtd_theme # Provide path to the python modules we want to run autodoc on sys.path.insert(0, os.path.abspath('../qp')) # Avoid imports that may be unsatisfied when running sphinx, see: # http://stackoverflow.com/questions/15889621/sphinx-how-to-exclude-imports-in-automodule#15912502 a...
Include links to source code with viewcode extension
Include links to source code with viewcode extension
Python
mit
aimalz/qp
--- +++ @@ -12,7 +12,8 @@ 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.mathjax', - 'sphinx.ext.napoleon' ] + 'sphinx.ext.napoleon', + 'sphinx.ext.viewcode'] html_theme = "sphinx_rtd_theme" html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
43ab1f2015b71ba5b63152dee524d0ccc1864302
test/helpers/xnat_test_helper.py
test/helpers/xnat_test_helper.py
import os, re from base64 import b64encode as encode from qipipe.staging import airc_collection as airc from qipipe.staging.staging_helper import SUBJECT_FMT from qipipe.helpers import xnat_helper import logging logger = logging.getLogger(__name__) def generate_subject_name(name): """ Makes a subject name tha...
import os, re from base64 import b64encode as encode from qipipe.staging import airc_collection as airc from qipipe.staging.staging_helper import SUBJECT_FMT from qipipe.helpers import xnat_helper import logging logger = logging.getLogger(__name__) def generate_subject_name(name): """ Makes a subject name tha...
Move delete_subjects to a test helper.
Move delete_subjects to a test helper.
Python
bsd-2-clause
ohsu-qin/qipipe
--- +++ @@ -15,3 +15,17 @@ :return: the test subject name """ return encode(name).strip('=') + +def delete_subjects(project, *subject_names): + """ + Deletes the given XNAT subjects, if they exist. + + :param project: the XNAT project id + :param subject_names: the XNAT subject names + "...
78a40488ee1adabb77400708e7d091e94807c1b5
PynamoDB/membership_stage.py
PynamoDB/membership_stage.py
from consistent_hash_ring import ConsistentHashRing from error_code import ErrorCode import util def get_hash(value): return hashlib.sha256(value).hexdigest() class MembershipStage(object): """ Stage for managing membership.""" @classmethod def from_node_list(cls, file_name, **kwargs): node_...
from consistent_hash_ring import ConsistentHashRing import logging import util import collections class MembershipStage(object): """ Stage for managing ring membeship and failure detection.""" def __init__(self, server = None, node_addresses=[]): self.logger = logging.getLogger('{}'.format(self.__cla...
Add skeleton methods for failures.
Add skeleton methods for failures. Decided that MembershipStage should handle the announced/unannounced failures since it’s in charge of detecting failures as well as the consistent hash ring.
Python
mit
samuelwu90/PynamoDB
--- +++ @@ -1,37 +1,37 @@ from consistent_hash_ring import ConsistentHashRing -from error_code import ErrorCode +import logging import util - - -def get_hash(value): - return hashlib.sha256(value).hexdigest() +import collections class MembershipStage(object): - """ Stage for managing membership.""" + ""...
bfce7465713edbc4e596138c9ce24c67454d533c
pomito/plugins/__init__.py
pomito/plugins/__init__.py
# -*- coding: utf-8 -*- # Pomito - Pomodoro timer on steroids # Base package for plugins __all__ = ['initialize', 'get_plugin'] # TODO Enable plugin discovery, support for drop-in plugins # TODO Validate plugins # TODO Some plugins may fail to import due to dependencies, gracefully handle them PLUGINS = {} ...
# -*- coding: utf-8 -*- # Pomito - Pomodoro timer on steroids # Base package for plugins __all__ = ['initialize', 'get_plugin'] # TODO Enable plugin discovery, support for drop-in plugins # TODO Validate plugins # TODO Some plugins may fail to import due to dependencies, gracefully handle them PLUGINS = {} ...
Fix qtapp UI plugin key for CI machines where POMITO_TEST is set.
Fix qtapp UI plugin key for CI machines where POMITO_TEST is set.
Python
mit
codito/pomito
--- +++ @@ -32,6 +32,10 @@ from .ui import qtapp PLUGINS['qtapp'] = qtapp.QtUI(pomodoro_service) + else: + # CI machines may not have Qt installed, ensure the lookup + # doesn't fail + PLUGINS['qtapp'] = None def get_plugin(plugin_name): return PLUGINS[plugin_name]
5b0dde337bbad6361e32fc99f12d51af534e6278
ceilometer/api/config.py
ceilometer/api/config.py
# Server Specific Configurations server = { 'port': '8080', 'host': '0.0.0.0' } # Pecan Application Configurations app = { 'root': 'ceilometer.api.controllers.root.RootController', 'modules': ['ceilometer.api'], 'static_root': '%(confdir)s/public', 'template_path': '%(confdir)s/ceilometer/api/t...
# Server Specific Configurations server = { 'port': '8777', 'host': '0.0.0.0' } # Pecan Application Configurations app = { 'root': 'ceilometer.api.controllers.root.RootController', 'modules': ['ceilometer.api'], 'static_root': '%(confdir)s/public', 'template_path': '%(confdir)s/ceilometer/api/t...
Make debugging the wsme app a bit easier.
Make debugging the wsme app a bit easier. - add a logger so we get exceptions - setup the port to 8777 so 'pecan serve config.py' works normally Change-Id: I7374a34ae5534d7d4127e4b405daa11cab5f5547
Python
apache-2.0
ityaptin/ceilometer,citrix-openstack-build/ceilometer,luogangyi/Ceilometer-oVirt,dreamhost/ceilometer,JioCloud/ceilometer,openstack/ceilometer,tanglei528/ceilometer,pkilambi/ceilometer,JioCloud/ceilometer,dreamhost/ceilometer,isyippee/ceilometer,openstack/aodh,maestro-hybrid-cloud/ceilometer,citrix-openstack-build/ceil...
--- +++ @@ -1,6 +1,6 @@ # Server Specific Configurations server = { - 'port': '8080', + 'port': '8777', 'host': '0.0.0.0' } @@ -16,7 +16,8 @@ logging = { 'loggers': { 'root': {'level': 'INFO', 'handlers': ['console']}, - 'ceilometer': {'level': 'DEBUG', 'handlers': ['console']} +...
7ad5619318fdac555a4350219f298adc702f6d6f
erpnext/domains/education.py
erpnext/domains/education.py
from __future__ import unicode_literals data = { 'desktop_icons': [ 'Student', 'Program', 'Course', 'Student Group', 'Instructor', 'Fees', 'Task', 'ToDo', 'Education', 'Student Attendance Tool', 'Student Applicant' ], 'default_portal_role': 'Guardian', 'restricted_roles': [ 'Student', 'In...
from __future__ import unicode_literals data = { 'desktop_icons': [ 'Student', 'Program', 'Course', 'Student Group', 'Instructor', 'Fees', 'Task', 'ToDo', 'Education', 'Student Attendance Tool', 'Student Applicant' ], 'default_portal_role': 'LMS User', 'restricted_roles': [ 'Student', 'In...
Set default role to LMS User for signup in Education
feat: Set default role to LMS User for signup in Education
Python
agpl-3.0
gsnbng/erpnext,gsnbng/erpnext,gsnbng/erpnext,gsnbng/erpnext
--- +++ @@ -14,7 +14,7 @@ 'Student Attendance Tool', 'Student Applicant' ], - 'default_portal_role': 'Guardian', + 'default_portal_role': 'LMS User', 'restricted_roles': [ 'Student', 'Instructor',
3ba8af66d0c6ebbdd4a3799b819a72292da2c6c5
netmiko/citrix/netscaler_ssh.py
netmiko/citrix/netscaler_ssh.py
import time from netmiko.base_connection import BaseConnection class NetscalerSSH(BaseConnection): """ Netscaler SSH class. """ def session_preparation(self): """Prepare the session after the connection has been established.""" # 0 will defer to the global delay factor delay_factor ...
import time from netmiko.base_connection import BaseConnection class NetscalerSSH(BaseConnection): """ Netscaler SSH class. """ def session_preparation(self): """Prepare the session after the connection has been established.""" # 0 will defer to the global delay factor delay_factor ...
Make return character an attribute
Make return character an attribute
Python
mit
ktbyers/netmiko,ktbyers/netmiko
--- +++ @@ -13,22 +13,23 @@ delay_factor = self.select_delay_factor(delay_factor=0) self._test_channel_read() self.set_base_prompt() - self.disable_paging(command="\nset cli mode -page OFF\n") + cmd = "{}set cli mode -page OFF{}".format(self.RETURN, self.RETURN) + self....
efe3c6acb6b5336461adc18d993ad74a31205c06
pre_push.py
pre_push.py
#!/usr/bin/env python """Run static analysis on the project.""" from shutil import rmtree from subprocess import CalledProcessError, check_call from tempfile import mkdtemp import sys def do_process(*args): """Run program provided by args. Return True on success. Output failed message on non-zero exit a...
#!/usr/bin/env python """Run static analysis on the project.""" from shutil import rmtree from subprocess import CalledProcessError, check_call from tempfile import mkdtemp import sys def do_process(*args): """Run program provided by args. Return True on success. Output failed message on non-zero exit a...
Exclude .tox/ from flake8 target
Exclude .tox/ from flake8 target
Python
bsd-2-clause
13steinj/praw,leviroth/praw,gschizas/praw,praw-dev/praw,gschizas/praw,13steinj/praw,praw-dev/praw,leviroth/praw
--- +++ @@ -30,7 +30,7 @@ def main(): """Entry point to pre_push.py.""" success = True - success &= do_process('flake8', '--exclude=.eggs,docs') + success &= do_process('flake8', '--exclude=.eggs,docs,.tox') success &= do_process('pydocstyle', 'praw') success &= do_process('pylint', '--rcfi...
477a6334482b7cfad0a4b1edb1cf1528824e82e4
tests/test_setuptools_command.py
tests/test_setuptools_command.py
import os from unittest.mock import MagicMock import pytest from isort import setuptools_commands def test_isort_command_smoke(src_dir): """A basic smoke test for the setuptools_commands command""" from distutils.dist import Distribution command = setuptools_commands.ISortCommand(Distribution()) co...
import os from unittest.mock import MagicMock import pytest from isort import setuptools_commands def test_isort_command_smoke(src_dir): """A basic smoke test for the setuptools_commands command""" from distutils.dist import Distribution command = setuptools_commands.ISortCommand(Distribution()) co...
Fix exception test to handle system exceptions
Fix exception test to handle system exceptions
Python
mit
PyCQA/isort,PyCQA/isort
--- +++ @@ -17,7 +17,7 @@ command.finalize_options() try: command.run() - except Exception: + except BaseException: pass command.distribution.package_dir = {"": "isort"} @@ -32,5 +32,5 @@ command.finalize_options() try: command.run() - except Exception: +...
62017dc7dc210d09e8f6753ad86365ac679f4a0a
oscar/apps/catalogue/categories.py
oscar/apps/catalogue/categories.py
from django.db.models import get_model Category = get_model('catalogue', 'category') def create_from_sequence(bits): """ Create categories from an iterable """ if len(bits) == 1: # Get or create root node try: root = Category.objects.get(depth=1, name=bits[0]) exce...
from django.db.models import get_model Category = get_model('catalogue', 'category') def create_from_sequence(bits): """ Create categories from an iterable """ if len(bits) == 1: # Get or create root node name = bits[0] try: # Category names should be unique at the...
Rework category creation from breadcrumbs
Rework category creation from breadcrumbs We now handle MultipleObjectsReturned exceptions, which are possible as we are looking up based on non-unique filters.
Python
bsd-3-clause
vovanbo/django-oscar,adamend/django-oscar,MatthewWilkes/django-oscar,manevant/django-oscar,django-oscar/django-oscar,WadeYuChen/django-oscar,elliotthill/django-oscar,sasha0/django-oscar,WillisXChen/django-oscar,jinnykoo/wuyisj,Jannes123/django-oscar,makielab/django-oscar,WadeYuChen/django-oscar,lijoantony/django-oscar,...
--- +++ @@ -9,17 +9,28 @@ """ if len(bits) == 1: # Get or create root node + name = bits[0] try: - root = Category.objects.get(depth=1, name=bits[0]) + # Category names should be unique at the depth=1 + root = Category.objects.get(depth=1, name=name)...
00a7f018b80d7ddf9cad775ee39d90813879253b
migrations/194-questions-product-migration.py
migrations/194-questions-product-migration.py
from django.utils.encoding import smart_str from kitsune.products.models import Product from kitsune.taggit.models import Tag from kitsune.questions.models import Question tags_to_migrate = { # source tag -> product 'desktop': ['firefox'], 'mobile': ['mobile'] } def assert_equals(a, b): assert a == ...
from django.utils.encoding import smart_str from kitsune.products.models import Product from taggit.models import Tag from kitsune.questions.models import Question tags_to_migrate = { # source tag -> product 'desktop': ['firefox'], 'mobile': ['mobile'] } def assert_equals(a, b): assert a == b, '%s !...
Fix wrong module name in migrations
Fix wrong module name in migrations
Python
bsd-3-clause
MikkCZ/kitsune,dbbhattacharya/kitsune,MziRintu/kitsune,dbbhattacharya/kitsune,YOTOV-LIMITED/kitsune,rlr/kitsune,turtleloveshoes/kitsune,feer56/Kitsune1,Osmose/kitsune,mythmon/kitsune,Osmose/kitsune,safwanrahman/kitsune,Osmose/kitsune,YOTOV-LIMITED/kitsune,rlr/kitsune,Osmose/kitsune,NewPresident1/kitsune,feer56/Kitsune2...
--- +++ @@ -1,7 +1,7 @@ from django.utils.encoding import smart_str from kitsune.products.models import Product -from kitsune.taggit.models import Tag +from taggit.models import Tag from kitsune.questions.models import Question tags_to_migrate = {
09102cb87c41330d1ae670f0e1cea00037c74b5b
src/librement/profile/models.py
src/librement/profile/models.py
from django.db import models from django_enumfield import EnumField from librement.utils.user_data import PerUserData from .enums import AccountEnum, CountryEnum class Profile(PerUserData('profile')): account_type = EnumField(AccountEnum) organisation = models.CharField(max_length=100, blank=True) add...
from django.db import models from django_enumfield import EnumField from librement.utils.user_data import PerUserData from .enums import AccountEnum, CountryEnum class Profile(PerUserData('profile')): account_type = EnumField(AccountEnum) organisation = models.CharField(max_length=100, blank=True) add...
Add model for storing multiple email addresses.
Add model for storing multiple email addresses. Signed-off-by: Chris Lamb <29e6d179a8d73471df7861382db6dd7e64138033@debian.org>
Python
agpl-3.0
rhertzog/librement,rhertzog/librement,rhertzog/librement
--- +++ @@ -18,3 +18,11 @@ zipcode = models.CharField(max_length=100, blank=True) country = EnumField(CountryEnum) + +class Email(models.Model): + user = models.ForeignKey('auth.User', related_name='emails') + + email = models.EmailField(unique=True) + + def __unicode__(self): + return u"%...
402d30d840e7e1d8885412cce7bee2897150a1cf
widelanguagedemo/public/views.py
widelanguagedemo/public/views.py
# -*- coding: utf-8 -*- # # views.py # wide-language-index-demo # """ Public facing frontpage. """ import json import random from flask import (Blueprint, request, render_template, redirect) from . import forms from ..index import util blueprint = Blueprint('public', __name__, static_folder="../static") @bluep...
# -*- coding: utf-8 -*- # # views.py # wide-language-index-demo # """ Public facing frontpage. """ import json import random from flask import (Blueprint, request, render_template, redirect) from . import forms from ..index import util blueprint = Blueprint('public', __name__, static_folder="../static") @bluep...
Fix an error when no samples were found.
Fix an error when no samples were found.
Python
bsd-3-clause
larsyencken/wide-language-demo,larsyencken/wide-language-demo,larsyencken/wide-language-demo,larsyencken/wide-language-demo,larsyencken/wide-language-demo
--- +++ @@ -40,6 +40,8 @@ records = index.get(language) inverted_name = util.get_languages().get(language) + record = None + record_json = None if records: record = random.choice(records) record_json = json.dumps(record, indent=2, sort_keys=True)
cbd6097cc070967963587441e6fdcf40f7c5293b
st2common/st2common/jinja/filters/data.py
st2common/st2common/jinja/filters/data.py
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
Set default_flow_style for yaml jinja filter
Set default_flow_style for yaml jinja filter
Python
apache-2.0
Plexxi/st2,nzlosh/st2,lakshmi-kannan/st2,StackStorm/st2,lakshmi-kannan/st2,tonybaloney/st2,StackStorm/st2,Plexxi/st2,nzlosh/st2,tonybaloney/st2,peak6/st2,tonybaloney/st2,StackStorm/st2,peak6/st2,nzlosh/st2,StackStorm/st2,peak6/st2,nzlosh/st2,lakshmi-kannan/st2,Plexxi/st2,Plexxi/st2
--- +++ @@ -28,4 +28,5 @@ def to_yaml_string(value, indent=4, allow_unicode=True): - return yaml.safe_dump(value, indent=indent, allow_unicode=allow_unicode) + return yaml.safe_dump(value, indent=indent, allow_unicode=allow_unicode, + default_flow_style=False)
042720760a71b5e372489af2335c2fccc5b4905b
ynr/apps/uk_results/views/api.py
ynr/apps/uk_results/views/api.py
from rest_framework import viewsets from django_filters import filters, filterset from api.v09.views import ResultsSetPagination from ..models import CandidateResult, ResultSet from ..serializers import CandidateResultSerializer, ResultSetSerializer class CandidateResultViewSet(viewsets.ModelViewSet): queryset ...
from rest_framework import viewsets from django_filters import filters, filterset from api.v09.views import ResultsSetPagination from ..models import CandidateResult, ResultSet from ..serializers import CandidateResultSerializer, ResultSetSerializer class CandidateResultViewSet(viewsets.ModelViewSet): queryset ...
Update filter args and fix name
Update filter args and fix name The newer version of django-filter uses `field_name` rather than `name`
Python
agpl-3.0
DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative
--- +++ @@ -15,10 +15,10 @@ pagination_class = ResultsSetPagination -class ProductFilter(filterset.FilterSet): - election_id = filters.CharFilter(name="post_election__election__slug") +class ResultSetFilter(filterset.FilterSet): + election_id = filters.CharFilter(field_name="post_election__election__sl...
853108e1c5cd9fca27d0f1dc8324b4b2a4d4b871
pyqode/python/plugins/pyqode_python_plugin.py
pyqode/python/plugins/pyqode_python_plugin.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # pyQode - Python/Qt Code Editor widget # Copyright 2013, Colin Duquesnoy <colin.duquesnoy@gmail.com> # # This software is released under the LGPLv3 license. # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # pyQode - Python/Qt Code Editor widget # Copyright 2013, Colin Duquesnoy <colin.duquesnoy@gmail.com> # # This software is released under the LGPLv3 license. # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see ...
Fix bug with python plugin and pyside
Fix bug with python plugin and pyside
Python
mit
pyQode/pyqode.python,mmolero/pyqode.python,pyQode/pyqode.python,zwadar/pyqode.python
--- +++ @@ -21,9 +21,9 @@ import os if not 'QT_API' in os.environ: os.environ.setdefault("QT_API", "PyQt") -import pcef.python +import pyqode.python -PLUGINS_TYPES = {'QPythonCodeEdit': pcef.python.QPythonCodeEdit} +PLUGINS_TYPES = {'QPythonCodeEdit': pyqode.python.QPythonCodeEdit} try: from pyqode.c...
e9605bd92e67c7f5daf7011f871c3a9d915abe76
core/urls/base.py
core/urls/base.py
from django.conf.urls import patterns, url, include from django.conf.urls.static import static from core.views import Home, register # Use this file to import all other url from game_website import settings urlpatterns = patterns( # Examples: # url(r'^blog/', include('blog.urls')), '', url(r'^$', Home...
from django.conf.urls import patterns, url, include from django.conf.urls.static import static from core.views import Home, register # Use this file to import all other url from game_website import settings urlpatterns = patterns( # Examples: # url(r'^blog/', include('blog.urls')), '', url(r'^$', Home...
Make logout redirect to home
Make logout redirect to home
Python
mit
joshsamara/game-website,joshsamara/game-website,joshsamara/game-website
--- +++ @@ -13,8 +13,8 @@ url(r'^games/', include('core.urls.games')), url(r'^register/$', register, name='register'), url(r'^login/$', 'django.contrib.auth.views.login', name='login'), - url(r'^logout/$', 'django.contrib.auth.views.logout_then_login', name='logout'), - + url(r'^logout/$', 'djang...
198181baa0b095d120b456e7191c0c49c98b3c03
conans/client/generators/xcode.py
conans/client/generators/xcode.py
from conans.model import Generator from conans.paths import BUILD_INFO_XCODE class XCodeGenerator(Generator): template = ''' HEADER_SEARCH_PATHS = $(inherited) {include_dirs} LIBRARY_SEARCH_PATHS = $(inherited) {lib_dirs} OTHER_LDFLAGS = $(inherited) {linker_flags} {libs} GCC_PREPROCESSOR_DEFINITIONS = $(inheri...
from conans.model import Generator from conans.paths import BUILD_INFO_XCODE class XCodeGenerator(Generator): template = ''' HEADER_SEARCH_PATHS = $(inherited) {include_dirs} LIBRARY_SEARCH_PATHS = $(inherited) {lib_dirs} OTHER_LDFLAGS = $(inherited) {linker_flags} {libs} GCC_PREPROCESSOR_DEFINITIONS = $(inheri...
Fix copy and paste error
Fix copy and paste error
Python
mit
conan-io/conan,conan-io/conan,luckielordie/conan,dragly/conan,lasote/conan,dragly/conan,tivek/conan,luckielordie/conan,memsharded/conan,conan-io/conan,memsharded/conan,birsoyo/conan,lasote/conan,memsharded/conan,mropert/conan,Xaltotun/conan,memsharded/conan,Xaltotun/conan,mropert/conan,birsoyo/conan,tivek/conan
--- +++ @@ -15,7 +15,7 @@ ''' def __init__(self, deps_cpp_info, cpp_info): - super(VisualStudioGenerator, self).__init__(deps_cpp_info, cpp_info) + super(XCodeGenerator, self).__init__(deps_cpp_info, cpp_info) self.include_dirs = " ".join('"%s"' % p.replace("\\", "/") ...
80bb5557f78268545139cd37f593278e35979fd5
corehq/mobile_flags.py
corehq/mobile_flags.py
from collections import namedtuple MobileFlag = namedtuple('MobileFlag', 'slug label') MULTIPLE_APPS_UNLIMITED = MobileFlag( 'multiple_apps_unlimited', 'Enable unlimited multiple apps' )
from collections import namedtuple MobileFlag = namedtuple('MobileFlag', 'slug label') MULTIPLE_APPS_UNLIMITED = MobileFlag( 'multiple_apps_unlimited', 'Enable unlimited multiple apps' ) ADVANCED_SETTINGS_ACCESS = MobileFlag( 'advanced_settings_access', 'Enable access to advanced settings' )
Add Flag enum for settings access
Add Flag enum for settings access
Python
bsd-3-clause
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
--- +++ @@ -8,3 +8,8 @@ 'multiple_apps_unlimited', 'Enable unlimited multiple apps' ) + +ADVANCED_SETTINGS_ACCESS = MobileFlag( + 'advanced_settings_access', + 'Enable access to advanced settings' +)
26e2feb6f2dfe74ade46cf871167101599c0acba
app/timetables/models.py
app/timetables/models.py
from __future__ import unicode_literals from django.db import models from common.mixins import ForceCapitalizeMixin class Weekday(ForceCapitalizeMixin, models.Model): """Model representing the day of the week.""" name = models.CharField(max_length=60, unique=True) capitalized_field_names = ('name',) ...
from __future__ import unicode_literals from django.db import models from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ from common.mixins import ForceCapitalizeMixin class Weekday(ForceCapitalizeMixin, models.Model): """Model representing the day of the w...
Update clean method to ensure that meal end_time is not same as or less than meal start_time
Update clean method to ensure that meal end_time is not same as or less than meal start_time
Python
mit
teamtaverna/core
--- +++ @@ -1,6 +1,8 @@ from __future__ import unicode_literals from django.db import models +from django.core.exceptions import ValidationError +from django.utils.translation import ugettext_lazy as _ from common.mixins import ForceCapitalizeMixin @@ -30,5 +32,10 @@ capitalized_field_names = ('name',...
922c6350fda965068927611348bdd9127ee405d9
scaffolder/commands/vcs.py
scaffolder/commands/vcs.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from optparse import make_option from optparse import OptionParser from scaffolder.core.commands import BaseCommand from scaffolder.vcs import VCS class VcsCommand(BaseCommand): option_list = BaseCommand.option_list + ( make_option( "-u", ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from optparse import make_option from optparse import OptionParser from scaffolder.core.commands import BaseCommand from scaffolder.vcs import VCS class VcsCommand(BaseCommand): option_list = BaseCommand.option_list + ( make_option( "-u", ...
Remove __init__ method, not needed.
VcsCommand: Remove __init__ method, not needed.
Python
mit
goliatone/minions
--- +++ @@ -28,26 +28,7 @@ ), ) - def __init__(self, name, help='', aliases=(), stdout=None, stderr=None): - help = 'Command to clone github repos' - aliases = ('git','hg',) - #TODO: Move to BaseCommand, create methods and have each subcommand override - parser = OptionP...
7d6ecfe52f60ac07c57bbd6e966cded11ce40e4c
scripts/hydrafw-version.py
scripts/hydrafw-version.py
import sys from optparse import OptionParser from datetime import * from git import * if __name__=="__main__": usage = """ %prog outfile.txt""" parser = OptionParser(usage=usage) (options, args) = parser.parse_args() if len(args)==1: sys.stdout = open(args[0], 'w') git=Repo().git print '#define HYDRAFW_GIT_TA...
import sys from optparse import OptionParser from datetime import * from git import * if __name__=="__main__": usage = """ %prog outfile.txt""" parser = OptionParser(usage=usage) (options, args) = parser.parse_args() if len(args)==1: sys.stdout = open(args[0], 'w') git=Repo().git print '#define HYDRAFW_GIT_TA...
Fix python script dirty flag for firmware version
Fix python script dirty flag for firmware version
Python
apache-2.0
Baldanos/hydrafw,hydrabus/hydrafw,hydrabus/hydrafw,hydrabus/hydrafw,Baldanos/hydrafw,Baldanos/hydrafw
--- +++ @@ -12,11 +12,8 @@ if len(args)==1: sys.stdout = open(args[0], 'w') git=Repo().git - print '#define HYDRAFW_GIT_TAG "' + git.describe(tags=True,always=True) + '"' - if Repo().is_dirty: - print '#define HYDRAFW_GIT_HASH "' + git.rev_parse('HEAD',short=True) + '-dirty"' - else: - print '#defin...
7420d9208067f5144b301ff00d962b0b84e2a0f3
tinymce/settings.py
tinymce/settings.py
import os from django.conf import settings DEFAULT_CONFIG = getattr(settings, 'TINYMCE_DEFAULT_CONFIG', {'theme': "simple", 'relative_urls': False}) USE_SPELLCHECKER = getattr(settings, 'TINYMCE_SPELLCHECKER', False) USE_COMPRESSOR = getattr(settings, 'TINYMCE_COMPRESSOR', False) USE_FILEBROWSER = getattr(s...
import os from django.conf import settings DEFAULT_CONFIG = getattr(settings, 'TINYMCE_DEFAULT_CONFIG', {'theme': "simple", 'relative_urls': False}) USE_SPELLCHECKER = getattr(settings, 'TINYMCE_SPELLCHECKER', False) USE_COMPRESSOR = getattr(settings, 'TINYMCE_COMPRESSOR', False) USE_FILEBROWSER = getattr(s...
Use STATIC_URL/STATIC_ROOT when using django.contrib.staticfiles (django 1.3)
Use STATIC_URL/STATIC_ROOT when using django.contrib.staticfiles (django 1.3)
Python
mit
pterk/django-tinymce,pterk/django-tinymce
--- +++ @@ -11,9 +11,10 @@ USE_FILEBROWSER = getattr(settings, 'TINYMCE_FILEBROWSER', 'filebrowser' in settings.INSTALLED_APPS) -if 'staticfiles' in settings.INSTALLED_APPS: - JS_URL = os.path.join(settings.STATIC_URL, 'tiny_mce/tiny_mce.js') - JS_ROOT = os.path.join(settings.STATIC_ROOT, 'tiny_mce'...
287609cc21ae7024507a662b2afe13520fdf8eb7
tests/test_mysql.py
tests/test_mysql.py
import unittest import logging; logger = logging.getLogger() from checks.db.mysql import MySql class TestMySql(unittest.TestCase): def setUp(self): # This should run on pre-2.7 python so no skiptest try: import MySQLdb self.mysql = MySql(logger) except ImportError: ...
import unittest import logging; logger = logging.getLogger() from checks.db.mysql import MySql from tests.common import load_check import time class TestMySql(unittest.TestCase): def testChecks(self): agentConfig = { 'mysql_server': 'localhost', 'mysql_user': "datadog", 'mysql_pas...
Fix mysql check to use checks.d version
Fix mysql check to use checks.d version
Python
bsd-3-clause
eeroniemi/dd-agent,indeedops/dd-agent,relateiq/dd-agent,Shopify/dd-agent,remh/dd-agent,huhongbo/dd-agent,darron/dd-agent,jamesandariese/dd-agent,jraede/dd-agent,eeroniemi/dd-agent,urosgruber/dd-agent,jvassev/dd-agent,eeroniemi/dd-agent,polynomial/dd-agent,lookout/dd-agent,jvassev/dd-agent,Mashape/dd-agent,Shopify/dd-ag...
--- +++ @@ -2,20 +2,30 @@ import logging; logger = logging.getLogger() from checks.db.mysql import MySql +from tests.common import load_check +import time class TestMySql(unittest.TestCase): - def setUp(self): - # This should run on pre-2.7 python so no skiptest - try: - import MySQ...
5b99fa7adf8ce65309f47d6456ecba32b02995a4
tests/utils.py
tests/utils.py
import os import sphinx_tests_util from xml.etree import ElementTree from xml.dom import minidom # ============================================================================= # Utility functions def srcdir(name): test_root = os.path.abspath(os.path.dirname(__file__)) return os.path.join(test_r...
import os import sphinx_tests_util from xml.etree import ElementTree from xml.dom import minidom # ============================================================================= # Utility functions def srcdir(name): test_root = os.path.abspath(os.path.dirname(__file__)) return os.path.join(test_r...
Use fresh build environment by default in tests
Use fresh build environment by default in tests
Python
apache-2.0
t4ngo/sphinxcontrib-traceables
--- +++ @@ -22,6 +22,13 @@ def with_app(*args, **kwargs): kwargs = kwargs.copy() + + # Expand test data directory. if "srcdir" in kwargs: kwargs["srcdir"] = srcdir(kwargs["srcdir"]) + + # By default use a fresh build environment. + if "freshenv" not in kwargs: + kwargs["freshenv"...
f54fd0bf65d731b4f25cfc2ddffb8d6f472e0d7c
examples/eiger_use_case.py
examples/eiger_use_case.py
'''Virtual datasets: The 'Eiger' use case https://support.hdfgroup.org/HDF5/docNewFeatures/VDS/HDF5-VDS-requirements-use-cases-2014-12-10.pdf ''' import h5py import numpy as np files = ['1.h5', '2.h5', '3.h5', '4.h5', '5.h5'] entry_key = 'data' # where the data is inside of the source files. sh = h5py.File(files[0]...
'''Virtual datasets: The 'Eiger' use case https://support.hdfgroup.org/HDF5/docNewFeatures/VDS/HDF5-VDS-requirements-use-cases-2014-12-10.pdf ''' import h5py import numpy as np files = ['1.h5', '2.h5', '3.h5', '4.h5', '5.h5'] entry_key = 'data' # where the data is inside of the source files. sh = h5py.File(files[0]...
Fix layout for Eiger example
Fix layout for Eiger example
Python
bsd-3-clause
h5py/h5py,h5py/h5py,h5py/h5py
--- +++ @@ -11,7 +11,7 @@ entry_key = 'data' # where the data is inside of the source files. sh = h5py.File(files[0], 'r')[entry_key].shape # get the first ones shape. -layout = h5py.VirtualLayout(shape=(len(files),) + sh, dtype=np.float) +layout = h5py.VirtualLayout(shape=(len(files) * sh[0], ) + sh[1:], dtype=n...
dd2c92bea635d7cfc93b437ce32266126bceb1e9
qipipe/helpers/bolus_arrival.py
qipipe/helpers/bolus_arrival.py
class BolusArrivalError(Exception): pass def bolus_arrival_index(time_series): """ Determines the DCE bolus arrival series index. The bolus arrival is the first series with a difference in average signal larger than double the difference from first two points. :param time_series: the 4D NiFT...
class BolusArrivalError(Exception): pass def bolus_arrival_index(time_series): """ Determines the DCE bolus arrival time point index. The bolus arrival is the first occurence of a difference in average signal larger than double the difference from first two points. :param time_series: the 4D...
Change series to time point.
Change series to time point.
Python
bsd-2-clause
ohsu-qin/qipipe
--- +++ @@ -4,12 +4,12 @@ def bolus_arrival_index(time_series): """ - Determines the DCE bolus arrival series index. The bolus arrival is - the first series with a difference in average signal larger than + Determines the DCE bolus arrival time point index. The bolus arrival + is the first occuren...
ffd1ba9eee804fdd55e86908b158a4ad94f2f366
Tools/idle/ZoomHeight.py
Tools/idle/ZoomHeight.py
# Sample extension: zoom a window to maximum height import re import sys class ZoomHeight: menudefs = [ ('windows', [ ('_Zoom Height', '<<zoom-height>>'), ]) ] windows_keydefs = { '<<zoom-height>>': ['<Alt-F2>'], } unix_keydefs = { '<<zoom-height>>': ...
# Sample extension: zoom a window to maximum height import re import sys class ZoomHeight: menudefs = [ ('windows', [ ('_Zoom Height', '<<zoom-height>>'), ]) ] windows_keydefs = { '<<zoom-height>>': ['<Alt-F2>'], } unix_keydefs = { '<<zoom-height>>': ...
Use only the height to decide whether to zoom in or out.
Use only the height to decide whether to zoom in or out.
Python
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
--- +++ @@ -29,14 +29,15 @@ top.bell() return width, height, x, y = map(int, m.groups()) - height = top.winfo_screenheight() + newheight = top.winfo_screenheight() if sys.platform == 'win32': - y = 0 - height = height - 72 + ne...
1d0570ca75419f441aa1324de78051534efba74b
search_engine.py
search_engine.py
import requests from bs4 import BeautifulSoup def download_url(url): r = requests.get(url) if r.status_code != 200: raise Exception('Non-OK status code: {}'.format(r.status_code)) return r.text def parse_text(html): bs = BeautifulSoup(html, 'html.parser') return bs.select('div.usertext-b...
import requests from bs4 import BeautifulSoup import os.path from base64 import b16encode import time def download_reddit_url(url): assert url.startswith('https://www.reddit.com/r/learnprogramming') headers = {'User-Agent':'JustSearch bot version 0.1'} r = requests.get(url, headers=headers) if r.statu...
Create files with posts and can go to the next page.
Create files with posts and can go to the next page.
Python
mit
tori-smile/JustSearch
--- +++ @@ -1,15 +1,47 @@ import requests from bs4 import BeautifulSoup +import os.path +from base64 import b16encode +import time -def download_url(url): - r = requests.get(url) +def download_reddit_url(url): + assert url.startswith('https://www.reddit.com/r/learnprogramming') + headers = {'User-Agent...
f4c1837eaadc9dfd2510e64d8dc7838ccc884379
python/servo/packages.py
python/servo/packages.py
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at https://mozilla.org/MPL/2.0/. WINDOWS_MSVC = { "cmake": "3.14.3", "llvm": "8.0.0", "moztools": "3.2", "ninja": "1.7.1", "nuget": ...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at https://mozilla.org/MPL/2.0/. WINDOWS_MSVC = { "cmake": "3.14.3", "llvm": "8.0.1", "moztools": "3.2", "ninja": "1.7.1", "nuget": ...
Update windows llvm to 8.0.1.
Update windows llvm to 8.0.1.
Python
mpl-2.0
KiChjang/servo,KiChjang/servo,splav/servo,KiChjang/servo,KiChjang/servo,splav/servo,splav/servo,KiChjang/servo,splav/servo,KiChjang/servo,splav/servo,splav/servo,KiChjang/servo,splav/servo,splav/servo,KiChjang/servo,KiChjang/servo,KiChjang/servo,splav/servo,splav/servo
--- +++ @@ -4,7 +4,7 @@ WINDOWS_MSVC = { "cmake": "3.14.3", - "llvm": "8.0.0", + "llvm": "8.0.1", "moztools": "3.2", "ninja": "1.7.1", "nuget": "08-08-2019",
73a96c3ddcf19df6534ae9dd57bcdca8d28ec615
registration/__init__.py
registration/__init__.py
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module def get_backend(): """ Return an instance of the registration backend for use on this site, as determined by the ``REGISTRATION_BACKEND`` setting. Raise ``django.cor...
from django.conf import settings from django.core.exceptions import ImproperlyConfigured # TODO: When Python 2.7 is released this becomes a try/except falling # back to Django's implementation. from django.utils.importlib import import_module def get_backend(): """ Return an instance of the registration backe...
Add reminder to myself to to importlib fallback.
Add reminder to myself to to importlib fallback.
Python
bsd-3-clause
lubosz/django-registration,lubosz/django-registration
--- +++ @@ -1,5 +1,8 @@ from django.conf import settings from django.core.exceptions import ImproperlyConfigured + +# TODO: When Python 2.7 is released this becomes a try/except falling +# back to Django's implementation. from django.utils.importlib import import_module def get_backend():
f2294b289b6eaa9c103f667dd3252429aac360e1
tools/miranda/miranda_parser.py
tools/miranda/miranda_parser.py
import sys # get hits from miranda scans cap = "" with open (sys.argv[1]) as infile1: for line1 in infile1: line1 = line1.strip() if "%" in line1 and "Forward:" not in line1: #print(line1) cap = cap + line1 + "\n" allregnettf = open(sys.argv[2], "w") allregnettf.write(cap) a...
import sys # get hits from miranda scans with open(sys.argv[1]) as infile1: with open(sys.argv[2], "w") as outfile: for line1 in infile1: if "%" in line1 and "Forward:" not in line1: outfile.write(line1)
Write output on the file.
Write output on the file.
Python
mit
anilthanki/tgac-galaxytools,TGAC/earlham-galaxytools,anilthanki/tgac-galaxytools,TGAC/earlham-galaxytools,TGAC/earlham-galaxytools,TGAC/earlham-galaxytools,TGAC/tgac-galaxytools,PerlaTroncosoRey/tgac-galaxytools,wjurkowski/earlham-galaxytools,TGAC/tgac-galaxytools,anilthanki/tgac-galaxytools,anilthanki/tgac-galaxytools...
--- +++ @@ -1,13 +1,8 @@ import sys # get hits from miranda scans -cap = "" -with open (sys.argv[1]) as infile1: - for line1 in infile1: - line1 = line1.strip() - if "%" in line1 and "Forward:" not in line1: - #print(line1) - cap = cap + line1 + "\n" -allregnettf = open(sys....
d70e563c3119e59de2ae23a77724e0fd803b768b
Python/tests.py
Python/tests.py
import unittest from BKKCrypt import BKKCrypt import urllib.request class TestEncodeStrings(unittest.TestCase): def test_simple_strings(self): self.assertEqual(BKKCrypt('adminadmin'), 'adminadmin') self.assertEqual(BKKCrypt('hunter2'), 'hunter2') self.assertEqual(BKKCrypt('password'), 'pas...
import unittest from BKKCrypt import BKKCrypt import urllib.request class TestEncodeStrings(unittest.TestCase): def test_simple_strings(self): self.assertEqual(BKKCrypt('adminadmin'), 'adminadmin') self.assertEqual(BKKCrypt('hunter2'), 'hunter2') self.assertEqual(BKKCrypt('password'), 'pas...
Remove trailing newlines from test cases
Remove trailing newlines from test cases
Python
mit
moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCrypt,moszinet/BKKCr...
--- +++ @@ -25,6 +25,7 @@ blns_request = urllib.request.urlretrieve("https://raw.githubusercontent.com/minimaxir/big-list-of-naughty-strings/master/blns.txt") with open(blns_request[0]) as blns_file: blns = blns_file.readlines() + blns = list(map(lambda x: x.strip(), blns)) def test_b...
819b968a3bb73c1e8fed1a9c5440c8122a6dec9e
plugin/core/logging.py
plugin/core/logging.py
import traceback from .settings import settings, PLUGIN_NAME def debug(*args): """Print args to the console if the "debug" setting is True.""" if settings.log_debug: printf(*args) def exception_log(message, ex): print(message) ex_traceback = ex.__traceback__ print(''.join(traceback.forma...
import traceback from .settings import settings, PLUGIN_NAME def debug(*args): """Print args to the console if the "debug" setting is True.""" if settings.log_debug: printf(*args) def exception_log(message, ex): print(message) ex_traceback = ex.__traceback__ print(''.join(traceback.forma...
Replace binary argument with hardcoded text "server"
Replace binary argument with hardcoded text "server"
Python
mit
tomv564/LSP
--- +++ @@ -14,8 +14,8 @@ print(''.join(traceback.format_exception(ex.__class__, ex, ex_traceback))) -def server_log(binary, *args): - printf(*args, prefix=binary) +def server_log(*args): + printf(*args, prefix="server") def printf(*args, prefix=PLUGIN_NAME):
45542f012b3dc6d089bc991529523a4ea6401b35
br_rss/boilerroomtv/management/commands/scrape_all.py
br_rss/boilerroomtv/management/commands/scrape_all.py
from django.core.management.base import BaseCommand from boilerroomtv.tasks import scrape_genres, scrape_all_recordings, scrape_channels class Command(BaseCommand): def handle(self, *args, **options): scrape_genres() scrape_all_recordings() scrape_channels()
from django.core.management.base import BaseCommand from ...tasks import scrape_genres, scrape_all_recordings, scrape_channels class Command(BaseCommand): def handle(self, *args, **options): scrape_genres() scrape_all_recordings() scrape_channels()
Use relative import in command.
Use relative import in command.
Python
mpl-2.0
jeffbr13/br-rss,jeffbr13/br-rss
--- +++ @@ -1,6 +1,6 @@ from django.core.management.base import BaseCommand -from boilerroomtv.tasks import scrape_genres, scrape_all_recordings, scrape_channels +from ...tasks import scrape_genres, scrape_all_recordings, scrape_channels class Command(BaseCommand):
d3f0d83b0c783d2f15a6f5eaf6fd4ace426307a6
tests/__init__.py
tests/__init__.py
import os import sys import unittest def suite(): MODULE_DIR = os.path.join(os.path.dirname(__file__), '..') MODULE_DIR = os.path.abspath(MODULE_DIR) sys.path.insert(0, MODULE_DIR) sys.path.insert(0, os.path.dirname(__file__)) SUB_UNITS = os.path.dirname(__file__) SUB_UNITS = os.listdir(SUB_U...
from os import walk, chdir from os.path import join, dirname, splitext, abspath, relpath import sys import unittest MODULE_DIR = join(dirname(__file__), '..') MODULE_DIR = abspath(MODULE_DIR) def walker(opath='.'): for path, folders, files in walk(opath): for filename in files: if filename.st...
Rework for tests in subdirectories
Rework for tests in subdirectories
Python
mit
Mause/pytransperth,Mause/pytransperth
--- +++ @@ -1,22 +1,28 @@ -import os +from os import walk, chdir +from os.path import join, dirname, splitext, abspath, relpath import sys import unittest +MODULE_DIR = join(dirname(__file__), '..') +MODULE_DIR = abspath(MODULE_DIR) + + +def walker(opath='.'): + for path, folders, files in walk(opath): + ...
db0ef5f31d82729f654d1d07fa39c1168aa5e5f7
tests/__init__.py
tests/__init__.py
# -*- coding: utf-8 -*- # # (C) Pywikipedia bot team, 2007 # # Distributed under the terms of the MIT license. # __version__ = '$Id$' import os import pywikibot.data.api from pywikibot.data.api import Request as _original_Request from pywikibot.data.api import CachedRequest class TestRequest(CachedRequest): def...
# -*- coding: utf-8 -*- # # (C) Pywikipedia bot team, 2007 # # Distributed under the terms of the MIT license. # __version__ = '$Id$' import os import pywikibot.data.api from pywikibot.data.api import Request as _original_Request from pywikibot.data.api import CachedRequest class TestRequest(CachedRequest): def...
Disable printing of API parameters which could leak private info and were generally not useful
Disable printing of API parameters which could leak private info and were generally not useful Change-Id: I8a8a8d10799df4f61e4465fe60b6c7efbefbd962
Python
mit
npdoty/pywikibot,PersianWikipedia/pywikibot-core,trishnaguha/pywikibot-core,jayvdb/pywikibot-core,emijrp/pywikibot-core,wikimedia/pywikibot-core,xZise/pywikibot-core,happy5214/pywikibot-core,hasteur/g13bot_tools_new,jayvdb/pywikibot-core,magul/pywikibot-core,h4ck3rm1k3/pywikibot-core,TridevGuha/pywikibot-core,hasteur/g...
--- +++ @@ -24,13 +24,6 @@ def _expired(self, dt): return False - def submit(self): - cached_available = self._load_cache() - if not cached_available: - print str(self) - return super(TestRequest, self).submit() - - def patch_request(): pywikibot.data.api.Reque...
96776b33fcf2ebbd2de4748c38d8be9c63fdec71
tests/conftest.py
tests/conftest.py
from django.conf import settings from django.core.management import call_command def pytest_configure(): settings.configure( ROOT_URLCONF='tests.urls', ALLOWED_HOSTS=['testserver'], DATABASES={ 'default': { 'ENGINE': 'django.db.backends.sqlite3', ...
from django.conf import settings from django.core.management import call_command def pytest_configure(): settings.configure( ROOT_URLCONF='tests.urls', ALLOWED_HOSTS=['testserver'], DATABASES={ 'default': { 'ENGINE': 'django.db.backends.sqlite3', ...
Replace --noinput with interactive=False in syncdb command call
Replace --noinput with interactive=False in syncdb command call
Python
bsd-2-clause
yprez/django-rest-assured,pombredanne/django-rest-assured,ydaniv/django-rest-assured
--- +++ @@ -28,7 +28,7 @@ try: from django import setup except ImportError: - call_command('syncdb', '--noinput') + call_command('syncdb', interactive=False) else: setup() call_command('migrate')
40711cb50189c4c39ed5a60c16910646a00f9acc
docker/types/daemon.py
docker/types/daemon.py
import socket try: import requests.packages.urllib3 as urllib3 except ImportError: import urllib3 class CancellableStream(object): """ Stream wrapper for real-time events, logs, etc. from the server. Example: >>> events = client.events() >>> for event in events: ... pri...
import socket try: import requests.packages.urllib3 as urllib3 except ImportError: import urllib3 class CancellableStream(object): """ Stream wrapper for real-time events, logs, etc. from the server. Example: >>> events = client.events() >>> for event in events: ... pri...
Fix cancellable streams on Windows clients + HTTPS transport
Fix cancellable streams on Windows clients + HTTPS transport Signed-off-by: Joffrey F <2e95f49799afcec0080c0aeb8813776d949e0768@docker.com>
Python
apache-2.0
youhong316/docker-py,docker/docker-py,funkyfuture/docker-py,funkyfuture/docker-py,docker/docker-py,vdemeester/docker-py,youhong316/docker-py,vdemeester/docker-py
--- +++ @@ -57,6 +57,8 @@ else: sock = sock_fp._sock + if isinstance(sock, urllib3.contrib.pyopenssl.WrappedSocket): + sock = sock.socket sock.shutdown(socket.SHUT_RDWR) sock.close()
07b7efdc848deeb7634f23cdb878774a99c9c535
ambassador/tests/t_grpc_bridge.py
ambassador/tests/t_grpc_bridge.py
import json from kat.harness import Query from abstract_tests import AmbassadorTest, ServiceType, EGRPC class AcceptanceGrpcBridgeTest(AmbassadorTest): target: ServiceType def init(self): self.target = EGRPC() def config(self): yield self, self.format(""" --- apiVersion: ambassador/v0 ...
from kat.harness import Query from abstract_tests import AmbassadorTest, ServiceType, EGRPC class AcceptanceGrpcBridgeTest(AmbassadorTest): target: ServiceType def init(self): self.target = EGRPC() def config(self): yield self, self.format(""" --- apiVersion: ambassador/v0 kind: Module...
Clean up existing gRPC bridge test (make it like t_tcpmapping.py)
Clean up existing gRPC bridge test (make it like t_tcpmapping.py) - Remove redundant HTTP status assertions - Adjust formatting - Remove unused import
Python
apache-2.0
datawire/ambassador,datawire/ambassador,datawire/ambassador,datawire/ambassador,datawire/ambassador
--- +++ @@ -1,5 +1,3 @@ -import json - from kat.harness import Query from abstract_tests import AmbassadorTest, ServiceType, EGRPC @@ -34,18 +32,18 @@ def queries(self): # [0] - yield Query(self.url("echo.EchoService/Echo"), headers={ "content-type": "application/grpc", - ...
032d1061454482db730e35a17fa058ba1ed5f66a
app/codeselfstudy/models/posts.py
app/codeselfstudy/models/posts.py
import datetime import mongoengine as me # Based on: https://flask-mongoengine.readthedocs.org/en/latest/ class Post(me.Document): title = me.StringField(max_length=120, required=True) created_at = me.DateTimeField(default=datetime.datetime.now, required=True) content = me.StringField(required=True) ...
import datetime import mongoengine as me # Based on: https://flask-mongoengine.readthedocs.org/en/latest/ class Post(me.Document): title = me.StringField(max_length=120, required=True) created_at = me.DateTimeField(default=datetime.datetime.now, required=True) content = me.StringField(required=True) ...
Add comment class to models
Add comment class to models
Python
mit
CodeSelfStudy/codeselfstudy_flask,CodeSelfStudy/codeselfstudy_flask,CodeSelfStudy/codeselfstudy_flask,harli123/codeselfstudy_flask,harli123/codeselfstudy_flask,harli123/codeselfstudy_flask
--- +++ @@ -9,6 +9,17 @@ created_at = me.DateTimeField(default=datetime.datetime.now, required=True) content = me.StringField(required=True) published = me.BooleanField(required=True) + slug = me.StringField(max_length=155, required=True) + comments = me.ListField(me.EmbeddedDocumentField('Commen...
957422118d31def826d336f26152de1d0399fe4e
py/src/ai/h2o/sparkling/H2OConf.py
py/src/ai/h2o/sparkling/H2OConf.py
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
Remove deprecated method H2OContext.getOrCreate with sparkSession or SparkContext argument
[SW-1971][FollowUp] Remove deprecated method H2OContext.getOrCreate with sparkSession or SparkContext argument
Python
apache-2.0
h2oai/sparkling-water,h2oai/sparkling-water,h2oai/sparkling-water,h2oai/sparkling-water
--- +++ @@ -15,7 +15,6 @@ # limitations under the License. # -import warnings from ai.h2o.sparkling.ExternalBackendConf import ExternalBackendConf from ai.h2o.sparkling.Initializer import Initializer from ai.h2o.sparkling.InternalBackendConf import InternalBackendConf @@ -24,12 +23,8 @@ class H2OConf(Shar...
054f9ce0a8d08b0ec740d7b6d26a8b5553962490
src/factories.py
src/factories.py
from chassis.models import db from chassis import models from faker import Factory as Fake from factory.alchemy import SQLAlchemyModelFactory import factory import logging #Suppress factory-boy debug data factory_log = logging.getLogger("factory") factory_log.setLevel(logging.WARNING) faker = Fake.create() class ...
from chassis.models import db from chassis import models from faker import Factory as Fake from factory.alchemy import SQLAlchemyModelFactory import factory import logging #Suppress factory-boy debug data factory_log = logging.getLogger("factory") factory_log.setLevel(logging.WARNING) faker = Fake.create() class ...
Fix faker calls since API changed.
Fix faker calls since API changed.
Python
mit
makmanalp/flask-chassis
--- +++ @@ -18,7 +18,7 @@ FACTORY_FOR = models.Cat FACTORY_SESSION = db.session - id = factory.LazyAttribute(lambda x: faker.unixTime()) - born_at = factory.LazyAttribute(lambda x: faker.unixTime()) + id = factory.LazyAttribute(lambda x: faker.unix_time()) + born_at = factory.LazyAttribute(lam...
daf68a1475530f4f0cb2e78e2ccf6ecbca821a8e
rfb_utils/prefs_utils.py
rfb_utils/prefs_utils.py
from ..rman_constants import RFB_PREFS_NAME import bpy def get_addon_prefs(): try: addon = bpy.context.preferences.addons[RFB_PREFS_NAME] return addon.preferences except: return None def get_pref(pref_name='', default=None): """ Return the value of a preference Args: p...
from ..rman_constants import RFB_PREFS_NAME import bpy def get_addon_prefs(): try: addon = bpy.context.preferences.addons[RFB_PREFS_NAME] return addon.preferences except: # try looking for all variants of RFB_PREFS_NAME for k, v in bpy.context.preferences.addons.items(): ...
Add some fallback code when looking for our prefs object.
Add some fallback code when looking for our prefs object.
Python
mit
prman-pixar/RenderManForBlender,adminradio/RenderManForBlender,prman-pixar/RenderManForBlender
--- +++ @@ -6,6 +6,10 @@ addon = bpy.context.preferences.addons[RFB_PREFS_NAME] return addon.preferences except: + # try looking for all variants of RFB_PREFS_NAME + for k, v in bpy.context.preferences.addons.items(): + if RFB_PREFS_NAME in k: + return v ...
753b2b6d04d0808e92dec0337d75a821d171e8e6
sahara/tests/__init__.py
sahara/tests/__init__.py
# Copyright (c) 2014 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
# Copyright (c) 2014 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Apply monkeypatching from eventlet before the tests starts
Apply monkeypatching from eventlet before the tests starts This should prevent issues with classes which may not have been otherwise instrumented (and sahara_engine and sahara_all do the instrumentation at the beginning anyway). Issues have been notices with eventlet 0.20.1 which now instruments subprocess. Change-I...
Python
apache-2.0
openstack/sahara,openstack/sahara
--- +++ @@ -13,6 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from sahara.utils import patches +patches.patch_all() + import oslo_i18n # NOTE(slukjanov): i18n.enable_lazy() must be called before
901bd73c61fbc6d9d8971ec1ce12e64100e633cb
base/settings/testing.py
base/settings/testing.py
# -*- coding: utf-8 -*- import os from .base import Base as Settings class Testing(Settings): # Database Configuration. # ------------------------------------------------------------------ DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME...
# -*- coding: utf-8 -*- import os from .base import Base as Settings class Testing(Settings): # Database Configuration. # ------------------------------------------------------------------ DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME...
Fix the Celery configuration under test settings.
Fix the Celery configuration under test settings.
Python
apache-2.0
hello-base/web,hello-base/web,hello-base/web,hello-base/web
--- +++ @@ -14,6 +14,11 @@ } } + # django-celery. + # ------------------------------------------------------------------ + Settings.INSTALLED_APPS += ['kombu.transport.django', 'djcelery',] + BROKER_URL = 'django://' + # django-haystack. # ----------------------------------------...
0b152333c30d061df64376bb036c5fcd20896c36
go/billing/urls.py
go/billing/urls.py
from django.conf.urls import patterns, url from go.billing import views urlpatterns = patterns( '', url( r'^(?P<statement_id>[\d]+)', views.statement_view, name='pdf_statement') )
from django.conf.urls import patterns, url from go.billing import views urlpatterns = patterns( '', url( r'^statement/(?P<statement_id>[\d]+)', views.statement_view, name='pdf_statement') )
Move statement PDF URL off the root of the billing URL namespace.
Move statement PDF URL off the root of the billing URL namespace.
Python
bsd-3-clause
praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go
--- +++ @@ -4,6 +4,6 @@ urlpatterns = patterns( '', url( - r'^(?P<statement_id>[\d]+)', views.statement_view, + r'^statement/(?P<statement_id>[\d]+)', views.statement_view, name='pdf_statement') )
86ec56b0de1e822af2e03fedd2a67a3c555a7d18
versebot/regex.py
versebot/regex.py
""" VerseBot for reddit By Matthieu Grieger regex.py Copyright (c) 2015 Matthieu Grieger (MIT License) """ import re def find_verses(message_body): """ Uses regex to search comment body for verse quotations. Returns a list of matches if found, None otherwise. """ regex = (r"(?<=\[)(?P<book>[\d\w\s]+)...
""" VerseBot for reddit By Matthieu Grieger regex.py Copyright (c) 2015 Matthieu Grieger (MIT License) """ import re def find_verses(message_body): """ Uses regex to search comment body for verse quotations. Returns a list of matches if found, None otherwise. """ regex = (r"(?<=\[)(?P<book>[\d\w\s]+)...
Fix return value from find_verses()
Fix return value from find_verses()
Python
mit
Matthew-Arnold/slack-versebot,Matthew-Arnold/slack-versebot
--- +++ @@ -14,4 +14,8 @@ regex = (r"(?<=\[)(?P<book>[\d\w\s]+)(?P<chapter>\d+)\:?(?P<verse>\d+" + r"\-?\d*)?\s*\(?(?P<translation>[\w\-\d]+)?\)?(?=\])") - return re.findall(regex, message_body) + matches = re.findall(regex, message_body) + if len(matches) == 0: + return None + ...
9bebf1c0cc9c0a03cde23fb1b92ae983f1fc3fa8
examples/check_args.py
examples/check_args.py
from __future__ import print_function @check.arg(0, check.int_value(min=0)) @check.arg(1, check.int_value(min=0)) def add_positive_integers(int1, int2): return int1 + int2 def main(): print(add_positive_integers(1, 5)) print(add_positive_integers(0, 5)) print(add_positive_integers(-1, 5)) if __nam...
from __future__ import print_function from collections import defaultdict def check_arg(arg_id, *constraints): return ArgCheckAdder(arg_id, *constraints) def check_int_value(min=None, max=None): def constraint(arg_id, args, kwargs): assert isinstance(args[arg_id], int) assert args[arg_id] >=...
Make isolated arg check example
Make isolated arg check example
Python
mit
explosion/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc,spacy-io/thinc,spacy-io/thinc,explosion/thinc
--- +++ @@ -1,8 +1,46 @@ from __future__ import print_function +from collections import defaultdict -@check.arg(0, check.int_value(min=0)) -@check.arg(1, check.int_value(min=0)) +def check_arg(arg_id, *constraints): + return ArgCheckAdder(arg_id, *constraints) + + +def check_int_value(min=None, max=None): + ...
f58cce56103b98e783fa0df5bae0ae0985f7dc8e
rmake_plugins/multinode_client/nodetypes.py
rmake_plugins/multinode_client/nodetypes.py
import inspect import sys import types from rmake.lib.apiutils import thaw, freeze class NodeType(object): nodeType = 'UNKNOWN' def __init__(self): pass def freeze(self): return (self.nodeType, self.__dict__) @classmethod def thaw(class_, d): return class_(**d) class Cli...
import inspect import sys import types from rmake.lib.apiutils import thaw, freeze _nodeTypes = {} class _NodeTypeRegistrar(type): def __init__(self, name, bases, dict): type.__init__(self, name, bases, dict) _nodeTypes[self.nodeType] = self class NodeType(object): __metaclass__ = _NodeType...
Use metaclasses to register node types.
Use metaclasses to register node types.
Python
apache-2.0
sassoftware/rmake3,sassoftware/rmake3,sassoftware/rmake,sassoftware/rmake,sassoftware/rmake3,sassoftware/rmake
--- +++ @@ -4,7 +4,16 @@ from rmake.lib.apiutils import thaw, freeze + +_nodeTypes = {} +class _NodeTypeRegistrar(type): + def __init__(self, name, bases, dict): + type.__init__(self, name, bases, dict) + _nodeTypes[self.nodeType] = self + + class NodeType(object): + __metaclass__ = _NodeTyp...
222a87ef324f66baf8113020b41d336c459ab847
stdnum/fi/__init__.py
stdnum/fi/__init__.py
# __init__.py - collection of Finnish numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, ...
# __init__.py - collection of Finnish numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, ...
Add alias to hetu in for finnish personal id code
Add alias to hetu in for finnish personal id code
Python
lgpl-2.1
holvi/python-stdnum,holvi/python-stdnum,arthurdejong/python-stdnum,arthurdejong/python-stdnum,holvi/python-stdnum,arthurdejong/python-stdnum
--- +++ @@ -23,3 +23,4 @@ # provide vat as an alias from stdnum.fi import alv as vat from stdnum.fi import ytunnus as businessid +from stdnum.fi import hetu as personalid
563a905a48a5d4059463f25c5467a52a9d9c79c5
groove/timezone.py
groove/timezone.py
from datetime import datetime, date from django.utils import timezone def datetime_midnight(year, month, day): """ Returns a timezone aware datetime object of a date at midnight, using the current timezone. """ return timezone.make_aware(datetime(year, month, day), timezone.get_current_timezone(...
from datetime import datetime, date from django.utils import timezone def datetime_midnight(year, month, day): """ Returns a timezone aware datetime object of a date at midnight, using the current timezone. """ return timezone.make_aware(datetime(year, month, day), timezone.get_current_timezone(...
Add function for creating a datetime aware object
Add function for creating a datetime aware object
Python
bsd-2-clause
funkbit/django-groove
--- +++ @@ -29,3 +29,11 @@ today = date.today() return datetime_midnight(today.year, today.month, today.day) + + +def datetime_aware(year, month, day, hour, minute, second): + """ + Return a datetime aware object with current local timezone. + """ + _datetime = datetime(year, month, day, hour,...
b2de891e75dc84e809b9c35222e6bc8fe44c3d37
test_arg.py
test_arg.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function, division import unittest as ut import numpy as np import ARG.arg as arg class ARGTestCase(ut.TestCase): def test_truisms(self): """Test parameter class""" param = arg.ARGparams() self.assertTrue(isinsta...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function, division import unittest as ut import numpy as np import ARG.arg as arg class ARGTestCase(ut.TestCase): def test_param_class(self): """Test parameter class.""" param = arg.ARGparams() self.assertIsInst...
Test functions a, b, c
Test functions a, b, c
Python
mit
khrapovs/argamma
--- +++ @@ -10,13 +10,23 @@ class ARGTestCase(ut.TestCase): - def test_truisms(self): - """Test parameter class""" + def test_param_class(self): + """Test parameter class.""" + param = arg.ARGparams() - self.assertTrue(isinstance(param.scale, float)) - self.assertTrue(i...
369b0499d02531e7058f4f0d6c5051b9058701aa
metadata_to_json_and_fnamesmap.py
metadata_to_json_and_fnamesmap.py
#! /usr/bin/env python # -*- coding: utf-8 -*- """Turn Excel metadata from SMVK into JSON-file for further processing. Input: Excel-file Processing: strip whitespace etc Output: JSON-file `cypern_metadata.json" containg dict in the current directory """ import pandas as pd import argparse def main(): """Illustra...
#! /usr/bin/env python # -*- coding: utf-8 -*- """Turn Excel metadata from SMVK into JSON-file for further processing. Input: Excel-file Processing: strip whitespace etc Output: JSON-file `cypern_metadata.json" containg dict in the current directory """ import pandas as pd import argparse def strip(text): try: ...
Read sheetname 'Cypern' and strip column names
Read sheetname 'Cypern' and strip column names
Python
mit
mattiasostmar/SMVK-Cypern_2017-01
--- +++ @@ -10,21 +10,30 @@ import pandas as pd import argparse + +def strip(text): + try: + return text.strip() + except AttributeError: + return text + + +cypern_converters = {"Fotonummer": strip, "Postnr": strip, "Nyckelord": strip, "Beskrivning": strip, "Land": strip, + ...
592bbd24b0711be5c3e87133fc27429c83eabc01
nipype/interfaces/spm/__init__.py
nipype/interfaces/spm/__init__.py
"""Top-level namespace for spm.""" from nipype.interfaces.spm.base import (SpmInfo, SpmMatlabCommandLine, scans_for_fname, scans_for_fnames) from nipype.interfaces.spm.preprocess import (SliceTiming, Realign, Coregister, Normalize, S...
Add spm imports at package level. Most tests pass now.
Add spm imports at package level. Most tests pass now. git-svn-id: 24f545668198cdd163a527378499f2123e59bf9f@1141 ead46cd0-7350-4e37-8683-fc4c6f79bf00
Python
bsd-3-clause
JohnGriffiths/nipype,carolFrohlich/nipype,blakedewey/nipype,christianbrodbeck/nipype,fprados/nipype,FCP-INDI/nipype,carlohamalainen/nipype,grlee77/nipype,dgellis90/nipype,sgiavasis/nipype,rameshvs/nipype,fprados/nipype,blakedewey/nipype,FredLoney/nipype,dgellis90/nipype,carlohamalainen/nipype,dmordom/nipype,sgiavasis/n...
--- +++ @@ -0,0 +1,10 @@ +"""Top-level namespace for spm.""" + +from nipype.interfaces.spm.base import (SpmInfo, SpmMatlabCommandLine, + scans_for_fname, scans_for_fnames) +from nipype.interfaces.spm.preprocess import (SliceTiming, Realign, Coregister, + ...
0c4bdc2d27fb289979004c7e0a0b9d0bf0a764cf
main.py
main.py
# -*- coding: utf-8 -*- import numpy as np import universe seed = 91231 n_trials = 20 n_steps = 1000 steps_to_reward = 9 max_reward = n_steps // steps_to_reward * 5. uni = universe.Universe('grid_world', world='2d_world0') uni.show() reward = [] for i in range(n_trials): np.random.seed(1234 + i) uni.res...
# -*- coding: utf-8 -*- import matplotlib.pyplot as plt import numpy as np import universe seed = 91231 n_trials = 20 n_steps = 1000 steps_to_reward = 14 max_reward = n_steps // steps_to_reward * 5. uni = universe.Universe('grid_world', world='2d_world1') uni.show() reward = [] for i in range(n_trials): rewa...
Add trial cumulative reward plot
Add trial cumulative reward plot
Python
mit
jakobj/python-tdl
--- +++ @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- +import matplotlib.pyplot as plt import numpy as np import universe @@ -9,14 +10,15 @@ n_trials = 20 n_steps = 1000 -steps_to_reward = 9 +steps_to_reward = 14 max_reward = n_steps // steps_to_reward * 5. -uni = universe.Universe('grid_world', world='2d_wor...
52c8b8d2676024ff07722115c815ecdd04dd000c
etrago/cluster/analyses/config.py
etrago/cluster/analyses/config.py
# -*- coding: utf-8 -*- """ """ from os import path root_path = '/home/openego/pf_results/' \ 'snapshot-clustering-results-k10-cyclic-withpypsaweighting/' clustered_path = path.join(root_path, 'daily') original_path = path.join(root_path, 'original') plot_path = root_path
# -*- coding: utf-8 -*- """ """ from os import path root_path = path.join(path.expanduser('~'),'pf_results/' \ 'snapshot-clustering-results-k10-cyclic/') clustered_path = path.join(root_path, 'daily') original_path = path.join(root_path, 'original') plot_path = root_path
Set path automatically to home of user
Set path automatically to home of user
Python
agpl-3.0
openego/eTraGo
--- +++ @@ -3,8 +3,9 @@ """ from os import path -root_path = '/home/openego/pf_results/' \ - 'snapshot-clustering-results-k10-cyclic-withpypsaweighting/' + +root_path = path.join(path.expanduser('~'),'pf_results/' \ + 'snapshot-clustering-results-k10-cyclic/') clustered_path = path.join(r...
cf9ba0d497127d5261c8bee5eebe0e8f12aabf3a
armstrong/core/arm_wells/views.py
armstrong/core/arm_wells/views.py
from django.core.exceptions import ImproperlyConfigured from django.views.generic import TemplateView class SimpleWellView(TemplateView): def render_to_response(self, context, **response_kwargs): if not 'params' in context: raise ImproperlyConfigured( "Expects `params` to b...
from django.core.exceptions import ImproperlyConfigured from django.views.generic import TemplateView from django.utils.translation import ugettext as _ class SimpleWellView(TemplateView): def render_to_response(self, context, **response_kwargs): if not 'params' in context: raise ImproperlyCon...
Make these exception messages translatable
Make these exception messages translatable
Python
apache-2.0
armstrong/armstrong.core.arm_wells,dmclain/armstrong.core.arm_wells,armstrong/armstrong.core.arm_wells,texastribune/armstrong.core.arm_wells,texastribune/armstrong.core.arm_wells,dmclain/armstrong.core.arm_wells,armstrong/armstrong.core.arm_wells
--- +++ @@ -1,21 +1,22 @@ from django.core.exceptions import ImproperlyConfigured from django.views.generic import TemplateView +from django.utils.translation import ugettext as _ class SimpleWellView(TemplateView): def render_to_response(self, context, **response_kwargs): if not 'params' in cont...
b7f07248834857e89f2f8312785a3a1f343c27c3
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) assistant_sid = 'UAXXXXXXXXX...
# 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 ...
Update to use assistant SID inline
Update to use assistant SID inline Maintaining consistency with the auto-generated code samples for Understand, which don't allow for our variable-named placeholder values
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,10 +6,10 @@ auth_token = 'your_auth_token' client = Client(account_sid, auth_token) -assistant_sid = 'UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' # Create a new intent named 'tell_a_joke' +# Replace 'UAXXX...' with your Assistant's unique SID https://www.twilio.com/console/assistant/list intent = client.p...
2573178fe8051e29dab5bc4463f9ef39aa8c7657
wordcloud/urls.py
wordcloud/urls.py
from django.conf.urls import patterns, url from django.views.generic.base import RedirectView from .views import wordcloud urlpatterns = patterns( '', url(r'^wordcloud/$', wordcloud, name='wordcloud'), url(r'^wordcloud/(?P<max_entries>\d+)/$', wordcloud, name='wordcloud'), # Temporary redirects of ol...
from django.conf.urls import patterns, url from django.views.generic.base import RedirectView from .views import wordcloud urlpatterns = patterns( '', url(r'^wordcloud/$', wordcloud, name='wordcloud'), url(r'^wordcloud/(?P<max_entries>\d+)/$', wordcloud, name='wordcloud'), # Temporary redirects of ol...
Remove an extraneous character from a URL's regular expression
Remove an extraneous character from a URL's regular expression
Python
agpl-3.0
geoffkilpin/pombola,mysociety/pombola,mysociety/pombola,geoffkilpin/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola,geoffkilpin/pombola,geoffkilpin/pombola,geoffkilpin/pombola,geoffkilpin/pombola
--- +++ @@ -11,6 +11,6 @@ # Temporary redirects of old urls url(r'^tagcloud/$', RedirectView.as_view(pattern_name='wordcloud', permanent=True)), - url(r'^tagcloud/(?P<max_entries>\d+)/$$', + url(r'^tagcloud/(?P<max_entries>\d+)/$', RedirectView.as_view(pattern_name='wordcloud', perma...
7cf4578297667bc8b6405e99828818de87e3ba9a
extensions/ExtGameController.py
extensions/ExtGameController.py
from python_cowbull_game.GameController import GameController from python_cowbull_game.GameMode import GameMode class ExtGameController(GameController): additional_modes = [ GameMode(mode="SuperTough", priority=6, digits=10, digit_type=0), GameMode(mode="hexTough", priority=5, digits=3, guesses_al...
from python_cowbull_game.GameController import GameController from python_cowbull_game.GameMode import GameMode class ExtGameController(GameController): additional_modes = [ GameMode(mode="SuperTough", priority=6, digits=10, digit_type=0), GameMode(mode="hexTough", priority=5, digits=3, guesses_al...
Update extensions and GameController subclass
Update extensions and GameController subclass
Python
apache-2.0
dsandersAzure/python_cowbull_server,dsandersAzure/python_cowbull_server
--- +++ @@ -8,5 +8,9 @@ GameMode(mode="hexTough", priority=5, digits=3, guesses_allowed=3, digit_type=1) ] - def __init__(self): - super(ExtGameController, self).__init__(game_modes=self.additional_modes) + def __init__(self, mode=None, game_json=None): + super(ExtGameController, s...
641a12d42bea5a78f8b1188ea758075fec6ef445
irclogview/urls.py
irclogview/urls.py
from django.conf.urls.defaults import * urlpatterns = patterns('irclogview.views', url(r'^(?P<name>[^/]+)/(?P<year>\d{4})(?P<month>\d{2})(?P<day>\d{2})/$', 'show_log', name='irclogview_show'), url(r'^(?P<name>[^/]+)/$', 'channel_index', name='irclogview_channel'), url(r'^$', 'index', name='irclogview_index...
from django.conf.urls.defaults import patterns, url from django.conf import settings urlpatterns = patterns('', url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) urlpatterns += patterns('irclogview.views', url(r'^(?P<name>[^/]+)/(?P<year>\d{4})(?P<mon...
Set /media/ as static folder
Set /media/ as static folder
Python
agpl-3.0
BlankOn/irclogview,fajran/irclogview,BlankOn/irclogview,fajran/irclogview
--- +++ @@ -1,6 +1,12 @@ -from django.conf.urls.defaults import * +from django.conf.urls.defaults import patterns, url +from django.conf import settings -urlpatterns = patterns('irclogview.views', +urlpatterns = patterns('', + url(r'^media/(?P<path>.*)$', 'django.views.static.serve', + {'document_root': s...
b32614df983402081cad272f486fcffcd3a18fc1
scripts/tests/data_util_test.py
scripts/tests/data_util_test.py
from data_util import DataManager import sys import data_util import numpy as np sys.path.append("../") # DataInstance = DataManager("../../data/train", "../../data/test", 128) # batch_input, batch_output, is_epoch_increase = DataInstance.get_batch() # print (np.shape(batch_input)) data_util.save_to_disk("../../data/tr...
import sys import numpy as np sys.path.append("../") import data_util # DataInstance = DataManager("../../data/train", "../../data/test", 128) # batch_input, batch_output, is_epoch_increase = DataInstance.get_batch() # print (np.shape(batch_input)) data_util.save_to_disk("../../data/train", "../../data/test")
Fix a bug on loding module
Fix a bug on loding module
Python
apache-2.0
Lucklyric/NLP-NER-CNN
--- +++ @@ -1,8 +1,9 @@ -from data_util import DataManager import sys +import numpy as np + +sys.path.append("../") import data_util -import numpy as np -sys.path.append("../") + # DataInstance = DataManager("../../data/train", "../../data/test", 128) # batch_input, batch_output, is_epoch_increase = DataInstance....
84254935bc78e86dadcde7ad3a09e8f1036c4051
anytask/index/views.py
anytask/index/views.py
from django.shortcuts import render from schools.models import School def index(request): schools = School.objects.all().filter(is_active=True).order_by('name') # current_year = get_current_year() # courses = Course.objects.filter(is_active=True).order_by('name') # archive_courses = Course.objects.ex...
from django.shortcuts import render from schools.models import School def index(request): schools = School.objects.all().filter(is_active=True).order_by('name') # current_year = get_current_year() # courses = Course.objects.filter(is_active=True).order_by('name') # archive_courses = Course.objects.ex...
Delete blank line at end of file
Delete blank line at end of file
Python
mit
znick/anytask,znick/anytask,znick/anytask,znick/anytask
--- +++ @@ -24,4 +24,3 @@ } return render(request, 'archived_schools_page.html', context) -
1941cba46978fb7f8182ddb3eddf2d77002b28f7
api/base/middleware.py
api/base/middleware.py
from framework.transactions import handlers class TokuTransactionsMiddleware(object): """TokuMX transaction middleware.""" def process_request(self, request): handlers.transaction_before_request() def process_response(self, request, response): return handlers.transaction_after_request(res...
from framework.transactions import handlers, commands class TokuTransactionsMiddleware(object): """TokuMX transaction middleware.""" def process_request(self, request): handlers.transaction_before_request() def process_exception(self, request, exception): commands.rollback() def proc...
Make sure transaction is rolled back if an exception is raised
Make sure transaction is rolled back if an exception is raised
Python
apache-2.0
TomHeatwole/osf.io,asanfilippo7/osf.io,fabianvf/osf.io,chrisseto/osf.io,dplorimer/osf,monikagrabowska/osf.io,chrisseto/osf.io,TomBaxter/osf.io,doublebits/osf.io,cwisecarver/osf.io,cwisecarver/osf.io,icereval/osf.io,jnayak1/osf.io,haoyuchen1992/osf.io,laurenrevere/osf.io,ckc6cz/osf.io,doublebits/osf.io,njantrania/osf.io...
--- +++ @@ -1,4 +1,4 @@ -from framework.transactions import handlers +from framework.transactions import handlers, commands class TokuTransactionsMiddleware(object): """TokuMX transaction middleware.""" @@ -6,5 +6,8 @@ def process_request(self, request): handlers.transaction_before_request() +...
b1c9aaa6551902b285c96c94c269a787701bb020
start_tornado.py
start_tornado.py
from tornado.wsgi import WSGIContainer from tornado.httpserver import HTTPServer from tornado.ioloop import IOLoop import tornado.options import server import os use_https = False if use_https: default_port = 80 else: default_port = 443 tornado.options.define("port", default=default_port, help="run on the...
from tornado.wsgi import WSGIContainer from tornado.httpserver import HTTPServer from tornado.ioloop import IOLoop import tornado.options import server import os use_https = False if use_https: default_port = 443 else: default_port = 80 tornado.options.define("port", default=default_port, help="run on the...
Correct the check of use HTTPS in Tornado file.
Correct the check of use HTTPS in Tornado file.
Python
apache-2.0
edmundo096/MoodMusic,edmundo096/MoodMusic,edmundo096/MoodMusic
--- +++ @@ -11,9 +11,9 @@ if use_https: + default_port = 443 +else: default_port = 80 -else: - default_port = 443 tornado.options.define("port", default=default_port, help="run on the given port", type=int)
4e7bcc26cb17af3879be62206231ab60d2b45fe5
Code/clientPlayer.py
Code/clientPlayer.py
#!/usr/bin/env python3 import getopt import sys import player from logger import * def usage(): print("clientPlayer -t number [-v number]") print("-t track number") print("-v volume") print("-d set debug mode") def main(): logger = logging.getLogger() try: opts, args = getopt.gnu_...
#!/usr/bin/env python3 import getopt import sys import player from logger import * def usage(): print("clientPlayer -t number [-v number]") print("-t track number") print("-v volume") print("-d set debug mode") def main(): logger = logging.getLogger() try: opts, args = getopt.gnu_...
Fix bug when no parameter is passed
Fix bug when no parameter is passed
Python
mit
jmigual/projecte2,jmigual/projecte2
--- +++ @@ -24,7 +24,7 @@ usage() sys.exit(1) - track = 0 + track = [0] velocity = 40 for o, a in opts:
2394de5f46d264e2a585b6cd4b87e4a45c99cfeb
cast_convert/__init__.py
cast_convert/__init__.py
from . import * from .convert import * from .media_info import * from .watch import *
__version__ = '0.1.5.18' from .cmd import cmd as command from .watch import * from . import * from .convert import * from .media_info import * @click.command(help="Print version") def version(): print(__version__) command.add_command(version)
Add version and version command
Add version and version command
Python
agpl-3.0
thismachinechills/cast_convert
--- +++ @@ -1,4 +1,16 @@ +__version__ = '0.1.5.18' + + +from .cmd import cmd as command +from .watch import * from . import * from .convert import * from .media_info import * -from .watch import * + + +@click.command(help="Print version") +def version(): + print(__version__) + + +command.add_command(version)
073fc87b0641685bf228ca530927d793c919d40d
hoomd/filter/custom.py
hoomd/filter/custom.py
"""Contains a class for custom particle filters in Python.""" from abc import ABCMeta, abstractmethod class CustomFilter(metaclass=ABCMeta): """Abstract base class for custom particle filters. The class allows the definition of particle filters in Python (see `hoomd.filter.ParticleFilter`. """ @ab...
"""Contains a class for custom particle filters in Python.""" from abc import ABC, abstractmethod from collections.abc import Hashable, Callable class CustomFilter(Hashable, Callable): """Abstract base class for custom particle filters. The class allows the definition of particle filters in Python (see `h...
Change the inherited classes of hoomd.filter.CustomFilter
Change the inherited classes of hoomd.filter.CustomFilter CustomFilter inherits now from Hashable and Callable
Python
bsd-3-clause
joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue
--- +++ @@ -1,7 +1,8 @@ """Contains a class for custom particle filters in Python.""" -from abc import ABCMeta, abstractmethod +from abc import ABC, abstractmethod +from collections.abc import Hashable, Callable -class CustomFilter(metaclass=ABCMeta): +class CustomFilter(Hashable, Callable): """Abstract base ...
27f409721a9f59b61d6fe01bad11733a7559bda0
hotohete/production.py
hotohete/production.py
import dj_database_url from hotohete.settings import * db_from_env = dj_database_url.config(conn_max_age=500) DATABASES['default'].update(db_from_env) ALLOWED_HOSTS = [ 'hotohete.herokuapp.com', 'localhost', '127.0.0.1' ]
import dj_database_url from hotohete.settings import * db_from_env = dj_database_url.config(conn_max_age=500) DATABASES['default'].update(db_from_env) ALLOWED_HOSTS = [ 'hotohete.herokuapp.com', 'hotohetestaging.herokuapp.com', 'localhost', '127.0.0.1' ]
Add stating to allowed hosts
Add stating to allowed hosts
Python
mit
wen96/hotohete,wen96/hotohete,wen96/hotohete,wen96/hotohete
--- +++ @@ -7,6 +7,7 @@ ALLOWED_HOSTS = [ 'hotohete.herokuapp.com', + 'hotohetestaging.herokuapp.com', 'localhost', '127.0.0.1' ]
4723e5aaf60d7fcf823d5fa72b67ef3331daa049
extruder/extrude_template.py
extruder/extrude_template.py
from __future__ import print_function, division, absolute_import from argparse import ArgumentParser def main(args=None): if args is None: parser = ArgumentParser('Tool for generating skeleton package-' 'building directory.') parser.add_argument('--appveyor-secret'...
from __future__ import print_function, division, absolute_import from argparse import ArgumentParser import os import shutil from jinja2 import Environment, FileSystemLoader def main(args=None): """ Copy all of the files needed from the source distribution to the current directory. """ if args ...
Implement script for creating skeleton build setup
Implement script for creating skeleton build setup
Python
bsd-3-clause
astropy/conda-build-tools,astropy/conda-build-tools
--- +++ @@ -1,18 +1,47 @@ from __future__ import print_function, division, absolute_import from argparse import ArgumentParser +import os +import shutil + +from jinja2 import Environment, FileSystemLoader def main(args=None): + """ + Copy all of the files needed from the source distribution to the curr...
7a7856d9ec56de91325c7bf7c62ff25c0241badc
tests/test_connect.py
tests/test_connect.py
import pypuppetdb def test_connect_api(): puppetdb = pypuppetdb.connect() assert puppetdb.version == 'v4'
import pypuppetdb def test_connect_api(): puppetdb = pypuppetdb.connect() assert puppetdb.version == 'v4' def test_connect_with_statement(): with pypuppetdb.connect() as puppetdb: assert puppetdb.version == 'v4'
Add test for creating connection with 'with' statement.
Add test for creating connection with 'with' statement.
Python
apache-2.0
puppet-community/pypuppetdb,voxpupuli/pypuppetdb
--- +++ @@ -4,3 +4,8 @@ def test_connect_api(): puppetdb = pypuppetdb.connect() assert puppetdb.version == 'v4' + + +def test_connect_with_statement(): + with pypuppetdb.connect() as puppetdb: + assert puppetdb.version == 'v4'
da1518d1e810ca227e84f110d4d42d1480040bc8
tests/test_twitter.py
tests/test_twitter.py
# -*- coding: utf-8 -*- import pytest import tweepy import vcr from secrets import TWITTER_ACCESS, TWITTER_SECRET from secrets import TWITTER_CONSUMER_ACCESS, TWITTER_CONSUMER_SECRET class TestTweepyIntegration(): """Test class to ensure tweepy functionality works as expected""" # Class level client to use a...
# -*- coding: utf-8 -*- import pytest import vcr from inet.sources.twitter import api class TestTweepyIntegration(): """Test class to ensure tweepy functionality works as expected""" @vcr.use_cassette('fixtures/vcr_cassettes/twitter.yaml') def test_authd(self): assert api.verify_credentials() is ...
Change tests to pull in twitter client from package
Change tests to pull in twitter client from package
Python
mit
nestauk/inet
--- +++ @@ -1,21 +1,14 @@ # -*- coding: utf-8 -*- import pytest -import tweepy import vcr -from secrets import TWITTER_ACCESS, TWITTER_SECRET -from secrets import TWITTER_CONSUMER_ACCESS, TWITTER_CONSUMER_SECRET +from inet.sources.twitter import api class TestTweepyIntegration(): """Test class to ensur...
bfc0ce1298b9fe7a640dc31c6e5729d1c6360945
langs/pystartup.py
langs/pystartup.py
# Add auto-completion and a stored history file of commands to your Python # interactive interpreter. Requires Python 2.0+, readline. Autocomplete is # bound to the Esc key by default (you can change it - see readline docs). # # Set an environment variable to point to it: "export PYTHONSTARTUP=foo" # # Note that PYTHO...
# Add auto-completion and a stored history file of commands to your Python # interactive interpreter. Requires Python 2.0+, readline. Autocomplete is # bound to the Esc key by default (you can change it - see readline docs). # # Set an environment variable to point to it: "export PYTHONSTARTUP=foo" # # Note that PYTHO...
Add json true/false/none in python repl
Add json true/false/none in python repl https://mobile.twitter.com/mitsuhiko/status/1229385843585974272/photo/2
Python
mit
keith/dotfiles,keith/dotfiles,keith/dotfiles,keith/dotfiles,keith/dotfiles,keith/dotfiles
--- +++ @@ -23,6 +23,15 @@ if os.path.exists(historyPath): readline.read_history_file(historyPath) +try: + import __builtin__ +except ImportError: + import builtins as __builtin__ + +__builtin__.true = True +__builtin__.false = False +__builtin__.null = None + readline.parse_and_bind("tab: complete") ...
2489ed6ff3d812888de4a0a2c45995389499d648
thread_output_ctrl.py
thread_output_ctrl.py
import Queue import wx, wx.stc from editor_fonts import init_stc_style class ThreadOutputCtrl(wx.stc.StyledTextCtrl): def __init__(self, parent, style=wx.TE_READONLY): wx.stc.StyledTextCtrl.__init__(self, parent) init_stc_style(self) self.SetIndent(4) self.SetTabWidth(8) sel...
import threading import wx, wx.stc from editor_fonts import init_stc_style class ThreadOutputCtrl(wx.stc.StyledTextCtrl): def __init__(self, parent, style=wx.TE_READONLY): wx.stc.StyledTextCtrl.__init__(self, parent) init_stc_style(self) self.SetIndent(4) self.SetTabWidth(8) ...
Use a lock-protected list instead of a Queue.
Use a lock-protected list instead of a Queue.
Python
mit
shaurz/devo
--- +++ @@ -1,4 +1,4 @@ -import Queue +import threading import wx, wx.stc from editor_fonts import init_stc_style @@ -10,28 +10,32 @@ self.SetTabWidth(8) self.SetUseTabs(False) - self.queue = Queue.Queue(1024) - self.timer = wx.Timer(self) + self.__lock = threading.Lock() ...
3a11712925ca1038a1c8c8c8eef29ca4d5fd1c6f
test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py
test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py
"""Check that we handle an ImportError in a special way when command script importing files.""" import os, sys, time import unittest2 import lldb from lldbtest import * class Rdar12586188TestCase(TestBase): mydir = os.path.join("functionalities", "command_script", "import", "rdar-12586188") @python_api_test...
"""Check that we handle an ImportError in a special way when command script importing files.""" import os, sys, time import unittest2 import lldb from lldbtest import * class Rdar12586188TestCase(TestBase): mydir = os.path.join("functionalities", "command_script", "import", "rdar-12586188") @python_api_test...
Fix expected error message in test.
Fix expected error message in test. git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@168220 91177308-0d34-0410-b5e6-96231b3b80d8
Python
apache-2.0
llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb
--- +++ @@ -24,7 +24,7 @@ self.expect("command script import ./fail12586188.py --allow-reload", error=True, substrs = ['error: module importing failed: I do not want to be imported']) self.expect("command script import ./fail212586188.py --allow-reload", - error=True,...
a877a578f0e71f9d667b5845c96b913ea51fa195
masquerade/urls.py
masquerade/urls.py
try: from django.conf.urls import url except ImportError: from django.core.urlresolvers import reverse from masquerade.views import mask, unmask urlpatterns = [ url(r'^mask/$', mask, name='masquerade-mask'), url(r'^unmask/$', unmask, name='masquerade-unmask'), ]
try: from django.urls import url except ImportError: from django.core.urlresolvers import reverse from masquerade.views import mask, unmask urlpatterns = [ url(r'^mask/$', mask, name='masquerade-mask'), url(r'^unmask/$', unmask, name='masquerade-unmask'), ]
Fix a bad import path
Fix a bad import path
Python
apache-2.0
erikcw/django-masquerade,erikcw/django-masquerade,erikcw/django-masquerade
--- +++ @@ -1,5 +1,5 @@ try: - from django.conf.urls import url + from django.urls import url except ImportError: from django.core.urlresolvers import reverse
336313ac982b9de278aca6e0f74f6820ef5b2526
landlab/grid/structured_quad/tests/test_links.py
landlab/grid/structured_quad/tests/test_links.py
import numpy as np from numpy.testing import assert_array_equal from nose.tools import raises, assert_true from landlab.grid.structured_quad.nodes import status_with_perimeter_as_boundary from landlab.grid.structured_quad.links import active_link_ids from landlab.grid.base import CORE_NODE, FIXED_VALUE_BOUNDARY, CLO...
import numpy as np from numpy.testing import assert_array_equal from nose.tools import raises, assert_equal from landlab.grid.structured_quad.nodes import status_with_perimeter_as_boundary from landlab.grid.structured_quad.links import active_link_ids from landlab.grid.base import CORE_NODE, FIXED_VALUE_BOUNDARY, CL...
Test of index arrays of type int.
Test of index arrays of type int.
Python
mit
ManuSchmi88/landlab,amandersillinois/landlab,SiccarPoint/landlab,cmshobe/landlab,amandersillinois/landlab,SiccarPoint/landlab,cmshobe/landlab,laijingtao/landlab,RondaStrauch/landlab,Carralex/landlab,Carralex/landlab,ManuSchmi88/landlab,cmshobe/landlab,Carralex/landlab,landlab/landlab,csherwood-usgs/landlab,ManuSchmi88/...
--- +++ @@ -1,7 +1,7 @@ import numpy as np from numpy.testing import assert_array_equal -from nose.tools import raises, assert_true +from nose.tools import raises, assert_equal from landlab.grid.structured_quad.nodes import status_with_perimeter_as_boundary from landlab.grid.structured_quad.links import activ...
4036ef2ac8435070d8850e1dab4187890bccd7c5
mayavi/__init__.py
mayavi/__init__.py
# Author: Prabhu Ramachandran, Gael Varoquaux # Copyright (c) 2004-2014, Enthought, Inc. # License: BSD Style. """ A tool for easy and interactive visualization of data. Part of the Mayavi project of the Enthought Tool Suite. """ __version__ = '4.4.4.dev0' __requires__ = [ 'apptools', 'traits', 'trait...
# Author: Prabhu Ramachandran, Gael Varoquaux # Copyright (c) 2004-2014, Enthought, Inc. # License: BSD Style. """ A tool for easy and interactive visualization of data. Part of the Mayavi project of the Enthought Tool Suite. """ __version__ = '4.4.3' __requires__ = [ 'apptools', 'traits', 'traitsui',...
Revert "Bump up dev version to 4.4.4.dev0"
Revert "Bump up dev version to 4.4.4.dev0" This reverts commit c65f7d3b9305fad3037f3086256927b2e1c1f43e.
Python
bsd-3-clause
dmsurti/mayavi,dmsurti/mayavi
--- +++ @@ -5,7 +5,7 @@ Part of the Mayavi project of the Enthought Tool Suite. """ -__version__ = '4.4.4.dev0' +__version__ = '4.4.3' __requires__ = [ 'apptools',
2be4b1b67ca17a400c6d22e8e29e0a4f1c69c0cc
dakota_utils/models/hydrotrend.py
dakota_utils/models/hydrotrend.py
#! /usr/bin/env python # # A module for working with HydroTrend. # # Mark Piper (mark.piper@colorado.edu) import numpy as np def load_series(output_file): ''' Reads a column of text containing HydroTrend output. Returns a numpy array, or None on an error. ''' try: series = np.loadtxt(outp...
#! /usr/bin/env python # # A module for working with HydroTrend. # # Mark Piper (mark.piper@colorado.edu) from subprocess import call import numpy as np def load(output_file): ''' Reads a column of text containing HydroTrend output. Returns a numpy array, or None on an error. ''' try: ser...
Add call() function, rename load() function
Add call() function, rename load() function Slowly encapsulating the run_hydrotrend.py script used in the Dakota experiments.
Python
mit
mdpiper/dakota-experiments,mdpiper/dakota-experiments,mcflugen/dakota-experiments,mdpiper/dakota-experiments,mcflugen/dakota-experiments
--- +++ @@ -4,10 +4,11 @@ # # Mark Piper (mark.piper@colorado.edu) +from subprocess import call import numpy as np -def load_series(output_file): +def load(output_file): ''' Reads a column of text containing HydroTrend output. Returns a numpy array, or None on an error. @@ -18,3 +19,10 @@ ...
c231987c532885fa7bc5e8d2afc8b7a30a2ce297
bayesian_methods_for_hackers/simulate_messages_ch02.py
bayesian_methods_for_hackers/simulate_messages_ch02.py
import json import matplotlib import numpy as np import pymc as pm from matplotlib import pyplot as plt def main(): matplotlibrc_path = '/home/noel/repo/playground/matplotlibrc.json' matplotlib.rcParams.update(json.load(open(matplotlibrc_path))) tau = pm.rdiscrete_uniform(0, 80) print tau alpha ...
import json import matplotlib import numpy as np import pymc as pm from matplotlib import pyplot as plt def main(): tau = pm.rdiscrete_uniform(0, 80) print tau alpha = 1. / 20. lambda_1, lambda_2 = pm.rexponential(alpha, 2) print lambda_1, lambda_2 data = np.r_[pm.rpoisson(lambda_1, tau), pm...
Change of repo name. Update effected paths
Change of repo name. Update effected paths
Python
mit
noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit
--- +++ @@ -6,9 +6,6 @@ def main(): - matplotlibrc_path = '/home/noel/repo/playground/matplotlibrc.json' - matplotlib.rcParams.update(json.load(open(matplotlibrc_path))) - tau = pm.rdiscrete_uniform(0, 80) print tau
7310fdd86cebd1c8b28d960f0211e350fbf07a62
handlers/login.py
handlers/login.py
from rorn.Box import LoginBox, ErrorBox, WarningBox, SuccessBox from rorn.Session import delay from User import User from Button import Button from utils import * @get('login') def login(handler, request): handler.title('Login') if handler.session['user']: print WarningBox('Logged In', 'You are already logged in ...
from rorn.Box import LoginBox, ErrorBox, WarningBox, SuccessBox from rorn.Session import delay from User import User from Button import Button from utils import * @get('login') def login(handler, request): handler.title('Login') if handler.session['user']: print WarningBox('Logged In', 'You are already logged in ...
Clear reset key on user activity
Clear reset key on user activity
Python
mit
mrozekma/Sprint,mrozekma/Sprint,mrozekma/Sprint
--- +++ @@ -18,6 +18,10 @@ handler.title('Login') user = User.load(username = p_username, password = User.crypt(p_username, p_password)) if user: + if user.resetkey: + user.resetkey = None + user.save() + handler.session['user'] = user delay(handler, SuccessBox("Login Complete", "Logged in as %s" % u...
018eab65881a2279efca88e1448dba0708a4dfe1
django_excel_to_model/management/commands/model_create_utils/django_tables2_utils.py
django_excel_to_model/management/commands/model_create_utils/django_tables2_utils.py
from django_excel_to_model.management.commands.model_create_utils.attribute_generator import ClassAttributeCreator import django_tables2 as tables def get_django_tables2_from_dict(data_dict): c = ClassAttributeCreator() table_meta_class = type("Meta", (), { "attrs": {'class': 'table table-striped tabl...
from django_excel_to_model.management.commands.model_create_utils.attribute_generator import ClassAttributeCreator import django_tables2 as tables def get_django_tables2_from_dict(data_dict): c = ClassAttributeCreator() table_meta_class = type("Meta", (), { "attrs": {'class': 'table table-striped tabl...
Remove sort function by default for table generated from dict.
Remove sort function by default for table generated from dict.
Python
bsd-3-clause
weijia/django-excel-to-model,weijia/django-excel-to-model
--- +++ @@ -5,8 +5,9 @@ def get_django_tables2_from_dict(data_dict): c = ClassAttributeCreator() table_meta_class = type("Meta", (), { - "attrs": {'class': 'table table-striped table-bordered table-advance table-hover'}} - ) + "attrs": {'class': 'table table-striped...