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
3beae50c7de7c79f072bbd86bf19d6c80e2b52d8
Ajoute au log l'événement d'origine
lafranceinsoumise/api-django,lafranceinsoumise/api-django,lafranceinsoumise/api-django,lafranceinsoumise/api-django
agir/mailing/signals.py
agir/mailing/signals.py
import json import logging from anymail.signals import tracking from django.dispatch import receiver logger = logging.getLogger(__name__) @receiver(tracking, dispatch_uid="log_anymail_tracking_events") def log_anymail_tracking_events(sender, event, esp_name, **kwargs): event_fields = [ "event_type", ...
import json import logging from anymail.signals import tracking from django.dispatch import receiver logger = logging.getLogger(__name__) @receiver(tracking, dispatch_uid="log_anymail_tracking_events") def log_anymail_tracking_events(sender, event, esp_name, **kwargs): event_fields = [ "event_type", ...
agpl-3.0
Python
6951304d4e628f1d992fe2d074a888f6887a009c
bump version
hopshadoop/hops-util-py,hopshadoop/hops-util-py
hops/version.py
hops/version.py
__version__ = '2.4.2'
__version__ = '2.4.1'
apache-2.0
Python
a42c4d36a913300dc8e6e2f56d3cf1b05f8d3323
bump version
hopshadoop/hops-util-py,hopshadoop/hops-util-py
hops/version.py
hops/version.py
__version__ = '2.7.2'
__version__ = '2.7.1'
apache-2.0
Python
8e94087ba3a1ac01ceee32fd870a5cb996aa6cff
add regex
LynnCo/TumblrDevKit
html_builder.py
html_builder.py
# builtin import re from glob import glob from html import escape style_tag = '<style type="text/css" source="local">{}</style>' # expands to (ex:) <meta name="color:Background" content="#eee"/> metadata_tag = '<meta name="{}" content="{}"/>' def format_metadata(blog_name, html): if metadata_tag not in html: ...
# builtin import re from glob import glob from html import escape style_tag = '<style type="text/css" source="local">{}</style>' # expands to (ex:) <meta name="color:Background" content="#eee"/> metadata_tag = '<meta name="{}" content="{}"/>' def format_metadata(blog_name, html): if metadata_tag not in html: ...
mit
Python
f3ccd140c2a38e3ac7af7d03f01c24464635eec6
add try/except on leds.
litex-hub/litex-boards
litex_boards/targets/simple.py
litex_boards/targets/simple.py
#!/usr/bin/env python3 # # This file is part of LiteX-Boards. # # Copyright (c) 2014-2020 Florent Kermarrec <florent@enjoy-digital.fr> # Copyright (c) 2013-2014 Sebastien Bourdeauducq <sb@m-labs.hk> # SPDX-License-Identifier: BSD-2-Clause import os import argparse import importlib from migen import * from litex.bui...
#!/usr/bin/env python3 # # This file is part of LiteX-Boards. # # Copyright (c) 2014-2020 Florent Kermarrec <florent@enjoy-digital.fr> # Copyright (c) 2013-2014 Sebastien Bourdeauducq <sb@m-labs.hk> # SPDX-License-Identifier: BSD-2-Clause import os import argparse import importlib from migen import * from litex.bui...
bsd-2-clause
Python
3b5a0631d413720169c2a1e166dcb794561c3376
Add image testing utility functions.
ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit
icekit/utils/testing.py
icekit/utils/testing.py
# USEFUL FUNCTIONS DESIGNED FOR TESTS ############################################################## import glob import os import uuid from django.core.files.base import ContentFile from PIL import Image from StringIO import StringIO def new_test_image(): """ Creates an automatically generated test image. ...
# USEFUL FUNCTIONS DESIGNED FOR TESTS ##############################################################
mit
Python
c48827787dce53de3366d11e48edb91166ceed5e
Update DataCleaning.py
ccbrandenburg/financialanalyticsproject
iembdfa/DataCleaning.py
iembdfa/DataCleaning.py
# -*- coding: utf-8 -*- """ Created on Wed Jun 15 11:39:04 2016 @author: rahulmehra """ # Import the modules import pandas as pd from sklearn.preprocessing import LabelEncoder import numpy as np # Define a function to autoclean the pandas dataframe def autoclean(x): for column in x.columns: # Replace ...
# -*- coding: utf-8 -*- """ Created on Wed Jun 15 11:39:04 2016 @author: rahulmehra """ # Import the modules import pandas as pd from sklearn.preprocessing import LabelEncoder import numpy as np # Define a function to autoclean the pandas dataframe def autoclean(x): for column in x.columns: # Replace ...
mit
Python
0b898a7b35e1de15fa3867770567202cb21a0db0
refactor tests ... add unit test for TI stuff...
OpenTransitTools/otp_client_py
ott/otp_client/tests/tests_ti.py
ott/otp_client/tests/tests_ti.py
import os import unittest from ott.otp_client.transit_index.routes import Routes DB = None def get_db(): from gtfsdb import api from ott.utils import file_utils from gtfsdb import util dir = file_utils.get_module_dir(Routes) gtfs_file = os.path.join(dir, '..', 'tests', 'multi-date-feed.zip') ...
import os import unittest from ott.data.dao.route_dao import CurrentRoutesListDao from ott.data.dao.stop_dao import CurrentStopsListDao DB = None def get_db(): from gtfsdb import api from ott.utils import file_utils from gtfsdb import util dir = file_utils.get_module_dir(CurrentRoutesListDao) gtf...
mpl-2.0
Python
fdb9e17ac77eb8c6f4295b9e380695aafcebb7b7
Bump the version.
tensorflow/hub,tensorflow/hub
tensorflow_hub/version.py
tensorflow_hub/version.py
# Copyright 2018 The TensorFlow Hub Authors. 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 app...
# Copyright 2018 The TensorFlow Hub Authors. 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 app...
apache-2.0
Python
7f35b33ef07c3a40630fa0417648553ea6f8d1ea
Print overall backend coverage report (#15949)
oppia/oppia,oppia/oppia,oppia/oppia,oppia/oppia,oppia/oppia
scripts/check_overall_backend_test_coverage.py
scripts/check_overall_backend_test_coverage.py
# Copyright 2022 The Oppia Authors. 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 ...
# Copyright 2022 The Oppia Authors. 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 ...
apache-2.0
Python
bebb9b7ff0e4fc14352287d0f2938f6d5c8570e2
remove unused import
StreetVoice/django-celery-ses
djcelery_ses/tests.py
djcelery_ses/tests.py
import os.path from django.test import TestCase from django.core import mail from django.core.mail import EmailMessage from django.test.utils import override_settings from .models import Blacklist from .utils import pass_blacklist @override_settings( EMAIL_BACKEND='djcelery_ses.backends.CeleryEmailBackend', ...
import os.path import json from django.test import TestCase from django.core import mail from django.core.mail import EmailMessage from django.test.utils import override_settings from .models import Blacklist from .utils import pass_blacklist @override_settings( EMAIL_BACKEND='djcelery_ses.backends.CeleryEmailB...
mit
Python
b54d5cb1c5825fdf08fdb410f651e603806c4c3c
add typing for helper callback creator
osmcode/pyosmium,osmcode/pyosmium,osmcode/pyosmium
src/osmium/helper.py
src/osmium/helper.py
from typing import Optional, Callable, TypeVar from osmium._osmium import SimpleHandler from osmium.osm import Node, Way, Relation, Area, Changeset T = TypeVar('T') HandlerFunc = Optional[Callable[[T], None]] def make_simple_handler(node: HandlerFunc[Node] = None, way: HandlerFunc[Way] = Non...
from osmium._osmium import SimpleHandler def make_simple_handler(node=None, way=None, relation=None, area=None, changeset=None): """ Convenience function that creates a `SimpleHandler` from a set of callback functions. Each of the parameters takes an optional callable that must expect a single posi...
bsd-2-clause
Python
137d5c75d525d404bf2fea15c4e22a09d4a67fbb
simplify example
david415/txtorcon,meejah/txtorcon,ghtdak/txtorcon,ghtdak/txtorcon,isislovecruft/txtorcon,david415/txtorcon,isislovecruft/txtorcon,sammyshj/txtorcon,sammyshj/txtorcon,meejah/txtorcon
examples/circuit_failure_rates.py
examples/circuit_failure_rates.py
#!/usr/bin/env python ## ## This example uses ICircuitListener to monitor how many circuits have ## failed since the monitor started up. If this figure is more than 50%, ## a warning-level message is logged. ## ## Like the :ref:`stream_circuit_logger.py` example, we also log all new ## circuits. ## import os import...
#!/usr/bin/env python ## ## This example uses ICircuitListener to monitor how many circuits have ## failed since the monitor started up. If this figure is more than 50%, ## a warning-level message is logged. ## ## Like the :ref:`stream_circuit_logger.py` example, we also log all new ## circuits. ## import os import...
mit
Python
2af5eff46cbae0927aeee135c22304e108519659
Use the default file upload max memory size
SimonWaldherr/uploader,SimonWaldherr/uploader,FineUploader/fine-uploader,SimonWaldherr/uploader,FineUploader/fine-uploader,SimonWaldherr/uploader,SimonWaldherr/uploader,SimonWaldherr/uploader,SimonWaldherr/uploader,FineUploader/fine-uploader
server/python_django/file_uploader/__init__.py
server/python_django/file_uploader/__init__.py
""" @author: Ferdinand E. Silva @email: ferdinandsilva@ferdinandsilva.com @website: http://ferdinandsilva.com """ import os from django.conf import settings from django.utils import simplejson as json class qqFileUploader(object): def __init__(self, allowedExtensions=None, sizeLimit=None): self.allowedEx...
""" @author: Ferdinand E. Silva @email: ferdinandsilva@ferdinandsilva.com @website: http://ferdinandsilva.com """ import os from django.utils import simplejson as json class qqFileUploader(object): def __init__(self, allowedExtensions=None, sizeLimit=1024): self.allowedExtensions = allowedExtensions or [...
mit
Python
29a3ada68c0f79252a48e9103dd8f632de03a2db
fix import
missionpinball/mpf,missionpinball/mpf
mpf/tests/test_TwitchClient.py
mpf/tests/test_TwitchClient.py
from unittest.mock import MagicMock import sys from mpf.tests.MpfFakeGameTestCase import MpfFakeGameTestCase class MockEvent: """Copy of the irc Events class.""" def __init__(self, type, source, target, arguments=None, tags=None): self.type = type self.source = source self.target =...
import sys from mock import MagicMock from unittest.mock import patch, PropertyMock from mpf.tests.MpfFakeGameTestCase import MpfFakeGameTestCase class MockEvent: """Copy of the irc Events class.""" def __init__(self, type, source, target, arguments=None, tags=None): self.type = type self...
mit
Python
1b19212d29586f2748c1c24223d90141027e6fe0
Remove the unneeded %s from the template plugin
mrhanky17/irc3,mrhanky17/irc3,gawel/irc3
irc3/template/plugin.py
irc3/template/plugin.py
# -*- coding: utf-8 -*- from irc3.plugins.command import command import irc3 @irc3.plugin class Plugin(object): def __init__(self, bot): self.bot = bot @irc3.event(irc3.rfc.JOIN) def say_hi(self, mask, channel): """Say hi when someone join a channel""" if mask.nick != self.bot.ni...
# -*- coding: utf-8 -*- from irc3.plugins.command import command import irc3 @irc3.plugin class Plugin(object): def __init__(self, bot): self.bot = bot @irc3.event(irc3.rfc.JOIN) def say_hi(self, mask, channel): """Say hi when someone join a channel""" if mask.nick != self.bot.ni...
mit
Python
57109bc8348b0ace736f7be6f3b387a34185e6fc
remove old mean function
Eigenstate/msmbuilder,brookehus/msmbuilder,msmbuilder/msmbuilder,rafwiewiora/msmbuilder,Eigenstate/msmbuilder,rafwiewiora/msmbuilder,brookehus/msmbuilder,Eigenstate/msmbuilder,rafwiewiora/msmbuilder,Eigenstate/msmbuilder,Eigenstate/msmbuilder,brookehus/msmbuilder,msmbuilder/msmbuilder,rafwiewiora/msmbuilder,msmbuilder/...
msmbuilder/utils/divergence.py
msmbuilder/utils/divergence.py
from __future__ import print_function, division, absolute_import import numpy as np from scipy.stats import entropy def _kld(P, Q, scalar=True): result = entropy(P.T, Q.T) if scalar: return np.sum(result) else: return result def _sym_kld(P, Q, scalar=True): return _kld(P,Q,scalar=scal...
from __future__ import print_function, division, absolute_import import numpy as np from scipy.stats import entropy def _kld(P, Q, scalar=True): result = entropy(P.T, Q.T) if scalar: return np.sum(result) else: return result def _sym_kld(P, Q, scalar=True): return _kld(P,Q,scalar=scal...
lgpl-2.1
Python
5c874677cc978e1cdd563a563d62bae162d3b7ac
Add check for valid type of tracks
aatchison/mycroft-core,MycroftAI/mycroft-core,MycroftAI/mycroft-core,aatchison/mycroft-core,linuxipho/mycroft-core,forslund/mycroft-core,linuxipho/mycroft-core,Dark5ide/mycroft-core,Dark5ide/mycroft-core,forslund/mycroft-core
mycroft/skills/audioservice.py
mycroft/skills/audioservice.py
import time from mycroft.messagebus.message import Message class AudioService(): def __init__(self, emitter): self.emitter = emitter self.emitter.on('MycroftAudioServiceTrackInfoReply', self._track_info) self.info = None def _track_info(self, message=None): self.info = messag...
import time from mycroft.messagebus.message import Message class AudioService(): def __init__(self, emitter): self.emitter = emitter self.emitter.on('MycroftAudioServiceTrackInfoReply', self._track_info) self.info = None def _track_info(self, message=None): self.info = messag...
apache-2.0
Python
1ad8eeda835196e8aae86f942fb4e0b8f93ab78c
Add tests from time-related templatetags
gpodder/mygpo,gpodder/mygpo,gpodder/mygpo,gpodder/mygpo
mygpo/web/templatetags/time.py
mygpo/web/templatetags/time.py
from datetime import time from django.utils.safestring import mark_safe from django.utils.translation import ugettext as _ from django import template register = template.Library() @register.filter def sec_to_time(sec): """ Converts seconds to a time object >>> t = sec_to_time(1000) >>> (t.hour, t.minu...
from datetime import time from django.utils.safestring import mark_safe from django.utils.translation import ugettext as _ from django import template register = template.Library() @register.filter def sec_to_time(sec): s = int(sec) return time(s / 60 / 60, (s / 60) % 60, s % 60) @register.filter def form...
agpl-3.0
Python
47f2c189b18d080aae48d13d5744c0aeb07ebc45
add basic error checking for config settings
fedspendingtransparency/data-act-broker-backend,fedspendingtransparency/data-act-core,fedspendingtransparency/data-act-broker-backend,chambers-brian/SIG_Digital-Strategy_SI_ODP_Backend,fedspendingtransparency/data-act-core,chambers-brian/SIG_Digital-Strategy_SI_ODP_Backend
dataactcore/config.py
dataactcore/config.py
import os.path from os.path import expanduser, normpath, dirname import yaml import re import warnings # set the location of the DATA Act broker config file CONFIG_PATH = os.path.join(dirname(__file__), 'config.yml') with open(CONFIG_PATH) as c: CONFIG_ALL = yaml.load(c) CONFIG_BROKER = CONFIG_ALL['broker'] CONFI...
from os.path import dirname, join import yaml # set the location of the DATA Act broker config file CONFIG_PATH = join(dirname(__file__), 'config.yml') with open(CONFIG_PATH) as c: CONFIG_ALL = yaml.load(c) CONFIG_BROKER = CONFIG_ALL['broker'] CONFIG_SERVICES = CONFIG_ALL['services'] CONFIG_DB = CONFIG_ALL['db'] ...
cc0-1.0
Python
18a6fed3e35f6817b931f73251d6d6e3a5960757
clean up release script
Akuli/editor,Akuli/porcupine,Akuli/porcupine,Akuli/porcupine
release.py
release.py
#!/usr/bin/env python3 """Bump the Porcupine version number.""" import argparse import os import subprocess import sys from porcupine import version_info as old_info def edit_init_dot_py(new_info): with open('porcupine/__init__.py', 'r') as f: content = f.read() assert repr(old_info) in content ...
#!/usr/bin/env python3 """Bump the Porcupine version number.""" import argparse import os import subprocess import sys from porcupine import version_info as old_info def check_stuff(): status = subprocess.check_output(['git', 'status']) assert status.startswith(b'On branch master\n') assert 'VIRTUAL_ENV...
mit
Python
6c4e0903527b720a37e5122626b04e63cea7f6e5
add missing copyright info to file
caedus75/Renamer
renamer.py
renamer.py
#!/usr/bin/env python3 # Copyright (c) 2015, Carlos Millett # All rights reserved. from renamer.__main__ import main main()
#!/usr/bin/env python3 from renamer.__main__ import main main()
bsd-2-clause
Python
261365b48a7f9ce596875a84c1bea27aeabe5905
Raise exception if calc_method fails when called
jrsmith3/datac,jrsmith3/datac
datac/datac.py
datac/datac.py
# -*- coding: utf-8 -*- import copy class Datac(object): """ Model of 2D data with static parameters A `Datac` object is instantiated with the following parameters: :param dict params: Static parameters required to initialize the object featuring the ordinate calculator method. :param list absci...
# -*- coding: utf-8 -*- import copy class Datac(object): """ Model of 2D data with static parameters A `Datac` object is instantiated with the following parameters: :param dict params: Static parameters required to initialize the object featuring the ordinate calculator method. :param list absci...
mit
Python
6a70d15d9fdab42149e47b217200f494cadf0700
fix dependency typo
DeadSix27/python_cross_compile_script
packages/products/ffmpeg_extra.py
packages/products/ffmpeg_extra.py
{ 'repo_type' : 'git', 'url' : 'git://git.ffmpeg.org/ffmpeg.git', 'rename_folder' : 'ffmpeg_extra_git', 'configure_options' : '!VAR(ffmpeg_config)VAR! !VAR(ffmpeg_extra_config)VAR! !VAR(ffmpeg_nonfree)VAR! --prefix={output_prefix}/ffmpeg_extra_git.installed --enable-sdl --disable-shared --enable-static', 'depends_...
{ 'repo_type' : 'git', 'url' : 'git://git.ffmpeg.org/ffmpeg.git', 'rename_folder' : 'ffmpeg_extra_git', 'configure_options' : '!VAR(ffmpeg_config)VAR! !VAR(ffmpeg_extra_config)VAR! !VAR(ffmpeg_nonfree)VAR! --prefix={output_prefix}/ffmpeg_extra_git.installed --enable-sdl --disable-shared --enable-static', 'depends_...
mpl-2.0
Python
5b51c53e03c8a4c8add87898825cfea75e4bbf06
Remove doc_type from abstract
qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq
corehq/form_processor/abstract_models.py
corehq/form_processor/abstract_models.py
from abc import abstractmethod, abstractproperty, ABCMeta class AbstractXFormInstance(object): @abstractproperty def form_id(self): raise NotImplementedError() @abstractproperty def auth_context(self): raise NotImplementedError() @abstractproperty def form_data(self): ...
from abc import abstractmethod, abstractproperty, ABCMeta class AbstractXFormInstance(object): @abstractproperty def form_id(self): raise NotImplementedError() @abstractproperty def auth_context(self): raise NotImplementedError() @abstractproperty def doc_type(self): ...
bsd-3-clause
Python
7b435df3b5cd37d4002ca4675184e9d9c36fe080
Update MaskingNoiseAutoencoderRunner
cshallue/models,alexgorban/models,derekjchow/models,derekjchow/models,tombstone/models,jiaphuan/models,tombstone/models,jiaphuan/models,tombstone/models,derekjchow/models,sshleifer/object_detection_kitti,sshleifer/object_detection_kitti,cshallue/models,sshleifer/object_detection_kitti,jiaphuan/models,alexgorban/models,...
autoencoder/MaskingNoiseAutoencoderRunner.py
autoencoder/MaskingNoiseAutoencoderRunner.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import sklearn.preprocessing as prep import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data from autoencoder_models.DenoisingAutoencoder import MaskingNoiseAutoen...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import sklearn.preprocessing as prep import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data from autoencoder_models.DenoisingAutoencoder import MaskingNoiseAutoen...
apache-2.0
Python
a3c9cccad611a5c373927ad05c7f44f95488e741
Update taylor_green.py
tum-pbs/PhiFlow,tum-pbs/PhiFlow
demos/taylor_green.py
demos/taylor_green.py
""" Taylor-Green Vortex """ from phi.flow import * def taylor_green_pressure(x): return math.sum(math.cos(2 * x * VORTEX_COUNT), 'vector') / 4 * math.exp(-4 * VORTEX_COUNT ** 2 * t / RE) def taylor_green_velocity(x): sin = math.sin(VORTEX_COUNT * x) cos = math.cos(VORTEX_COUNT * x) return math.exp(-...
""" Taylor-Green Vortex """ from phi.flow import * def taylor_green_pressure(x): return math.sum(math.cos(2 * x * Q), 'vector') / 4 * math.exp(-4 * Q**2 * t / RE) def taylor_green_velocity(x): sin = math.sin(Q*x) cos = math.cos(Q*x) return math.exp(-2*Q**2*t/RE) * math.stack({ 'x': -cos.vect...
mit
Python
7f42bcc5028ff24cb6d74539538619999824bd9a
fix inefficient option selector
jwlin/web-crawler-tutorial
ch9/bot_house.py
ch9/bot_house.py
from bs4 import BeautifulSoup from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions from selenium.webdriver.common.by import By if __name__ == '__main__': url = 'http://www.bot.com.tw/house/default.aspx' try: d...
from bs4 import BeautifulSoup from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions from selenium.webdriver.common.by import By if __name__ == '__main__': url = 'http://www.bot.com.tw/house/default.aspx' try: d...
mit
Python
548d27cd166d109b1ff2b264427690f200752b43
Fix path for GAE SDK installed with gcloud
gpanther/hn-archive,gpanther/hn-archive
extract_data/01_record_to_json.py
extract_data/01_record_to_json.py
# based on http://gbayer.com/big-data/app-engine-datastore-how-to-efficiently-export-your-data/ import glob import json import sys import time import zlib # Make sure App Engine APK is available sys.path.append('/usr/lib/google-cloud-sdk/platform/google_appengine') from google.appengine.api.files import records from...
# based on http://gbayer.com/big-data/app-engine-datastore-how-to-efficiently-export-your-data/ import glob import json import sys import time import zlib # Make sure App Engine APK is available sys.path.append('/usr/local/google_appengine') from google.appengine.api.files import records from google.appengine.datast...
agpl-3.0
Python
6243c84e3caed64f619b63b26b246f9bf1559df7
fix keys
rkabir/omar
kill_screens.py
kill_screens.py
import os keys = ["twentysix", "twentyseven", "twentyeight", "twentynine", "thirty", "twentyone", "twentytwo", "twentythree", "twentyfour", "twentyfive", "sixteen", "seventeen", "eighteen", "nineteen", "twenty", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "ohsix", "ohseven", "oheight", "ohni...
import os keys = ["twentysix", "twentyseven", "twentyeight", "twentynine", "thirty", "twentyone", "twentytwo", "twentythree", "twentyfour", "twentyfive", "sixteen", "seventeen", "eighteen", "nineteen", "twenty", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "six", "seven", "eight", "nine", "te...
mit
Python
6cc3f65648820f5e73d55ac01cabe822a22a7c11
Update work_time.py
pollseed/python_script_lib,pollseed/script_lib,pollseed/python_script_lib,pollseed/python_script_lib,pollseed/script_lib,pollseed/script_lib,pollseed/python_script_lib,pollseed/python_script_lib,pollseed/python_script_lib,pollseed/script_lib,pollseed/script_lib,pollseed/script_lib
lib/work_time.py
lib/work_time.py
# -*- coding: utf-8 -*- from datetime import datetime as dt from datetime import date as d """ python work_time.py What time is working end time of {__day of the week__}? Plerase your today's working-end hour >>> """ class WorkTime(object): DAY_OF_THE_WEEK = {0:"monday",1:"tuesday",2:"wednesday",3:"thursday",4...
# -*- coding: utf-8 -*- from datetime import datetime as dt from datetime import date as d """ python work_time.py What time is working end time of {__day of the week__}? Plerase your today's working-end hour >>> """ class WorkTime(object): DAY_OF_THE_WEEK = {0:"monday",1:"tuesday",2:"wednesday",3:"thursday",4...
mit
Python
76174b92a74bc044dca88eaa36a7e8b9051eee22
Remove redundant parenthesis
jamesevickery/l293d,jamesevickery/l293d
l293d/config.py
l293d/config.py
import os import yaml config_path = '' # Custom config filepath # ^ For example: '/home/arthurdent/configs/l293d.yaml' # If no custom path, user's home directory is used if not config_path: # Get user home location and append filename.extension config_path = os.path.expanduser('~') + '/l293d-config.yaml' co...
import os import yaml config_path = '' # Custom config filepath # ^ For example: '/home/arthurdent/configs/l293d.yaml' # If no custom path, user's home directory is used if not config_path: # Get user home location and append filename.extension config_path = os.path.expanduser('~') + '/l293d-config.yaml' co...
mit
Python
22cbb0b9e0c0b667e5e68bec3b2284be42c9e9bf
Patch version bump to 17.5.2
alphagov/notifications-utils
notifications_utils/version.py
notifications_utils/version.py
__version__ = '17.5.2'
__version__ = '17.5.1'
mit
Python
6de038e8dae3bd73bddcd9b5242c57dca84d2f13
increase number of symbols in separators
CiscoSystems/os-sqe,CiscoSystems/os-sqe,CiscoSystems/os-sqe
lab/with_log.py
lab/with_log.py
class WithLogMixIn(object): @staticmethod def log_to_artifact(name, body): from lab.with_config import open_artifact with open_artifact(name, 'w') as f: f.write(body) def _format_single_cmd_output(self, cmd, ans): n = 160 return n * 'v' + '\n' + self.__repr__()...
class WithLogMixIn(object): @staticmethod def log_to_artifact(name, body): from lab.with_config import open_artifact with open_artifact(name, 'w') as f: f.write(body) def _format_single_cmd_output(self, cmd, ans): return 80 * 'v' + '\n' + self.__repr__() + '> ' + cmd +...
apache-2.0
Python
6593a7bfcad12796316f3a1cba40a41ee1546c2b
Fix the version tuple.
dipakvwarade/pychef,jarosser06/pychef,jarosser06/pychef,coderanger/pychef,Scalr/pychef,cread/pychef,Scalr/pychef,coderanger/pychef,dipakvwarade/pychef,cread/pychef
chef/__init__.py
chef/__init__.py
# Copyright (c) 2010 Noah Kantrowitz <noah@coderanger.net> __version__ = (0, 2, 0, 'dev') from chef.api import ChefAPI, autoconfigure from chef.client import Client from chef.data_bag import DataBag, DataBagItem from chef.exceptions import ChefError from chef.node import Node from chef.role import Role from chef.envi...
# Copyright (c) 2010 Noah Kantrowitz <noah@coderanger.net> __version__ = (0, 2, 'dev') from chef.api import ChefAPI, autoconfigure from chef.client import Client from chef.data_bag import DataBag, DataBagItem from chef.exceptions import ChefError from chef.node import Node from chef.role import Role from chef.environ...
apache-2.0
Python
91340dbcac805cfed7b93ce3854342ef56bee88a
Update of copyright string
lewangbtcc/anti-XSS,lewangbtcc/anti-XSS
lib/__init__.py
lib/__init__.py
#!/usr/bin/env python """ Copyright (c) 2016 anti-XSS developers (http://laiw3n.com/) See the file 'doc/COPYING' for copying permission """ pass
#!/usr/bin/env python """ Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ pass
mit
Python
e7945032b8205cdf262755836449eab7ed9589c7
update char_cnn.py
yasfmy/chainer_charcnn
lib/char_cnn.py
lib/char_cnn.py
from math import ceil import chainer import chainer.functions as F import chainer.links as L from tools.model import BaseModel class CharCNN(BaseModel): def __init__(self, length, categories): fc_size = ceil((length - 96) / 27) * 256 super().__init__( conv1 = L.Convolution2D(1, 25...
import os from datetime import datetime from math import ceil import chainer import chainer.functions as F import chainer.links as L from chainer import cuda from chainer import serializers class BaseModel(chainer.Chain): def use_gpu(self, gpu_id): cuda.get_device(gpu_id).use() self.to_gpu() ...
mit
Python
d49e539d87082cca428c0b6f157ba6165e38b5d3
Add unique descriptor name validation
hack4impact/maps4all,hack4impact/maps4all,hack4impact/maps4all,hack4impact/maps4all
app/descriptor/forms.py
app/descriptor/forms.py
from flask.ext.wtf import Form from wtforms.fields import ( BooleanField, FieldList, SelectField, SelectMultipleField, SubmitField, TextField ) from wtforms.validators import InputRequired, Length, ValidationError from ..models import Descriptor class NewDescriptorForm(Form): desc_type = S...
from flask.ext.wtf import Form from wtforms.fields import ( BooleanField, FieldList, SelectField, SelectMultipleField, SubmitField, TextField ) from wtforms.validators import InputRequired, Length class NewDescriptorForm(Form): desc_type = SelectField('Descriptor type', ...
mit
Python
793a553027dcad85bd8d67513d54432f6311a4e3
add m102 to allowed failures
mwcraig/feder-object-list
test_valid_object_file.py
test_valid_object_file.py
from __future__ import print_function, division from exceptions import Exception from astropy.table import Table from astropy.coordinates import SkyCoord from astropy.coordinates.name_resolve import NameResolveError from astropy import units as u from astropy import utils class CoordinateMismatchError(Exception): ...
from __future__ import print_function, division from exceptions import Exception from astropy.table import Table from astropy.coordinates import SkyCoord from astropy.coordinates.name_resolve import NameResolveError from astropy import units as u from astropy import utils class CoordinateMismatchError(Exception): ...
bsd-2-clause
Python
4565fa4122b4550398d945b600ca34669ad7e707
Fix a comment
Tesi-Luca-Davide/ryu,OpenState-SDN/ryu,StephenKing/summerschool-2015-ryu,hisaharu/ryu,TakeshiTseng/ryu,shinpeimuraoka/ryu,habibiefaried/ryu,iwaseyusuke/ryu,diogommartins/ryu,fujita/ryu,alanquillin/ryu,jalilm/ryu,Tesi-Luca-Davide/ryu,muzixing/ryu,gopchandani/ryu,gareging/SDN_Framework,alyosha1879/ryu,yamt/ryu,osrg/ryu,o...
ryu/cfg.py
ryu/cfg.py
# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2014 YAMAMOTO Takashi <yamamoto at valinux co jp> # # 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:...
# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2014 YAMAMOTO Takashi <yamamoto at valinux co jp> # # 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:...
apache-2.0
Python
2ba105821370de9487d3fca3e924153ed5610245
Use AuthApiRequest class
devicehive/devicehive-python
devicehive/command.py
devicehive/command.py
from devicehive.api_request import AuthApiRequest class Command(object): """Command class.""" DEVICE_ID_KEY = 'deviceId' ID_KEY = 'id' USER_ID_KEY = 'userId' COMMAND_KEY = 'command' PARAMETERS_KEY = 'parameters' LIFETIME_KEY = 'lifetime' TIMESTAMP_KEY = 'timestamp' # TODO: add LAS...
from devicehive.api_request import ApiRequest class Command(object): """Command class.""" DEVICE_ID_KEY = 'deviceId' ID_KEY = 'id' USER_ID_KEY = 'userId' COMMAND_KEY = 'command' PARAMETERS_KEY = 'parameters' LIFETIME_KEY = 'lifetime' TIMESTAMP_KEY = 'timestamp' # TODO: add LAST_UP...
apache-2.0
Python
73fb23af2db047c8012382c03abbf48f392f63b9
Update verion 1.0.0.dev2 -> 1.0.0.dev3
oneklc/dimod,oneklc/dimod
dimod/package_info.py
dimod/package_info.py
__version__ = '1.0.0.dev3' __author__ = 'D-Wave Systems Inc.' __authoremail__ = 'acondello@dwavesys.com' __description__ = 'A shared API for binary quadratic model samplers.'
__version__ = '1.0.0.dev2' __author__ = 'D-Wave Systems Inc.' __authoremail__ = 'acondello@dwavesys.com' __description__ = 'A shared API for binary quadratic model samplers.'
apache-2.0
Python
ac02f4b1fa995162064b47534b1adeb18aeca1e5
fix for api_client
chouseknecht/openshift-restclient-python,chouseknecht/openshift-restclient-python
openshift/client/api_client.py
openshift/client/api_client.py
from __future__ import absolute_import from kubernetes.client.api_client import ApiClient as K8sApiClient from . import models class ApiClient(K8sApiClient): def _ApiClient__deserialize(self, data, klass): try: return super(ApiClient, self).__deserialize(data, klass) except AttributeE...
from kubernetes.client.api_client import ApiClient as K8sApiClient class ApiClient(K8sApiClient): def _ApiClient__deserialize(self, data, klass): try: return super(ApiClient, self).__deserialize(data, klass) except AttributeError: klass = eval('models.' + klass) ...
apache-2.0
Python
c82adb21600f8830102a86ed9fbdda8659b9300c
Update the utils module
tschijnmo/GCMCbyGULP,tschijnmo/GCMCbyGULP
GCMCbyGULP/utils.py
GCMCbyGULP/utils.py
""" Small utility functions ======================= """ import collections def ensure_list_of_str(val, tag): """Ensures that the given value is a list of strings It ensures that the given value is a list of strings and return them, or value error will be raised. If a single string is given, a singleto...
""" Small utility functions ======================= """ import collections def ensure_list_of_str(val, tag): """Ensures that the given value is a list of strings It ensures that the given value is a list of strings and return them, or value error will be raised. If a single string is given, a singleto...
mit
Python
33cd3d029987aec02036719e306f9c163d43df96
Use functools.wraps as the basis for api_util.wraps.
google/jax,google/jax,tensorflow/probability,google/jax,tensorflow/probability,google/jax
jax/api_util.py
jax/api_util.py
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
Python
77ef9f4a7ccd51d7b070da31ff4c30768653bb7b
Remove alloy and s3 from generated docs, just for 0.1 release.
blakedewey/nipype,gerddie/nipype,FCP-INDI/nipype,rameshvs/nipype,blakedewey/nipype,satra/NiPypeold,FCP-INDI/nipype,FredLoney/nipype,arokem/nipype,dmordom/nipype,pearsonlab/nipype,pearsonlab/nipype,Leoniela/nipype,glatard/nipype,mick-d/nipype_source,mick-d/nipype,dmordom/nipype,arokem/nipype,carlohamalainen/nipype,mick-...
tools/build_modref_templates.py
tools/build_modref_templates.py
#!/usr/bin/env python """Script to auto-generate our API docs. """ # stdlib imports import os # local imports from apigen import ApiDocWriter #***************************************************************************** if __name__ == '__main__': package = 'nipype' outdir = os.path.join('api','generated') ...
#!/usr/bin/env python """Script to auto-generate our API docs. """ # stdlib imports import os # local imports from apigen import ApiDocWriter #***************************************************************************** if __name__ == '__main__': package = 'nipype' outdir = os.path.join('api','generated') ...
bsd-3-clause
Python
c772a8aa5219334db929bd48591de5ca0abb9a77
Rewrite combination_sum.py to python from Java
keon/algorithms,amaozhao/algorithms
dp/combination_sum.py
dp/combination_sum.py
""" Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target. Example: nums = [1, 2, 3] target = 4 The possible combination ways are: (1, 1, 1, 1) (1, 1, 2) (1, 2, 1) (1, 3) (2, 1, 1) (2, 2) (3, 1) Note that different seque...
Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target. Example: nums = [1, 2, 3] target = 4 The possible combination ways are: (1, 1, 1, 1) (1, 1, 2) (1, 2, 1) (1, 3) (2, 1, 1) (2, 2) (3, 1) Note that different sequences...
mit
Python
fe38867743a04df21cca8733bde4e644b36bde62
bump to 0.51.2
dmpetrov/dataversioncontrol,efiop/dvc,efiop/dvc,dmpetrov/dataversioncontrol
dvc/version.py
dvc/version.py
# Used in setup.py, so don't pull any additional dependencies # # Based on: # - https://github.com/python/mypy/blob/master/mypy/version.py # - https://github.com/python/mypy/blob/master/mypy/git.py import os import subprocess _BASE_VERSION = "0.55.2" def _generate_version(base_version): """Generate a versio...
# Used in setup.py, so don't pull any additional dependencies # # Based on: # - https://github.com/python/mypy/blob/master/mypy/version.py # - https://github.com/python/mypy/blob/master/mypy/git.py import os import subprocess _BASE_VERSION = "0.55.1" def _generate_version(base_version): """Generate a versio...
apache-2.0
Python
af8a7aa25d9243e24f1ee0e4f61362d48146588c
bump to 0.59.2
dmpetrov/dataversioncontrol,efiop/dvc,dmpetrov/dataversioncontrol,efiop/dvc
dvc/version.py
dvc/version.py
# Used in setup.py, so don't pull any additional dependencies # # Based on: # - https://github.com/python/mypy/blob/master/mypy/version.py # - https://github.com/python/mypy/blob/master/mypy/git.py import os import subprocess _BASE_VERSION = "0.59.2" def _generate_version(base_version): """Generate a versio...
# Used in setup.py, so don't pull any additional dependencies # # Based on: # - https://github.com/python/mypy/blob/master/mypy/version.py # - https://github.com/python/mypy/blob/master/mypy/git.py import os import subprocess _BASE_VERSION = "0.59.1" def _generate_version(base_version): """Generate a versio...
apache-2.0
Python
198daeca7aa52e947fb839fe953dd1f7b172edd1
Update update_customer_for_issue.py
ShashaQin/erpnext,ShashaQin/erpnext,ShashaQin/erpnext,ShashaQin/erpnext
erpnext/patches/v6_27/update_customer_for_issue.py
erpnext/patches/v6_27/update_customer_for_issue.py
import frappe # patch all for-print field (total amount) in Journal Entry in 2015 def execute(): updated_list = [] for issue in frappe.db.sql_list("""select name from `tabIssue` where (contact is null or contact='') or (customer is null or customer='')"""): issue = frappe.get_doc("Issue", issue) if issue....
import frappe # patch all for-print field (total amount) in Journal Entry in 2015 def execute(): updated_list = [] for issue in frappe.db.sql_list("""select name from `tabIssue` where contact is null or customer is null"""): issue = frappe.get_doc("Issue", issue) if issue.raised_by: contact = frappe.d...
agpl-3.0
Python
5e8918d1c8d03a0d35baf6ee3e7bdf922fdbaa46
update lock
sachinio/redalert,sachinio/redalert,sachinio/redalert,sachinio/redalert,sachinio/redalert,sachinio/redalert,sachinio/redalert
lights/lights.py
lights/lights.py
from __future__ import print_function import serial, fcntl import time import sys def calChecksum(frameData): checksum=0 for a in frameData: checksum+=int(a,16) return hex(int('0xFF',16)-int(str(hex(checksum))[-2:],16)) def createFrame(address, data): frameDelimiter = "7E" frameType = "10"...
from __future__ import print_function import serial, fcntl import time import sys def calChecksum(frameData): checksum=0 for a in frameData: checksum+=int(a,16) return hex(int('0xFF',16)-int(str(hex(checksum))[-2:],16)) def createFrame(address, data): frameDelimiter = "7E" frameType = "10"...
mit
Python
b6e20cdbfdcb8fe8debbc61f0551efffce602e9f
test subdir list
mjirik/lisa,mjirik/lisa
tests/experiments_test.py
tests/experiments_test.py
#! /usr/bin/python # -*- coding: utf-8 -*- # import funkcí z jiného adresáře import sys import os.path import copy path_to_script = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.join(path_to_script, "../extern/pyseg_base/src/")) sys.path.append(os.path.join(path_to_script, "../extern/pycat/exte...
#! /usr/bin/python # -*- coding: utf-8 -*- # import funkcí z jiného adresáře import sys import os.path import copy path_to_script = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.join(path_to_script, "../extern/pyseg_base/src/")) sys.path.append(os.path.join(path_to_script, "../extern/pycat/exte...
bsd-3-clause
Python
720e86a45c85c7e9d96707f62f6d495645cbba0e
Test that Cursor.__iter__() returns self
lalinsky/python-phoenixdb,Pirionfr/pyPhoenix,lalinsky/python-phoenixdb,youngwookim/python-phoenixdb,youngwookim/python-phoenixdb,Pirionfr/pyPhoenix
phoenixdb/tests/test_phoenixdb.py
phoenixdb/tests/test_phoenixdb.py
import os import unittest import phoenixdb import dbapi20 TEST_URL = os.environ.get('PHOENIXDB_TEST_URL') @unittest.skipIf(TEST_URL is None, "these tests require the PHOENIXDB_TEST_URL environment variable set to a clean database") class PhoenixDatabaseAPI20Test(dbapi20.DatabaseAPI20Test): driver = phoenixdb ...
import os import unittest import phoenixdb import dbapi20 TEST_URL = os.environ.get('PHOENIXDB_TEST_URL') @unittest.skipIf(TEST_URL is None, "these tests require the PHOENIXDB_TEST_URL environment variable set to a clean database") class PhoenixDatabaseAPI20Test(dbapi20.DatabaseAPI20Test): driver = phoenixdb ...
apache-2.0
Python
0f3c33de86d38cf47f84df97a79e838d37264b7c
Add messages on idle so that we don't break
sugarlabs/sugar-toolkit,ceibal-tatu/sugar-toolkit-gtk3,tchx84/debian-pkg-sugar-toolkit,manuq/sugar-toolkit-gtk3,quozl/sugar-toolkit-gtk3,godiard/sugar-toolkit-gtk3,Daksh/sugar-toolkit-gtk3,ceibal-tatu/sugar-toolkit-gtk3,ceibal-tatu/sugar-toolkit,gusDuarte/sugar-toolkit-gtk3,i5o/sugar-toolkit-gtk3,sugarlabs/sugar-toolki...
sugar/session/LogWriter.py
sugar/session/LogWriter.py
import os import sys import dbus import gobject class LogWriter: def __init__(self, application): self._application = application bus = dbus.SessionBus() proxy_obj = bus.get_object('com.redhat.Sugar.Logger', '/com/redhat/Sugar/Logger') self._logger = dbus.Interface(proxy_obj, 'com.redhat.Sugar.Logger') def ...
import os import sys import dbus class LogWriter: def __init__(self, application): self._application = application bus = dbus.SessionBus() proxy_obj = bus.get_object('com.redhat.Sugar.Logger', '/com/redhat/Sugar/Logger') self._logger = dbus.Interface(proxy_obj, 'com.redhat.Sugar.Logger') def start(self): ...
lgpl-2.1
Python
9c265b0e2ede441a27d8f4a14b6093207d260886
Correct command in CommandError
jkimbo/freight,rshk/freight,jkimbo/freight,klynton/freight,rshk/freight,jkimbo/freight,jkimbo/freight,getsentry/freight,klynton/freight,getsentry/freight,klynton/freight,rshk/freight,klynton/freight,getsentry/freight,rshk/freight,getsentry/freight,getsentry/freight
ds/utils/workspace.py
ds/utils/workspace.py
from __future__ import absolute_import import os import traceback from subprocess import Popen, PIPE from ds.exceptions import CommandError class Workspace(object): def __init__(self, path, logbuffer=PIPE): self.path = path self.logbuffer = logbuffer def run(self, command, *args, **kwargs)...
from __future__ import absolute_import import os import traceback from subprocess import Popen, PIPE from ds.exceptions import CommandError class Workspace(object): def __init__(self, path, logbuffer=PIPE): self.path = path self.logbuffer = logbuffer def run(self, command, *args, **kwargs)...
apache-2.0
Python
d866bbb43d61d08ba31d7d23d71354863c8c911b
update scraper
ojengwa/gfe
scraper.py
scraper.py
import re from dateutil.parser import parse from xml.sax.saxutils import unescape import requests import bs4 from app import app, db from models import Result base_scraper_url = app.config.get('SCRAPER_BASE_URL') base_url = app.config.get('BASE_URL') base_dict = {} def clean_html(html): return ' '.join(re.fin...
import re from dateutil.parser import parse from xml.sax.saxutils import unescape import requests import bs4 from app import app, db from models import Result base_scraper_url = app.config.get('SCRAPER_BASE_URL') base_url = app.config.get('BASE_URL') base_dict = {} print('value', '...') def clean_html(html): ...
mit
Python
d34ce0371153fd2885c2e4226973877cf7e86d0b
use fancy apostrophe in Don't know for yes/no field
mysociety/yournextmp-popit,mysociety/yournextmp-popit,DemocracyClub/yournextrepresentative,neavouli/yournextrepresentative,mysociety/yournextrepresentative,mysociety/yournextrepresentative,neavouli/yournextrepresentative,mysociety/yournextmp-popit,neavouli/yournextrepresentative,mysociety/yournextrepresentative,neavoul...
candidates/templatetags/extra_field_value.py
candidates/templatetags/extra_field_value.py
from django import template from django.utils.html import conditional_escape from django.utils.safestring import mark_safe from django.utils.translation import ugettext as _ register = template.Library() @register.filter def extra_field_value(extra_field): if extra_field['value'] == '': return '' if...
from django import template from django.utils.html import conditional_escape from django.utils.safestring import mark_safe from django.utils.translation import ugettext as _ register = template.Library() @register.filter def extra_field_value(extra_field): if extra_field['value'] == '': return '' if...
agpl-3.0
Python
76dd30f8d292759374fe03699d91fdd9e36f59bd
add system_server_wtf
dropbox-dashbpard/error-detect-of-log,dropbox-dashbpard/error-detect-of-log
ed/__init__.py
ed/__init__.py
# -*- coding: utf-8 -*- from app_crash import app_crash from app_anr import app_anr from app_wtf import app_wtf from system_tombstone import system_tombstone from flask import jsonify, request import json TAGS = { "system_app_crash": app_crash, "SYSTEM_TOMBSTONE": system_tombstone, "system_ap...
# -*- coding: utf-8 -*- from app_crash import app_crash from app_anr import app_anr from app_wtf import app_wtf from system_tombstone import system_tombstone from flask import jsonify, request import json TAGS = { "system_app_crash": app_crash, "SYSTEM_TOMBSTONE": system_tombstone, "system_ap...
mit
Python
2022357fd0f81be6f3ca91718a6c8c1d1d46ac1b
Rename olfactory stimulus file and internal array.
cerrno/neurokernel
examples/olfaction/config_files/gen_olf_stimuli.py
examples/olfaction/config_files/gen_olf_stimuli.py
""" Create odorant stimuli in hd5 format """ """ Create the gexf configuration based on E. Hallem's cell paper on 2006 """ import numpy as np import h5py osn_num = 1375; f = h5py.File("olfactory_stimulus.h5","w") dt = 1e-4 # time step Ot = 2000 # number of data point during reset period Rt = 1000 # number of data ...
""" Create odorant stimuli in hd5 format """ """ Create the gexf configuration based on E. Hallem's cell paper on 2006 """ import numpy as np import h5py osn_num = 1375; f = h5py.File("al.hdf5","w") dt = 1e-4 # time step Ot = 2000 # number of data point during reset period Rt = 1000 # number of data point during o...
bsd-3-clause
Python
4b91a02275a27d3d863dbd7da9f806277424b7c3
add generic function to validate all types of bodys
joaolrpaulo/eletronic-voting-system,joaolrpaulo/eletronic-voting-system,joaolrpaulo/eletronic-voting-system
voting-server/app/validators.py
voting-server/app/validators.py
import re def has_valid_body(json, fields, functions): return all([func(json.get(field)) for field, func in zip(fields, functions)]) def get_body_errors(json, fields, functions): missing = [field for field in fields if not json.get(field)] malformed = [field for field, func in zip(fields, functions) if ...
import re def voter_id(data): # Exactly 8 numbers to follow National Card ID return bool(re.match('^(\d{8})$', str(data))) def password(data): # Minimum 8 chars, Maximum, 64 chars, 1 upper, 1 lower, 1 symbol, 1 numeric return bool(re.match('^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8...
mit
Python
1cc7ff3b6d3d9595712234e1da593196cc1889bf
Use same db name for test. Use custom config for tests to separate test and dev dbs.
dvhbru/dvhb-hybrid
dvhb_hybrid/config.py
dvhb_hybrid/config.py
import os import invoke import yaml def load_conf(overrides=None, local_path=None, *, base_path, env_path, system_prefix, env_prefix): with open(base_path) as f: base = yaml.load(f) path = os.environ.get(env_path) if not overrides and path and os.path.isfile(path): with open(path) as f: ...
import os import invoke import yaml def load_conf(overrides=None, local_path=None, *, base_path, env_path, system_prefix, env_prefix): with open(base_path) as f: base = yaml.load(f) path = os.environ.get(env_path) if not overrides and path and os.path.isfile(path): with open(path) as f: ...
mit
Python
c6445353f95694ebfd5bfcb14921eb7e465e4232
Add repr magic function for OrdinalVote
brotherjack/RoodeStem,brotherjack/RoodeStem,brotherjack/RoodeStem
voting_systems/voting_system.py
voting_systems/voting_system.py
#!/usr/bin/env python3 from abc import abstractmethod, ABCMeta from itertools import combinations class VotingException(Exception): pass class VotingError(Exception): pass def flatten(l): return flatten(l[0]) +\ (flatten(l[1:]) if len(l) > 1 else []) if type(l) is list else [l] class VotingSystem(objec...
#!/usr/bin/env python3 from abc import abstractmethod, ABCMeta from itertools import combinations class VotingException(Exception): pass class VotingError(Exception): pass def flatten(l): return flatten(l[0]) +\ (flatten(l[1:]) if len(l) > 1 else []) if type(l) is list else [l] class VotingSystem(objec...
mit
Python
d77e6f61d42b6bcb957ff235978790cb90a6d3ee
Rename SCM command; #197
DMOJ/judge,DMOJ/judge,DMOJ/judge
dmoj/executors/SCM.py
dmoj/executors/SCM.py
from .base_executor import CompiledExecutor class Executor(CompiledExecutor): ext = '.scm' name = 'SCM' command = 'chicken-csc' command_paths = ['chicken-csc', 'csc'] syscalls = ['newselect', 'select'] test_program = '(declare (uses extras)) (map print (read-lines))' def get_compile_args(...
from .base_executor import CompiledExecutor class Executor(CompiledExecutor): ext = '.scm' name = 'SCM' command = 'chicken-csc' command_paths = ['chicken-csc', 'csc'] syscalls = ['newselect', 'select'] test_program = '(declare (uses extras)) (map print (read-lines))' def get_compile_args(...
agpl-3.0
Python
6367fe885a3ab6704b5eb066dadf98713ccc5d88
Fix relative path to .gitignore and other minor changes.
mwgoldsmith/libilbc,mwgoldsmith/ilbc,TimothyGu/libilbc,mwgoldsmith/ilbc,TimothyGu/libilbc,mwgoldsmith/libilbc,ShiftMediaProject/libilbc,TimothyGu/libilbc,TimothyGu/libilbc,ShiftMediaProject/libilbc,mwgoldsmith/ilbc,TimothyGu/libilbc,mwgoldsmith/libilbc,mwgoldsmith/libilbc,ShiftMediaProject/libilbc,ShiftMediaProject/lib...
webrtc/build/extra_gitignore.py
webrtc/build/extra_gitignore.py
#!/usr/bin/env python # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All c...
#!/usr/bin/env python # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All c...
bsd-3-clause
Python
696c83dc8b40df12ef6ca7f20a8804a8b770f291
add a test for agent_list creation
m-deck/stimulus
tests/test_agent_stuff.py
tests/test_agent_stuff.py
import pytest from .. import stimulus def test_agent_creation(): agent = stimulus.Agent(None) #uses None as schedule assert isinstance(agent.id, int) and agent.status == 'logged_off' and not agent.active_call and agent.handling_call is None and isinstance(agent.schedule, object) def test_agent_schedule_crea...
import pytest from .. import stimulus def test_agent_creation(): agent = stimulus.Agent(None) #uses None as schedule assert isinstance(agent.id, int) and agent.status == 'logged_off' and not agent.active_call and agent.handling_call is None and isinstance(agent.schedule, object) def test_agent_schedule_crea...
mit
Python
23cd8c25ded14ba47c6daa843989a4de27ceacaa
Resolve flake8 lint problems
pawelzny/dotty_dict
tests/test_dotty_cache.py
tests/test_dotty_cache.py
import unittest from unittest.mock import MagicMock from dotty_dict import dotty class TestDottyCache(unittest.TestCase): def test_getitem_cache(self): dot = dotty() dot._data = MagicMock() for _ in range(10): dot.get('x.y.z') self.assertEqual(dot.__getitem__.cache_in...
import unittest from unittest.mock import MagicMock from dotty_dict import dotty class TestDottyCache(unittest.TestCase): def test_getitem_cache(self): dot = dotty() dot._data = MagicMock() for i in range(10): dot.get('x.y.z') self.assertEqual(dot.__getitem__.cache_inf...
mit
Python
2f027bf53f8114467b89f5610701ac577a564c6f
Add querystring awareness to cache_page_per_user
stianjensen/wikipendium.no,stianjensen/wikipendium.no,stianjensen/wikipendium.no
wikipendium/cache/decorators.py
wikipendium/cache/decorators.py
from django.core.cache import caches def _make_cache_key_from_function(fn, *args, **kwargs): return '%s.%s(%s,%s)' % ( fn.__module__, fn.__name__, '(args:%s)' % ','.join(map(str, map(hash, args))), '(kwargs:%s)' % ','.join(map(str, map(hash, kwargs.items()))), ) def cache_pag...
from django.core.cache import caches def _make_cache_key_from_function(fn, *args, **kwargs): return '%s.%s(%s,%s)' % ( fn.__module__, fn.__name__, '(args:%s)' % ','.join(map(str, map(hash, args))), '(kwargs:%s)' % ','.join(map(str, map(hash, kwargs.items()))), ) def cache_pag...
apache-2.0
Python
a456d874faaa3d28421aaba00169086f33723cb6
tag v0.6.0
tony/libtmux
libtmux/__about__.py
libtmux/__about__.py
__title__ = 'libtmux' __package_name__ = 'libtmux' __version__ = '0.6.0' __description__ = 'scripting library / orm for tmux' __email__ = 'tony@git-pull.com' __author__ = 'Tony Narlock' __license__ = 'BSD' __copyright__ = 'Copyright 2016 Tony Narlock'
__title__ = 'libtmux' __package_name__ = 'libtmux' __version__ = '0.5.1' __description__ = 'scripting library / orm for tmux' __email__ = 'tony@git-pull.com' __author__ = 'Tony Narlock' __license__ = 'BSD' __copyright__ = 'Copyright 2016 Tony Narlock'
bsd-3-clause
Python
971bfae0d92debe709532aaf5cc5f258ef0c4889
Fix test_factory
Faylixe/seleniumsoup,Faylixe/seleniumsoup
tests/test_pagefactory.py
tests/test_pagefactory.py
#!/usr/bin/python import unittest from seleniumsoup.page import PageFactory url = 'http://faylixe.fr/seleniumsoup/testpage.html' class PageFactoryTests(unittest.TestCase): """ PageFactory class test case. """ def test_factory(self): """ Test case for page factory usage. """ factory = PageFa...
#!/usr/bin/python import unittest from seleniumsoup.page import PageFactory url = 'http://faylixe.fr/seleniumsoup/testpage.html' class PageFactoryTests(unittest.TestCase): """ PageFactory class test case. """ def test_factory(self): """ Test case for page factory usage. """ factory = PageFa...
mit
Python
8ac0bc536cc3d89a3c14216e7f58fbb7458f5dc1
Remove extraneous test code
dbader/pytest-mypy
tests/test_pytest_mypy.py
tests/test_pytest_mypy.py
def test_mypy_success(testdir): testdir.makepyfile(''' def myfunc(x: int) -> int: return x * 2 ''') result = testdir.runpytest_subprocess('--mypy', '-v') assert result.ret == 0 def test_mypy_error(testdir): testdir.makepyfile(''' def myfunc(x: int) -> str: ...
def test_mypy_success(testdir): testdir.makepyfile(''' def myfunc(x: int) -> int: return x * 2 def test_myfunc(): assert myfunc(12) ''') result = testdir.runpytest_subprocess('--mypy', '-v') assert result.ret == 0 def test_mypy_error(testdir): testdir.mak...
mit
Python
f243dcc1d57846085bf9c31a238838e3d4de4ce0
fix nl
aioworkers/aioworkers,aamalev/aioworkers
tests/test_queue_proxy.py
tests/test_queue_proxy.py
import io import os from queue import Queue from aioworkers import utils from aioworkers.core.config import Config from aioworkers.core.context import Context from aioworkers.queue import proxy async def test_q(loop): conf = Config() conf.update({'q.cls': utils.import_uri(proxy.ProxyQueue)}) async with ...
import io import os from queue import Queue from aioworkers import utils from aioworkers.core.config import Config from aioworkers.core.context import Context from aioworkers.queue import proxy async def test_q(loop): conf = Config() conf.update({'q.cls': utils.import_uri(proxy.ProxyQueue)}) async with ...
apache-2.0
Python
adb450c5ddbe645871a362b7d312a30551bb7ed1
include numpy.get_include()
rainwoodman/bigfile,rainwoodman/bigfile,rainwoodman/bigfile
python/setup.py
python/setup.py
from distutils.core import setup from Cython.Build import cythonize from distutils.extension import Extension import numpy extensions = [ Extension("bigfile.pyxbigfile", ["src/pyxbigfile.pyx"], include_dirs = ["../src", numpy.get_include()])] setup( name="bigfile", version="0.1", author="Yu...
from distutils.core import setup from Cython.Build import cythonize from distutils.extension import Extension extensions = [ Extension("bigfile.pyxbigfile", ["src/pyxbigfile.pyx"], include_dirs = ["../src"])] setup( name="bigfile", version="0.1", author="Yu Feng", description="python bi...
bsd-2-clause
Python
dc9f28a1b462a5c48f8062af9abb7134f25acb04
Test Ultrametric.children method
jni/viridis
tests/test_ultrametric.py
tests/test_ultrametric.py
from viridis import tree from six.moves import range import pytest @pytest.fixture def base_tree(): t = tree.Ultrametric(list(range(6))) t.merge(0, 1, 0.1) t.merge(6, 2, 0.2) t.merge(3, 4, 0.3) t.merge(8, 5, 0.4) t.merge(7, 8, 0.5) return t def test_split(base_tree): t = base_tree ...
from viridis import tree from six.moves import range import pytest @pytest.fixture def base_tree(): t = tree.Ultrametric(list(range(6))) t.merge(0, 1, 0.1) t.merge(6, 2, 0.2) t.merge(3, 4, 0.3) t.merge(8, 5, 0.4) t.merge(7, 8, 0.5) return t def test_split(base_tree): t = base_tree ...
mit
Python
5c4d30071c7b72c75a4785f94cd62f978902dbad
Drop a now unused constant
edgedb/edgedb,edgedb/edgedb,edgedb/edgedb
edb/server/defines.py
edb/server/defines.py
# # This source file is part of the EdgeDB open source project. # # Copyright 2016-present MagicStack Inc. and the EdgeDB 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...
# # This source file is part of the EdgeDB open source project. # # Copyright 2016-present MagicStack Inc. and the EdgeDB 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...
apache-2.0
Python
ab1dba52f9be88bc49ec7d83cf6f622b97a2c262
Add admin_ordering to INSTALLED_APPS
feincms/form_designer,feincms/form_designer
tests/testapp/settings.py
tests/testapp/settings.py
import os DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:"}} DEFAULT_AUTO_FIELD = "django.db.models.AutoField" INSTALLED_APPS = [ "django.contrib.auth", "django.contrib.admin", "django.contrib.contenttypes", "django.contrib.sessions", "django.contrib.staticfiles...
import os DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:"}} DEFAULT_AUTO_FIELD = "django.db.models.AutoField" INSTALLED_APPS = [ "django.contrib.auth", "django.contrib.admin", "django.contrib.contenttypes", "django.contrib.sessions", "django.contrib.staticfiles...
bsd-3-clause
Python
58d131e8aceb1adbbcdce2e1d4a86f5fb4615196
Remove the outer test for __name__; not necessary.
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
22afccd29426886f8fc2f85b125444cee73c84ca
Add tests for the custom templates
inventree/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,inventree/InvenTree
InvenTree/part/test_part.py
InvenTree/part/test_part.py
from django.test import TestCase import os from .models import Part from .models import rename_part_image from .templatetags import inventree_extras class TemplateTagTest(TestCase): """ Tests for the custom template tag code """ def test_multiply(self): self.assertEqual(inventree_extras.multiply(3,...
from django.test import TestCase import os from .models import Part from .models import rename_part_image class SimplePartTest(TestCase): """ Tests for the Part model """ fixtures = [ 'category', 'part', 'location', ] def setUp(self): self.R1 = Part.objects.get(name...
mit
Python
66a528b171b433a9cb298fba395180445fe1f3e1
Improve Project Euler problem 014 solution 2 (#4752)
TheAlgorithms/Python
project_euler/problem_014/sol2.py
project_euler/problem_014/sol2.py
""" Problem 14: https://projecteuler.net/problem=14 Collatz conjecture: start with any positive integer n. Next term obtained from the previous term as follows: If the previous term is even, the next term is one half the previous term. If the previous term is odd, the next term is 3 times the previous term plus 1. Th...
""" Problem 14: https://projecteuler.net/problem=14 Collatz conjecture: start with any positive integer n. Next term obtained from the previous term as follows: If the previous term is even, the next term is one half the previous term. If the previous term is odd, the next term is 3 times the previous term plus 1. Th...
mit
Python
965b1ff7dfac4806d61e39dfbbdfb6c5c165c0a7
Improve Project Euler problem 078 solution 1 (#5708)
TheAlgorithms/Python
project_euler/problem_078/sol1.py
project_euler/problem_078/sol1.py
""" Problem 78 Url: https://projecteuler.net/problem=78 Statement: Let p(n) represent the number of different ways in which n coins can be separated into piles. For example, five coins can be separated into piles in exactly seven different ways, so p(5)=7. OOOOO OOOO O OOO OO ...
""" Problem 78 Url: https://projecteuler.net/problem=78 Statement: Let p(n) represent the number of different ways in which n coins can be separated into piles. For example, five coins can be separated into piles in exactly seven different ways, so p(5)=7. OOOOO OOOO O OOO OO ...
mit
Python
03a2b72c2fb85425ed7b61f9fc4c62c9c2e416ef
Fix operational error failure
odarbelaeze/condor-ir,odarbelaeze/lsa-program
condor/dbutil.py
condor/dbutil.py
''' Utils to work with a mongo database, it contains a global connection to the database so that a new one is not created with every request which is a huge overhead. Furthermore it has a tool to use a pymongo collection as a context manager. ''' import click import functools import sys from sqlalchemy import create_...
''' Utils to work with a mongo database, it contains a global connection to the database so that a new one is not created with every request which is a huge overhead. Furthermore it has a tool to use a pymongo collection as a context manager. ''' import click import functools import sys from sqlalchemy import create_...
mit
Python
aa9b70a087610901a88c759ccfa858d30756ca53
make active default to true
thrive-refugee/thrive-refugee,thrive-refugee/thrive-refugee,thrive-refugee/thrive-refugee
esl_manager/models.py
esl_manager/models.py
from django.db import models import datetime # Create your models here. class ESLStudent(models.Model): FirstName = models.CharField("First Name", max_length=50) LastName = models.CharField("Last Name", max_length=80) StreetAddress = models.CharField("Address", max_length=50) City = models.CharField(...
from django.db import models import datetime # Create your models here. class ESLStudent(models.Model): FirstName = models.CharField("First Name", max_length=50) LastName = models.CharField("Last Name", max_length=80) StreetAddress = models.CharField("Address", max_length=50) City = models.CharField(...
mit
Python
04b9d498458da6ff70acb6754b94f74775d801ee
Bump version to v3.9.0
Yelp/kafka-utils,Yelp/kafka-utils
kafka_utils/__init__.py
kafka_utils/__init__.py
# -*- coding: utf-8 -*- # Copyright 2016 Yelp Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
# -*- coding: utf-8 -*- # Copyright 2016 Yelp Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
Python
c55d31c0ab163682bcf5e03476ed6f3655c048e8
Undo changes made to kiva.quartz.__init__.
tommy-u/enable,tommy-u/enable,tommy-u/enable,tommy-u/enable
kiva/quartz/__init__.py
kiva/quartz/__init__.py
# :Author: Robert Kern # :Copyright: 2004, Enthought, Inc. # :License: BSD Style from mac_context import get_mac_context def get_macport(dc): """ Returns the Port or the CGContext of a wxDC (or child class) instance. """ if 'GetCGContext' in dir(dc): ptr = dc.GetCGContext() retur...
# :Author: Robert Kern # :Copyright: 2004, Enthought, Inc. # :License: BSD Style try: from mac_context import get_mac_context except ImportError: get_mac_context = None def get_macport(dc): """ Returns the Port or the CGContext of a wxDC (or child class) instance. """ if 'GetCGContext' i...
bsd-3-clause
Python
147c1f253ba7c9059e555f83a62201d88453d9e0
Bump version
klusta-team/klustaviewa
klustaviewa/__init__.py
klustaviewa/__init__.py
# ----------------------------------------------------------------------------- # Global variables # ----------------------------------------------------------------------------- __version__ = '0.4.5' APPNAME = 'klustaviewa' ABOUT = """KlustaViewa is a software for semi-automatic spike sorting with high-channel coun...
# ----------------------------------------------------------------------------- # Global variables # ----------------------------------------------------------------------------- __version__ = '0.4.4' APPNAME = 'klustaviewa' ABOUT = """KlustaViewa is a software for semi-automatic spike sorting with high-channel coun...
bsd-3-clause
Python
899890dd864b2789ff69af9d6c70ba174f41ada8
work around base class change to avoid error upon addons path insertion
akretion/l10n-brazil,OCA/l10n-brazil,OCA/l10n-brazil,OCA/l10n-brazil,akretion/l10n-brazil,akretion/l10n-brazil
l10n_br_crm/crm_lead.py
l10n_br_crm/crm_lead.py
# -*- encoding: utf-8 -*- ############################################################################### # # # Copyright (C) 2012 Renato Lima - Akretion # # ...
# -*- encoding: utf-8 -*- ############################################################################### # # # Copyright (C) 2012 Renato Lima - Akretion # # ...
agpl-3.0
Python
ce4cf1cc6c0f8e1fec1b8af597c4daf7ce531503
fix 2 bugs in curse words
ucarion/git-code-debt,ucarion/git-code-debt,ucarion/git-code-debt,Yelp/git-code-debt,Yelp/git-code-debt,Yelp/git-code-debt,Yelp/git-code-debt
git_code_debt/metrics/curse.py
git_code_debt/metrics/curse.py
import collections import os from git_code_debt.diff_parser_base import DiffParserBase from git_code_debt.metric import Metric from git_code_debt.metrics.common import FILE_TYPE_MAP from git_code_debt_util.path import split_file_path path = os.path.join(os.path.dirname(__file__), 'single_curse_words.txt') curse_word...
import collections import os from git_code_debt.diff_parser_base import DiffParserBase from git_code_debt.metric import Metric from git_code_debt.metrics.common import FILE_TYPE_MAP from git_code_debt_util.path import split_file_path path = os.path.join(os.path.dirname(__file__), 'single_curse_words.txt') curse_word...
mit
Python
998099aa9e2cf9baafb7ee58169cca60868994cc
Update error pattern
briancurtin/rpc-maas,miguelgrinberg/rpc-openstack,byronmccollum/rpc-openstack,shannonmitchell/rpc-openstack,major/rpc-openstack,npawelek/rpc-maas,jpmontez/rpc-openstack,claco/rpc-openstack,nrb/rpc-openstack,sigmavirus24/rpc-openstack,byronmccollum/rpc-openstack,andymcc/rpc-openstack,byronmccollum/rpc-openstack,BjoernT/...
glance_registry_local_check.py
glance_registry_local_check.py
#!/usr/bin/env python from maas_common import (status_ok, status_err, metric, get_keystone_client, get_auth_ref) from requests import Session from requests import exceptions as exc def check(auth_ref): keystone = get_keystone_client(auth_ref) tenant_id = keystone.tenant_id auth_t...
#!/usr/bin/env python from maas_common import (status_ok, status_err, metric, get_keystone_client, get_auth_ref) from requests import Session from requests import exceptions as exc def check(auth_ref): keystone = get_keystone_client(auth_ref) tenant_id = keystone.tenant_id auth_t...
apache-2.0
Python
7048a32a1ed087bb5d0c8e546bfd97e0e762877b
Add addConfig method
ollien/PyConfigManager
configmanager.py
configmanager.py
import json import os import os.path class ConfigManager(): def __init__(self, configPath = "configs/"): if os.path.isdir(configPath): self.configPath = configPath else: raise IOError("Config Path does not eixst") self.configs = {} self.getConfigs() #Recursive function to get all files. Sub is the rel...
import json import os import os.path class ConfigManager(): def __init__(self, configPath = "configs/"): if os.path.isdir(configPath): self.configPath = configPath else: raise IOError("Config Path does not eixst") self.configs = {} self.getConfigs() #Recursive function to get all files. Sub is the rel...
mit
Python
21d34f99c2da434f73669b09068f090af5a6f530
Test Commint; please ignore
MSU-CS-Software-Engineering/habitgame,MSU-CS-Software-Engineering/habitgame
conflict_test.py
conflict_test.py
"""The point of this exercise is to create a merging conflict. Accomplish this by deleting the line containing the if statement above your name. Only modify the one if statement with your name""" ## BEFORE ## if("name"): ## print "name" ## ## AFTER ## print "name" def print_name(): if("Timothy"): ...
"""The point of this exercise is to create a merging conflict. Accomplish this by deleting the line containing the if statement above your name. Only modify the one if statement with your name""" ## BEFORE ## if("name"): ## print "name" ## ## AFTER ## print "name" def print_name(): if("Timothy"): ...
mit
Python
c92a5209563747756181f84a5f83e610646d04dc
Update breadth_first_search.py (#1869)
TheAlgorithms/Python
graphs/breadth_first_search.py
graphs/breadth_first_search.py
#!/usr/bin/python """ Author: OMKAR PATHAK """ class Graph: def __init__(self): self.vertices = {} def printGraph(self): """prints adjacency list representation of graaph""" for i in self.vertices.keys(): print(i, " : ", " -> ".join([str(j) for j in self.vertices[i]])) ...
#!/usr/bin/python """ Author: OMKAR PATHAK """ class Graph: def __init__(self): self.vertex = {} # for printing the Graph vertices def printGraph(self): for i in self.vertex.keys(): print(i, " -> ", " -> ".join([str(j) for j in self.vertex[i]])) # for adding the edge bet...
mit
Python
2b58318ad7134a8c894b70918520a89b51a2d6dd
Modify s3 connection test for new AWS_S3_HOST setting
ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend
cla_backend/apps/reports/tests/test_utils.py
cla_backend/apps/reports/tests/test_utils.py
import mock import os from boto.s3.connection import S3Connection from django.test import TestCase, override_settings from reports.utils import get_s3_connection class UtilsTestCase(TestCase): @override_settings(AWS_ACCESS_KEY_ID="000000000001", AWS_SECRET_ACCESS_KEY="000000000002", AWS_S3_HOST="s3.eu-west-2.ama...
import mock import os from boto.s3.connection import S3Connection from django.test import TestCase, override_settings from reports.utils import get_s3_connection class UtilsTestCase(TestCase): @override_settings(AWS_ACCESS_KEY_ID="000000000001", AWS_SECRET_ACCESS_KEY="000000000002") def test_get_s3_connectio...
mit
Python
b1d04bfa42d72d61425441cf74a9266669ba3034
test socket with gevent
chenset/pyFetch,chenset/pyFetch,chenset/pyFetch
service.py
service.py
# coding=utf-8 import gevent import time import math from gevent import socket def server(port): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.bind(('0.0.0.0', port)) sock.listen(256) while True: cli, addr = sock.accept() gevent.spawn(handle_request, cli) def handle_r...
# coding=utf-8 import gevent import time import math from gevent import socket def server(port): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.settimeout(10) sock.bind(('0.0.0.0', port)) sock.listen(256) while True: cli, addr = sock.accept() gevent.spawn(handle_requ...
apache-2.0
Python
0f5c92f81789b0257bf3b264b3b8f778a22ec8bf
Bump version
alphagov/notifications-utils
notifications_utils/version.py
notifications_utils/version.py
__version__ = '25.2.0'
__version__ = '25.1.0'
mit
Python
5557602d40253fba6505fa6a499a083d90766e64
Fix non-ASCII character in comment
rpp0/python-loranode
loranode/commands.py
loranode/commands.py
# This command resets the module's configuration data and user EEPPROM to # factory default values and restarts the module. After factoryRESET, the # RN2483 module will automatically reset and all configuration parameters are # restored to factory default values. CMD_FACTORY_RESET = "sys factoryRESET" CMD_RESET = "sys...
# This command resets the module’s configuration data and user EEPPROM to # factory # default values and restarts the module. After factoryRESET, the # RN2483 module will automatically reset and all configuration parameters are # restored to factory default values. CMD_FACTORY_RESET = "sys factoryRESET" CMD_RESET = "s...
bsd-3-clause
Python
3bf1f414a1e62d5612e694c46c0c66865c5698a3
check invalid ranges while matching id
pureqml/qmlcore,pureqml/qmlcore,pureqml/qmlcore
compiler/code.py
compiler/code.py
import re def scan(text): str_context = False escape = False c_comment = False cpp_comment = False begin = 0 invalid = [] for i in xrange(0, len(text)): c = text[i] if escape: escape = False continue if cpp_comment: if c == "\n": cpp_comment = False end = i invalid.append((begin, end...
import re def scan(text): str_context = False escape = False c_comment = False cpp_comment = False begin = 0 invalid = [] for i in xrange(0, len(text)): c = text[i] if escape: escape = False continue if cpp_comment: if c == "\n": cpp_comment = False end = i invalid.append((begin, end...
mit
Python
da4e4c174923b1c3664c674ca59370b719cdc8fe
Bump version
DandyDev/slack-machine
machine/__about__.py
machine/__about__.py
__all__ = [ '__title__', '__description__', '__uri__', '__version__', '__author__', '__email__', '__license__', '__copyright__' ] __title__ = "slack-machine" __description__ = "A sexy, simple, yet powerful and extendable Slack bot" __uri__ = "https://github.com/DandyDev/slack-machine" __version_info__ = (0, 9...
__all__ = [ '__title__', '__description__', '__uri__', '__version__', '__author__', '__email__', '__license__', '__copyright__' ] __title__ = "slack-machine" __description__ = "A sexy, simple, yet powerful and extendable Slack bot" __uri__ = "https://github.com/DandyDev/slack-machine" __version_info__ = (0, 8...
mit
Python
42798a81780c47fea470d0dc66a55c0a70ca24f3
Add pkg_resources.
heavenshell/py-mackerel-client
mackerel/__init__.py
mackerel/__init__.py
__import__('pkg_resources').declare_namespace(__name__)
bsd-3-clause
Python
b0fc1e728403ac7cb91fe2ec54dc8763f3dd6765
Update temp_chart.py
webbhm/OpenAg_MVP_UI,webbhm/OpenAg_MVP_UI,webbhm/OpenAg_MVP_UI
MVP_UI/python/temp_chart.py
MVP_UI/python/temp_chart.py
import pygal import requests import json #Use a view in CouchDB to get the data #use the first key for attribute type #order descending so when limit the results will get the latest at the top r = requests.get('http://127.0.0.1:5984/mvp_sensor_data/_design/doc/_view/attribute_value?startkey=["temperature",{}]&endkey=[...
import pygal import requests import json #Use a view in CouchDB to get the data #use the first key for attribute type #order descending so when limit the results will get the latest at the top r = requests.get('http://127.0.0.1:5984/mvp_sensor_data/_design/doc/_view/attribute_value?startkey=["temperature",{}]&endkey=[...
mit
Python
43f34fa45f16e66325dfa0b9609700809ab096a9
update trainner.py
Catherine-Chu/DeepQA,Catherine-Chu/DeepQA,Catherine-Chu/DeepQA,Catherine-Chu/DeepQA
chatbot/trainner.py
chatbot/trainner.py
#!/usr/bin/env python3 # Copyright 2015 Conchylicultor. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
#!/usr/bin/env python3 # Copyright 2015 Conchylicultor. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
apache-2.0
Python
dfd9d6c010083893814cfbc9cc4953ac8f785ecf
Change version number for release
materials-data-facility/forge
forge/setup.py
forge/setup.py
from setuptools import setup setup( name='mdf_forge', version='0.4.1', packages=['mdf_forge'], description='Materials Data Facility python package', long_description="Forge is the Materials Data Facility Python package to interface and leverage the MDF Data Discovery service. Forge allows users to ...
from setuptools import setup setup( name='mdf_forge', version='0.5.0', packages=['mdf_forge'], description='Materials Data Facility python package', long_description="Forge is the Materials Data Facility Python package to interface and leverage the MDF Data Discovery service. Forge allows users to ...
apache-2.0
Python