commit
stringlengths
40
40
subject
stringlengths
4
1.73k
repos
stringlengths
5
127k
old_file
stringlengths
2
751
new_file
stringlengths
2
751
new_contents
stringlengths
1
8.98k
old_contents
stringlengths
0
6.59k
license
stringclasses
13 values
lang
stringclasses
23 values
db22f7a508524409f5e03fdbcbf6a394670ebbde
Use built-in auth views
GNOME/extensions-web,GNOME/extensions-web,GNOME/extensions-web,magcius/sweettooth,GNOME/extensions-web,magcius/sweettooth
sweettooth/auth/urls.py
sweettooth/auth/urls.py
from django.conf.urls.defaults import patterns, url from django.views.generic import TemplateView urlpatterns = patterns('', url(r'login/$', 'django.contrib.auth.views.login', dict(template_name='login.html'), name='login'), url(r'logout/$', 'django.contrib.auth.views.logout', dict(template_na...
from django.conf.urls.defaults import patterns, url from django.views.generic import TemplateView urlpatterns = patterns('', url(r'login/$', 'django.contrib.auth.views.login', dict(template_name='login.html'), name='login'), url(r'logout/$', 'django.contrib.auth.views.logout', name='logout'), url(r'regist...
agpl-3.0
Python
32fba62d157953eaeea6e5885a7ea860632a1945
rename filter function and set the second parameter as required
adnedelcu/SyncSettings,mfuentesg/SyncSettings
sync_settings/helper.py
sync_settings/helper.py
# -*- coding: utf-8 -*- import os, re from urllib import parse def getDifference (setA, setB): return list(filter(lambda el: el not in setB, setA)) def getHomePath (fl = ""): if isinstance(fl, str) and fl != "": return joinPath((os.path.expanduser('~'), fl)) return os.path.expanduser('~') def existsPath(p...
# -*- coding: utf-8 -*- import os, re from urllib import parse def getDifference (setA, setB): return list(filter(lambda el: el not in setB, setA)) def getHomePath (fl = ""): if isinstance(fl, str) and fl != "": return joinPath((os.path.expanduser('~'), fl)) return os.path.expanduser('~') def existsPath(p...
mit
Python
c3c703c6d8b434da40beef6202bf2cbdc01e50a1
Add configured tests
Farama-Foundation/Gymnasium,dianchen96/gym,Farama-Foundation/Gymnasium,dianchen96/gym
gym/wrappers/tests/test_wrappers.py
gym/wrappers/tests/test_wrappers.py
import gym from gym import error from gym import wrappers from gym.wrappers import SkipWrapper import tempfile import shutil def test_skip(): every_two_frame = SkipWrapper(2) env = gym.make("FrozenLake-v0") env = every_two_frame(env) obs = env.reset() env.render() def test_configured(): env ...
import gym from gym import error from gym import wrappers from gym.wrappers import SkipWrapper import tempfile import shutil def test_skip(): every_two_frame = SkipWrapper(2) env = gym.make("FrozenLake-v0") env = every_two_frame(env) obs = env.reset() env.render() def test_no_double_wrapping():...
mit
Python
fa0174185832fac608cc1b65255231a73aac630a
fix evacuate call on branched lient
lcostantino/healing-os,lcostantino/healing-os
healing/handler_plugins/evacuate.py
healing/handler_plugins/evacuate.py
from healing.handler_plugins import base from healing import exceptions from healing.openstack.common import log as logging from healing import utils LOG = logging.getLogger(__name__) class Evacuate(base.HandlerPluginBase): """evacuate VM plugin. Data format in action_meta is: 'evacuate_host': True...
from healing.handler_plugins import base from healing import exceptions from healing.openstack.common import log as logging from healing import utils LOG = logging.getLogger(__name__) class Evacuate(base.HandlerPluginBase): """evacuate VM plugin. Data format in action_meta is: 'evacuate_host': True...
apache-2.0
Python
5336ff3967f4e297237045ca0914ae5257e3a767
fix csv output in one autoplot
akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem
htdocs/plotting/auto/scripts/p92.py
htdocs/plotting/auto/scripts/p92.py
import psycopg2.extras import pyiem.nws.vtec as vtec import datetime import pandas as pd def get_description(): """ Return a dict describing how to call this plotter """ d = dict() d['data'] = True d['cache'] = 3600 d['description'] = """This map depicts the number of days since a Weather Fore...
import psycopg2.extras import pyiem.nws.vtec as vtec import datetime import pandas as pd def get_description(): """ Return a dict describing how to call this plotter """ d = dict() d['data'] = True d['cache'] = 3600 d['description'] = """This map depicts the number of days since a Weather Fore...
mit
Python
a8d639cbac2439c0079b86b72dd3daee6505e9d0
Update version file
noxdafox/clipspy,noxdafox/clipspy
version.py
version.py
"""Versioning controlled via Git Tag, check setup.py""" __version__ = "0.3.3"
"""Versioning controlled via Git Tag, check setup.py""" __version__ = "0.3.2"
bsd-3-clause
Python
137b20e4aa779be3c97c500ab485126085492ce5
comment format
azatoth/pywikipedia
pywikibot/families/scratchpad_wikia_family.py
pywikibot/families/scratchpad_wikia_family.py
# -*- coding: utf-8 -*- from pywikibot import family class Family(family.Family): def __init__(self): family.Family.__init__(self) self.name = 'scratchpad_wikia' self.langs = { 'de':'de.mini.wikia.com', 'en':'scratchpad.wikia.com', 'fr':'bloc-notes.wiki...
# -*- coding: utf-8 -*- from pywikibot import family class Family(family.Family): def __init__(self): family.Family.__init__(self) self.name = 'scratchpad_wikia' self.langs = { 'de':'de.mini.wikia.com', 'en':'scratchpad.wikia.com', 'fr':'bloc-notes.wiki...
mit
Python
c898b68fa8d81963b7a5282e67ecb28764bbd0a3
Add comment explaining mocking
alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin
tests/app/models/test_contact_list.py
tests/app/models/test_contact_list.py
from datetime import datetime from app.models.contact_list import ContactList from app.models.job import PaginatedJobs def test_created_at(): created_at = ContactList({'created_at': '2016-05-06T07:08:09.061258'}).created_at assert isinstance(created_at, datetime) assert created_at.isoformat() == '2016-05...
from datetime import datetime from app.models.contact_list import ContactList from app.models.job import PaginatedJobs def test_created_at(): created_at = ContactList({'created_at': '2016-05-06T07:08:09.061258'}).created_at assert isinstance(created_at, datetime) assert created_at.isoformat() == '2016-05...
mit
Python
39c34860fa9992f38892aa026c5b0c6547bd4b23
Fix flaky evergreen test
theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs
tests/content/test_content_manager.py
tests/content/test_content_manager.py
from django.test import override_settings from django.utils import timezone from bulbs.campaigns.models import Campaign from bulbs.content.models import Content from bulbs.utils.test import make_content, BaseIndexableTestCase from example.testcontent.models import TestContentObj, TestContentObjTwo class ContentMana...
from django.test import override_settings from django.utils import timezone from bulbs.campaigns.models import Campaign from bulbs.content.models import Content from bulbs.utils.test import make_content, BaseIndexableTestCase from example.testcontent.models import TestContentObj, TestContentObjTwo class ContentMana...
mit
Python
8c8bc1ef8e3ba7519d4612856a420ed410974e12
add redactor on installed apps settings
opps/opps,YACOWS/opps,opps/opps,jeanmask/opps,williamroot/opps,jeanmask/opps,YACOWS/opps,williamroot/opps,opps/opps,williamroot/opps,williamroot/opps,YACOWS/opps,opps/opps,YACOWS/opps,jeanmask/opps,jeanmask/opps
opps/core/__init__.py
opps/core/__init__.py
# -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ from django.conf import settings trans_app_label = _('Opps') settings.INSTALLED_APPS += ('redactor',)
# -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ trans_app_label = _('Opps')
mit
Python
6a02c5e1844ad7d1b9ae50cd5dbae6975fb685ee
Make internal error more clear
stefanseefeld/numba,shiquanwang/numba,gdementen/numba,seibert/numba,numba/numba,cpcloud/numba,shiquanwang/numba,gdementen/numba,gdementen/numba,cpcloud/numba,sklam/numba,numba/numba,jriehl/numba,IntelLabs/numba,seibert/numba,ssarangi/numba,GaZ3ll3/numba,pombredanne/numba,pitrou/numba,gdementen/numba,pombredanne/numba,s...
numba/error.py
numba/error.py
import traceback def format_pos(node): if node is not None and hasattr(node, 'lineno'): return "%s:%s: " % (node.lineno, node.col_offset) else: return "" class NumbaError(Exception): "Some error happened during compilation" def __init__(self, node, msg=None, *args): if msg is ...
import traceback def format_pos(node): if node is not None and hasattr(node, 'lineno'): return "%s:%s: " % (node.lineno, node.col_offset) else: return "" class NumbaError(Exception): "Some error happened during compilation" def __init__(self, node, msg=None, *args): if msg is ...
bsd-2-clause
Python
429bf52eb482955cfe195708898ce275e1a72dcb
Validate input.
devilry/devilry-django,devilry/devilry-django,devilry/devilry-django,devilry/devilry-django
src/devilry_qualifiesforexam/devilry_qualifiesforexam/rest/preview.py
src/devilry_qualifiesforexam/devilry_qualifiesforexam/rest/preview.py
from djangorestframework.views import View from djangorestframework.permissions import IsAuthenticated from djangorestframework.response import ErrorResponse from djangorestframework import status as statuscodes from django.shortcuts import get_object_or_404 from devilry_qualifiesforexam.pluginhelpers import create_se...
from djangorestframework.views import View from djangorestframework.permissions import IsAuthenticated from django.shortcuts import get_object_or_404 from devilry_qualifiesforexam.pluginhelpers import create_sessionkey from devilry.apps.core.models import Period from devilry.utils.groups_groupedby_relatedstudent_and_a...
bsd-3-clause
Python
8ab7ad1f6aee485c64a7e1347c76e628cc820ba8
add some docker Builder args
gopythongo/gopythongo,gopythongo/gopythongo
src/py/gopythongo/builders/docker.py
src/py/gopythongo/builders/docker.py
# -* encoding: utf-8 *- import argparse import gopythongo.shared.docker_args from gopythongo.utils import print_info, highlight from gopythongo.builders import BaseBuilder from typing import Any class DockerBuilder(BaseBuilder): def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*ar...
# -* encoding: utf-8 *- import argparse import gopythongo.shared.docker_args from gopythongo.utils import print_info, highlight from gopythongo.builders import BaseBuilder from typing import Any class DockerBuilder(BaseBuilder): def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*ar...
mpl-2.0
Python
6248a0b813fc6598d964639ad696ecd506015918
Rename to TaarifaAPI
gwob/Maarifa,gwob/Maarifa,gwob/Maarifa,gwob/Maarifa,gwob/Maarifa
taarifa_api/settings.py
taarifa_api/settings.py
"""Global API configuration.""" from os import environ from urlparse import urlparse from schemas import facility_schema, request_schema, resource_schema, \ service_schema API_NAME = 'TaarifaAPI' URL_PREFIX = 'api' if 'EVE_DEBUG' in environ: DEBUG = True if 'MONGOLAB_URI' in environ: url = urlparse(envi...
"""Global API configuration.""" from os import environ from urlparse import urlparse from schemas import facility_schema, request_schema, resource_schema, \ service_schema API_NAME = 'Taarifa' URL_PREFIX = 'api' if 'EVE_DEBUG' in environ: DEBUG = True if 'MONGOLAB_URI' in environ: url = urlparse(environ...
apache-2.0
Python
059a799b9c347b6abfcd2daa3678d98cd0884210
Add "no cover" to teardown() and handle_address_delete() on TiedModelRealtimeSignalProcessor. These are never called.
OpenVolunteeringPlatform/django-ovp-search
ovp_search/signals.py
ovp_search/signals.py
from django.db import models from haystack import signals from ovp_projects.models import Project from ovp_organizations.models import Organization from ovp_core.models import GoogleAddress class TiedModelRealtimeSignalProcessor(signals.BaseSignalProcessor): """ TiedModelRealTimeSignalProcessor handles updates...
from django.db import models from haystack import signals from ovp_projects.models import Project from ovp_organizations.models import Organization from ovp_core.models import GoogleAddress class TiedModelRealtimeSignalProcessor(signals.BaseSignalProcessor): """ TiedModelRealTimeSignalProcessor handles updates...
agpl-3.0
Python
9cbdc64bcc1144b8ca7d32d08aa5d36afa7f1e73
index command - reflected _log_id_short change
lukas-linhart/pageobject
pageobject/commands/index.py
pageobject/commands/index.py
def index(self, value): """ Return index of the first child containing the specified value. :param str value: text value to look for :returns: index of the first child containing the specified value :rtype: int :raises ValueError: if the value is not found """ self.logger.info('getting ...
def index(self, value): """ Return index of the first child containing the specified value. :param str value: text value to look for :returns: index of the first child containing the specified value :rtype: int :raises ValueError: if the value is not found """ self.logger.info('getting ...
mit
Python
6143e6b015ed0435dc747b8d4242d47dca79c7a8
improve busydialog handling
phil65/script.module.kodi65
lib/kodi65/busyhandler.py
lib/kodi65/busyhandler.py
# -*- coding: utf8 -*- # Copyright (C) 2015 - Philipp Temminghoff <phil65@kodi.tv> # This program is Free Software see LICENSE file for details import xbmcgui from kodi65 import utils import traceback from functools import wraps class BusyHandler(object): """ Class to deal with busydialog handling """ ...
# -*- coding: utf8 -*- # Copyright (C) 2015 - Philipp Temminghoff <phil65@kodi.tv> # This program is Free Software see LICENSE file for details import xbmc from kodi65 import utils import traceback from functools import wraps class BusyHandler(object): """ Class to deal with busydialog handling """ ...
lgpl-2.1
Python
767a50052895cf10386f01bab83941a2141c30f1
fix json test and add json from string test
Mappy/mapnik,mbrukman/mapnik,yiqingj/work,mapycz/python-mapnik,cjmayo/mapnik,mapycz/mapnik,mapnik/python-mapnik,stefanklug/mapnik,tomhughes/python-mapnik,qianwenming/mapnik,sebastic/python-mapnik,whuaegeanse/mapnik,pramsey/mapnik,yohanboniface/python-mapnik,whuaegeanse/mapnik,manz/python-mapnik,Airphrame/mapnik,Uli1/ma...
tests/python_tests/datasource_test.py
tests/python_tests/datasource_test.py
#!/usr/bin/env python from nose.tools import * from utilities import execution_path import os, mapnik2 def setup(): # All of the paths used are relative, if we run the tests # from another directory we need to chdir() os.chdir(execution_path('.')) def test_field_listing(): lyr = mapnik2.Layer('t...
#!/usr/bin/env python from nose.tools import * from utilities import execution_path import os, mapnik2 def setup(): # All of the paths used are relative, if we run the tests # from another directory we need to chdir() os.chdir(execution_path('.')) def test_field_listing(): lyr = mapnik2.Layer('t...
lgpl-2.1
Python
05855c934624c667053635a8ab8679c54426e49f
Rewrite the initialization of Release.eol_date.
django/djangoproject.com,django/djangoproject.com,django/djangoproject.com,nanuxbe/django,django/djangoproject.com,xavierdutreilh/djangoproject.com,xavierdutreilh/djangoproject.com,nanuxbe/django,nanuxbe/django,django/djangoproject.com,xavierdutreilh/djangoproject.com,django/djangoproject.com,xavierdutreilh/djangoproje...
releases/migrations/0003_populate_release_eol_date.py
releases/migrations/0003_populate_release_eol_date.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.db import migrations, models def set_eol_date(apps, schema_editor): Release = apps.get_model('releases', 'Release') # Set the EOL date of all releases to the date of the following release # except for the final o...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.db import migrations, models def set_eol_date(apps, schema_editor): Release = apps.get_model('releases', 'Release') # List of EOL dates for releases for which docs are published. for version, eol_date in [ ...
bsd-3-clause
Python
ab93ea01dacc0fbd63fac91b1afcf5af1b711c2f
correct latest migration
mohrm/umklapp_site,mohrm/umklapp_site,mohrm/umklapp_site
umklapp/migrations/0009_teller_hasleft.py
umklapp/migrations/0009_teller_hasleft.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-05-31 20:38 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('umklapp', '0008_auto_20160528_2332'), ] operations = [ migrations.AddField( ...
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-05-31 19:39 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('umklapp', '0008_auto_20160528_2332'), ] operations = [ migrations.AddField( ...
mit
Python
c5bfd55147e7fb18264f601c34e180453974f55e
DEBUG messages deleted
avlach/univbris-ocf,avlach/univbris-ocf,avlach/univbris-ocf,avlach/univbris-ocf
vt_manager/src/python/agent/provisioning/ProvisioningDispatcher.py
vt_manager/src/python/agent/provisioning/ProvisioningDispatcher.py
''' @author: msune Provisioning dispatcher. Selects appropiate Driver for VT tech ''' from communications.XmlRpcClient import XmlRpcClient from utils.VmMutexStore import VmMutexStore import threading class ProvisioningDispatcher: @staticmethod def __getProvisioningDispatcher(vtype): #Import of Dispatchers ...
''' @author: msune Provisioning dispatcher. Selects appropiate Driver for VT tech ''' from communications.XmlRpcClient import XmlRpcClient from utils.VmMutexStore import VmMutexStore import threading class ProvisioningDispatcher: @staticmethod def __getProvisioningDispatcher(vtype): #Import of Dispatchers ...
bsd-3-clause
Python
b78165d68e1e01e722b746e926a36b5680debdfa
remove email filter and rfactor
masschallenge/impact-api,masschallenge/impact-api,masschallenge/impact-api,masschallenge/impact-api
web/impact/impact/v1/views/mentor_program_office_hour_list_view.py
web/impact/impact/v1/views/mentor_program_office_hour_list_view.py
# MIT License # Copyright (c) 2019 MassChallenge, Inc. from impact.v1.views.base_list_view import BaseListView from impact.v1.helpers import ( MentorProgramOfficeHourHelper, ) class MentorProgramOfficeHourListView(BaseListView): view_name = "office_hour" helper_class = MentorProgramOfficeHourHelper ...
# MIT License # Copyright (c) 2019 MassChallenge, Inc. from impact.v1.views.base_list_view import BaseListView from impact.v1.helpers import ( MentorProgramOfficeHourHelper, ) LOOKUPS = { 'mentor_email': 'mentor__email__icontains', 'mentor_id': 'mentor_id', 'finalist_email': 'finalist__email__icontai...
mit
Python
05b7f56bdfa600e72d4cca5a4c51324ff3c94d4d
Update file distancematrixtest.py
ajnebro/pyMSAScoring
pymsascoring/distancematrix/test/distancematrixtest.py
pymsascoring/distancematrix/test/distancematrixtest.py
import unittest from pymsascoring.distancematrix.distancematrix import DistanceMatrix __author__ = "Antonio J. Nebro" class TestMethods(unittest.TestCase): def setUp(self): pass def test_should_default_gap_penalty_be_minus_eight(self): matrix = DistanceMatrix() self.assertEqual(-8,...
import unittest __author__ = "Antonio J. Nebro" class TestMethods(unittest.TestCase): def setUp(self): pass if __name__ == '__main__': unittest.main()
mit
Python
bd32faf934bd26957a16a0aa2ac092c5759d2342
annotate new test
github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql
python/ql/test/experimental/dataflow/fieldflow/test.py
python/ql/test/experimental/dataflow/fieldflow/test.py
# These are defined so that we can evaluate the test code. NONSOURCE = "not a source" SOURCE = "source" def is_source(x): return x == "source" or x == b"source" or x == 42 or x == 42.0 or x == 42j def SINK(x): if is_source(x): print("OK") else: print("Unexpected flow", x) def SINK_F(x)...
# These are defined so that we can evaluate the test code. NONSOURCE = "not a source" SOURCE = "source" def is_source(x): return x == "source" or x == b"source" or x == 42 or x == 42.0 or x == 42j def SINK(x): if is_source(x): print("OK") else: print("Unexpected flow", x) def SINK_F(x)...
mit
Python
091ebd935c6145ac233c03bedeb52c65634939f4
Include the version-detecting code to allow PyXML to override the "standard" xml package. Require at least PyXML 0.6.1.
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
Lib/xml/__init__.py
Lib/xml/__init__.py
"""Core XML support for Python. This package contains three sub-packages: dom -- The W3C Document Object Model. This supports DOM Level 1 + Namespaces. parsers -- Python wrappers for XML parsers (currently only supports Expat). sax -- The Simple API for XML, developed by XML-Dev, led by David Meggins...
"""Core XML support for Python. This package contains three sub-packages: dom -- The W3C Document Object Model. This supports DOM Level 1 + Namespaces. parsers -- Python wrappers for XML parsers (currently only supports Expat). sax -- The Simple API for XML, developed by XML-Dev, led by David Meggins...
mit
Python
3a27568211c07cf614aa9865a2f08d2a9b9bfb71
Return errors in json only
chrisseto/dinosaurs.sexy,chrisseto/dinosaurs.sexy
dinosaurs/views.py
dinosaurs/views.py
import os import json import httplib as http import tornado.web import tornado.ioloop from dinosaurs import api from dinosaurs import settings class SingleStatic(tornado.web.StaticFileHandler): def initialize(self, path): self.dirname, self.filename = os.path.split(path) super(SingleStatic, self...
import os import json import httplib as http import tornado.web import tornado.ioloop from dinosaurs import api from dinosaurs import settings class SingleStatic(tornado.web.StaticFileHandler): def initialize(self, path): self.dirname, self.filename = os.path.split(path) super(SingleStatic, self...
mit
Python
c9f25b7fb983c3d635ab7f13f350a53422059a8c
Handle errors in reloaded code
edne/pineal
cpp/pineal-run.py
cpp/pineal-run.py
#!/usr/bin/env python from __future__ import print_function import os from time import sleep from sys import argv import logging from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler import hy from pineal.hy_utils import run_hy_code logger = logging.getLogger("pineal-run") logger....
#!/usr/bin/env python from __future__ import print_function import os from time import sleep from sys import argv from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler import hy from pineal.hy_utils import run_hy_code def update_file(file_name, ns, history): "Update running ...
agpl-3.0
Python
f574e19b14ff861c45f6c66c64a2570bdb0e3a3c
Apply change of file name
tosh1ki/NicoCrawler
crawl_comments.py
crawl_comments.py
#!/usr/bin/env python # -*- coding: utf-8 -*- __doc__ = ''' Crawl comment from nicovideo.jp Usage: crawl_comments.py [--sqlite <sqlite>] [--csv <csv>] Options: --sqlite <sqlite> (optional) path of comment DB [default: comments.sqlite3] --csv <csv> (optional) path of csv file contains urls of vid...
#!/usr/bin/env python # -*- coding: utf-8 -*- __doc__ = ''' Crawl comment from nicovideo.jp Usage: main_crawl.py [--sqlite <sqlite>] [--csv <csv>] Options: --sqlite <sqlite> (optional) path of comment DB [default: comments.sqlite3] --csv <csv> (optional) path of csv file contains urls of videos ...
mit
Python
3bc4fa33c3ec9272fed565260677518dcf5957fe
change version to 0.10.0.dev0
espdev/csaps
csaps/_version.py
csaps/_version.py
# -*- coding: utf-8 -*- __version__ = '0.10.0.dev0'
# -*- coding: utf-8 -*- __version__ = '0.9.0'
mit
Python
3bb9c0aacdfff372e41d7a8d4c43e71535bff930
Remove perf regression in not yet finished size estimation code
amitsela/incubator-beam,wangyum/beam,rangadi/beam,jbonofre/incubator-beam,amarouni/incubator-beam,robertwb/incubator-beam,chamikaramj/beam,apache/beam,lukecwik/incubator-beam,peihe/incubator-beam,apache/beam,lukecwik/incubator-beam,sammcveety/incubator-beam,sammcveety/incubator-beam,jbonofre/beam,jasonkuster/beam,eljef...
sdks/python/google/cloud/dataflow/worker/opcounters.py
sdks/python/google/cloud/dataflow/worker/opcounters.py
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
Python
aab7c01c94088594258e33e3074f76d8735b8c2e
Add default config and config schema
swak/mopidy,quartz55/mopidy,liamw9534/mopidy,kingosticks/mopidy,bacontext/mopidy,hkariti/mopidy,vrs01/mopidy,vrs01/mopidy,pacificIT/mopidy,jodal/mopidy,woutervanwijk/mopidy,mokieyue/mopidy,bencevans/mopidy,abarisain/mopidy,vrs01/mopidy,ZenithDK/mopidy,liamw9534/mopidy,SuperStarPL/mopidy,glogiotatidis/mopidy,bencevans/m...
mopidy/frontends/mpd/__init__.py
mopidy/frontends/mpd/__init__.py
from __future__ import unicode_literals import mopidy from mopidy import ext from mopidy.utils import config, formatting default_config = """ [ext.mpd] # If the MPD extension should be enabled or not enabled = true # Which address the MPD server should bind to # # 127.0.0.1 # Listens only on the IPv4 loopback ...
from __future__ import unicode_literals import mopidy from mopidy import ext __doc__ = """The MPD server frontend. MPD stands for Music Player Daemon. MPD is an independent project and server. Mopidy implements the MPD protocol, and is thus compatible with clients for the original MPD server. **Dependencies:** - ...
apache-2.0
Python
317926c18ac2e139d2018acd767d10b4f53428f3
Remove unneeded post method from CreateEnvProfile view
ezPy-co/ezpy,alibulota/Package_Installer,ezPy-co/ezpy,alibulota/Package_Installer
installer/installer_config/views.py
installer/installer_config/views.py
from django.shortcuts import render from django.shortcuts import render_to_response from django.views.generic import CreateView, UpdateView, DeleteView from installer_config.models import EnvironmentProfile, UserChoice, Step from installer_config.forms import EnvironmentForm from django.core.urlresolvers import reverse...
from django.shortcuts import render from django.shortcuts import render_to_response from django.views.generic import CreateView, UpdateView, DeleteView from installer_config.models import EnvironmentProfile, UserChoice, Step from installer_config.forms import EnvironmentForm from django.core.urlresolvers import reverse...
mit
Python
c24dbc2d4d8b59a62a68f326edb350b3c633ea25
Change the comment of InterleavingMethod.evaluate
mpkato/interleaving
interleaving/interleaving_method.py
interleaving/interleaving_method.py
class InterleavingMethod(object): ''' Interleaving ''' def interleave(self, k, a, b): ''' k: the maximum length of resultant interleaving a: a list of document IDs b: a list of document IDs Return an instance of Ranking ''' raise NotImplementedErr...
class InterleavingMethod(object): ''' Interleaving ''' def interleave(self, k, a, b): ''' k: the maximum length of resultant interleaving a: a list of document IDs b: a list of document IDs Return an instance of Ranking ''' raise NotImplementedErr...
mit
Python
e94af78bbeae26933d987494e628b18e201f8da2
fix logger error message
uw-it-aca/spotseeker_server,uw-it-aca/spotseeker_server,uw-it-aca/spotseeker_server
spotseeker_server/management/commands/sync_techloan.py
spotseeker_server/management/commands/sync_techloan.py
# Copyright 2022 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 import logging from django.core.management.base import BaseCommand from django.conf import settings from schema import Schema from .techloan.techloan import Techloan from .techloan.spotseeker import Spots logger = logging.getLog...
# Copyright 2022 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 import logging from django.core.management.base import BaseCommand from django.conf import settings from schema import Schema from .techloan.techloan import Techloan from .techloan.spotseeker import Spots logger = logging.getLog...
apache-2.0
Python
a9bcbe8bf69403dbf7780843fe362cf8e1f02c95
update tree topo
TakeshiTseng/SDN-Work,TakeshiTseng/SDN-Work,TakeshiTseng/SDN-Work,TakeshiTseng/SDN-Work
mininet/tree/tree.py
mininet/tree/tree.py
#!/usr/bin/env python from mininet.cli import CLI from mininet.node import Link from mininet.net import Mininet from mininet.node import RemoteController from mininet.term import makeTerm from functools import partial def ofp_version(switch, protocols): protocols_str = ','.join(protocols) command = 'ovs-vsctl set...
#!/usr/bin/env python from mininet.cli import CLI from mininet.link import Link from mininet.net import Mininet from mininet.node import RemoteController from mininet.term import makeTerm def ofp_version(switch, protocols): protocols_str = ','.join(protocols) command = 'ovs-vsctl set Bridge %s protocols=%s' % (swi...
mit
Python
e2e57a89b63943857eb2954d0c5bdcf8e2191ff4
simplify logic for player count requirement
SupaHam/mark2,SupaHam/mark2
mk2/plugins/alert.py
mk2/plugins/alert.py
import os import random from mk2.plugins import Plugin from mk2.events import Hook, StatPlayerCount class Alert(Plugin): interval = Plugin.Property(default=200) command = Plugin.Property(default="say {message}") path = Plugin.Property(default="alerts.txt") min_pcount = Plugin.Property(default=0)...
import os import random from mk2.plugins import Plugin from mk2.events import Hook, StatPlayerCount class Alert(Plugin): interval = Plugin.Property(default=200) command = Plugin.Property(default="say {message}") path = Plugin.Property(default="alerts.txt") min_pcount = Plugin.Property(default=0)...
mit
Python
1519d9dc2f483671aee0f92252dd839a4d7af9c3
Add About page TemplateView
xanv/painindex
painindex_app/urls.py
painindex_app/urls.py
from django.conf.urls import patterns, url from django.views.generic import TemplateView, FormView from painindex_app import views urlpatterns = patterns('', url(r'^$', views.homepage, name='homepage'), url(r'^about/$', TemplateView.as_view(template_name='painindex_app/about.html'), name='about'), url(r'^...
from django.conf.urls import patterns, url from django.views.generic import TemplateView, FormView from painindex_app import views urlpatterns = patterns('', url(r'^$', views.homepage, name='homepage'), url(r'^painsource/(?P<painsource_id>\d+)/$', views.painsource_detail, name='painsource_detail'), # url(...
mit
Python
40705a39292d0080126933b2318d20ef1a4499a2
Remove obsolete input.
matz-e/lobster,matz-e/lobster,matz-e/lobster
lobster/cmssw/data/job.py
lobster/cmssw/data/job.py
#!/usr/bin/env python import json import os import pickle import shutil import subprocess import sys fragment = """import FWCore.ParameterSet.Config as cms process.source.fileNames = cms.untracked.vstring({input_files}) process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(-1)) process.source.lumisToProc...
#!/usr/bin/env python import base64 import json import os import pickle import shutil import subprocess import sys fragment = """import FWCore.ParameterSet.Config as cms process.source.fileNames = cms.untracked.vstring({input_files}) process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(-1)) process.sour...
mit
Python
85769162560d83a58ccc92f818559ddd3dce2a09
Fix another bug in the authentication
layus/INGInious,GuillaumeDerval/INGInious,GuillaumeDerval/INGInious,layus/INGInious,layus/INGInious,GuillaumeDerval/INGInious,GuillaumeDerval/INGInious,layus/INGInious
pages/index.py
pages/index.py
import web from modules.base import renderer from modules.login import loginInstance from modules.courses import Course #Index page class IndexPage: #Simply display the page def GET(self): if loginInstance.isLoggedIn(): userInput = web.input(); if "logoff" in userInput: ...
import web from modules.base import renderer from modules.login import loginInstance from modules.courses import Course #Index page class IndexPage: #Simply display the page def GET(self): if loginInstance.isLoggedIn(): userInput = web.input(); if "logoff" in userInput: ...
agpl-3.0
Python
1363c12251cb6aaad37f2b3be6890f70e7f80a66
Fix invalid syntax
caioariede/django-location-field,caioariede/django-location-field,Mixser/django-location-field,undernewmanagement/django-location-field,janusnic/django-location-field,caioariede/django-location-field,Mixser/django-location-field,undernewmanagement/django-location-field,recklessromeo/django-location-field,recklessromeo/...
location_field/widgets.py
location_field/widgets.py
from django.conf import settings from django.forms import widgets from django.utils.safestring import mark_safe GOOGLE_MAPS_V3_APIKEY = getattr(settings, 'GOOGLE_MAPS_V3_APIKEY', None) GOOGLE_API_JS = '//maps.google.com/maps/api/js?sensor=false' if GOOGLE_MAPS_V3_APIKEY: GOOGLE_API_JS = '{0}&amp;key={0}'.format(G...
from django.conf import settings from django.forms import widgets from django.utils.safestring import mark_safe GOOGLE_MAPS_V3_APIKEY = getattr(settings, 'GOOGLE_MAPS_V3_APIKEY', None) GOOGLE_API_JS = '//maps.google.com/maps/api/js?sensor=false' if GOOGLE_MAPS_V3_APIKEY: GOOGLE_API_JS = '{0}&amp;key={0}'.format(G...
mit
Python
30c8e4d7a1e6e237772aa89256b83ec37a015803
increment version
MediaMath/t1-python
terminalone/metadata.py
terminalone/metadata.py
# -*- coding: utf-8 -*- __name__ = 'TerminalOne' __author__ = 'MediaMath' __copyright__ = 'Copyright 2015, MediaMath' __license__ = 'Apache License, Version 2.0' __version__ = '1.9.9' __maintainer__ = 'MediaMath Developer Relations' __email__ = 'developers@mediamath.com' __status__ = 'Stable' __url__ = 'http://www.med...
# -*- coding: utf-8 -*- __name__ = 'TerminalOne' __author__ = 'MediaMath' __copyright__ = 'Copyright 2015, MediaMath' __license__ = 'Apache License, Version 2.0' __version__ = '1.9.8' __maintainer__ = 'MediaMath Developer Relations' __email__ = 'developers@mediamath.com' __status__ = 'Stable' __url__ = 'http://www.med...
apache-2.0
Python
1fca3a48b0617b19554ab55c54db322090a69c3d
Add with statement tests
tyrannosaurus/python-libmagic
magic/tests/test_magic.py
magic/tests/test_magic.py
import unittest import magic import magic.flags class MagicTestCase(unittest.TestCase): def setUp(self): self.magic = magic.Magic() def test_get_version(self): self.assertTrue(isinstance(self.magic.version, int)) def test_from_buffer(self): mimetype = self.magic.from_buffer("ehlo") self.asse...
import unittest import magic import magic.flags class MagicTestCase(unittest.TestCase): def setUp(self): self.magic = magic.Magic() def test_get_version(self): self.assertTrue(isinstance(self.magic.version, int)) def test_from_buffer(self): mimetype = self.magic.from_buffer("ehlo") self.asse...
mit
Python
436aa56758403b96aa4c0038db6d2a24047cfa16
fix bug
youtaya/mothertree,youtaya/mothertree,youtaya/mothertree,youtaya/mothertree
monthertree/monthertree/wsgi.py
monthertree/monthertree/wsgi.py
""" WSGI config for monthertree project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ """ import os import sys from django.conf import settings sys.path.append(settings.PROJECT_DIR) o...
""" WSGI config for monthertree project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ """ import os import sys sys.path.append('/home/jinxp/Documents/shell/mothertree/monthertree/') o...
mit
Python
6d8dbb6621da2ddfffd58303131eb6cda345e37c
Make person experience the default tab for ZA
hzj123/56th,mysociety/pombola,geoffkilpin/pombola,hzj123/56th,mysociety/pombola,geoffkilpin/pombola,patricmutwiri/pombola,hzj123/56th,mysociety/pombola,patricmutwiri/pombola,ken-muturi/pombola,geoffkilpin/pombola,ken-muturi/pombola,hzj123/56th,patricmutwiri/pombola,patricmutwiri/pombola,patricmutwiri/pombola,hzj123/56t...
pombola/south_africa/urls.py
pombola/south_africa/urls.py
from django.conf.urls import patterns, include, url from pombola.core.views import PersonDetailSub from pombola.south_africa.views import LatLonDetailView,SAPlaceDetailSub urlpatterns = patterns('pombola.south_africa.views', url(r'^place/latlon/(?P<lat>[0-9\.-]+),(?P<lon>[0-9\.-]+)/', LatLonDetailView.as_view(), ...
from django.conf.urls import patterns, include, url from pombola.south_africa.views import LatLonDetailView,SAPlaceDetailSub urlpatterns = patterns('pombola.south_africa.views', url(r'^place/latlon/(?P<lat>[0-9\.-]+),(?P<lon>[0-9\.-]+)/', LatLonDetailView.as_view(), name='latlon'), url(r'^place/(?P<slug>[-\w]...
agpl-3.0
Python
76289f734f622227c44487d8f44879e078dbdcb3
Improve gzweb launcher
cyrillg/ros-playground,cyrillg/ros-playground
src/deedee_tutorials/src/deedee_tutorials/launcher.py
src/deedee_tutorials/src/deedee_tutorials/launcher.py
#! /usr/bin/env python import rospy import subprocess class MainLauncher: ''' Node spawning the environment with respect to the global configs ''' def __init__(self): rospy.init_node("middleware_spawner") rospy.sleep(0.5) # Configs self.configs = {"robot_name": "deedee", "si...
#! /usr/bin/env python import rospy import subprocess class MainLauncher: ''' Node spawning the environment with respect to the global configs ''' def __init__(self): rospy.init_node("middleware_spawner") rospy.sleep(0.5) # Configs self.configs = {"robot_name": "deedee", "si...
mit
Python
61c6f174b1e406955c3e881217ff863d6ff6c3ce
Fix validate/sanitize functions for click
thombashi/pathvalidate
pathvalidate/click.py
pathvalidate/click.py
""" .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ import click from ._common import PathType from ._file import sanitize_filename, sanitize_filepath, validate_filename, validate_filepath from .error import ValidationError def validate_filename_arg(ctx, param, value) -> str: if not value: ...
""" .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ import click from ._common import PathType from ._file import sanitize_filename, sanitize_filepath, validate_filename, validate_filepath from .error import ValidationError def validate_filename_arg(ctx, param, value) -> None: if not value:...
mit
Python
b65283984b1be7e8bb88d3281bb3654a3dd12233
Make sure test setup is run for subdirectories
n0ano/ganttclient
nova/tests/scheduler/__init__.py
nova/tests/scheduler/__init__.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Openstack LLC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/...
apache-2.0
Python
aeb69479a6bf5492411e82bbcb77331daa8da819
add a test to test the monitor
lapisdecor/bzoing
tests/test_bzoing.py
tests/test_bzoing.py
""" test_bzoing ---------------------------------- Tests for `bzoing` module. """ import unittest from bzoing.tasks import Bzoinq, Monitor import time class TestTasksAndMonitor(unittest.TestCase): def test_creating_task(self): a = Bzoinq() a.create_task() self.assertTrue(len(a.task_lis...
""" test_bzoing ---------------------------------- Tests for `bzoing` module. """ import unittest from bzoing.tasks import Bzoinq, Monitor import time class TestTasksAndMonitor(unittest.TestCase): def test_creating_task(self): a = Bzoinq() a.create_task() self.assertTrue(len(a.task_list...
mit
Python
148826f75072576d7f0d0f206e3d1dba34688720
Refactor getLongestWord to simplify maximum collection and reduce number of conditionals
alkaitz/general-programming
stream_processor/stream_processor.py
stream_processor/stream_processor.py
''' Created on Aug 7, 2017 @author: alkaitz ''' import heapq ''' You have a function that will be called with a stream of strings. Every time you receive a new word, you should return the length of the longest word that you have received that has showed in the string only once. Ex: f("Yes") -> 3 ...
''' Created on Aug 7, 2017 @author: alkaitz ''' import heapq ''' You have a function that will be called with a stream of strings. Every time you receive a new word, you should return the length of the longest word that you have received that has showed in the string only once. Ex: f("Yes") -> 3 ...
mit
Python
6d267faaf9d18e58b24cf93906961b152ef0fcb7
build vehicle list based on if make is provided
sitture/trade-motors,sitture/trade-motors,sitture/trade-motors,sitture/trade-motors,sitture/trade-motors
src/vehicles/views.py
src/vehicles/views.py
from django.shortcuts import render, render_to_response, RequestContext # import the custom context processor from vehicles.context_processor import global_context_processor from vehicles.models import Vehicle, VehicleMake, Category def home_page(request): return render_to_response("home_page.html", locals(), ...
from django.shortcuts import render, render_to_response, RequestContext # import the custom context processor from vehicles.context_processor import global_context_processor from vehicles.models import Vehicle, Category def home_page(request): return render_to_response("home_page.html", locals(), context...
mit
Python
39ab86b500cc28420aa0062395adc9e6ddf2017c
allow reading fom multiple configuration files
OpenTouch/vsphere-client
src/vsphere/config.py
src/vsphere/config.py
import sys from os import path from ConfigParser import ConfigParser VSPHERE_CFG_FILE = "vsphere.conf" unix_platforms = [ "darwin", "Linux" ] class EsxConfig: def __init__(self): ok = False # specific configuration local_cfg = VSPHERE_CFG_FILE # user-global configuration...
from ConfigParser import ConfigParser class EsxConfig: def __init__(self): parser = ConfigParser() parser.read("vsphere.conf") self.vs_host = parser.get('server', 'host') self.vs_user = parser.get('server', 'user') self.vs_password = parser.get('server', 'password') ...
apache-2.0
Python
170a50eeca4249a488cc9d0c69876c5f2708b743
use two-tail for testing significance and right_tail for redundancy checking
anzev/hedwig,anzev/hedwig
stats/significance.py
stats/significance.py
''' Significance testing methods. @author: anze.vavpetic@ijs.si ''' from fisher import pvalue def is_redundant(rule, new_rule): ''' Computes the redundancy coefficient of a new rule compared to its immediate generalization. Rules with a coeff > 1 are deemed non-redundant. ''' return _fisher(...
''' Significance testing methods. @author: anze.vavpetic@ijs.si ''' from fisher import pvalue def is_redundant(rule, new_rule): ''' Computes the redundancy coefficient of a new rule compared to its immediate generalization. Rules with a coeff > 1 are deemed non-redundant. ''' return fisher(n...
mit
Python
8907993e48a59ce39dab1cdb359e287f527b7642
Add --verbose parameter
stb-tester/stb-tester,LewisHaley/stb-tester,LewisHaley/stb-tester,stb-tester/stb-tester,LewisHaley/stb-tester,LewisHaley/stb-tester,LewisHaley/stb-tester,stb-tester/stb-tester,LewisHaley/stb-tester,LewisHaley/stb-tester,stb-tester/stb-tester
stbt_control_relay.py
stbt_control_relay.py
#!/usr/bin/python """ Allows using any of the stbt remote control backends remotely using the lirc protocol. Presents the same socket protocol as lircd but sending keypresses using any of stbt's controls. This allows for example controlling a roku over its HTTP interface from some software that only speaks lirc. Exa...
#!/usr/bin/python """ Allows using any of the stbt remote control backends remotely using the lirc protocol. Presents the same socket protocol as lircd but sending keypresses using any of stbt's controls. This allows for example controlling a roku over its HTTP interface from some software that only speaks lirc. Exa...
lgpl-2.1
Python
84ee720fd2d8403de5f49c54fc41bfcb67a78f78
Add missing vat alias for Turkey
arthurdejong/python-stdnum,arthurdejong/python-stdnum,arthurdejong/python-stdnum
stdnum/tr/__init__.py
stdnum/tr/__init__.py
# __init__.py - collection of Turkish numbers # coding: utf-8 # # Copyright (C) 2016 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 Turkish numbers # coding: utf-8 # # Copyright (C) 2016 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, ...
lgpl-2.1
Python
f02eb748d33b621368198c10a965b27ee31effca
update tutorial section link
freme-project/Documentation,freme-project/Documentation,freme-project/Documentation,freme-project/Documentation,freme-project/freme-project.github.io,freme-project/Documentation,freme-project/freme-project.github.io,freme-project/freme-project.github.io,freme-project/freme-project.github.io
swagger/yamlscript.py
swagger/yamlscript.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # This script, when run, parses the file "swagger.yaml" and strips it down to only # include those paths and methods specified in the included variable. # # As of now, it is called with every "jekyll build" - see jekyll-freme/_plugins/jekyll-pages-directory.rb # line: "...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # This script, when run, parses the file "swagger.yaml" and strips it down to only # include those paths and methods specified in the included variable. # # As of now, it is called with every "jekyll build" - see jekyll-freme/_plugins/jekyll-pages-directory.rb # line: "...
apache-2.0
Python
86b698a228ddf1309e8f2006726724af05c5fca1
bump version
pinax/symposion,miurahr/symposion,pydata/symposion,pyconca/2013-web,python-spain/symposion,pyconau2017/symposion,NelleV/pyconfr-test,miurahr/symposion,faulteh/symposion,pyohio/symposion,pyohio/symposion,NelleV/pyconfr-test,mbrochh/symposion,TheOpenBastion/symposion,euroscipy/symposion,toulibre/symposion,mbrochh/symposi...
symposion/__init__.py
symposion/__init__.py
__version__ = "1.0b1.dev12"
__version__ = "1.0b1.dev11"
bsd-3-clause
Python
18d551d2495fc122edb142e416a06ce4129da1f7
Update urls.py
BoraDowon/Life3.0,BoraDowon/Life3.0,BoraDowon/Life3.0
life3/config/urls.py
life3/config/urls.py
"""life3.0 URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-ba...
"""life3.0 URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-ba...
mit
Python
ac3a9211725a0538c8c8f7899d86e4e22ceebb71
Update binary_search.py
ueg1990/aids
aids/sorting_and_searching/binary_search.py
aids/sorting_and_searching/binary_search.py
''' In this module, we implement binary search in Python both recrusively and iteratively Assumption: Array is sorted Time complexity: O(log n) ''' def binary_search_recursive(arr, left, right, value): ''' Recursive implementation of binary search of a sorted array Return index of the value found else ...
''' In this module, we implement binary search in Python both recrusively and iteratively Assumption: Array is sorted Time complexity: O(log n) ''' def binary_search_recursive(arr, left, right, value): ''' Recursive implementation of binary search of a sorted array Return index of the value found else ...
mit
Python
1433106d2e36a08f79b4b2c67e07c1fdd361bda6
fix MAINTENANCE_MODE logic
DemocracyClub/electionleaflets,JustinWingChungHui/electionleaflets,JustinWingChungHui/electionleaflets,JustinWingChungHui/electionleaflets,JustinWingChungHui/electionleaflets,DemocracyClub/electionleaflets,DemocracyClub/electionleaflets
electionleaflets/urls.py
electionleaflets/urls.py
from django.conf import settings from django.conf.urls import patterns, include, url from django.contrib import admin from django.conf.urls.static import static from django.views.generic import TemplateView admin.autodiscover() from leaflets.feeds import * from core.views import HomeView, MaintenanceView MAINTENANCE...
from django.conf import settings from django.conf.urls import patterns, include, url from django.contrib import admin from django.conf.urls.static import static from django.views.generic import TemplateView admin.autodiscover() from leaflets.feeds import * from core.views import HomeView, MaintenanceView if getattr...
mit
Python
bc9bbe0075f8a6571179e2310a9cfeaff89652b2
Remove unused argument
nerevu/riko,nerevu/riko
modules/pipeunion.py
modules/pipeunion.py
# pipeunion.py # from pipe2py import util def pipe_union(context, _INPUT, **kwargs): """This operator merges up to 5 source together. Keyword arguments: context -- pipeline context _INPUT -- source generator kwargs -- _OTHER1 - another source generator _OTHER2 etc. Yields (...
# pipeunion.py # from pipe2py import util def pipe_union(context, _INPUT, conf, **kwargs): """This operator merges up to 5 source together. Keyword arguments: context -- pipeline context _INPUT -- source generator kwargs -- _OTHER1 - another source generator _OTHER2 etc. conf: ...
mit
Python
3053c57a67c4dfb5e20bb93d6a586c7acf84275e
Prepare release v1.3.5.
bigbrozer/monitoring.nagios,bigbrozer/monitoring.nagios
monitoring/nagios/__init__.py
monitoring/nagios/__init__.py
import monitoring.nagios.logger __version__ = '1.3.5'
import monitoring.nagios.logger __version__ = '1.3.2'
mit
Python
cf07c34fe3a3d7b8767e50e77e609253dd177cff
Use isoformat date RFC 3339
YunoHost/moulinette
moulinette/utils/serialize.py
moulinette/utils/serialize.py
import logging from json.encoder import JSONEncoder import datetime logger = logging.getLogger('moulinette.utils.serialize') # JSON utilities ------------------------------------------------------- class JSONExtendedEncoder(JSONEncoder): """Extended JSON encoder Extend default JSON encoder to recognize mor...
import logging from json.encoder import JSONEncoder import datetime logger = logging.getLogger('moulinette.utils.serialize') # JSON utilities ------------------------------------------------------- class JSONExtendedEncoder(JSONEncoder): """Extended JSON encoder Extend default JSON encoder to recognize mor...
agpl-3.0
Python
5d8b2224bf2864ad7e4bacb0624542dec8549b57
add mpf-mc entry points in machine test
missionpinball/mpf,missionpinball/mpf
mpf/tests/MpfMachineTestCase.py
mpf/tests/MpfMachineTestCase.py
import inspect from mpf.core.machine import MachineController from mpf.tests.MpfTestCase import MpfTestCase class MpfMachineTestCase(MpfTestCase): def __init__(self, methodName='runTest'): super().__init__(methodName) # only disable bcp. everything else should run self.machine_config_pat...
from mpf.tests.MpfTestCase import MpfTestCase class MpfMachineTestCase(MpfTestCase): def __init__(self, methodName='runTest'): super().__init__(methodName) # only disable bcp. everything else should run self.machine_config_patches = dict() self.machine_config_patches['bcp'] = [] ...
mit
Python
04745c9c4074ee44e2cfd7ef5fecae1eb796b109
Fix now_utc() to return aware datetime
Dark5ide/mycroft-core,forslund/mycroft-core,linuxipho/mycroft-core,Dark5ide/mycroft-core,MycroftAI/mycroft-core,forslund/mycroft-core,MycroftAI/mycroft-core,linuxipho/mycroft-core
mycroft/util/time.py
mycroft/util/time.py
# -*- coding: utf-8 -*- # # Copyright 2018 Mycroft AI 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 ...
# -*- coding: utf-8 -*- # # Copyright 2018 Mycroft AI 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 ...
apache-2.0
Python
e4ccfdb49951ed9c4073ba389421d89fea273288
make test more robust
missionpinball/mpf-mc,missionpinball/mpf-mc,missionpinball/mpf-mc
mpfmc/tests/MpfSlideTestCase.py
mpfmc/tests/MpfSlideTestCase.py
from mpf.tests.MpfTestCase import MpfTestCase class MpfSlideTestCase(MpfTestCase): def assertSlideOnTop(self, slide_name, target="default"): self.assertEqual(slide_name, self.mc.targets[target].current_slide.name) def assertTextOnTopSlide(self, text, target="default"): self.assertTextInSlide...
from mpf.tests.MpfTestCase import MpfTestCase class MpfSlideTestCase(MpfTestCase): def assertSlideOnTop(self, slide_name, target="default"): self.assertEqual(slide_name, self.mc.targets[target].current_slide.name) def assertTextOnTopSlide(self, text, target="default"): self.assertTextInSlide...
mit
Python
2d95b9a4b6d87e9f630c59995403988dee390c20
Fix simple typo: utilty -> utility (#5182)
dmlc/xgboost,dmlc/xgboost,dmlc/xgboost,dmlc/xgboost,dmlc/xgboost,dmlc/xgboost
doc/sphinx_util.py
doc/sphinx_util.py
# -*- coding: utf-8 -*- """Helper utility function for customization.""" import sys import os import docutils import subprocess READTHEDOCS_BUILD = (os.environ.get('READTHEDOCS', None) is not None) if not os.path.exists('web-data'): subprocess.call('rm -rf web-data;' + 'git clone https://github.co...
# -*- coding: utf-8 -*- """Helper utilty function for customization.""" import sys import os import docutils import subprocess READTHEDOCS_BUILD = (os.environ.get('READTHEDOCS', None) is not None) if not os.path.exists('web-data'): subprocess.call('rm -rf web-data;' + 'git clone https://github.com...
apache-2.0
Python
62f3a1ce0e2af511e897ac300e3ab32f4bf14463
Fix docs
pybel/pybel,pybel/pybel,pybel/pybel
src/pybel/struct/filters/node_predicates/modifications.py
src/pybel/struct/filters/node_predicates/modifications.py
# -*- coding: utf-8 -*- """Predicates for checking nodes' variants.""" from functools import wraps from typing import Tuple, Type, Union from .utils import node_predicate from ..typing import NodePredicate from ....dsl import BaseEntity, CentralDogma, Fragment, GeneModification, Hgvs, ProteinModification, Variant _...
# -*- coding: utf-8 -*- """Predicates for checking nodes' variants.""" from typing import Tuple, Type, Union from .utils import node_predicate from ..typing import NodePredicate from ....dsl import BaseEntity, CentralDogma, Fragment, GeneModification, Hgvs, ProteinModification, Variant __all__ = [ 'has_variant'...
mit
Python
65b658d9bb1b9220cfd15724692517c14f5e2cbc
Send more information
ebmdatalab/openprescribing,annapowellsmith/openpresc,ebmdatalab/openprescribing,ebmdatalab/openprescribing,annapowellsmith/openpresc,annapowellsmith/openpresc,ebmdatalab/openprescribing,annapowellsmith/openpresc
openprescribing/frontend/signals/handlers.py
openprescribing/frontend/signals/handlers.py
import logging from allauth.account.signals import user_logged_in from anymail.signals import tracking from requests_futures.sessions import FuturesSession from django.contrib.auth.models import User from django.db.models.signals import post_save from django.dispatch import receiver from django.conf import settings ...
import logging from allauth.account.signals import user_logged_in from anymail.signals import tracking from requests_futures.sessions import FuturesSession from django.contrib.auth.models import User from django.db.models.signals import post_save from django.dispatch import receiver from django.conf import settings ...
mit
Python
09cb8a0fbb10f14d6622bbeed815e025e4eb1751
Update newServer.py
mrahman1122/Team4CS3240
Server/newServer.py
Server/newServer.py
__author__ = 'masudurrahman' import sys import os from twisted.protocols import ftp from twisted.protocols.ftp import FTPFactory, FTPAnonymousShell, FTPRealm, FTP, FTPShell, IFTPShell from twisted.cred.portal import Portal from twisted.cred import checkers from twisted.cred.checkers import AllowAnonymousAccess, FilePa...
__author__ = 'masudurrahman' import sys import os from twisted.protocols import ftp from twisted.protocols.ftp import FTPFactory, FTPAnonymousShell, FTPRealm, FTP, FTPShell, IFTPShell from twisted.cred.portal import Portal from twisted.cred import checkers from twisted.cred.checkers import AllowAnonymousAccess, FilePa...
apache-2.0
Python
25e71a56d48e5bdc4d73522333196d69d735707a
Update the PCA10056 example to use new pin naming
adafruit/micropython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/micropython,adafruit/micropython,adafruit/micropython,adafruit/circuitpython,adafruit/micropython
ports/nrf/boards/pca10056/examples/buttons.py
ports/nrf/boards/pca10056/examples/buttons.py
import board import digitalio import gamepad import time pad = gamepad.GamePad( digitalio.DigitalInOut(board.P0_11), digitalio.DigitalInOut(board.P0_12), digitalio.DigitalInOut(board.P0_24), digitalio.DigitalInOut(board.P0_25), ) prev_buttons = 0 while True: buttons = pad.get_pressed() if bu...
import board import digitalio import gamepad import time pad = gamepad.GamePad( digitalio.DigitalInOut(board.PA11), digitalio.DigitalInOut(board.PA12), digitalio.DigitalInOut(board.PA24), digitalio.DigitalInOut(board.PA25), ) prev_buttons = 0 while True: buttons = pad.get_pressed() if button...
mit
Python
3de29a3fdd17beece1fbe26c4f578cd854d16d0d
Fix bug introduced in update_from_old_problemformat.py
Kattis/problemtools,Kattis/problemtools,Kattis/problemtools,Kattis/problemtools
problemtools/update_from_old_problemformat.py
problemtools/update_from_old_problemformat.py
# -*- coding: utf-8 -*- import argparse import glob import os.path import yaml def update(problemdir): probyaml = os.path.join(problemdir, 'problem.yaml') if not os.path.isfile(probyaml): raise Exception('Could not find %s' % probyaml) config = yaml.safe_load('%s' % open(probyaml, 'r').read()) ...
# -*- coding: utf-8 -*- import argparse import glob import os.path import yaml def update(problemdir): probyaml = os.path.join(problemdir, 'problem.yaml') if not os.path.isfile(probyaml): raise Exception('Could not find %s' % probyaml) config = yaml.safe_load('%s' % open(probyaml, 'r').read()) ...
mit
Python
a3bb1ff203789b6547e241f2ba0108e89bd1aefe
Remove mystery import
pavoljuhas/ipython_ophyd,NSLS-II-XPD/ipython_ophyd,pavoljuhas/ipython_ophyd,NSLS-II-XPD/ipython_ophyd
profile_collection/startup/80-areadetector.py
profile_collection/startup/80-areadetector.py
from ophyd.controls.area_detector import (AreaDetectorFileStoreHDF5, AreaDetectorFileStoreTIFF, AreaDetectorFileStoreTIFFSquashing) # from shutter import sh1 shctl1 = EpicsSignal('XF:28IDC-ES:1{Det:PE1}cam1:ShutterMode', name='shctl1'...
from ophyd.controls.area_detector import (AreaDetectorFileStoreHDF5, AreaDetectorFileStoreTIFF, AreaDetectorFileStoreTIFFSquashing) from shutter import sh1 shctl1 = EpicsSignal('XF:28IDC-ES:1{Det:PE1}cam1:ShutterMode', name='shctl1') ...
bsd-2-clause
Python
9bd5b66a50def87de2b8a37ba452ee4efc8a17b7
add docstring for update_average
xgi/aliendb,xgi/aliendb,xgi/aliendb,xgi/aliendb
web/aliendb/apps/analytics/helpers.py
web/aliendb/apps/analytics/helpers.py
def update_average(field, value, tracked) -> float: """Updates a previously calculated average with a new value. Args: field: the current average; value: the new value to include in the average; tracked: the number of elements used to form the _original_ average; Returns: f...
def update_average(field, value, tracked): return (value + field * tracked) / (1 + tracked)
bsd-3-clause
Python
aaac2228119bf965183d30ebf9d4b8cb13699fd8
fix tkinter for python 3
tdimiduk/groupeng
GroupEng.py
GroupEng.py
#!/usr/bin/python # Copyright 2011, Thomas G. Dimiduk # # This file is part of GroupEng. # # GroupEng is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your opti...
#!/usr/bin/python # Copyright 2011, Thomas G. Dimiduk # # This file is part of GroupEng. # # GroupEng is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your opti...
agpl-3.0
Python
3e7d433c193bd2e35b2c760297d81973f56b3eec
Fix test cases
muddyfish/PYKE,muddyfish/PYKE
node/floor_divide.py
node/floor_divide.py
#!/usr/bin/env python from nodes import Node import math class FloorDiv(Node): char = "f" args = 2 results = 1 @Node.test_func([3,2], [1]) @Node.test_func([6,-3], [-2]) def func(self, a:Node.number,b:Node.number): """a/b. Rounds down, returns an int.""" return a//b ...
#!/usr/bin/env python from nodes import Node import math class FloorDiv(Node): char = "f" args = 2 results = 1 @Node.test_func([3,2], [1]) @Node.test_func([6,-3], [-2]) def func(self, a:Node.number,b:Node.number): """a/b. Rounds down, returns an int.""" return a//b ...
mit
Python
a9c9cbac36568676be194024f6f660e4fc3f03b6
Add old list to applist migration
YunoHost/yunohost,YunoHost/yunohost,YunoHost/moulinette-yunohost,YunoHost/moulinette-yunohost,YunoHost/yunohost,YunoHost/moulinette-yunohost,YunoHost/moulinette-yunohost,YunoHost/moulinette-yunohost,YunoHost/yunohost
src/yunohost/data_migrations/0010_migrate_to_apps_json.py
src/yunohost/data_migrations/0010_migrate_to_apps_json.py
import os from moulinette.utils.log import getActionLogger from yunohost.app import app_fetchlist, app_removelist, _read_appslist_list, APPSLISTS_JSON from yunohost.tools import Migration logger = getActionLogger('yunohost.migration') BASE_CONF_PATH = '/home/yunohost.conf' BACKUP_CONF_DIR = os.path.join(BASE_CONF_PA...
import os from moulinette.utils.log import getActionLogger from yunohost.app import app_fetchlist, app_removelist, _read_appslist_list, APPSLISTS_JSON from yunohost.tools import Migration logger = getActionLogger('yunohost.migration') BASE_CONF_PATH = '/home/yunohost.conf' BACKUP_CONF_DIR = os.path.join(BASE_CONF_PA...
agpl-3.0
Python
9316ec9f2246ac14176d9bf9d27287dfccedb3f3
Update to 0.3.0
Azure/azure-sdk-for-python,Azure/azure-sdk-for-python,AutorestCI/azure-sdk-for-python,lmazuel/azure-sdk-for-python,Azure/azure-sdk-for-python,Azure/azure-sdk-for-python
azure-mgmt-datalake-analytics/azure/mgmt/datalake/analytics/version.py
azure-mgmt-datalake-analytics/azure/mgmt/datalake/analytics/version.py
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------------...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------------...
mit
Python
8c89a0d52c43f96d9673b8b84786a7185ddc3f6f
Bump WireCloud version
rockneurotiko/wirecloud,jpajuelo/wirecloud,jpajuelo/wirecloud,jpajuelo/wirecloud,rockneurotiko/wirecloud,rockneurotiko/wirecloud,rockneurotiko/wirecloud,jpajuelo/wirecloud
src/wirecloud/platform/__init__.py
src/wirecloud/platform/__init__.py
# -*- coding: utf-8 -*- # Copyright (c) 2011-2014 CoNWeT Lab., Universidad Politécnica de Madrid # This file is part of Wirecloud. # Wirecloud is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either v...
# -*- coding: utf-8 -*- # Copyright (c) 2011-2014 CoNWeT Lab., Universidad Politécnica de Madrid # This file is part of Wirecloud. # Wirecloud is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either v...
agpl-3.0
Python
36bfa8f556941848eb1a809d48aae1aa43f23c3f
Add option to choose if we keep the <none> images
aebm/docker-image-cleaner,aleasoluciones/docker-image-cleaner
di-cleaner.py
di-cleaner.py
#!/usr/bin/env python import argparse import atexit import logging import sys from pprint import pformat DEFAULT_DOCKER_BASE_URL = 'unix://var/run/docker.sock' HELP_DOCKER_BASE_URL = ('Refers to the protocol+hostname+port where the ' 'Docker server is hosted. Defaults to %s') % DEFAULT_DOCKER_BASE_URL DEFAULT_DO...
#!/usr/bin/env python import argparse import atexit import logging import sys from pprint import pformat DEFAULT_DOCKER_BASE_URL = 'unix://var/run/docker.sock' HELP_DOCKER_BASE_URL = ('Refers to the protocol+hostname+port where the ' 'Docker server is hosted. Defaults to %s') % DEFAULT_DOCKER_BASE_URL DEFAULT_DO...
mit
Python
edf099ca644aae12daef65ff65744d99fcd3a634
Remove function we won't actually use.
StackStorm/st2,nzlosh/st2,StackStorm/st2,StackStorm/st2,StackStorm/st2,Plexxi/st2,nzlosh/st2,Plexxi/st2,Plexxi/st2,nzlosh/st2,Plexxi/st2,nzlosh/st2
st2common/st2common/util/compat.py
st2common/st2common/util/compat.py
# -*- coding: utf-8 -*- # 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 "Licen...
# -*- coding: utf-8 -*- # 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 "Licen...
apache-2.0
Python
a187bd1f89d40d4274f884bba567a2f6be160dcd
Remove unintended changes from reverthousekeeping command
ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend
cla_backend/apps/cla_butler/management/commands/reverthousekeeping.py
cla_backend/apps/cla_butler/management/commands/reverthousekeeping.py
# coding=utf-8 import os from django.conf import settings from django.contrib.admin.models import LogEntry from django.core.management.base import BaseCommand from cla_butler.qs_to_file import QuerysetToFile from cla_eventlog.models import Log from cla_provider.models import Feedback from complaints.models import Com...
# coding=utf-8 import os import logging from django.conf import settings from django.contrib.admin.models import LogEntry from django.core.management.base import BaseCommand from cla_butler.qs_to_file import QuerysetToFile from cla_eventlog.models import Log from cla_provider.models import Feedback from complaints.mod...
mit
Python
123401cb6ed88b77d9a584eea8f2de75e518e5da
remove try except when hintsvm is not installed
ntucllab/libact,ntucllab/libact,ntucllab/libact
libact/query_strategies/__init__.py
libact/query_strategies/__init__.py
""" Concrete query strategy classes. """ import logging logger = logging.getLogger(__name__) from .active_learning_by_learning import ActiveLearningByLearning from .hintsvm import HintSVM from .uncertainty_sampling import UncertaintySampling from .query_by_committee import QueryByCommittee from .quire import QUIRE fro...
""" Concrete query strategy classes. """ import logging logger = logging.getLogger(__name__) from .active_learning_by_learning import ActiveLearningByLearning try: from .hintsvm import HintSVM except ImportError: logger.warn('HintSVM library not found, not importing.') from .uncertainty_sampling import Uncerta...
bsd-2-clause
Python
0e56ed6234e1f28b0aac2e22063bb39faab1d54c
use '!XyZZy!' as value to be sustituted in metric name
librato/librato-python-web
librato_python_web/tools/compose.py
librato_python_web/tools/compose.py
# Copyright (c) 2015. Librato, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions a...
# Copyright (c) 2015. Librato, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions a...
bsd-3-clause
Python
f379d8ce256159a4fc7ce58abf87c609a4a0c3ab
rename present() _present(), indicating private
alphatwirl/alphatwirl,TaiSakuma/AlphaTwirl,TaiSakuma/AlphaTwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl
AlphaTwirl/EventReader/ProgressMonitor.py
AlphaTwirl/EventReader/ProgressMonitor.py
# Tai Sakuma <sakuma@fnal.gov> import multiprocessing import time from ProgressReport import ProgressReport ##____________________________________________________________________________|| class ProgressReporter(object): def __init__(self, queue, pernevents = 1000): self.queue = queue self.perneve...
# Tai Sakuma <sakuma@fnal.gov> import multiprocessing import time from ProgressReport import ProgressReport ##____________________________________________________________________________|| class ProgressReporter(object): def __init__(self, queue, pernevents = 1000): self.queue = queue self.perneve...
bsd-3-clause
Python
68fe7ecadeda267b5645fd804bb7bbf29afa3667
add docstring
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
corehq/apps/cleanup/management/commands/delete_es_docs_in_domain.py
corehq/apps/cleanup/management/commands/delete_es_docs_in_domain.py
from django.core.management import BaseCommand, CommandError from corehq.apps.domain.models import Domain from corehq.apps.es import AppES, CaseES, CaseSearchES, FormES, GroupES, UserES from corehq.apps.es.registry import registry_entry from corehq.apps.es.transient_util import doc_adapter_from_info class Command(Ba...
from django.core.management import BaseCommand, CommandError from corehq.apps.domain.models import Domain from corehq.apps.es import AppES, CaseES, CaseSearchES, FormES, GroupES, UserES from corehq.apps.es.registry import registry_entry from corehq.apps.es.transient_util import doc_adapter_from_info class Command(Ba...
bsd-3-clause
Python
bff3a087ec70ab07fe163394826a41c33f6bc38f
Add extra version of py-jinja2 (#14989)
iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack
var/spack/repos/builtin/packages/py-jinja2/package.py
var/spack/repos/builtin/packages/py-jinja2/package.py
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyJinja2(PythonPackage): """Jinja2 is a template engine written in pure Python. It provide...
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyJinja2(PythonPackage): """Jinja2 is a template engine written in pure Python. It provide...
lgpl-2.1
Python
2b8716f5a1f0e1f147b6bbda3e45e4abec59811d
fix TB in indexing debug toolbar
abilian/abilian-core,abilian/abilian-core,abilian/abilian-core,abilian/abilian-core,abilian/abilian-core
abilian/services/indexing/debug_toolbar.py
abilian/services/indexing/debug_toolbar.py
# coding=utf-8 """ """ from __future__ import absolute_import from flask import current_app from flask_debugtoolbar.panels import DebugPanel from abilian.core.util import fqcn from abilian.i18n import _ from abilian.web.action import actions class IndexedTermsDebugPanel(DebugPanel): """ A panel to display term va...
# coding=utf-8 """ """ from __future__ import absolute_import from flask import current_app from flask_debugtoolbar.panels import DebugPanel from abilian.core.util import fqcn from abilian.i18n import _ from abilian.web.action import actions class IndexedTermsDebugPanel(DebugPanel): """ A panel to display term va...
lgpl-2.1
Python
0c9f2f51778b26bb126eccfbef0b098da3db2877
normalize version numbers
mozaik-association/mozaik,mozaik-association/mozaik
asynchronous_batch_mailings/__openerp__.py
asynchronous_batch_mailings/__openerp__.py
# -*- coding: utf-8 -*- ############################################################################## # # This file is part of asynchronous_batch_mailings, an Odoo module. # # Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>) # # asynchronous_batch_mailings is free software: # you can redistribute i...
# -*- coding: utf-8 -*- ############################################################################## # # This file is part of asynchronous_batch_mailings, an Odoo module. # # Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>) # # asynchronous_batch_mailings is free software: # you can redistribute i...
agpl-3.0
Python
dafc54e782c5ee9bda3cf1817df92ae16ed26979
fix website url in manifest
ClearCorp/server-tools,ClearCorp/server-tools
attachment_base_synchronize/__openerp__.py
attachment_base_synchronize/__openerp__.py
# coding: utf-8 # @ 2015 Florian DA COSTA @ Akretion # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': 'Attachment Base Synchronize', 'version': '9.0.1.0.0', 'author': 'Akretion,Odoo Community Association (OCA)', 'website': 'http://www.akretion.com/', 'license': 'AGPL-3...
# coding: utf-8 # @ 2015 Florian DA COSTA @ Akretion # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': 'Attachment Base Synchronize', 'version': '9.0.1.0.0', 'author': 'Akretion,Odoo Community Association (OCA)', 'website': 'www.akretion.com', 'license': 'AGPL-3', '...
agpl-3.0
Python
a007f80dc2182787eca521c84f37aeedc307645a
Remove base64 padding
amitu/django-encrypted-id
encrypted_id/__init__.py
encrypted_id/__init__.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals try: basestring except NameError: basestring = str from Crypto.Cipher import AES import base64 import binascii import struct from djang...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals try: basestring except NameError: basestring = str from Crypto.Cipher import AES import base64 import binascii import struct from djang...
bsd-2-clause
Python
391d69f4ce485ff02a3844b4cf5a54f23125c477
test presab
ballesterus/PhyloUtensils
partBreaker.py
partBreaker.py
#!/usr/bin/env python import argparse import Get_fasta_from_Ref as GFR import re from sys import argv import os presab={} def Subsetfromto(FastaDict, outFile, start,end): """Writes a subsect multifast file, boud at sequence indeces start and end, form sequence stored in a dictioanry""" with open(outFile, '...
#!/usr/bin/env python import argparse import Get_fasta_from_Ref as GFR import re from sys import argv import os def Subsetfromto(FastaDict, outFile, start,end): """Writes a subsect multifast file, boud at sequence indeces start and end, form sequence stored in a dictioanry""" with open(outFile, 'w') as out...
agpl-3.0
Python
7399dfa45c9b5a563798f504e9eb4054faf2aa30
print a more meaningful description of EventAct
openpolis/open_municipio,openpolis/open_municipio,openpolis/open_municipio,openpolis/open_municipio
open_municipio/events/models.py
open_municipio/events/models.py
from django.db import models from django.utils.translation import ugettext_lazy as _ from open_municipio.acts.models import Act from open_municipio.events.managers import EventManager from open_municipio.people.models import Institution from datetime import datetime, date class Event(models.Model): """ This ...
from django.db import models from django.utils.translation import ugettext_lazy as _ from open_municipio.acts.models import Act from open_municipio.events.managers import EventManager from open_municipio.people.models import Institution from datetime import datetime, date class Event(models.Model): """ This ...
agpl-3.0
Python
a9373c3e4c65160bc04e56edbc356e086d2dae71
Tweak division display
mileswwatkins/python-opencivicdata-django,opencivicdata/python-opencivicdata,rshorey/python-opencivicdata-django,opencivicdata/python-opencivicdata,opencivicdata/python-opencivicdata-divisions,opencivicdata/python-opencivicdata-django,mileswwatkins/python-opencivicdata-django,opencivicdata/python-opencivicdata-django,r...
opencivicdata/admin/division.py
opencivicdata/admin/division.py
from django.contrib import admin from opencivicdata.models import division as models @admin.register(models.Division) class DivisionAdmin(admin.ModelAdmin): list_display = ('display_name', 'id') search_fields = list_display
from django.contrib import admin from opencivicdata.models import division as models @admin.register(models.Division) class DivisionAdmin(admin.ModelAdmin): pass
bsd-3-clause
Python
a39cbaf22401c466f02e5b12e3ebdd46fa8eef0c
Fix issue refs in test_numpy_piecewise_regression
skirpichev/omg,diofant/diofant
sympy/printing/tests/test_numpy.py
sympy/printing/tests/test_numpy.py
from sympy import Piecewise from sympy.abc import x from sympy.printing.lambdarepr import NumPyPrinter def test_numpy_piecewise_regression(): """ NumPyPrinter needs to print Piecewise()'s choicelist as a list to avoid breaking compatibility with numpy 1.8. This is not necessary in numpy 1.9+. See symp...
from sympy import Piecewise from sympy.abc import x from sympy.printing.lambdarepr import NumPyPrinter def test_numpy_piecewise_regression(): """ NumPyPrinter needs to print Piecewise()'s choicelist as a list to avoid breaking compatibility with numpy 1.8. This is not necessary in numpy 1.9+. See gh-9...
bsd-3-clause
Python
1addeefdf51713d562788018ebfb6549b215f55b
Fix C typo error in a test
timj/scons,timj/scons,timj/scons,timj/scons,timj/scons,timj/scons,timj/scons,timj/scons,timj/scons
test/option/tree-lib.py
test/option/tree-lib.py
#!/usr/bin/env python # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, ...
#!/usr/bin/env python # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, ...
mit
Python
df9ff4f13fc7da111bc11cf5f390efe94352b6e6
Fix Setting class
ids1024/wikicurses
src/wikicurses/__init__.py
src/wikicurses/__init__.py
import os import json import pkgutil from enum import Enum _data = pkgutil.get_data('wikicurses', 'interwiki.list').decode() wikis = dict([i.split('|')[0:2] for i in _data.splitlines() if i[0]!='#']) default_configdir = os.environ['HOME'] + '/.config' configpath = os.environ.get('XDG_CONFIG_HOME', default_configdir) ...
import os import json import pkgutil from enum import Enum _data = pkgutil.get_data('wikicurses', 'interwiki.list').decode() wikis = dict([i.split('|')[0:2] for i in _data.splitlines() if i[0]!='#']) default_configdir = os.environ['HOME'] + '/.config' configpath = os.environ.get('XDG_CONFIG_HOME', default_configdir) ...
mit
Python
afedc41fd4e573f4db38f2fde38b2286d623b4c4
Remove obsolete property
ZeitOnline/zeit.campus
src/zeit/campus/article.py
src/zeit/campus/article.py
import zope.interface import zeit.cms.content.reference import zeit.campus.interfaces class TopicpageLink(zeit.cms.related.related.RelatedBase): zope.interface.implements(zeit.campus.interfaces.ITopicpageLink) topicpagelink = zeit.cms.content.reference.SingleResource( '.head.topicpagelink', 'relat...
import zope.interface import zeit.cms.content.reference import zeit.campus.interfaces class TopicpageLink(zeit.cms.related.related.RelatedBase): zope.interface.implements(zeit.campus.interfaces.ITopicpageLink) topicpagelink = zeit.cms.content.reference.SingleResource( '.head.topicpagelink', 'relat...
bsd-3-clause
Python
e60a05886c52574227b1a73fe02575ede81ffa5e
mark out-of-date tests with a @skip
d120/pyophase,d120/pyophase,d120/pyophase,d120/pyophase
staff/tests/tests_views.py
staff/tests/tests_views.py
from unittest import skip from django.core import mail from django.test import Client, TestCase from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from django.utils.http import urlencode class StaffAddView(TestCase): fixtures = ['ophasebase.json', 'staff.json', 'students.json...
from django.core import mail from django.test import Client, TestCase from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from django.utils.http import urlencode class StaffAddView(TestCase): fixtures = ['ophasebase.json', 'staff.json', 'students.json'] def test_redirect(s...
agpl-3.0
Python
42ec06aa5e2034266f817dc6465cd8bf4fea6ead
fix migration
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
corehq/apps/linked_domain/migrations/0005_migrate_linked_app_toggle.py
corehq/apps/linked_domain/migrations/0005_migrate_linked_app_toggle.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.9 on 2018-02-01 15:00 from __future__ import unicode_literals from couchdbkit import ResourceNotFound from django.db import migrations from corehq.toggles import LINKED_DOMAINS from toggle.models import Toggle def _migrate_linked_apps_toggle(apps, schema_editor): ...
# -*- coding: utf-8 -*- # Generated by Django 1.11.9 on 2018-02-01 15:00 from __future__ import unicode_literals from couchdbkit import ResourceNotFound from django.db import migrations from corehq.toggles import LINKED_DOMAINS from toggle.models import Toggle def _migrate_linked_apps_toggle(apps, schema_editor): ...
bsd-3-clause
Python
d3d25e127592356d6b678dc8d013f83f53803f67
update mordred.tests to check hidden modules
mordred-descriptor/mordred,mordred-descriptor/mordred
mordred/tests/__main__.py
mordred/tests/__main__.py
import os import nose def main(): base = os.path.dirname(os.path.dirname(__file__)) hidden = [ os.path.join(base, n) for n in os.listdir(base) if n[:1] == "_" and os.path.splitext(n)[1] == ".py" ] tests = [base, os.path.join(base, "_base")] + hidden os.environ["NOSE_WITH...
import os import nose def main(): base = os.path.dirname(os.path.dirname(__file__)) tests = [base, os.path.join(base, "_base")] os.environ["NOSE_WITH_DOCTEST"] = "1" nose.main( defaultTest=",".join(tests), ) if __name__ == "__main__": main()
bsd-3-clause
Python