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 |
|---|---|---|---|---|---|---|---|---|
ad0608847e8eef659f57d580c3816af653275339 | Fix paddle.init bug | putcn/Paddle,chengduoZH/Paddle,tensor-tang/Paddle,lcy-seso/Paddle,Canpio/Paddle,Canpio/Paddle,lcy-seso/Paddle,lispc/Paddle,reyoung/Paddle,Canpio/Paddle,chengduoZH/Paddle,luotao1/Paddle,tensor-tang/Paddle,tensor-tang/Paddle,hedaoyuan/Paddle,luotao1/Paddle,reyoung/Paddle,QiJune/Paddle,lispc/Paddle,baidu/Paddle,baidu/Padd... | python/paddle/v2/__init__.py | python/paddle/v2/__init__.py | # Copyright (c) 2016 PaddlePaddle 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 applic... | # Copyright (c) 2016 PaddlePaddle 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 applic... | apache-2.0 | Python |
cf54719f3a383f836bb9e4671d8e36ca8ebc0baa | fix the error | nanshihui/PocCollect,nanshihui/PocCollect | cms/phpcms/__init__.py | cms/phpcms/__init__.py | KEYWORDS = ['phpcms', ]
def rules(head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
if 'phpcms' in context or 'phpcms' in head:
return True
else:
return False | KEYWORDS = ['huaficms', ]
def rules(head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
if 'huaficms' in context or 'huaficms' in head:
return True
else:
return False | mit | Python |
ea0a31ce5f273c193b23548064efb04a85af9ce6 | Update hook-visvis.py | UmSenhorQualquer/pythonVideoAnnotator | build_settings/win/hooks/hook-visvis.py | build_settings/win/hooks/hook-visvis.py | from PyInstaller.utils.hooks import collect_submodules, collect_data_files
from visvis.freezeHelp import getIncludes
import visvis
import visvis.core
import visvis.processing
modules = getIncludes('qt4')
hiddenimports = tuple([collect_submodules(module) for module in modules]+[collect_submodules('visvis.core')+collec... | from PyInstaller.utils.hooks import collect_submodules, collect_data_files
import visvis
import visvis.core
import visvis.processing
hiddenimports = (collect_submodules('visvis.core') +
collect_submodules('visvis.processing'))
datas = collect_data_files('visvis', include_py_files=True)
| mit | Python |
032df1fe8649a622611e80e5e1efacdba4d7cafe | reorganize imports | diyclassics/cltk,mbevila/cltk,coderbhupendra/cltk,TylerKirby/cltk,kylepjohnson/cltk,D-K-E/cltk,cltk/cltk,LBenzahia/cltk,TylerKirby/cltk,LBenzahia/cltk | cltk/tests/test_ner.py | cltk/tests/test_ner.py | """Test cltk.ner."""
from cltk.ner import ner
from cltk.stem.latin.j_v import JVReplacer
import os
import unittest
__author__ = 'Kyle P. Johnson <kyle@kyle-p-johnson.com>'
__license__ = 'MIT License. See LICENSE.'
class TestSequenceFunctions(unittest.TestCase): # pylint: disable=R0904
"""Class for unittest"""
... | """Test cltk.ner."""
__author__ = 'Kyle P. Johnson <kyle@kyle-p-johnson.com>'
__license__ = 'MIT License. See LICENSE.'
from cltk.ner import ner
from cltk.stem.latin.j_v import JVReplacer
import os
import unittest
class TestSequenceFunctions(unittest.TestCase): # pylint: disable=R0904
"""Class for unittest"""
... | mit | Python |
91eeee8abbf516f00ce891076433c9222247bf67 | Add display names to historical calendars. | jwg4/qual,jwg4/calexicon | qual/calendars/historical.py | qual/calendars/historical.py | from datetime import date
from base import Calendar
from date import InvalidDate
from main import JulianCalendar
class JulianToGregorianCalendar(Calendar):
def date(self, year, month, day):
gregorian_date = date(year, month, day)
if gregorian_date < self.first_gregorian_day:
julian_dat... | from datetime import date
from base import Calendar
from date import InvalidDate
from main import JulianCalendar
class JulianToGregorianCalendar(Calendar):
def date(self, year, month, day):
gregorian_date = date(year, month, day)
if gregorian_date < self.first_gregorian_day:
julian_dat... | apache-2.0 | Python |
8ca30840b5477239625c93f4799f266f0a971e3d | Add query to json output in json generation test | uwescience/raco,uwescience/raco,uwescience/raco,uwescience/raco,uwescience/raco | raco/datalog/datalog_test.py | raco/datalog/datalog_test.py | import unittest
import json
import raco.fakedb
from raco import RACompiler
from raco.language import MyriaAlgebra
from myrialang import compile_to_json
class DatalogTestCase(unittest.TestCase):
def setUp(self):
self.db = raco.fakedb.FakeDatabase()
def execute_query(self, query):
'''Run a te... | import unittest
import json
import raco.fakedb
from raco import RACompiler
from raco.language import MyriaAlgebra
from myrialang import compile_to_json
class DatalogTestCase(unittest.TestCase):
def setUp(self):
self.db = raco.fakedb.FakeDatabase()
def execute_query(self, query):
'''Run a te... | bsd-3-clause | Python |
84adbc29ec97491b881f6636f6d74b94032cdeb7 | modify version code | DeanThompson/pyelong | pyelong/__init__.py | pyelong/__init__.py | # -*- coding: utf-8 -*-
from client import Client
from request import Request
from response import Response
__version__ = '0.3.6'
__all__ = ('Client', 'Request', 'Response')
| # -*- coding: utf-8 -*-
from client import Client
from request import Request
from response import Response
__version__ = '0.3.5'
__all__ = ('Client', 'Request', 'Response')
| mit | Python |
f443a8d254f58b0640d68a52185f83967a7ae7e5 | add trigram | danche354/Sequence-Labeling | tools/prepare.py | tools/prepare.py |
import numpy as np
import hashing
import conf
embedding_dict = conf.senna_dict
emb_vocab = conf.senna_vocab
auto_encoder_dict = conf.auto_encoder_dict
auto_vocab = conf.auto_vocab
step_length = conf.step_length
feature_length = conf.feature_length
ALL_IOB = conf.ALL_IOB_encode
NP_IOB = conf.NP_IOB_encode
POS = co... |
import numpy as np
import hashing
import conf
embedding_dict = conf.senna_dict
emb_vocab = conf.senna_vocab
auto_encoder_dict = conf.auto_encoder_dict
auto_vocab = conf.auto_vocab
step_length = conf.step_length
feature_length = conf.feature_length
ALL_IOB = conf.ALL_IOB_encode
NP_IOB = conf.NP_IOB_encode
POS = co... | mit | Python |
99feb65afd3ab18791932b50aa11f76c8f45d5d8 | use text() in XPath query | eka/pygrabbit | pygrabbit/parser.py | pygrabbit/parser.py | import requests
from lxml import html
from ._compat import urljoin
from ._helpers import cached_attribute
class PyGrabbit:
headers = {'User-agent': 'PyGrabbit 0.1'}
def __init__(self, url):
self.url = url
self._tree = None
self._content = requests.get(url, headers=self.headers).text
... | import requests
from lxml import html
from ._compat import urljoin
from ._helpers import cached_attribute
class PyGrabbit:
headers = {'User-agent': 'PyGrabbit 0.1'}
def __init__(self, url):
self.url = url
self._tree = None
self._content = requests.get(url, headers=self.headers).text
... | mit | Python |
b8f33283014854bfa2d92896e2061bf17de00836 | Revert "Try not importing basal_area_increment to init" | tesera/pygypsy,tesera/pygypsy | pygypsy/__init__.py | pygypsy/__init__.py | """pygypsy
Based on Hueng et all (2009)
Huang, S., Meng, S. X., & Yang, Y. (2009). A growth and yield projection system
(GYPSY) for natural and post-harvest stands in Alberta. Forestry Division,
Alberta Sustainable Resource Development, 25.
Important Acronyms:
aw = white aspen
sb = black spruce
sw = white spruce
pl... | """pygypsy
Based on Hueng et all (2009)
Huang, S., Meng, S. X., & Yang, Y. (2009). A growth and yield projection system
(GYPSY) for natural and post-harvest stands in Alberta. Forestry Division,
Alberta Sustainable Resource Development, 25.
Important Acronyms:
aw = white aspen
sb = black spruce
sw = white spruce
pl... | mit | Python |
954e4882a496433162313110ac7f6bbe2b2eaaba | update version number | Synss/pyhard2 | pyhard2/__init__.py | pyhard2/__init__.py | __version__ = u"1.0.0 beta"
| __version__ = u"0.9.8c alpha"
| mit | Python |
740a06df7e92ff53c9b5a66c06f97476193b8799 | add an example for the marker usage | ianupright/micropsi2,ianupright/micropsi2,printedheart/micropsi2,printedheart/micropsi2,ianupright/micropsi2,printedheart/micropsi2 | micropsi_core/tests/test_node.py | micropsi_core/tests/test_node.py | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
"""
Tests for node, nodefunction and the like
"""
from micropsi_core.nodenet.node import Nodetype
from micropsi_core.nodenet.nodefunctions import register, concept
from micropsi_core import runtime as micropsi
import pytest
@pytest.mark.engine("theano_engine")
def tes... | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
"""
Tests for node, nodefunction and the like
"""
from micropsi_core.nodenet.node import Nodetype
from micropsi_core.nodenet.nodefunctions import concept
from micropsi_core import runtime as micropsi
def test_nodetype_function_definition_overwrites_default_function_na... | mit | Python |
3a61b480285c5a7d0f99ae91fbd278679444c0c3 | add some comments | thefab/tornadis,thefab/tornadis | tornadis/pool.py | tornadis/pool.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of tornadis library released under the MIT license.
# See the LICENSE file for more information.
import tornado.gen
import toro
import functools
from collections import deque
from tornadis.client import Client
from tornadis.utils import ContextManage... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of tornadis library released under the MIT license.
# See the LICENSE file for more information.
import tornado.gen
import toro
import functools
from collections import deque
from tornadis.client import Client
from tornadis.utils import ContextManage... | mit | Python |
51814e57103e75deaec11af81d85d13ed80ec594 | Bump version number to 0.2 | mila-udem/fuel,aalmah/fuel,capybaralet/fuel,dmitriy-serdyuk/fuel,capybaralet/fuel,aalmah/fuel,dribnet/fuel,dribnet/fuel,dmitriy-serdyuk/fuel,udibr/fuel,vdumoulin/fuel,udibr/fuel,mila-udem/fuel,vdumoulin/fuel | fuel/version.py | fuel/version.py | version = '0.2.0'
| version = '0.1.1'
| mit | Python |
72ce164a461987f7b9d35ac9a2b3a36386b7f8c9 | Add possibility of passing priority for adding an observer | berendkleinhaneveld/Registrationshop,berendkleinhaneveld/Registrationshop | ui/Interactor.py | ui/Interactor.py | """
Interactor
This class can be used to simply managing callback resources.
Callbacks are often used by interactors with vtk and callbacks
are hard to keep track of.
Use multiple inheritance to inherit from this class to get access
to the convenience methods.
Observers for vtk events can be added through
AddObserver... | """
Interactor
This class can be used to simply managing callback resources.
Callbacks are often used by interactors with vtk and callbacks
are hard to keep track of.
Use multiple inheritance to inherit from this class to get access
to the convenience methods.
Observers for vtk events can be added through
AddObserver... | mit | Python |
5fc75cda8c56145ee803943f018420620db186db | add history command | bjarneo/Pytify,bjarneo/Pytify,jaruserickson/spotiplay | pytify/commander.py | pytify/commander.py | from __future__ import absolute_import, unicode_literals
class Commander():
def __init__(self, Pytifylib):
self.pytify = Pytifylib
def parse(self, command):
if command[0] != '/':
return ''
command = command.replace('/', '')
return command
def commands(self):... | from __future__ import absolute_import, unicode_literals
class Commander():
def __init__(self, Pytifylib):
self.pytify = Pytifylib
def parse(self, command):
if command[0] != '/':
return ''
command = command.replace('/', '')
return command
def commands(self):... | mit | Python |
2370c601f087e0d342287c400654a9ceab22c504 | Add function to send email from a template | renalreg/radar,renalreg/radar,renalreg/radar,renalreg/radar | radar/radar/mail.py | radar/radar/mail.py | import smtplib
from email.mime.text import MIMEText, MIMEMultipart
from flask import current_app
COMMA_SPACE = ', '
def send_email(to_addresses, subject, message_plain, message_html=None, from_address=None):
if from_address is None:
from_address = current_app.config.get('FROM_ADDRESS', 'bot@radar.nhs.uk... | import smtplib
from email.mime.text import MIMEText, MIMEMultipart
from flask import current_app
COMMA_SPACE = ', '
def send_email(to_addresses, subject, message_plain, message_html=None, from_address=None):
if from_address is None:
from_address = current_app.config.get('FROM_ADDRESS', 'bot@radar.nhs.uk... | agpl-3.0 | Python |
281cf28a3eb64442957ce76d5681c4fba9c66d23 | Update corpus docstring (no need to fit dictionary first). | escherba/glove-python,joshloyal/glove-python,ChristosChristofidis/glove-python,maciejkula/glove-python | glove/corpus.py | glove/corpus.py | # Cooccurrence matrix construction tools
# for fitting the GloVe model.
try:
# Python 2 compat
import cPickle as pickle
except ImportError:
import pickle
from .corpus_cython import construct_cooccurrence_matrix
class Corpus(object):
"""
Class for constructing a cooccurrence matrix
from a cor... | # Cooccurrence matrix construction tools
# for fitting the GloVe model.
try:
# Python 2 compat
import cPickle as pickle
except ImportError:
import pickle
from .corpus_cython import construct_cooccurrence_matrix
class Corpus(object):
"""
Class for constructing a cooccurrence matrix
from a cor... | apache-2.0 | Python |
7919ee8374b3f3d15d45ee04f50c1de82f91b19d | Implement authentication and added resources | GooeeIOT/gooee-python-sdk | gooee/client.py | gooee/client.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from platform import platform
import requests
from .compat import json
from .decorators import resource
from .exceptions import (
IllegalHttpMethod,
)
from . import __version__
from .utils import (
format_path,
GOOEE_API_URL
)
class Gooee(o... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from platform import platform
import requests
from .compat import json
from .exceptions import (
IllegalHttpMethod,
)
from . import __version__
from .utils import (
format_path,
GOOEE_API_URL
)
class Gooee(object):
"""Gooee HTTP client ... | apache-2.0 | Python |
5ae3172898b65c3a63c85cecb4355ccf8cb34e54 | raise error if no file is provided | RasaHQ/rasa_core,RasaHQ/rasa_nlu,RasaHQ/rasa_core,RasaHQ/rasa_nlu,RasaHQ/rasa_core,RasaHQ/rasa_nlu | rasa_core/config.py | rasa_core/config.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from typing import Optional, Text, Dict, Any, List
from rasa_core import utils
from rasa_core.policies import PolicyEnsemble
def load(config_file):
# type: (Option... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from typing import Optional, Text, Dict, Any, List
from rasa_core import utils
from rasa_core.policies import PolicyEnsemble
def load(config_file):
# type: (Option... | apache-2.0 | Python |
d593d3d8f8487cdc933c088a83b632b4baaf8e8a | add fsType to config.file | LiquidSame/rbh-quota | rbh_quota/config.py | rbh_quota/config.py | #!/usr/bin/env python
import ConfigParser
import socket
from os.path import expanduser
Config = ConfigParser.ConfigParser()
Config.read(expanduser('~/.rbh-quota.ini'))
try:
db_host = Config.get('rbh-quota_api', 'db_host')
except:
db_host = ''
try:
db_user = Config.get('rbh-quota_api', 'db_user')
except:
... | #!/usr/bin/env python
import ConfigParser
import socket
from os.path import expanduser
Config = ConfigParser.ConfigParser()
Config.read(expanduser('~/.rbh-quota.ini'))
try:
db_host = Config.get('rbh-quota_api', 'db_host')
except:
db_host = ''
try:
db_user = Config.get('rbh-quota_api', 'db_user')
except:
... | mit | Python |
2b724f32ecd311ce526b433ec81399c7a8e8e202 | Update settings.py | Programmeerclub-WLG/Agenda-App | gui/settings.py | gui/settings.py |
"""
Dit is het bestand voor het aanpassen van instellingen scherm voor de Agenda-App
Het heeft een aantal functies en dezen staat beschreven in de drive.
<LICENSE>
<COPYRIGHT NOTICE>
<DEVELOPER>
<VERSION and DATE>
"""
| apache-2.0 | Python | |
4a4fcd362865bb8ae0d23f9232e9e2e4c3cef0a0 | Add error check for body | poliastro/poliastro | src/poliastro/twobody/mean_elements.py | src/poliastro/twobody/mean_elements.py | import erfa
from astropy import units as u
from astropy.coordinates.solar_system import PLAN94_BODY_NAME_TO_PLANET_INDEX
from poliastro.bodies import SOLAR_SYSTEM_BODIES
from ..constants import J2000
from ..frames import Planes
from .states import RVState
def get_mean_elements(body, epoch=J2000):
"""Get eclipti... | import erfa
from astropy import units as u
from astropy.coordinates.solar_system import PLAN94_BODY_NAME_TO_PLANET_INDEX
from ..constants import J2000
from ..frames import Planes
from .states import RVState
from poliastro.bodies import Sun, Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune
SOLAR_SYSTEM_B... | mit | Python |
06d9c54dc06db2ea7d2315bd2705fc55d06587a5 | Add function numeric typed weekday to string typed weekday. | why2pac/dp-tornado,why2pac/dp-tornado,why2pac/dp-tornado,why2pac/dp-tornado | helper/korea.py | helper/korea.py | #
# dp for Tornado
# YoungYong Park (youngyongpark@gmail.com)
# 2014.10.23
#
from __future__ import absolute_import
from engine.helper import Helper as dpHelper
class KoreaHelper(dpHelper):
def readable_phone_number(self, number, separator='-'):
number = str(self.helper.numeric.extract_numbers(number)... | #
# dp for Tornado
# YoungYong Park (youngyongpark@gmail.com)
# 2014.10.23
#
from __future__ import absolute_import
from engine.helper import Helper as dpHelper
class KoreaHelper(dpHelper):
def readable_phone_number(self, number, separator='-'):
number = str(self.helper.numeric.extract_numbers(number)... | mit | Python |
addb5337bff43888d500f2782778b26a1e976581 | Bump version number to 0.2.10 | kblin/ncbi-genome-download,kblin/ncbi-genome-download | ncbi_genome_download/__init__.py | ncbi_genome_download/__init__.py | """Download genome files from the NCBI"""
from .config import (
SUPPORTED_TAXONOMIC_GROUPS,
NgdConfig
)
from .core import (
args_download,
download,
argument_parser,
)
__version__ = '0.2.10'
__all__ = [
'download',
'args_download',
'SUPPORTED_TAXONOMIC_GROUPS',
'NgdConfig',
'arg... | """Download genome files from the NCBI"""
from .config import (
SUPPORTED_TAXONOMIC_GROUPS,
NgdConfig
)
from .core import (
args_download,
download,
argument_parser,
)
__version__ = '0.2.9'
__all__ = [
'download',
'args_download',
'SUPPORTED_TAXONOMIC_GROUPS',
'NgdConfig',
'argu... | apache-2.0 | Python |
e9bd4dc3285922ce1333b41b9eb2d97164b64257 | Update views to send proper responses | avinassh/nightreads,avinassh/nightreads | nightreads/user_manager/views.py | nightreads/user_manager/views.py | from django.views.generic import View
from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt
from django.utils.decorators import method_decorator
from .forms import SubscribeForm, UnsubscribeForm, ConfirmEmailForm
from . import user_service
class SubscribeView(View):
form_class... | from django.views.generic import View
from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt
from django.utils.decorators import method_decorator
from .forms import SubscribeForm, UnsubscribeForm, ConfirmEmailForm
from . import user_service
class SubscribeView(View):
form_class... | mit | Python |
9980c5defc34eb125ba5f2b39f0d9a67e6490269 | add regex conditional for n s e w | cds-amal/addressparser,cds-amal/addressparser,cds-amal/addressparser,cds-amal/addressparser | nyctext/neighborhoods/regexps.py | nyctext/neighborhoods/regexps.py | import re
from throughways import names as throughway_names
def make_neighorbood_regex(lHoods, city):
hoods = '|'.join(lHoods)
hoods = '(%s)' % hoods
# Don't match if neighborhood is followed
# by a thoroughfare name
names = throughway_names[1:-1] # remove parens
names = '(%s|%s|north|south... | import re
from throughways import names as throughway_names
def make_neighorbood_regex(lHoods, city):
hoods = '|'.join(lHoods)
hoods = '(%s)' % hoods
# Don't match if neighborhood is followed
# by a thoroughfare name
names = throughway_names[1:-1] # remove parens
names = '(%s|%s)' % (names,... | mit | Python |
31ae945c8d7d885dc019eaf7bb4e8c2dc4619dfc | Remove unneeded 'output_file' variable | mdpiper/dakota-experiments,mdpiper/dakota-experiments,mdpiper/dakota-experiments | experiments/delft3d-ps-1/run_delft3d.py | experiments/delft3d-ps-1/run_delft3d.py | #! /usr/bin/env python
# Brokers communication between Delft3D and Dakota through files.
# Mark Piper (mark.piper@colorado.edu)
import sys
import os
import shutil
from subprocess import call, check_output
import time
def job_is_running(job_id):
'''
Returns True if the PBS job with the given id is running.
... | #! /usr/bin/env python
# Brokers communication between Delft3D and Dakota through files.
# Mark Piper (mark.piper@colorado.edu)
import sys
import os
import shutil
from subprocess import call, check_output
import time
def job_is_running(job_id):
'''
Returns True if the PBS job with the given id is running.
... | mit | Python |
e880aaa34fee44e1da1b9c3d7109c1fe500e9d04 | add version number | ojengwa/ibu,ojengwa/migrate | ibu/__init__.py | ibu/__init__.py | __version__ = '0.0.2'
docs_url = 'http://github.com'
| __version__ = '0.0.2'
| mit | Python |
9e413e02961975f36a134d601b3629c668a16fe9 | Use processes with celery and threads with multiprocessing | gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine | openquake/commands/with_tiles.py | openquake/commands/with_tiles.py | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2017 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, o... | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2017 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, o... | agpl-3.0 | Python |
1ca6c23f6fce8f052890547890ab326e796e1cd4 | update database info | ThinkmanWang/NotesServer,ThinkmanWang/NotesServer,ThinkmanWang/NotesServer | utils/dbutils.py | utils/dbutils.py | import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'models'))
#print(sys.path)
from mysql_python import MysqlPython
from models.User import User
from models.Customer import Customer
import MySQLdb
from DBUtils.PooledDB import PooledDB
import hashlib
import time
g_dbPool ... | import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'models'))
#print(sys.path)
from mysql_python import MysqlPython
from models.User import User
from models.Customer import Customer
import MySQLdb
from DBUtils.PooledDB import PooledDB
import hashlib
import time
g_dbPool ... | apache-2.0 | Python |
b2bab632d3eac82b910d65e37fc78d8a0a3c2209 | set up active scanning | hbock/bgasync | utils/scanner.py | utils/scanner.py | """
Test utility to create a Bluetooth LE scan table.
"""
import sys
import argparse
from bgasync import api
from bgasync.twisted.protocol import BluegigaProtocol
from twisted.internet.serialport import SerialPort
from twisted.internet.defer import inlineCallbacks
from twisted.internet.task import deferLater
from twi... | """
Test utility to create a Bluetooth LE scan table.
"""
import sys
import argparse
from bgasync import api
from bgasync.twisted.protocol import BluegigaProtocol
from twisted.internet.serialport import SerialPort
from twisted.internet.defer import inlineCallbacks
from twisted.internet.task import deferLater
from twi... | bsd-2-clause | Python |
8a5b0c70164c7bc76d8825d77654f2804b9529e6 | Fix typo | lindareijnhoudt/resync,dans-er/resync,dans-er/resync,lindareijnhoudt/resync,resync/resync | resync/source_description.py | resync/source_description.py | """ResourceSync Description object
A ResourceSync Description enumerates the Capability Lists
offered by a Source. Since a Source has one Capability List
per set of resources that it distinguishes, the
ResourceSync Description will enumerate as many Capability
Lists as the Source has distinct sets of resources.
Th... | """ResourceSync Description object
A ResourceSync Description enumerates the Capability Lists
offered by a Source. Since a Source has one Capability List
per set of resources that it distinguishes, the
ResourceSync Description will enumerate as many Capability
Lists as the Source has distinct sets of resources.
Th... | apache-2.0 | Python |
8d2ffbb17ce5dac6ae8abdf3c612e3348027090d | Add PUBLIC_IPS to consolidate socket logic | ipython/ipython,ipython/ipython | IPython/utils/localinterfaces.py | IPython/utils/localinterfaces.py | """Simple utility for building a list of local IPs using the socket module.
This module defines two constants:
LOCALHOST : The loopback interface, or the first interface that points to this
machine. It will *almost* always be '127.0.0.1'
LOCAL_IPS : A list of IP addresses, loopback first, that point to t... | """Simple utility for building a list of local IPs using the socket module.
This module defines two constants:
LOCALHOST : The loopback interface, or the first interface that points to this
machine. It will *almost* always be '127.0.0.1'
LOCAL_IPS : A list of IP addresses, loopback first, that point to t... | bsd-3-clause | Python |
0473ba4bb1592c480f5741839fbf1dad59dd0403 | Print stats for researcher and department in tests | wetneb/dissemin,Lysxia/dissemin,dissemin/dissemin,wetneb/dissemin,dissemin/dissemin,dissemin/dissemin,dissemin/dissemin,wetneb/dissemin,Lysxia/dissemin,Lysxia/dissemin,dissemin/dissemin,wetneb/dissemin,Lysxia/dissemin | statistics/tests.py | statistics/tests.py | # Dissemin: open access policy enforcement tool
# Copyright (C) 2014 Antonin Delpeuch
#
# This program 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 2
# of the License, or (at your opti... | # Dissemin: open access policy enforcement tool
# Copyright (C) 2014 Antonin Delpeuch
#
# This program 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 2
# of the License, or (at your opti... | agpl-3.0 | Python |
bfdcc8bb36fba26baed28e2846a7ae193154a12b | fix the method to validate invoice | ClearCorp/odoo-clearcorp,ClearCorp/odoo-clearcorp,ClearCorp/odoo-clearcorp,ClearCorp/odoo-clearcorp | partner_slow_payer/models/res_partner.py | partner_slow_payer/models/res_partner.py | # -*- coding: utf-8 -*-
# © 2016 ClearCorp
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
from datetime import date
from openerp.exceptions import Warning
class ResPartner(models.Model):
_inherit = 'res.partner'
slow_payer = fields.Boolean('Slow... | # -*- coding: utf-8 -*-
# © 2016 ClearCorp
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
from datetime import date
from openerp.exceptions import Warning
class ResPartner(models.Model):
_inherit = 'res.partner'
slow_payer = fields.Boolean('Slow... | agpl-3.0 | Python |
63b2ed03b843d4eec0d15231d1b8d612a1df5a10 | use f-strings to help serialize int metadata (fix #63) | EmilStenstrom/conllu | conllu/serializer.py | conllu/serializer.py | import typing as T
from conllu.exceptions import ParseException
if T.TYPE_CHECKING:
from conllu.models import TokenList
def serialize_field(field: T.Any) -> str:
if field is None:
return '_'
if isinstance(field, dict):
fields = []
for key, value in field.items():
if ... | import typing as T
from conllu.exceptions import ParseException
if T.TYPE_CHECKING:
from conllu.models import TokenList
def serialize_field(field: T.Any) -> str:
if field is None:
return '_'
if isinstance(field, dict):
fields = []
for key, value in field.items():
if ... | mit | Python |
c6b9db6842f5c1929fd67e13647fe81b9242b328 | return blob count | scienceopen/CVutils | connectedComponents.py | connectedComponents.py | import cv2
try: #OpenCV 2.4
from cv2 import SimpleBlobDetector as SimpleBlobDetector
except ImportError: #OpenCV 3
from cv2 import SimpleBlobDetector_create as SimpleBlobDetector
def doblob(morphed,blobdet,img):
"""
img: can be RGB (MxNx3) or gray (MxN)
http://docs.opencv.org/master/modules/feature... | import cv2
try: #OpenCV 2.4
from cv2 import SimpleBlobDetector as SimpleBlobDetector
except ImportError: #OpenCV 3
from cv2 import SimpleBlobDetector_create as SimpleBlobDetector
def doblob(morphed,blobdet,img):
"""
img: can be RGB (MxNx3) or gray (MxN)
http://docs.opencv.org/master/modules/feature... | mit | Python |
021230bb5284de0fa5454df5f933e38b3539acd4 | add devilvery trip list | singesavant/salesmonkey | salesmonkey/delivery/rest.py | salesmonkey/delivery/rest.py | import logging
from werkzeug.exceptions import (
NotFound
)
from flask_apispec import (
marshal_with,
MethodResource,
use_kwargs
)
from erpnext_client.documents import (
ERPDeliveryTrip,
ERPContact,
ERPAddress
)
from erpnext_client.schemas import (
ERPDeliveryTripSchema,
ERPDeliv... | import logging
from werkzeug.exceptions import (
NotFound
)
from flask_apispec import (
marshal_with,
MethodResource,
use_kwargs
)
from erpnext_client.documents import (
ERPDeliveryTrip,
ERPContact,
ERPAddress
)
from erpnext_client.schemas import (
ERPDeliveryTripSchema,
ERPDeliv... | agpl-3.0 | Python |
a93fc1d9455cc520f2cdef819205b13640677355 | Add import errno (#3) | SandstoneHPC/sandstone-spawner | sandstone_spawner/spawner.py | sandstone_spawner/spawner.py | from jupyterhub.spawner import LocalProcessSpawner
from jupyterhub.utils import random_port
from subprocess import Popen
from tornado import gen
import pipes
import shutil
import os
import errno
# This is the path to the sandstone-jupyterhub script
APP_PATH = os.environ.get('SANDSTONE_APP_PATH')
SANDSTONE_SETTINGS ... | from jupyterhub.spawner import LocalProcessSpawner
from jupyterhub.utils import random_port
from subprocess import Popen
from tornado import gen
import pipes
import shutil
import os
# This is the path to the sandstone-jupyterhub script
APP_PATH = os.environ.get('SANDSTONE_APP_PATH')
SANDSTONE_SETTINGS = os.environ.... | mit | Python |
85c1f90a6e46e76ab3a59580a2a1620d849a987f | Change namespaces | jessepeng/coburg-city-memory,jessepeng/coburg-city-memory,fraunhoferfokus/mobile-city-memory,fraunhoferfokus/mobile-city-memory | Mobiles_Stadtgedaechtnis/urls.py | Mobiles_Stadtgedaechtnis/urls.py | from django.conf.urls import patterns, include, url
import stadtgedaechtnis_backend.admin
import settings
js_info_dict = {
'packages': ('stadtgedaechtnis_backend',),
}
urlpatterns = patterns('',
url(r'^', include('stadtgedaechtnis_backend.urls', namespace="stadtgedaechtnis_backend")),
url(r'^', include('... | from django.conf.urls import patterns, include, url
import stadtgedaechtnis.admin
import settings
js_info_dict = {
'packages': ('stadtgedaechtnis',),
}
urlpatterns = patterns('',
url(r'^', include('stadtgedaechtnis.urls', namespace="stadtgedaechtnis")),
url(r'^', include('stadtgedaechtnis_frontend.urls',... | mit | Python |
a0b4f997b2f0d29a99a3b95e247169b9b0222b7a | Bump boto version | pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus | packages/pegasus-worker/setup.py | packages/pegasus-worker/setup.py | import os
import subprocess
from setuptools import find_packages, setup
src_dir = os.path.dirname(__file__)
home_dir = os.path.abspath(os.path.join(src_dir, "../.."))
install_requires = [
"six>=1.9.0",
"boto==2.49.0",
"globus-sdk==1.4.1",
]
#
# Utility function to read the pegasus Version.in file
#
def... | import os
import subprocess
from setuptools import find_packages, setup
src_dir = os.path.dirname(__file__)
home_dir = os.path.abspath(os.path.join(src_dir, "../.."))
install_requires = [
"six>=1.9.0",
"boto==2.48.0",
"globus-sdk==1.4.1",
]
#
# Utility function to read the pegasus Version.in file
#
def... | apache-2.0 | Python |
83f56db640dd22a40693a31826b6c89de3adf9a1 | Fix bug | pmatos/maxsatzilla,pmatos/maxsatzilla,pmatos/maxsatzilla,pmatos/maxsatzilla,pmatos/maxsatzilla | run-instance-set.py | run-instance-set.py | #!/usr/bin/env python
import sys, os, getopt, glob, os.path, signal, tempfile
opts, args = getopt.getopt( sys.argv[1:], 'p:' )
solver = args[0]
set_list = args[1]
execution_list = args[2:]
if len( opts ) == 1:
print '# Percentatge = ' + opts[0][1]
percentatge = int( opts[0][1] )
else:
percentatge = 100
t... | #!/usr/bin/env python
import sys, os, getopt, glob, os.path, signal, tempfile
opts, args = getopt.getopt( sys.argv[1:], 'p:' )
solver = args[0]
set_list = args[1]
execution_list = args[2:]
if len( opts ) == 1:
print '# Percentatge = ' + opts[0][1]
percentatge = int( opts[0][1] )
else:
percentatge = 100
t... | mit | Python |
66a425599e2b88336cf78f64c8ad04a88045ad1c | Improve docs | KeplerGO/K2metadata,barentsen/K2metadata,barentsen/k2-target-index | scripts/3-create-database.py | scripts/3-create-database.py | """Export a CSV and SQLite database detailing all the K2 target pixel files.
"""
import glob
import logging
import sqlite3
import pandas as pd
log = logging.getLogger(__name__)
log.setLevel("INFO")
# Output filenames
CSV_FILENAME = "../k2-target-pixel-files.csv"
SQLITE_FILENAME = "../k2-target-pixel-files.db"
if _... | """Creates an SQLite database detailing all the K2 target pixel files.
TODO
----
* Add an index to the sqlite table?
"""
import glob
import logging
import sqlite3
import pandas as pd
log = logging.getLogger(__name__)
log.setLevel("INFO")
CSV_FILENAME = "../k2-target-pixel-files.csv"
SQLITE_FILENAME = "../k2-targe... | mit | Python |
4a37cd5dde97d58da43fd664b807362e67a38eeb | bump version | crateio/carrier | conveyor/__init__.py | conveyor/__init__.py | __version__ = "0.1.dev18"
| __version__ = "0.1.dev17"
| bsd-2-clause | Python |
2fab26a2ae3fc3bb76b63d4744accf40fc5db4d6 | Add support for --version. | flaccid/akaudit | akaudit/clidriver.py | akaudit/clidriver.py | #!/usr/bin/env python
# Copyright 2015 Chris Fordham
#
# 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 ... | #!/usr/bin/env python
# Copyright 2015 Chris Fordham
#
# 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 |
3e957e939fa1ab4a003202c250f5895c2da04312 | use default host | uw-it-cte/wheniwork-restclient,uw-it-cte/wheniwork-restclient | wheniwork/dao.py | wheniwork/dao.py | from os.path import abspath, dirname, join
from restclients_core.dao import DAO
class WhenIWork_DAO(DAO):
def service_name(self):
return 'wheniwork'
def service_mock_paths(self):
return [abspath(join(dirname(__file__), "resources"))]
def get_default_service_setting(self, key):
i... | from os.path import abspath, dirname, join
from restclients_core.dao import DAO
class WhenIWork_DAO(DAO):
def service_name(self):
return 'wheniwork'
def service_mock_paths(self):
return [abspath(join(dirname(__file__), "resources"))]
| apache-2.0 | Python |
69b50cbe9816bf5c4cd8c405d28d75cd31e3c0ae | Fix alignak_home for windows | Alignak-monitoring-contrib/alignak-app,Alignak-monitoring-contrib/alignak-app | alignak_app/utils.py | alignak_app/utils.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2016:
# Matthieu Estrada, ttamalfor@gmail.com
#
# This file is part of (AlignakApp).
#
# (AlignakApp) 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 Sof... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2016:
# Matthieu Estrada, ttamalfor@gmail.com
#
# This file is part of (AlignakApp).
#
# (AlignakApp) 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 Sof... | agpl-3.0 | Python |
c635a8bd409dcd985352c821410949c39620dcbb | Fix 0016 | Show-Me-the-Code/python,Yrthgze/prueba-sourcetree2,Yrthgze/prueba-sourcetree2,Show-Me-the-Code/python,Yrthgze/prueba-sourcetree2,Show-Me-the-Code/python,Yrthgze/prueba-sourcetree2,Show-Me-the-Code/python,Show-Me-the-Code/python,Yrthgze/prueba-sourcetree2,Yrthgze/prueba-sourcetree2,Show-Me-the-Code/python | Drake-Z/0016/0016.py | Drake-Z/0016/0016.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''第 0016 题: 纯文本文件 numbers.txt, 里面的内容(包括方括号)如下所示:
[
[1, 82, 65535],
[20, 90, 13],
[26, 809, 1024]
]
请将上述内容写到 numbers.xls 文件中。'''
__author__ = 'Drake-Z'
import os
import re
from collections import OrderedDict
import xlwt
def shuju(data, re1, re2):
c = O... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''第 0015 题: 纯文本文件 city.txt为城市信息, 里面的内容(包括花括号)如下所示:
{
"1" : "上海",
"2" : "北京",
"3" : "成都"
}
请将上述内容写到 city.xls 文件中。'''
__author__ = 'Drake-Z'
import os
import re
from collections import OrderedDict
import xlwt
def shuju(data, re1, re2):
c = OrderedDict([]... | mit | Python |
dd38751a775cdbf5a006dd4fd3ce1ed335d94549 | use x0 = '00C' | simpeg/simpeg,simpeg/discretize,simpeg/discretize,simpeg/discretize | SimPEG/Examples/Mesh_Plot_Cyl.py | SimPEG/Examples/Mesh_Plot_Cyl.py | import numpy as np
import matplotlib.pyplot as plt
from SimPEG import Mesh, Utils, Maps
# Set a nice colormap!
plt.set_cmap(plt.get_cmap('viridis'))
def run(plotIt=True):
"""
Plot Mirrored Cylindrically Symmetric Model
===========================================
Here, we demonstrate plot... | import numpy as np
import matplotlib.pyplot as plt
from SimPEG import Mesh, Utils, Maps
# Set a nice colormap!
plt.set_cmap(plt.get_cmap('viridis'))
def run(plotIt=True):
"""
Plot Mirrored Cylindrically Symmetric Model
===========================================
Here, we demonstrate plot... | mit | Python |
4b0dce64ccac8b8658e49e0ff36714872158a428 | Add missing re.UNICODE flag to re.compile call | samjabrahams/anchorhub | anchorhub/builtin/github/cstrategies.py | anchorhub/builtin/github/cstrategies.py | """
Concrete CollectorStrategy classes for the GitHub built-in module
"""
import re
from anchorhub.collector import CollectorStrategy
class MarkdownATXCollectorStrategy(CollectorStrategy):
"""
Concrete collector strategy used to parse ATX style headers that have
AnchorHub tags specified
ATX style he... | """
Concrete CollectorStrategy classes for the GitHub built-in module
"""
import re
from anchorhub.collector import CollectorStrategy
class MarkdownATXCollectorStrategy(CollectorStrategy):
"""
Concrete collector strategy used to parse ATX style headers that have
AnchorHub tags specified
ATX style he... | apache-2.0 | Python |
03b8e53bae5125ddf79df4803152909a27217510 | Bump version -> 0.2.4 | nickstenning/tagalog,alphagov/tagalog,nickstenning/tagalog,alphagov/tagalog | tagalog/__init__.py | tagalog/__init__.py | from __future__ import unicode_literals
import datetime
import os
from tagalog import io
__all__ = ['io', 'stamp', 'tag', 'fields']
__version__ = '0.2.4'
# Use UTF8 for stdin, stdout, stderr
os.environ['PYTHONIOENCODING'] = 'utf-8'
def now():
return _now().strftime('%Y-%m-%dT%H:%M:%S.%fZ')
def stamp(iterabl... | from __future__ import unicode_literals
import datetime
import os
from tagalog import io
__all__ = ['io', 'stamp', 'tag', 'fields']
__version__ = '0.2.3'
# Use UTF8 for stdin, stdout, stderr
os.environ['PYTHONIOENCODING'] = 'utf-8'
def now():
return _now().strftime('%Y-%m-%dT%H:%M:%S.%fZ')
def stamp(iterabl... | mit | Python |
655cdb0c58a6eeb268c80818fa3a245c06f9404b | put tree_li on old | francisl/vcms,francisl/vcms,francisl/vcms,francisl/vcms | modules/vcms/apps/vwm/tree/generator.py | modules/vcms/apps/vwm/tree/generator.py | # encoding: utf-8
# copyright Vimba inc. 2010
# programmer : Francis Lavoie
from django import template
from django.template.loader import render_to_string
register = template.Library()
@register.inclusion_tag('tree/tree_dl.html')
def generetate_dl_tree(data, cssid, cssclass):
return {"data":data, "cssid":cssid,... | # encoding: utf-8
# copyright Vimba inc. 2010
# programmer : Francis Lavoie
from django import template
from django.template.loader import render_to_string
register = template.Library()
@register.inclusion_tag('tree/tree_dl.html')
def generetate_dl_tree(data, cssid, cssclass):
return {"data":data, "cssid":cssid,... | bsd-3-clause | Python |
0055e044a504e37fa96359e1bdb161fbad1acf78 | Update about_new_style_classes.py | yashwanthbabu/python_koans_python2_solutions,yashwanthbabu/python_koans_python2_solutions | python2/koans/about_new_style_classes.py | python2/koans/about_new_style_classes.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutNewStyleClasses(Koan):
class OldStyleClass:
"An old style class"
# Original class style have been phased out in Python 3.
class NewStyleClass(object):
"A new style class"
# Introduced in Python... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutNewStyleClasses(Koan):
class OldStyleClass:
"An old style class"
# Original class style have been phased out in Python 3.
class NewStyleClass(object):
"A new style class"
# Introduced in Python... | mit | Python |
327903dce8105c320ed1188587e2104dd2ad2c04 | fix bug | nick6918/ThingCloud,nick6918/ThingCloud,nick6918/ThingCloud | ThingCloud/OrderSystem/models.py | ThingCloud/OrderSystem/models.py | # -*- coding: utf-8 -*-
from django.db import models
from AccountSystem.models import User
from CloudList.models import Address, WareHouse
from MainSystem.models import Employee
from django.forms.models import model_to_dict
from TCD_lib.utils import dictPolish
# Create your models here.
class Courier(models.Model):
... | # -*- coding: utf-8 -*-
from django.db import models
from AccountSystem.models import User
from CloudList.models import Address, WareHouse
from MainSystem.models import Employee
from django.forms.models import model_to_dict
from TCD_lib.utils import dictPolish
# Create your models here.
class Courier(models.Model):
... | mit | Python |
7e60524b9443d1815334aa7df9b44cfe363acafd | Update to version v0.7.7rc2 | jeffknupp/sandman,webwlsong/sandman,jeffknupp/sandman,beni55/sandman,webwlsong/sandman,webwlsong/sandman,jmcarp/sandman,jeffknupp/sandman,jmcarp/sandman,beni55/sandman,aprilcs/sandman,aprilcs/sandman,jmcarp/sandman,aprilcs/sandman,beni55/sandman | sandman/__init__.py | sandman/__init__.py | """Sandman automatically generates a REST API from your existing database,
without you needing to tediously define the tables in typical ORM style. Simply
create a class for each table you want to expose in the API, give it's
associated database table, and off you go! The generated API essentially exposes
a completely ... | """Sandman automatically generates a REST API from your existing database,
without you needing to tediously define the tables in typical ORM style. Simply
create a class for each table you want to expose in the API, give it's
associated database table, and off you go! The generated API essentially exposes
a completely ... | apache-2.0 | Python |
41d45d7dce8756658ec3d28540f4a5bce425ff1d | Update instagram regex. | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit | icekit/plugins/instagram_embed/forms.py | icekit/plugins/instagram_embed/forms.py | import re
from django import forms
from fluent_contents.forms import ContentItemForm
class InstagramEmbedAdminForm(ContentItemForm):
def clean_url(self):
"""
Make sure the URL provided matches the instagram URL format.
"""
url = self.cleaned_data['url']
if url:
... | import re
from django import forms
from fluent_contents.forms import ContentItemForm
class InstagramEmbedAdminForm(ContentItemForm):
def clean_url(self):
"""
Make sure the URL provided matches the instagram URL format.
"""
url = self.cleaned_data['url']
if url:
... | mit | Python |
82f66f42d5fee210c3bb2e535d559c5a5dbfccc4 | Clarify message for Unicode argument requrement | orome/crypto-enigma-py | crypto_enigma/utils.py | crypto_enigma/utils.py | #!/usr/bin/env python
# encoding: utf8
# Copyright (C) 2015 by Roy Levien.
# This file is part of crypto-enigma, an Enigma Machine simulator.
# released under the BSD-3 License (see LICENSE.txt).
"""
Description
.. note::
Any additional note.
"""
from __future__ import (absolute_import, print_function, division... | #!/usr/bin/env python
# encoding: utf8
# Copyright (C) 2015 by Roy Levien.
# This file is part of crypto-enigma, an Enigma Machine simulator.
# released under the BSD-3 License (see LICENSE.txt).
"""
Description
.. note::
Any additional note.
"""
from __future__ import (absolute_import, print_function, division... | bsd-3-clause | Python |
0f9bdbcd2c0f927097f534770c56e96244ce28a5 | Add a textarea widget | theatrus/yyafl,miracle2k/yyafl | yyafl/widgets.py | yyafl/widgets.py | from yyafl.util import flatatt, smart_unicode
class Widget(object):
is_hidden = False
def __init__(self, attrs = None):
if attrs is not None:
self.attrs = attrs.copy()
else:
self.attrs = {}
def render(self, name, value, attrs = None):
"""
Returns... | from yyafl.util import flatatt, smart_unicode
class Widget(object):
is_hidden = False
def __init__(self, attrs = None):
if attrs is not None:
self.attrs = attrs.copy()
else:
self.attrs = {}
def render(self, name, value, attrs = None):
"""
Returns ... | bsd-3-clause | Python |
f459fd25b774d59a263edc220b6b0289209d30d9 | Bump version; 0.1.5.dev1 | treasure-data/td-client-python | tdclient/version.py | tdclient/version.py | __version__ = "0.1.5.dev1"
| __version__ = "0.1.5.dev0"
| apache-2.0 | Python |
f99315cda065d5f869114f725a52e7d79189a041 | update sitemap generation for multiple profiles and ref GetRepositoryItem | kevinpdavies/pycsw,kalxas/pycsw,ingenieroariel/pycsw,PublicaMundi/pycsw,bukun/pycsw,benhowell/pycsw,PublicaMundi/pycsw,ocefpaf/pycsw,kalxas/pycsw,tomkralidis/pycsw,geopython/pycsw,ricardogsilva/pycsw,rouault/pycsw,rouault/pycsw,ricardogsilva/pycsw,tomkralidis/pycsw,ckan-fcd/pycsw-fcd,geopython/pycsw,ocefpaf/pycsw,ingen... | sbin/gen_sitemap.py | sbin/gen_sitemap.py | #!/usr/bin/python
# -*- coding: ISO-8859-15 -*-
# =================================================================
#
# $Id$
#
# Authors: Tom Kralidis <tomkralidis@hotmail.com>
#
# Copyright (c) 2011 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and ass... | #!/usr/bin/python
# -*- coding: ISO-8859-15 -*-
# =================================================================
#
# $Id$
#
# Authors: Tom Kralidis <tomkralidis@hotmail.com>
#
# Copyright (c) 2011 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and ass... | mit | Python |
e2d0e830c2b9b8615523d73ee53fb86d98c59c3b | Bump version; 0.12.1.dev0 [ci skip] | treasure-data/td-client-python | tdclient/version.py | tdclient/version.py | __version__ = "0.12.1.dev0"
| __version__ = "0.12.0"
| apache-2.0 | Python |
1179f0afbf3c3a6a306979306f2c4fa4e8669e09 | load example configs for defaults | svub/whatsapp-rest-webservice,svub/whatsapp-rest-webservice | service/quickstart/config.py | service/quickstart/config.py | import ConfigParser
import os
class Config:
defaults = {}
# load example.conf for defaults and overwrite if a real config has been created.
configfiles = ['whatsapp.example.conf', 'service/whatsapp.example.conf', 'whatsapp.conf', 'service/whatsapp.conf']
config=None
@classmethod
def get(self,... | import ConfigParser
import os
class Config:
defaults = {}
configfiles = ['whatsapp.conf', 'service/whatsapp.conf']
config=None
@classmethod
def get(self, section, value):
if not self.config:
# load configuration file once
self.config = ConfigParser.RawConfigParser(... | mit | Python |
70fa93238128440f7098940ebc67d5bb56ae8dcb | make more consistent | RockefellerArchiveCenter/DACSspace | dacsspace/validator.py | dacsspace/validator.py | import json
from jsonschema import Draft202012Validator
class Validator:
"""Validates data from ArchivesSpace."""
def __init__(self, schema_identifier, schema_filepath):
"""Loads and validates the schema from an identifier or filepath.
Args:
schema_identifier (str): a pointer to... | import json
from jsonschema import Draft202012Validator
class Validator:
"""Validates data from ArchivesSpace."""
def __init__(self, schema_identifier, schema_filepath):
"""Loads and validates the schema from an identifier or filepath.
Args:
schema_identifier (str): a pointer to... | mit | Python |
87bc8092a86fb9e6fd10a4a620def2a22c742003 | Simplify code a bit | jpopelka/fabric8-analytics-common,tisnik/fabric8-analytics-common,tisnik/fabric8-analytics-common,jpopelka/fabric8-analytics-common,tisnik/fabric8-analytics-common,jpopelka/fabric8-analytics-common | integration-tests/features/src/utils.py | integration-tests/features/src/utils.py | """Unsorted utility functions used in integration tests."""
import requests
import subprocess
def download_file_from_url(url):
"""Download file from the given URL and do basic check of response."""
assert url
response = requests.get(url)
assert response.status_code == 200
assert response.text is n... | """Unsorted utility functions used in integration tests."""
import requests
import subprocess
def download_file_from_url(url):
"""Download file from the given URL and do basic check of response."""
assert url
response = requests.get(url)
assert response.status_code == 200
assert response.text is n... | apache-2.0 | Python |
c9f294a1c9284975e711dbe0b37519e68606543c | Update ripencc.py | aaronkaplan/intelmq,pkug/intelmq,pkug/intelmq,robcza/intelmq,pkug/intelmq,sch3m4/intelmq,sch3m4/intelmq,sch3m4/intelmq,certtools/intelmq,robcza/intelmq,sch3m4/intelmq,certtools/intelmq,certtools/intelmq,robcza/intelmq,robcza/intelmq,aaronkaplan/intelmq,pkug/intelmq,aaronkaplan/intelmq | intelmq/bots/experts/ripencc/ripencc.py | intelmq/bots/experts/ripencc/ripencc.py | from intelmq.lib.bot import Bot, sys
from intelmq.bots.experts.ripencc.lib import RIPENCC
'''
Reference: https://stat.ripe.net/data/abuse-contact-finder/data.json?resource=1.1.1.1
TODO:
Load RIPE networks prefixes into memory.
Compare each IP with networks prefixes loadad.
If ip matchs, query RIPE
'''
cl... | from intelmq.lib.bot import Bot, sys
from intelmq.bots.experts.ripencc.lib import RIPENCC
'''
Reference: https://stat.ripe.net/data/abuse-contact-finder/data.json?resource=1.1.1.1
FIXME: Create a cache.
'''
class RIPENCCExpertBot(Bot):
def process(self):
event = self.receive_message()
... | agpl-3.0 | Python |
e85fcd553756eab32cedca214c9b8b86ff48f8b8 | Make workload optional when editing vacancies | viaict/viaduct,viaict/viaduct,viaict/viaduct,viaict/viaduct,viaict/viaduct | app/forms/vacancy.py | app/forms/vacancy.py | from flask_wtf import Form
from flask_babel import lazy_gettext as _ # noqa
from wtforms import StringField, SubmitField, TextAreaField, \
DateField, SelectField
from wtforms.validators import InputRequired
class VacancyForm(Form):
title = StringField(_('Title'), validators=[InputRequired(
message=_(... | from flask_wtf import Form
from flask_babel import lazy_gettext as _ # noqa
from wtforms import StringField, SubmitField, TextAreaField, \
DateField, SelectField
from wtforms.validators import InputRequired
class VacancyForm(Form):
title = StringField(_('Title'), validators=[InputRequired(
message=_(... | mit | Python |
c3cb5035889b7a428d0f2d99719765b6e1218e19 | Change initial twiss parameters | lnls-fac/sirius | sirius/LI_V00/accelerator.py | sirius/LI_V00/accelerator.py |
import numpy as _np
import lnls as _lnls
import pyaccel as _pyaccel
from . import lattice as _lattice
_default_cavity_on = False
_default_radiation_on = False
_default_vchamber_on = False
def create_accelerator():
accelerator = _pyaccel.accelerator.Accelerator(
lattice=_lattice.create_lattice(),
... |
import numpy as _np
import lnls as _lnls
import pyaccel as _pyaccel
from . import lattice as _lattice
_default_cavity_on = False
_default_radiation_on = False
_default_vchamber_on = False
def create_accelerator():
accelerator = _pyaccel.accelerator.Accelerator(
lattice=_lattice.create_lattice(),
... | mit | Python |
f94061d2aefa3c8b42bca884d4f98bad34ca2a81 | Load new brief_response_manifests | alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend | app/main/__init__.py | app/main/__init__.py | from flask import Blueprint
from dmcontent.content_loader import ContentLoader
main = Blueprint('main', __name__)
content_loader = ContentLoader('app/content')
content_loader.load_manifest('g-cloud-6', 'services', 'edit_service')
content_loader.load_messages('g-cloud-6', ['dates', 'urls'])
content_loader.load_manife... | from flask import Blueprint
from dmcontent.content_loader import ContentLoader
main = Blueprint('main', __name__)
content_loader = ContentLoader('app/content')
content_loader.load_manifest('g-cloud-6', 'services', 'edit_service')
content_loader.load_messages('g-cloud-6', ['dates', 'urls'])
content_loader.load_manife... | mit | Python |
240c274fb8f5620ffb08ba8a6f06ff377c749fdb | fix import | campagnola/acq4,pbmanis/acq4,acq4/acq4,pbmanis/acq4,acq4/acq4,acq4/acq4,campagnola/acq4,pbmanis/acq4,acq4/acq4,pbmanis/acq4,campagnola/acq4,campagnola/acq4 | acq4/devices/Pipette/__init__.py | acq4/devices/Pipette/__init__.py | from __future__ import print_function
from .pipette import Pipette, PipetteDeviceGui | from __future__ import print_function
from .pipette import Pipette | mit | Python |
9f725a6c4481d65e95c1d3119c96b13cd0543604 | Change the database connection | kinoreel/kinoreel-backend,kinoreel/kinoreel-backend | kinoreel_backend/settings/production.py | kinoreel_backend/settings/production.py | from .base import *
# SECURITY CONFIG
DEBUG = True
ALLOWED_HOSTS = ['api.kino-project.tech']
try:
from .GLOBALS import *
except ImportError or ModuleNotFoundError:
PG_SERVER = os.environ['PG_SERVER']
PG_PORT = os.environ['PG_PORT']
PG_DB = os.environ['PG_DB']
PG_USERNAME = os.environ['PG_USERNA... | from .base import *
# SECURITY CONFIG
DEBUG = True
ALLOWED_HOSTS = ['api.kino-project.tech']
# Database
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
| mit | Python |
e4426ed90b883ffd6526fc9cc1f1011f215a9b38 | Correct env test. | ResidentMario/geoplot | scripts/test-env.py | scripts/test-env.py | """
This script tests whether the current environment works correctly or not.
"""
import sys; sys.path.insert(0, '../')
import geoplot as gplt
from geoplot import crs as gcrs
import geopandas as gpd
# cf. https://github.com/Toblerity/Shapely/issues/435
# Fiona/Shapely/Geopandas test.
cities = gpd.read_file("../data... | """
This script tests whether the current environment works correctly or not.
"""
import sys; sys.path.insert(0, '../')
import geoplot as gplt
from geoplot import crs as gcrs
import geopandas as gpd
# cf. https://github.com/Toblerity/Shapely/issues/435
# Fiona/Shapely/Geopandas test.
cities = gpd.read_file("../data... | mit | Python |
ca496c21989d92b0e1d717faa4e834326188e546 | fix lxml import after P3 migration | ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo | addons/board/controllers/main.py | addons/board/controllers/main.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from lxml import etree as ElementTree
from odoo.http import Controller, route, request
class Board(Controller):
@route('/board/add_to_dashboard', type='json', auth='user')
def add_to_dashboard(self, action_id... | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from xml.etree import ElementTree
from odoo.http import Controller, route, request
class Board(Controller):
@route('/board/add_to_dashboard', type='json', auth='user')
def add_to_dashboard(self, action_id, co... | agpl-3.0 | Python |
2627c2c5ea6fdbff9d9979765deee8740a11c7c9 | Fix module packaging thanks to landscape.io hint | vodkina/GlobaLeaks,vodkina/GlobaLeaks,vodkina/GlobaLeaks,vodkina/GlobaLeaks | backend/globaleaks/handlers/__init__.py | backend/globaleaks/handlers/__init__.py | # -*- encoding: utf-8 -*-
#
# In here you will find all the handlers that are tasked with handling the
# requests specified in the API.
#
# From these handlers we will be instantiating models objects that will take care
# of our business logic and the generation of the output to be sent to GLClient.
#
# In here we are ... | # -*- encoding: utf-8 -*-
#
# In here you will find all the handlers that are tasked with handling the
# requests specified in the API.
#
# From these handlers we will be instantiating models objects that will take care
# of our business logic and the generation of the output to be sent to GLClient.
#
# In here we are ... | agpl-3.0 | Python |
d62dbd6e8068d0982e5b89d734c7ef09c7fd4871 | modify BufferGenerate | MatriQ/BufferGenerate | BufferGenerate.py | BufferGenerate.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2015-05-12 18:35:26
# @Author : Matrixdom (Matrixdom@126.com)
# @Link :
# @Version : 0.1
#coding=utf-8
import re
import os
templateFilePattern=re.compile("^\w+\.tmp$")
#获取所有模板名
def getAllTemplateFiles(path):
result=set()
for parent,dirnames,filenames... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2015-05-12 18:35:26
# @Author : Matrixdom (Matrixdom@126.com)
# @Link :
# @Version : 0.1
#coding=utf-8
import re
import os
templateFilePattern=re.compile("^\w+\.tmp$")
#获取所有模板名
def getAllTemplateFiles(path):
result=set()
for parent,dirnames,filenames... | apache-2.0 | Python |
6728bf1fecef3ac1aea9489e7c74333ad0a3b552 | Comment out audo-discovery of addons | torebutlin/cued_datalogger | datalogger/__main__.py | datalogger/__main__.py | import sys
from PyQt5.QtWidgets import QApplication
from datalogger.bin.workspace import Workspace
from datalogger.analysis_window_testing import AnalysisWindow
def full():
app = 0
app = QApplication(sys.argv)
# Create the window
w = AnalysisWindow()
w.CurrentWorkspace = Workspace()
#w.Curr... | import sys
from PyQt5.QtWidgets import QApplication
from datalogger.bin.workspace import Workspace
from datalogger.analysis_window_testing import AnalysisWindow
def full():
app = 0
app = QApplication(sys.argv)
# Create the window
w = AnalysisWindow()
w.CurrentWorkspace = Workspace()
# Load ... | bsd-3-clause | Python |
e6079bd4059717cc05d8b514d958c0ca4910bd60 | bump version | dsten/datascience,data-8/datascience | datascience/version.py | datascience/version.py | __version__ = '0.5.11'
| __version__ = '0.5.10'
| bsd-3-clause | Python |
2be9eef18567acf8d0ea03849423ee222c6a6242 | Fix forgotten import | Teknologforeningen/tf-info,walliski/tf-info,olkku/tf-info,walliski/tf-info,olkku/tf-info,walliski/tf-info,Teknologforeningen/tf-info,olkku/tf-info,Teknologforeningen/tf-info | apps/dagsen/views.py | apps/dagsen/views.py | from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import HttpResponse
from django.views.decorators.cache import cache_page
from django.conf import settings
import json
import urllib2, urllib
import datetime
# Cache kept for
minutes = 10
cam_url = settings.CAM... | from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import HttpResponse
from django.views.decorators.cache import cache_page
import json
import urllib2, urllib
import datetime
# Cache kept for
minutes = 10
cam_url = settings.CAM_URL
def nextMeal():
now = dat... | bsd-3-clause | Python |
911badb2ababf1f265a755974098a35fd66ddbde | fix rjapi null response | hansroh/aquests,hansroh/aquests | aquests/lib/rjapi.py | aquests/lib/rjapi.py | import requests
import json
from urllib.parse import quote
def tostr (p):
if p:
return "?" + "&".join (["%s=%s" % (k, quote (str (v))) for k, v in p.items ()])
return ""
class API:
API_SERVER = "http://127.0.0.1:5000"
REQ_TIMEOUT = 30.0
def __init__ (self, server, timeout = 30.0):
self.API_SERVER = ser... | import requests
import json
from urllib.parse import quote
def tostr (p):
if p:
return "?" + "&".join (["%s=%s" % (k, quote (str (v))) for k, v in p.items ()])
return ""
class API:
API_SERVER = "http://127.0.0.1:5000"
REQ_TIMEOUT = 30.0
def __init__ (self, server, timeout = 30.0):
self.API_SERVER = ser... | mit | Python |
6d02e8feeac74c40831f1d96c5d251e060fb7ec0 | Add 'post comment' api | MACSIFS/IFS,MACSIFS/IFS,MACSIFS/IFS,MACSIFS/IFS | server/resources.py | server/resources.py | from flask import request
from flask_restful import Resource, Api, abort, reqparse
from .models import db, Comment, Lecture
api = Api()
class CommentListResource(Resource):
def get(self, lecture_id):
db_lecture = Lecture.query.filter(Lecture.id == lecture_id).first()
if not db_lecture:
... | from flask_restful import Resource, Api, abort
from .models import Comment, Lecture
api = Api()
class CommentListResource(Resource):
def get(self, lecture_id):
db_lecture = Lecture.query.filter(Lecture.id == lecture_id).first()
if not db_lecture:
abort(404, message="Lecture {} does n... | mit | Python |
58783b1dc96a7ee3d880a6483d38422d51930268 | drop to pdb on newest pypy | HPI-SWA-Lab/RSqueak,HPI-SWA-Lab/RSqueak,HPI-SWA-Lab/RSqueak,HPI-SWA-Lab/RSqueak | spyvm/plugins/vmdebugging.py | spyvm/plugins/vmdebugging.py | import os
from spyvm import model, error
from spyvm.plugins.plugin import Plugin
from spyvm.util.system import IS_WINDOWS
DebuggingPlugin = Plugin()
DebuggingPlugin.userdata['stop_ui'] = False
def stop_ui_process():
DebuggingPlugin.userdata['stop_ui'] = True
# @DebuggingPlugin.expose_primitive(unwrap_spec=[obje... | import os
from spyvm import model, error
from spyvm.plugins.plugin import Plugin
from spyvm.util.system import IS_WINDOWS
DebuggingPlugin = Plugin()
DebuggingPlugin.userdata['stop_ui'] = False
def stop_ui_process():
DebuggingPlugin.userdata['stop_ui'] = True
# @DebuggingPlugin.expose_primitive(unwrap_spec=[obje... | bsd-3-clause | Python |
f2aabd3bdcd522769b28b5e160677d8a96ca6bb8 | fix https://github.com/PyThaiNLP/pythainlp/issues/155 | franziz/artagger | artagger/__init__.py | artagger/__init__.py | # -*- coding: utf-8 -*-
from .Utility.Utils import getWordTag, readDictionary
from .InitialTagger.InitialTagger import initializeSentence
from .SCRDRlearner.SCRDRTree import SCRDRTree
from .SCRDRlearner.Object import FWObject
import os
import copy
import pickle
import codecs
class Word:
def __init__(self, **kwargs... | # -*- coding: utf-8 -*-
from .Utility.Utils import getWordTag, readDictionary
from .InitialTagger.InitialTagger import initializeSentence
from .SCRDRlearner.SCRDRTree import SCRDRTree
from .SCRDRlearner.Object import FWObject
import os
import copy
import pickle
import codecs
class Word:
def __init__(self, **kwargs... | apache-2.0 | Python |
605e362351bf3839ab6c15a67c29c339c6509d43 | increase version | pedvide/simetuc | simetuc/__init__.py | simetuc/__init__.py | # -*- coding: utf-8 -*-
"""
Created on Mon Oct 31 14:27:37 2016
@author: Pedro
"""
VERSION = '1.6.4'
DESCRIPTION = 'simetuc: Simulating Energy Transfer and Upconversion'
| # -*- coding: utf-8 -*-
"""
Created on Mon Oct 31 14:27:37 2016
@author: Pedro
"""
DESCRIPTION = 'simetuc: Simulating Energy Transfer and Upconversion'
| mit | Python |
35685f77d9590c7208877934f5e29851efac1277 | Fix incomplete docstring | privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea | privacyidea/lib/utils/compare.py | privacyidea/lib/utils/compare.py | # -*- coding: utf-8 -*-
#
# 2019-07-02 Friedrich Weber <friedrich.weber@netknights.it>
# Add a central module for comparing two values
#
# This code is free software; you can redistribute it and/or
# modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
# License as published by the Free Softw... | # -*- coding: utf-8 -*-
#
# 2019-07-02 Friedrich Weber <friedrich.weber@netknights.it>
# Add a central module for comparing two values
#
# This code is free software; you can redistribute it and/or
# modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
# License as published by the Free Softw... | agpl-3.0 | Python |
d5aba53b285587f2d13ba3e5372ed699354c9135 | Add red_check | jhanley634/testing-tools,jhanley634/testing-tools,jhanley634/testing-tools,jhanley634/testing-tools,jhanley634/testing-tools,jhanley634/testing-tools,jhanley634/testing-tools | problem/color/find_color_name.py | problem/color/find_color_name.py | #! /usr/bin/env python
from functools import lru_cache
import colormath as cm
import colormath.color_objects as co
import seaborn as sns
assert 949 == len(sns.xkcd_rgb) # e.g. 'very light green': '#d1ffbd'
@lru_cache()
def get_name_to_srgb():
keys = sns.xkcd_rgb.keys()
return dict(zip(keys, sns.xkcd_palet... | #! /usr/bin/env python
from functools import lru_cache
import colormath as cm
import colormath.color_objects as co
import seaborn as sns
assert 949 == len(sns.xkcd_rgb) # e.g. 'very light green': '#d1ffbd'
@lru_cache()
def get_name_to_srgb():
keys = sns.xkcd_rgb.keys()
return dict(zip(keys, sns.xkcd_palet... | mit | Python |
a50c93a5166dc341640fad71fcb62466608d2494 | fix potential exceptions | guiniol/py3status,alexoneill/py3status,ultrabug/py3status,tobes/py3status,guiniol/py3status,ultrabug/py3status,valdur55/py3status,valdur55/py3status,tobes/py3status,docwalter/py3status,vvoland/py3status,valdur55/py3status,Andrwe/py3status,ultrabug/py3status,Andrwe/py3status | py3status/modules/taskwarrior.py | py3status/modules/taskwarrior.py | # -*- coding: utf-8 -*-
"""
Display tasks currently running in taskwarrior.
Configuration parameters:
cache_timeout: refresh interval for this module (default 5)
format: display format for this module (default '{task}')
Format placeholders:
{task} active tasks
Requires
task: https://taskwarrior.org/d... | # -*- coding: utf-8 -*-
"""
Display tasks currently running in taskwarrior.
Configuration parameters:
cache_timeout: refresh interval for this module (default 5)
format: display format for this module (default '{task}')
Format placeholders:
{task} active tasks
Requires
task: https://taskwarrior.org/d... | bsd-3-clause | Python |
4a09ef767d28671c567fc5ac657e37ccf124d13b | change ssl make with shell | wdongxv/DDDProxy,wdongxv/DDDProxy,wdongxv/DDDProxy,wdongxv/DDDProxy | DDDProxyConfig.py | DDDProxyConfig.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on 2015年1月11日
@author: dx.wang
'''
import os
import ssl
import threading
from os.path import dirname
localServerProxyListenPort = 8080
localServerAdminListenPort = 8081
localServerListenIp = "0.0.0.0"
remoteServerHost = None
remoteServerListenPort = 8083
r... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on 2015年1月11日
@author: dx.wang
'''
import os
import ssl
import threading
import random
from os.path import dirname
from OpenSSL import crypto
localServerProxyListenPort = 8080
localServerAdminListenPort = 8081
localServerListenIp = "0.0.0.0"
remoteServerHost... | apache-2.0 | Python |
f682351e08d925293e4a428afc8a379a45c8d2ac | change the boxplot script. now supports grouping | Buchhold/QLever,Buchhold/QLever,Buchhold/QLever,Buchhold/QLever,Buchhold/QLever | misc/create_boxplot_from_compare_out.py | misc/create_boxplot_from_compare_out.py | import argparse
import seaborn as sns
import pandas as pd
import numpy as np
__author__ = 'buchholb'
parser = argparse.ArgumentParser()
parser.add_argument('--times-file',
type=str,
help='Output of the compare_performance.py script',
required=True)
def g... | import argparse
import seaborn as sns
import pandas as pd
__author__ = 'buchholb'
parser = argparse.ArgumentParser()
parser.add_argument('--times-file',
type=str,
help='Output of the compare_performance.py script',
required=True)
def get_data_frame_from_... | apache-2.0 | Python |
a5faeb16a599b4260f32741846607dd05f10bc53 | Add ability to specify which settings are used via `export PRODUCTION=0' | django-settings/django-settings | myproject/myproject/project_settings.py | myproject/myproject/project_settings.py | # Project Settings - Settings that don't exist in settings.py that you want to
# add (e.g. USE_THOUSAND_SEPARATOR, GRAPPELLI_ADMIN_TITLE, CELERYBEAT_SCHEDULER,
# CELERYD_PREFETCH_MULTIPLIER, etc.)
#USE_THOUSAND_SEPARATOR = True
#GRAPPELLI_ADMIN_TITLE = ''
#import djcelery
#djcelery.setup_loader()
#CELERYBEAT_SCHEDUL... | # Project Settings - Settings that don't exist in settings.py that you want to
# add (e.g. USE_THOUSAND_SEPARATOR, GRAPPELLI_ADMIN_TITLE, CELERYBEAT_SCHEDULER,
# CELERYD_PREFETCH_MULTIPLIER, etc.)
#USE_THOUSAND_SEPARATOR = True
#GRAPPELLI_ADMIN_TITLE = ''
#import djcelery
#djcelery.setup_loader()
#CELERYBEAT_SCHEDUL... | unlicense | Python |
69af087e7115ff8443cfccb6979cdbeea95345b9 | change from manual toggling to automatic toggling | bardia-heydarinejad/Graph,bardia-heydarinejad/Graph,bardia73/Graph,bardia73/Graph | Graph/settings.py | Graph/settings.py | """
Django settings for Graph project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
impo... | """
Django settings for Graph project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
impo... | mit | Python |
ca2026bdf4d9b148115a236979c85ef761c85bc8 | fix logic in test_gf_coverage script | googlefonts/gftools,googlefonts/gftools | test_gf_coverage.py | test_gf_coverage.py | #!/usr/bin/env python2
# Copyright 2016 The Fontbakery Authors
# Copyright 2017 The Google Fonts Tools Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lic... | #!/usr/bin/env python2
# Copyright 2016 The Fontbakery Authors
# Copyright 2017 The Google Fonts Tools Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lic... | apache-2.0 | Python |
7cbad2ecab781391758ed7391612644d7a695652 | make things derive from SimError | f-prettyland/angr,angr/angr,chubbymaggie/simuvex,iamahuman/angr,f-prettyland/angr,chubbymaggie/angr,chubbymaggie/angr,axt/angr,chubbymaggie/simuvex,angr/angr,iamahuman/angr,schieb/angr,schieb/angr,iamahuman/angr,tyb0807/angr,f-prettyland/angr,tyb0807/angr,schieb/angr,axt/angr,tyb0807/angr,angr/angr,angr/simuvex,axt/ang... | simuvex/s_errors.py | simuvex/s_errors.py | #!/usr/bin/env python
class SimError(Exception):
pass
class SimIRSBError(SimError):
pass
class SimModeError(SimError):
pass
class SimProcedureError(SimError):
pass
class SimMergeError(SimError):
pass
class SimValueError(SimError):
pass
class SimUnsatError(SimValueError):
pass
class SimMemoryError(SimErro... | #!/usr/bin/env python
class SimError(Exception):
pass
class SimIRSBError(SimError):
pass
class SimModeError(SimError):
pass
class SimProcedureError(Exception):
pass
class SimMergeError(Exception):
pass
class SimValueError(Exception):
pass
class SimUnsatError(SimValueError):
pass
class SimMemoryError(SimE... | bsd-2-clause | Python |
51f107f3e218b42553340ca59b55386c39787a33 | Fix required package intent_service | forslund/mycroft-core,MycroftAI/mycroft-core,Dark5ide/mycroft-core,MycroftAI/mycroft-core,forslund/mycroft-core,aatchison/mycroft-core,linuxipho/mycroft-core,Dark5ide/mycroft-core,aatchison/mycroft-core,linuxipho/mycroft-core | skills-sdk-setup.py | skills-sdk-setup.py | from setuptools import setup
from mycroft.util.setup_base import get_version, place_manifest
__author__ = 'seanfitz'
place_manifest("skills-sdk-MANIFEST.in")
setup(
name="mycroft-skills-sdk",
version=get_version(),
install_requires=[
"mustache==0.1.4",
"configobj==5.0.6",
"pyee==... | from setuptools import setup
from mycroft.util.setup_base import get_version, place_manifest
__author__ = 'seanfitz'
place_manifest("skills-sdk-MANIFEST.in")
setup(
name="mycroft-skills-sdk",
version=get_version(),
install_requires=[
"mustache==0.1.4",
"configobj==5.0.6",
"pyee==... | apache-2.0 | Python |
4c16bd7c11aabb96e6df0ebbfcf600f92950e4d5 | fix get_indices | theislab/scvelo | tests/test_basic.py | tests/test_basic.py | from scvelo.tools.utils import prod_sum_obs, prod_sum_var, norm
import numpy as np
import scvelo as scv
def test_einsum():
adata = scv.datasets.toy_data(n_obs=100)
scv.pp.recipe_velocity(adata, n_top_genes=300)
Ms, Mu = adata.layers['Ms'], adata.layers['Mu']
assert np.allclose(prod_sum_obs(Ms, Mu), np... | from scvelo.tools.utils import prod_sum_obs, prod_sum_var, norm
import numpy as np
import scvelo as scv
def test_einsum():
adata = scv.datasets.toy_data(n_obs=100)
scv.pp.recipe_velocity(adata)
Ms, Mu = adata.layers['Ms'], adata.layers['Mu']
assert np.allclose(prod_sum_obs(Ms, Mu), np.sum(Ms * Mu, 0))... | bsd-3-clause | Python |
204c771c77b03ae1829ba09c6382d19c13591c41 | move rest result for good | xflr6/graphviz | tests/test_files.py | tests/test_files.py | import os
import graphviz
def test_save_source_from_files(tmp_path):
dot = graphviz.Digraph(directory=tmp_path)
dot.edge('hello', 'world')
dot.render()
old_stat = os.stat(dot.filepath)
source = graphviz.Source.from_file(dot.filepath)
source.save()
assert os.stat(dot.filepath).st_mtime =... | import os
import graphviz
def test_save_source_from_files(tmp_path):
dot = graphviz.Digraph()
dot.edge('hello', 'world')
dot.render()
old_stat = os.stat(dot.filepath)
source = graphviz.Source.from_file(dot.filepath)
source.save()
assert os.stat(dot.filepath).st_mtime == old_stat.st_mtim... | mit | Python |
21f1a34989c6170abffd2cae03188b9147a1462d | Make get_updates test less strict | davande/hackernews-top,rylans/hackernews-top | tests/test_hnapi.py | tests/test_hnapi.py | """
Tests
"""
from __future__ import unicode_literals
import unittest
from hnapi.connectors.api_connector import ApiConnector
class HnapiTest(unittest.TestCase):
"""
Test hnapi
"""
def test_get_item_by(self):
"""
Test item retrieval and 'by' field
"""
con = ApiConnecto... | """
Tests
"""
from __future__ import unicode_literals
import unittest
from hnapi.connectors.api_connector import ApiConnector
class HnapiTest(unittest.TestCase):
"""
Test hnapi
"""
def test_get_item_by(self):
"""
Test item retrieval and 'by' field
"""
con = ApiConnecto... | apache-2.0 | Python |
b026917c58d98bf70df452a7e04252af010ca441 | Add test for dashboard change quantity form | itbabu/saleor,tfroehlich82/saleor,maferelo/saleor,UITools/saleor,car3oon/saleor,UITools/saleor,HyperManTT/ECommerceSaleor,mociepka/saleor,KenMutemi/saleor,UITools/saleor,mociepka/saleor,itbabu/saleor,UITools/saleor,HyperManTT/ECommerceSaleor,maferelo/saleor,UITools/saleor,KenMutemi/saleor,maferelo/saleor,car3oon/saleor... | tests/test_order.py | tests/test_order.py | from prices import Price
from saleor.cart.models import Cart
from saleor.dashboard.order.forms import ChangeQuantityForm
from saleor.order import models
def test_total_property():
order = models.Order(total_net=20, total_tax=5)
assert order.total.gross == 25
assert order.total.tax == 5
assert order.t... | from prices import Price
from saleor.cart.models import Cart
from saleor.order import models
def test_total_property():
order = models.Order(total_net=20, total_tax=5)
assert order.total.gross == 25
assert order.total.tax == 5
assert order.total.net == 20
def test_total_property_empty_value():
... | bsd-3-clause | Python |
2db8c4874e10db7c78f4255df45b14a9484990ec | Update social_auth/urls.py | duoduo369/django-social-auth,vuchau/django-social-auth,adw0rd/django-social-auth,vuchau/django-social-auth,VishvajitP/django-social-auth,beswarm/django-social-auth,dongguangming/django-social-auth,gustavoam/django-social-auth,WW-Digital/django-social-auth,caktus/django-social-auth,michael-borisov/django-social-auth,sk7... | social_auth/urls.py | social_auth/urls.py | """URLs module"""
try:
from django.conf.urls import patterns, url
except ImportError:
# for Django version less then 1.4
from django.conf.urls.defaults import patterns, url
from social_auth.views import auth, complete, disconnect
urlpatterns = patterns('',
# authentication
url(r'^login/(?P... | """URLs module"""
try:
from django.conf.urls import patterns, url
except ImportError:
# for Django version less then 1.4
from django.conf.urls.default import patterns, url
from social_auth.views import auth, complete, disconnect
urlpatterns = patterns('',
# authentication
url(r'^login/(?P<... | bsd-3-clause | Python |
72add1034c9f085b73ec45eff5f3cb686e0322cb | update phylo test | AndersenLab/vcf-toolbox,AndersenLab/vcf-kit,AndersenLab/vcf-kit,AndersenLab/vcf-toolbox,AndersenLab/vcf-toolbox,AndersenLab/vcf-kit | tests/test_phylo.py | tests/test_phylo.py | from vcfkit import phylo
from subprocess import Popen, PIPE
import hashlib
from tests.test_utilities import Capturing
def test_phylo_fasta():
with Capturing() as out:
phylo.main(["phylo", "fasta", "test_data/test.vcf.gz"])
h = hashlib.sha224(str(out).strip()).hexdigest()
assert h == "3e13b81be200e... | from vcfkit import phylo
from subprocess import Popen, PIPE
import hashlib
from tests.test_utilities import Capturing
def test_phylo_fasta():
with Capturing() as out:
phylo.main(["phylo", "fasta", "test_data/test.vcf.gz"])
h = hashlib.sha224(str(out)).hexdigest()
assert h == "3e13b81be200e1128d6ee... | mit | Python |
794596fd6f55806eecca1c54e155533590108eee | Rename misleading parameter name: UnicodeDictReader should have the same interface as csv.DictReader | CivicVision/datahub,nathanhilbert/FPA_Core,USStateDept/FPA_Core,johnjohndoe/spendb,openspending/spendb,spendb/spendb,CivicVision/datahub,pudo/spendb,CivicVision/datahub,nathanhilbert/FPA_Core,pudo/spendb,openspending/spendb,johnjohndoe/spendb,spendb/spendb,nathanhilbert/FPA_Core,openspending/spendb,johnjohndoe/spendb,s... | openspending/lib/unicode_dict_reader.py | openspending/lib/unicode_dict_reader.py | # work around python2's csv.py's difficulty with utf8
# partly cribbed from http://stackoverflow.com/questions/5478659/python-module-like-csv-dictreader-with-full-utf8-support
import csv
class EmptyCSVError(Exception):
pass
class UnicodeDictReader(object):
def __init__(self, fp, encoding='utf8', **kwargs):
... | # work around python2's csv.py's difficulty with utf8
# partly cribbed from http://stackoverflow.com/questions/5478659/python-module-like-csv-dictreader-with-full-utf8-support
import csv
class EmptyCSVError(Exception):
pass
class UnicodeDictReader(object):
def __init__(self, file_or_str, encoding='utf8', **... | agpl-3.0 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.