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
b047c1aad2b0148fc12a0a10732e90c4d71d8e90
clean up to further simplify implementation of pid lockfile
shad7/seedbox
seedbox/cli.py
seedbox/cli.py
#!/usr/bin/env python """ The main program that is the entry point for the SeedboxManager application. Provides the ability to configure and start up processing. """ from __future__ import absolute_import import logging import os import sys import lockfile from lockfile import pidlockfile from oslo.config import cfg ...
#!/usr/bin/env python """ The main program that is the entry point for the SeedboxManager application. Provides the ability to configure and start up processing. """ from __future__ import absolute_import import logging import os import sys import lockfile from lockfile import pidlockfile from oslo.config import cfg ...
mit
Python
009901ef919394e34e961e68a50521dacd859b7a
Bump version 28
ArchiveTeam/terroroftinytown,ArchiveTeam/terroroftinytown,ArchiveTeam/terroroftinytown,hugovk/terroroftinytown,hugovk/terroroftinytown,hugovk/terroroftinytown
terroroftinytown/client/__init__.py
terroroftinytown/client/__init__.py
VERSION = 28 # Please update this whenever .client or .services changes # Please update MIN_VERSION_OVERRIDE and MIN_CLIENT_VERSION_OVERRIDE as needed
VERSION = 27 # Please update this whenever .client or .services changes # Please update MIN_VERSION_OVERRIDE and MIN_CLIENT_VERSION_OVERRIDE as needed
mit
Python
855c7b56ff92efce90dc4953ebabc4aca07f5eb8
Improve LQR example for integrator_chains domain
fmrchallenge/fmrbenchmark,fmrchallenge/fmrbenchmark,fmrchallenge/fmrbenchmark
domains/integrator_chains/fmrb_sci_examples/scripts/lqr.py
domains/integrator_chains/fmrb_sci_examples/scripts/lqr.py
#!/usr/bin/env python from __future__ import print_function import roslib; roslib.load_manifest('dynamaestro') import rospy from dynamaestro.msg import VectorStamped from control import lqr import numpy as np class StateFeedback(rospy.Subscriber): def __init__(self, intopic, outtopic, K=None): rospy.Sub...
#!/usr/bin/env python from __future__ import print_function import roslib; roslib.load_manifest('dynamaestro') import rospy from dynamaestro.msg import VectorStamped class LQRController(rospy.Subscriber): def __init__(self, intopic, outtopic): rospy.Subscriber.__init__(self, outtopic, VectorStamped, self...
bsd-3-clause
Python
cfa91204fa1a820f58d60fe9c6eae5e03f4e09ed
Fix typo in browserify compile command
editorsnotes/editorsnotes,editorsnotes/editorsnotes
editorsnotes_app/management/commands/compile_browserify.py
editorsnotes_app/management/commands/compile_browserify.py
import os import subprocess from optparse import make_option from django.conf import settings from django.core.management.base import BaseCommand, CommandError browserify_bin = os.path.join(settings.EN_PROJECT_PATH, 'node_modules', '.bin', 'browserify') thisdir = os.path.dirname(__file_...
import os import subprocess from optparse import make_option from django.conf import settings from django.core.management.base import BaseCommand, CommandError browserify_bin = os.path.join(settings.EN_PROJECT_PATH, 'node_modules', '.bin', 'browserify') thisdir = os.path.dirname(__file_...
agpl-3.0
Python
815dd19fb4b265e9a29ed98bf612953858fb3bbd
Remove unicode literal compat code
Akasurde/pytest,rmfitzpatrick/pytest,tareqalayan/pytest,tomviner/pytest,pfctdayelise/pytest,The-Compiler/pytest,nicoddemus/pytest,hackebrot/pytest,tomviner/pytest,davidszotten/pytest,markshao/pytest,alfredodeza/pytest,The-Compiler/pytest,txomon/pytest,pytest-dev/pytest,nicoddemus/pytest,RonnyPfannschmidt/pytest,ddbolin...
testing/logging/test_fixture.py
testing/logging/test_fixture.py
# -*- coding: utf-8 -*- import logging logger = logging.getLogger(__name__) sublogger = logging.getLogger(__name__+'.baz') def test_fixture_help(testdir): result = testdir.runpytest('--fixtures') result.stdout.fnmatch_lines(['*caplog*']) def test_change_level(caplog): caplog.set_level(logging.INFO) ...
# -*- coding: utf-8 -*- import sys import logging logger = logging.getLogger(__name__) sublogger = logging.getLogger(__name__+'.baz') u = (lambda x: x.decode('utf-8')) if sys.version_info < (3,) else (lambda x: x) def test_fixture_help(testdir): result = testdir.runpytest('--fixtures') result.stdout.fnmatc...
mit
Python
6407365c6709600b7b62b5760a5bccc4dd9a2aca
Use mock in YoChannelTestCase
ymyzk/kawasemi,ymyzk/django-channels
tests/tests/backends/test_yo.py
tests/tests/backends/test_yo.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from unittest import mock from django.conf import settings from django.test import TestCase import requests from channels.backends.yo import YoChannel from channels.exceptions import HttpError config = settings.CHANNELS["CHANNELS"]["channels.backends.y...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from copy import deepcopy from django.conf import settings from django.test import TestCase from channels.backends.yo import YoChannel from channels.exceptions import HttpError, ImproperlyConfigured config = settings.CHANNELS["CHANNELS"]["channels.back...
mit
Python
0453402da8ca1522fc08ce4d774a2664953348ee
Use post_migrate signal instead of post_syncdb
siovene/django-threaded-messages,siovene/django-threaded-messages,siovene/django-threaded-messages
threaded_messages/management.py
threaded_messages/management.py
from django.conf import settings from django.utils.translation import ugettext_noop as _ from django.db.models import signals if "notification" in settings.INSTALLED_APPS: from notification import models as notification def create_notice_types(app, created_models, verbosity, **kwargs): notification.cr...
from django.conf import settings from django.utils.translation import ugettext_noop as _ from django.db.models import signals if "notification" in settings.INSTALLED_APPS: from notification import models as notification def create_notice_types(app, created_models, verbosity, **kwargs): notification.cr...
mit
Python
3e662c259caf34a73a7ca9a60a5544e5332340da
Write Detector by spec
yu-liang-kono/thumbor_rekognition
thumbor_rekognition/__init__.py
thumbor_rekognition/__init__.py
#!/usr/bin/env python # standard library imports from io import BytesIO # third party related imports import boto3 from thumbor.config import Config from thumbor.detectors import BaseDetector from thumbor.point import FocalPoint from thumbor.utils import logger # local library imports Config.define( 'REKOGNITI...
mit
Python
832e0076423125ebe76ada576df8955006df9b41
add auto parmisson serquence and lowpass filter
irvs/ros_tms,irvs/ros_tms,irvs/ros_tms,irvs/ros_tms,irvs/ros_tms,irvs/ros_tms,irvs/ros_tms,irvs/ros_tms,irvs/ros_tms
tms_ss/tms_ss_vs/scripts/afe.py
tms_ss/tms_ss_vs/scripts/afe.py
#!/usr/bin/env python # -*- coding:utf-8 -*- ## @file afe.py # @brief OEL blood stream sensor node # @author Akio Shigekane # @date 2015.3.3 import rospy import serial import json import traceback import pprint import subprocess from std_msgs.msg import Int32 PORT = "/dev/ttyUSB0" KEYS = (u"Raw", u"HBR"...
#!/usr/bin/env python # -*- coding:utf-8 -*- ## @file afe.py # @brief OEL blood stream sensor node # @author Akio Shigekane # @date 2015.3.3 import rospy import serial import json import traceback import pprint import subprocess from std_msgs.msg import Int32 PORT = "/dev/ttyUSB0" KEYS = ("Raw", "HBR") ...
bsd-3-clause
Python
e925bea54eda611f37ff750cef5e2a92fce3963f
fix typo
cmu-db/cmdbac,cmu-db/cmdbac,cmu-db/db-webcrawler,cmu-db/db-webcrawler,cmu-db/db-webcrawler,cmu-db/cmdbac,cmu-db/db-webcrawler,cmu-db/cmdbac,cmu-db/cmdbac,cmu-db/db-webcrawler
tools/main.py
tools/main.py
#!/usr/bin/env python import os, sys ############ to be deleted in the future sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir)) sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, "core")) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "db_webcrawler.settings") import django django.se...
#!/usr/bin/env python import os, sys ############ to be deleted in the future sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir)) sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, "core")) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "db_webcrawler.settings") import django django.se...
apache-2.0
Python
98b1248dee926f414b9a141df5bd8ff36e342649
Add solution for Lesson_3_Problem_Set.06-Crossfield_Auditing
krzyste/ud032,krzyste/ud032
Lesson_3_Problem_Set/06-Crossfield_Auditing/location.py
Lesson_3_Problem_Set/06-Crossfield_Auditing/location.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ In this problem set you work with cities infobox data, audit it, come up with a cleaning idea and then clean it up. If you look at the full city data, you will notice that there are couple of values that seem to provide the same information in different formats: "point...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ In this problem set you work with cities infobox data, audit it, come up with a cleaning idea and then clean it up. If you look at the full city data, you will notice that there are couple of values that seem to provide the same information in different formats: "point...
agpl-3.0
Python
ae97a252f149a6e6dc231575a5ab238f355e8d13
update url
opengridcc/opengrid,kdebrab/opengrid
opengrid/__about__.py
opengrid/__about__.py
# -*- coding: utf-8 -*- __all__ = ['__title__', '__summary__', '__url__', '__version__', '__author__', '__email__', '__license__'] __title__ = 'opengrid' __summary__ = 'Open-source algorithms for data-driven building analysis and control' __version__ = '0.5.3' __author__ = 'Roel De Coninck and many others' __email__ =...
# -*- coding: utf-8 -*- __all__ = ['__title__', '__summary__', '__url__', '__version__', '__author__', '__email__', '__license__'] __title__ = 'opengrid' __summary__ = 'Open-source algorithms for data-driven building analysis and control' __version__ = '0.5.3' __author__ = 'Roel De Coninck and many others' __email__ =...
apache-2.0
Python
be86e1a9d42bac61bbd3b3c47d1930f8ffb0de37
Update Docstring
blaklites/fb
fb/request.py
fb/request.py
from . import settings from . import wiring """ Constructs a "POST" and "DELETE" URL. The function is used by the publish and delete method First category of "POST" and "DELETE" url construction. Caling it first category because for publishing photos or more complex stuffs, newer fucntions might be added to deal ...
from . import settings from . import wiring #Constructs a "POST" and "DELETE" URL. The function is used by the publish and delete method #First category of "POST" and "DELETE" url construction. Caling it first category because for #publishing photos or more complex stuffs, newer fucntions might be added to deal w...
mit
Python
bfbdf12489c7d9351503feca89f8be135df39150
tag required
ultmaster/eoj3,ultmaster/eoj3,ultmaster/eoj3,ultmaster/eoj3
polygon/problem/forms.py
polygon/problem/forms.py
from django import forms from tagging.models import Tag from problem.models import Problem from utils.multiple_choice_field import CommaSeparatedMultipleChoiceField class ProblemEditForm(forms.ModelForm): class Meta: model = Problem fields = ['title', 'alias', 'time_limit', 'memory_limit', 'descr...
from django import forms from tagging.models import Tag from problem.models import Problem from utils.multiple_choice_field import CommaSeparatedMultipleChoiceField class ProblemEditForm(forms.ModelForm): class Meta: model = Problem fields = ['title', 'alias', 'time_limit', 'memory_limit', 'descr...
mit
Python
6f6244ce7346900c2cbc89ac6dc1d291b03fd73f
add repr for Account to simply debug
Intelworks/OpenTAXII,EclecticIQ/OpenTAXII,EclecticIQ/OpenTAXII,Intelworks/OpenTAXII
opentaxii/entities.py
opentaxii/entities.py
class Account(object): '''Represents Account entity. This class holds user-specific information and is used for authorization. :param str id: account id :param dict details: additional details of an account ''' def __init__( self, id, username, permissions, is_admin=False, **...
class Account(object): '''Represents Account entity. This class holds user-specific information and is used for authorization. :param str id: account id :param dict details: additional details of an account ''' def __init__( self, id, username, permissions, is_admin=False, **...
bsd-3-clause
Python
6a830973fa8f29278015d55819dcbd87f0472ac9
Fix Django 1.10 url patterns warning
ui/django-post_office,JostCrow/django-post_office,RafRaf/django-post_office,ui/django-post_office,yprez/django-post_office,jrief/django-post_office
post_office/test_urls.py
post_office/test_urls.py
from django.conf.urls import include, url from django.contrib import admin admin.autodiscover() urlpatterns = [ url(r'^admin/', include(admin.site.urls), name='admin'), ]
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls), name='admin'), )
mit
Python
d84a9c58cd18e96a144d69d61da3a3c3de51f9b5
Change relative path of healthy files in filter file
NCRA-TIFR/gadpu,NCRA-TIFR/gadpu
filter_lta.py
filter_lta.py
import re import os import glob data_dir = '/data2/gmrtarch/cycle20/' VALID_LIST = '../parser/filter_healthy/healthy2_file.txt' valid_observations = open(VALID_LIST, 'r').read().split('\n')[0:-1] all_observations = os.listdir(data_dir) def INVALID_OBS(): for DIR_NAME in all_observations: current_obslog = g...
import re import os import glob data_dir = '/data2/gmrtarch/cycle20/' VALID_LIST = './parser/filter_healthy/healthy2_file.txt' valid_observations = open(VALID_LIST, 'r').read().split('\n')[0:-1] all_observations = os.listdir(data_dir) def INVALID_OBS(): for DIR_NAME in all_observations: current_obslog = gl...
mit
Python
a014872e27d17b55c68b6e604266f5edac7cc689
add docstring
develersrl/rooms,develersrl/rooms,develersrl/rooms,develersrl/rooms,develersrl/rooms,develersrl/rooms,develersrl/rooms
trunk/editor/structdata/__init__.py
trunk/editor/structdata/__init__.py
"""Package in cui sono inserite tutte le classi necessarie per i dati. Le classi base per rappresentare i dati sono: - Room - Area - Event - Image - Item - ItemRequest - Param - Var - VarRequirement Ogni classe rappresenta un tag necessario per rappresentare l'informazione. Nella cla...
mit
Python
ec4b8b93c146cf2f652d6570449d5fd728515e81
Update conftest.py
bashu/wagtail-metadata-mixin,bashu/wagtail-metadata-mixin
wagtailmetadata/tests/conftest.py
wagtailmetadata/tests/conftest.py
# -*- coding: utf-8 -*- """ Dummy conftest.py for wagtailmetadata. If you don't know what this is for, just leave it empty. Read more about conftest.py under: https://pytest.org/latest/plugins.html """ from __future__ import print_function, absolute_import, division import pytest
# -*- coding: utf-8 -*- """ Dummy conftest.py for secretballot. If you don't know what this is for, just leave it empty. Read more about conftest.py under: https://pytest.org/latest/plugins.html """ from __future__ import print_function, absolute_import, division import pytest
mit
Python
f8d1a6abefe69a04601d99495db2042fcbc2d6a6
Modify to print full paths of files.
holdenweb/nbtools,holdenweb/nbtools
project/tools/nbstats.py
project/tools/nbstats.py
#!/usr/bin/env python # # nbrstats.py: report some statistics on a collection of notebooks # """\ This program reads all the notebooks whose names are passed as arguments (or if no arguments are given, all ".ipynb" files in the current directory) and provides information about the content that will hopefully give a us...
#!/usr/bin/env python # # nbrstats.py: report some statistics on a collection of notebooks # """\ This program reads all the notebooks whose names are passed as arguments (or if no arguments are given, all ".ipynb" files in the current directory) and provides information about the content that will hopefully give a us...
mit
Python
057f0e80f1903d86bf930324faca3da65d5cc3ee
Add docstring comments to functions
GoogleCloudPlatform/getting-started-python,GoogleCloudPlatform/getting-started-python,GoogleCloudPlatform/getting-started-python
authenticating-users/main.py
authenticating-users/main.py
# Copyright 2019 Google 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/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
# Copyright 2019 Google 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/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0
Python
13035697650252583093e94a712811596353d57f
Fix Atom unit tests. (They passed locally, somehow)
ComicIronic/ByondToolsv3,Boggart/ByondTools
tests/Atom.py
tests/Atom.py
''' Created on Jan 1, 2014 @author: Rob ''' import unittest class AtomTest(unittest.TestCase): def test_copy_consistency(self): from byond.basetypes import Atom, BYONDString, BYONDValue atom = Atom('/datum/test',__file__,0) atom.properties['dir']=BYONDValue(2) atom.propert...
''' Created on Jan 1, 2014 @author: Rob ''' import unittest class AtomTest(unittest.TestCase): def test_copy_consistency(self): from byond.basetypes import Atom, BYONDString, BYONDValue atom = Atom('/datum/test',__file__,0) atom.properties={ 'dir': BYONDValue(2), 'n...
mit
Python
e10a2143914e260c50722df94c0955327f89e5fa
fix typing lib compatibilty with py3.7
machow/siuba
siuba/utils.py
siuba/utils.py
# TODO: move siu.py into its own folder, add this to it (w/ Call Trees) from typing import Any, Union, TypeVar import inspect def is_union(x): return getattr(x, '__origin__', None) is Union def get_union_args(x): return getattr(x, '__args__', getattr(x, '__union_args__', None)) def is_flex_subclass(x, cls): ...
# TODO: move siu.py into its own folder, add this to it (w/ Call Trees) from typing import _Any, _Union, TypeVar import inspect def is_flex_subclass(x, cls): if isinstance(x, _Any): return True return issubclass(x, cls) def is_dispatch_func_subtype(f, input_cls, output_cls): """Returns whethe...
mit
Python
75de7e79fc59a56f2c86ce58232ce5a21922bfc4
Improve slack tickets command
WebCampZg/conference-web,WebCampZg/conference-web,WebCampZg/conference-web
slack/views.py
slack/views.py
import re from django.http import JsonResponse from django.conf import settings from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.db.models import Count from django.utils.decorators import method_decorator from django.views.decorators.csrf import csrf_exempt from django.views.generi...
import re from django.http import HttpResponse from django.conf import settings from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.db.models import Count from django.utils.decorators import method_decorator from django.views.decorators.csrf import csrf_exempt from django.views.generi...
bsd-3-clause
Python
20b89a97176a5fc2d2c2c01e4f725f3a1d1e928b
Increment version [ci skip]
honnibal/spaCy,honnibal/spaCy,explosion/spaCy,spacy-io/spaCy,explosion/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,spacy-io/spaCy,spacy-io/spaCy,honnibal/spaCy,spacy-io/spaCy,spacy-io/spaCy,honnibal/spaCy,explosion/spaCy,explosion/spaCy
spacy/about.py
spacy/about.py
# fmt: off __title__ = "spacy-nightly" __version__ = "3.0.0a25" __release__ = True __download_url__ = "https://github.com/explosion/spacy-models/releases/download" __compatibility__ = "https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json" __projects__ = "https://github.com/explosion/projec...
# fmt: off __title__ = "spacy-nightly" __version__ = "3.0.0a24" __release__ = True __download_url__ = "https://github.com/explosion/spacy-models/releases/download" __compatibility__ = "https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json" __projects__ = "https://github.com/explosion/projec...
mit
Python
feaebb0b665f625efef700f2e8cd3d3e6aa3eae4
Update default_config docstring on LOG_FILE
piotr-rusin/url-shortener,piotr-rusin/url-shortener
url_shortener/default_config.py
url_shortener/default_config.py
# -*- coding: utf-8 -*- ''' Default configuration for the application This data must be supplemented with custom configuration to which URL_SHORTENER_CONFIGURATION environment variable points, overriding some of the values specified here. :var SQLALCHEMY_DATABASE_URI: uri of database to be used by the application. T...
# -*- coding: utf-8 -*- ''' Default configuration for the application This data must be supplemented with custom configuration to which URL_SHORTENER_CONFIGURATION environment variable points, overriding some of the values specified here. :var SQLALCHEMY_DATABASE_URI: uri of database to be used by the application. T...
mit
Python
63b2b0a861bc5135227aae9f98823169fd419ddf
implement a conversion function from ISSN to EAN
holvi/python-stdnum,holvi/python-stdnum,arthurdejong/python-stdnum,dchoruzy/python-stdnum,tonyseek/python-stdnum,arthurdejong/python-stdnum,arthurdejong/python-stdnum,holvi/python-stdnum,t0mk/python-stdnum
stdnum/issn.py
stdnum/issn.py
# issn.py - functions for handling ISSNs # # Copyright (C) 2010 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, or (at your option) a...
# issn.py - functions for handling ISSNs # # Copyright (C) 2010 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, or (at your option) a...
lgpl-2.1
Python
e7a670657aab38c1bb292c9ff334829b6bca8f5d
Add lemmatization
WT-Swish/swish
swish/parse.py
swish/parse.py
import rethinkdb as r from nltk.stem import WordNetLemmatizer from adapt.engine import IntentDeterminationEngine from adapt.intent import IntentBuilder wnl = WordNetLemmatizer() def register_intent(name, engine, *keywords, **kwargs): for keyword in keywords: engine.register_entity(keyword, name.title()...
import rethinkdb as r from adapt.engine import IntentDeterminationEngine from adapt.intent import IntentBuilder def register_intent(name, engine, *keywords, **kwargs): for keyword in keywords: engine.register_entity(keyword, name.title() + "Keyword") for index, values in kwargs.items(): for...
mit
Python
8f9136467549df1beffb6d83b2b12f4e7eae1f3f
Add DataModel.flags()
mattdeckard/wherewithal
budget.py
budget.py
#!/usr/bin/env python import sys from PySide import QtGui, QtCore class DataModel(QtCore.QAbstractItemModel) : def __init__(self, parent=None) : super(DataModel, self).__init__(parent) def columnCount(self, parent) : return 2 def rowCount(self, parent) : if parent.isValid() : ret...
#!/usr/bin/env python import sys from PySide import QtGui, QtCore class DataModel(QtCore.QAbstractItemModel) : def __init__(self, parent=None) : super(DataModel, self).__init__(parent) def columnCount(self, parent) : return 2 def rowCount(self, parent) : if parent.isValid() : ret...
apache-2.0
Python
0b542c1a3c680058d27516b108c59e363274e8e1
Use Enums to encode Question fields
mthipparthi/parliament-search
parliamentsearch/items.py
parliamentsearch/items.py
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html from enum import Enum import scrapy class MemberofParliament(scrapy.Item): """ Data structure to define Member of Parliament information """ mp_id = scrapy.Field...
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html import scrapy class MemberofParliament(scrapy.Item): """ Data structure to define Member of Parliament information """ mp_id = scrapy.Field() mp_name = scrapy.F...
mit
Python
5a094701ffc7d628cd6bc87da7818513587b7a8b
Update package version number.
mattiaslinnap/django-partial-index
partial_index/__init__.py
partial_index/__init__.py
# Provide a nicer error message than failing to import models.Index. VERSION = (0, 6, 0) __version__ = '.'.join(str(v) for v in VERSION) __all__ = ['PartialIndex', 'PQ', 'PF', 'ValidatePartialUniqueMixin', 'PartialUniqueValidationError'] MIN_DJANGO_VERSION = (1, 11) DJANGO_VERSION_ERROR = 'Django version %s or lat...
# Provide a nicer error message than failing to import models.Index. VERSION = (0, 5, 2) __version__ = '.'.join(str(v) for v in VERSION) __all__ = ['PartialIndex', 'PQ', 'PF', 'ValidatePartialUniqueMixin', 'PartialUniqueValidationError'] MIN_DJANGO_VERSION = (1, 11) DJANGO_VERSION_ERROR = 'Django version %s or lat...
bsd-3-clause
Python
9d8133d1c88e8a066eb84eba7bca025a7ef53a20
Add audition flash
teknologkoren/teknologkoren-se,teknologkoren/teknologkoren-se,teknologkoren/teknologkoren-se,teknologkoren/teknologkoren-se
teknologkoren_se/views/blog.py
teknologkoren_se/views/blog.py
from flask import abort, Blueprint, flash, redirect, render_template, url_for from flask_babel import gettext, get_locale from teknologkoren_se import app, images from teknologkoren_se.models import Post, Event from teknologkoren_se.util import url_for_other_page, bp_url_processors mod = Blueprint('blog', __name__, u...
from flask import abort, Blueprint, flash, redirect, render_template, url_for from flask_babel import gettext from teknologkoren_se import app, images from teknologkoren_se.models import Post, Event from teknologkoren_se.util import url_for_other_page, bp_url_processors mod = Blueprint('blog', __name__, url_prefix='/...
mpl-2.0
Python
d87f2ba4e4979e2c8def4922d927243503a80e7b
change directory input to use of native.glob
donnadionne/grpc,ctiller/grpc,deepaklukose/grpc,PeterFaiman/ruby-grpc-minimal,sreecha/grpc,thinkerou/grpc,pszemus/grpc,mehrdada/grpc,PeterFaiman/ruby-grpc-minimal,carl-mastrangelo/grpc,deepaklukose/grpc,jtattermusch/grpc,fuchsia-mirror/third_party-grpc,vjpai/grpc,ncteisen/grpc,Vizerai/grpc,deepaklukose/grpc,nicolasnobl...
test/core/util/grpc_fuzzer.bzl
test/core/util/grpc_fuzzer.bzl
# Copyright 2016 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
# Copyright 2016 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
apache-2.0
Python
e1c3edcf2cbee45ba6d9a9a5692a99734580d5e7
allow spawning only a subset of the team
osrf/uctf,osrf/uctf,osrf/uctf
src/uctf/spawn.py
src/uctf/spawn.py
import argparse from uctf import generate_init_script from uctf import get_ground_control_port from uctf import get_launch_snippet from uctf import get_vehicle_pose from uctf import spawn_model from uctf import VEHICLE_BASE_PORT from uctf import write_launch_file def vehicle_id_type(value): value = int(value) ...
from uctf import generate_init_script from uctf import get_ground_control_port from uctf import get_launch_snippet from uctf import get_vehicle_pose from uctf import spawn_model from uctf import VEHICLE_BASE_PORT from uctf import write_launch_file def spawn_team(color): # ensure valid team color assert color ...
apache-2.0
Python
595ae6e9d6a6115cae7983f13bd0909a4fe1b527
Add initial solution
CubicComet/exercism-python-solutions
bracket-push/bracket_push.py
bracket-push/bracket_push.py
BRACKETS = ["()", "[]", "{}"] def check_brackets(s): brackets = "".join(filter(is_bracket, s)) length = 0 while brackets and length != len(brackets): length = len(brackets) for pair in BRACKETS: brackets = brackets.replace(pair, "") return len(brackets) == 0 def is_bracke...
def check_brackets(string): pass
agpl-3.0
Python
7f7010e3f6e49d59dea0b8620b0be99acc075c1a
Document members of named_tuples.
SymbiFlow/fasm,SymbiFlow/fasm
fasm/model.py
fasm/model.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2017-2020 The SymbiFlow Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC from collections import namedtuple impor...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2017-2020 The SymbiFlow Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC from collections import namedtuple impor...
isc
Python
930b48242d7c779522da232ab2bbdaecf2f85226
bump version to v3.7.0
geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx-frontend
osmaxx/__init__.py
osmaxx/__init__.py
__version__ = 'v3.7.0' __all__ = [ '__version__', ]
__version__ = 'v3.6.0' __all__ = [ '__version__', ]
mit
Python
ff265cc8d00680cb9e99b2c404491da75ac11ba3
Add MFileOAuthToken to Admin
mmcardle/MServe,mmcardle/MServe,mmcardle/MServe,mmcardle/MServe
mserve/dataservice/admin.py
mserve/dataservice/admin.py
from dataservice.models import * from django.contrib import admin admin.site.register(HostingContainer) admin.site.register(DataService) admin.site.register(MFile) admin.site.register(MFolder) admin.site.register(Usage) admin.site.register(Auth) admin.site.register(Role) admin.site.register(BackupFile) admin.site.regi...
from dataservice.models import * from django.contrib import admin admin.site.register(HostingContainer) admin.site.register(DataService) admin.site.register(MFile) admin.site.register(MFolder) admin.site.register(Usage) admin.site.register(Auth) admin.site.register(Role) admin.site.register(BackupFile) admin.site.regi...
lgpl-2.1
Python
cf02a96bdf18b1f2a6515239ad252338aadabdb2
remove debug stmt
leeopop/2015-CS570-Project
loader.py
loader.py
import csv import os #return: dict, key = uniq id #val: dict, key = column name, val = val #example: dict: {2066053: {'affiliation': 'KAIST', 'name': 'myname'}} def load_single_file(input_file): with open(input_file, 'r', encoding='utf-8') as read_file: reader = csv.reader(read_file) column = reader.__next__() ...
import csv import os #return: dict, key = uniq id #val: dict, key = column name, val = val #example: dict: {2066053: {'affiliation': 'KAIST', 'name': 'myname'}} def load_single_file(input_file): with open(input_file, 'r', encoding='utf-8') as read_file: reader = csv.reader(read_file) column = reader.__next__() ...
mit
Python
f098a0dde4b08f4ce9a8088fc76cadba36b548fd
make mem_reducer.py ready for python 3
hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR
waflib/extras/mem_reducer.py
waflib/extras/mem_reducer.py
#! /usr/bin/env python # encoding: UTF-8 """ This tool can help to reduce the memory usage in very large builds featuring many tasks with after/before attributes. It may also improve the overall build time by decreasing the amount of iterations over tasks. Usage: def options(opt): opt.load('mem_reducer') """ import...
#! /usr/bin/env python # encoding: UTF-8 """ This tool can help to reduce the memory usage in very large builds featuring many tasks with after/before attributes. It may also improve the overall build time by decreasing the amount of iterations over tasks. Usage: def options(opt): opt.load('mem_reducer') """ import...
agpl-3.0
Python
41be48d61ea7b82feb6049aa303b23e2de2b1e7c
Remove unused import
BakeCode/performance-testing,BakeCode/performance-testing
performance/result.py
performance/result.py
import json class Result: def __init__(self): self.results = {} def add_result(self, client, url, result): if client not in self.results: self.results[client] = {} if url not in self.results[client]: self.results[client][url] = [] self.results[client][u...
import Queue import json class Result: def __init__(self): self.results = {} def add_result(self, client, url, result): if client not in self.results: self.results[client] = {} if url not in self.results[client]: self.results[client][url] = [] self.resu...
mit
Python
aac5b4e900aaf10eb8544a158cafce9ebfa77ca3
Tweak test_md5 to be compatible with python 3
sqlobject/sqlobject,sqlobject/sqlobject,drnlm/sqlobject,drnlm/sqlobject
sqlobject/tests/test_md5.py
sqlobject/tests/test_md5.py
from hashlib import md5 ######################################## # hashlib.md5 ######################################## def test_md5(): assert md5(b'').hexdigest() == 'd41d8cd98f00b204e9800998ecf8427e' assert md5(b'\n').hexdigest() == '68b329da9893e34099c7d8ad5cb9c940' assert md5(b'123').hexdigest() == ...
from hashlib import md5 ######################################## # hashlib.md5 ######################################## def test_md5(): assert md5('').hexdigest() == 'd41d8cd98f00b204e9800998ecf8427e' assert md5('\n').hexdigest() == '68b329da9893e34099c7d8ad5cb9c940' assert md5('123').hexdigest() == '20...
lgpl-2.1
Python
ed0769396e9c3478550963fbe624c8f39fbc5c29
Update zero_one_normalization.py
greenelab/adage,greenelab/adage,greenelab/adage
Data_collection_processing/zero_one_normalization.py
Data_collection_processing/zero_one_normalization.py
''' Linearly scale the expression range of one gene to be between 0 and 1. If a reference dataset is provided, then the scaling of one gene in the target dataset in done using the minimun and range of that gene in the reference dataset. ''' import sys import argparse sys.path.insert(0,'Data_collection_processing/') f...
''' Linearly scale the expression range of one gene to be between 0 and 1. If a reference dataset is provided, then the scaling of one gene in the target dataset in done using the minimun and range of that gene in the reference dataset. ''' import sys import argparse sys.path.insert(0,'Data_collection_processing/') f...
bsd-3-clause
Python
170f5444028e7e5d44548142cfd2bd24f77c8608
Bump up version;
Wiredcraft/pipelines,Wiredcraft/pipelines,Wiredcraft/pipelines,Wiredcraft/pipelines
pipelines/__init__.py
pipelines/__init__.py
__version__ = '0.0.3' __author__ = 'Wirecraft'
__version__ = '0.0.2' __author__ = 'Wirecraft'
mit
Python
9006543b47a087ab000a0d3fe22d4b803b26d329
fix https://github.com/zxwing/premium/issues/119
zstackorg/zstack-utility,zstackorg/zstack-utility,mrwangxc/zstack-utility,mrwangxc/zstack-utility,zstackio/zstack-utility,zstackio/zstack-utility,mrwangxc/zstack-utility,live4thee/zstack-utility,live4thee/zstack-utility,mingjian2049/zstack-utility,mingjian2049/zstack-utility,zstackorg/zstack-utility,mingjian2049/zstack...
kvmagent/kvmagent/kdaemon.py
kvmagent/kvmagent/kdaemon.py
''' @author: frank ''' import sys, os, os.path from zstacklib.utils import log from zstacklib.utils import linux import zstacklib.utils.iptables as iptables pidfile = '/var/run/zstack/kvmagent.pid' log.configure_log('/var/log/zstack/zstack-kvmagent.log') logger = log.get_logger(__name__) import kvmagent...
''' @author: frank ''' import sys, os, os.path from zstacklib.utils import log from zstacklib.utils import linux import zstacklib.utils.iptables as iptables pidfile = '/var/run/zstack/kvmagent.pid' log.configure_log('/var/log/zstack/zstack-kvmagent.log') logger = log.get_logger(__name__) import kvmagent...
apache-2.0
Python
d89ef28a24e86b9ec8fb3deb8303e3c0954c67ad
allow to work on python2.7 and python3
barry-scott/scm-workbench,barry-scott/scm-workbench,barry-scott/git-workbench,barry-scott/git-workbench,barry-scott/scm-workbench
Source/Git/wb_git_askpass_client_unix.py
Source/Git/wb_git_askpass_client_unix.py
''' ==================================================================== Copyright (c) 2016 Barry A Scott. All rights reserved. This software is licensed as described in the file LICENSE.txt, which you should have received as part of this distribution. ===========================================================...
''' ==================================================================== Copyright (c) 2016 Barry A Scott. All rights reserved. This software is licensed as described in the file LICENSE.txt, which you should have received as part of this distribution. ===========================================================...
apache-2.0
Python
bc7467c1a817489798935eb49e733eed7cfe2b33
Remove unused line from test
pulsar-chem/Pulsar-Core,pulsar-chem/Pulsar-Core,pulsar-chem/Pulsar-Core,pulsar-chem/Pulsar-Core
test/tensor.py
test/tensor.py
#!/usr/bin/env python3 import os import sys import argparse import traceback sys.path.insert(0, "/home/ben/programming/BPModule/install/modules") sys.path.insert(0, "/home/ben/programming/ambit/install/lib") import bpmodule as bp def Run(): try: # Load the python modules # supermodule...
#!/usr/bin/env python3 import os import sys import argparse import traceback sys.path.insert(0, "/home/ben/programming/BPModule/install/modules") sys.path.insert(0, "/home/ben/programming/ambit/install/lib") import bpmodule as bp def Run(): try: # Load the python modules # supermodule...
bsd-3-clause
Python
5be746d3a27ba463b1028feabf705e048c79f518
add NullHandler for pika logging
genome/flow-core,genome/flow-core,genome/flow-core
lib/amqp_service/__init__.py
lib/amqp_service/__init__.py
import logging import logging.handlers try: nh = logging.handlers.NullHandler() except AttributeError: class NullHandler(logging.Handler): def emit(self, record): pass nh = NullHandler() logging.getLogger('amqp_service').addHandler(nh) # NOTE pika does not do this itself for some rea...
import logging import logging.handlers try: nh = logging.handlers.NullHandler() except AttributeError: class NullHandler(logging.Handler): def emit(self, record): pass nh = NullHandler() logging.getLogger('amqp_service').addHandler(nh) from connection_manager import ConnectionManage...
agpl-3.0
Python
0ebd81bd156662d8f027d0810b122d05913b59f7
Add hdf5 1.10.x support for versions above 3.4.0 (#10746)
LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack
var/spack/repos/builtin/packages/py-pytables/package.py
var/spack/repos/builtin/packages/py-pytables/package.py
# Copyright 2013-2019 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 PyPytables(PythonPackage): """PyTables is a package for managing hierarchical datasets and...
# Copyright 2013-2019 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 PyPytables(PythonPackage): """PyTables is a package for managing hierarchical datasets and...
lgpl-2.1
Python
41ae04539774bf2e6bad3203b7f063fd73f0141a
Fix network conflict creator.
Vladimir-Ivanov-Git/raw-packet,Vladimir-Ivanov-Git/raw-packet
network_conflict_creator.py
network_conflict_creator.py
#!/usr/bin/env python from base import Base from argparse import ArgumentParser from sys import exit from scapy.all import sniff, Ether, ARP, sendp from logging import getLogger, ERROR getLogger("scapy.runtime").setLevel(ERROR) Base.check_user() parser = ArgumentParser(description='DHCP Starvation attack script') pa...
#!/usr/bin/env python from base import Base from argparse import ArgumentParser from sys import exit from scapy.all import sniff, Ether, ARP, sendp from logging import getLogger, ERROR getLogger("scapy.runtime").setLevel(ERROR) Base.check_user() parser = ArgumentParser(description='DHCP Starvation attack script') pa...
mit
Python
385a5b213eb65df99daa106034e1df375c2aaca1
Bump version to 5.1.0
alerta/alerta-contrib,alerta/alerta-contrib,alerta/alerta-contrib
plugins/telegram/setup.py
plugins/telegram/setup.py
from setuptools import setup, find_packages version = '5.1.0' setup( name="alerta-telegram", version=version, description='Alerta plugin for Telegram', url='https://github.com/alerta/alerta-contrib', license='MIT', author='Nick Satterly', author_email='nick.satterly@theguardian.com', ...
from setuptools import setup, find_packages version = '5.0.4' setup( name="alerta-telegram", version=version, description='Alerta plugin for Telegram', url='https://github.com/alerta/alerta-contrib', license='MIT', author='Nick Satterly', author_email='nick.satterly@theguardian.com', ...
mit
Python
64aba25ab80e69a9d4e5216b309e60930478f768
add logging option
erstrom/opencv-home-cam,erstrom/opencv-home-cam
opencv_home_cam/__main__.py
opencv_home_cam/__main__.py
import argparse import traceback import sys import os import cv2 import signal import logging import logging.config from opencv_home_cam import HomeCamManager, HomeCamException description = "OpenCV home cam test app" def signal_handler(signal, frame): global hcm sys.stderr.write('Signal received!') hc...
import argparse import traceback import sys import os import cv2 import signal from opencv_home_cam import HomeCamManager, HomeCamException description = "OpenCV home cam test app" def signal_handler(signal, frame): global hcm sys.stderr.write('Signal received!') hcm.stop() def load_options(): g...
mit
Python
5a52f6fc8b410b481638e8fe71746d409688e67c
remove reference to SubjectDashboard
jcairo/391_project,jcairo/391_project
project_391/main/admin.py
project_391/main/admin.py
from django.contrib import admin from main.models import Persons, Users, Groups, GroupLists, Images, Views class PersonsAdmin(admin.ModelAdmin): pass class UsersAdmin(admin.ModelAdmin): pass class GroupsAdmin(admin.ModelAdmin): pass class GroupListsAdmin(admin.ModelAdmin): def formfield_for_foreignk...
from django.contrib import admin from main.models import Persons, Users, Groups, GroupLists, Images, Views class SubjectDashboardAdmin(admin.ModelAdmin): pass class PersonsAdmin(admin.ModelAdmin): pass class UsersAdmin(admin.ModelAdmin): pass class GroupsAdmin(admin.ModelAdmin): pass class GroupLis...
mit
Python
393b37f56b42961432af2347d9ffc9ff07cd85ab
add rest_framework to INSTALLED_APPS
cmu-db/cmdbac,cmu-db/db-webcrawler,cmu-db/cmdbac,cmu-db/db-webcrawler,cmu-db/db-webcrawler,cmu-db/db-webcrawler,cmu-db/db-webcrawler,cmu-db/cmdbac,cmu-db/cmdbac,cmu-db/cmdbac
db_webcrawler/settings_example.py
db_webcrawler/settings_example.py
from __future__ import absolute_import """ Django settings for db_webcrawler project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the proj...
from __future__ import absolute_import """ Django settings for db_webcrawler project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the proj...
apache-2.0
Python
21484df95c7b23802ee346a567aba1782410d8e3
Refactor createnetwork manage.py command to use new store backend.
Ghost-script/ircb,waartaa/ircb
manage.py
manage.py
import asyncio from flask.ext.script import Command, Manager, Option from ircb.web.app import app from ircb.models import get_session, User from ircb.storeclient import NetworkStore import ircb.stores manager = Manager(app) session = get_session() class CreateUserCommand(Command): option_list = ( Option...
from flask.ext.script import Command, Manager, Option from ircb.web.app import app from ircb.models import create_tables, get_session, User, Network manager = Manager(app) session = get_session() class CreateUserCommand(Command): option_list = ( Option('--username', '-u', dest='username'), Optio...
mit
Python
0b5c338bdba8a2e496e61427496409b52ea4d4ac
send slack-consumable response
lwbrooke/slackbot
src/message_router.py
src/message_router.py
import falcon import json class SlackMessageRouter: def on_post(self, req, resp): resp.body = json.dumps({'text': 'hello, world!'}) resp.status = falcon.HTTP_200
import falcon import json class SlackMessageRouter: def on_post(self, req, resp): resp.body = json.dumps({'message': 'hello, world!'}) resp.status = falcon.HTTP_200
apache-2.0
Python
2910646c5f67cea9796ea07acbeade3716095462
update version
jasonrbriggs/stomp.py,jasonrbriggs/stomp.py
stomp/__init__.py
stomp/__init__.py
"""Stomp Protocol Connectivity This provides basic connectivity to a message broker supporting the 'stomp' protocol. At the moment ACK, SEND, SUBSCRIBE, UNSUBSCRIBE, BEGIN, ABORT, COMMIT, CONNECT and DISCONNECT operations are supported. This changes the previous version which required a listener...
"""Stomp Protocol Connectivity This provides basic connectivity to a message broker supporting the 'stomp' protocol. At the moment ACK, SEND, SUBSCRIBE, UNSUBSCRIBE, BEGIN, ABORT, COMMIT, CONNECT and DISCONNECT operations are supported. This changes the previous version which required a listener...
apache-2.0
Python
372e7a948dc05b3093822efdcc299decaec73380
Fix project validation
elifesciences/builder,elifesciences/builder
src/integration_tests/test_validation.py
src/integration_tests/test_validation.py
from time import sleep from tests import base from buildercore import cfngen, project import logging LOG = logging.getLogger(__name__) # not integration tests per se, but very lengthy and depend on # talking to AWS. class TestBuildercoreCfngen(base.BaseCase): def test_validation(self): "dummy projects an...
from time import sleep from tests import base from buildercore import cfngen, project import logging LOG = logging.getLogger(__name__) # not integration tests per se, but very lengthy and depend on # talking to AWS. class TestBuildercoreCfngen(base.BaseCase): def test_validation(self): "dummy projects an...
mit
Python
f91a6126868b1722af41dade4e369f4d215ff533
support ipv4
tjcsl/director,tjcsl/director,tjcsl/director,tjcsl/director
agent/views/updatedns.py
agent/views/updatedns.py
from agent import rpc from ipaddress import ip_address import dns.query import dns.tsigkeyring import dns.update keyring = dns.tsigkeyring.from_text({ 'vm.sites.tjhsst.edu.': open("/root/dns.key", "r").read().strip() }) @rpc.method("dns.add") def add_dns(host, ip): update = dns.update.Update('vm.sites.tjhss...
from agent import rpc import dns.query import dns.tsigkeyring import dns.update import sys keyring = dns.tsigkeyring.from_text({ 'vm.sites.tjhsst.edu.': open("/root/dns.key", "r").read().strip() }) @rpc.method("dns.add") def add_dns(host, ip): update = dns.update.Update('vm.sites.tjhsst.edu', keyring=keyring...
mit
Python
657db54d8982ecfe75d260904a226d922200c2ce
add kernel density estimator
Enucatl/machine-learning-aging-brains,Enucatl/machine-learning-aging-brains,Enucatl/machine-learning-aging-brains
agingbrains/voxel_fit.py
agingbrains/voxel_fit.py
import numpy as np import sklearn.gaussian_process as skg import sklearn.neighbors as skn def emit_voxels((file_name, dictionary)): data = dictionary["data"][0] age = dictionary["age"][0] for x in range(data.shape[0]): for y in range(data.shape[1]): for z in range(data.shape[2]): ...
import numpy as np import sklearn.gaussian_process as skg def emit_voxels((file_name, dictionary)): data = dictionary["data"][0] age = dictionary["age"][0] for x in range(data.shape[0]): for y in range(data.shape[1]): for z in range(data.shape[2]): yield ((x, y, z), (ag...
mit
Python
4ff7c6927477c37e2a2ba89b87de0395a40d1f1b
Add missing util.raise_from_cause
sqlalchemy/alembic,zzzeek/alembic
alembic/util/__init__.py
alembic/util/__init__.py
from .compat import raise_from_cause # noqa from .exc import CommandError from .langhelpers import _with_legacy_names # noqa from .langhelpers import asbool # noqa from .langhelpers import dedupe_tuple # noqa from .langhelpers import Dispatcher # noqa from .langhelpers import immutabledict # noqa from .langhelper...
from .exc import CommandError from .langhelpers import _with_legacy_names # noqa from .langhelpers import asbool # noqa from .langhelpers import dedupe_tuple # noqa from .langhelpers import Dispatcher # noqa from .langhelpers import immutabledict # noqa from .langhelpers import memoized_property # noqa from .lang...
mit
Python
480c89d81e1610d698269c41f4543c38193bef13
Expand test to include query on the created database as restricted user
ODoSE/odose.nl
test/test_orthomcl_database.py
test/test_orthomcl_database.py
import MySQLdb import shutil import tempfile import unittest import orthomcl_database class Test(unittest.TestCase): def setUp(self): self.run_dir = tempfile.mkdtemp() self.credentials = orthomcl_database._get_root_credentials() def tearDown(self): shutil.rmtree(self.run_dir) d...
import shutil import tempfile import unittest import orthomcl_database class Test(unittest.TestCase): def setUp(self): self.run_dir = tempfile.mkdtemp() def tearDown(self): shutil.rmtree(self.run_dir) def test_get_configuration_file(self): conffile = orthomcl_database.get_confi...
mit
Python
6e6cb17b9c88664a6683d600b797df0aea34d4af
Fix spacing to adhere to PEP8.
revsys/django-test-plus,grahamu/django-test-plus,revsys/django-test-plus,grahamu/django-test-plus
test_project/test_app/views.py
test_project/test_app/views.py
from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.shortcuts import render, redirect from django.views import generic from .models import Data # Function-based test views def view_200(request): return HttpResponse('', status=200) def view_201(request): ...
from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.shortcuts import render, redirect from django.views import generic from .models import Data # Function-based test views def view_200(request): return HttpResponse('', status=200) def view_201(request): ...
bsd-3-clause
Python
2aa3a72fe7ec2f2e1a860076dc4f42f76a199fb4
Allow multi-version benchmarking
indx/indx-core,indx/indx-core,indx/indx-core,indx/indx-core,indx/indx-core
tests/objectstore/benchmark.py
tests/objectstore/benchmark.py
import psycopg2, time, sys from objectstore import ObjectStore # database variables root_user = "postgres" root_pass = "foobar" db_name = "webbox_benchmark" # dropped at first db_user = "webbox" db_pass = "foobar" obj_count = 100 # how many objects to create prop_count = 100 # how many properties per object # doubl...
import psycopg2, time, sys from objectstore import ObjectStore # database variables root_user = "postgres" root_pass = "foobar" db_name = "webbox_benchmark" # dropped at first db_user = "webbox" db_pass = "foobar" obj_count = 100 # how many objects to create prop_count = 100 # how many properties per object # doubl...
agpl-3.0
Python
082ac65c32c323c36036e0ddac140a87942e9b00
Make windows bigger in this test so the captions can be read.
infowantstobeseen/pyglet-darwincore,infowantstobeseen/pyglet-darwincore,infowantstobeseen/pyglet-darwincore,infowantstobeseen/pyglet-darwincore,infowantstobeseen/pyglet-darwincore
tests/window/WINDOW_CAPTION.py
tests/window/WINDOW_CAPTION.py
#!/usr/bin/env python '''Test that the window caption can be set. Expected behaviour: Two windows will be opened, one with the caption "Window caption 1" counting up every second; the other with a Unicode string including some non-ASCII characters. Press escape or close either window to finished the ...
#!/usr/bin/env python '''Test that the window caption can be set. Expected behaviour: Two windows will be opened, one with the caption "Window caption 1" counting up every second; the other with a Unicode string including some non-ASCII characters. Press escape or close either window to finished the ...
bsd-3-clause
Python
56c1119443466a9706e134bec230bbdb7b20ac95
rewrite youtube plugin again to use jsonc interface and report more information
callumhogsden/ausbot,Jeebeevee/DouweBot,parkrrr/skybot,TeamPeggle/ppp-helpdesk,SophosBlitz/glacon,Teino1978-Corp/Teino1978-Corp-skybot,craisins/wh2kbot,isislab/botbot,rmmh/skybot,cmarguel/skybot,elitan/mybot,df-5/skybot,jmgao/skybot,crisisking/skybot,Jeebeevee/DouweBot_JJ15,olslash/skybot,ddwo/nhl-bot,craisins/nascarbo...
plugins/youtube.py
plugins/youtube.py
import json import locale import re import time import urllib2 from util import hook locale.setlocale(locale.LC_ALL, '') youtube_re = re.compile(r'youtube.*?v=([-_a-z0-9]+)', flags=re.I) url = 'http://gdata.youtube.com/feeds/api/videos/%s?v=2&alt=jsonc' #@hook.command(hook=r'(.*)', prefix=False) def youtube(inp): ...
import json import locale import re import urllib2 from util import hook locale.setlocale(locale.LC_ALL, '') youtube_re = re.compile(r'.*youtube.*v=([-_a-z0-9]+)', flags=re.I) url = 'http://gdata.youtube.com/feeds/api/videos/%s?alt=json' #@hook.command(hook=r'(.*)', prefix=False) def youtube(inp): m = youtube_r...
unlicense
Python
50542f79526436ce053d9a0f78183d1ff67556f5
Add support for shortened youtube URLs
thomasleese/smartbot-old,tomleese/smartbot,Cyanogenoid/smartbot,Muzer/smartbot
plugins/youtube.py
plugins/youtube.py
import re import requests import urllib from smartbot import utils from smartbot.formatting import * class Plugin: def __init__(self, key): self.key = key def on_message(self, bot, msg, reply): match = re.findall(r"(?:https?://)?(?:www\.)?youtu\.?be(?:\.com)?/(?:watch\?v=)?([^\s]+)", msg["me...
import re import requests import urllib from smartbot import utils from smartbot.formatting import * class Plugin: def __init__(self, key): self.key = key def on_message(self, bot, msg, reply): match = re.findall(r"https?://(?:www\.)?youtube\.com/watch\?v=([^\s]+)", msg["message"], re.IGNORE...
mit
Python
b33e587359d5a6d71b0d49533b8c0e1682cc8231
Update model_warmup.py
GoogleCloudPlatform/ai-platform-samples,GoogleCloudPlatform/ai-platform-samples
prediction/tools/model_warmup/model_warmup.py
prediction/tools/model_warmup/model_warmup.py
# # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
"""Generate Warmup requests.""" import tensorflow as tf import requests from tensorflow.python.framework import tensor_util from tensorflow_serving.apis import predict_pb2 from tensorflow_serving.apis import prediction_log_pb2 IMAGE_URL = 'https://tensorflow.org/images/blogs/serving/cat.jpg' NUM_RECORDS = 100 def...
apache-2.0
Python
7e6be2759c50bcf4f6cbb40d47358e54e877c53b
Add static routes to VLANs.
trungdtbk/faucet,wackerly/faucet,trentindav/faucet,asmltd/faucet,asmltd/faucet,gwacter/faucet,mwutzke/faucet,faucetsdn/faucet,asmltd/faucet,Bairdo/faucet,isomer/faucet,REANNZ/faucet,Bairdo/faucet,mwutzke/faucet,faucetsdn/faucet,isomer/faucet,asmltd/faucet,anarkiwi/faucet,trentindav/faucet,anarkiwi/faucet,REANNZ/faucet,...
src/ryu_faucet/org/onfsdn/faucet/vlan.py
src/ryu_faucet/org/onfsdn/faucet/vlan.py
# Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer. # Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd. # # 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 Licens...
# Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer. # Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd. # # 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 Licens...
apache-2.0
Python
7b063193c311bb825006dbfeaff73364885c61f1
add basic logging
garbas/mozilla-releng-services,La0/mozilla-relengapi,mozilla-releng/services,La0/mozilla-relengapi,La0/mozilla-relengapi,srfraser/services,lundjordan/services,srfraser/services,La0/mozilla-relengapi,andrei987/services,mozilla-releng/services,lundjordan/services,andrei987/services,mozilla-releng/services,mozilla-releng/...
src/shipit_signoff/shipit_signoff/api.py
src/shipit_signoff/shipit_signoff/api.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 http://mozilla.org/MPL/2.0/. from __future__ import absolute_import import logging log = logging.getLogger(__name__) STEPS = {} SIGNOFFS = {} de...
# 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 http://mozilla.org/MPL/2.0/. from __future__ import absolute_import STEPS = {} SIGNOFFS = {} def list_steps(): return list(STEPS.keys()) def...
mpl-2.0
Python
466c1f3e010c35ecdf1ec6dba181c42cfb94e899
Use `send_cors`
matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse
synapse/rest/media/v1/config_resource.py
synapse/rest/media/v1/config_resource.py
# -*- coding: utf-8 -*- # Copyright 2018 Will Hunt <will@half-shot.uk> # # 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 b...
# -*- coding: utf-8 -*- # Copyright 2018 Will Hunt <will@half-shot.uk> # # 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 b...
apache-2.0
Python
108fbaf10088f33fc3188798ef34a7d31f979f03
add mail service to send notification mails
szabgab/codeandtalk.com,szabgab/codeandtalk.com,rollandf/codeandtalk.com,rollandf/codeandtalk.com,rollandf/codeandtalk.com,szabgab/codeandtalk.com,rollandf/codeandtalk.com,szabgab/codeandtalk.com
notify.py
notify.py
import json import os import sys import smtplib from jinja2 import Environment, PackageLoader from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart env = Environment(loader=PackageLoader('cat')) template = env.get_template('email.html') # add in e-mail from https://docs.python.org/3.4/...
import json import os import sys from jinja2 import Environment, PackageLoader env = Environment(loader=PackageLoader('cat')) template = env.get_template('email.html') # add in e-mail from https://docs.python.org/3.4/library/email-examples.html root = os.path.dirname((os.path.realpath(__file__))) sys.path.insert(0, r...
apache-2.0
Python
b142e58cf1c2c4b50d266818e48296b2ab298920
enhance timestamp calculations
Storagesavvy/vipr-spelunker
timestamper.py
timestamper.py
import datetime """timestamp tracking function for splunk REST API ViPR Logging App""" def logstartstop(): #import datetime module import datetime from datetime import timedelta #get current time for log request stop time stoptime = datetime.datetime.now() #increment 1 second for sta...
import datetime """timestamp tracking function for splunk REST API ViPR Logging App""" def logstartstop(): #import datetime module import datetime from datetime import timedelta #get current time for log request stop time stoptime = datetime.datetime.now() #increment 1 second for start ti...
mpl-2.0
Python
4f4c3fabe1ccb91ca8f510a6ab81b6f2eb588c17
Fix the telemetry statistics test
briancurtin/python-openstacksdk,dtroyer/python-openstacksdk,dtroyer/python-openstacksdk,openstack/python-openstacksdk,openstack/python-openstacksdk,briancurtin/python-openstacksdk,stackforge/python-openstacksdk,stackforge/python-openstacksdk
openstack/tests/functional/telemetry/v2/test_statistics.py
openstack/tests/functional/telemetry/v2/test_statistics.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
Python
9037bb21df910453f9c7bf149be5e8a5c8d6e1e0
use content plain for description
maartenbreddels/vaex,maartenbreddels/vaex,maartenbreddels/vaex,maartenbreddels/vaex,maartenbreddels/vaex,maartenbreddels/vaex
packages/vaex-meta/setup.py
packages/vaex-meta/setup.py
import os import imp from setuptools import setup from setuptools import Extension dirname = os.path.dirname(__file__) path_version = os.path.join(dirname, 'vaex/meta/_version.py') version = imp.load_source('version', path_version) name = 'vaex' author = 'Maarten A. Breddels' author_email = 'maartenbreddels@gmail.co...
import os import imp from setuptools import setup from setuptools import Extension dirname = os.path.dirname(__file__) path_version = os.path.join(dirname, 'vaex/meta/_version.py') version = imp.load_source('version', path_version) name = 'vaex' author = 'Maarten A. Breddels' author_email = 'maartenbreddels@gmail.co...
mit
Python
60971f3fd1b50dba524a4b5ad7d5a3d96017ce40
Update models.py
Amechi101/concepteur-market-app,Amechi101/concepteur-market-app,Amechi101/concepteur-market-app,Amechi101/concepteur-market-app
profiles/models.py
profiles/models.py
from django.db import models from django.contrib.auth.models import User ======= import secretballot # from django.contrib.auth.models import User class ProfileUser(models.Model): user = models.OneToOneField(User,unique=True) birthday = models.DateField(null=True,blank=True) city = models.CharField(max_length=50...
from django.db import models <<<<<<< HEAD from django.contrib.auth.models import User ======= import secretballot # from django.contrib.auth.models import User >>>>>>> FETCH_HEAD class ProfileUser(models.Model): user = models.OneToOneField(User,unique=True) birthday = models.DateField(null=True,blank=True) city = ...
mit
Python
0dabb6f4b18ff73f16088b207894d5e647494afb
Update ColorHax to 2.3.0 address
wiiudev/pyGecko,wiiudev/pyGecko
colors.py
colors.py
from tcpgecko import TCPGecko from textwrap import wrap from struct import pack from binascii import unhexlify import sys tcp = TCPGecko("192.168.0.8") #Wii U IP address Colors = b"" for i in range(1, 4): #Ignores Alpha since it doesn't use it Color = wrap(sys.argv[i], 2) #Split it into 2 character chunks fo...
from tcpgecko import TCPGecko from textwrap import wrap from struct import pack from binascii import hexlify, unhexlify import sys def pokecolor(pos, string): color = textwrap.wrap(string, 4) tcp.pokemem(pos, struct.unpack(">I", color[0])[0]) tcp.pokemem(pos + 4, struct.unpack(">I", color[1])[0]) tcp...
mit
Python
6215c00a951074e96fa4289b5fce7dc36a25d6ff
Update localsettings_example_with_comments.py
ddsc/ddsc-worker
ddsc_worker/localsettings_example_with_comments.py
ddsc_worker/localsettings_example_with_comments.py
DATABASES = { 'default': { 'NAME': 'ddsc', 'ENGINE': 'django.contrib.gis.db.backends.postgis', 'USER': 'xxxx', 'PASSWORD': 'xxxxxxxx', 'HOST': 'xx.xx.xxx.xxx', 'PORT': '', } } CASSANDRA = { 'servers': [ 'xxx.xxx.xxx.xx:9160', 'xx.xxx.xxx.xx:91...
DATABASES = { 'default': { 'NAME': 'ddsc', 'ENGINE': 'django.contrib.gis.db.backends.postgis', 'USER': 'xxxx', 'PASSWORD': 'xxxxxxxx', 'HOST': 'xx.xx.xxx.xxx', 'PORT': '', } } CASSANDRA = { 'servers': [ 'xxx.xxx.xxx.xx:9160', 'xx.xxx.xxx.xx:91...
mit
Python
4e30963b2b282c3029916c4d2c3a67c505f47e52
Integrate LLVM at llvm/llvm-project@7ccacaf4428d
Intel-Corporation/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,karllessard/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_...
third_party/llvm/workspace.bzl
third_party/llvm/workspace.bzl
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "7ccacaf4428d1712029594184baa6f617a51c340" LLVM_SHA256 = "312ec01fc8aad123c06f1504ee719677ddd518c1a429bdda66f31e7193e262ec" tf_http_archive( ...
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "ba093fe58b152e12049663e87536ea15a6de638d" LLVM_SHA256 = "eeb55c2828011957fe4f3108bc3487a16607631a4f1aedff4e4c3d4b96d57d63" tf_http_archive( ...
apache-2.0
Python
fe319a958d84b9bf2a65ceb72592becd4c5e427e
Integrate LLVM at llvm/llvm-project@cd20a1828605
tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime
third_party/llvm/workspace.bzl
third_party/llvm/workspace.bzl
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tfrt_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "cd20a1828605887699579789b5433111d5bc0319" LLVM_SHA256 = "0a9e582ec4f4743668b16e24345845161170a3a2aaf362b9ccc8a2cf1b12c870" tfrt_http_archive( ...
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tfrt_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "2675c41671315da867c56276160e70905c59d11f" LLVM_SHA256 = "50e14228719ddc526a47ecffbf54334ac54a76ce08b383af5ea9431228ad5852" tfrt_http_archive( ...
apache-2.0
Python
8a3d95c51a8e84f4add89edeeb464c4e746146b3
Integrate LLVM at llvm/llvm-project@a72cd6353c45
tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime
third_party/llvm/workspace.bzl
third_party/llvm/workspace.bzl
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tfrt_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "a72cd6353c455b81df75d89959fafe886addfe5e" LLVM_SHA256 = "26f712c37096108f3c8430cff44114f8f5fd672fcc5935814e29e11ef4fe2639" tfrt_http_archive( ...
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tfrt_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "67d4d7cf68b643397655fd8276a7fa473d3ba12b" LLVM_SHA256 = "7362a14af7af4dd44db73f086b04b70e11762b20a8e8fae5f5153ec751d802df" tfrt_http_archive( ...
apache-2.0
Python
a427191473aed9adb91587fd8394d322820780ad
Integrate LLVM at llvm/llvm-project@2325f363010d
karllessard/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-Corporation/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,paolodedios/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_tf...
third_party/llvm/workspace.bzl
third_party/llvm/workspace.bzl
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "2325f363010d3176e96579628cbb96b8fca003a1" LLVM_SHA256 = "5e1a5cddffda7984898068110e02b6b2fe310a12fde6b04f6c000542852a96a6" tf_http_archive( ...
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "da77db58d7629a3bfea1a0053aa9c29764b0bc2b" LLVM_SHA256 = "e17a5d22d7cc300df537d8c28ac8750f7454a684723bf3ebcbd7960e1e0233f8" tf_http_archive( ...
apache-2.0
Python
d5eb41b9711e2a7017ff16ce835d31e482884fed
Integrate LLVM at llvm/llvm-project@42a90e6017b0
tensorflow/tensorflow-pywrap_tf_optimizer,paolodedios/tensorflow,tensorflow/tensorflow,Intel-tensorflow/tensorflow,karllessard/tensorflow,yongtang/tensorflow,Intel-tensorflow/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_saved_model,karllessard/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,paolo...
third_party/llvm/workspace.bzl
third_party/llvm/workspace.bzl
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "42a90e6017b04f218a398b46c331fb5a8336433d" LLVM_SHA256 = "fa1986c42aee428a9caa26a40398b33237657c36b5fdee07c0888d2440b3730a" tf_http_archive( ...
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "8491d01cc385d08b8b4f5dd097239ea0009ddc63" LLVM_SHA256 = "ff2b360d6e3abb9a8f4a49235cc5308633570f589defac5b83417fdc3f1e0b60" tf_http_archive( ...
apache-2.0
Python
889016952a248cf229c78c014d9f6c95422d98b8
use f-strings in PythonAWSLambda (#8115)
tdyas/pants,pantsbuild/pants,tdyas/pants,pantsbuild/pants,benjyw/pants,benjyw/pants,pantsbuild/pants,wisechengyi/pants,wisechengyi/pants,wisechengyi/pants,jsirois/pants,tdyas/pants,wisechengyi/pants,tdyas/pants,benjyw/pants,jsirois/pants,wisechengyi/pants,benjyw/pants,wisechengyi/pants,tdyas/pants,benjyw/pants,pantsbui...
contrib/awslambda/python/src/python/pants/contrib/awslambda/python/targets/python_awslambda.py
contrib/awslambda/python/src/python/pants/contrib/awslambda/python/targets/python_awslambda.py
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from pants.backend.python.targets.python_binary import PythonBinary from pants.base.exceptions import TargetDefinitionException from pants.base.payload import Payload from pants.base.paylo...
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from pants.backend.python.targets.python_binary import PythonBinary from pants.base.exceptions import TargetDefinitionException from pants.base.payload import Payload from pants.base.paylo...
apache-2.0
Python
567e70c745808a1d55d2bbb90176b9799b3301b5
Remove stray print statement.
geggo/pyface,brett-patterson/pyface,geggo/pyface
pyface/i_python_shell.py
pyface/i_python_shell.py
#------------------------------------------------------------------------------ # Copyright (c) 2005, Enthought, Inc. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in enthought/LICENSE.txt and may be redistributed only # under the conditions describe...
#------------------------------------------------------------------------------ # Copyright (c) 2005, Enthought, Inc. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in enthought/LICENSE.txt and may be redistributed only # under the conditions describe...
bsd-3-clause
Python
e22229fc963b8601c4b34982495b69e5905c2d96
Edit Increment class to use FileManager as a Singleton
rlinguri/pyfwk
pyfwk/utils/increment.py
pyfwk/utils/increment.py
#!/usr/bin/env python """ increment.py: some scripts require fetching of internet data or operations that could cause a drain on the system if they were to be executed sequentially. The Increment class provides methods for reading and writing ids to disc so that execution the scripts can be looped on increment...
#!/usr/bin/env python """ increment.py: some scripts require fetching of internet data or operations that could cause a drain on the system if they were to be executed sequentially. The Increment class provides methods for reading and writing ids to disc so that execution the scripts can be looped on increment...
mit
Python
7ad69f9331b432da3dcd0ae783244ffc7bdda580
Fix version num
randomchars/pushbullet.py,kovacsbalu/pushbullet.py,Saturn/pushbullet.py
pushbullet/__version__.py
pushbullet/__version__.py
__version__ = "0.11.0"
__version__ = "0.10.0"
mit
Python
9013e39caf8dd35051d3520d725bf067cccc34c0
Fix test for versions generator
ascott1/regulations-site,willbarton/regulations-site,willbarton/regulations-site,ascott1/regulations-site,ascott1/regulations-site,grapesmoker/regulations-site,willbarton/regulations-site,grapesmoker/regulations-site,grapesmoker/regulations-site,ascott1/regulations-site,willbarton/regulations-site,grapesmoker/regulatio...
regulations/tests/generator_versions_tests.py
regulations/tests/generator_versions_tests.py
from datetime import datetime, timedelta from unittest import TestCase from mock import patch from regulations.generator.versions import * class VersionsTest(TestCase): @patch('regulations.generator.versions.api_reader') def test_fetch_grouped_history(self, reader): client = reader.ApiReader.return_...
from datetime import datetime, timedelta from unittest import TestCase from mock import patch from regulations.generator.versions import * class VersionsTest(TestCase): @patch('regulations.generator.versions.api_reader') def test_fetch_grouped_history(self, reader): client = reader.ApiReader.return_...
cc0-1.0
Python
192d31045d84fa30da4154ac6b13e00e486bc791
ADD keep_connected column
OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft
packages/syft/src/syft/core/node/common/node_table/node.py
packages/syft/src/syft/core/node/common/node_table/node.py
# third party from sqlalchemy import Boolean from sqlalchemy import Column from sqlalchemy import Integer from sqlalchemy import String # relative from . import Base # this table holds the list of known nodes usually peer domains class Node(Base): __tablename__ = "node" id = Column(Integer(), primary_key=Tr...
# third party from sqlalchemy import Column from sqlalchemy import Integer from sqlalchemy import String # relative from . import Base # this table holds the list of known nodes usually peer domains class Node(Base): __tablename__ = "node" id = Column(Integer(), primary_key=True, autoincrement=True) nod...
apache-2.0
Python
7adc80917d6db8cb22ff912c6b4d44b25948e372
use app engine's mox; automatically show logging when running single test(s)
snarfed/oauth-dropins,snarfed/oauth-dropins,snarfed/oauth-dropins
oauth_dropins/test/__init__.py
oauth_dropins/test/__init__.py
# Add the App Engine SDK's bundled libraries (django, webob, yaml, etc.) to # sys.path so we can use them instead of adding them all to tests_require in # setup.py. # https://cloud.google.com/appengine/docs/python/tools/localunittesting#Python_Setting_up_a_testing_framework import dev_appserver dev_appserver.fix_sys_pa...
# Add the App Engine SDK's bundled libraries (django, mox, webob, yaml, etc.) to # sys.path so we can use them instead of adding them all to tests_require in # setup.py. # https://cloud.google.com/appengine/docs/python/tools/localunittesting#Python_Setting_up_a_testing_framework import dev_appserver dev_appserver.fix_s...
unlicense
Python
14b3ac31e7c46ce7c0482fd926a5306234a4f1e6
Fix the accidental removal of IS_PY26
Xion/taipan
taipan/_compat.py
taipan/_compat.py
""" Compatibility shims for different Python versions and platforms. """ try: import json except ImportError: try: import simplejson as json except ImportError: import django.utils.simplejson as json import sys IS_PY26 = sys.version[:2] == (2, 6) IS_PY3 = sys.version_info[0] == 3 import p...
""" Compatibility shims for different Python versions and platforms. """ try: import json except ImportError: try: import simplejson as json except ImportError: import django.utils.simplejson as json import sys IS_PY3 = sys.version_info[0] == 3 import platform IS_PYPY = platform.python_im...
bsd-2-clause
Python
9f0c341a93c18c42a3882df9be2ea51f1e3795e9
Structure tests in main function
waltermoreira/tartpy
tartpy/example.py
tartpy/example.py
import rt class Stateless(rt.Actor): def __init__(self): super().__init__() self.behavior = self.stateless_beh def stateless_beh(self, message): print("Stateless got message: {}".format(message)) class Stateful(rt.Actor): def __init__(self, state): super().__ini...
import rt class Stateless(rt.Actor): def __init__(self): super().__init__() self.behavior = self.stateless_beh def stateless_beh(self, message): print("Stateless got message: {}".format(message)) class Stateful(rt.Actor): def __init__(self, state): super().__ini...
mit
Python
f0704bc4ae755ec59690fcee896a55c71ba57e79
Fix edge case for groups with no rules.
krux/pysecurity-groups
pysecurity_groups/aws.py
pysecurity_groups/aws.py
### -*- coding: utf-8 -*- ### ### © 2012 Krux Digital, Inc. ### Author: Paul Lathrop <paul@krux.com> ### """AWS functions for pysecurity-groups.""" from operator import concat ### The code which reads the boto configuration files only runs when you ### import boto, so even though we aren't using the module, we need ...
### -*- coding: utf-8 -*- ### ### © 2012 Krux Digital, Inc. ### Author: Paul Lathrop <paul@krux.com> ### """AWS functions for pysecurity-groups.""" from operator import concat ### The code which reads the boto configuration files only runs when you ### import boto, so even though we aren't using the module, we need ...
mit
Python
bdbba8c6b7a29552b3230ab5a83be53cf2a1b6ea
Simplify _create integration logic
cgvarela/pysellus,Pysellus/pysellus,angelsanz/pysellus,ergl/pysellus
pysellus/integrations.py
pysellus/integrations.py
import rx.subjects as subjects from pysellus.stock_integrations import terminal """ { test_name: [ registered_integrations ] } """ registered_integrations = {} """ { integration_name: rx.subjects.Subject } """ integration_to_subject = {} def on_failure(*integration_names): """ on_failure :: [String] -> (fn...
import rx.subjects as subjects from pysellus.stock_integrations import terminal """ { test_name: [ registered_integrations ] } """ registered_integrations = {} """ { integration_name: rx.subjects.Subject } """ integration_to_subject = {} def on_failure(*integration_names): """ on_failure :: [String] -> (fn...
mit
Python
146c7deb8eb06813bb8d744d6e33148fc55c1a30
Fix variable naming in features.account.
Shizmob/pydle
pydle/features/account.py
pydle/features/account.py
## account.py # Account system support. from pydle.features import rfc1459 class AccountSupport(rfc1459.RFC1459Support): ## Internal. def _create_user(self, nickname): super()._create_user(nickname) self.users[nickname].update({ 'account': None, 'identified': False ...
## account.py # Account system support. from pydle.features import rfc1459 class AccountSupport(rfc1459.RFC1459Support): ## Internal. def _create_user(self, nickname): super()._create_user(nickname) self.users[nickname].update({ 'account': None, 'identified': False ...
bsd-3-clause
Python
ab06c459f4919502fd78da180b228b9721077ca2
Make validTest error on empty output again
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/coverage/validTest.py
python/ql/test/experimental/dataflow/coverage/validTest.py
def check_output(outtext, f): if outtext and all(s == "OK" for s in outtext.splitlines()): pass else: raise RuntimeError("Function failed", outtext, f) def check_test_function(f): from io import StringIO import sys capturer = StringIO() old_stdout = sys.stdout sys.stdout = ...
def check_output(outtext, f): if all(s == "OK" for s in outtext.splitlines()): pass else: raise RuntimeError("Function failed", outtext, f) def check_test_function(f): from io import StringIO import sys capturer = StringIO() old_stdout = sys.stdout sys.stdout = capturer ...
mit
Python
d1f4328c913af1ae43d257b1190ef32c19c596fc
Bump version for release
saltstack/pytest-tempdir
pytest_tempdir/version.py
pytest_tempdir/version.py
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)` :copyright: © 2015 by the SaltStack Team, see AUTHORS for more details. :license: Apache 2.0, see LICENSE for more details. pytest_tempdir.version ~~~~~~~~~~~~~~~~~~~~~~ pytest tempdir plugin version informat...
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)` :copyright: © 2015 by the SaltStack Team, see AUTHORS for more details. :license: Apache 2.0, see LICENSE for more details. pytest_tempdir.version ~~~~~~~~~~~~~~~~~~~~~~ pytest tempdir plugin version informat...
apache-2.0
Python
fb455bdec9fd25e01eb4be7331721ee5548f519f
Update SingleTilingExpert parameters in reduction benchmark.
iree-org/iree-llvm-sandbox,iree-org/iree-llvm-sandbox,iree-org/iree-llvm-sandbox,iree-org/iree-llvm-sandbox
python/reduction/bench.py
python/reduction/bench.py
# RUN: %PYTHON %s 2>&1 | FileCheck %s # This file contains small benchmarks with reasonably-sized problem/tiling sizes # and codegen options. from ..core.experts import * from .util import * all_experts = [ SingleTilingExpert( sizes=[8, 16, 32], interchange=[0, 1, 2], peel=False, ...
# RUN: %PYTHON %s 2>&1 | FileCheck %s # This file contains small benchmarks with reasonably-sized problem/tiling sizes # and codegen options. from ..core.experts import * from .util import * all_experts = [ SingleTilingExpert( sizes=[8, 16, 32], interchange=[0, 1, 2], pad=[0, 1, 2], ...
apache-2.0
Python
0e977a62aeb51781855c96d333410c6801dde754
Update test_order.py
ccxt/ccxt,ccxt/ccxt,ccxt/ccxt,ccxt/ccxt,ccxt/ccxt
python/test/test_order.py
python/test/test_order.py
import os import sys root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(root) # ---------------------------------------------------------------------------- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING...
import os import sys root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(root) # ---------------------------------------------------------------------------- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING...
mit
Python
b67a01891004b1d3e279a745eb5c025f8f0de7e4
Fix a stash issue in middleware code
gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine
openquake/server/middleware.py
openquake/server/middleware.py
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2015-2018 GEM Foundation # # OpenQuake 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 Licen...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2015-2018 GEM Foundation # # OpenQuake 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 Licen...
agpl-3.0
Python