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
78f96421598a561285b9cd5568fd4acabd52585f
Add embed site freeze generator
Opendatal/offenerhaushalt.de,Opendatal/offenerhaushalt.de,Opendatal/offenerhaushalt.de
offenerhaushalt/generators.py
offenerhaushalt/generators.py
from offenerhaushalt.core import freezer, pages, sites @freezer.register_generator def page(): for page in pages: yield {'path': page.path} @freezer.register_generator def site(): for site in sites: yield {'slug': site.slug} @freezer.register_generator def embed_site(): for site in sit...
from offenerhaushalt.core import freezer, pages, sites @freezer.register_generator def page(): for page in pages: yield {'path': page.path} @freezer.register_generator def site(): for site in sites: yield {'slug': site.slug}
mit
Python
9fda25c0a28f7965c2378dcd4b2106ca034052c3
Handle missing accounts on HaveIBeenPwned properly.
sk89q/Plumeria,sk89q/Plumeria,sk89q/Plumeria
plumeria/plugins/have_i_been_pwned.py
plumeria/plugins/have_i_been_pwned.py
import plumeria.util.http as http from plumeria import config from plumeria.command import commands, CommandError from plumeria.command.parse import Text from plumeria.message.mappings import build_mapping from plumeria.util.collections import SafeStructure from plumeria.util.ratelimit import rate_limit @commands.reg...
import plumeria.util.http as http from plumeria import config from plumeria.command import commands, CommandError from plumeria.command.parse import Text from plumeria.message.mappings import build_mapping from plumeria.util.collections import SafeStructure from plumeria.util.ratelimit import rate_limit @commands.reg...
mit
Python
3f995558f35ec6ce28320c4d1ffda5a4f8507fd6
Fix broken super call
richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation
groundstation/peer_socket.py
groundstation/peer_socket.py
from sockets.socket_closed_exception import SocketClosedException from sockets.stream_socket import StreamSocket from groundstation import settings import groundstation.logger log = groundstation.logger.getLogger(__name__) class PeerSocket(StreamSocket): """Wrapper for a peer who just connected, or one we've con...
from sockets.socket_closed_exception import SocketClosedException from sockets.stream_socket import StreamSocket from groundstation import settings import groundstation.logger log = groundstation.logger.getLogger(__name__) class PeerSocket(StreamSocket): """Wrapper for a peer who just connected, or one we've con...
mit
Python
cc51137aedeee8bdcf6b47e98b195ec750183ab4
Allow plain values, not just methods
carlmjohnson/django-context-variables
context_variables/__init__.py
context_variables/__init__.py
class context_variable(object): def __init__(self, func): self.func = func self.__doc__ = func.__doc__ def __get__(self, obj, objtype=None): # Handle case of being called from class instead of an instance if obj is None: return self # If we got a plain value...
class context_variable(object): def __init__(self, func): self.func = func self.__doc__ = func.__doc__ def __get__(self, obj, objtype=None): # Handle case of being called from class instead of an instance if obj is None: return self # Evaluate the property ...
mit
Python
11218089bd2739b26e6b22cbb54117e27cba76ac
Fix flake error
django/channels,Coread/channels,linuxlewis/channels,andrewgodwin/django-channels,raiderrobert/channels,andrewgodwin/channels,Coread/channels,raphael-boucher/channels,Krukov/channels,Krukov/channels
channels/apps.py
channels/apps.py
from django.apps import AppConfig from django.core.exceptions import ImproperlyConfigured class ChannelsConfig(AppConfig): name = "channels" verbose_name = "Channels" def ready(self): # Check you're not running 1.10 or above try: from django import channels # NOQA isort:skip...
from django.apps import AppConfig from django.core.exceptions import ImproperlyConfigured class ChannelsConfig(AppConfig): name = "channels" verbose_name = "Channels" def ready(self): # Check you're not running 1.10 or above try: from django import channels except Imp...
bsd-3-clause
Python
ca7bc952727e23b742570aab8bcad3be97ac6739
fix typo
EUMSSI/EUMSSI-platform,EUMSSI/EUMSSI-platform,EUMSSI/EUMSSI-platform
preprocess/video_persons2extracted.py
preprocess/video_persons2extracted.py
#!/usr/bin/env python from extract_converter import ExtractConverter import click def convert(x): meta = { #meta['all'] = [w['item'] for w in x['result']['content']] 'amalia': x['result']['Amalia_Json'] } available_data = ['video_persons'] return meta, available_data @click.command(...
#!/usr/bin/env python from extract_converter import ExtractConverter import click def convert(x): meta = { #meta['all'] = [w['item'] for w in x['result']['content']] 'amalia': x['result']['Amalia_Json']) } available_data = ['video_persons'] return meta, available_data @click.command...
apache-2.0
Python
992b999e4511ef1445c14e2147147a595e51a94d
Add -usehd to excluded args in check-doc.py
chaincoin/chaincoin,chaincoin/chaincoin,chaincoin/chaincoin,chaincoin/chaincoin,chaincoin/chaincoin,chaincoin/chaincoin
contrib/devtools/check-doc.py
contrib/devtools/check-doc.py
#!/usr/bin/env python # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' This checks if all command line args are documented. Return value is 0 to indicate no error. Author: ...
#!/usr/bin/env python # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' This checks if all command line args are documented. Return value is 0 to indicate no error. Author: ...
mit
Python
3557e471e158d668b7834cfc1c2e3dae438cb4cd
Add client macs obscure option handling
FreiFunkMuenster/ffmap-backend,ffac/ffmap-backend,FreifunkBremen/ffmap-backend,ff-kbu/ffmap-backend,FreiFunkMuenster/ffmap-backend,mweinelt/ffmap-backend,FreifunkBremen/ffmap-backend,ffnord/ffmap-backend,FreifunkMD/ffmap-backend,freifunkhamburg/ffmap-backend,FreifunkJena/ffmap-backend,freifunk-fulda/ffmap-backend,kpcyr...
bat2nodes.py
bat2nodes.py
#!/usr/bin/env python3 import json import fileinput import argparse import os from batman import batman from rrd import rrd from nodedb import NodeDB from d3mapbuilder import D3MapBuilder # Force encoding to UTF-8 import locale # Ensures that subsequent open()s locale.getpreferredenc...
#!/usr/bin/env python3 import json import fileinput import argparse import os from batman import batman from rrd import rrd from nodedb import NodeDB from d3mapbuilder import D3MapBuilder # Force encoding to UTF-8 import locale # Ensures that subsequent open()s locale.getpreferredenc...
bsd-3-clause
Python
c6e52e781b0739ab63a3f4c5e49741cd690ddf95
fix problem with un-escaped backslashes in string
StratusLab/client,StratusLab/client,StratusLab/client,StratusLab/client
cli/user/src/main/scripts/create-windows-stubs.py
cli/user/src/main/scripts/create-windows-stubs.py
#!/usr/bin/env python import os import stat import glob import StringIO input_path='main/python/' output_path='target/windows/' stub="""@echo off python %~dp0..\\bin\\%~n0 %* """ def process_file(file): output_basename = os.path.basename(file) output_name = output_basename + ".bat" output_file = os.pat...
#!/usr/bin/env python import os import stat import glob import StringIO input_path='main/python/' output_path='target/windows/' stub='''@echo off python %~dp0..\bin\%~n0 %* ''' def process_file(file): output_basename = os.path.basename(file) output_name = output_basename + ".bat" output_file = os.path....
apache-2.0
Python
717ca3e94106ebe00aa8876267d98cddc1c390b5
fix coveralls
MySmile/sfchat,MySmile/sfchat,MySmile/sfchat,MySmile/sfchat
config/local.py
config/local.py
# -*- coding: utf-8 -*- # secret settings import os from mongoengine import connect, register_connection from sfchat.settings.base import BASE_DIR DEBUG = True COMPRESS_ENABLED = False DEBUG_TOOLBAR_PATCH_SETTINGS = False # @NOTE: if True then enable 'debug_toolbar.middleware.DebugToolbarMiddleware' also TEMPLAT...
# -*- coding: utf-8 -*- # secret settings import os from mongoengine import connect, register_connection from sfchat.settings.base import BASE_DIR DEBUG = True COMPRESS_ENABLED = False DEBUG_TOOLBAR_PATCH_SETTINGS = False # @NOTE: if True then enable 'debug_toolbar.middleware.DebugToolbarMiddleware' also TEMPLAT...
bsd-3-clause
Python
2ebbacc70940f0c176a9f378571e2e904bb02c44
decrease image in causes serializer
OpenVolunteeringPlatform/django-ovp-core,OpenVolunteeringPlatform/django-ovp-core
ovp_core/serializers/cause.py
ovp_core/serializers/cause.py
from ovp_core import models from ovp_core import validators from rest_framework import serializers class CauseSerializer(serializers.ModelSerializer): class Meta: fields = ['id', 'name'] model = models.Cause class CauseAssociationSerializer(serializers.ModelSerializer): id = serializers.IntegerField() name =...
from ovp_core import models from ovp_core import validators from rest_framework import serializers from ovp_uploads.serializers import UploadedImageSerializer class CauseSerializer(serializers.ModelSerializer): image = UploadedImageSerializer() class Meta: fields = ['id', 'name', 'image'] model = models.Cause c...
agpl-3.0
Python
546d16a0b30ca1738390d2e7a9e9d8e104a49140
Bump version to 0.3.0 (#706)
quantumlib/Cirq,quantumlib/Cirq,balopat/Cirq,balopat/Cirq,quantumlib/Cirq,balopat/Cirq,quantumlib/Cirq,quantumlib/Cirq
cirq/_version.py
cirq/_version.py
# Copyright 2018 The Cirq Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
# Copyright 2018 The Cirq Developers # # 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 ...
apache-2.0
Python
96db4f0f42058ba9a8917fd4e9a3d8174f91cbd3
Update licensing info on version file
StackStorm/mistral,StackStorm/mistral
version_st2.py
version_st2.py
# Copyright 2016 - StackStorm, 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 ...
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use t...
apache-2.0
Python
25b92ff94875afd3ab84e99773c025d8860ff4e9
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
9653f3d4d3bd859d592542fc011ad7b81a866052
Make the widget experimental error a real python warning
jupyter-widgets/ipywidgets,cornhundred/ipywidgets,cornhundred/ipywidgets,SylvainCorlay/ipywidgets,cornhundred/ipywidgets,jupyter-widgets/ipywidgets,ipython/ipywidgets,jupyter-widgets/ipywidgets,ipython/ipywidgets,jupyter-widgets/ipywidgets,cornhundred/ipywidgets,cornhundred/ipywidgets,SylvainCorlay/ipywidgets,ipython/i...
IPython/html/widgets/__init__.py
IPython/html/widgets/__init__.py
from .widget import Widget, DOMWidget, CallbackDispatcher, register from .widget_bool import Checkbox, ToggleButton from .widget_button import Button from .widget_box import Box, Popup, FlexBox, HBox, VBox from .widget_float import FloatText, BoundedFloatText, FloatSlider, FloatProgress, FloatRangeSlider from .widget_...
from .widget import Widget, DOMWidget, CallbackDispatcher, register from .widget_bool import Checkbox, ToggleButton from .widget_button import Button from .widget_box import Box, Popup, FlexBox, HBox, VBox from .widget_float import FloatText, BoundedFloatText, FloatSlider, FloatProgress, FloatRangeSlider from .widget_...
bsd-3-clause
Python
a9bf46545502afb9991f7ffd65406797b79d1716
Correct murano-agent reference to message headers
telefonicaid/murano-agent,Bloomie/murano-agent,Bloomie/murano-agent,openstack/murano-agent,Bloomie/murano-agent,telefonicaid/murano-agent,openstack/murano-agent,telefonicaid/murano-agent,openstack/murano-agent,openstack/murano-agent,Bloomie/murano-agent
python-agent/muranoagent/common/messaging/message.py
python-agent/muranoagent/common/messaging/message.py
# Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
# Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
Python
58b34507553a5956b99b0cb2844a4e274eda9cb4
Resolve merge conflict in output_filters.py
corinnelhh/chatbot,corinnelhh/chatbot
output_filters.py
output_filters.py
import nltk from nltk import pos_tag from nltk.tokenize import wordpunct_tokenize funct_dict = {} def add_func_to_dict(func): funct_dict[func.__name__] = func return func @add_func_to_dict def filter_length(sentences, wordcount=13): """Takes in a list of sentences and returns a reduced list, that ...
import nltk from nltk import pos_tag from nltk.tokenize import wordpunct_tokenize def filter_length(sentences, wordcount=13): """Takes in a list of sentences and returns a reduced list, that contains only sentences with less than <wordcount> words.""" for sentence in sentences[:]: if len(sentenc...
mit
Python
52c01db2efaf3c124695bb182938cf146d02d34c
make tests compaitble with python 2.6
jumpstarter-io/ceph-deploy,jumpstarter-io/ceph-deploy,Vicente-Cheng/ceph-deploy,branto1/ceph-deploy,rtulke/ceph-deploy,Vicente-Cheng/ceph-deploy,shenhequnying/ceph-deploy,ghxandsky/ceph-deploy,alfredodeza/ceph-deploy,ceph/ceph-deploy,shenhequnying/ceph-deploy,osynge/ceph-deploy,imzhulei/ceph-deploy,isyippee/ceph-deploy...
ceph_deploy/tests/test_cli.py
ceph_deploy/tests/test_cli.py
import pytest import subprocess def test_help(tmpdir, cli): with cli( args=['ceph-deploy', '--help'], stdout=subprocess.PIPE, ) as p: result = p.stdout.read() assert 'usage: ceph-deploy' in result assert 'Deploy Ceph' in result assert 'optional arguments:' i...
import pytest import subprocess def test_help(tmpdir, cli): with cli( args=['ceph-deploy', '--help'], stdout=subprocess.PIPE, ) as p: result = p.stdout.read() assert 'usage: ceph-deploy' in result assert 'Deploy Ceph' in result assert 'optional arguments:' i...
mit
Python
9b95c126faa93814011b49228d942e0244d546e6
Use UTF8 encoding
lonewolf07/coala,Uran198/coala,svsn2117/coala,Nosferatul/coala,sophiavanvalkenburg/coala,jayvdb/coala,CruiseDevice/coala,arafsheikh/coala,lonewolf07/coala,MariosPanag/coala,Balaji2198/coala,yashLadha/coala,kartikeys98/coala,yland/coala,Asalle/coala,rimacone/testing2,tltuan/coala,NalinG/coala,sophiavanvalkenburg/coala,M...
coalib/results/result_actions/OpenEditorAction.py
coalib/results/result_actions/OpenEditorAction.py
import subprocess from coalib.results.Diff import Diff from coalib.results.Result import Result from coalib.results.result_actions.ApplyPatchAction import ApplyPatchAction EDITOR_ARGS = { "subl": "--wait", "gedit": "-s", "atom": "--wait" } GUI_EDITORS = ["kate", "gedit", "subl", "atom"] class OpenEdit...
import subprocess from coalib.results.Diff import Diff from coalib.results.Result import Result from coalib.results.result_actions.ApplyPatchAction import ApplyPatchAction EDITOR_ARGS = { "subl": "--wait", "gedit": "-s", "atom": "--wait" } GUI_EDITORS = ["kate", "gedit", "subl", "atom"] class OpenEdit...
agpl-3.0
Python
33bc8b39b1ce307536a63b98629fc2241b0fd29f
add error message when asserting False
freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut
tests/twisted/avahi/test-disabled-1-1-tubes.py
tests/twisted/avahi/test-disabled-1-1-tubes.py
""" Test if 1-1 tubes support is properly disabled. This test should be removed as soon as we re-enable 1-1 tubes support. """ from saluttest import exec_test from avahitest import AvahiAnnouncer, AvahiListener from avahitest import get_host_name import avahi import dbus import os import errno import string from xmpps...
""" Test if 1-1 tubes support is properly disabled. This test should be removed as soon as we re-enable 1-1 tubes support. """ from saluttest import exec_test from avahitest import AvahiAnnouncer, AvahiListener from avahitest import get_host_name import avahi import dbus import os import errno import string from xmpps...
lgpl-2.1
Python
8fcb7205dbf36709e27d89734ff33a8cdc9b6968
Fix docker_events field handling
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
salt/engines/docker_events.py
salt/engines/docker_events.py
# -*- coding: utf-8 -*- ''' Send events from Docker events :Depends: Docker API >= 1.22 ''' # Import Python Libs from __future__ import absolute_import import json import logging import traceback import salt.utils # pylint: disable=import-error try: import docker import docker.utils HAS_DOCKER_PY = Tr...
# -*- coding: utf-8 -*- ''' Send events from Docker events :Depends: Docker API >= 1.22 ''' # Import Python Libs from __future__ import absolute_import import json import logging import traceback import salt.utils # pylint: disable=import-error try: import docker import docker.utils HAS_DOCKER_PY = Tr...
apache-2.0
Python
37215ba859e393b11187f6a98cb0fd89f4fbbaf4
Simplify one more tests.
Neki/searchengine
searchengine/tests/evaluation/test_evaluation.py
searchengine/tests/evaluation/test_evaluation.py
import unittest from unittest import TestCase from searchengine.evaluation.evaluation import * from searchengine.search.vectorial_search import vectorial_search from searchengine.parser import CacmDocument from searchengine.index.process import Weighting class TestEvaluation(TestCase): def test_number_of_relevant...
import unittest from unittest import TestCase from searchengine.evaluation.evaluation import * from searchengine.search.vectorial_search import vectorial_search from searchengine.parser import CacmDocument from searchengine.index.process import Weighting class TestEvaluation(TestCase): def test_number_of_relevant...
mit
Python
cdcf6899522f3d768c80684b1f43366513b4a301
fix version in __init__
bassio/omicexperiment
omicexperiment/__init__.py
omicexperiment/__init__.py
__version__ = '0.1.2-dev1'
<<<<<<< HEAD __version__ = '0.01-dev' ======= __version__ = '0.1.2-dev1' >>>>>>> 0d1b27e06abfcfcec83d67ebc5842b2954537620
bsd-3-clause
Python
f7b8112764a66dbfb394a2584fef354c248de60a
add iphone sim detection macros
bittorrent/needy,vmrob/needy,ccbrown/needy,bittorrent/needy,ccbrown/needy,vmrob/needy
needy/platforms/iphonesim.py
needy/platforms/iphonesim.py
from ..platform import Platform import platform DEFAULT_MIN_IOS_VERSION = '5.0' class iPhoneSimulatorPlatform(Platform): def __init__(self, parameters): Platform.__init__(self, parameters) self.__minimum_version = parameters.minimum_ios_version if 'minimum_ios_version' in parameters else DEFAULT...
from ..platform import Platform import platform DEFAULT_MIN_IOS_VERSION = '5.0' class iPhoneSimulatorPlatform(Platform): def __init__(self, parameters): Platform.__init__(self, parameters) self.__minimum_version = parameters.minimum_ios_version if 'minimum_ios_version' in parameters else DEFAULT...
mit
Python
3a3ab4b7410cb9f491b56d785236832b94e6936b
Add tests for Mocking.HistoryItem.
vishwaprakashmishra/xmatrix,vishwaprakashmishra/xmatrix,harrissoerja/vumi,harrissoerja/vumi,vishwaprakashmishra/xmatrix,harrissoerja/vumi,TouK/vumi,TouK/vumi,TouK/vumi
vumi/tests/test_testutils.py
vumi/tests/test_testutils.py
from twisted.trial.unittest import TestCase from vumi.service import Worker from vumi.tests.utils import get_stubbed_worker, Mocking from vumi.tests.fake_amqp import FakeAMQClient class ToyWorker(Worker): def poke(self): return "poke" class MockingHistoryItemTestCase(TestCase): def test_basic_item(...
from twisted.trial.unittest import TestCase from vumi.service import Worker from vumi.tests.utils import get_stubbed_worker from vumi.tests.fake_amqp import FakeAMQClient class ToyWorker(Worker): def poke(self): return "poke" class UtilsTestCase(TestCase): def test_get_stubbed_worker(self): ...
bsd-3-clause
Python
f1ee5b9b6f5b173895b19fd16b635a570927605d
Use shell=True for windows npm installation of gauge
kashishm/gauge-python,kashishm/gauge-python
check_and_install_getgauge.py
check_and_install_getgauge.py
import sys import json import pkg_resources from subprocess import check_output def get_version(): out = check_output(["gauge", "-v", "--machine-readable"],shell=True) data = json.loads(str(out.decode())) for plugin in data['plugins']: if plugin['name'] == 'python': return plugin['vers...
import sys import json import pkg_resources from subprocess import check_output def get_version(): out = check_output(["gauge", "-v", "--machine-readable"]) data = json.loads(str(out.decode())) for plugin in data['plugins']: if plugin['name'] == 'python': return plugin['version'] r...
mit
Python
8e275405af5c79f80dbb9870fef1349ad20e619f
Fix missing imports.
salopensource/sal,sheagcraig/sal,sheagcraig/sal,salopensource/sal,sheagcraig/sal,salopensource/sal,salopensource/sal,sheagcraig/sal
server/management/commands/server_maintenance.py
server/management/commands/server_maintenance.py
"""Cleans up plugin script submissions and update histories that exceed the retention limit""" import datetime import gc from time import sleep from django.core.management.base import BaseCommand from django.conf import settings from django.db.models import Q import django.utils.timezone import server.utils from se...
"""Cleans up plugin script submissions and update histories that exceed the retention limit""" import datetime import gc from time import sleep from django.core.management.base import BaseCommand from django.conf import settings from django.db.models import Q import django.utils.timezone import server.utils from se...
apache-2.0
Python
15a0293c45d8b799235b690bd9c4570f388bd4a7
Fix some abiguities
qasim/cobalt,cobalt-uoft/cobalt,cobalt-io/cobalt,ivanzhangio/cobalt,kshvmdn/cobalt,cobalt-io/cobalt
web-scraper/course_finder.py
web-scraper/course_finder.py
import requests import http.cookiejar import time class CourseFinder: """A wrapper for utilizing UofT's Course Finder web service.""" def __init__(self): self.host = 'http://coursefinder.utoronto.ca' def search(self, query='', requirements=''): """Perform a search and return the data as ...
import requests import http.cookiejar import time class CourseFinder: """A wrapper for utilizing UofT's Course Finder web service.""" def __init__(self): self.host = 'http://coursefinder.utoronto.ca' def search(self, query='', requirements=''): """Perform a UofT Course Finder search and ...
mit
Python
267226978395e30ad9e5e30acb25eb569a67b6b1
Delete print statements from emailer
ViderumGlobal/ckanext-orgportals,ViderumGlobal/ckanext-orgportals,ViderumGlobal/ckanext-orgportals,ViderumGlobal/ckanext-orgportals
ckanext/orgportals/emailer.py
ckanext/orgportals/emailer.py
import logging import smtplib from socket import error as socket_error from email.mime.text import MIMEText from pylons import config log = logging.getLogger(__name__) FROM = config.get('ckanext.orgportals.smtp.mail.from', 'usedata@montroseint.com') SMTP_SERVER = config.get('ckanext.orgportals.smtp.server', 'localh...
import logging import smtplib from socket import error as socket_error from email.mime.text import MIMEText from pylons import config log = logging.getLogger(__name__) FROM = config.get('ckanext.orgportals.smtp.mail.from', 'usedata@montroseint.com') SMTP_SERVER = config.get('ckanext.orgportals.smtp.server', 'localh...
agpl-3.0
Python
468d964fda4da65f24bc25812987ee0b831ae140
add include/exclude flags to validate task. Closes #38
cathydeng/openelections-core,openelections/openelections-core,datamade/openelections-core,cathydeng/openelections-core,openelections/openelections-core,datamade/openelections-core
openelex/tasks/validate.py
openelex/tasks/validate.py
import os import sys from collections import OrderedDict from invoke import task from .utils import load_module, split_args @task(help={ 'state':'Two-letter state-abbreviation, e.g. NY', }) def list(state): """ Show available validations for state. """ state_mod = load_module(state, ['validate'...
import os import sys from invoke import task from .utils import load_module @task(help={ 'state':'Two-letter state-abbreviation, e.g. NY', }) def list(state): state_mod = load_module(state, ['validate']) print "\nAvailable validators:\n" for name in dir(state_mod.validate): if name.startswit...
mit
Python
84855334bf0a07d8b0d9e9023c980c88a52e2e65
fix for django<1.6
allink/allink-frontend-editor,allink/allink-frontend-editor
allink_frontend_editor/page_extensions/snippets.py
allink_frontend_editor/page_extensions/snippets.py
from __future__ import absolute_import, unicode_literals from functools import update_wrapper from django.contrib.admin.util import unquote from django.http import HttpResponse from django.shortcuts import render from feincms import extensions from ..fields import JSONField from ..forms import SnippetForm class E...
from __future__ import absolute_import, unicode_literals from functools import update_wrapper from django.contrib.admin.util import unquote from django.http import HttpResponse from django.shortcuts import render from feincms import extensions from ..fields import JSONField from ..forms import SnippetForm class E...
bsd-3-clause
Python
54a16964d412f4c7d1c64c482e99122406ed1328
Test colissimo id lengths, and raise some errors
willprice/weboob,nojhan/weboob-devel,willprice/weboob,yannrouillard/weboob,Boussadia/weboob,RouxRC/weboob,frankrousseau/weboob,laurent-george/weboob,yannrouillard/weboob,Boussadia/weboob,Boussadia/weboob,Konubinix/weboob,Boussadia/weboob,Konubinix/weboob,RouxRC/weboob,nojhan/weboob-devel,sputnick-dev/weboob,laurent-geo...
modules/colissimo/backend.py
modules/colissimo/backend.py
# -*- coding: utf-8 -*- # Copyright(C) 2013 Florent Fourcot # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your op...
# -*- coding: utf-8 -*- # Copyright(C) 2013 Florent Fourcot # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your op...
agpl-3.0
Python
99b8dac214f489dc3e429b643851c178d9d63ec9
update urlpatterns to django 1.11
cobrateam/django-htmlmin,cobrateam/django-htmlmin
htmlmin/tests/pico_django.py
htmlmin/tests/pico_django.py
# -*- coding: utf-8 -*- # Copyright 2013 django-htmlmin authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. ''' File: pico_django.py Description: Code based on snippet available in the link below. https://github.com/readevalprint/mini...
# -*- coding: utf-8 -*- # Copyright 2013 django-htmlmin authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. ''' File: pico_django.py Description: Code based on snippet available in the link below. https://github.com/readevalprint/mini...
bsd-2-clause
Python
238e573440c72581a051b16c15f56fcd25bece74
Deal with sequences with odd characters
RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline
rnacentral_pipeline/rnacentral/ftp_export/ensembl.py
rnacentral_pipeline/rnacentral/ftp_export/ensembl.py
# -*- coding: utf-8 -*- """ Copyright [2009-2017] EMBL-European Bioinformatics Institute 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...
# -*- coding: utf-8 -*- """ Copyright [2009-2017] EMBL-European Bioinformatics Institute 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...
apache-2.0
Python
d10b9ae52a6d1894ff2b6686c502fa398b2753da
fix bug of viz
cyliustack/sofa,cyliustack/sofa,cyliustack/sofa,cyliustack/sofa,cyliustack/sofa
bin/sofa_viz.py
bin/sofa_viz.py
import os import subprocess import sys from functools import partial from sofa_config import * from sofa_print import * def sofa_viz(cfg): print_warning(cfg, 'If your rendering timeline is slow, please try \033[4msofa report --plot_ratio=10\033[24m to downsample scatter points,') print_warning(cfg, '...
import os import subprocess import sys from functools import partial from sofa_config import * from sofa_print import * def sofa_viz(cfg): print_warning(cfg, 'If your rendering timeline is slow, please try \033[4msofa report --plot_ratio=10\033[24m to downsample scatter points,') print_warning(cfg, '...
apache-2.0
Python
a935cc920624d2b539fb49fabf87a22a5be89789
Update for Python 3.2; encode postdata as ASCII
clarifyeducation/coursenotify,mutantmonkey/coursenotify
coursenotify.py
coursenotify.py
#!/usr/bin/python import urllib.parse, urllib.request, urllib.error import re import config from emailgateway import EmailGateway from time import sleep nosectex = b"NO SECTIONS FOUND FOR THIS INQUIRY." coursenrex = b"<TD class=deleft style=background-color:WHITE>\n<FONT SIZE=\"1\">(.+?)<\/FONT>\n<\/TD>" coursetitex ...
#!/usr/bin/python import urllib.parse, urllib.request, urllib.error import re import config from emailgateway import EmailGateway from time import sleep nosectex = b"NO SECTIONS FOUND FOR THIS INQUIRY." coursenrex = b"<TD class=deleft style=background-color:WHITE>\n<FONT SIZE=\"1\">(.+?)<\/FONT>\n<\/TD>" coursetitex ...
isc
Python
23f5ff5f7e75df9665e650412bbc42ccbf6aa287
Add method get_cluster_message
studiawan/pygraphc
pygraphc/anomaly/SentimentAnalysis.py
pygraphc/anomaly/SentimentAnalysis.py
from textblob import TextBlob from operator import itemgetter class SentimentAnalysis(object): """Get sentiment analysis with only positive and negative considered. Positive means normal logs and negative sentiment refers to possible attacks. This class uses sentiment analysis feature from the TextBlob l...
from textblob import TextBlob class SentimentAnalysis(object): """Get sentiment analysis with only positive and negative considered. Positive means normal logs and negative sentiment refers to possible attacks. This class uses sentiment analysis feature from the TextBlob library [Loria2016]_. Refere...
mit
Python
62cc569446f7217fa768f260418e504373f05621
Use one_hot=True when building MNIST
sandeepkbhat/pylearn2,KennethPierce/pylearnk,kastnerkyle/pylearn2,Refefer/pylearn2,JesseLivezey/plankton,daemonmaker/pylearn2,mclaughlin6464/pylearn2,TNick/pylearn2,abergeron/pylearn2,aalmah/pylearn2,theoryno3/pylearn2,caidongyun/pylearn2,hyqneuron/pylearn2-maxsom,woozzu/pylearn2,Refefer/pylearn2,chrish42/pylearn,hyqne...
pylearn2/datasets/tests/test_mnist.py
pylearn2/datasets/tests/test_mnist.py
from pylearn2.datasets.mnist import MNIST import unittest from pylearn2.testing.skip import skip_if_no_data import numpy as np class TestMNIST(unittest.TestCase): def setUp(self): skip_if_no_data() self.train = MNIST(which_set = 'train', one_hot=True) self.test = MNIST(which_set = 'test', o...
from pylearn2.datasets.mnist import MNIST import unittest from pylearn2.testing.skip import skip_if_no_data import numpy as np class TestMNIST(unittest.TestCase): def setUp(self): skip_if_no_data() self.train = MNIST(which_set = 'train') self.test = MNIST(which_set = 'test') def test_r...
bsd-3-clause
Python
025867a11bbc2bb3f85d44ef44fde059b92557bb
add gcloud-python header to user agent (#9551)
tswast/google-cloud-python,tswast/google-cloud-python,googleapis/google-cloud-python,GoogleCloudPlatform/gcloud-python,tseaver/google-cloud-python,googleapis/google-cloud-python,tseaver/google-cloud-python,tseaver/google-cloud-python,tswast/google-cloud-python,GoogleCloudPlatform/gcloud-python
storage/google/cloud/storage/_http.py
storage/google/cloud/storage/_http.py
# Copyright 2014 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, s...
# Copyright 2014 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, s...
apache-2.0
Python
6f6cb4760c76f18b859a3c559914ab795b81222e
Fix migration for tests
onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle
bluebottle/mails/migrations/0002_auto_20171211_1117.py
bluebottle/mails/migrations/0002_auto_20171211_1117.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2017-12-11 09:38 from __future__ import unicode_literals import urllib2 from django.core.files import File from django.core.files.temp import NamedTemporaryFile from django.db import migrations, connection def scrape_mail_logo(apps, schema_editor): Client =...
# -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2017-12-11 09:38 from __future__ import unicode_literals import urllib2 from django.core.files import File from django.core.files.temp import NamedTemporaryFile from django.db import migrations, connection def scrape_mail_logo(apps, schema_editor): Client =...
bsd-3-clause
Python
eba363f161d0d026bbde295efe814fa6351d94e0
Document the FFT
msullivan/advent-of-code,msullivan/advent-of-code,msullivan/advent-of-code
2019/16b.alt.py
2019/16b.alt.py
#!/usr/bin/env python3 """ This does an honest computation of the Flawed Frequency Transmission that doesn't rely on the offset being large. It computes all of the digits of the FFT. On my laptop it ran in two minutes using pypy. The trick is that we compute a partial sums array, where partials[0] = 0 and partials[i...
#!/usr/bin/env python3 # This does an honest computation of the Flawed Frequency Transmission # that doesn't rely on the offset being large. It computes all of the digits # of the FFT. # On my laptop it ran in two minutes using pypy. from __future__ import print_function import sys import time def go(n, partials): ...
mit
Python
b0a0cf81ee91226a5ab327d5e2aaa5b7eeb4c984
set the name of the run to be the title in summary_plots()
joelagnel/trappy,joelagnel/trappy,bjackman/trappy,sinkap/trappy,ARM-software/trappy,joelagnel/trappy,ARM-software/trappy,ARM-software/trappy,sinkap/trappy,JaviMerino/trappy,derkling/trappy,JaviMerino/trappy,bjackman/trappy,sinkap/trappy,joelagnel/trappy,ARM-software/trappy,sinkap/trappy,derkling/trappy,bjackman/trappy,...
cr2/__init__.py
cr2/__init__.py
#!/usr/bin/python from pid_controller import PIDController from power import OutPower, InPower from thermal import Thermal, ThermalGovernor from run import Run from results import CR2, get_results, combine_results def summary_plots(actor_order, map_label, **kwords): """A summary of plots as similar as possible to...
#!/usr/bin/python from pid_controller import PIDController from power import OutPower, InPower from thermal import Thermal, ThermalGovernor from run import Run from results import CR2, get_results, combine_results def summary_plots(actor_order, map_label, **kwords): """A summary of plots as similar as possible to...
apache-2.0
Python
96b53217c52f02cfd696a6694865d4c43fdf0603
add adaptive protect
MySmile/mysmile,MySmile/mysmile
apps/pages/templatetags/email2img.py
apps/pages/templatetags/email2img.py
import os, PIL from PIL import Image, ImageDraw, ImageFont from django import template register = template.Library() from mysmile.settings.main import STATIC_ROOT, BASE_DIR, DEBUG @register.filter(name='email2img') def email2img(email): """ protect email via img """ try: os.path.isfile(STATIC_R...
import os, PIL from PIL import Image, ImageDraw, ImageFont from django import template register = template.Library() from mysmile.settings.main import STATIC_ROOT @register.filter(name='email2img') def email2img(email): """ protect email via img """ if os.path.isfile(STATIC_ROOT+'static/images/email2im...
bsd-3-clause
Python
1b09b30897d92a71e353bd5fd7c7ff2680f74a01
Fix sending of root posts
fi-ksi/web-backend,fi-ksi/web-backend
endpoint/post.py
endpoint/post.py
import json, falcon from db import session import model import util from thread import Thread class Post(object): def on_put(self, req, resp, id): self.on_get(req, resp, id) def on_get(self, req, resp, id): user_id = req.context['user'].get_id() if req.context['user'].is_logged_in() else None post = sessi...
import json, falcon from db import session import model import util from thread import Thread class Post(object): def on_put(self, req, resp, id): self.on_get(req, resp, id) def on_get(self, req, resp, id): user_id = req.context['user'].get_id() if req.context['user'].is_logged_in() else None post = sessi...
mit
Python
459d16bea2f67601c6cf538bd70efaa4a01c28d5
Remove obsolete api-key
tastatur/PredictionIO,takeshineshiro/PredictionIO,akaash-nigam/PredictionIO,PredictionIO/PredictionIO,jasonchaffee/PredictionIO,nvoron23/PredictionIO,b-cuts/PredictionIO,adamharish/PredictionIO,rbo7nik/PredictionIO,rsganesh83/PredictionIO,arudenko/PredictionIO,schon/PredictionIO,elkingtonmcb/PredictionIO,TheDataShed/Pr...
sdk/python-sdk/examples/demo-movielens/app_config.py
sdk/python-sdk/examples/demo-movielens/app_config.py
APP_ID = 2 API_URL = 'http://localhost:7070' THREADS = 25 REQUEST_QSIZE = 500
#APP_KEY = 'bfs7QCga121RitVkToTaoSOFTB4i0clnQbu7zTI8hqWMjVKXL9mj225YC7VfpaIR' APP_ID = 2 API_URL = 'http://localhost:7070' THREADS = 25 REQUEST_QSIZE = 500
apache-2.0
Python
04cffe48844bf97050d4ae312b2412c492ed5faa
Make heartbeat output less verbose
mozilla/normandy,Osmose/normandy,Osmose/normandy,mozilla/normandy,mozilla/normandy,mozilla/normandy,Osmose/normandy,Osmose/normandy
normandy/health/api/views.py
normandy/health/api/views.py
import os from django.conf import settings from django.core.checks.registry import registry as checks_registry from django.core.checks import messages as checks_messages from rest_framework import status from rest_framework.decorators import api_view, authentication_classes from rest_framework.response import Respons...
import os from django.conf import settings from django.core.checks.registry import registry as checks_registry from django.core.checks import messages as checks_messages from rest_framework import status from rest_framework.decorators import api_view, authentication_classes from rest_framework.response import Respons...
mpl-2.0
Python
0fc9fbdf171816f240d902190205420e57f70247
support for image, scale and alpha parameters
jffernandez/kivy,jegger/kivy,edubrunaldi/kivy,xpndlabs/kivy,rnixx/kivy,iamutkarshtiwari/kivy,LogicalDash/kivy,jkankiewicz/kivy,autosportlabs/kivy,inclement/kivy,yoelk/kivy,rafalo1333/kivy,matham/kivy,darkopevec/kivy,niavlys/kivy,jkankiewicz/kivy,edubrunaldi/kivy,niavlys/kivy,andnovar/kivy,arcticshores/kivy,Shyam10/kivy...
kivy/modules/touchring.py
kivy/modules/touchring.py
''' Touchring module ================ Show ring around every touch on the table. You can use this module for checking if you don't have any calibration trouble with touches. ''' import os from kivy import kivy_data_dir from kivy.core.image import Image from kivy.graphics import Color, Rectangle pointer_image = None ...
''' Touchring module ================ Show ring around every touch on the table. You can use this module for checking if you don't have any calibration trouble with touches. ''' import os from kivy import kivy_data_dir from kivy.core.image import Image from kivy.graphics import Color, Rectangle if not 'KIVY_DOC' in ...
mit
Python
b020d1549b99ea85569fcefbeb6582ee186b8ef6
print HA networks to log, print ports
CiscoSystems/os-sqe,CiscoSystems/os-sqe,CiscoSystems/os-sqe
lab/deployers/__init__.py
lab/deployers/__init__.py
import abc from lab.with_config import WithConfig class Deployer(WithConfig): @abc.abstractmethod def wait_for_cloud(self, list_of_servers): """Make sure that cloud is up and running on the provided list of servers :param list_of_servers: list of server provided during provisioning phase ...
import abc from lab.with_config import WithConfig class Deployer(WithConfig): @abc.abstractmethod def wait_for_cloud(self, list_of_servers): """Make sure that cloud is up and running on the provided list of servers :param list_of_servers: list of server provided during provisioning phase ...
apache-2.0
Python
9044ae987f059c8dc173f6c21d75a4908a121afe
Update link of dependency
brain-tec/sale-workflow,thomaspaulb/sale-workflow,acsone/sale-workflow,acsone/sale-workflow,jabibi/sale-workflow,Endika/sale-workflow,Antiun/sale-workflow,BT-cserra/sale-workflow,fevxie/sale-workflow,akretion/sale-workflow,open-synergy/sale-workflow,ddico/sale-workflow,diagramsoftware/sale-workflow,factorlibre/sale-wor...
sale_payment_method_transaction_id/__openerp__.py
sale_payment_method_transaction_id/__openerp__.py
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
agpl-3.0
Python
49bd9ae52e24375b61999fa6a4915866ea9a0377
add travis ci
kute/eventor
test/test.py
test/test.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # __author__ = 'kute' # __mtime__ = '2016/12/25 17:47' """ """ # from __future__ import absolute_import import unittest from eventor.core import Eventor from eventor.util import EventorUtil import os class SimpleTest(unittest.TestCase): def test_run_with_tasklis...
#! /usr/bin/env python # -*- coding: utf-8 -*- # __author__ = 'kute' # __mtime__ = '2016/12/25 17:47' """ """ # from __future__ import absolute_import import unittest from eventor.core import Eventor from eventor.util import EventorUtil import os class SimpleTest(unittest.TestCase): def test_run_with_tasklis...
mit
Python
c7e55bfd8284c4bb6755abc51dd7c940bca9d81a
Add sound level to influx
ojarva/home-info-display,ojarva/home-info-display,ojarva/home-info-display,ojarva/home-info-display
sensor_consumers/dust_node.py
sensor_consumers/dust_node.py
# coding=utf-8 from local_settings import * from utils import SensorConsumerBase import redis import datetime import sys class DustNode(SensorConsumerBase): def __init__(self): SensorConsumerBase.__init__(self, "indoor_air_quality") def run(self): self.subscribe("dust-node-pubsub", self.pubsu...
# coding=utf-8 from local_settings import * from utils import SensorConsumerBase import redis import datetime import sys class DustNode(SensorConsumerBase): def __init__(self): SensorConsumerBase.__init__(self, "indoor_air_quality") def run(self): self.subscribe("dust-node-pubsub", self.pubsu...
bsd-3-clause
Python
6e9b1ad4af56dbde51673176113bec91baa90327
add iosdriver
2gis/contesto,rseek/contesto
contesto/basis/driver_mixin.py
contesto/basis/driver_mixin.py
from contesto.exceptions import UnknownBrowserName class AbstractDriver(object): _driver_type = None dc_from_config = None @classmethod def _form_desired_capabilities(cls, driver_settings): try: cls.dc_from_config = driver_settings["desired_capabilities"] except KeyError: ...
from contesto.exceptions import UnknownBrowserName class AbstractDriver(object): _driver_type = None dc_from_config = None @classmethod def _form_desired_capabilities(cls, driver_settings): try: cls.dc_from_config = driver_settings["desired_capabilities"] except KeyError: ...
mit
Python
b3fd19f309c883b9f09be964f1647dfb455ccb68
Fix domain models __slots__ field
ets-labs/domain_models,rmk135/domain_models,ets-labs/python-domain-models
domain_models/model.py
domain_models/model.py
"""Domain models model.""" import six from . import fields class DomainModelMetaClass(type): """Domain model meta class.""" def __new__(mcs, class_name, bases, attributes): """Domain model class factory.""" cls = type.__new__(mcs, class_name, bases, attributes) for field_name, fiel...
"""Domain models model.""" import six from . import fields class DomainModelMetaClass(type): """Domain model meta class.""" def __new__(mcs, class_name, bases, attributes): """Domain model class factory.""" cls = type.__new__(mcs, class_name, bases, attributes) for field_name, fiel...
bsd-3-clause
Python
cc84a379132c8d500de62a5a111210ca867a71ae
Fix typo registrant->registrar
DomainTools/python_api,DomainTools/python_api
domaintools/results.py
domaintools/results.py
"""Defines the used Result object based on the current versions and/or features available to Python runtime Additionally, defines any custom result objects that may be used to enable more Pythonic interaction with endpoints. """ import sys from itertools import chain try: # pragma: no cover from collections impor...
"""Defines the used Result object based on the current versions and/or features available to Python runtime Additionally, defines any custom result objects that may be used to enable more Pythonic interaction with endpoints. """ import sys from itertools import chain try: # pragma: no cover from collections impor...
mit
Python
3256d46fe1063f1da65b58942fd4f68b3c0d081f
Append extra args with a space for dox.yml
emonty/dox,emonty/dox,stackforge/dox,coolsvap/dox
dox/config/dox_yaml.py
dox/config/dox_yaml.py
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
Python
4369de9f0f44860f27d26f6814dc100fefe421be
Fix tests for Django 1.10
AliLozano/django-messages-extends,AliLozano/django-messages-extends,AliLozano/django-messages-extends
test_urls.py
test_urls.py
import django if django.VERSION >= (1,10): from django.conf.urls import include, url patterns = lambda _ignore, x: list([x,]) else: from django.conf.urls import patterns, include, url urlpatterns = patterns('', url(r'^messages/', include('messages_extends.urls', namespace='messages')), )
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'temp.views.home', name='home'), # url(r'^temp/', include('temp.foo.urls')), # Uncommen...
mit
Python
03b36b5dc594bbe239d0ad66dc43ea7d1832072c
Remove warnings
pypa/setuptools,pypa/setuptools,pypa/setuptools
setuptools/distutils_patch.py
setuptools/distutils_patch.py
""" Ensure that the local copy of distutils is preferred over stdlib. See https://github.com/pypa/setuptools/issues/417#issuecomment-392298401 for more motivation. """ import sys import re import os import importlib import warnings def clear_distutils(): if 'distutils' not in sys.modules: return mo...
""" Ensure that the local copy of distutils is preferred over stdlib. See https://github.com/pypa/setuptools/issues/417#issuecomment-392298401 for more motivation. """ import sys import re import os import importlib import warnings is_pypy = '__pypy__' in sys.builtin_module_names def warn_distutils_present(): ...
mit
Python
0534822dc02285060f57cdb27bda5ad3fbce8727
Add support for altpassword.
AVOXI/b2bua,AVOXI/b2bua,sippy/b2bua,sippy/b2bua
sippy/IVoiSysAuthorisation.py
sippy/IVoiSysAuthorisation.py
# Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved. # Copyright (c) 2006-2007 Sippy Software, Inc. All rights reserved. # # This file is part of SIPPY, a free RFC3261 SIP stack and B2BUA. # # SIPPY is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
# Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved. # Copyright (c) 2006-2007 Sippy Software, Inc. All rights reserved. # # This file is part of SIPPY, a free RFC3261 SIP stack and B2BUA. # # SIPPY is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
bsd-2-clause
Python
b2354fdde28bf841bebfc1f5347b2bde3c3cc390
Fix bill table missed column
eddiedb6/ej,eddiedb6/ej,eddiedb6/ej
db/TableBill.py
db/TableBill.py
{ PDBConst.Name: "bill", PDBConst.Columns: [ { PDBConst.Name: "ID", PDBConst.Attributes: ["int", "not null", "auto_increment", "primary key"] }, { PDBConst.Name: "PID", PDBConst.Attributes: ["int", "not null"] }, { PDBConst.Name: "Datetime", PD...
{ PDBConst.Name: "bill", PDBConst.Columns: [ { PDBConst.Name: "ID", PDBConst.Attributes: ["int", "not null", "auto_increment", "primary key"] }, { PDBConst.Name: "Datetime", PDBConst.Attributes: ["datetime", "not null"] }, { PDBConst.Name: "Amount", ...
mit
Python
5da6ebbab96dd29a205d82b8fd0996085995cd2b
Update to fix width/height for rotation.
drougge/wellpapp-pyclient
db_oldrotate.py
db_oldrotate.py
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- from pyexiv2 import Image as ExivImage import Image from db_add import exif2rotation from dbclient import dbclient from sys import argv opts = argv[1] # z for size (fix for rotation), r for rotate (from exif) client = dbclient() fields = ["rotate", "width", "height"...
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- from pyexiv2 import Image as ExivImage from db_add import exif2rotation from dbclient import dbclient client = dbclient() posts = client._search_post("SPFrotate", ["rotate"]) print len(posts), "posts" for post in posts: if post["rotate"] == -1: m = post["md5"] e...
mit
Python
b047bb4b75df155cb20308612954767c8a5f5ac8
Fix error message displayed when the initial api call on the dialogue screen fails
praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go
go/apps/dialogue/view_definition.py
go/apps/dialogue/view_definition.py
from django.http import HttpResponse from bootstrap.forms import BootstrapForm from go.api.go_api import client from go.api.go_api.client import GoApiError from go.conversation.view_definition import ( ConversationViewDefinitionBase, ConversationTemplateView) class DialogueEditView(ConversationTemplateView): ...
from django.http import HttpResponse from bootstrap.forms import BootstrapForm from go.api.go_api import client from go.api.go_api.client import GoApiError from go.conversation.view_definition import ( ConversationViewDefinitionBase, ConversationTemplateView) class DialogueEditView(ConversationTemplateView): ...
bsd-3-clause
Python
a50bb67591ce134c0333176872e3953eaedc6d2b
fix missing archive extention
pavel-paulau/perfrunner,pavel-paulau/perfrunner,thomas-couchbase/perfrunner,pavel-paulau/perfrunner,vmx/perfrunner,couchbase/perfrunner,mikewied/perfrunner,couchbase/perfrunner,dkao-cb/perfrunner,EricACooper/perfrunner,PaintScratcher/perfrunner,vmx/perfrunner,couchbase/perfrunner,PaintScratcher/perfrunner,hsharsha/perf...
perfrunner/helpers/remote.py
perfrunner/helpers/remote.py
from uuid import uuid4 from fabric.api import execute, hide, get, run, parallel, settings from logger import logger from perfrunner.helpers import Helper def all_hosts(task): def wrapper(*args, **kargs): self = args[0] with hide('output', 'running'): with settings(user=self.ssh_usern...
from uuid import uuid4 from fabric.api import execute, hide, get, run, parallel, settings from logger import logger from perfrunner.helpers import Helper def all_hosts(task): def wrapper(*args, **kargs): self = args[0] with hide('output', 'running'): with settings(user=self.ssh_usern...
apache-2.0
Python
e6d539d073bcac1bee247ca66706621b11969fd6
Support Meta and F* keys in urwid.
5monkeys/bpython
bpython/keys.py
bpython/keys.py
# The MIT License # # Copyright (c) 2008 Simon de Vlieger # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify...
# The MIT License # # Copyright (c) 2008 Simon de Vlieger # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify...
mit
Python
6c866caa0b5d6a251c694e13a3f1d5e32c45ae3a
Add missing NameFilter.to_es_filter() implementation
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq
corehq/apps/export/filters.py
corehq/apps/export/filters.py
from corehq.apps.es import filters as esfilters from corehq.apps.es.cases import ( owner, is_closed, opened_range, modified_range, user, closed_range, ) class ExportFilter(object): """ Abstract base class for an export filter on a single case or form property """ def to_es_fil...
from corehq.apps.es import filters as esfilters from corehq.apps.es.cases import ( owner, is_closed, opened_range, modified_range, user, closed_range, ) class ExportFilter(object): """ Abstract base class for an export filter on a single case or form property """ def to_es_fil...
bsd-3-clause
Python
b4250c4f8e700906a6d82915f98b8a0133892396
Make subclass testing more boring
kelle/astropy,DougBurke/astropy,lpsinger/astropy,lpsinger/astropy,pllim/astropy,joergdietrich/astropy,funbaker/astropy,saimn/astropy,joergdietrich/astropy,dhomeier/astropy,astropy/astropy,pllim/astropy,dhomeier/astropy,funbaker/astropy,stargaser/astropy,aleksandr-bakanov/astropy,StuartLittlefair/astropy,tbabej/astropy,...
astropy/table/tests/test_subclass.py
astropy/table/tests/test_subclass.py
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst # TEST_UNICODE_LITERALS from ... import table from .. import pprint class MyRow(table.Row): def __str__(self): return str(self.data) class MyColumn(table.Column): pass class MyMaskedColumn(table.Column): p...
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst # TEST_UNICODE_LITERALS from ... import table from .. import pprint class MyRow(table.Row): def __str__(self): return str(self.data) class MyColumn(table.Column): def cool(self): return 'Cool!' class M...
bsd-3-clause
Python
5db183c681af4b078fa8addc8cf4268b7315678a
allow to give modifiers to grep values
msztolcman/jsontool,mysz/jsontool
jsontool.py
jsontool.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ jsontool - Perform some actions with json using CLI http://github.com/mysz/jsontool Author: Marcin Sztolcman (marcin@urzenia.net) Get help with: jsontool.py --help Information about version: jsontool.py --version """ from __future__ import print_funct...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ jsontool - Perform some actions with json using CLI http://github.com/mysz/jsontool Author: Marcin Sztolcman (marcin@urzenia.net) Get help with: jsontool.py --help Information about version: jsontool.py --version """ from __future__ import print_funct...
mit
Python
9109458ca157907145d5ae2ce5f709bd72bacc6b
Update Error Message
rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org
readthedocs/doc_builder/exceptions.py
readthedocs/doc_builder/exceptions.py
# -*- coding: utf-8 -*- """Exceptions raised when building documentation.""" from django.utils.translation import ugettext_noop class BuildEnvironmentException(Exception): message = None status_code = None def __init__(self, message=None, **kwargs): self.status_code = kwargs.pop( 's...
# -*- coding: utf-8 -*- """Exceptions raised when building documentation.""" from django.utils.translation import ugettext_noop class BuildEnvironmentException(Exception): message = None status_code = None def __init__(self, message=None, **kwargs): self.status_code = kwargs.pop( 's...
mit
Python
c1f31f69ca7ba75185100cf7a8eabf58ed41ccdf
Connect signal callback using the model class as sender.
mozilla/telemetry-analysis-service,mozilla/telemetry-analysis-service,mozilla/telemetry-analysis-service,mozilla/telemetry-analysis-service
atmo/apps.py
atmo/apps.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/. import logging import session_csrf from django.apps import AppConfig from django.db.models.signals import post_save, pre...
# 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/. import logging import session_csrf from django.apps import AppConfig from django.db.models.signals import post_save, pre...
mpl-2.0
Python
477e200d36de1ec83146fd0117745997ae3d7357
Update clean documentation
J535D165/recordlinkage,J535D165/recordlinkage
recordlinkage/standardise/cleaning.py
recordlinkage/standardise/cleaning.py
from __future__ import division from __future__ import absolute_import import logging import numpy as np import pandas as pd import itertools def clean(s, lower=True, replace_by_none='[^ \-\_A-Za-z0-9]+', replace_by_whitespace='[\-\_]', remove_brackets=True): """ clean(lower=True, replace_by_none='[^ \-\_A-...
from __future__ import division from __future__ import absolute_import import logging import numpy as np import pandas as pd import itertools def clean(s, lower=True, replace_by_none='[^ \-\_A-Za-z0-9]+', replace_by_whitespace='[\-\_]', remove_brackets=True): """ clean(lower=True, replace_by_none='[^ \-\_A-...
bsd-3-clause
Python
314014f0c4064398eb550f745085ff83bea3adf0
Update webhost.py
anvanza/invenavi,anvanza/invenavi,anvanza/invenavi
web/webhost.py
web/webhost.py
import sys import logging from twisted.python import log from twisted.internet import reactor, defer from twisted.web.server import Site from twisted.web.static import File from autobahn.websocket import listenWS from autobahn.wamp import exportRpc, \ WampServerFactory, \ ...
import sys import logging from twisted.python import log from twisted.internet import reactor, defer from twisted.web.server import Site from twisted.web.static import File from autobahn.websocket import listenWS from autobahn.wamp import exportRpc, \ WampServerFactory, \ ...
mit
Python
b972634c03a00527c7fadefa873376737ecbcb61
Update webhost.py
anvanza/invenavi,anvanza/invenavi,anvanza/invenavi
web/webhost.py
web/webhost.py
import sys import logging from twisted.python import log from twisted.internet import reactor, defer from twisted.web.server import Site from twisted.web.static import File from autobahn.websocket import listenWS from autobahn.wamp import exportRpc, \ WampServerFactory, \ ...
import sys import logging from twisted.python import log from twisted.internet import reactor, defer from twisted.web.server import Site from twisted.web.static import File from autobahn.websocket import listenWS from autobahn.wamp import exportRpc, \ WampServerFactory, \ ...
mit
Python
6ec4c21cf7af09401aabadff79898fe783efe9bd
Fix import of rotate function
SamHames/scikit-image,michaelpacer/scikit-image,ofgulban/scikit-image,paalge/scikit-image,jwiggins/scikit-image,SamHames/scikit-image,almarklein/scikit-image,rjeli/scikit-image,blink1073/scikit-image,ofgulban/scikit-image,almarklein/scikit-image,SamHames/scikit-image,almarklein/scikit-image,GaZ3ll3/scikit-image,chriscr...
skimage/transform/__init__.py
skimage/transform/__init__.py
from .hough_transform import * from .radon_transform import * from .finite_radon_transform import * from .integral import * from ._geometric import (estimate_transform, SimilarityTransform, AffineTransform, ProjectiveTransform, PolynomialTransform) from ._warps import w...
from .hough_transform import * from .radon_transform import * from .finite_radon_transform import * from .integral import * from ._geometric import (estimate_transform, SimilarityTransform, AffineTransform, ProjectiveTransform, PolynomialTransform) from ._warps import w...
bsd-3-clause
Python
308924cd852f13212e0ca758c2eccc588af38b24
Fix ResourcesProxy::getPath
onitake/Uranium,onitake/Uranium
UM/Qt/Bindings/ResourcesProxy.py
UM/Qt/Bindings/ResourcesProxy.py
from PyQt5.QtCore import QObject, pyqtSlot, QUrl, Q_ENUMS from UM.Resources import Resources class ResourcesProxy(QObject): class Location: ResourcesLocation = Resources.ResourcesLocation SettingsLocation = Resources.SettingsLocation PreferencesLocation = Resources.PreferencesLocation ...
from PyQt5.QtCore import QObject, pyqtSlot, QUrl from UM.Resources import Resources class ResourcesProxy(QObject): ResourcesLocation = Resources.ResourcesLocation SettingsLocation = Resources.SettingsLocation PreferencesLocation = Resources.PreferencesLocation def __init__(self, parent = None): ...
agpl-3.0
Python
c9f990ff4095b7fb361b2d59c0c5b2c9555643ff
Remove left over merge conflict text
uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged
csunplugged/tests/BaseTest.py
csunplugged/tests/BaseTest.py
"""Base test class with methods implemented for Django testing.""" from django.test import TestCase from django.contrib.auth.models import User from django.test.client import Client from django.utils.translation import activate class BaseTest(SimpleTestCase): """Base test class with methods implemented for Djang...
"""Base test class with methods implemented for Django testing.""" from django.test import TestCase from django.contrib.auth.models import User from django.test.client import Client from django.utils.translation import activate <<<<<<< HEAD class BaseTest(SimpleTestCase): """Base test class with methods implemen...
mit
Python
3d56133237b8ca79eb6f96c5cd94dc8bb0f71476
Update __openerp__.py
ingadhoc/partner
partner_school/__openerp__.py
partner_school/__openerp__.py
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Pu...
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Pu...
agpl-3.0
Python
305da4001219a014360f4529a2cfa8428a53a9a0
convert language to locale
invalid-access/django-phonenumber-field,thenewguy/django-phonenumber-field,bramd/django-phonenumber-field,thenewguy/django-phonenumber-field,ellmetha/django-phonenumber-field,hovel/django-phonenumber-field,hwkns/django-phonenumber-field,bramd/django-phonenumber-field,invalid-access/django-phonenumber-field,hwkns/django...
phonenumber_field/widgets.py
phonenumber_field/widgets.py
# -*- coding: utf-8 -*- from babel import Locale from phonenumbers.data import _COUNTRY_CODE_TO_REGION_CODE from django.utils import translation from django.forms import Select, TextInput from django.forms.widgets import MultiWidget from phonenumber_field.phonenumber import PhoneNumber class PhonePrefixSelect(Sel...
# -*- coding: utf-8 -*- from babel import Locale from phonenumbers.data import _COUNTRY_CODE_TO_REGION_CODE from django.utils import translation from django.forms import Select, TextInput from django.forms.widgets import MultiWidget from phonenumber_field.phonenumber import PhoneNumber class PhonePrefixSelect(Sel...
mit
Python
4173a544ce18dafe46be822921763e37d4a44a18
add cvc4
ultimate-pa/benchexec,ultimate-pa/benchexec,IljaZakharov/benchexec,ultimate-pa/benchexec,dbeyer/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,dbeyer/benchexec,IljaZakharov/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,martin-neuhaeusser/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,dbeyer/benchexec,martin-neuh...
benchexec/tools/ultimateautomizer.py
benchexec/tools/ultimateautomizer.py
""" BenchExec is a framework for reliable benchmarking. This file is part of BenchExec. Copyright (C) 2015 Daniel Dietsch 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 ...
""" BenchExec is a framework for reliable benchmarking. This file is part of BenchExec. Copyright (C) 2015 Daniel Dietsch 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 ...
apache-2.0
Python
8d47940ddf80d49102f72f78d485d884b14694ff
implement static rebalance test with index
hsharsha/perfrunner,mikewied/perfrunner,PaintScratcher/perfrunner,couchbase/perfrunner,EricACooper/perfrunner,thomas-couchbase/perfrunner,couchbase/perfrunner,vmx/perfrunner,couchbase/perfrunner,pavel-paulau/perfrunner,couchbase/perfrunner,mikewied/perfrunner,EricACooper/perfrunner,couchbase/perfrunner,EricACooper/perf...
perfrunner/tests/rebalance.py
perfrunner/tests/rebalance.py
import time from multiprocessing import Event from perfrunner.tests import PerfTest from perfrunner.tests.index import IndexTest def with_delay(method): def wrapper(self, *args, **kwargs): time.sleep(self.rebalance_settings.start_after) method(self, *args, **kwargs) time.sleep(self.rebala...
import time from perfrunner.tests import PerfTest from multiprocessing import Event def with_delay(method): def wrapper(self, *args, **kwargs): time.sleep(self.rebalance_settings.start_after) method(self, *args, **kwargs) time.sleep(self.rebalance_settings.stop_after) self.shutdo...
apache-2.0
Python
a02fd405c1fd5a86a4a3fb2e374d0c23ea204834
use less stupid words in tests
martinsbalodis/warc-tools,martinsbalodis/warc-tools
hanzo/httptools/tests/parse_test.py
hanzo/httptools/tests/parse_test.py
import unittest2 from StringIO import StringIO from hanzo.httptools.messaging import RequestParser, ResponseParser get_request = "\r\n".join( [ "GET / HTTP/1.1", "Host: example.org", "", "", ]) get_response = "\r\n".join( [ "HTTP/1.1 200 OK", "Host: example.org", "Content-Length:5", ...
import unittest2 from StringIO import StringIO from hanzo.httptools.messaging import RequestParser, ResponseParser get_request = "\r\n".join( [ "GET / HTTP/1.1", "Host: example.org", "", "", ]) get_response = "\r\n".join( [ "HTTP/1.1 200 OK", "Host: example.org", "Content-Length:5", ...
mit
Python
cebe264462553bca38be7938edfecd323a5413cc
add unit tests for bivariate k sample
kellieotto/permute,statlab/permute,kellieotto/permute,jarrodmillman/permute
permute/tests/test_ksample.py
permute/tests/test_ksample.py
from __future__ import (absolute_import, division, print_function, unicode_literals) from nose.plugins.attrib import attr from nose.tools import assert_raises, raises import numpy as np from numpy.random import RandomState from numpy.testing import assert_equal, assert_almost_equal, assert_arr...
from __future__ import (absolute_import, division, print_function, unicode_literals) from nose.plugins.attrib import attr from nose.tools import assert_raises, raises import numpy as np from numpy.random import RandomState from numpy.testing import assert_equal, assert_almost_equal, assert_arr...
bsd-2-clause
Python
e1c453c3a1c7e63c48e86bb4b60517d8c52bbe37
normalise kwarg in HOG unnecessary (should be set to default False, not None). Also changed the image numpy arrays to be logged and normalized between -1 and 1
cavestruz/StrongCNN,cavestruz/StrongCNN
pipeline/image_processing.py
pipeline/image_processing.py
import numpy as np import copy from sklearn.base import BaseEstimator def load_images(filenames): '''Expects filenames to be a list of .fits file locations''' from astropy.io.fits import getdata return [np.log(getdata(filename))/np.max(np.abs(np.log(getdata(filename)))) for filename in filenames] class Me...
import numpy as np import copy from sklearn.base import BaseEstimator def load_images(filenames): '''Expects filenames to be a list of .fits file locations''' from astropy.io.fits import getdata return [getdata(filename).copy()/np.max(getdata(filename).copy()) for filename in filenames] class MedianSmooth...
mit
Python
0ab2da918cbf0e58cf850f6868f5b896ea5c3893
Make NickServIdentify play nice with service specific configs
Heufneutje/PyHeufyBot,Heufneutje/PyHeufyBot
heufybot/modules/util/nickservid.py
heufybot/modules/util/nickservid.py
from twisted.plugin import IPlugin from heufybot.moduleinterface import BotModule, IBotModule from zope.interface import implements import logging class NickServIdentify(BotModule): implements(IPlugin, IBotModule) name = "NickServIdentify" def hookBot(self, bot): self.bot = bot def actions(...
from twisted.plugin import IPlugin from heufybot.moduleinterface import BotModule, IBotModule from zope.interface import implements import logging class NickServIdentify(BotModule): implements(IPlugin, IBotModule) name = "NickServIdentify" def hookBot(self, bot): self.bot = bot def actions(...
mit
Python
c1ea1e71155bea6e0fa6fe4dcb67bec364ae79ec
remove stray print statements
opencivicdata/python-legistar-scraper,datamade/python-legistar-scraper
legistar/people.py
legistar/people.py
from .base import LegistarScraper class LegistarPersonScraper(LegistarScraper): MEMBERLIST = None def councilMembers(self, follow_links=True) : for page in self.pages(self.MEMBERLIST) : table = page.xpath( "//table[@id='ctl00_ContentPlaceHolder1_gridPeople_ctl00']")[0] ...
from .base import LegistarScraper class LegistarPersonScraper(LegistarScraper): MEMBERLIST = None def councilMembers(self, follow_links=True) : for page in self.pages(self.MEMBERLIST) : table = page.xpath( "//table[@id='ctl00_ContentPlaceHolder1_gridPeople_ctl00']")[0] ...
bsd-3-clause
Python
70737f757c67446859b604425d28dca233b99769
fix xml order in terp
Som-Energia/somenergia-generationkwh,Som-Energia/somenergia-generationkwh
som_generationkwh/__terp__.py
som_generationkwh/__terp__.py
# -*- coding: utf-8 -*- { "name": "Generation kWh", "description": """Support for SomEnergia's Generation kWh in GisceERP""", "version": "2.0", "author": "GISCE-TI & Som Energia", "category": "Master", "depends": [ 'base', "poweremail", "poweremail_references", 'som_polissa_soci', 'som_i...
# -*- coding: utf-8 -*- { "name": "Generation kWh", "description": """Support for SomEnergia's Generation kWh in GisceERP""", "version": "2.0", "author": "GISCE-TI & Som Energia", "category": "Master", "depends": [ 'base', "poweremail", "poweremail_references", 'som_polissa_soci', 'som_i...
agpl-3.0
Python
35d14348ce419421bba2b043ea2818c185526301
Comment out fix_fee_product_index from migration
cfpb/owning-a-home-api
ratechecker/migrations/0002_remove_fee_loader.py
ratechecker/migrations/0002_remove_fee_loader.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.22 on 2019-10-31 16:33 from __future__ import unicode_literals from django.db import migrations, OperationalError, ProgrammingError def fix_fee_product_index(apps, schema_editor): try: schema_editor.execute( 'DROP INDEX idx_16977_product_id;' ...
# -*- coding: utf-8 -*- # Generated by Django 1.11.22 on 2019-10-31 16:33 from __future__ import unicode_literals from django.db import migrations, OperationalError, ProgrammingError def fix_fee_product_index(apps, schema_editor): table_name = 'cfpb.ratechecker_fee' index_name = 'idx_16977_product_id' try...
cc0-1.0
Python
d3b7c78bb2505603b7d827f388cf9b68de70f442
Añade filtros para busqueda de event
abertal/alpha,migonzalvar/alpha,migonzalvar/alpha,abertal/alpha,migonzalvar/alpha,abertal/alpha,migonzalvar/alpha,abertal/alpha
webapp/filters.py
webapp/filters.py
from django.db import models from django.db.models import Value as V from django.db.models import Q from django.db.models.functions import Concat from django.utils.translation import ugettext_lazy as _ import django_filters from core.models import Group, Event class PersonFilter(django_filters.FilterSet): q = ...
from django.db import models from django.db.models import Value as V from django.db.models import Q from django.db.models.functions import Concat from django.utils.translation import ugettext_lazy as _ import django_filters from core.models import Group class PersonFilter(django_filters.FilterSet): q = django_...
bsd-3-clause
Python
2a83e5eba8a92d7391fb914e335859a38dd19451
Add lint test and format generated code (#4114)
googleapis/google-cloud-java,googleapis/google-cloud-java,googleapis/google-cloud-java
java-monitoring/google-cloud-monitoring/synth.py
java-monitoring/google-cloud-monitoring/synth.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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
apache-2.0
Python
98c30fc87b326466a76b574696056f154e4b4139
add example for sensory stimulus
florisvb/multi_tracker
examples/sample_data/config_20160412_134708_N1.py
examples/sample_data/config_20160412_134708_N1.py
import imp import os import numpy as np import multi_tracker_analysis as mta def load_sensory_stimulus_on(): # write some code that reads a file and reformats stimulus on/off times to have the form of a list of epoch timestamps e.g. [[t1,t2],[t3,4]] return [[1444888597, 1444888599], [1444888602, 1444888603]] ...
import imp import os import numpy as np import multi_tracker_analysis as mta class Config(object): def __init__(self, path, identifiercode=''): if '.py' in path: self.path = os.path.dirname(path) else: self.path = path self.identifiercode = identifiercode ...
mit
Python
43e1914d9c74ddd9ab366596c85e3c8e4b83ce92
Change negating.
phac-nml/bio_hansel
bio_hansel/quality_check/qc_utils.py
bio_hansel/quality_check/qc_utils.py
from typing import Tuple from bio_hansel.subtype import Subtype from pandas import DataFrame ''' [get_conflicting_tiles] Input: Subtype, DataFrame Output: List Desc: The purpose of this method is to find positive and negative tiles for the same refposition in the dataframe. The method will return a list with the confl...
from typing import Tuple from bio_hansel.subtype import Subtype from pandas import DataFrame ''' [get_conflicting_tiles] Input: Subtype, DataFrame Output: List Desc: The purpose of this method is to find positive and negative tiles for the same refposition in the dataframe. The method will return a list with the confl...
apache-2.0
Python
e0c311e04be19bd42f9e830200b975f6b7135434
Fix a lint issue
arthur-wsw/pinax-announcements,arthur-wsw/pinax-announcements,pinax/django-announcements,pinax/django-announcements,pinax/pinax-announcements
pinax/announcements/models.py
pinax/announcements/models.py
from django.conf import settings from django.db import models from django.core.urlresolvers import reverse from django.utils import timezone from django.utils.translation import ugettext_lazy as _ class Announcement(models.Model): """ A single announcement. """ DISMISSAL_NO = 1 DISMISSAL_SESSION =...
from django.conf import settings from django.db import models from django.core.urlresolvers import reverse from django.utils import timezone from django.utils.translation import ugettext_lazy as _ class Announcement(models.Model): """ A single announcement. """ DISMISSAL_NO = 1 DISMISSAL_SESSION = ...
mit
Python
4f9b5700ae6247c282ff4bcc40ec0f2cf3a2ff35
Bump version to 1.18.0
platformio/platformio-api
platformio_api/__init__.py
platformio_api/__init__.py
# Copyright 2014-present Ivan Kravets <me@ikravets.com> # # 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...
# Copyright 2014-present Ivan Kravets <me@ikravets.com> # # 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...
apache-2.0
Python
0bfcca4d11722c92d1fa9fe8da30a9a118d7f8ea
Fix bounty constructor; add verification; NO PING
gappleto97/Senior-Project
common/bounty.py
common/bounty.py
import os, pickle, re from common.safeprint import safeprint bountyList = [] class Bounty: ip = "" btc = "" reward = 0 data = [] def __init__(self, ipAddress, btcAddress, rewardAmount, dataList=[]): self.ip = ipAddress self.btc = btcAddress self.reward = rewardAmount self.data = dataList ...
import os, pickle from common.safeprint import safeprint bountyList = [] class Bounty: ip = "" btc = "" reward = 0 data = [] def __init__(ipAddress, btcAddress, rewardAmount): ip = ipAddress btc = btcAddress reward = rewardAmount def __init__(ipAddress, btcAddress, rewardAmount, dataList...
mit
Python
d6bfe637dad3ddddf980127646cecc4d3e6b7db3
use pfctl for IP check (#4320)
opnsense/core,opnsense/core,opnsense/core,opnsense/core,opnsense/core,opnsense/core
src/opnsense/scripts/filter/find_table_references.py
src/opnsense/scripts/filter/find_table_references.py
#!/usr/local/bin/python3 """ Copyright (c) 2018-2019 Deciso B.V. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright no...
#!/usr/local/bin/python3 """ Copyright (c) 2018-2019 Deciso B.V. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright no...
bsd-2-clause
Python
924f5b5467d3ee395fa957e992ea716ce5c3a835
Add support of facts gathering WWNs on Solaris 10 and Solaris 11 OS (#52091)
thaim/ansible,thaim/ansible
lib/ansible/module_utils/facts/network/fc_wwn.py
lib/ansible/module_utils/facts/network/fc_wwn.py
# Fibre Channel WWN initiator related facts collection for ansible. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your o...
# Fibre Channel WWN initiator related facts collection for ansible. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your o...
mit
Python
65ac4143dbf2f69f74b86c071f40f640c33873b3
prepare for entry to SQL - not SQL itself
danodonovan/django-condor,danodonovan/django-condor
condor/fields.py
condor/fields.py
from django.db import models from django.core.serializers.json import DjangoJSONEncoder from django.utils import simplejson as json # Brad Jasper's JSONField https://github.com/bradjasper/django-jsonfield class JSONField(models.TextField): """JSONField is a generic textfield that serializes/unserializes JSON objec...
from django.db import models from django.core.serializers.json import DjangoJSONEncoder from django.utils import simplejson as json # Brad Jasper's JSONField https://github.com/bradjasper/django-jsonfield class JSONField(models.TextField): """JSONField is a generic textfield that serializes/unserializes JSON objec...
bsd-3-clause
Python
d1a7a56c1480d9d17a8ddef359787bba2d05aed8
fix encoding
tehron/tehbot,spaceone/tehbot
plugins/translate/__init__.py
plugins/translate/__init__.py
import plugins import urllib import urllib2 import lxml.html def translate(connection, channel, nick, cmd, args): if not args: return headers = { 'User-Agent' : 'Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1' } data = { 'sl' : 'auto', 'tl' : 'en', 'hl' : 'en', 'ie' : 'UTF-...
import plugins import urllib import urllib2 import lxml.html def translate(connection, channel, nick, cmd, args): if not args: return headers = { 'User-Agent' : 'Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1' } data = { 'sl' : 'auto', 'tl' : 'en', 'hl' : 'en', 'ie' : 'UTF-...
mit
Python
f21bb9d1b1d08fab8a127dc839b688338df30576
Fix auto-encoder
uaca/deepy,zomux/deepy,uaca/deepy,uaca/deepy,zomux/deepy
experiments/auto_encoders/rnn_auto_encoder.py
experiments/auto_encoders/rnn_auto_encoder.py
#!/usr/bin/env python # -*- coding: utf-8 -*- #!/usr/bin/env python # -*- coding: utf-8 -*- import os from deepy.networks import AutoEncoder from deepy.layers import RNN, Dense from deepy.trainers import SGDTrainer, LearningRateAnnealer from util import get_data, VECTOR_SIZE, SEQUENCE_LENGTH HIDDEN_SIZE = 50 model...
#!/usr/bin/env python # -*- coding: utf-8 -*- #!/usr/bin/env python # -*- coding: utf-8 -*- from deepy.networks import AutoEncoder from deepy.layers import RNN, Dense from deepy.trainers import SGDTrainer, LearningRateAnnealer from util import get_data, VECTOR_SIZE, SEQUENCE_LENGTH HIDDEN_SIZE = 50 model_path = o...
mit
Python
64d98bb88b5b7d2c98cfdd22d74761a80003e769
bump version
arraystream/simpleplotly
weplot/version.py
weplot/version.py
__version__ = '0.0.9'
__version__ = '0.0.8'
mit
Python
51c7728b6304f678e0eb6460470e0f5cc95b816f
Use print() function in both Python 2 and Python 3 (#52)
magenta/magenta-demos,magenta/magenta-demos,magenta/magenta-demos,magenta/magenta-demos,magenta/magenta-demos
ai-jam-js/maybe_download_mags.py
ai-jam-js/maybe_download_mags.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from six.moves.urllib.request import URLopener # This script downloads these .mag files if not already present. mag_files = [ 'http://download.magenta.tensorflow.org/models/attention_rnn.mag', ...
import os import urllib # This script downloads these .mag files if not already present. mag_files = [ 'http://download.magenta.tensorflow.org/models/attention_rnn.mag', 'http://download.magenta.tensorflow.org/models/performance.mag', 'http://download.magenta.tensorflow.org/models/pianoroll_rnn_nade.mag', ...
apache-2.0
Python
1db4d00640432e5ce3acc9580127527c49a30d64
Clear base_api cache in tests.
alephdata/aleph,alephdata/aleph,pudo/aleph,pudo/aleph,alephdata/aleph,alephdata/aleph,pudo/aleph,alephdata/aleph
aleph/tests/test_sessions_api.py
aleph/tests/test_sessions_api.py
import jwt from aleph.core import db, settings from aleph.model import Collection from aleph.logic.collections import update_collection from aleph.views.base_api import _metadata_locale from aleph.tests.util import TestCase from aleph.tests.factories.models import RoleFactory class SessionsApiTestCase(TestCase): ...
import jwt from aleph.core import db, settings from aleph.model import Collection from aleph.logic.collections import update_collection from aleph.tests.util import TestCase from aleph.tests.factories.models import RoleFactory class SessionsApiTestCase(TestCase): def setUp(self): super(SessionsApiTestCa...
mit
Python